1 /* Code generated from eC source file: pass15.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 #include <sys/types.h>
41 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
47 #define arch_PointerSize sizeof(void *)
48 #define structSize_Instance (_64BIT ? 24 : 12)
49 #define structSize_Module (_64BIT ? 560 : 300)
50 #define structSize_NamedLink64 (_64BIT ? 32 : 24)
52 struct __ecereNameSpace__ecere__com__Instance;
54 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
56 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
58 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
60 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
62 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
64 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
66 struct __ecereNameSpace__ecere__sys__BTNode;
68 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
70 struct __ecereNameSpace__ecere__sys__BinaryTree
72 struct __ecereNameSpace__ecere__sys__BTNode * root;
74 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
75 void (* FreeKey)(void * key);
76 } __attribute__ ((gcc_struct));
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
80 struct __ecereNameSpace__ecere__sys__OldList
87 } __attribute__ ((gcc_struct));
89 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
91 struct __ecereNameSpace__ecere__com__Method
94 struct __ecereNameSpace__ecere__com__Method * parent;
95 struct __ecereNameSpace__ecere__com__Method * left;
96 struct __ecereNameSpace__ecere__com__Method * right;
101 struct __ecereNameSpace__ecere__com__Class * _class;
103 const char * dataTypeString;
104 struct Type * dataType;
106 } __attribute__ ((gcc_struct));
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
110 struct __ecereNameSpace__ecere__com__Property
112 struct __ecereNameSpace__ecere__com__Property * prev;
113 struct __ecereNameSpace__ecere__com__Property * next;
115 unsigned int isProperty;
118 struct __ecereNameSpace__ecere__com__Class * _class;
119 const char * dataTypeString;
120 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
121 struct Type * dataType;
122 void (* Set)(void * , int);
123 int (* Get)(void * );
124 unsigned int (* IsSet)(void * );
128 unsigned int conversion;
129 unsigned int watcherOffset;
130 const char * category;
131 unsigned int compiled;
132 unsigned int selfWatchable;
133 unsigned int isWatchable;
134 } __attribute__ ((gcc_struct));
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
144 } __attribute__ ((gcc_struct));
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
150 struct CodePosition start;
151 struct CodePosition end;
152 } __attribute__ ((gcc_struct));
154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
158 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
167 struct Attrib * attr;
168 } __attribute__ ((gcc_struct)) __anon1;
169 } __attribute__ ((gcc_struct));
171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
173 struct ClassDefinition
175 struct ClassDefinition * prev;
176 struct ClassDefinition * next;
178 struct Specifier * _class;
179 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
180 struct __ecereNameSpace__ecere__sys__OldList * definitions;
181 struct Symbol * symbol;
182 struct Location blockStart;
183 struct Location nameLoc;
186 unsigned int deleteWatchable;
187 } __attribute__ ((gcc_struct));
189 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
193 struct Context * parent;
194 struct __ecereNameSpace__ecere__sys__BinaryTree types;
195 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
196 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
197 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
200 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
201 struct ClassDefinition * classDef;
202 unsigned int templateTypesOnly;
203 unsigned int hasNameSpace;
204 } __attribute__ ((gcc_struct));
206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
210 struct Instantiation * prev;
211 struct Instantiation * next;
213 struct Specifier * _class;
214 struct Expression * exp;
215 struct __ecereNameSpace__ecere__sys__OldList * members;
216 struct Symbol * symbol;
217 unsigned int fullSet;
218 unsigned int isConstant;
219 unsigned char * data;
220 struct Location nameLoc;
221 struct Location insideLoc;
223 } __attribute__ ((gcc_struct));
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
229 struct Declaration * prev;
230 struct Declaration * next;
237 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
238 struct __ecereNameSpace__ecere__sys__OldList * declarators;
239 } __attribute__ ((gcc_struct)) __anon1;
240 struct Instantiation * inst;
243 struct Identifier * id;
244 struct Expression * exp;
245 } __attribute__ ((gcc_struct)) __anon2;
246 } __attribute__ ((gcc_struct)) __anon1;
247 struct Specifier * extStorage;
248 struct Symbol * symbol;
250 } __attribute__ ((gcc_struct));
252 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
256 struct Statement * prev;
257 struct Statement * next;
262 struct __ecereNameSpace__ecere__sys__OldList * expressions;
265 struct Identifier * id;
266 struct Statement * stmt;
267 } __attribute__ ((gcc_struct)) labeled;
270 struct Expression * exp;
271 struct Statement * stmt;
272 } __attribute__ ((gcc_struct)) caseStmt;
275 struct __ecereNameSpace__ecere__sys__OldList * declarations;
276 struct __ecereNameSpace__ecere__sys__OldList * statements;
277 struct Context * context;
278 unsigned int isSwitch;
279 } __attribute__ ((gcc_struct)) compound;
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 struct Statement * elseStmt;
285 } __attribute__ ((gcc_struct)) ifStmt;
288 struct __ecereNameSpace__ecere__sys__OldList * exp;
289 struct Statement * stmt;
290 } __attribute__ ((gcc_struct)) switchStmt;
293 struct __ecereNameSpace__ecere__sys__OldList * exp;
294 struct Statement * stmt;
295 } __attribute__ ((gcc_struct)) whileStmt;
298 struct __ecereNameSpace__ecere__sys__OldList * exp;
299 struct Statement * stmt;
300 } __attribute__ ((gcc_struct)) doWhile;
303 struct Statement * init;
304 struct Statement * check;
305 struct __ecereNameSpace__ecere__sys__OldList * increment;
306 struct Statement * stmt;
307 } __attribute__ ((gcc_struct)) forStmt;
310 struct Identifier * id;
311 } __attribute__ ((gcc_struct)) gotoStmt;
314 struct Specifier * spec;
316 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
317 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
318 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
319 } __attribute__ ((gcc_struct)) asmStmt;
322 struct Expression * watcher;
323 struct Expression * object;
324 struct __ecereNameSpace__ecere__sys__OldList * watches;
325 } __attribute__ ((gcc_struct)) _watch;
328 struct Identifier * id;
329 struct __ecereNameSpace__ecere__sys__OldList * exp;
330 struct __ecereNameSpace__ecere__sys__OldList * filter;
331 struct Statement * stmt;
332 } __attribute__ ((gcc_struct)) forEachStmt;
333 struct Declaration * decl;
334 } __attribute__ ((gcc_struct)) __anon1;
335 } __attribute__ ((gcc_struct));
337 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
341 struct TypeName * prev;
342 struct TypeName * next;
344 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
345 struct Declarator * declarator;
347 struct Expression * bitCount;
348 } __attribute__ ((gcc_struct));
350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
354 struct Initializer * prev;
355 struct Initializer * next;
360 struct Expression * exp;
361 struct __ecereNameSpace__ecere__sys__OldList * list;
362 } __attribute__ ((gcc_struct)) __anon1;
363 unsigned int isConstant;
364 struct Identifier * id;
365 } __attribute__ ((gcc_struct));
367 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
369 struct __ecereNameSpace__ecere__com__DataValue
384 } __attribute__ ((gcc_struct)) __anon1;
385 } __attribute__ ((gcc_struct));
387 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
391 struct Expression * prev;
392 struct Expression * next;
400 struct Identifier * identifier;
401 } __attribute__ ((gcc_struct)) __anon1;
402 struct Statement * compound;
403 struct Instantiation * instance;
407 unsigned int intlString;
408 } __attribute__ ((gcc_struct)) __anon2;
409 struct __ecereNameSpace__ecere__sys__OldList * list;
412 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
413 struct Declarator * decl;
414 } __attribute__ ((gcc_struct)) _classExp;
417 struct Identifier * id;
418 } __attribute__ ((gcc_struct)) classData;
421 struct Expression * exp;
422 struct __ecereNameSpace__ecere__sys__OldList * arguments;
423 struct Location argLoc;
424 } __attribute__ ((gcc_struct)) call;
427 struct Expression * exp;
428 struct __ecereNameSpace__ecere__sys__OldList * index;
429 } __attribute__ ((gcc_struct)) index;
432 struct Expression * exp;
433 struct Identifier * member;
435 unsigned int thisPtr;
436 } __attribute__ ((gcc_struct)) member;
440 struct Expression * exp1;
441 struct Expression * exp2;
442 } __attribute__ ((gcc_struct)) op;
443 struct TypeName * typeName;
444 struct Specifier * _class;
447 struct TypeName * typeName;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) cast;
452 struct Expression * cond;
453 struct __ecereNameSpace__ecere__sys__OldList * exp;
454 struct Expression * elseExp;
455 } __attribute__ ((gcc_struct)) cond;
458 struct TypeName * typeName;
459 struct Expression * size;
460 } __attribute__ ((gcc_struct)) _new;
463 struct TypeName * typeName;
464 struct Expression * size;
465 struct Expression * exp;
466 } __attribute__ ((gcc_struct)) _renew;
470 struct Identifier * id;
471 } __attribute__ ((gcc_struct)) db;
474 struct Expression * ds;
475 struct Expression * name;
476 } __attribute__ ((gcc_struct)) dbopen;
479 struct TypeName * typeName;
480 struct Initializer * initializer;
481 } __attribute__ ((gcc_struct)) initializer;
484 struct Expression * exp;
485 struct TypeName * typeName;
486 } __attribute__ ((gcc_struct)) vaArg;
487 } __attribute__ ((gcc_struct)) __anon1;
488 unsigned int debugValue;
489 struct __ecereNameSpace__ecere__com__DataValue val;
491 unsigned int hasAddress;
492 struct Type * expType;
493 struct Type * destType;
496 unsigned int byReference;
497 unsigned int isConstant;
498 unsigned int addedThis;
499 unsigned int needCast;
500 unsigned int thisPtr;
501 unsigned int opDestType;
502 unsigned int needTemplateCast;
503 } __attribute__ ((gcc_struct));
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
507 struct TemplateDatatype
509 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
510 struct Declarator * decl;
511 } __attribute__ ((gcc_struct));
513 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
515 struct TemplateArgument;
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
519 struct TemplateParameter
521 struct TemplateParameter * prev;
522 struct TemplateParameter * next;
525 struct Identifier * identifier;
528 struct TemplateDatatype * dataType;
530 } __attribute__ ((gcc_struct)) __anon1;
531 struct TemplateArgument * defaultArgument;
532 const char * dataTypeString;
533 struct Type * baseType;
534 } __attribute__ ((gcc_struct));
536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
540 struct Specifier * prev;
541 struct Specifier * next;
549 struct ExtDecl * extDecl;
551 struct Symbol * symbol;
552 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
553 } __attribute__ ((gcc_struct)) __anon1;
556 struct Identifier * id;
557 struct __ecereNameSpace__ecere__sys__OldList * list;
558 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
559 struct __ecereNameSpace__ecere__sys__OldList * definitions;
560 unsigned int addNameSpace;
561 struct Context * ctx;
562 struct ExtDecl * extDeclStruct;
563 } __attribute__ ((gcc_struct)) __anon2;
564 struct Expression * expression;
565 struct Specifier * _class;
566 struct TemplateParameter * templateParameter;
567 } __attribute__ ((gcc_struct)) __anon1;
568 } __attribute__ ((gcc_struct));
570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
574 struct Identifier * prev;
575 struct Identifier * next;
577 struct Symbol * classSym;
578 struct Specifier * _class;
580 struct Identifier * badID;
581 } __attribute__ ((gcc_struct));
583 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
591 struct Declarator * prev;
592 struct Declarator * next;
595 struct Symbol * symbol;
596 struct Declarator * declarator;
599 struct Identifier * identifier;
602 struct Expression * exp;
603 struct Expression * posExp;
604 struct Attrib * attrib;
605 } __attribute__ ((gcc_struct)) structDecl;
608 struct Expression * exp;
609 struct Specifier * enumClass;
610 } __attribute__ ((gcc_struct)) array;
613 struct __ecereNameSpace__ecere__sys__OldList * parameters;
614 } __attribute__ ((gcc_struct)) function;
617 struct Pointer * pointer;
618 } __attribute__ ((gcc_struct)) pointer;
621 struct ExtDecl * extended;
622 } __attribute__ ((gcc_struct)) extended;
623 } __attribute__ ((gcc_struct)) __anon1;
624 } __attribute__ ((gcc_struct));
626 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
628 struct FunctionDefinition
630 struct FunctionDefinition * prev;
631 struct FunctionDefinition * next;
633 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
634 struct Declarator * declarator;
635 struct __ecereNameSpace__ecere__sys__OldList * declarations;
636 struct Statement * body;
637 struct __ecereNameSpace__ecere__com__Class * _class;
638 struct __ecereNameSpace__ecere__sys__OldList attached;
641 struct Symbol * propSet;
643 unsigned int propertyNoThis;
644 } __attribute__ ((gcc_struct));
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
654 struct External * prev;
655 struct External * next;
658 struct Symbol * symbol;
661 struct FunctionDefinition * function;
662 struct ClassDefinition * _class;
663 struct Declaration * declaration;
665 struct Identifier * id;
666 struct DBTableDef * table;
667 } __attribute__ ((gcc_struct)) __anon1;
669 } __attribute__ ((gcc_struct));
671 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
675 struct ModuleImport * prev;
676 struct ModuleImport * next;
678 struct __ecereNameSpace__ecere__sys__OldList classes;
679 struct __ecereNameSpace__ecere__sys__OldList functions;
682 } __attribute__ ((gcc_struct));
684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
688 struct ClassImport * prev;
689 struct ClassImport * next;
691 struct __ecereNameSpace__ecere__sys__OldList methods;
692 struct __ecereNameSpace__ecere__sys__OldList properties;
695 } __attribute__ ((gcc_struct));
697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
702 struct Symbol * parent;
703 struct Symbol * left;
704 struct Symbol * right;
709 struct __ecereNameSpace__ecere__com__Method * method;
710 struct __ecereNameSpace__ecere__com__Property * _property;
711 struct __ecereNameSpace__ecere__com__Class * registered;
712 } __attribute__ ((gcc_struct)) __anon1;
719 struct External * pointerExternal;
720 struct External * structExternal;
721 } __attribute__ ((gcc_struct)) __anon1;
724 struct External * externalGet;
725 struct External * externalSet;
726 struct External * externalPtr;
727 struct External * externalIsSet;
728 } __attribute__ ((gcc_struct)) __anon2;
731 struct External * methodExternal;
732 struct External * methodCodeExternal;
733 } __attribute__ ((gcc_struct)) __anon3;
734 } __attribute__ ((gcc_struct)) __anon2;
735 unsigned int imported;
736 unsigned int declaredStructSym;
737 struct __ecereNameSpace__ecere__com__Class * _class;
738 unsigned int declaredStruct;
739 unsigned int needConstructor;
740 unsigned int needDestructor;
741 char * constructorName;
744 char * destructorName;
745 struct ModuleImport * module;
746 struct ClassImport * _import;
747 struct Location nameLoc;
748 unsigned int isParam;
749 unsigned int isRemote;
750 unsigned int isStruct;
751 unsigned int fireWatchersDone;
753 unsigned int classData;
754 unsigned int isStatic;
756 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
757 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
758 struct Context * ctx;
760 struct Expression * propCategory;
761 } __attribute__ ((gcc_struct));
763 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
772 struct Symbol * _class;
775 struct __ecereNameSpace__ecere__sys__OldList members;
777 } __attribute__ ((gcc_struct)) __anon1;
780 struct Type * returnType;
781 struct __ecereNameSpace__ecere__sys__OldList params;
782 struct Symbol * thisClass;
783 unsigned int staticMethod;
784 struct TemplateParameter * thisClassTemplate;
785 } __attribute__ ((gcc_struct)) __anon2;
788 struct __ecereNameSpace__ecere__com__Method * method;
789 struct __ecereNameSpace__ecere__com__Class * methodClass;
790 struct __ecereNameSpace__ecere__com__Class * usedClass;
791 } __attribute__ ((gcc_struct)) __anon3;
794 struct Type * arrayType;
796 struct Expression * arraySizeExp;
797 unsigned int freeExp;
798 struct Symbol * enumClass;
799 } __attribute__ ((gcc_struct)) __anon4;
801 struct TemplateParameter * templateParameter;
802 } __attribute__ ((gcc_struct)) __anon1;
812 unsigned int isSigned : 1;
813 unsigned int constant : 1;
814 unsigned int truth : 1;
815 unsigned int byReference : 1;
816 unsigned int extraParam : 1;
817 unsigned int directClassAccess : 1;
818 unsigned int computing : 1;
819 unsigned int keepCast : 1;
820 unsigned int passAsTemplate : 1;
821 unsigned int dllExport : 1;
822 unsigned int attrStdcall : 1;
823 unsigned int declaredWithStruct : 1;
824 unsigned int typedByReference : 1;
825 unsigned int casted : 1;
826 } __attribute__ ((gcc_struct));
828 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
830 struct __ecereNameSpace__ecere__com__Class
832 struct __ecereNameSpace__ecere__com__Class * prev;
833 struct __ecereNameSpace__ecere__com__Class * next;
839 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
840 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
843 struct __ecereNameSpace__ecere__com__Class * base;
844 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
845 struct __ecereNameSpace__ecere__sys__BinaryTree members;
846 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
847 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
848 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
849 struct __ecereNameSpace__ecere__sys__OldList derivatives;
853 struct __ecereNameSpace__ecere__com__Instance * module;
854 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
855 const char * dataTypeString;
856 struct Type * dataType;
858 int defaultAlignment;
859 void (* Initialize)();
861 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
862 const char * designerClass;
863 unsigned int noExpansion;
864 const char * defaultProperty;
865 unsigned int comRedefinition;
868 unsigned int internalDecl;
870 unsigned int computeSize;
872 int destructionWatchOffset;
874 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
875 int inheritanceAccess;
876 const char * fullName;
878 struct __ecereNameSpace__ecere__sys__OldList conversions;
879 struct __ecereNameSpace__ecere__sys__OldList templateParams;
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
881 struct __ecereNameSpace__ecere__com__Class * templateClass;
882 struct __ecereNameSpace__ecere__sys__OldList templatized;
884 unsigned int isInstanceClass;
885 unsigned int byValueSystemClass;
886 } __attribute__ ((gcc_struct));
888 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
890 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
892 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
894 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
896 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
898 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
900 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
902 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
906 struct __ecereNameSpace__ecere__com__Instance
909 struct __ecereNameSpace__ecere__com__Class * _class;
911 } __attribute__ ((gcc_struct));
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
915 struct __ecereNameSpace__ecere__com__DataMember
917 struct __ecereNameSpace__ecere__com__DataMember * prev;
918 struct __ecereNameSpace__ecere__com__DataMember * next;
920 unsigned int isProperty;
923 struct __ecereNameSpace__ecere__com__Class * _class;
924 const char * dataTypeString;
925 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
926 struct Type * dataType;
930 struct __ecereNameSpace__ecere__sys__OldList members;
931 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
934 } __attribute__ ((gcc_struct));
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
938 struct __ecereNameSpace__ecere__com__SerialBuffer
940 unsigned char * _buffer;
944 } __attribute__ ((gcc_struct));
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
948 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
954 const char * dataTypeString;
955 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
956 } __attribute__ ((gcc_struct)) __anon1;
957 struct __ecereNameSpace__ecere__com__DataValue expression;
960 const char * memberString;
963 struct __ecereNameSpace__ecere__com__DataMember * member;
964 struct __ecereNameSpace__ecere__com__Property * prop;
965 struct __ecereNameSpace__ecere__com__Method * method;
966 } __attribute__ ((gcc_struct)) __anon1;
967 } __attribute__ ((gcc_struct)) __anon2;
968 } __attribute__ ((gcc_struct)) __anon1;
969 } __attribute__ ((gcc_struct));
971 void exit(int status);
973 void * calloc(size_t nmemb, size_t size);
975 void free(void * ptr);
977 void * malloc(size_t size);
979 void * realloc(void * ptr, size_t size);
981 long int strtol(const char * nptr, char ** endptr, int base);
983 long long int strtoll(const char * nptr, char ** endptr, int base);
985 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
989 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
992 typedef union YYSTYPE
997 struct Identifier * id;
998 struct Expression * exp;
999 struct Specifier * specifier;
1000 struct __ecereNameSpace__ecere__sys__OldList * list;
1001 struct Enumerator * enumerator;
1002 struct Declarator * declarator;
1003 struct Pointer * pointer;
1004 struct Initializer * initializer;
1005 struct InitDeclarator * initDeclarator;
1006 struct TypeName * typeName;
1007 struct Declaration * declaration;
1008 struct Statement * stmt;
1009 struct FunctionDefinition * function;
1010 struct External * external;
1011 struct Context * context;
1012 struct AsmField * asmField;
1013 struct Attrib * attrib;
1014 struct ExtDecl * extDecl;
1015 struct Attribute * attribute;
1016 struct Instantiation * instance;
1017 struct MembersInit * membersInit;
1018 struct MemberInit * memberInit;
1019 struct ClassFunction * classFunction;
1020 struct ClassDefinition * _class;
1021 struct ClassDef * classDef;
1022 struct PropertyDef * prop;
1024 struct Symbol * symbol;
1025 struct PropertyWatch * propertyWatch;
1026 struct TemplateParameter * templateParameter;
1027 struct TemplateArgument * templateArgument;
1028 struct TemplateDatatype * templateDatatype;
1029 struct DBTableEntry * dbtableEntry;
1030 struct DBIndexItem * dbindexItem;
1031 struct DBTableDef * dbtableDef;
1032 } __attribute__ ((gcc_struct)) YYSTYPE;
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1038 struct Enumerator * prev;
1039 struct Enumerator * next;
1040 struct Location loc;
1041 struct Identifier * id;
1042 struct Expression * exp;
1043 } __attribute__ ((gcc_struct));
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1047 struct InitDeclarator
1049 struct InitDeclarator * prev;
1050 struct InitDeclarator * next;
1051 struct Location loc;
1052 struct Declarator * declarator;
1053 struct Initializer * initializer;
1054 } __attribute__ ((gcc_struct));
1056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1060 struct AsmField * prev;
1061 struct AsmField * next;
1062 struct Location loc;
1064 struct Expression * expression;
1065 struct Identifier * symbolic;
1066 } __attribute__ ((gcc_struct));
1068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1072 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1074 struct ClassFunction
1076 struct ClassFunction * prev;
1077 struct ClassFunction * next;
1078 struct Location loc;
1079 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1080 struct Declarator * declarator;
1081 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1082 struct Statement * body;
1083 struct __ecereNameSpace__ecere__com__Class * _class;
1084 struct __ecereNameSpace__ecere__sys__OldList attached;
1087 struct Symbol * propSet;
1088 unsigned int isVirtual;
1089 unsigned int isConstructor;
1090 unsigned int isDestructor;
1091 unsigned int dontMangle;
1094 } __attribute__ ((gcc_struct));
1096 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1100 struct MembersInit * prev;
1101 struct MembersInit * next;
1102 struct Location loc;
1106 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1107 struct ClassFunction * function;
1108 } __attribute__ ((gcc_struct)) __anon1;
1109 } __attribute__ ((gcc_struct));
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1115 struct MemberInit * prev;
1116 struct MemberInit * next;
1117 struct Location loc;
1118 struct Location realLoc;
1119 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1120 struct Initializer * initializer;
1122 unsigned int variable;
1123 unsigned int takeOutExp;
1124 } __attribute__ ((gcc_struct));
1126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1130 struct PropertyDef * prev;
1131 struct PropertyDef * next;
1132 struct Location loc;
1133 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1134 struct Declarator * declarator;
1135 struct Identifier * id;
1136 struct Statement * getStmt;
1137 struct Statement * setStmt;
1138 struct Statement * issetStmt;
1139 struct Symbol * symbol;
1140 struct Expression * category;
1143 unsigned int conversion : 1;
1144 unsigned int isWatchable : 1;
1145 unsigned int isDBProp : 1;
1146 } __attribute__ ((gcc_struct)) __anon1;
1147 } __attribute__ ((gcc_struct));
1149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1151 struct PropertyWatch
1153 struct PropertyWatch * prev;
1154 struct PropertyWatch * next;
1155 struct Location loc;
1156 struct Statement * compound;
1157 struct __ecereNameSpace__ecere__sys__OldList * properties;
1158 unsigned int deleteWatch;
1159 } __attribute__ ((gcc_struct));
1161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1165 struct ClassDef * prev;
1166 struct ClassDef * next;
1167 struct Location loc;
1171 struct Declaration * decl;
1172 struct ClassFunction * function;
1173 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1174 struct PropertyDef * propertyDef;
1175 struct PropertyWatch * propertyWatch;
1177 struct Identifier * defaultProperty;
1180 struct Identifier * id;
1181 struct Initializer * initializer;
1182 } __attribute__ ((gcc_struct)) __anon1;
1183 } __attribute__ ((gcc_struct)) __anon1;
1186 } __attribute__ ((gcc_struct));
1188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1190 struct DBTableEntry;
1192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1196 extern YYSTYPE yylval;
1198 extern struct Location yylloc;
1200 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1202 extern int returnCode;
1204 extern struct Expression * parsedExpression;
1206 extern unsigned int yydebug;
1208 void SetYydebug(unsigned int b)
1213 extern unsigned int echoOn;
1215 void resetScanner();
1219 int expression_yyparse();
1221 static struct Statement * curCompound;
1223 struct External * curExternal, * afterExternal;
1225 static struct Type * curSwitchType;
1227 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1229 struct __ecereNameSpace__ecere__com__Class * thisClass;
1231 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1236 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1241 static char * thisNameSpace;
1243 struct __ecereNameSpace__ecere__com__Class * containerClass;
1245 unsigned int thisClassParams = 1;
1247 unsigned int internalValueCounter;
1249 extern unsigned int outputLineNumbers;
1251 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1253 extern size_t strlen(const char * );
1255 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1257 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1259 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1261 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1263 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1265 void PrintExpression(struct Expression * exp, char * string)
1268 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1270 unsigned int backOutputLineNumbers = outputLineNumbers;
1272 outputLineNumbers = 0;
1274 OutputExpression(exp, f);
1275 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1276 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1278 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1279 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1280 count = strlen(string);
1281 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1282 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1284 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1285 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1286 string[count] = '\0';
1287 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1288 outputLineNumbers = backOutputLineNumbers;
1292 extern struct Type * ProcessTypeString(const char * string, unsigned int staticMethod);
1294 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1296 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1298 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1300 if(!param->baseType)
1302 if(param->dataTypeString)
1303 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1305 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1307 return param->baseType;
1309 return (((void *)0));
1312 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1314 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1316 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1320 if(type1->kind == type2->kind)
1331 if(type1->passAsTemplate && !type2->passAsTemplate)
1333 return type1->isSigned != type2->isSigned;
1335 return type1->__anon1._class != type2->__anon1._class;
1337 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1345 extern int strcmp(const char * , const char * );
1347 extern struct Context * curContext;
1349 extern struct Context * topContext;
1351 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1353 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1355 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1357 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1359 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1363 struct __ecereNameSpace__ecere__com__ClassProperty
1366 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1367 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1368 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1370 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1371 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1372 const char * dataTypeString;
1373 struct Type * dataType;
1374 unsigned int constant;
1375 } __attribute__ ((gcc_struct));
1377 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
1379 extern struct Expression * QMkExpId(const char * id);
1381 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1383 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1385 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1391 const char * dataTypeString;
1393 } __attribute__ ((gcc_struct)) __anon1;
1394 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1396 } __attribute__ ((gcc_struct));
1398 extern struct Expression * GetTemplateArgExpByName(const char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1400 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1402 extern void FreeIdentifier(struct Identifier * id);
1404 void ProcessExpressionType(struct Expression * exp);
1406 extern struct Declarator * SpecDeclFromString(const char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1408 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1410 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1412 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1414 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1416 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1418 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1420 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
1422 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1424 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1426 struct Identifier * id = exp->__anon1.__anon1.identifier;
1427 struct Context * ctx;
1428 struct Symbol * symbol = (((void *)0));
1430 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1432 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1434 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1439 if(!symbol && ((!id->_class || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->__anon1.registered))))
1441 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1442 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1443 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1444 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1448 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1450 if(!prop && !method)
1451 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1452 if(!prop && !method && !member)
1454 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1456 if(prop || method || member || classProp)
1459 exp->__anon1.member.member = id;
1460 exp->__anon1.member.memberType = 0;
1461 exp->__anon1.member.exp = QMkExpId("this");
1464 else if(_class && _class->templateParams.first)
1466 struct __ecereNameSpace__ecere__com__Class * sClass;
1468 for(sClass = _class; sClass; sClass = sClass->base)
1470 if(sClass->templateParams.first)
1472 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1474 for(param = sClass->templateParams.first; param; param = param->next)
1476 if(param->type == 2 && !strcmp(param->name, id->string))
1478 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1482 struct Declarator * decl;
1483 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1485 FreeIdentifier(exp->__anon1.member.member);
1486 ProcessExpressionType(argExp);
1487 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1488 exp->expType = ProcessType(specs, decl);
1490 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1501 extern int sprintf(char * , const char * , ...);
1503 extern char * strcat(char * , const char * );
1505 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
1507 char * PrintInt(long long result)
1511 if(result > (((int)0x7fffffff)))
1512 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1514 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1515 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1520 char * PrintUInt(uint64 result)
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else if(result > (((int)0x7fffffff)))
1527 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1529 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1533 char * PrintInt64(long long result)
1537 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1538 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
1540 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 char * PrintUInt64(uint64 result)
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1550 else if(result > (((int)0x7fffffff)))
1551 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1553 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1557 char * PrintHexUInt(uint64 result)
1561 if(result > (0xffffffff))
1562 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1564 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1565 if(result > (0xffffffff))
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1570 char * PrintHexUInt64(uint64 result)
1574 if(result > (0xffffffff))
1575 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1577 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1578 return __ecereNameSpace__ecere__sys__CopyString(temp);
1581 char * PrintShort(short result)
1585 sprintf(temp, "%d", (unsigned short)result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1589 char * PrintUShort(unsigned short result)
1593 if(result > (unsigned short)32767)
1594 sprintf(temp, "0x%X", (int)result);
1596 sprintf(temp, "%d", (int)result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1600 extern int isprint(int c);
1602 char * PrintChar(char result)
1606 if(result > (char)0 && isprint(result))
1607 sprintf(temp, "'%c'", result);
1608 else if(result < (char)0)
1609 sprintf(temp, "%d", (int)result);
1611 sprintf(temp, "0x%X", (unsigned char)result);
1612 return __ecereNameSpace__ecere__sys__CopyString(temp);
1615 char * PrintUChar(unsigned char result)
1619 sprintf(temp, "0x%X", result);
1620 return __ecereNameSpace__ecere__sys__CopyString(temp);
1623 extern char * strcpy(char * , const char * );
1625 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1627 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
1629 extern int (* __ecereProp_float_Get_signBit)(float this);
1631 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
1633 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1635 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
1637 char * PrintFloat(float result)
1641 if(__ecereProp_float_Get_isInf(result))
1643 if(__ecereProp_float_Get_signBit(result))
1644 strcpy(temp, "-inf");
1646 strcpy(temp, "inf");
1648 else if(__ecereProp_float_Get_isNan(result))
1650 if(__ecereProp_float_Get_signBit(result))
1651 strcpy(temp, "-nan");
1653 strcpy(temp, "nan");
1656 sprintf(temp, "%.16ff", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1662 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
1664 extern int (* __ecereProp_double_Get_signBit)(double this);
1666 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
1668 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1670 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
1672 char * PrintDouble(double result)
1676 if(__ecereProp_double_Get_isInf(result))
1678 if(__ecereProp_double_Get_signBit(result))
1679 strcpy(temp, "-inf");
1681 strcpy(temp, "inf");
1683 else if(__ecereProp_double_Get_isNan(result))
1685 if(__ecereProp_double_Get_signBit(result))
1686 strcpy(temp, "-nan");
1688 strcpy(temp, "nan");
1691 sprintf(temp, "%.16f", result);
1692 return __ecereNameSpace__ecere__sys__CopyString(temp);
1695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1699 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* Neg)(struct Expression *, struct Operand *);
1705 unsigned int (* Inc)(struct Expression *, struct Operand *);
1706 unsigned int (* Dec)(struct Expression *, struct Operand *);
1707 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1719 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (* Not)(struct Expression *, struct Operand *);
1725 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1728 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1729 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1730 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1731 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1732 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1733 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1734 } __attribute__ ((gcc_struct));
1736 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1742 unsigned int ptrSize;
1755 } __attribute__ ((gcc_struct)) __anon1;
1757 } __attribute__ ((gcc_struct));
1759 unsigned int GetOpInt(struct Operand * op2, int * value2)
1761 if(op2->kind == 3 && op2->type->isSigned)
1762 *value2 = op2->__anon1.i;
1763 else if(op2->kind == 3)
1764 *value2 = (int)op2->__anon1.ui;
1765 else if(op2->kind == 4 && op2->type->isSigned)
1766 *value2 = (int)op2->__anon1.i64;
1767 else if(op2->kind == 4)
1768 *value2 = (int)op2->__anon1.ui64;
1769 else if(op2->kind == 23 && op2->type->isSigned)
1770 *value2 = (int)op2->__anon1.i64;
1771 else if(op2->kind == 23)
1772 *value2 = (int)op2->__anon1.ui64;
1773 else if(op2->kind == 22 && op2->type->isSigned)
1774 *value2 = (int)op2->__anon1.i64;
1775 else if(op2->kind == 22)
1776 *value2 = (int)op2->__anon1.ui64;
1777 else if(op2->kind == 2 && op2->type->isSigned)
1778 *value2 = (int)op2->__anon1.s;
1779 else if(op2->kind == 2)
1780 *value2 = (int)op2->__anon1.us;
1781 else if(op2->kind == 1 && op2->type->isSigned)
1782 *value2 = (int)op2->__anon1.c;
1783 else if(op2->kind == 24 || op2->kind == 1)
1784 *value2 = (int)op2->__anon1.uc;
1785 else if(op2->kind == 6)
1786 *value2 = (int)op2->__anon1.f;
1787 else if(op2->kind == 7)
1788 *value2 = (int)op2->__anon1.d;
1789 else if(op2->kind == 13)
1790 *value2 = (int)op2->__anon1.ui64;
1796 struct Operand GetOperand(struct Expression * exp);
1798 unsigned int GetInt(struct Expression * exp, int * value2)
1800 struct Operand op2 = GetOperand(exp);
1802 return GetOpInt(&op2, value2);
1805 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1807 if(op2->kind == 3 && op2->type->isSigned)
1808 *value2 = (unsigned int)op2->__anon1.i;
1809 else if(op2->kind == 3)
1810 *value2 = op2->__anon1.ui;
1811 else if(op2->kind == 4 && op2->type->isSigned)
1812 *value2 = (unsigned int)op2->__anon1.i64;
1813 else if(op2->kind == 4)
1814 *value2 = (unsigned int)op2->__anon1.ui64;
1815 else if(op2->kind == 23 && op2->type->isSigned)
1816 *value2 = (unsigned int)op2->__anon1.i64;
1817 else if(op2->kind == 23)
1818 *value2 = (unsigned int)op2->__anon1.ui64;
1819 else if(op2->kind == 22 && op2->type->isSigned)
1820 *value2 = (unsigned int)op2->__anon1.i64;
1821 else if(op2->kind == 22)
1822 *value2 = (unsigned int)op2->__anon1.ui64;
1823 else if(op2->kind == 2 && op2->type->isSigned)
1824 *value2 = (unsigned int)op2->__anon1.s;
1825 else if(op2->kind == 2)
1826 *value2 = (unsigned int)op2->__anon1.us;
1827 else if(op2->kind == 1 && op2->type->isSigned)
1828 *value2 = (unsigned int)op2->__anon1.c;
1829 else if(op2->kind == 24 || op2->kind == 1)
1830 *value2 = (unsigned int)op2->__anon1.uc;
1831 else if(op2->kind == 6)
1832 *value2 = (unsigned int)op2->__anon1.f;
1833 else if(op2->kind == 7)
1834 *value2 = (unsigned int)op2->__anon1.d;
1835 else if(op2->kind == 13)
1836 *value2 = (unsigned int)op2->__anon1.ui64;
1842 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1844 struct Operand op2 = GetOperand(exp);
1846 return GetOpUInt(&op2, value2);
1849 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1851 if(op2->kind == 3 && op2->type->isSigned)
1852 *value2 = (long long)op2->__anon1.i;
1853 else if(op2->kind == 3)
1854 *value2 = (long long)op2->__anon1.ui;
1855 else if(op2->kind == 4 && op2->type->isSigned)
1856 *value2 = op2->__anon1.i64;
1857 else if(op2->kind == 4)
1858 *value2 = (long long)op2->__anon1.ui64;
1859 else if(op2->kind == 23 && op2->type->isSigned)
1860 *value2 = op2->__anon1.i64;
1861 else if(op2->kind == 23)
1862 *value2 = (long long)op2->__anon1.ui64;
1863 else if(op2->kind == 22 && op2->type->isSigned)
1864 *value2 = op2->__anon1.i64;
1865 else if(op2->kind == 22)
1866 *value2 = (long long)op2->__anon1.ui64;
1867 else if(op2->kind == 2 && op2->type->isSigned)
1868 *value2 = (long long)op2->__anon1.s;
1869 else if(op2->kind == 2)
1870 *value2 = (long long)op2->__anon1.us;
1871 else if(op2->kind == 1 && op2->type->isSigned)
1872 *value2 = (long long)op2->__anon1.c;
1873 else if(op2->kind == 24 || op2->kind == 1)
1874 *value2 = (long long)op2->__anon1.uc;
1875 else if(op2->kind == 6)
1876 *value2 = (long long)op2->__anon1.f;
1877 else if(op2->kind == 7)
1878 *value2 = (long long)op2->__anon1.d;
1879 else if(op2->kind == 13)
1880 *value2 = (long long)op2->__anon1.ui64;
1886 unsigned int GetInt64(struct Expression * exp, long long * value2)
1888 struct Operand op2 = GetOperand(exp);
1890 return GetOpInt64(&op2, value2);
1893 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1895 if(op2->kind == 3 && op2->type->isSigned)
1896 *value2 = (uint64)op2->__anon1.i;
1897 else if(op2->kind == 3)
1898 *value2 = (uint64)op2->__anon1.ui;
1899 else if(op2->kind == 4 && op2->type->isSigned)
1900 *value2 = (uint64)op2->__anon1.i64;
1901 else if(op2->kind == 4)
1902 *value2 = op2->__anon1.ui64;
1903 else if(op2->kind == 23 && op2->type->isSigned)
1904 *value2 = (uint64)op2->__anon1.i64;
1905 else if(op2->kind == 23)
1906 *value2 = op2->__anon1.ui64;
1907 else if(op2->kind == 22 && op2->type->isSigned)
1908 *value2 = (uint64)op2->__anon1.i64;
1909 else if(op2->kind == 22)
1910 *value2 = op2->__anon1.ui64;
1911 else if(op2->kind == 2 && op2->type->isSigned)
1912 *value2 = (uint64)op2->__anon1.s;
1913 else if(op2->kind == 2)
1914 *value2 = (uint64)op2->__anon1.us;
1915 else if(op2->kind == 1 && op2->type->isSigned)
1916 *value2 = (uint64)op2->__anon1.c;
1917 else if(op2->kind == 24 || op2->kind == 1)
1918 *value2 = (uint64)op2->__anon1.uc;
1919 else if(op2->kind == 6)
1920 *value2 = (uint64)op2->__anon1.f;
1921 else if(op2->kind == 7)
1922 *value2 = (uint64)op2->__anon1.d;
1923 else if(op2->kind == 13)
1924 *value2 = op2->__anon1.ui64;
1930 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1932 struct Operand op2 = GetOperand(exp);
1934 return GetOpUInt64(&op2, value2);
1937 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1939 if(op2->kind == 3 && op2->type->isSigned)
1940 *value2 = (intptr_t)op2->__anon1.i;
1941 else if(op2->kind == 3)
1942 *value2 = (intptr_t)op2->__anon1.ui;
1943 else if(op2->kind == 4 && op2->type->isSigned)
1944 *value2 = (intptr_t)op2->__anon1.i64;
1945 else if(op2->kind == 4)
1946 *value2 = (intptr_t)op2->__anon1.ui64;
1947 else if(op2->kind == 23 && op2->type->isSigned)
1948 *value2 = (intptr_t)op2->__anon1.i64;
1949 else if(op2->kind == 23)
1950 *value2 = (intptr_t)op2->__anon1.ui64;
1951 else if(op2->kind == 22 && op2->type->isSigned)
1952 *value2 = (intptr_t)op2->__anon1.i64;
1953 else if(op2->kind == 22)
1954 *value2 = (intptr_t)op2->__anon1.ui64;
1955 else if(op2->kind == 2 && op2->type->isSigned)
1956 *value2 = (intptr_t)op2->__anon1.s;
1957 else if(op2->kind == 2)
1958 *value2 = (intptr_t)op2->__anon1.us;
1959 else if(op2->kind == 1 && op2->type->isSigned)
1960 *value2 = (intptr_t)op2->__anon1.c;
1961 else if(op2->kind == 24 || op2->kind == 1)
1962 *value2 = (intptr_t)op2->__anon1.uc;
1963 else if(op2->kind == 6)
1964 *value2 = (intptr_t)op2->__anon1.f;
1965 else if(op2->kind == 7)
1966 *value2 = (intptr_t)op2->__anon1.d;
1967 else if(op2->kind == 13)
1968 *value2 = (intptr_t)op2->__anon1.ui64;
1974 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1976 struct Operand op2 = GetOperand(exp);
1978 return GetOpIntPtr(&op2, value2);
1981 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1983 if(op2->kind == 3 && op2->type->isSigned)
1984 *value2 = (uintptr_t)op2->__anon1.i;
1985 else if(op2->kind == 3)
1986 *value2 = (uintptr_t)op2->__anon1.ui;
1987 else if(op2->kind == 4 && op2->type->isSigned)
1988 *value2 = (uintptr_t)op2->__anon1.i64;
1989 else if(op2->kind == 4)
1990 *value2 = (uintptr_t)op2->__anon1.ui64;
1991 else if(op2->kind == 23 && op2->type->isSigned)
1992 *value2 = (uintptr_t)op2->__anon1.i64;
1993 else if(op2->kind == 23)
1994 *value2 = (uintptr_t)op2->__anon1.ui64;
1995 else if(op2->kind == 22 && op2->type->isSigned)
1996 *value2 = (uintptr_t)op2->__anon1.i64;
1997 else if(op2->kind == 22)
1998 *value2 = (uintptr_t)op2->__anon1.ui64;
1999 else if(op2->kind == 2 && op2->type->isSigned)
2000 *value2 = (uintptr_t)op2->__anon1.s;
2001 else if(op2->kind == 2)
2002 *value2 = (uintptr_t)op2->__anon1.us;
2003 else if(op2->kind == 1 && op2->type->isSigned)
2004 *value2 = (uintptr_t)op2->__anon1.c;
2005 else if(op2->kind == 24 || op2->kind == 1)
2006 *value2 = (uintptr_t)op2->__anon1.uc;
2007 else if(op2->kind == 6)
2008 *value2 = (uintptr_t)op2->__anon1.f;
2009 else if(op2->kind == 7)
2010 *value2 = (uintptr_t)op2->__anon1.d;
2011 else if(op2->kind == 13)
2012 *value2 = (uintptr_t)op2->__anon1.ui64;
2018 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2020 struct Operand op2 = GetOperand(exp);
2022 return GetOpUIntPtr(&op2, value2);
2025 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2027 if(op2->kind == 3 && op2->type->isSigned)
2028 *value2 = (ssize_t)op2->__anon1.i;
2029 else if(op2->kind == 3)
2030 *value2 = (ssize_t)op2->__anon1.ui;
2031 else if(op2->kind == 4 && op2->type->isSigned)
2032 *value2 = (ssize_t)op2->__anon1.i64;
2033 else if(op2->kind == 4)
2034 *value2 = (ssize_t)op2->__anon1.ui64;
2035 else if(op2->kind == 23 && op2->type->isSigned)
2036 *value2 = (ssize_t)op2->__anon1.i64;
2037 else if(op2->kind == 23)
2038 *value2 = (ssize_t)op2->__anon1.ui64;
2039 else if(op2->kind == 22 && op2->type->isSigned)
2040 *value2 = (ssize_t)op2->__anon1.i64;
2041 else if(op2->kind == 22)
2042 *value2 = (ssize_t)op2->__anon1.ui64;
2043 else if(op2->kind == 2 && op2->type->isSigned)
2044 *value2 = (ssize_t)op2->__anon1.s;
2045 else if(op2->kind == 2)
2046 *value2 = (ssize_t)op2->__anon1.us;
2047 else if(op2->kind == 1 && op2->type->isSigned)
2048 *value2 = (ssize_t)op2->__anon1.c;
2049 else if(op2->kind == 24 || op2->kind == 1)
2050 *value2 = (ssize_t)op2->__anon1.uc;
2051 else if(op2->kind == 6)
2052 *value2 = (ssize_t)op2->__anon1.f;
2053 else if(op2->kind == 7)
2054 *value2 = (ssize_t)op2->__anon1.d;
2055 else if(op2->kind == 13)
2056 *value2 = (ssize_t)op2->__anon1.ui64;
2062 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2064 struct Operand op2 = GetOperand(exp);
2066 return GetOpIntSize(&op2, value2);
2069 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2071 if(op2->kind == 3 && op2->type->isSigned)
2072 *value2 = (size_t)op2->__anon1.i;
2073 else if(op2->kind == 3)
2074 *value2 = (size_t)op2->__anon1.ui;
2075 else if(op2->kind == 4 && op2->type->isSigned)
2076 *value2 = (size_t)op2->__anon1.i64;
2077 else if(op2->kind == 4)
2078 *value2 = (size_t)op2->__anon1.ui64;
2079 else if(op2->kind == 23 && op2->type->isSigned)
2080 *value2 = (size_t)op2->__anon1.i64;
2081 else if(op2->kind == 23)
2082 *value2 = (size_t)op2->__anon1.ui64;
2083 else if(op2->kind == 22 && op2->type->isSigned)
2084 *value2 = (size_t)op2->__anon1.i64;
2085 else if(op2->kind == 22)
2086 *value2 = (size_t)op2->__anon1.ui64;
2087 else if(op2->kind == 2 && op2->type->isSigned)
2088 *value2 = (size_t)op2->__anon1.s;
2089 else if(op2->kind == 2)
2090 *value2 = (size_t)op2->__anon1.us;
2091 else if(op2->kind == 1 && op2->type->isSigned)
2092 *value2 = (size_t)op2->__anon1.c;
2093 else if(op2->kind == 24 || op2->kind == 1)
2094 *value2 = (size_t)op2->__anon1.uc;
2095 else if(op2->kind == 6)
2096 *value2 = (size_t)op2->__anon1.f;
2097 else if(op2->kind == 7)
2098 *value2 = (size_t)op2->__anon1.d;
2099 else if(op2->kind == 13)
2100 *value2 = (size_t)op2->__anon1.ui64;
2106 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2108 struct Operand op2 = GetOperand(exp);
2110 return GetOpUIntSize(&op2, value2);
2113 unsigned int GetOpShort(struct Operand * op2, short * value2)
2115 if(op2->kind == 3 && op2->type->isSigned)
2116 *value2 = (short)op2->__anon1.i;
2117 else if(op2->kind == 3)
2118 *value2 = (short)op2->__anon1.ui;
2119 else if(op2->kind == 4 && op2->type->isSigned)
2120 *value2 = (short)op2->__anon1.i64;
2121 else if(op2->kind == 4)
2122 *value2 = (short)op2->__anon1.ui64;
2123 else if(op2->kind == 23 && op2->type->isSigned)
2124 *value2 = (short)op2->__anon1.i64;
2125 else if(op2->kind == 23)
2126 *value2 = (short)op2->__anon1.ui64;
2127 else if(op2->kind == 22 && op2->type->isSigned)
2128 *value2 = (short)op2->__anon1.i64;
2129 else if(op2->kind == 22)
2130 *value2 = (short)op2->__anon1.ui64;
2131 else if(op2->kind == 2 && op2->type->isSigned)
2132 *value2 = op2->__anon1.s;
2133 else if(op2->kind == 2)
2134 *value2 = (short)op2->__anon1.us;
2135 else if(op2->kind == 1 && op2->type->isSigned)
2136 *value2 = (short)op2->__anon1.c;
2137 else if(op2->kind == 24 || op2->kind == 1)
2138 *value2 = (short)op2->__anon1.uc;
2139 else if(op2->kind == 6)
2140 *value2 = (short)op2->__anon1.f;
2141 else if(op2->kind == 7)
2142 *value2 = (short)op2->__anon1.d;
2143 else if(op2->kind == 13)
2144 *value2 = (short)op2->__anon1.ui64;
2150 unsigned int GetShort(struct Expression * exp, short * value2)
2152 struct Operand op2 = GetOperand(exp);
2154 return GetOpShort(&op2, value2);
2157 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2159 if(op2->kind == 3 && op2->type->isSigned)
2160 *value2 = (unsigned short)op2->__anon1.i;
2161 else if(op2->kind == 3)
2162 *value2 = (unsigned short)op2->__anon1.ui;
2163 else if(op2->kind == 4 && op2->type->isSigned)
2164 *value2 = (unsigned short)op2->__anon1.i64;
2165 else if(op2->kind == 4)
2166 *value2 = (unsigned short)op2->__anon1.ui64;
2167 else if(op2->kind == 23 && op2->type->isSigned)
2168 *value2 = (unsigned short)op2->__anon1.i64;
2169 else if(op2->kind == 23)
2170 *value2 = (unsigned short)op2->__anon1.ui64;
2171 else if(op2->kind == 22 && op2->type->isSigned)
2172 *value2 = (unsigned short)op2->__anon1.i64;
2173 else if(op2->kind == 22)
2174 *value2 = (unsigned short)op2->__anon1.ui64;
2175 else if(op2->kind == 2 && op2->type->isSigned)
2176 *value2 = (unsigned short)op2->__anon1.s;
2177 else if(op2->kind == 2)
2178 *value2 = op2->__anon1.us;
2179 else if(op2->kind == 1 && op2->type->isSigned)
2180 *value2 = (unsigned short)op2->__anon1.c;
2181 else if(op2->kind == 24 || op2->kind == 1)
2182 *value2 = (unsigned short)op2->__anon1.uc;
2183 else if(op2->kind == 6)
2184 *value2 = (unsigned short)op2->__anon1.f;
2185 else if(op2->kind == 7)
2186 *value2 = (unsigned short)op2->__anon1.d;
2187 else if(op2->kind == 13)
2188 *value2 = (unsigned short)op2->__anon1.ui64;
2194 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2196 struct Operand op2 = GetOperand(exp);
2198 return GetOpUShort(&op2, value2);
2201 unsigned int GetOpChar(struct Operand * op2, char * value2)
2203 if(op2->kind == 3 && op2->type->isSigned)
2204 *value2 = (char)op2->__anon1.i;
2205 else if(op2->kind == 3)
2206 *value2 = (char)op2->__anon1.ui;
2207 else if(op2->kind == 4 && op2->type->isSigned)
2208 *value2 = (char)op2->__anon1.i64;
2209 else if(op2->kind == 4)
2210 *value2 = (char)op2->__anon1.ui64;
2211 else if(op2->kind == 23 && op2->type->isSigned)
2212 *value2 = (char)op2->__anon1.i64;
2213 else if(op2->kind == 23)
2214 *value2 = (char)op2->__anon1.ui64;
2215 else if(op2->kind == 22 && op2->type->isSigned)
2216 *value2 = (char)op2->__anon1.i64;
2217 else if(op2->kind == 22)
2218 *value2 = (char)op2->__anon1.ui64;
2219 else if(op2->kind == 2 && op2->type->isSigned)
2220 *value2 = (char)op2->__anon1.s;
2221 else if(op2->kind == 2)
2222 *value2 = (char)op2->__anon1.us;
2223 else if(op2->kind == 1 && op2->type->isSigned)
2224 *value2 = op2->__anon1.c;
2225 else if(op2->kind == 24 || op2->kind == 1)
2226 *value2 = (char)op2->__anon1.uc;
2227 else if(op2->kind == 6)
2228 *value2 = (char)op2->__anon1.f;
2229 else if(op2->kind == 7)
2230 *value2 = (char)op2->__anon1.d;
2231 else if(op2->kind == 13)
2232 *value2 = (char)op2->__anon1.ui64;
2238 unsigned int GetChar(struct Expression * exp, char * value2)
2240 struct Operand op2 = GetOperand(exp);
2242 return GetOpChar(&op2, value2);
2245 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2247 if(op2->kind == 3 && op2->type->isSigned)
2248 *value2 = (unsigned char)op2->__anon1.i;
2249 else if(op2->kind == 3)
2250 *value2 = (unsigned char)op2->__anon1.ui;
2251 else if(op2->kind == 4 && op2->type->isSigned)
2252 *value2 = (unsigned char)op2->__anon1.i64;
2253 else if(op2->kind == 4)
2254 *value2 = (unsigned char)op2->__anon1.ui64;
2255 else if(op2->kind == 23 && op2->type->isSigned)
2256 *value2 = (unsigned char)op2->__anon1.i64;
2257 else if(op2->kind == 23)
2258 *value2 = (unsigned char)op2->__anon1.ui64;
2259 else if(op2->kind == 22 && op2->type->isSigned)
2260 *value2 = (unsigned char)op2->__anon1.i64;
2261 else if(op2->kind == 22)
2262 *value2 = (unsigned char)op2->__anon1.ui64;
2263 else if(op2->kind == 2 && op2->type->isSigned)
2264 *value2 = (unsigned char)op2->__anon1.s;
2265 else if(op2->kind == 2)
2266 *value2 = (unsigned char)op2->__anon1.us;
2267 else if(op2->kind == 1 && op2->type->isSigned)
2268 *value2 = (unsigned char)op2->__anon1.c;
2269 else if(op2->kind == 24 || op2->kind == 1)
2270 *value2 = op2->__anon1.uc;
2271 else if(op2->kind == 6)
2272 *value2 = (unsigned char)op2->__anon1.f;
2273 else if(op2->kind == 7)
2274 *value2 = (unsigned char)op2->__anon1.d;
2275 else if(op2->kind == 13)
2276 *value2 = (unsigned char)op2->__anon1.ui64;
2282 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2284 struct Operand op2 = GetOperand(exp);
2286 return GetOpUChar(&op2, value2);
2289 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2291 if(op2->kind == 3 && op2->type->isSigned)
2292 *value2 = (float)(float)op2->__anon1.i;
2293 else if(op2->kind == 3)
2294 *value2 = (float)(float)op2->__anon1.ui;
2295 else if(op2->kind == 4 && op2->type->isSigned)
2296 *value2 = (float)(float)op2->__anon1.i64;
2297 else if(op2->kind == 4)
2298 *value2 = (float)(float)op2->__anon1.ui64;
2299 else if(op2->kind == 23 && op2->type->isSigned)
2300 *value2 = (float)(float)op2->__anon1.i64;
2301 else if(op2->kind == 23)
2302 *value2 = (float)(float)op2->__anon1.ui64;
2303 else if(op2->kind == 22 && op2->type->isSigned)
2304 *value2 = (float)(float)op2->__anon1.i64;
2305 else if(op2->kind == 22)
2306 *value2 = (float)(float)op2->__anon1.ui64;
2307 else if(op2->kind == 2 && op2->type->isSigned)
2308 *value2 = (float)(float)op2->__anon1.s;
2309 else if(op2->kind == 2)
2310 *value2 = (float)(float)op2->__anon1.us;
2311 else if(op2->kind == 1 && op2->type->isSigned)
2312 *value2 = (float)(float)op2->__anon1.c;
2313 else if(op2->kind == 24 || op2->kind == 1)
2314 *value2 = (float)(float)op2->__anon1.uc;
2315 else if(op2->kind == 6)
2316 *value2 = (float)op2->__anon1.f;
2317 else if(op2->kind == 7)
2318 *value2 = (float)op2->__anon1.d;
2319 else if(op2->kind == 13)
2320 *value2 = (float)(float)op2->__anon1.ui64;
2326 unsigned int GetFloat(struct Expression * exp, float * value2)
2328 struct Operand op2 = GetOperand(exp);
2330 return GetOpFloat(&op2, value2);
2333 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2335 if(op2->kind == 3 && op2->type->isSigned)
2336 *value2 = (double)(double)op2->__anon1.i;
2337 else if(op2->kind == 3)
2338 *value2 = (double)(double)op2->__anon1.ui;
2339 else if(op2->kind == 4 && op2->type->isSigned)
2340 *value2 = (double)(double)op2->__anon1.i64;
2341 else if(op2->kind == 4)
2342 *value2 = (double)(double)op2->__anon1.ui64;
2343 else if(op2->kind == 23 && op2->type->isSigned)
2344 *value2 = (double)(double)op2->__anon1.i64;
2345 else if(op2->kind == 23)
2346 *value2 = (double)(double)op2->__anon1.ui64;
2347 else if(op2->kind == 22 && op2->type->isSigned)
2348 *value2 = (double)(double)op2->__anon1.i64;
2349 else if(op2->kind == 22)
2350 *value2 = (double)(double)op2->__anon1.ui64;
2351 else if(op2->kind == 2 && op2->type->isSigned)
2352 *value2 = (double)(double)op2->__anon1.s;
2353 else if(op2->kind == 2)
2354 *value2 = (double)(double)op2->__anon1.us;
2355 else if(op2->kind == 1 && op2->type->isSigned)
2356 *value2 = (double)(double)op2->__anon1.c;
2357 else if(op2->kind == 24 || op2->kind == 1)
2358 *value2 = (double)(double)op2->__anon1.uc;
2359 else if(op2->kind == 6)
2360 *value2 = (double)op2->__anon1.f;
2361 else if(op2->kind == 7)
2362 *value2 = (double)op2->__anon1.d;
2363 else if(op2->kind == 13)
2364 *value2 = (double)(double)op2->__anon1.ui64;
2370 unsigned int GetDouble(struct Expression * exp, double * value2)
2372 struct Operand op2 = GetOperand(exp);
2374 return GetOpDouble(&op2, value2);
2377 void ComputeExpression(struct Expression * exp);
2379 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2381 extern int targetBits;
2383 int ComputeTypeSize(struct Type * type);
2385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2387 struct __ecereNameSpace__ecere__com__BitMember
2389 struct __ecereNameSpace__ecere__com__BitMember * prev;
2390 struct __ecereNameSpace__ecere__com__BitMember * next;
2392 unsigned int isProperty;
2395 struct __ecereNameSpace__ecere__com__Class * _class;
2396 const char * dataTypeString;
2397 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2398 struct Type * dataType;
2403 } __attribute__ ((gcc_struct));
2405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2407 struct __ecereNameSpace__ecere__sys__OldLink
2409 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2410 struct __ecereNameSpace__ecere__sys__OldLink * next;
2412 } __attribute__ ((gcc_struct));
2414 void FinishTemplatesContext(struct Context * context);
2416 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2418 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2419 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2421 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2423 int unionMemberOffset = 0;
2428 member->memberOffset = 0;
2429 if(targetBits < sizeof(void *) * 8)
2430 member->structAlignment = 0;
2432 else if(targetBits < sizeof(void *) * 8)
2433 _class->structAlignment = 0;
2434 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2435 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2436 if(!member && _class->destructionWatchOffset)
2437 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2439 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2441 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2443 if(!dataMember->isProperty)
2445 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2447 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
2453 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2455 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2457 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2459 if(!isMember && _class->type == 2 && dataMember->dataType)
2461 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2465 ComputeTypeSize(dataMember->dataType);
2466 if(bitMember->pos == -1)
2467 bitMember->pos = _class->memberOffset;
2468 if(!bitMember->size)
2469 bitMember->size = dataMember->dataType->size * 8;
2470 _class->memberOffset = bitMember->pos + bitMember->size;
2471 for(d = 0; d < bitMember->size; d++)
2477 bitMember->mask = mask << bitMember->pos;
2479 else if(dataMember->type == 0 && dataMember->dataType)
2484 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->__anon1._class || !dataMember->dataType->__anon1._class->__anon1.registered || dataMember->dataType->__anon1._class->__anon1.registered != _class || _class->type != 1)))
2485 ComputeTypeSize(dataMember->dataType);
2486 if(dataMember->dataType->bitFieldCount)
2488 bitFields += dataMember->dataType->bitFieldCount;
2495 int size = (bitFields + 7) / 8;
2499 int __simpleStruct0;
2503 int __simpleStruct0;
2505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2506 if(member->memberOffset % alignment)
2507 member->memberOffset += alignment - (member->memberOffset % alignment);
2509 dataMember->offset = member->memberOffset;
2510 if(member->type == 1)
2511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2514 member->memberOffset += size;
2521 int __simpleStruct0;
2523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2524 if(_class->memberOffset % alignment)
2525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2527 dataMember->offset = _class->memberOffset;
2528 _class->memberOffset += size;
2532 size = dataMember->dataType->size;
2533 alignment = dataMember->dataType->alignment;
2537 int __simpleStruct0;
2541 int __simpleStruct0;
2543 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2544 if(member->memberOffset % alignment)
2545 member->memberOffset += alignment - (member->memberOffset % alignment);
2547 dataMember->offset = member->memberOffset;
2548 if(member->type == 1)
2549 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2552 member->memberOffset += size;
2559 int __simpleStruct0;
2561 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2562 if(_class->memberOffset % alignment)
2563 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2565 dataMember->offset = _class->memberOffset;
2566 _class->memberOffset += size;
2573 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
2574 alignment = dataMember->structAlignment;
2577 int __simpleStruct0;
2581 int __simpleStruct0;
2583 if(member->memberOffset % alignment)
2584 member->memberOffset += alignment - (member->memberOffset % alignment);
2585 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2587 dataMember->offset = member->memberOffset;
2588 if(member->type == 1)
2589 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2591 member->memberOffset += dataMember->memberOffset;
2597 int __simpleStruct0;
2599 if(_class->memberOffset % alignment)
2600 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2603 dataMember->offset = _class->memberOffset;
2604 _class->memberOffset += dataMember->memberOffset;
2612 int size = (bitFields + 7) / 8;
2616 int __simpleStruct0;
2620 int __simpleStruct0;
2622 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2623 if(member->memberOffset % alignment)
2624 member->memberOffset += alignment - (member->memberOffset % alignment);
2626 if(member->type == 1)
2627 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2630 member->memberOffset += size;
2637 int __simpleStruct0;
2639 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2640 if(_class->memberOffset % alignment)
2641 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2643 _class->memberOffset += size;
2648 if(member && member->type == 1)
2650 member->memberOffset = unionMemberOffset;
2654 if(_class->type != 2)
2658 if(_class->structAlignment)
2660 if(_class->memberOffset % _class->structAlignment)
2661 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2663 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2666 struct __ecereNameSpace__ecere__com__Property * prop;
2668 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2670 if(prop->isProperty && prop->isWatchable)
2672 prop->watcherOffset = _class->structSize;
2673 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2678 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2680 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2682 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2684 if(deriv->computeSize)
2686 deriv->offset = _class->structSize;
2687 deriv->memberOffset = 0;
2688 deriv->structSize = deriv->offset;
2689 ComputeClassMembers(deriv, 0);
2697 FinishTemplatesContext(context);
2700 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2702 struct __ecereNameSpace__ecere__com__NameSpace
2705 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2706 struct __ecereNameSpace__ecere__com__NameSpace * left;
2707 struct __ecereNameSpace__ecere__com__NameSpace * right;
2709 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2710 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2711 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2712 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2713 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2714 } __attribute__ ((gcc_struct));
2716 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2718 struct __ecereNameSpace__ecere__com__Module
2720 struct __ecereNameSpace__ecere__com__Instance * application;
2721 struct __ecereNameSpace__ecere__sys__OldList classes;
2722 struct __ecereNameSpace__ecere__sys__OldList defines;
2723 struct __ecereNameSpace__ecere__sys__OldList functions;
2724 struct __ecereNameSpace__ecere__sys__OldList modules;
2725 struct __ecereNameSpace__ecere__com__Instance * prev;
2726 struct __ecereNameSpace__ecere__com__Instance * next;
2732 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2733 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2734 } __attribute__ ((gcc_struct));
2736 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2738 struct __ecereNameSpace__ecere__com__Class * _class;
2739 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2741 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2742 ComputeModuleClasses(subModule->data);
2743 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2744 ComputeClassMembers(_class, 0);
2747 extern unsigned int inCompiler;
2749 extern void Compiler_Error(const char * format, ...);
2751 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
2753 int ComputeTypeSize(struct Type * type)
2755 unsigned int size = type ? type->size : 0;
2757 if(!size && type && !type->computing)
2759 type->computing = 1;
2763 type->alignment = size = sizeof(char);
2766 type->alignment = size = sizeof(char);
2769 type->alignment = size = sizeof(int);
2772 type->alignment = size = sizeof(long long);
2775 type->alignment = size = targetBits / 8;
2778 type->alignment = size = targetBits / 8;
2781 type->alignment = size = sizeof(long);
2784 type->alignment = size = sizeof(short);
2787 type->alignment = size = sizeof(float);
2790 type->alignment = size = sizeof(double);
2794 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2796 if(_class && _class->type == 1)
2798 ComputeClassMembers(_class, 0);
2799 type->alignment = _class->structAlignment;
2800 size = _class->structSize;
2801 if(type->alignment && size % type->alignment)
2802 size += type->alignment - (size % type->alignment);
2804 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2806 if(!_class->dataType)
2807 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
2808 size = type->alignment = ComputeTypeSize(_class->dataType);
2811 size = type->alignment = targetBits / 8;
2816 size = type->alignment = targetBits / 8;
2819 if(type->__anon1.__anon4.arraySizeExp)
2821 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2822 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2823 if(!type->__anon1.__anon4.arraySizeExp->isConstant || (type->__anon1.__anon4.arraySizeExp->expType->kind != 3 && type->__anon1.__anon4.arraySizeExp->expType->kind != 2 && type->__anon1.__anon4.arraySizeExp->expType->kind != 1 && type->__anon1.__anon4.arraySizeExp->expType->kind != 5 && type->__anon1.__anon4.arraySizeExp->expType->kind != 4 && type->__anon1.__anon4.arraySizeExp->expType->kind != 23 && type->__anon1.__anon4.arraySizeExp->expType->kind != 22 && type->__anon1.__anon4.arraySizeExp->expType->kind != 15 && (type->__anon1.__anon4.arraySizeExp->expType->kind != 8 || !type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered || type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered->type != 4)))
2825 struct Location oldLoc = yylloc;
2826 char expression[10240];
2828 expression[0] = '\0';
2829 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2830 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2832 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2836 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2838 else if(type->__anon1.__anon4.enumClass)
2840 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2842 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2845 type->__anon1.__anon4.arraySize = 0;
2849 type->__anon1.__anon4.arraySize = 0;
2851 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2852 if(type->__anon1.type)
2853 type->alignment = type->__anon1.type->alignment;
2857 struct Type * member;
2859 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2861 int __simpleStruct0, __simpleStruct1;
2862 unsigned int addSize = ComputeTypeSize(member);
2864 member->offset = size;
2865 if(member->alignment && size % member->alignment)
2866 member->offset += member->alignment - (size % member->alignment);
2867 size = member->offset;
2868 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2871 if(type->alignment && size % type->alignment)
2872 size += type->alignment - (size % type->alignment);
2877 struct Type * member;
2879 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2881 int __simpleStruct0, __simpleStruct1;
2882 unsigned int addSize = ComputeTypeSize(member);
2884 member->offset = size;
2885 if(member->alignment && size % member->alignment)
2886 member->offset += member->alignment - (size % member->alignment);
2887 size = member->offset;
2888 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2889 size = ((size > addSize) ? size : addSize);
2891 if(type->alignment && size % type->alignment)
2892 size += type->alignment - (size % type->alignment);
2897 struct TemplateParameter * param = type->__anon1.templateParameter;
2898 struct Type * baseType = ProcessTemplateParameterType(param);
2902 size = ComputeTypeSize(baseType);
2903 type->alignment = baseType->alignment;
2906 type->alignment = size = sizeof(uint64);
2911 type->alignment = size = sizeof(enum
2919 type->alignment = size = targetBits / 8;
2924 type->computing = 0;
2929 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2931 extern struct Identifier * MkIdentifier(const char * string);
2933 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2935 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2937 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2939 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2941 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2943 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2945 extern void FreeType(struct Type * type);
2947 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2949 extern struct Specifier * MkSpecifier(int specifier);
2951 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2953 extern struct Expression * MkExpConstant(const char * string);
2955 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, unsigned int * addedPadding)
2957 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2958 unsigned int totalSize = 0;
2959 unsigned int maxSize = 0;
2962 struct __ecereNameSpace__ecere__com__DataMember * member;
2964 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2968 if(!isMember && _class->base)
2970 maxSize = _class->structSize;
2972 if(_class->type == 1 || _class->type == 5)
2973 AddMembers(declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
2976 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2978 if(maxSize > baseSize)
2979 maxSize -= baseSize;
2985 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2987 if(!member->isProperty)
2989 switch(member->type)
2993 if(member->dataTypeString)
2995 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2996 struct Declarator * decl;
2998 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2999 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
3000 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
3001 if(!member->dataType)
3002 member->dataType = ProcessType(specs, decl);
3003 ReplaceThisClassSpecifiers(specs, topClass);
3005 struct Type * type = ProcessType(specs, decl);
3007 DeclareType(member->dataType, 0, 0);
3010 ComputeTypeSize(member->dataType);
3011 size = member->dataType->size;
3012 alignment = member->dataType->alignment;
3015 if(totalSize % alignment)
3016 totalSize += alignment - (totalSize % alignment);
3025 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3028 sprintf(id, "__anon%d", anonID++);
3030 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
3031 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3032 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3033 alignment = member->structAlignment;
3036 if(totalSize % alignment)
3037 totalSize += alignment - (totalSize % alignment);
3047 unsigned int __simpleStruct0;
3049 if(topMember && topMember->type == 1)
3050 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3052 *retSize += totalSize;
3054 else if(totalSize < maxSize && _class->type != 1000)
3056 int autoPadding = 0;
3058 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3059 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3060 if(totalSize + autoPadding < maxSize)
3062 char sizeString[50];
3064 sprintf(sizeString, "%d", maxSize - totalSize);
3065 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3071 FinishTemplatesContext(context);
3072 return topMember ? topMember->memberID : _class->memberID;
3075 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3077 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3078 struct __ecereNameSpace__ecere__com__DataMember * member;
3079 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3081 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3082 DeclareMembers(_class->base, 0);
3083 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3085 if(!member->isProperty)
3087 switch(member->type)
3091 if(!member->dataType && member->dataTypeString)
3092 member->dataType = ProcessTypeString(member->dataTypeString, 0);
3093 if(member->dataType)
3094 DeclareType(member->dataType, 0, 0);
3100 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 1);
3107 FinishTemplatesContext(context);
3108 return topMember ? topMember->memberID : _class->memberID;
3111 extern struct Identifier * GetDeclId(struct Declarator * decl);
3113 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3115 struct ClassDef * def;
3118 for(def = (*definitions).first; def; def = def->next)
3122 struct Declaration * decl = def->__anon1.decl;
3124 if(decl && decl->__anon1.__anon1.specifiers)
3126 struct Specifier * spec;
3127 unsigned int isStruct = 0;
3129 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3131 if(spec->type == 3 || spec->type == 4)
3133 if(spec->__anon1.__anon2.definitions)
3134 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3140 struct Declarator * d = (((void *)0));
3142 if(decl->__anon1.__anon1.declarators)
3144 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3146 struct Identifier * idDecl = GetDeclId(d);
3156 sprintf(id, "__anon%d", anonID++);
3157 if(!decl->__anon1.__anon1.declarators)
3158 decl->__anon1.__anon1.declarators = MkList();
3159 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3167 extern struct Symbol * FindClass(const char * name);
3169 extern char * strchr(const char * , int);
3171 extern void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams);
3173 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3175 extern void FreeClassDef(struct ClassDef * def);
3177 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3179 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3181 extern void DeclareClass(struct Symbol * classSym, const char * className);
3183 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3185 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3187 void DeclareStruct(const char * name, unsigned int skipNoHead)
3189 struct External * external = (((void *)0));
3190 struct Symbol * classSym = FindClass(name);
3192 if(!inCompiler || !classSym)
3194 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3196 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3198 struct Declaration * decl;
3199 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3200 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3201 char structName[1024];
3202 struct Specifier * spec = (((void *)0));
3204 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3205 classSym->declaring++;
3206 if(strchr(classSym->string, '<'))
3208 if(classSym->__anon1.registered->templateClass)
3210 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3211 classSym->declaring--;
3215 DeclareMembers(classSym->__anon1.registered, 0);
3216 structName[0] = (char)0;
3217 FullClassNameCat(structName, name, 0);
3218 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3220 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3222 if(spec->type == 3 || spec->type == 4)
3226 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3228 unsigned int addedPadding = 0;
3230 classSym->declaredStructSym = 1;
3231 declarations = MkList();
3232 AddMembers(declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3233 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3235 FreeList(declarations, (void *)(FreeClassDef));
3236 declarations = (((void *)0));
3239 if(skipNoHead || declarations)
3244 spec->__anon1.__anon2.definitions = declarations;
3245 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3247 if(classSym->__anon2.__anon1.structExternal)
3248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3250 classSym->id = curExternal->symbol->idCode;
3251 classSym->idCode = curExternal->symbol->idCode;
3257 external = MkExternalDeclaration((((void *)0)));
3258 specifiers = MkList();
3259 declarators = MkList();
3260 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3261 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3262 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3263 decl->symbol->__anon2.__anon1.pointerExternal = external;
3264 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3266 char className[1024];
3268 strcpy(className, "__ecereClass_");
3269 FullClassNameCat(className, classSym->string, 1);
3270 DeclareClass(classSym, className);
3271 external->symbol = classSym;
3272 classSym->__anon2.__anon1.pointerExternal = external;
3273 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3274 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3278 char className[1024];
3280 strcpy(className, "__ecereClass_");
3281 FullClassNameCat(className, classSym->string, 1);
3282 classSym->__anon2.__anon1.structExternal = external;
3283 DeclareClass(classSym, className);
3284 external->symbol = classSym;
3286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3289 classSym->declaring--;
3293 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3295 struct Specifier * spec;
3297 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3299 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3302 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3304 classSym->declaring++;
3306 if(classSym->__anon1.registered)
3307 DeclareMembers(classSym->__anon1.registered, 0);
3309 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3311 if(classSym->__anon2.__anon1.structExternal)
3312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3314 classSym->id = curExternal->symbol->idCode;
3315 classSym->idCode = curExternal->symbol->idCode;
3317 classSym->declaring--;
3322 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3324 extern struct ModuleImport * mainModule;
3326 extern struct Specifier * MkSpecifierName(const char * name);
3328 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3330 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3332 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3334 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3336 extern void FreeDeclarator(struct Declarator * decl);
3338 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
3340 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
3342 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
3344 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
3346 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3348 struct PropertyImport
3350 struct PropertyImport * prev;
3351 struct PropertyImport * next;
3353 unsigned int isVirtual;
3354 unsigned int hasSet;
3355 unsigned int hasGet;
3356 } __attribute__ ((gcc_struct));
3358 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3360 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3362 struct Symbol * symbol = prop->symbol;
3364 strcpy(setName, "__ecereProp_");
3365 FullClassNameCat(setName, prop->_class->fullName, 0);
3366 strcat(setName, "_Set_");
3367 FullClassNameCat(setName, prop->name, 1);
3368 strcpy(getName, "__ecereProp_");
3369 FullClassNameCat(getName, prop->_class->fullName, 0);
3370 strcat(getName, "_Get_");
3371 FullClassNameCat(getName, prop->name, 1);
3372 if(prop->_class->type == 1)
3373 DeclareStruct(prop->_class->fullName, 0);
3374 if(!symbol || curExternal->symbol->idCode < symbol->id)
3376 unsigned int imported = 0;
3377 unsigned int dllImport = 0;
3379 if(!symbol || symbol->_import)
3383 struct Symbol * classSym;
3385 if(!prop->_class->symbol)
3386 prop->_class->symbol = FindClass(prop->_class->fullName);
3387 classSym = prop->_class->symbol;
3388 if(classSym && !classSym->_import)
3390 struct ModuleImport * module;
3392 if(prop->_class->module)
3393 module = FindModule(prop->_class->module);
3395 module = mainModule;
3396 classSym->_import = __extension__ ({
3397 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3399 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3403 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3404 symbol->_import = (struct ClassImport *)__extension__ ({
3405 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3407 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3413 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3418 struct Context * context = SetupTemplatesContext(prop->_class);
3420 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3421 FinishTemplatesContext(context);
3425 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3427 struct Declaration * decl;
3428 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3429 struct Declarator * d;
3430 struct __ecereNameSpace__ecere__sys__OldList * params;
3431 struct Specifier * spec;
3432 struct External * external;
3433 struct Declarator * typeDecl;
3434 unsigned int simple = 0;
3436 specifiers = MkList();
3437 declarators = MkList();
3439 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3440 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3442 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3444 struct Context * context = SetupTemplatesContext(prop->_class);
3446 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3447 FinishTemplatesContext(context);
3449 for(spec = (*specifiers).first; spec; spec = spec->next)
3453 if((!typeDecl || typeDecl->type == 1))
3455 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3457 symbol->_class = classSym->__anon1.registered;
3458 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3460 DeclareStruct(spec->__anon1.__anon1.name, 0);
3467 d = PlugDeclarator(typeDecl, d);
3470 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3471 specifiers = MkList();
3473 d = MkDeclaratorFunction(d, params);
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3476 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3479 ListAdd(specifiers, MkSpecifier(VOID));
3480 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3481 decl = MkDeclaration(specifiers, declarators);
3482 external = MkExternalDeclaration(decl);
3483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3484 external->symbol = symbol;
3485 symbol->__anon2.__anon2.externalGet = external;
3486 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3488 FreeDeclarator(typeDecl);
3492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3497 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3499 struct Declaration * decl;
3500 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3501 struct Declarator * d;
3502 struct __ecereNameSpace__ecere__sys__OldList * params;
3503 struct Specifier * spec;
3504 struct External * external;
3505 struct Declarator * typeDecl;
3507 declarators = MkList();
3509 if(!prop->conversion || prop->_class->type == 1)
3511 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3513 specifiers = MkList();
3515 struct Context * context = SetupTemplatesContext(prop->_class);
3517 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3518 FinishTemplatesContext(context);
3520 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3522 ListAdd(params, MkTypeName(specifiers, d));
3523 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3525 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3526 d = MkDeclaratorFunction(d, params);
3527 for(spec = (*specifiers).first; spec; spec = spec->next)
3531 if((!typeDecl || typeDecl->type == 1))
3533 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3535 symbol->_class = classSym->__anon1.registered;
3536 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3537 DeclareStruct(spec->__anon1.__anon1.name, 0);
3541 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3542 specifiers = MkList();
3544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3545 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3547 if(!prop->conversion || prop->_class->type == 1)
3548 ListAdd(specifiers, MkSpecifier(VOID));
3550 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3551 decl = MkDeclaration(specifiers, declarators);
3552 external = MkExternalDeclaration(decl);
3553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3554 external->symbol = symbol;
3555 symbol->__anon2.__anon2.externalSet = external;
3556 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3563 if(!symbol->__anon2.__anon2.externalPtr)
3565 struct Declaration * decl;
3566 struct External * external;
3567 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3568 char propName[1024];
3571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3574 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
3577 ListAdd(specifiers, MkSpecifierName("Property"));
3578 strcpy(propName, "__ecereProp_");
3579 FullClassNameCat(propName, prop->_class->fullName, 0);
3580 strcat(propName, "_");
3581 FullClassNameCat(propName, prop->name, 1);
3583 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3585 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3588 strcpy(propName, "__ecerePropM_");
3589 FullClassNameCat(propName, prop->_class->fullName, 0);
3590 strcat(propName, "_");
3591 FullClassNameCat(propName, prop->name, 1);
3592 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3594 decl = MkDeclaration(specifiers, list);
3596 external = MkExternalDeclaration(decl);
3597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3598 external->symbol = symbol;
3599 symbol->__anon2.__anon2.externalPtr = external;
3603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3605 symbol->id = curExternal->symbol->idCode;
3609 struct Type * Dereference(struct Type * source)
3611 struct Type * type = (((void *)0));
3615 if(source->kind == 13 || source->kind == 12)
3617 type = source->__anon1.type;
3618 source->__anon1.type->refCount++;
3620 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3622 type = __extension__ ({
3623 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3625 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3628 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3639 static struct Type * Reference(struct Type * source)
3641 struct Type * type = (((void *)0));
3645 type = __extension__ ({
3646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3648 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3655 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);
3657 extern void * memcpy(void * , const void * , size_t size);
3659 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3661 extern void FreeExpression(struct Expression * exp);
3663 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3665 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, unsigned int warnConst);
3667 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3669 extern struct Type * MkClassType(const char * name);
3671 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
3673 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)
3675 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3676 unsigned int found = 0;
3677 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3678 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3679 unsigned int freeType = 0;
3681 yylloc = member->loc;
3686 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3690 dataMember = *curMember;
3696 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3697 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3698 int _subMemberStackPos = 0;
3701 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3704 dataMember = thisMember;
3705 if(curMember && thisMember->memberAccess == 1)
3707 *curMember = thisMember;
3708 *curClass = thisMember->_class;
3709 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3710 *subMemberStackPos = _subMemberStackPos;
3716 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3717 if(method && method->type == 1)
3720 method = (((void *)0));
3725 struct Type * type = (((void *)0));
3729 if(!dataMember->dataType && dataMember->dataTypeString)
3731 struct Context * context = SetupTemplatesContext(_class);
3733 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3734 FinishTemplatesContext(context);
3736 type = dataMember->dataType;
3740 if(!method->dataType)
3741 ProcessMethodType(method);
3742 type = method->dataType;
3744 if(ident && ident->next)
3746 for(ident = ident->next; ident && type; ident = ident->next)
3750 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3752 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3754 type = dataMember->dataType;
3756 else if(type->kind == 9 || type->kind == 10)
3758 struct Type * memberType;
3760 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3762 if(!strcmp(memberType->name, ident->string))
3771 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3774 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3775 struct __ecereNameSpace__ecere__com__Class * sClass;
3777 for(sClass = _class; sClass; sClass = sClass->base)
3780 if(sClass->templateClass)
3781 sClass = sClass->templateClass;
3782 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3784 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3786 for(sClass = sClass->base; sClass; sClass = sClass->base)
3788 if(sClass->templateClass)
3789 sClass = sClass->templateClass;
3790 id += sClass->templateParams.count;
3801 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3803 if(arg.__anon1.__anon1.dataTypeString)
3805 unsigned int constant = type->constant;
3807 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3808 if(type->kind == 8 && constant)
3810 else if(type->kind == 13)
3812 struct Type * t = type->__anon1.type;
3814 while(t->kind == 13)
3815 t = t->__anon1.type;
3817 t->constant = constant;
3820 if(type && _class->templateClass)
3821 type->passAsTemplate = 1;
3828 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3830 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3831 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3834 char templateString[1024];
3835 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3837 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3838 for(cClass = expClass; cClass; cClass = cClass->base)
3842 if(cClass->templateClass)
3843 cClass = cClass->templateClass;
3844 for(param = cClass->templateParams.first; param; param = param->next)
3847 struct __ecereNameSpace__ecere__com__Class * sClass;
3848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3850 for(sClass = cClass->base; sClass; sClass = sClass->base)
3852 if(sClass->templateClass)
3853 sClass = sClass->templateClass;
3854 id += sClass->templateParams.count;
3856 arg = expClass->templateArgs[id];
3857 for(sClass = _class; sClass; sClass = sClass->base)
3859 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3861 struct __ecereNameSpace__ecere__com__Class * nextClass;
3863 if(sClass->templateClass)
3864 sClass = sClass->templateClass;
3865 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3867 if(nextClass->templateClass)
3868 nextClass = nextClass->templateClass;
3869 p += nextClass->templateParams.count;
3871 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3873 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3875 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3877 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3878 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3892 char expString[1024];
3893 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3894 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3895 struct Expression * exp;
3896 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3898 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3899 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3900 ProcessExpressionType(exp);
3901 ComputeExpression(exp);
3902 expString[0] = '\0';
3903 PrintExpression(exp, expString);
3904 strcat(argument, expString);
3905 FreeExpression(exp);
3910 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3915 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3916 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3923 strcat(templateString, ", ");
3924 if(lastParam != p - 1)
3926 strcat(templateString, param->name);
3927 strcat(templateString, " = ");
3929 strcat(templateString, argument);
3938 int len = strlen(templateString);
3940 if(templateString[len - 1] == '<')
3944 if(templateString[len - 1] == '>')
3945 templateString[len++] = ' ';
3946 templateString[len++] = '>';
3948 templateString[len++] = '\0';
3951 struct Context * context = SetupTemplatesContext(_class);
3955 type = ProcessTypeString(templateString, 0);
3957 FinishTemplatesContext(context);
3960 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3962 ProcessExpressionType(member->initializer->__anon1.exp);
3963 if(!member->initializer->__anon1.exp->expType)
3967 char expString[10240];
3969 expString[0] = '\0';
3970 PrintExpression(member->initializer->__anon1.exp, expString);
3971 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3975 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3977 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3980 else if(member->initializer)
3982 ProcessInitializer(member->initializer, type);
3989 if(_class && _class->type == 3)
3991 if(member->initializer)
3993 struct Type * type = MkClassType(_class->fullName);
3995 ProcessInitializer(member->initializer, type);
4001 if(member->initializer)
4003 ProcessInitializer(member->initializer, (((void *)0)));
4009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4015 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4019 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4024 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);
4026 extern void FreeSpecifier(struct Specifier * spec);
4028 static void ProcessFunction(struct FunctionDefinition * function);
4030 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
4032 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4034 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4036 extern void FreeClassFunction(struct ClassFunction * func);
4038 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4040 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4042 void ProcessInstantiationType(struct Instantiation * inst)
4047 struct MembersInit * members;
4048 struct Symbol * classSym;
4049 struct __ecereNameSpace__ecere__com__Class * _class;
4051 classSym = inst->_class->__anon1.__anon1.symbol;
4052 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4053 if(!_class || _class->type != 5)
4054 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4055 afterExternal = afterExternal ? afterExternal : curExternal;
4057 ProcessExpressionType(inst->exp);
4058 inst->isConstant = 1;
4061 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4062 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4063 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4064 int subMemberStackPos = 0;
4066 for(members = (*inst->members).first; members; members = members->next)
4068 switch(members->type)
4073 static unsigned int instMethodID = 0;
4074 struct External * external = curExternal;
4075 struct Context * context = curContext;
4076 struct Declarator * declarator = members->__anon1.function->declarator;
4077 struct Identifier * nameID = GetDeclId(declarator);
4078 char * unmangled = nameID ? nameID->string : (((void *)0));
4079 struct Expression * exp;
4080 struct External * createdExternal = (((void *)0));
4086 strcpy(name, "__ecereInstMeth_");
4087 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4089 strcat(name, nameID->string);
4091 sprintf(number, "_%08d", instMethodID++);
4092 strcat(name, number);
4093 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4097 struct Symbol * symbol = declarator->symbol;
4098 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4100 if(method && method->type == 1)
4102 symbol->__anon1.method = method;
4103 ProcessMethodType(method);
4104 if(!symbol->type->__anon1.__anon2.thisClass)
4106 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4108 if(!currentClass->symbol)
4109 currentClass->symbol = FindClass(currentClass->fullName);
4110 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4115 _class->symbol = FindClass(_class->fullName);
4116 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4119 DeclareType(symbol->type, 1, 1);
4123 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4126 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4129 FreeSpecifier(nameID->_class);
4130 nameID->_class = (((void *)0));
4134 struct External * oldExternal = curExternal;
4136 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4138 struct External * externalDecl;
4140 externalDecl = MkExternalDeclaration((((void *)0)));
4141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4142 if(createdExternal->__anon1.function)
4144 ProcessFunction(createdExternal->__anon1.function);
4146 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4148 externalDecl->__anon1.declaration = decl;
4149 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4150 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4151 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4158 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4159 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4161 curExternal = external;
4162 curContext = context;
4165 FreeClassFunction(members->__anon1.function);
4166 exp = QMkExpId(name);
4168 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4169 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4175 if(members->__anon1.dataMembers && classSym)
4177 struct MemberInit * member;
4178 struct Location oldyyloc = yylloc;
4180 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4182 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4183 if(member->initializer && !member->initializer->isConstant)
4184 inst->isConstant = 0;
4196 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4200 if(type->kind == 11)
4202 struct Type * param;
4206 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4207 DeclareType(param, declarePointers, 1);
4209 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4211 else if(type->kind == 13 && declarePointers)
4212 DeclareType(type->__anon1.type, declarePointers, 0);
4213 else if(type->kind == 8)
4215 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4216 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4218 else if(type->kind == 9 || type->kind == 10)
4220 struct Type * member;
4222 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4223 DeclareType(member, 0, 0);
4225 else if(type->kind == 12)
4226 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4230 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
4232 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4234 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4236 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4237 struct __ecereNameSpace__ecere__com__Class * sClass;
4239 for(sClass = _class; sClass; sClass = sClass->base)
4242 if(sClass->templateClass)
4243 sClass = sClass->templateClass;
4244 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4246 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4248 for(sClass = sClass->base; sClass; sClass = sClass->base)
4250 if(sClass->templateClass)
4251 sClass = sClass->templateClass;
4252 id += sClass->templateParams.count;
4263 arg = &_class->templateArgs[id];
4264 if(arg && param->type == 0)
4265 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4270 extern struct Context * PushContext(void);
4272 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4274 struct TemplatedType
4277 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4278 struct __ecereNameSpace__ecere__sys__BTNode * left;
4279 struct __ecereNameSpace__ecere__sys__BTNode * right;
4281 struct TemplateParameter * param;
4282 } __attribute__ ((gcc_struct));
4284 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4286 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4288 struct Context * context = PushContext();
4290 context->templateTypesOnly = 1;
4291 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4293 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4295 for(; param; param = param->next)
4297 if(param->type == 0 && param->identifier)
4299 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4307 struct __ecereNameSpace__ecere__com__Class * sClass;
4309 for(sClass = _class; sClass; sClass = sClass->base)
4311 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4313 for(p = sClass->templateParams.first; p; p = p->next)
4317 struct TemplateParameter * param = p->param;
4318 struct TemplatedType * type;
4322 p->param = param = __extension__ ({
4323 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4325 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4328 type = __extension__ ({
4329 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4331 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4333 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4341 extern void PopContext(struct Context * ctx);
4343 extern void FreeContext(struct Context * context);
4345 void FinishTemplatesContext(struct Context * context)
4347 PopContext(context);
4348 FreeContext(context);
4349 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4352 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4354 if(!method->dataType)
4356 struct Context * context = SetupTemplatesContext(method->_class);
4358 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4359 FinishTemplatesContext(context);
4360 if(method->type != 1 && method->dataType)
4362 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4364 if(!method->_class->symbol)
4365 method->_class->symbol = FindClass(method->_class->fullName);
4366 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4372 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4376 struct Context * context = SetupTemplatesContext(prop->_class);
4378 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4379 FinishTemplatesContext(context);
4383 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4385 extern void FreeTypeName(struct TypeName * typeName);
4387 static void ProcessDeclarator(struct Declarator * decl);
4389 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4395 struct MethodImport * prev;
4396 struct MethodImport * next;
4398 unsigned int isVirtual;
4399 } __attribute__ ((gcc_struct));
4401 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4403 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4405 struct Symbol * symbol = method->symbol;
4407 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4409 unsigned int dllImport = 0;
4411 if(!method->dataType)
4412 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4413 if(!symbol || symbol->_import || method->type == 1)
4415 if(!symbol || method->type == 1)
4417 struct Symbol * classSym;
4419 if(!method->_class->symbol)
4420 method->_class->symbol = FindClass(method->_class->fullName);
4421 classSym = method->_class->symbol;
4422 if(!classSym->_import)
4424 struct ModuleImport * module;
4426 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4427 module = FindModule(method->_class->module);
4429 module = mainModule;
4430 classSym->_import = __extension__ ({
4431 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4433 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4439 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4441 if(!symbol->_import)
4443 symbol->_import = (struct ClassImport *)__extension__ ({
4444 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4446 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4452 symbol->type = method->dataType;
4454 symbol->type->refCount++;
4457 if(!method->dataType->dllExport)
4459 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4463 if(method->type != 1 && method->dataType)
4464 DeclareType(method->dataType, 1, 1);
4465 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4467 struct Declaration * decl;
4468 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4469 struct Declarator * d;
4470 struct Declarator * funcDecl;
4471 struct External * external;
4473 specifiers = MkList();
4474 declarators = MkList();
4476 ListAdd(specifiers, MkSpecifier(EXTERN));
4477 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4478 ListAdd(specifiers, MkSpecifier(STATIC));
4479 if(method->type == 1)
4481 ListAdd(specifiers, MkSpecifier(INT));
4482 d = MkDeclaratorIdentifier(MkIdentifier(name));
4486 d = MkDeclaratorIdentifier(MkIdentifier(name));
4488 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4490 struct Context * context = SetupTemplatesContext(method->_class);
4492 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4493 FinishTemplatesContext(context);
4495 funcDecl = GetFuncDecl(d);
4498 struct Specifier * spec, * next;
4500 for(spec = (*specifiers).first; spec; spec = next)
4505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4506 FreeSpecifier(spec);
4510 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4512 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4514 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4515 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4516 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4517 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4519 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4521 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4523 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4524 FreeTypeName(param);
4526 if(!funcDecl->__anon1.function.parameters)
4527 funcDecl->__anon1.function.parameters = MkList();
4528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4532 ProcessDeclarator(d);
4533 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4534 decl = MkDeclaration(specifiers, declarators);
4535 ReplaceThisClassSpecifiers(specifiers, method->_class);
4536 if(symbol->__anon2.__anon1.pointerExternal)
4538 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4541 *functionSymbol = *symbol;
4542 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4543 if(functionSymbol->type)
4544 functionSymbol->type->refCount++;
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4547 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4549 external = MkExternalDeclaration(decl);
4551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4552 external->symbol = symbol;
4553 symbol->__anon2.__anon1.pointerExternal = external;
4557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4559 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4563 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4565 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4567 unsigned int first = 1;
4569 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4571 char className[1024];
4573 strcpy(className, _class->fullName);
4574 for(param = _class->templateParams.first; param; param = param->next)
4578 strcat(className, "<");
4580 strcat(className, ", ");
4581 if(lastParam + 1 != p)
4583 strcat(className, param->name);
4584 strcat(className, " = ");
4586 strcat(className, param->name);
4594 int len = strlen(className);
4596 if(className[len - 1] == '>')
4597 className[len++] = ' ';
4598 className[len++] = '>';
4599 className[len++] = '\0';
4601 return __ecereNameSpace__ecere__sys__CopyString(className);
4604 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4607 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4611 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4613 unsigned int first = 1;
4615 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4617 char className[1024];
4619 strcpy(className, _class->fullName);
4620 for(param = _class->templateParams.first; param; param = param->next)
4624 strcat(className, "<");
4626 strcat(className, ", ");
4627 if(lastParam + 1 != p)
4629 strcat(className, param->name);
4630 strcat(className, " = ");
4632 strcat(className, param->name);
4640 int len = strlen(className);
4642 if(className[len - 1] == '>')
4643 className[len++] = ' ';
4644 className[len++] = '>';
4645 className[len++] = '\0';
4647 type = MkClassType(className);
4651 type = MkClassType(_class->fullName);
4656 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4658 if(specs != (((void *)0)) && _class)
4660 struct Specifier * spec;
4662 for(spec = specs->first; spec; spec = spec->next)
4664 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4667 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4668 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4676 struct __ecereNameSpace__ecere__com__GlobalFunction
4678 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4679 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4682 struct __ecereNameSpace__ecere__com__Instance * module;
4683 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4684 const char * dataTypeString;
4685 struct Type * dataType;
4687 } __attribute__ ((gcc_struct));
4689 extern struct Context * globalContext;
4691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4693 struct FunctionImport
4695 struct FunctionImport * prev;
4696 struct FunctionImport * next;
4698 } __attribute__ ((gcc_struct));
4700 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4702 struct Symbol * symbol = function->symbol;
4704 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4706 unsigned int imported = 0;
4707 unsigned int dllImport = 0;
4709 if(!function->dataType)
4711 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4712 if(!function->dataType->__anon1.__anon2.thisClass)
4713 function->dataType->__anon1.__anon2.staticMethod = 1;
4719 struct ModuleImport * module = FindModule(function->module);
4721 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4724 if(!function->dataType->dllExport)
4726 symbol->_import = (struct ClassImport *)__extension__ ({
4727 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4729 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4735 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4736 if(!symbol->type->__anon1.__anon2.thisClass)
4737 symbol->type->__anon1.__anon2.staticMethod = 1;
4740 imported = symbol->_import ? 1 : 0;
4741 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4744 DeclareType(function->dataType, 1, 1);
4747 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4749 struct Declaration * decl;
4750 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4751 struct Declarator * d;
4752 struct Declarator * funcDecl;
4753 struct External * external;
4755 specifiers = MkList();
4756 declarators = MkList();
4757 ListAdd(specifiers, MkSpecifier(EXTERN));
4758 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4760 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4761 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4762 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4764 struct Specifier * spec;
4766 for(spec = (*specifiers).first; spec; spec = spec->next)
4767 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4770 FreeSpecifier(spec);
4774 funcDecl = GetFuncDecl(d);
4775 if(funcDecl && !funcDecl->__anon1.function.parameters)
4777 funcDecl->__anon1.function.parameters = MkList();
4778 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4780 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4782 struct Context * oldCtx = curContext;
4784 curContext = globalContext;
4785 decl = MkDeclaration(specifiers, declarators);
4786 curContext = oldCtx;
4788 if(symbol->__anon2.__anon1.pointerExternal)
4790 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4793 *functionSymbol = *symbol;
4794 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4795 if(functionSymbol->type)
4796 functionSymbol->type->refCount++;
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4799 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4801 external = MkExternalDeclaration(decl);
4803 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4804 external->symbol = symbol;
4805 symbol->__anon2.__anon1.pointerExternal = external;
4809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4812 symbol->id = curExternal->symbol->idCode;
4815 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4818 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4823 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4824 struct __ecereNameSpace__ecere__sys__BTNode * left;
4825 struct __ecereNameSpace__ecere__sys__BTNode * right;
4827 struct __ecereNameSpace__ecere__com__Instance * module;
4828 char * dataTypeString;
4829 struct Type * dataType;
4832 } __attribute__ ((gcc_struct));
4834 void DeclareGlobalData(struct GlobalData * data)
4836 struct Symbol * symbol = data->symbol;
4838 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4843 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4846 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4847 DeclareType(data->dataType, 1, 1);
4850 if(!symbol->__anon2.__anon1.pointerExternal)
4852 struct Declaration * decl;
4853 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4854 struct Declarator * d;
4855 struct External * external;
4857 specifiers = MkList();
4858 declarators = MkList();
4859 ListAdd(specifiers, MkSpecifier(EXTERN));
4860 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4861 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4862 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4863 decl = MkDeclaration(specifiers, declarators);
4864 external = MkExternalDeclaration(decl);
4866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4867 external->symbol = symbol;
4868 symbol->__anon2.__anon1.pointerExternal = external;
4872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4875 symbol->id = curExternal->symbol->idCode;
4882 struct Conversion * prev, * next;
4883 struct __ecereNameSpace__ecere__com__Property * convert;
4885 struct Type * resultType;
4886 } __attribute__ ((gcc_struct));
4888 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4890 extern void Compiler_Warning(const char * format, ...);
4892 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4894 unsigned int status = 1;
4896 if(((source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered) || dest->kind == 13))
4898 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4899 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4901 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4903 struct Type * sourceType = source, * destType = dest;
4905 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4906 sourceType = sourceType->__anon1.type;
4907 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4908 destType = destType->__anon1.type;
4909 if(!destType->constant && sourceType->constant)
4913 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4920 extern void CopyTypeInto(struct Type * type, struct Type * src);
4922 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4924 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, unsigned int warnConst)
4929 CheckConstCompatibility(source, dest, 1);
4930 if(source->kind == 20 && dest->kind != 20)
4932 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4937 if(dest->kind == 20 && source->kind != 20)
4939 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4944 if(dest->classObjectType == 2 && dest->kind != 11)
4946 if(source->classObjectType != 3)
4950 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4958 if(source->kind != 11 && source->classObjectType == 3)
4960 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4963 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4965 if((dest->__anon1.__anon1.enumName && source->__anon1.__anon1.enumName && !strcmp(dest->__anon1.__anon1.enumName, source->__anon1.__anon1.enumName)) || (source->__anon1.__anon1.members.first && source->__anon1.__anon1.members.first == dest->__anon1.__anon1.members.first))
4968 if(dest->kind == 14 && source->kind != 0)
4970 if(dest->kind == 13 && dest->__anon1.type->kind == 0 && ((source->kind == 8 && (!source->__anon1._class || !source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type == 1 || source->__anon1._class->__anon1.registered->type == 0 || source->__anon1._class->__anon1.registered->type == 5 || source->__anon1._class->__anon1.registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4972 if(!isConversionExploration && source->kind == 13 && source->__anon1.type->kind == 0 && ((dest->kind == 8 && (!dest->__anon1._class || !dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type == 1 || dest->__anon1._class->__anon1.registered->type == 0 || dest->__anon1._class->__anon1.registered->type == 5 || dest->__anon1._class->__anon1.registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4974 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4976 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4978 if(conversions != (((void *)0)))
4980 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4985 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4987 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4989 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4991 if(sourceBase == destBase)
4995 else if(source->__anon1._class && dest->__anon1._class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type != 4) || (!dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, dest->__anon1._class->__anon1.registered))
4999 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
5001 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
5008 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
5012 if(source->kind == 8)
5014 struct __ecereNameSpace__ecere__com__Class * _class;
5016 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5018 struct __ecereNameSpace__ecere__com__Property * convert;
5020 for(convert = _class->conversions.first; convert; convert = convert->next)
5022 if(convert->memberAccess == 1 || _class->module == privateModule)
5024 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5026 if(!convert->dataType)
5027 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5028 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 1 : 0, convert->dataType->kind == 8, 0, 1, warnConst))
5030 if(!conversions && !convert->Get)
5032 else if(conversions != (((void *)0)))
5034 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5038 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5040 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5051 struct __ecereNameSpace__ecere__com__Class * _class;
5053 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5055 struct __ecereNameSpace__ecere__com__Property * convert;
5057 for(convert = _class->conversions.first; convert; convert = convert->next)
5059 if(convert->memberAccess == 1 || _class->module == privateModule)
5061 struct Type * constType = (((void *)0));
5062 unsigned int success = 0;
5064 if(!convert->dataType)
5065 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5066 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5068 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5070 constType = __extension__ ({
5071 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5073 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5075 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5076 ptrType->constant = 1;
5078 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5080 if(!conversions && !convert->Set)
5082 else if(conversions != (((void *)0)))
5084 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (source->kind != 8 || source->__anon1._class->__anon1.registered != _class->base))
5088 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5096 FreeType(constType);
5102 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5104 if(!dest->__anon1._class->__anon1.registered->dataType)
5105 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5106 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5108 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5115 if(source->kind == 8)
5117 struct __ecereNameSpace__ecere__com__Class * _class;
5119 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5121 struct __ecereNameSpace__ecere__com__Property * convert;
5123 for(convert = _class->conversions.first; convert; convert = convert->next)
5125 if(convert->memberAccess == 1 || _class->module == privateModule)
5127 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5129 if(!convert->dataType)
5130 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5131 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0, 1, warnConst))
5133 if(!conversions && !convert->Get)
5135 else if(conversions != (((void *)0)))
5137 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5141 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5151 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5153 if(!source->__anon1._class->__anon1.registered->dataType)
5154 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5155 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5157 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5159 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5165 if(source->kind == 8 || source->kind == 19)
5167 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5169 else if(dest->kind == 7 && source->kind == 6)
5171 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5173 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5175 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5177 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5179 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5181 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
5183 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5185 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->__anon1.type->kind == 11) || source->kind == 16)))
5187 struct Type * paramSource, * paramDest;
5189 if(dest->kind == 16)
5190 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5191 if(source->kind == 16)
5192 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5193 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5194 dest = dest->__anon1.type;
5195 if(source->kind == 13 && source->__anon1.type->kind == 11)
5196 source = source->__anon1.type;
5197 if(dest->kind == 16)
5198 dest = dest->__anon1.__anon3.method->dataType;
5199 if(source->kind == 16)
5200 source = source->__anon1.__anon3.method->dataType;
5201 paramSource = source->__anon1.__anon2.params.first;
5202 if(paramSource && paramSource->kind == 0)
5203 paramSource = (((void *)0));
5204 paramDest = dest->__anon1.__anon2.params.first;
5205 if(paramDest && paramDest->kind == 0)
5206 paramDest = (((void *)0));
5207 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5209 if(!paramDest || (!(paramDest->kind == 13 && paramDest->__anon1.type && paramDest->__anon1.type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, paramDest->__anon1._class->__anon1.registered))))
5211 if(paramDest && paramDest->kind == 8)
5212 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5214 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5217 paramDest = paramDest->next;
5219 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5221 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5223 if(dest->__anon1.__anon2.thisClass)
5225 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5233 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5236 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5242 paramSource = paramSource->next;
5246 if(dest->__anon1.__anon2.thisClass)
5248 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5250 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5256 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5264 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5266 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5270 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5271 for(; paramDest; paramDest = paramDest->next)
5275 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5279 struct Type * paramDestType = paramDest;
5280 struct Type * paramSourceType = paramSource;
5281 struct Type * type = paramDestType;
5283 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5286 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5287 struct __ecereNameSpace__ecere__com__Class * sClass;
5289 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5292 if(sClass->templateClass)
5293 sClass = sClass->templateClass;
5294 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5296 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5298 for(sClass = sClass->base; sClass; sClass = sClass->base)
5300 if(sClass->templateClass)
5301 sClass = sClass->templateClass;
5302 id += sClass->templateParams.count;
5313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5315 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5318 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst)))
5323 PrintType(paramDest, type, 0, 1);
5324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5325 if(paramDestType != paramDest)
5326 FreeType(paramDestType);
5329 if(paramDestType != paramDest)
5330 FreeType(paramDestType);
5332 paramSource = paramSource->next;
5336 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5341 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5345 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5347 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5354 static void FreeConvert(struct Conversion * convert)
5356 if(convert->resultType)
5357 FreeType(convert->resultType);
5360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5362 struct __ecereNameSpace__ecere__com__BTNamedLink
5365 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5366 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5367 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5370 } __attribute__ ((gcc_struct));
5372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5374 struct __ecereNameSpace__ecere__com__EnumClassData
5376 struct __ecereNameSpace__ecere__sys__OldList values;
5378 } __attribute__ ((gcc_struct));
5380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5382 struct __ecereNameSpace__ecere__sys__NamedLink64
5384 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5385 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5388 } __attribute__ ((gcc_struct));
5390 extern void FreeExpContents(struct Expression * exp);
5392 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5394 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5396 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5398 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5400 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5402 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5404 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5406 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)))
5408 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5410 if(_class->type == 4)
5412 struct __ecereNameSpace__ecere__sys__OldList converts =
5416 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5420 _class->symbol = FindClass(_class->fullName);
5421 type->__anon1._class = _class->symbol;
5422 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5424 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5425 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5429 struct __ecereNameSpace__ecere__com__Class * baseClass;
5431 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5433 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5435 for(value = e->values.first; value; value = value->next)
5437 if(!strcmp(value->name, string))
5442 FreeExpContents(sourceExp);
5443 FreeType(sourceExp->expType);
5444 sourceExp->isConstant = 1;
5445 sourceExp->expType = MkClassType(baseClass->fullName);
5449 sourceExp->type = 2;
5450 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5451 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5453 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5454 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5456 while(converts.first)
5458 struct Conversion * convert = converts.first;
5460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5463 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
5471 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5474 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)))
5475 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5482 struct __ecereNameSpace__ecere__com__SubModule
5484 struct __ecereNameSpace__ecere__com__SubModule * prev;
5485 struct __ecereNameSpace__ecere__com__SubModule * next;
5486 struct __ecereNameSpace__ecere__com__Instance * module;
5488 } __attribute__ ((gcc_struct));
5490 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5492 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5494 if(searchFor == searchIn)
5496 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5498 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5500 if(ModuleVisibility(subModule->module, searchFor))
5507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5509 struct __ecereNameSpace__ecere__com__Application
5512 const char * * argv;
5514 unsigned int isGUIApp;
5515 struct __ecereNameSpace__ecere__sys__OldList allModules;
5516 char * parsedCommand;
5517 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5518 } __attribute__ ((gcc_struct));
5520 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5522 struct __ecereNameSpace__ecere__com__Instance * module;
5524 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5526 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5528 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5530 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5532 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5538 extern struct Expression * CopyExpression(struct Expression * exp);
5540 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5542 void ReadString(char * output, char * string);
5544 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5546 extern struct TypeName * QMkClass(const char * spec, struct Declarator * decl);
5548 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5550 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5552 struct Type * source;
5553 struct Type * realDest = dest;
5554 struct Type * backupSourceExpType = (((void *)0));
5555 struct Expression * computedExp = sourceExp;
5558 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5560 computedExp = CopyExpression(sourceExp);
5561 ComputeExpression(computedExp);
5563 source = sourceExp->expType;
5564 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5566 if(computedExp != sourceExp)
5568 FreeExpression(computedExp);
5569 computedExp = sourceExp;
5574 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5576 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5578 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5580 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5582 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5584 if(sourceBase == destBase)
5586 if(computedExp != sourceExp)
5588 FreeExpression(computedExp);
5589 computedExp = sourceExp;
5598 struct __ecereNameSpace__ecere__sys__OldList * specs;
5599 unsigned int flag = 0;
5600 long long value = (((int)0x7fffffff));
5603 if(computedExp->type == 2)
5605 if(source->isSigned)
5606 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5608 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5610 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5612 if(source->isSigned)
5613 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5615 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5617 if(computedExp != sourceExp)
5619 FreeExpression(computedExp);
5620 computedExp = sourceExp;
5622 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "ecere::com::unichar"))
5625 source = __extension__ ({
5626 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5628 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5633 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5635 if(_class && _class->type == 3)
5637 if(source->kind != 8)
5639 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5640 struct Type * tempDest, * tempSource;
5642 for(; _class->base->type != 1000; _class = _class->base)
5645 tempDest = tempType;
5648 _class->symbol = FindClass(_class->fullName);
5649 tempType->__anon1._class = _class->symbol;
5650 tempType->truth = dest->truth;
5651 if(tempType->__anon1._class)
5652 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5653 backupSourceExpType = sourceExp->expType;
5654 sourceExp->expType = dest;
5657 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5660 if(_class && _class->type == 2 && source->kind != 8)
5662 if(!dest->__anon1._class->__anon1.registered->dataType)
5663 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5664 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5667 FreeType(sourceExp->expType);
5668 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5672 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5674 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5675 struct Declarator * decl;
5678 ReadString(string, sourceExp->__anon1.__anon2.string);
5679 decl = SpecDeclFromString(string, specs, (((void *)0)));
5680 FreeExpContents(sourceExp);
5681 FreeType(sourceExp->expType);
5682 sourceExp->type = 24;
5683 sourceExp->__anon1._classExp.specifiers = specs;
5684 sourceExp->__anon1._classExp.decl = decl;
5685 sourceExp->expType = dest;
5689 if(backupSourceExpType)
5690 FreeType(backupSourceExpType);
5694 else if(source->kind == 8)
5696 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5698 if(_class && (_class->type == 3 || _class->type == 2))
5702 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5703 struct Type * tempDest, * tempSource;
5705 if(!source->__anon1._class->__anon1.registered->dataType)
5706 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5707 for(; _class->base->type != 1000; _class = _class->base)
5710 tempSource = tempType;
5712 tempType->__anon1._class = FindClass(_class->fullName);
5713 tempType->truth = source->truth;
5714 tempType->classObjectType = source->classObjectType;
5715 if(tempType->__anon1._class)
5716 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5717 if(conversions->last)
5719 ((struct Conversion *)conversions->last)->resultType = dest;
5722 FreeType(sourceExp->expType);
5723 sourceExp->expType = MkClassType(_class->fullName);
5724 sourceExp->expType->truth = source->truth;
5725 sourceExp->expType->classObjectType = source->classObjectType;
5726 if(!sourceExp->destType)
5728 FreeType(sourceExp->destType);
5729 sourceExp->destType = sourceExp->expType;
5730 if(sourceExp->expType)
5731 sourceExp->expType->refCount++;
5733 if(!_class->dataType)
5734 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5736 dest = MkClassType(source->__anon1._class->string);
5737 dest->truth = source->truth;
5738 dest->classObjectType = source->classObjectType;
5740 source = _class->dataType;
5742 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5748 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5757 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5758 unsigned int fittingValue = 0;
5760 if(_class && _class->type == 4)
5762 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5763 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5765 if(c && value >= 0 && value <= c->largest)
5768 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5770 if(_class->type == 0 || _class->type == 5)
5772 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5774 *newExp = *sourceExp;
5775 if(sourceExp->destType)
5776 sourceExp->destType->refCount++;
5777 if(sourceExp->expType)
5778 sourceExp->expType->refCount++;
5779 sourceExp->type = 11;
5780 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5781 sourceExp->__anon1.cast.exp = newExp;
5782 FreeType(sourceExp->expType);
5783 sourceExp->expType = (((void *)0));
5784 ProcessExpressionType(sourceExp);
5787 FreeType(sourceExp->expType);
5788 sourceExp->expType = dest;
5793 if(backupSourceExpType)
5794 FreeType(backupSourceExpType);
5797 if(!_class->dataType)
5798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5800 dest = _class->dataType;
5803 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5805 specs = MkListOne(MkSpecifier(DOUBLE));
5807 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5809 specs = MkListOne(MkSpecifier(FLOAT));
5811 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5815 ListAdd(specs, MkSpecifier(UNSIGNED));
5816 ListAdd(specs, MkSpecifier(INT64));
5818 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5822 ListAdd(specs, MkSpecifier(UNSIGNED));
5823 ListAdd(specs, MkSpecifier(INT));
5825 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5829 ListAdd(specs, MkSpecifier(UNSIGNED));
5830 ListAdd(specs, MkSpecifier(SHORT));
5832 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5836 ListAdd(specs, MkSpecifier(UNSIGNED));
5837 ListAdd(specs, MkSpecifier(CHAR));
5843 if(backupSourceExpType)
5845 if(sourceExp->expType)
5846 FreeType(sourceExp->expType);
5847 sourceExp->expType = backupSourceExpType;
5852 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 == 24 || source->kind == 1))
5854 specs = MkListOne(MkSpecifier(DOUBLE));
5856 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5858 specs = MkListOne(MkSpecifier(FLOAT));
5860 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5863 ListAdd(specs, MkSpecifier(BOOL));
5865 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5869 ListAdd(specs, MkSpecifier(UNSIGNED));
5870 ListAdd(specs, MkSpecifier(CHAR));
5872 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5876 ListAdd(specs, MkSpecifier(UNSIGNED));
5877 ListAdd(specs, MkSpecifier(SHORT));
5879 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5883 ListAdd(specs, MkSpecifier(UNSIGNED));
5884 ListAdd(specs, MkSpecifier(INT));
5886 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5890 ListAdd(specs, MkSpecifier(UNSIGNED));
5891 ListAdd(specs, MkSpecifier(INT64));
5893 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5895 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5901 if(backupSourceExpType)
5903 if(sourceExp->expType)
5904 FreeType(sourceExp->expType);
5905 sourceExp->expType = backupSourceExpType;
5909 if(!flag && !sourceExp->opDestType)
5911 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5913 *newExp = *sourceExp;
5914 newExp->prev = (((void *)0));
5915 newExp->next = (((void *)0));
5916 if(sourceExp->destType)
5917 sourceExp->destType->refCount++;
5918 if(sourceExp->expType)
5919 sourceExp->expType->refCount++;
5920 sourceExp->type = 11;
5921 if(realDest->kind == 8)
5923 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5924 FreeList(specs, (void *)(FreeSpecifier));
5927 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5928 if(newExp->type == 4)
5930 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5933 sourceExp->__anon1.cast.exp = newExp;
5934 FreeType(sourceExp->expType);
5935 sourceExp->expType = (((void *)0));
5936 ProcessExpressionType(sourceExp);
5939 FreeList(specs, (void *)(FreeSpecifier));
5942 if(backupSourceExpType)
5943 FreeType(backupSourceExpType);
5948 if(computedExp != sourceExp)
5950 FreeExpression(computedExp);
5951 computedExp = sourceExp;
5953 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5954 sourceExp = (*sourceExp->__anon1.list).last;
5955 if(sourceExp->type == 0)
5957 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5961 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5963 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5964 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5968 for(; _class && _class->type == 4; _class = _class->base)
5970 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5971 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5973 for(value = e->values.first; value; value = value->next)
5975 if(!strcmp(value->name, id->string))
5980 FreeExpContents(sourceExp);
5981 FreeType(sourceExp->expType);
5982 sourceExp->isConstant = 1;
5983 sourceExp->expType = MkClassType(_class->fullName);
5985 sourceExp->type = 2;
5986 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5987 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5989 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5998 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
6009 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6011 int value2 = op2->__anon1.i;
6014 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6017 exp->expType = op1->type;
6019 op1->type->refCount++;
6024 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6026 unsigned int value2 = op2->__anon1.ui;
6029 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6032 exp->expType = op1->type;
6034 op1->type->refCount++;
6039 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6041 long long value2 = op2->__anon1.i64;
6044 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6047 exp->expType = op1->type;
6049 op1->type->refCount++;
6054 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6056 uint64 value2 = op2->__anon1.ui64;
6059 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6062 exp->expType = op1->type;
6064 op1->type->refCount++;
6069 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6071 short value2 = op2->__anon1.s;
6074 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6077 exp->expType = op1->type;
6079 op1->type->refCount++;
6084 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6086 unsigned short value2 = op2->__anon1.us;
6089 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6092 exp->expType = op1->type;
6094 op1->type->refCount++;
6099 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6101 char value2 = op2->__anon1.c;
6104 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6107 exp->expType = op1->type;
6109 op1->type->refCount++;
6114 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6116 unsigned char value2 = op2->__anon1.uc;
6119 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6122 exp->expType = op1->type;
6124 op1->type->refCount++;
6129 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6131 float value2 = op2->__anon1.f;
6134 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6137 exp->expType = op1->type;
6139 op1->type->refCount++;
6144 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6146 double value2 = op2->__anon1.d;
6149 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6152 exp->expType = op1->type;
6154 op1->type->refCount++;
6159 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6161 int value2 = op2->__anon1.i;
6164 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6167 exp->expType = op1->type;
6169 op1->type->refCount++;
6174 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6176 unsigned int value2 = op2->__anon1.ui;
6179 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6182 exp->expType = op1->type;
6184 op1->type->refCount++;
6189 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6191 long long value2 = op2->__anon1.i64;
6194 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6197 exp->expType = op1->type;
6199 op1->type->refCount++;
6204 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6206 uint64 value2 = op2->__anon1.ui64;
6209 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6212 exp->expType = op1->type;
6214 op1->type->refCount++;
6219 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6221 short value2 = op2->__anon1.s;
6224 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6227 exp->expType = op1->type;
6229 op1->type->refCount++;
6234 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6236 unsigned short value2 = op2->__anon1.us;
6239 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6242 exp->expType = op1->type;
6244 op1->type->refCount++;
6249 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6251 char value2 = op2->__anon1.c;
6254 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6257 exp->expType = op1->type;
6259 op1->type->refCount++;
6264 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6266 unsigned char value2 = op2->__anon1.uc;
6269 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6272 exp->expType = op1->type;
6274 op1->type->refCount++;
6279 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6281 float value2 = op2->__anon1.f;
6284 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6287 exp->expType = op1->type;
6289 op1->type->refCount++;
6294 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6296 double value2 = op2->__anon1.d;
6299 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6302 exp->expType = op1->type;
6304 op1->type->refCount++;
6309 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6311 int value2 = op2->__anon1.i;
6314 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6317 exp->expType = op1->type;
6319 op1->type->refCount++;
6324 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6326 unsigned int value2 = op2->__anon1.ui;
6329 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6332 exp->expType = op1->type;
6334 op1->type->refCount++;
6339 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6341 long long value2 = op2->__anon1.i64;
6344 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6347 exp->expType = op1->type;
6349 op1->type->refCount++;
6354 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6356 uint64 value2 = op2->__anon1.ui64;
6359 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6371 short value2 = op2->__anon1.s;
6374 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6377 exp->expType = op1->type;
6379 op1->type->refCount++;
6384 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6386 unsigned short value2 = op2->__anon1.us;
6389 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6392 exp->expType = op1->type;
6394 op1->type->refCount++;
6399 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6401 char value2 = op2->__anon1.c;
6404 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6407 exp->expType = op1->type;
6409 op1->type->refCount++;
6414 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6416 unsigned char value2 = op2->__anon1.uc;
6419 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6422 exp->expType = op1->type;
6424 op1->type->refCount++;
6429 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6431 float value2 = op2->__anon1.f;
6434 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6437 exp->expType = op1->type;
6439 op1->type->refCount++;
6444 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6446 double value2 = op2->__anon1.d;
6449 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6452 exp->expType = op1->type;
6454 op1->type->refCount++;
6459 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6461 int value2 = op2->__anon1.i;
6464 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6467 exp->expType = op1->type;
6469 op1->type->refCount++;
6474 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6476 unsigned int value2 = op2->__anon1.ui;
6479 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6482 exp->expType = op1->type;
6484 op1->type->refCount++;
6489 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6491 long long value2 = op2->__anon1.i64;
6494 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6497 exp->expType = op1->type;
6499 op1->type->refCount++;
6504 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6506 uint64 value2 = op2->__anon1.ui64;
6509 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6512 exp->expType = op1->type;
6514 op1->type->refCount++;
6519 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6521 short value2 = op2->__anon1.s;
6524 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6527 exp->expType = op1->type;
6529 op1->type->refCount++;
6534 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6536 unsigned short value2 = op2->__anon1.us;
6539 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6542 exp->expType = op1->type;
6544 op1->type->refCount++;
6549 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6551 char value2 = op2->__anon1.c;
6554 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6557 exp->expType = op1->type;
6559 op1->type->refCount++;
6564 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6566 unsigned char value2 = op2->__anon1.uc;
6569 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6572 exp->expType = op1->type;
6574 op1->type->refCount++;
6579 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6581 float value2 = op2->__anon1.f;
6584 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6587 exp->expType = op1->type;
6589 op1->type->refCount++;
6594 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6596 double value2 = op2->__anon1.d;
6599 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6602 exp->expType = op1->type;
6604 op1->type->refCount++;
6609 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6611 int value2 = op2->__anon1.i;
6614 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6617 exp->expType = op1->type;
6619 op1->type->refCount++;
6624 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6626 unsigned int value2 = op2->__anon1.ui;
6629 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6632 exp->expType = op1->type;
6634 op1->type->refCount++;
6639 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6641 long long value2 = op2->__anon1.i64;
6644 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6647 exp->expType = op1->type;
6649 op1->type->refCount++;
6654 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6656 uint64 value2 = op2->__anon1.ui64;
6659 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6662 exp->expType = op1->type;
6664 op1->type->refCount++;
6669 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6671 short value2 = op2->__anon1.s;
6674 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6677 exp->expType = op1->type;
6679 op1->type->refCount++;
6684 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6686 unsigned short value2 = op2->__anon1.us;
6689 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6692 exp->expType = op1->type;
6694 op1->type->refCount++;
6699 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6701 char value2 = op2->__anon1.c;
6704 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6707 exp->expType = op1->type;
6709 op1->type->refCount++;
6714 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6716 unsigned char value2 = op2->__anon1.uc;
6719 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6722 exp->expType = op1->type;
6724 op1->type->refCount++;
6729 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6732 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6735 exp->expType = op1->type;
6737 op1->type->refCount++;
6742 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6745 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6748 exp->expType = op1->type;
6750 op1->type->refCount++;
6755 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6758 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6761 exp->expType = op1->type;
6763 op1->type->refCount++;
6768 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6771 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6774 exp->expType = op1->type;
6776 op1->type->refCount++;
6781 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6784 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6787 exp->expType = op1->type;
6789 op1->type->refCount++;
6794 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6797 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6800 exp->expType = op1->type;
6802 op1->type->refCount++;
6807 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6810 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6813 exp->expType = op1->type;
6815 op1->type->refCount++;
6820 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6823 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6826 exp->expType = op1->type;
6828 op1->type->refCount++;
6833 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6836 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6849 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6852 exp->expType = op1->type;
6854 op1->type->refCount++;
6859 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6862 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6865 exp->expType = op1->type;
6867 op1->type->refCount++;
6872 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6875 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6878 exp->expType = op1->type;
6880 op1->type->refCount++;
6885 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6888 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6891 exp->expType = op1->type;
6893 op1->type->refCount++;
6898 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6901 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6904 exp->expType = op1->type;
6906 op1->type->refCount++;
6911 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6914 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6917 exp->expType = op1->type;
6919 op1->type->refCount++;
6924 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6927 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6930 exp->expType = op1->type;
6932 op1->type->refCount++;
6937 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6940 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6943 exp->expType = op1->type;
6945 op1->type->refCount++;
6950 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6953 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6956 exp->expType = op1->type;
6958 op1->type->refCount++;
6963 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6966 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6969 exp->expType = op1->type;
6971 op1->type->refCount++;
6976 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6979 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6982 exp->expType = op1->type;
6984 op1->type->refCount++;
6989 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6992 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6995 exp->expType = op1->type;
6997 op1->type->refCount++;
7002 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7005 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7008 exp->expType = op1->type;
7010 op1->type->refCount++;
7015 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7018 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7021 exp->expType = op1->type;
7023 op1->type->refCount++;
7028 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7031 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7034 exp->expType = op1->type;
7036 op1->type->refCount++;
7041 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7044 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7047 exp->expType = op1->type;
7049 op1->type->refCount++;
7054 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7057 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7060 exp->expType = op1->type;
7062 op1->type->refCount++;
7067 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7070 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7073 exp->expType = op1->type;
7075 op1->type->refCount++;
7080 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7083 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7086 exp->expType = op1->type;
7088 op1->type->refCount++;
7093 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7096 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7099 exp->expType = op1->type;
7101 op1->type->refCount++;
7106 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7109 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7112 exp->expType = op1->type;
7114 op1->type->refCount++;
7119 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7121 int value2 = op2->__anon1.i;
7124 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7127 exp->expType = op1->type;
7129 op1->type->refCount++;
7134 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7136 unsigned int value2 = op2->__anon1.ui;
7139 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7142 exp->expType = op1->type;
7144 op1->type->refCount++;
7149 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7151 long long value2 = op2->__anon1.i64;
7154 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7157 exp->expType = op1->type;
7159 op1->type->refCount++;
7164 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7166 uint64 value2 = op2->__anon1.ui64;
7169 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7172 exp->expType = op1->type;
7174 op1->type->refCount++;
7179 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7181 short value2 = op2->__anon1.s;
7184 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7187 exp->expType = op1->type;
7189 op1->type->refCount++;
7194 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7196 unsigned short value2 = op2->__anon1.us;
7199 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7202 exp->expType = op1->type;
7204 op1->type->refCount++;
7209 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7211 char value2 = op2->__anon1.c;
7214 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7217 exp->expType = op1->type;
7219 op1->type->refCount++;
7224 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7226 unsigned char value2 = op2->__anon1.uc;
7229 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7232 exp->expType = op1->type;
7234 op1->type->refCount++;
7239 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7241 float value2 = op2->__anon1.f;
7244 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7247 exp->expType = op1->type;
7249 op1->type->refCount++;
7254 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7256 double value2 = op2->__anon1.d;
7259 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7262 exp->expType = op1->type;
7264 op1->type->refCount++;
7269 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7271 int value2 = op2->__anon1.i;
7274 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7277 exp->expType = op1->type;
7279 op1->type->refCount++;
7284 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7286 unsigned int value2 = op2->__anon1.ui;
7289 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7292 exp->expType = op1->type;
7294 op1->type->refCount++;
7299 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7301 long long value2 = op2->__anon1.i64;
7304 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7307 exp->expType = op1->type;
7309 op1->type->refCount++;
7314 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7316 uint64 value2 = op2->__anon1.ui64;
7319 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7322 exp->expType = op1->type;
7324 op1->type->refCount++;
7329 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7331 short value2 = op2->__anon1.s;
7334 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7337 exp->expType = op1->type;
7339 op1->type->refCount++;
7344 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7346 unsigned short value2 = op2->__anon1.us;
7349 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7352 exp->expType = op1->type;
7354 op1->type->refCount++;
7359 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7361 char value2 = op2->__anon1.c;
7364 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7367 exp->expType = op1->type;
7369 op1->type->refCount++;
7374 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7376 unsigned char value2 = op2->__anon1.uc;
7379 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7382 exp->expType = op1->type;
7384 op1->type->refCount++;
7389 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7391 float value2 = op2->__anon1.f;
7394 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7397 exp->expType = op1->type;
7399 op1->type->refCount++;
7404 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7406 double value2 = op2->__anon1.d;
7409 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7412 exp->expType = op1->type;
7414 op1->type->refCount++;
7419 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7421 int value2 = op2->__anon1.i;
7424 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7427 exp->expType = op1->type;
7429 op1->type->refCount++;
7434 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7436 unsigned int value2 = op2->__anon1.ui;
7439 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7442 exp->expType = op1->type;
7444 op1->type->refCount++;
7449 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7451 long long value2 = op2->__anon1.i64;
7454 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7457 exp->expType = op1->type;
7459 op1->type->refCount++;
7464 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7466 uint64 value2 = op2->__anon1.ui64;
7469 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7472 exp->expType = op1->type;
7474 op1->type->refCount++;
7479 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7481 short value2 = op2->__anon1.s;
7484 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7487 exp->expType = op1->type;
7489 op1->type->refCount++;
7494 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7496 unsigned short value2 = op2->__anon1.us;
7499 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7502 exp->expType = op1->type;
7504 op1->type->refCount++;
7509 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7511 char value2 = op2->__anon1.c;
7514 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7517 exp->expType = op1->type;
7519 op1->type->refCount++;
7524 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7526 unsigned char value2 = op2->__anon1.uc;
7529 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7532 exp->expType = op1->type;
7534 op1->type->refCount++;
7539 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7541 float value2 = op2->__anon1.f;
7544 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7547 exp->expType = op1->type;
7549 op1->type->refCount++;
7554 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7556 double value2 = op2->__anon1.d;
7559 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7562 exp->expType = op1->type;
7564 op1->type->refCount++;
7569 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7571 int value2 = op2->__anon1.i;
7574 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7577 exp->expType = op1->type;
7579 op1->type->refCount++;
7584 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7586 unsigned int value2 = op2->__anon1.ui;
7589 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7592 exp->expType = op1->type;
7594 op1->type->refCount++;
7599 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7601 long long value2 = op2->__anon1.i64;
7604 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7607 exp->expType = op1->type;
7609 op1->type->refCount++;
7614 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7616 uint64 value2 = op2->__anon1.ui64;
7619 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7622 exp->expType = op1->type;
7624 op1->type->refCount++;
7629 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7631 short value2 = op2->__anon1.s;
7634 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7637 exp->expType = op1->type;
7639 op1->type->refCount++;
7644 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7646 unsigned short value2 = op2->__anon1.us;
7649 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7652 exp->expType = op1->type;
7654 op1->type->refCount++;
7659 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7661 char value2 = op2->__anon1.c;
7664 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7667 exp->expType = op1->type;
7669 op1->type->refCount++;
7674 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7676 unsigned char value2 = op2->__anon1.uc;
7679 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7682 exp->expType = op1->type;
7684 op1->type->refCount++;
7689 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7691 float value2 = op2->__anon1.f;
7694 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7697 exp->expType = op1->type;
7699 op1->type->refCount++;
7704 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7706 double value2 = op2->__anon1.d;
7709 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7712 exp->expType = op1->type;
7714 op1->type->refCount++;
7719 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7721 int value2 = op2->__anon1.i;
7724 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7727 exp->expType = op1->type;
7729 op1->type->refCount++;
7734 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7736 unsigned int value2 = op2->__anon1.ui;
7739 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7742 exp->expType = op1->type;
7744 op1->type->refCount++;
7749 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7751 long long value2 = op2->__anon1.i64;
7754 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7757 exp->expType = op1->type;
7759 op1->type->refCount++;
7764 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7766 uint64 value2 = op2->__anon1.ui64;
7769 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7772 exp->expType = op1->type;
7774 op1->type->refCount++;
7779 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7781 short value2 = op2->__anon1.s;
7784 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7787 exp->expType = op1->type;
7789 op1->type->refCount++;
7794 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7796 unsigned short value2 = op2->__anon1.us;
7799 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7802 exp->expType = op1->type;
7804 op1->type->refCount++;
7809 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7811 char value2 = op2->__anon1.c;
7814 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7817 exp->expType = op1->type;
7819 op1->type->refCount++;
7824 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7826 unsigned char value2 = op2->__anon1.uc;
7829 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7832 exp->expType = op1->type;
7834 op1->type->refCount++;
7839 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7841 float value2 = op2->__anon1.f;
7844 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7847 exp->expType = op1->type;
7849 op1->type->refCount++;
7854 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7856 double value2 = op2->__anon1.d;
7859 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7862 exp->expType = op1->type;
7864 op1->type->refCount++;
7869 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7871 int value2 = op2->__anon1.i;
7874 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7877 exp->expType = op1->type;
7879 op1->type->refCount++;
7884 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7886 unsigned int value2 = op2->__anon1.ui;
7889 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7892 exp->expType = op1->type;
7894 op1->type->refCount++;
7899 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7901 long long value2 = op2->__anon1.i64;
7904 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7916 uint64 value2 = op2->__anon1.ui64;
7919 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7922 exp->expType = op1->type;
7924 op1->type->refCount++;
7929 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7931 short value2 = op2->__anon1.s;
7934 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7937 exp->expType = op1->type;
7939 op1->type->refCount++;
7944 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7946 unsigned short value2 = op2->__anon1.us;
7949 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7952 exp->expType = op1->type;
7954 op1->type->refCount++;
7959 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7961 char value2 = op2->__anon1.c;
7964 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7967 exp->expType = op1->type;
7969 op1->type->refCount++;
7974 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7976 unsigned char value2 = op2->__anon1.uc;
7979 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7982 exp->expType = op1->type;
7984 op1->type->refCount++;
7989 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7991 int value2 = op2->__anon1.i;
7994 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7997 exp->expType = op1->type;
7999 op1->type->refCount++;
8004 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8006 unsigned int value2 = op2->__anon1.ui;
8009 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8012 exp->expType = op1->type;
8014 op1->type->refCount++;
8019 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8021 long long value2 = op2->__anon1.i64;
8024 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8027 exp->expType = op1->type;
8029 op1->type->refCount++;
8034 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8036 uint64 value2 = op2->__anon1.ui64;
8039 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8042 exp->expType = op1->type;
8044 op1->type->refCount++;
8049 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8051 short value2 = op2->__anon1.s;
8054 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8057 exp->expType = op1->type;
8059 op1->type->refCount++;
8064 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8066 unsigned short value2 = op2->__anon1.us;
8069 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8072 exp->expType = op1->type;
8074 op1->type->refCount++;
8079 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8081 char value2 = op2->__anon1.c;
8084 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8087 exp->expType = op1->type;
8089 op1->type->refCount++;
8094 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8096 unsigned char value2 = op2->__anon1.uc;
8099 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8102 exp->expType = op1->type;
8104 op1->type->refCount++;
8109 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8111 int value2 = op2->__anon1.i;
8114 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8117 exp->expType = op1->type;
8119 op1->type->refCount++;
8124 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8126 unsigned int value2 = op2->__anon1.ui;
8129 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8132 exp->expType = op1->type;
8134 op1->type->refCount++;
8139 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8141 long long value2 = op2->__anon1.i64;
8144 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8147 exp->expType = op1->type;
8149 op1->type->refCount++;
8154 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8156 uint64 value2 = op2->__anon1.ui64;
8159 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8162 exp->expType = op1->type;
8164 op1->type->refCount++;
8169 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8171 short value2 = op2->__anon1.s;
8174 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8177 exp->expType = op1->type;
8179 op1->type->refCount++;
8184 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8186 unsigned short value2 = op2->__anon1.us;
8189 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8192 exp->expType = op1->type;
8194 op1->type->refCount++;
8199 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8201 char value2 = op2->__anon1.c;
8204 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8207 exp->expType = op1->type;
8209 op1->type->refCount++;
8214 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8216 unsigned char value2 = op2->__anon1.uc;
8219 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8222 exp->expType = op1->type;
8224 op1->type->refCount++;
8229 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8231 int value2 = op2->__anon1.i;
8234 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8237 exp->expType = op1->type;
8239 op1->type->refCount++;
8244 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8246 unsigned int value2 = op2->__anon1.ui;
8249 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8252 exp->expType = op1->type;
8254 op1->type->refCount++;
8259 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8261 long long value2 = op2->__anon1.i64;
8264 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8267 exp->expType = op1->type;
8269 op1->type->refCount++;
8274 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8276 uint64 value2 = op2->__anon1.ui64;
8279 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8282 exp->expType = op1->type;
8284 op1->type->refCount++;
8289 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8291 short value2 = op2->__anon1.s;
8294 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8297 exp->expType = op1->type;
8299 op1->type->refCount++;
8304 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8306 unsigned short value2 = op2->__anon1.us;
8309 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8312 exp->expType = op1->type;
8314 op1->type->refCount++;
8319 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8321 char value2 = op2->__anon1.c;
8324 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8327 exp->expType = op1->type;
8329 op1->type->refCount++;
8334 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8336 unsigned char value2 = op2->__anon1.uc;
8339 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8342 exp->expType = op1->type;
8344 op1->type->refCount++;
8349 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8351 int value2 = op2->__anon1.i;
8354 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8357 exp->expType = op1->type;
8359 op1->type->refCount++;
8364 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8366 unsigned int value2 = op2->__anon1.ui;
8369 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8372 exp->expType = op1->type;
8374 op1->type->refCount++;
8379 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8381 long long value2 = op2->__anon1.i64;
8384 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8387 exp->expType = op1->type;
8389 op1->type->refCount++;
8394 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8396 uint64 value2 = op2->__anon1.ui64;
8399 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8402 exp->expType = op1->type;
8404 op1->type->refCount++;
8409 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8411 short value2 = op2->__anon1.s;
8414 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8417 exp->expType = op1->type;
8419 op1->type->refCount++;
8424 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8426 unsigned short value2 = op2->__anon1.us;
8429 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8432 exp->expType = op1->type;
8434 op1->type->refCount++;
8439 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8441 char value2 = op2->__anon1.c;
8444 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8447 exp->expType = op1->type;
8449 op1->type->refCount++;
8454 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8456 unsigned char value2 = op2->__anon1.uc;
8459 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8462 exp->expType = op1->type;
8464 op1->type->refCount++;
8469 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8471 int value2 = op2->__anon1.i;
8474 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8477 exp->expType = op1->type;
8479 op1->type->refCount++;
8484 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8486 unsigned int value2 = op2->__anon1.ui;
8489 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8492 exp->expType = op1->type;
8494 op1->type->refCount++;
8499 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8501 long long value2 = op2->__anon1.i64;
8504 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8507 exp->expType = op1->type;
8509 op1->type->refCount++;
8514 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8516 uint64 value2 = op2->__anon1.ui64;
8519 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8522 exp->expType = op1->type;
8524 op1->type->refCount++;
8529 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8531 short value2 = op2->__anon1.s;
8534 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8537 exp->expType = op1->type;
8539 op1->type->refCount++;
8544 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8546 unsigned short value2 = op2->__anon1.us;
8549 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8552 exp->expType = op1->type;
8554 op1->type->refCount++;
8559 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8561 char value2 = op2->__anon1.c;
8564 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8567 exp->expType = op1->type;
8569 op1->type->refCount++;
8574 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8576 unsigned char value2 = op2->__anon1.uc;
8579 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8582 exp->expType = op1->type;
8584 op1->type->refCount++;
8589 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8592 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8595 exp->expType = op1->type;
8597 op1->type->refCount++;
8602 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8605 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8608 exp->expType = op1->type;
8610 op1->type->refCount++;
8615 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8618 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8621 exp->expType = op1->type;
8623 op1->type->refCount++;
8628 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8631 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8634 exp->expType = op1->type;
8636 op1->type->refCount++;
8641 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8644 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8647 exp->expType = op1->type;
8649 op1->type->refCount++;
8654 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8657 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8670 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8673 exp->expType = op1->type;
8675 op1->type->refCount++;
8680 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8683 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8686 exp->expType = op1->type;
8688 op1->type->refCount++;
8693 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8695 int value2 = op2->__anon1.i;
8698 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8701 exp->expType = op1->type;
8703 op1->type->refCount++;
8708 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8710 unsigned int value2 = op2->__anon1.ui;
8713 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8716 exp->expType = op1->type;
8718 op1->type->refCount++;
8723 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8725 long long value2 = op2->__anon1.i64;
8728 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8731 exp->expType = op1->type;
8733 op1->type->refCount++;
8738 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8740 uint64 value2 = op2->__anon1.ui64;
8743 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8746 exp->expType = op1->type;
8748 op1->type->refCount++;
8753 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8755 short value2 = op2->__anon1.s;
8758 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8761 exp->expType = op1->type;
8763 op1->type->refCount++;
8768 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8770 unsigned short value2 = op2->__anon1.us;
8773 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8776 exp->expType = op1->type;
8778 op1->type->refCount++;
8783 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8785 char value2 = op2->__anon1.c;
8788 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8791 exp->expType = op1->type;
8793 op1->type->refCount++;
8798 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8800 unsigned char value2 = op2->__anon1.uc;
8803 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8806 exp->expType = op1->type;
8808 op1->type->refCount++;
8813 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8815 int value2 = op2->__anon1.i;
8818 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8821 exp->expType = op1->type;
8823 op1->type->refCount++;
8828 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8830 unsigned int value2 = op2->__anon1.ui;
8833 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8836 exp->expType = op1->type;
8838 op1->type->refCount++;
8843 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8845 long long value2 = op2->__anon1.i64;
8848 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8851 exp->expType = op1->type;
8853 op1->type->refCount++;
8858 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8860 uint64 value2 = op2->__anon1.ui64;
8863 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8866 exp->expType = op1->type;
8868 op1->type->refCount++;
8873 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8875 short value2 = op2->__anon1.s;
8878 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8881 exp->expType = op1->type;
8883 op1->type->refCount++;
8888 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8890 unsigned short value2 = op2->__anon1.us;
8893 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8896 exp->expType = op1->type;
8898 op1->type->refCount++;
8903 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8905 char value2 = op2->__anon1.c;
8908 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8911 exp->expType = op1->type;
8913 op1->type->refCount++;
8918 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8920 unsigned char value2 = op2->__anon1.uc;
8923 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8926 exp->expType = op1->type;
8928 op1->type->refCount++;
8933 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8935 int value2 = op2->__anon1.i;
8938 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8941 exp->expType = op1->type;
8943 op1->type->refCount++;
8948 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8950 unsigned int value2 = op2->__anon1.ui;
8953 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8956 exp->expType = op1->type;
8958 op1->type->refCount++;
8963 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8965 long long value2 = op2->__anon1.i64;
8968 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8971 exp->expType = op1->type;
8973 op1->type->refCount++;
8978 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8980 uint64 value2 = op2->__anon1.ui64;
8983 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8986 exp->expType = op1->type;
8988 op1->type->refCount++;
8993 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8995 short value2 = op2->__anon1.s;
8998 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
9001 exp->expType = op1->type;
9003 op1->type->refCount++;
9008 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9010 unsigned short value2 = op2->__anon1.us;
9013 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9016 exp->expType = op1->type;
9018 op1->type->refCount++;
9023 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9025 char value2 = op2->__anon1.c;
9028 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9031 exp->expType = op1->type;
9033 op1->type->refCount++;
9038 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9040 unsigned char value2 = op2->__anon1.uc;
9043 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9046 exp->expType = op1->type;
9048 op1->type->refCount++;
9053 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9055 int value2 = op2->__anon1.i;
9058 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9061 exp->expType = op1->type;
9063 op1->type->refCount++;
9068 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9070 unsigned int value2 = op2->__anon1.ui;
9073 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9076 exp->expType = op1->type;
9078 op1->type->refCount++;
9083 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9085 long long value2 = op2->__anon1.i64;
9088 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9091 exp->expType = op1->type;
9093 op1->type->refCount++;
9098 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9100 uint64 value2 = op2->__anon1.ui64;
9103 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9106 exp->expType = op1->type;
9108 op1->type->refCount++;
9113 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9115 short value2 = op2->__anon1.s;
9118 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9121 exp->expType = op1->type;
9123 op1->type->refCount++;
9128 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9130 unsigned short value2 = op2->__anon1.us;
9133 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9136 exp->expType = op1->type;
9138 op1->type->refCount++;
9143 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9145 char value2 = op2->__anon1.c;
9148 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9151 exp->expType = op1->type;
9153 op1->type->refCount++;
9158 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9160 unsigned char value2 = op2->__anon1.uc;
9163 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9166 exp->expType = op1->type;
9168 op1->type->refCount++;
9173 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9175 int value2 = op2->__anon1.i;
9178 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9181 exp->expType = op1->type;
9183 op1->type->refCount++;
9188 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9190 unsigned int value2 = op2->__anon1.ui;
9193 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9196 exp->expType = op1->type;
9198 op1->type->refCount++;
9203 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9205 long long value2 = op2->__anon1.i64;
9208 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9211 exp->expType = op1->type;
9213 op1->type->refCount++;
9218 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9220 uint64 value2 = op2->__anon1.ui64;
9223 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9226 exp->expType = op1->type;
9228 op1->type->refCount++;
9233 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9235 short value2 = op2->__anon1.s;
9238 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9241 exp->expType = op1->type;
9243 op1->type->refCount++;
9248 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9250 unsigned short value2 = op2->__anon1.us;
9253 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9256 exp->expType = op1->type;
9258 op1->type->refCount++;
9263 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9265 char value2 = op2->__anon1.c;
9268 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9271 exp->expType = op1->type;
9273 op1->type->refCount++;
9278 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9280 unsigned char value2 = op2->__anon1.uc;
9283 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9286 exp->expType = op1->type;
9288 op1->type->refCount++;
9293 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9296 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9299 exp->expType = op1->type;
9301 op1->type->refCount++;
9306 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9309 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9312 exp->expType = op1->type;
9314 op1->type->refCount++;
9319 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9322 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9325 exp->expType = op1->type;
9327 op1->type->refCount++;
9332 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9335 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9338 exp->expType = op1->type;
9340 op1->type->refCount++;
9345 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9348 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9351 exp->expType = op1->type;
9353 op1->type->refCount++;
9358 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9361 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9364 exp->expType = op1->type;
9366 op1->type->refCount++;
9371 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9374 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9377 exp->expType = op1->type;
9379 op1->type->refCount++;
9384 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9387 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9390 exp->expType = op1->type;
9392 op1->type->refCount++;
9397 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9399 int value2 = op2->__anon1.i;
9402 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9405 exp->expType = op1->type;
9407 op1->type->refCount++;
9412 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9414 unsigned int value2 = op2->__anon1.ui;
9417 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9420 exp->expType = op1->type;
9422 op1->type->refCount++;
9427 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9429 long long value2 = op2->__anon1.i64;
9432 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9435 exp->expType = op1->type;
9437 op1->type->refCount++;
9442 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9444 uint64 value2 = op2->__anon1.ui64;
9447 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9450 exp->expType = op1->type;
9452 op1->type->refCount++;
9457 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9459 short value2 = op2->__anon1.s;
9462 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9465 exp->expType = op1->type;
9467 op1->type->refCount++;
9472 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9474 unsigned short value2 = op2->__anon1.us;
9477 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9480 exp->expType = op1->type;
9482 op1->type->refCount++;
9487 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9489 char value2 = op2->__anon1.c;
9492 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9495 exp->expType = op1->type;
9497 op1->type->refCount++;
9502 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9504 unsigned char value2 = op2->__anon1.uc;
9507 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9510 exp->expType = op1->type;
9512 op1->type->refCount++;
9517 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9519 float value2 = op2->__anon1.f;
9522 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9525 exp->expType = op1->type;
9527 op1->type->refCount++;
9532 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9534 double value2 = op2->__anon1.d;
9537 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9540 exp->expType = op1->type;
9542 op1->type->refCount++;
9547 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9549 int value2 = op2->__anon1.i;
9552 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9555 exp->expType = op1->type;
9557 op1->type->refCount++;
9562 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9564 unsigned int value2 = op2->__anon1.ui;
9567 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9570 exp->expType = op1->type;
9572 op1->type->refCount++;
9577 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9579 long long value2 = op2->__anon1.i64;
9582 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9585 exp->expType = op1->type;
9587 op1->type->refCount++;
9592 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9594 uint64 value2 = op2->__anon1.ui64;
9597 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9600 exp->expType = op1->type;
9602 op1->type->refCount++;
9607 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9609 short value2 = op2->__anon1.s;
9612 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9615 exp->expType = op1->type;
9617 op1->type->refCount++;
9622 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9624 unsigned short value2 = op2->__anon1.us;
9627 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9630 exp->expType = op1->type;
9632 op1->type->refCount++;
9637 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9639 char value2 = op2->__anon1.c;
9642 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9645 exp->expType = op1->type;
9647 op1->type->refCount++;
9652 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9654 unsigned char value2 = op2->__anon1.uc;
9657 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9660 exp->expType = op1->type;
9662 op1->type->refCount++;
9667 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9669 float value2 = op2->__anon1.f;
9672 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9675 exp->expType = op1->type;
9677 op1->type->refCount++;
9682 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9684 double value2 = op2->__anon1.d;
9687 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9690 exp->expType = op1->type;
9692 op1->type->refCount++;
9697 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9699 int value2 = op2->__anon1.i;
9702 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9705 exp->expType = op1->type;
9707 op1->type->refCount++;
9712 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9714 unsigned int value2 = op2->__anon1.ui;
9717 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9720 exp->expType = op1->type;
9722 op1->type->refCount++;
9727 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9729 long long value2 = op2->__anon1.i64;
9732 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9735 exp->expType = op1->type;
9737 op1->type->refCount++;
9742 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9744 uint64 value2 = op2->__anon1.ui64;
9747 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9750 exp->expType = op1->type;
9752 op1->type->refCount++;
9757 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9759 short value2 = op2->__anon1.s;
9762 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9765 exp->expType = op1->type;
9767 op1->type->refCount++;
9772 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9774 unsigned short value2 = op2->__anon1.us;
9777 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9780 exp->expType = op1->type;
9782 op1->type->refCount++;
9787 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9789 char value2 = op2->__anon1.c;
9792 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9795 exp->expType = op1->type;
9797 op1->type->refCount++;
9802 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9804 unsigned char value2 = op2->__anon1.uc;
9807 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9810 exp->expType = op1->type;
9812 op1->type->refCount++;
9817 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9819 float value2 = op2->__anon1.f;
9822 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9825 exp->expType = op1->type;
9827 op1->type->refCount++;
9832 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9834 double value2 = op2->__anon1.d;
9837 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9840 exp->expType = op1->type;
9842 op1->type->refCount++;
9847 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9849 int value2 = op2->__anon1.i;
9852 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9855 exp->expType = op1->type;
9857 op1->type->refCount++;
9862 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9864 unsigned int value2 = op2->__anon1.ui;
9867 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9870 exp->expType = op1->type;
9872 op1->type->refCount++;
9877 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9879 long long value2 = op2->__anon1.i64;
9882 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9885 exp->expType = op1->type;
9887 op1->type->refCount++;
9892 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9894 uint64 value2 = op2->__anon1.ui64;
9897 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9900 exp->expType = op1->type;
9902 op1->type->refCount++;
9907 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9909 short value2 = op2->__anon1.s;
9912 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9915 exp->expType = op1->type;
9917 op1->type->refCount++;
9922 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9924 unsigned short value2 = op2->__anon1.us;
9927 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9930 exp->expType = op1->type;
9932 op1->type->refCount++;
9937 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9939 char value2 = op2->__anon1.c;
9942 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9945 exp->expType = op1->type;
9947 op1->type->refCount++;
9952 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9954 unsigned char value2 = op2->__anon1.uc;
9957 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9960 exp->expType = op1->type;
9962 op1->type->refCount++;
9967 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9969 float value2 = op2->__anon1.f;
9972 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9975 exp->expType = op1->type;
9977 op1->type->refCount++;
9982 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9984 double value2 = op2->__anon1.d;
9987 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9990 exp->expType = op1->type;
9992 op1->type->refCount++;
9997 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9999 int value2 = op2->__anon1.i;
10002 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10005 exp->expType = op1->type;
10007 op1->type->refCount++;
10012 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10014 unsigned int value2 = op2->__anon1.ui;
10017 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10020 exp->expType = op1->type;
10022 op1->type->refCount++;
10027 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10029 long long value2 = op2->__anon1.i64;
10032 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10035 exp->expType = op1->type;
10037 op1->type->refCount++;
10042 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10044 uint64 value2 = op2->__anon1.ui64;
10047 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10050 exp->expType = op1->type;
10052 op1->type->refCount++;
10057 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10059 short value2 = op2->__anon1.s;
10062 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10065 exp->expType = op1->type;
10067 op1->type->refCount++;
10072 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10074 unsigned short value2 = op2->__anon1.us;
10077 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10080 exp->expType = op1->type;
10082 op1->type->refCount++;
10087 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10089 char value2 = op2->__anon1.c;
10092 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10095 exp->expType = op1->type;
10097 op1->type->refCount++;
10102 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10104 unsigned char value2 = op2->__anon1.uc;
10107 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10110 exp->expType = op1->type;
10112 op1->type->refCount++;
10117 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10119 float value2 = op2->__anon1.f;
10122 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10125 exp->expType = op1->type;
10127 op1->type->refCount++;
10132 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10134 double value2 = op2->__anon1.d;
10137 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10140 exp->expType = op1->type;
10142 op1->type->refCount++;
10147 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10149 int value2 = op2->__anon1.i;
10152 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10155 exp->expType = op1->type;
10157 op1->type->refCount++;
10162 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10164 unsigned int value2 = op2->__anon1.ui;
10167 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10170 exp->expType = op1->type;
10172 op1->type->refCount++;
10177 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10179 long long value2 = op2->__anon1.i64;
10182 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10185 exp->expType = op1->type;
10187 op1->type->refCount++;
10192 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10194 uint64 value2 = op2->__anon1.ui64;
10197 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10200 exp->expType = op1->type;
10202 op1->type->refCount++;
10207 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10209 short value2 = op2->__anon1.s;
10212 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10215 exp->expType = op1->type;
10217 op1->type->refCount++;
10222 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10224 unsigned short value2 = op2->__anon1.us;
10227 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10230 exp->expType = op1->type;
10232 op1->type->refCount++;
10237 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10239 char value2 = op2->__anon1.c;
10242 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10245 exp->expType = op1->type;
10247 op1->type->refCount++;
10252 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10254 unsigned char value2 = op2->__anon1.uc;
10257 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10260 exp->expType = op1->type;
10262 op1->type->refCount++;
10267 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10269 float value2 = op2->__anon1.f;
10272 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10275 exp->expType = op1->type;
10277 op1->type->refCount++;
10282 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10284 double value2 = op2->__anon1.d;
10287 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10290 exp->expType = op1->type;
10292 op1->type->refCount++;
10297 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10299 int value2 = op2->__anon1.i;
10302 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10305 exp->expType = op1->type;
10307 op1->type->refCount++;
10312 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10314 unsigned int value2 = op2->__anon1.ui;
10317 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10320 exp->expType = op1->type;
10322 op1->type->refCount++;
10327 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10329 long long value2 = op2->__anon1.i64;
10332 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10335 exp->expType = op1->type;
10337 op1->type->refCount++;
10342 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10344 uint64 value2 = op2->__anon1.ui64;
10347 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10350 exp->expType = op1->type;
10352 op1->type->refCount++;
10357 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10359 short value2 = op2->__anon1.s;
10362 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10365 exp->expType = op1->type;
10367 op1->type->refCount++;
10372 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10374 unsigned short value2 = op2->__anon1.us;
10377 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10380 exp->expType = op1->type;
10382 op1->type->refCount++;
10387 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10389 char value2 = op2->__anon1.c;
10392 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10395 exp->expType = op1->type;
10397 op1->type->refCount++;
10402 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10404 unsigned char value2 = op2->__anon1.uc;
10407 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10410 exp->expType = op1->type;
10412 op1->type->refCount++;
10417 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10419 float value2 = op2->__anon1.f;
10422 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10425 exp->expType = op1->type;
10427 op1->type->refCount++;
10432 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10434 double value2 = op2->__anon1.d;
10437 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10440 exp->expType = op1->type;
10442 op1->type->refCount++;
10447 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10449 int value2 = op2->__anon1.i;
10452 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10455 exp->expType = op1->type;
10457 op1->type->refCount++;
10462 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10464 unsigned int value2 = op2->__anon1.ui;
10467 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10470 exp->expType = op1->type;
10472 op1->type->refCount++;
10477 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10479 long long value2 = op2->__anon1.i64;
10482 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10485 exp->expType = op1->type;
10487 op1->type->refCount++;
10492 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10494 uint64 value2 = op2->__anon1.ui64;
10497 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10500 exp->expType = op1->type;
10502 op1->type->refCount++;
10507 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10509 short value2 = op2->__anon1.s;
10512 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10515 exp->expType = op1->type;
10517 op1->type->refCount++;
10522 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10524 unsigned short value2 = op2->__anon1.us;
10527 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10530 exp->expType = op1->type;
10532 op1->type->refCount++;
10537 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10539 char value2 = op2->__anon1.c;
10542 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10545 exp->expType = op1->type;
10547 op1->type->refCount++;
10552 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10554 unsigned char value2 = op2->__anon1.uc;
10557 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10560 exp->expType = op1->type;
10562 op1->type->refCount++;
10567 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10569 float value2 = op2->__anon1.f;
10572 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10575 exp->expType = op1->type;
10577 op1->type->refCount++;
10582 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10584 double value2 = op2->__anon1.d;
10587 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10590 exp->expType = op1->type;
10592 op1->type->refCount++;
10597 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10600 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10603 exp->expType = op1->type;
10605 op1->type->refCount++;
10610 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10613 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10616 exp->expType = op1->type;
10618 op1->type->refCount++;
10623 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10626 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10629 exp->expType = op1->type;
10631 op1->type->refCount++;
10636 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10639 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10642 exp->expType = op1->type;
10644 op1->type->refCount++;
10649 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10652 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10655 exp->expType = op1->type;
10657 op1->type->refCount++;
10662 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10665 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10668 exp->expType = op1->type;
10670 op1->type->refCount++;
10675 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10678 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10681 exp->expType = op1->type;
10683 op1->type->refCount++;
10688 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10691 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10694 exp->expType = op1->type;
10696 op1->type->refCount++;
10701 struct OpTable intOps =
10703 (void *)(IntAdd), (void *)(IntSub), (void *)(IntMul), (void *)(IntDiv), (void *)(IntMod), (void *)(IntNeg), (void *)(IntInc), (void *)(IntDec), (void *)(IntAsign), (void *)(IntAddAsign), (void *)(IntSubAsign), (void *)(IntMulAsign), (void *)(IntDivAsign), (void *)(IntModAsign), (void *)(IntBitAnd), (void *)(IntBitOr), (void *)(IntBitXor), (void *)(IntLShift), (void *)(IntRShift), (void *)(IntBitNot), (void *)(IntAndAsign), (void *)(IntOrAsign), (void *)(IntXorAsign), (void *)(IntLShiftAsign), (void *)(IntRShiftAsign), (void *)(IntNot), (void *)(IntEqu), (void *)(IntNqu), (void *)(IntAnd), (void *)(IntOr), (void *)(IntGrt), (void *)(IntSma), (void *)(IntGrtEqu), (void *)(IntSmaEqu), (void *)(IntCond)
10706 struct OpTable uintOps =
10708 (void *)(UIntAdd), (void *)(UIntSub), (void *)(UIntMul), (void *)(UIntDiv), (void *)(UIntMod), (void *)(UIntNeg), (void *)(UIntInc), (void *)(UIntDec), (void *)(UIntAsign), (void *)(UIntAddAsign), (void *)(UIntSubAsign), (void *)(UIntMulAsign), (void *)(UIntDivAsign), (void *)(UIntModAsign), (void *)(UIntBitAnd), (void *)(UIntBitOr), (void *)(UIntBitXor), (void *)(UIntLShift), (void *)(UIntRShift), (void *)(UIntBitNot), (void *)(UIntAndAsign), (void *)(UIntOrAsign), (void *)(UIntXorAsign), (void *)(UIntLShiftAsign), (void *)(UIntRShiftAsign), (void *)(UIntNot), (void *)(UIntEqu), (void *)(UIntNqu), (void *)(UIntAnd), (void *)(UIntOr), (void *)(UIntGrt), (void *)(UIntSma), (void *)(UIntGrtEqu), (void *)(UIntSmaEqu), (void *)(UIntCond)
10711 struct OpTable int64Ops =
10713 (void *)(Int64Add), (void *)(Int64Sub), (void *)(Int64Mul), (void *)(Int64Div), (void *)(Int64Mod), (void *)(Int64Neg), (void *)(Int64Inc), (void *)(Int64Dec), (void *)(Int64Asign), (void *)(Int64AddAsign), (void *)(Int64SubAsign), (void *)(Int64MulAsign), (void *)(Int64DivAsign), (void *)(Int64ModAsign), (void *)(Int64BitAnd), (void *)(Int64BitOr), (void *)(Int64BitXor), (void *)(Int64LShift), (void *)(Int64RShift), (void *)(Int64BitNot), (void *)(Int64AndAsign), (void *)(Int64OrAsign), (void *)(Int64XorAsign), (void *)(Int64LShiftAsign), (void *)(Int64RShiftAsign), (void *)(Int64Not), (void *)(Int64Equ), (void *)(Int64Nqu), (void *)(Int64And), (void *)(Int64Or), (void *)(Int64Grt), (void *)(Int64Sma), (void *)(Int64GrtEqu), (void *)(Int64SmaEqu), (void *)(Int64Cond)
10716 struct OpTable uint64Ops =
10718 (void *)(UInt64Add), (void *)(UInt64Sub), (void *)(UInt64Mul), (void *)(UInt64Div), (void *)(UInt64Mod), (void *)(UInt64Neg), (void *)(UInt64Inc), (void *)(UInt64Dec), (void *)(UInt64Asign), (void *)(UInt64AddAsign), (void *)(UInt64SubAsign), (void *)(UInt64MulAsign), (void *)(UInt64DivAsign), (void *)(UInt64ModAsign), (void *)(UInt64BitAnd), (void *)(UInt64BitOr), (void *)(UInt64BitXor), (void *)(UInt64LShift), (void *)(UInt64RShift), (void *)(UInt64BitNot), (void *)(UInt64AndAsign), (void *)(UInt64OrAsign), (void *)(UInt64XorAsign), (void *)(UInt64LShiftAsign), (void *)(UInt64RShiftAsign), (void *)(UInt64Not), (void *)(UInt64Equ), (void *)(UInt64Nqu), (void *)(UInt64And), (void *)(UInt64Or), (void *)(UInt64Grt), (void *)(UInt64Sma), (void *)(UInt64GrtEqu), (void *)(UInt64SmaEqu), (void *)(UInt64Cond)
10721 struct OpTable shortOps =
10723 (void *)(ShortAdd), (void *)(ShortSub), (void *)(ShortMul), (void *)(ShortDiv), (void *)(ShortMod), (void *)(ShortNeg), (void *)(ShortInc), (void *)(ShortDec), (void *)(ShortAsign), (void *)(ShortAddAsign), (void *)(ShortSubAsign), (void *)(ShortMulAsign), (void *)(ShortDivAsign), (void *)(ShortModAsign), (void *)(ShortBitAnd), (void *)(ShortBitOr), (void *)(ShortBitXor), (void *)(ShortLShift), (void *)(ShortRShift), (void *)(ShortBitNot), (void *)(ShortAndAsign), (void *)(ShortOrAsign), (void *)(ShortXorAsign), (void *)(ShortLShiftAsign), (void *)(ShortRShiftAsign), (void *)(ShortNot), (void *)(ShortEqu), (void *)(ShortNqu), (void *)(ShortAnd), (void *)(ShortOr), (void *)(ShortGrt), (void *)(ShortSma), (void *)(ShortGrtEqu), (void *)(ShortSmaEqu), (void *)(ShortCond)
10726 struct OpTable ushortOps =
10728 (void *)(UShortAdd), (void *)(UShortSub), (void *)(UShortMul), (void *)(UShortDiv), (void *)(UShortMod), (void *)(UShortNeg), (void *)(UShortInc), (void *)(UShortDec), (void *)(UShortAsign), (void *)(UShortAddAsign), (void *)(UShortSubAsign), (void *)(UShortMulAsign), (void *)(UShortDivAsign), (void *)(UShortModAsign), (void *)(UShortBitAnd), (void *)(UShortBitOr), (void *)(UShortBitXor), (void *)(UShortLShift), (void *)(UShortRShift), (void *)(UShortBitNot), (void *)(UShortAndAsign), (void *)(UShortOrAsign), (void *)(UShortXorAsign), (void *)(UShortLShiftAsign), (void *)(UShortRShiftAsign), (void *)(UShortNot), (void *)(UShortEqu), (void *)(UShortNqu), (void *)(UShortAnd), (void *)(UShortOr), (void *)(UShortGrt), (void *)(UShortSma), (void *)(UShortGrtEqu), (void *)(UShortSmaEqu), (void *)(UShortCond)
10731 struct OpTable floatOps =
10733 (void *)(FloatAdd), (void *)(FloatSub), (void *)(FloatMul), (void *)(FloatDiv), (((void *)0)), (void *)(FloatNeg), (void *)(FloatInc), (void *)(FloatDec), (void *)(FloatAsign), (void *)(FloatAddAsign), (void *)(FloatSubAsign), (void *)(FloatMulAsign), (void *)(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)), (void *)(FloatEqu), (void *)(FloatNqu), (void *)(FloatAnd), (void *)(FloatOr), (void *)(FloatGrt), (void *)(FloatSma), (void *)(FloatGrtEqu), (void *)(FloatSmaEqu)
10736 struct OpTable doubleOps =
10738 (void *)(DoubleAdd), (void *)(DoubleSub), (void *)(DoubleMul), (void *)(DoubleDiv), (((void *)0)), (void *)(DoubleNeg), (void *)(DoubleInc), (void *)(DoubleDec), (void *)(DoubleAsign), (void *)(DoubleAddAsign), (void *)(DoubleSubAsign), (void *)(DoubleMulAsign), (void *)(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)), (void *)(DoubleEqu), (void *)(DoubleNqu), (void *)(DoubleAnd), (void *)(DoubleOr), (void *)(DoubleGrt), (void *)(DoubleSma), (void *)(DoubleGrtEqu), (void *)(DoubleSmaEqu)
10741 struct OpTable charOps =
10743 (void *)(CharAdd), (void *)(CharSub), (void *)(CharMul), (void *)(CharDiv), (void *)(CharMod), (void *)(CharNeg), (void *)(CharInc), (void *)(CharDec), (void *)(CharAsign), (void *)(CharAddAsign), (void *)(CharSubAsign), (void *)(CharMulAsign), (void *)(CharDivAsign), (void *)(CharModAsign), (void *)(CharBitAnd), (void *)(CharBitOr), (void *)(CharBitXor), (void *)(CharLShift), (void *)(CharRShift), (void *)(CharBitNot), (void *)(CharAndAsign), (void *)(CharOrAsign), (void *)(CharXorAsign), (void *)(CharLShiftAsign), (void *)(CharRShiftAsign), (void *)(CharNot), (void *)(CharEqu), (void *)(CharNqu), (void *)(CharAnd), (void *)(CharOr), (void *)(CharGrt), (void *)(CharSma), (void *)(CharGrtEqu), (void *)(CharSmaEqu), (void *)(CharCond)
10746 struct OpTable ucharOps =
10748 (void *)(UCharAdd), (void *)(UCharSub), (void *)(UCharMul), (void *)(UCharDiv), (void *)(UCharMod), (void *)(UCharNeg), (void *)(UCharInc), (void *)(UCharDec), (void *)(UCharAsign), (void *)(UCharAddAsign), (void *)(UCharSubAsign), (void *)(UCharMulAsign), (void *)(UCharDivAsign), (void *)(UCharModAsign), (void *)(UCharBitAnd), (void *)(UCharBitOr), (void *)(UCharBitXor), (void *)(UCharLShift), (void *)(UCharRShift), (void *)(UCharBitNot), (void *)(UCharAndAsign), (void *)(UCharOrAsign), (void *)(UCharXorAsign), (void *)(UCharLShiftAsign), (void *)(UCharRShiftAsign), (void *)(UCharNot), (void *)(UCharEqu), (void *)(UCharNqu), (void *)(UCharAnd), (void *)(UCharOr), (void *)(UCharGrt), (void *)(UCharSma), (void *)(UCharGrtEqu), (void *)(UCharSmaEqu), (void *)(UCharCond)
10751 void ReadString(char * output, char * string)
10753 int len = strlen(string);
10755 unsigned int quoted = 0, escaped = 0;
10757 for(c = 0; c < len; c++)
10759 char ch = string[c];
10817 int UnescapeString(char * d, char * s, int len)
10822 while(j < len && (ch = s[j]))
10827 switch((ch = s[++j]))
10873 char * OffsetEscapedString(char * s, int len, int offset)
10878 while(j < len && k < offset && (ch = s[j]))
10884 return (k == offset) ? s + j : (((void *)0));
10887 extern long long __ecereNameSpace__ecere__com___strtoi64(const char * string, const char * * endString, int base);
10889 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char * string, const char * * endString, int base);
10891 extern double strtod(const char * , char * * );
10893 extern float (* __ecereMethod_float_inf)(void);
10895 extern float (* __ecereMethod_float_nan)(void);
10897 extern double (* __ecereMethod_double_inf)(void);
10899 extern double (* __ecereMethod_double_nan)(void);
10901 struct Operand GetOperand(struct Expression * exp)
10903 struct Operand op =
10910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10913 struct Type * type = exp->expType;
10917 while(type->kind == 8 && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
10919 if(!type->__anon1._class->__anon1.registered->dataType)
10920 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10921 type = type->__anon1._class->__anon1.registered->dataType;
10923 if(exp->type == 3 && op.kind == 13)
10925 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10927 op.ops = uint64Ops;
10929 else if(exp->isConstant && exp->type == 2)
10931 op.kind = type->kind;
10938 if(exp->__anon1.__anon1.constant[0] == '\'')
10940 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10943 else if(type->isSigned)
10945 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10950 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10958 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10963 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10964 op.ops = ushortOps;
10971 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10976 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10984 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10989 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10990 op.ops = uint64Ops;
10997 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11002 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11003 op.ops = uint64Ops;
11010 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11015 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11016 op.ops = uint64Ops;
11021 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11022 op.__anon1.f = __ecereMethod_float_inf();
11023 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11024 op.__anon1.f = -__ecereMethod_float_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11026 op.__anon1.f = __ecereMethod_float_nan();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11028 op.__anon1.f = -__ecereMethod_float_nan();
11030 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11034 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11035 op.__anon1.d = __ecereMethod_double_inf();
11036 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11037 op.__anon1.d = -__ecereMethod_double_inf();
11038 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11039 op.__anon1.d = __ecereMethod_double_nan();
11040 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11041 op.__anon1.d = -__ecereMethod_double_nan();
11043 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11044 op.ops = doubleOps;
11049 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11051 op.ops = uint64Ops;
11059 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11063 switch(_class->typeSize)
11066 if(!strcmp(_class->dataTypeString, "uint64"))
11067 v = (long long)*(uint64 *)ptr;
11069 v = *(long long *)ptr;
11072 if(!strcmp(_class->dataTypeString, "uint"))
11073 v = (long long)*(unsigned int *)ptr;
11075 v = (long long)*(int *)ptr;
11078 if(!strcmp(_class->dataTypeString, "uint16"))
11079 v = (long long)*(unsigned short *)ptr;
11081 v = (long long)*(short *)ptr;
11084 if(!strcmp(_class->dataTypeString, "byte"))
11085 v = (long long)*(unsigned char *)ptr;
11087 v = (long long)*(char *)ptr;
11093 int __ecereVMethodID_class_OnGetString;
11095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11097 static __attribute__((unused)) void UnusedFunction()
11101 ((const char * (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char * tempString, void * fieldData, unsigned int * needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
11104 extern int __ecereVMethodID_class_OnGetString;
11106 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11108 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11110 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11112 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11113 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11116 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11117 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11118 struct Type * type;
11119 void * ptr = inst->data + dataMember->offset + offset;
11120 char * result = (((void *)0));
11122 exp->loc = member->loc = inst->loc;
11123 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11124 if(!dataMember->dataType)
11125 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11126 type = dataMember->dataType;
11127 if(type->kind == 8)
11129 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11131 if(_class->type == 4)
11133 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11137 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11138 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11140 for(item = e->values.first; item; item = item->next)
11142 if(item->data == GetEnumValue(_class, ptr))
11144 result = item->name;
11150 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11152 exp->destType = MkClassType(_class->fullName);
11153 ProcessExpressionType(exp);
11157 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11159 if(!_class->dataType)
11160 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11161 type = _class->dataType;
11170 FreeExpContents(exp);
11171 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11177 FreeExpContents(exp);
11178 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11184 FreeExpContents(exp);
11185 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11191 FreeExpContents(exp);
11192 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11198 FreeExpContents(exp);
11199 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11205 FreeExpContents(exp);
11206 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11214 ListAdd(memberList, member);
11216 if(parentDataMember->type == 1)
11221 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11223 void PopulateInstance(struct Instantiation * inst)
11225 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11226 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11227 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11228 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11231 inst->members = MkListOne(MkMembersInitList(memberList));
11233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11234 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11236 if(!dataMember->isProperty)
11238 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11239 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11242 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11243 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11244 struct Type * type;
11245 void * ptr = inst->data + dataMember->offset;
11246 char * result = (((void *)0));
11248 exp->loc = member->loc = inst->loc;
11249 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11250 if(!dataMember->dataType)
11251 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11252 type = dataMember->dataType;
11253 if(type->kind == 8)
11255 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11257 if(_class->type == 4)
11259 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11263 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11264 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11266 for(item = e->values.first; item; item = item->next)
11268 if(item->data == GetEnumValue(_class, ptr))
11270 result = item->name;
11277 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11279 exp->destType = MkClassType(_class->fullName);
11280 ProcessExpressionType(exp);
11283 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11285 if(!_class->dataType)
11286 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11287 type = _class->dataType;
11296 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11302 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11308 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11314 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11320 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11328 ListAdd(memberList, member);
11334 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, unsigned int * offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
11336 extern void FreeInstance(struct Instantiation * inst);
11338 void ComputeInstantiation(struct Expression * exp)
11340 struct Instantiation * inst = exp->__anon1.instance;
11341 struct MembersInit * members;
11342 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11343 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11344 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11345 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11346 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11347 int subMemberStackPos = 0;
11350 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11354 if(_class->type == 0 || _class->type == 5)
11356 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11357 if(_class->type == 0)
11358 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11361 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11365 for(members = (*inst->members).first; members; members = members->next)
11367 switch(members->type)
11371 if(members->__anon1.dataMembers)
11373 struct MemberInit * member;
11375 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11377 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11378 unsigned int found = 0;
11379 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11380 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11381 unsigned int dataMemberOffset;
11385 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11388 if(curMember->isProperty)
11389 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11392 dataMember = curMember;
11393 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11394 if(_class->type == 0)
11395 dataMemberOffset += _class->base->structSize;
11402 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11406 if(prop->memberAccess == 1)
11408 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11409 curClass = prop->_class;
11414 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11415 int _subMemberStackPos = 0;
11417 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11421 if(dataMember->memberAccess == 1)
11423 curMember = dataMember;
11424 curClass = dataMember->_class;
11425 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11426 subMemberStackPos = _subMemberStackPos;
11431 if(found && member->initializer && member->initializer->type == 0)
11433 struct Expression * value = member->initializer->__anon1.exp;
11434 struct Type * type = (((void *)0));
11435 unsigned int deepMember = 0;
11439 type = prop->dataType;
11441 else if(dataMember)
11443 if(!dataMember->dataType)
11444 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11445 type = dataMember->dataType;
11447 if(ident && ident->next)
11450 for(ident = ident->next; ident && type; ident = ident->next)
11452 if(type->kind == 8)
11454 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11456 type = prop->dataType;
11459 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11461 type = dataMember->dataType;
11464 else if(type->kind == 9 || type->kind == 10)
11466 struct Type * memberType;
11468 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11470 if(!strcmp(memberType->name, ident->string))
11481 FreeType(value->destType);
11482 value->destType = type;
11485 ComputeExpression(value);
11487 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11489 if(type->kind == 8)
11491 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11493 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11495 if(!_class->dataType)
11496 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11497 type = _class->dataType;
11502 void * ptr = inst->data + dataMemberOffset;
11504 if(value->type == 2)
11510 GetInt(value, (int *)ptr);
11515 GetInt64(value, (long long *)ptr);
11520 GetIntPtr(value, (intptr_t *)ptr);
11525 GetIntSize(value, (ssize_t *)ptr);
11530 GetFloat(value, (float *)ptr);
11535 GetDouble(value, (double *)ptr);
11540 else if(value->type == 1)
11542 if(type->kind == 8)
11544 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11546 if(_class->type == 1)
11548 ComputeTypeSize(type);
11549 if(value->__anon1.instance->data)
11550 memcpy(ptr, value->__anon1.instance->data, type->size);
11557 if(value->type == 1 && value->__anon1.instance->data)
11559 if(type->kind == 8)
11561 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11563 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->__anon1.instance->data))->_class, _class)))
11565 void (* Set)(void *, void *) = (void *)prop->Set;
11567 Set(inst->data, value->__anon1.instance->data);
11568 PopulateInstance(inst);
11572 else if(value->type == 2)
11578 void (* Set)(void *, double) = (void *)prop->Set;
11580 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11585 void (* Set)(void *, float) = (void *)prop->Set;
11587 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11592 void (* Set)(void *, int) = (void *)prop->Set;
11594 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11599 void (* Set)(void *, long long) = (void *)prop->Set;
11601 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11606 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11608 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11613 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11615 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11620 else if(value->type == 3)
11624 ReadString(temp, value->__anon1.__anon2.string);
11625 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11629 else if(!deepMember && type && _class->type == 3)
11633 if(value->type == 2)
11635 if(type->kind == 8)
11637 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11639 if(_class->type == 3)
11641 if(!_class->dataType)
11642 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11643 type = _class->dataType;
11651 float (* Set)(float) = (void *)prop->Set;
11653 GetFloat(member->initializer->__anon1.exp, &fValue);
11654 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11661 double (* Set)(double) = (void *)prop->Set;
11663 GetDouble(member->initializer->__anon1.exp, &dValue);
11664 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11672 else if(!deepMember && type && _class->type == 2)
11676 if(value->type == 1 && value->__anon1.instance->data)
11678 unsigned int (* Set)(void *) = (void *)prop->Set;
11680 bits = Set(value->__anon1.instance->data);
11682 else if(value->type == 2)
11686 else if(dataMember)
11688 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11689 struct Type * type;
11692 bits = (bits & ~bitMember->mask);
11693 if(!bitMember->dataType)
11694 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11695 type = bitMember->dataType;
11696 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11698 if(!type->__anon1._class->__anon1.registered->dataType)
11699 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11700 type = type->__anon1._class->__anon1.registered->dataType;
11709 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11717 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11726 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11734 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11742 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11750 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11755 bits |= part << bitMember->pos;
11761 if(_class && _class->type == 3)
11763 ComputeExpression(member->initializer->__anon1.exp);
11764 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11766 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11776 if(_class && _class->type == 2)
11778 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11783 FreeInstance(inst);
11787 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11789 unsigned int result = 0;
11794 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11795 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11799 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11800 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11803 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11804 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11807 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11808 result = GetOpFloat(op, &op->__anon1.f);
11811 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11812 result = GetOpDouble(op, &op->__anon1.d);
11815 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11816 result = GetOpUInt64(op, &op->__anon1.ui64);
11819 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11820 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11823 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11824 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11827 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11828 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11834 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11836 if(exp->__anon1.op.op == SIZEOF)
11838 FreeExpContents(exp);
11840 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11844 if(!exp->__anon1.op.exp1)
11846 switch(exp->__anon1.op.op)
11850 struct Expression * exp2 = exp->__anon1.op.exp2;
11852 exp->__anon1.op.exp2 = (((void *)0));
11853 FreeExpContents(exp);
11854 FreeType(exp->expType);
11855 FreeType(exp->destType);
11857 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11863 FreeExpContents(exp);
11864 op1->ops.Neg(exp, op1);
11868 if(op1->ops.BitNot)
11870 FreeExpContents(exp);
11871 op1->ops.BitNot(exp, op1);
11877 FreeExpContents(exp);
11878 op1->ops.Not(exp, op1);
11885 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11887 if(Promote(op2, op1->kind, op1->type->isSigned))
11888 op2->kind = op1->kind, op2->ops = op1->ops;
11889 else if(Promote(op1, op2->kind, op2->type->isSigned))
11890 op1->kind = op2->kind, op1->ops = op2->ops;
11892 switch(exp->__anon1.op.op)
11897 FreeExpContents(exp);
11898 op1->ops.Add(exp, op1, op2);
11904 FreeExpContents(exp);
11905 op1->ops.Sub(exp, op1, op2);
11911 FreeExpContents(exp);
11912 op1->ops.Mul(exp, op1, op2);
11918 FreeExpContents(exp);
11919 op1->ops.Div(exp, op1, op2);
11925 FreeExpContents(exp);
11926 op1->ops.Mod(exp, op1, op2);
11930 if(exp->__anon1.op.exp2)
11932 if(op1->ops.BitAnd)
11934 FreeExpContents(exp);
11935 op1->ops.BitAnd(exp, op1, op2);
11942 FreeExpContents(exp);
11943 op1->ops.BitOr(exp, op1, op2);
11947 if(op1->ops.BitXor)
11949 FreeExpContents(exp);
11950 op1->ops.BitXor(exp, op1, op2);
11954 if(op1->ops.LShift)
11956 FreeExpContents(exp);
11957 op1->ops.LShift(exp, op1, op2);
11961 if(op1->ops.RShift)
11963 FreeExpContents(exp);
11964 op1->ops.RShift(exp, op1, op2);
11970 FreeExpContents(exp);
11971 op1->ops.Equ(exp, op1, op2);
11977 FreeExpContents(exp);
11978 op1->ops.Nqu(exp, op1, op2);
11984 FreeExpContents(exp);
11985 op1->ops.And(exp, op1, op2);
11991 FreeExpContents(exp);
11992 op1->ops.Or(exp, op1, op2);
11998 FreeExpContents(exp);
11999 op1->ops.Grt(exp, op1, op2);
12005 FreeExpContents(exp);
12006 op1->ops.Sma(exp, op1, op2);
12010 if(op1->ops.GrtEqu)
12012 FreeExpContents(exp);
12013 op1->ops.GrtEqu(exp, op1, op2);
12017 if(op1->ops.SmaEqu)
12019 FreeExpContents(exp);
12020 op1->ops.SmaEqu(exp, op1, op2);
12028 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
12030 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12032 void ComputeExpression(struct Expression * exp)
12038 ComputeInstantiation(exp);
12043 struct Expression * exp1, * exp2 = (((void *)0));
12044 struct Operand op1 =
12051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12054 struct Operand op2 =
12061 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12065 if(exp->__anon1.op.exp2)
12067 struct Expression * e = exp->__anon1.op.exp2;
12069 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12071 if(e->type == 5 || e->type == 32 || e->type == 23)
12074 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12076 e = (*e->__anon1.list).last;
12079 if(exp->__anon1.op.op == 261 && e && e->expType)
12081 if(e->type == 3 && e->__anon1.__anon2.string)
12083 char * string = e->__anon1.__anon2.string;
12084 int len = strlen(string);
12085 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12087 len = UnescapeString(tmp, string + 1, len - 2);
12088 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12089 FreeExpContents(exp);
12091 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12095 struct Type * type = e->expType;
12098 FreeExpContents(exp);
12100 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12106 ComputeExpression(exp->__anon1.op.exp2);
12108 if(exp->__anon1.op.exp1)
12110 ComputeExpression(exp->__anon1.op.exp1);
12111 exp1 = exp->__anon1.op.exp1;
12112 exp2 = exp->__anon1.op.exp2;
12113 op1 = GetOperand(exp1);
12115 op1.type->refCount++;
12118 op2 = GetOperand(exp2);
12120 op2.type->refCount++;
12125 exp1 = exp->__anon1.op.exp2;
12126 op1 = GetOperand(exp1);
12128 op1.type->refCount++;
12130 CallOperator(exp, exp1, exp2, &op1, &op2);
12132 FreeType(op1.type);
12134 FreeType(op2.type);
12140 struct Expression * e, * n;
12142 for(e = (*exp->__anon1.list).first; e; e = n)
12147 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12148 struct Expression * prev = exp->prev;
12149 struct Expression * next = exp->next;
12151 ComputeExpression(e);
12152 FreeType(exp->expType);
12153 FreeType(exp->destType);
12157 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12158 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12169 struct Expression * memberExp = exp->__anon1.member.exp;
12170 struct Identifier * memberID = exp->__anon1.member.member;
12171 struct Type * type;
12173 ComputeExpression(exp->__anon1.member.exp);
12174 type = exp->__anon1.member.exp->expType;
12177 struct __ecereNameSpace__ecere__com__Class * _class = (exp->__anon1.member.member && exp->__anon1.member.member->classSym) ? exp->__anon1.member.member->classSym->__anon1.registered : (((type->kind == 8 || type->kind == 19) && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0)));
12178 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12179 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12180 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12182 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12183 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12187 struct Symbol * classSym;
12190 PrintTypeNoConst(type, string, 0, 1);
12191 classSym = FindClass(string);
12192 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12194 if(exp->__anon1.member.member)
12196 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12198 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12200 if(!prop && !member && _class && exp->__anon1.member.member)
12202 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12204 convertTo = _class;
12205 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12206 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12212 struct Type * type = prop->dataType;
12214 if(_class->type == 3)
12216 if(type->kind == 8)
12218 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12220 if(_class->type == 3)
12222 if(!_class->dataType)
12223 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12224 type = _class->dataType;
12232 float (* Get)(float) = (void *)prop->Get;
12234 GetFloat(exp->__anon1.member.exp, &value);
12235 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12242 double (* Get)(double);
12244 GetDouble(exp->__anon1.member.exp, &value);
12246 Get = (void *)prop->Set;
12248 Get = (void *)prop->Get;
12249 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12259 struct Expression * value = exp->__anon1.member.exp;
12260 struct Type * type;
12262 if(!prop->dataType)
12263 ProcessPropertyType(prop);
12264 type = prop->dataType;
12268 else if(_class->type == 1)
12274 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12276 if(propertyClass->type == 1 && value->type == 1)
12278 void (* Set)(void *, void *) = (void *)prop->Set;
12280 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12281 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12282 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12283 exp->__anon1.instance->loc = exp->loc;
12285 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12286 PopulateInstance(exp->__anon1.instance);
12293 void (* Set)(void *, int) = (void *)prop->Set;
12295 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12296 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12297 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12298 exp->__anon1.instance->loc = exp->loc;
12300 GetInt(value, &intValue);
12301 Set(exp->__anon1.instance->data, intValue);
12302 PopulateInstance(exp->__anon1.instance);
12307 long long intValue;
12308 void (* Set)(void *, long long) = (void *)prop->Set;
12310 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12311 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12312 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12313 exp->__anon1.instance->loc = exp->loc;
12315 GetInt64(value, &intValue);
12316 Set(exp->__anon1.instance->data, intValue);
12317 PopulateInstance(exp->__anon1.instance);
12323 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12325 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12326 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12327 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12328 exp->__anon1.instance->loc = exp->loc;
12330 GetIntPtr(value, &intValue);
12331 Set(exp->__anon1.instance->data, intValue);
12332 PopulateInstance(exp->__anon1.instance);
12338 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12340 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12341 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12342 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12343 exp->__anon1.instance->loc = exp->loc;
12345 GetIntSize(value, &intValue);
12346 Set(exp->__anon1.instance->data, intValue);
12347 PopulateInstance(exp->__anon1.instance);
12353 void (* Set)(void *, float) = (void *)prop->Set;
12355 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12356 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12357 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12358 exp->__anon1.instance->loc = exp->loc;
12360 GetFloat(value, &floatValue);
12361 Set(exp->__anon1.instance->data, floatValue);
12362 PopulateInstance(exp->__anon1.instance);
12367 double doubleValue;
12368 void (* Set)(void *, double) = (void *)prop->Set;
12370 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12371 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12372 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12373 exp->__anon1.instance->loc = exp->loc;
12375 GetDouble(value, &doubleValue);
12376 Set(exp->__anon1.instance->data, doubleValue);
12377 PopulateInstance(exp->__anon1.instance);
12382 else if(_class->type == 2)
12388 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12390 if(propertyClass->type == 1 && value->__anon1.instance->data)
12392 unsigned int (* Set)(void *) = (void *)prop->Set;
12393 unsigned int bits = Set(value->__anon1.instance->data);
12395 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12399 else if(_class->type == 2)
12401 unsigned int value;
12402 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12405 GetUInt(exp->__anon1.member.exp, &value);
12407 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12416 if(_class->type == 2)
12418 unsigned int value;
12420 GetUInt(exp->__anon1.member.exp, &value);
12425 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12427 if(_class->type == 1)
12429 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12431 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12432 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12433 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12434 exp->__anon1.instance->loc = exp->loc;
12436 Get(value, exp->__anon1.instance->data);
12437 PopulateInstance(exp->__anon1.instance);
12439 else if(_class->type == 2)
12441 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12442 uint64 bits = Get(value);
12444 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12451 else if(_class->type == 1)
12453 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12459 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12461 if(_class->type == 1 && value)
12463 void (* Get)(void *, void *) = (void *)prop->Get;
12465 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12466 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12467 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12468 exp->__anon1.instance->loc = exp->loc;
12470 Get(value, exp->__anon1.instance->data);
12471 PopulateInstance(exp->__anon1.instance);
12482 exp->isConstant = 0;
12491 FreeExpression(memberExp);
12492 FreeIdentifier(memberID);
12498 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12500 FreeExpContents(exp);
12501 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12508 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12510 if(classSym && classSym->__anon1.registered)
12512 if(classSym->__anon1.registered->fixed)
12514 FreeSpecifier(exp->__anon1._class);
12515 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12520 char className[1024];
12522 strcpy(className, "__ecereClass_");
12523 FullClassNameCat(className, classSym->string, 1);
12524 DeclareClass(classSym, className);
12525 FreeExpContents(exp);
12527 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12528 exp->__anon1.member.member = MkIdentifier("structSize");
12535 struct Type * type;
12536 struct Expression * e = exp;
12538 if(exp->type == 11)
12540 if(exp->__anon1.cast.exp)
12541 ComputeExpression(exp->__anon1.cast.exp);
12542 e = exp->__anon1.cast.exp;
12544 if(e && exp->expType)
12546 type = exp->expType;
12547 if(type->kind == 8)
12549 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12551 if(_class && (_class->type == 3 || _class->type == 2))
12553 if(!_class->dataType)
12554 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12555 type = _class->dataType;
12564 char value = (char)0;
12566 if(GetChar(e, &value))
12568 FreeExpContents(exp);
12569 exp->__anon1.__anon1.constant = PrintChar(value);
12575 unsigned char value = (unsigned char)0;
12577 if(GetUChar(e, &value))
12579 FreeExpContents(exp);
12580 exp->__anon1.__anon1.constant = PrintUChar(value);
12588 short value = (short)0;
12590 if(GetShort(e, &value))
12592 FreeExpContents(exp);
12593 exp->__anon1.__anon1.constant = PrintShort(value);
12599 unsigned short value = (unsigned short)0;
12601 if(GetUShort(e, &value))
12603 FreeExpContents(exp);
12604 exp->__anon1.__anon1.constant = PrintUShort(value);
12614 if(GetInt(e, &value))
12616 FreeExpContents(exp);
12617 exp->__anon1.__anon1.constant = PrintInt(value);
12623 unsigned int value = 0;
12625 if(GetUInt(e, &value))
12627 FreeExpContents(exp);
12628 exp->__anon1.__anon1.constant = PrintUInt(value);
12636 long long value = 0;
12638 if(GetInt64(e, &value))
12640 FreeExpContents(exp);
12641 exp->__anon1.__anon1.constant = PrintInt64(value);
12649 if(GetUInt64(e, &value))
12651 FreeExpContents(exp);
12652 exp->__anon1.__anon1.constant = PrintUInt64(value);
12660 intptr_t value = 0;
12662 if(GetIntPtr(e, &value))
12664 FreeExpContents(exp);
12665 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12671 uintptr_t value = 0;
12673 if(GetUIntPtr(e, &value))
12675 FreeExpContents(exp);
12676 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12686 if(GetIntSize(e, &value))
12688 FreeExpContents(exp);
12689 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12697 if(GetUIntSize(e, &value))
12699 FreeExpContents(exp);
12700 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12709 if(GetFloat(e, &value))
12711 FreeExpContents(exp);
12712 exp->__anon1.__anon1.constant = PrintFloat(value);
12721 if(GetDouble(e, &value))
12723 FreeExpContents(exp);
12724 exp->__anon1.__anon1.constant = PrintDouble(value);
12735 struct Operand op1 =
12742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12745 struct Operand op2 =
12752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12755 struct Operand op3 =
12762 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12766 if(exp->__anon1.cond.exp)
12767 ComputeExpression((*exp->__anon1.cond.exp).last);
12768 if(exp->__anon1.cond.elseExp)
12769 ComputeExpression(exp->__anon1.cond.elseExp);
12770 if(exp->__anon1.cond.cond)
12771 ComputeExpression(exp->__anon1.cond.cond);
12772 op1 = GetOperand(exp->__anon1.cond.cond);
12774 op1.type->refCount++;
12775 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12777 op2.type->refCount++;
12778 op3 = GetOperand(exp->__anon1.cond.elseExp);
12780 op3.type->refCount++;
12783 FreeExpContents(exp);
12784 op1.ops.Cond(exp, &op1, &op2, &op3);
12787 FreeType(op1.type);
12789 FreeType(op2.type);
12791 FreeType(op3.type);
12797 void ApplyAnyObjectLogic(struct Expression * e);
12799 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12801 unsigned int result = 1;
12805 struct __ecereNameSpace__ecere__sys__OldList converts =
12809 struct Conversion * convert;
12811 if(destType->kind == 0)
12813 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12817 for(convert = converts.first; convert; convert = convert->next)
12819 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12823 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12824 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12827 newExp->prev = (((void *)0));
12828 newExp->next = (((void *)0));
12829 newExp->destType = (((void *)0));
12833 exp->addedThis = 1;
12834 exp->__anon1.member.exp = newExp;
12835 FreeType(exp->__anon1.member.exp->expType);
12836 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12837 exp->__anon1.member.exp->expType->classObjectType = objectType;
12838 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12839 exp->__anon1.member.memberType = 1;
12840 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12843 exp->expType->refCount++;
12844 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12850 exp->addedThis = 1;
12851 exp->__anon1.member.exp = newExp;
12852 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->__anon1._class && newExp->expType->__anon1._class->__anon1.registered && newExp->expType->__anon1._class->__anon1.registered->type == 5)
12854 newExp->byReference = 1;
12856 FreeType(exp->__anon1.member.exp->expType);
12857 exp->__anon1.member.exp->expType = (((void *)0));
12858 if(convert->convert->dataType)
12860 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12861 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12862 exp->__anon1.member.exp->expType->refCount = 1;
12863 exp->__anon1.member.exp->expType->classObjectType = objectType;
12864 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12866 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12867 exp->__anon1.member.memberType = 4;
12868 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12870 if(convert->resultType)
12871 convert->resultType->refCount++;
12877 FreeType(exp->expType);
12880 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12881 if(exp->destType->casted)
12884 exp->expType->refCount++;
12888 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12889 if(exp->destType->casted)
12891 if(convert->resultType)
12892 convert->resultType->refCount++;
12896 if(exp->isConstant && inCompiler)
12897 ComputeExpression(exp);
12898 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12900 if(!result && exp->expType && converts.count)
12902 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12904 if(!result && exp->expType && exp->destType)
12906 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->__anon1.type->kind == 8 && exp->expType->__anon1.type->__anon1._class == exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->__anon1.type->kind == 8 && exp->destType->__anon1.type->__anon1._class == exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1))
12913 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12915 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12917 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12919 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12921 void CheckTemplateTypes(struct Expression * exp)
12923 struct Expression * nbExp = GetNonBracketsExp(exp);
12925 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12927 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12928 struct Context * context;
12932 exp->destType->refCount++;
12934 exp->expType->refCount++;
12935 newExp->prev = (((void *)0));
12936 newExp->next = (((void *)0));
12937 switch(exp->expType->kind)
12940 if(exp->destType->classObjectType)
12943 exp->destType->refCount--;
12945 exp->expType->refCount--;
12946 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12950 struct __ecereNameSpace__ecere__sys__OldList * specs;
12951 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12952 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12954 context = PushContext();
12955 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12956 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12957 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12959 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12960 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12961 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12962 exp->__anon1.compound->__anon1.compound.context = context;
12963 PopContext(context);
12968 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12969 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12974 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12977 struct Context * context;
12981 exp->destType->refCount++;
12983 exp->expType->refCount++;
12984 newExp->prev = (((void *)0));
12985 newExp->next = (((void *)0));
12986 switch(exp->expType->kind)
12989 if(exp->destType->classObjectType)
12992 exp->destType->refCount--;
12994 exp->expType->refCount--;
12995 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12999 struct __ecereNameSpace__ecere__sys__OldList * specs;
13000 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13001 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13003 context = PushContext();
13004 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13005 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13006 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13008 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13009 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13010 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13011 exp->__anon1.compound->__anon1.compound.context = context;
13012 PopContext(context);
13017 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13020 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
13021 ProcessExpressionType((*exp->__anon1.list).first);
13027 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13028 exp->needTemplateCast = 2;
13029 newExp->needCast = 1;
13030 newExp->needTemplateCast = 2;
13031 ProcessExpressionType((*exp->__anon1.list).first);
13037 if(exp->expType->kind == 20)
13039 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13043 FreeType(exp->destType);
13044 FreeType(exp->expType);
13045 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13049 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13052 exp->__anon1.op.op = '*';
13053 exp->__anon1.op.exp1 = (((void *)0));
13054 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13058 char typeString[1024];
13059 struct Declarator * decl;
13060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13062 typeString[0] = '\0';
13063 PrintType(exp->expType, typeString, 0, 0);
13064 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13066 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13067 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13068 exp->__anon1.cast.exp->needCast = 1;
13076 extern int strncmp(const char * , const char * , size_t n);
13078 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
13080 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13082 int nsLen = strlen(nameSpace);
13083 struct Symbol * symbol;
13085 for(symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(tree, nameSpace); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
13087 char * s = symbol->string;
13089 if(!strncmp(s, nameSpace, nsLen))
13094 for(c = strlen(s) - 1; c >= 0; c--)
13097 namePart = s + c + 1;
13098 if(!strcmp(namePart, name))
13106 return (((void *)0));
13109 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13112 char nameSpace[1024];
13113 const char * namePart;
13114 unsigned int gotColon = 0;
13116 nameSpace[0] = '\0';
13117 for(c = strlen(name) - 1; c >= 0; c--)
13123 namePart = name + c + 1;
13124 while(c >= 0 && name[c] == ':')
13128 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13132 memcpy(nameSpace, name, c + 1);
13133 nameSpace[c + 1] = (char)0;
13134 return ScanWithNameSpace(tree, nameSpace, namePart);
13138 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13144 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13148 return ScanWithNameSpace(tree, "", namePart);
13150 return (((void *)0));
13153 static void ProcessDeclaration(struct Declaration * decl);
13155 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13157 struct Context * ctx;
13158 struct Symbol * symbol = (((void *)0));
13160 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13162 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13164 symbol = (((void *)0));
13167 char curName[1024];
13169 strcpy(curName, thisNameSpace);
13170 strcat(curName, "::");
13171 strcat(curName, name);
13172 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13175 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13178 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13179 if(symbol || ctx == endContext)
13182 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13184 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13186 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13187 struct Context * tmpContext = curContext;
13189 curContext = (((void *)0));
13190 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13191 curContext = tmpContext;
13192 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13193 DeclareType(symbol->type, 1, 1);
13194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13195 symbol->id = curExternal->symbol->idCode;
13197 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13199 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13200 symbol->id = curExternal->symbol->idCode;
13206 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13208 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13209 ListAdd(specs, MkSpecifier(UNSIGNED));
13214 if(type->__anon1._class->__anon1.registered)
13216 if(!type->__anon1._class->__anon1.registered->dataType)
13217 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13218 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13223 ListAdd(specs, MkSpecifier(DOUBLE));
13226 ListAdd(specs, MkSpecifier(FLOAT));
13229 ListAdd(specs, MkSpecifier(CHAR));
13232 ListAdd(specs, MkSpecifier(_BOOL));
13235 ListAdd(specs, MkSpecifier(SHORT));
13238 ListAdd(specs, MkSpecifier(INT64));
13241 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13244 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13248 ListAdd(specs, MkSpecifier(INT));
13253 static void PrintArraySize(struct Type * arrayType, char * string)
13259 if(arrayType->__anon1.__anon4.enumClass)
13260 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13261 else if(arrayType->__anon1.__anon4.arraySizeExp)
13262 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13264 strcat(string, size);
13267 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13271 if(printConst && type->constant)
13272 strcat(string, "const ");
13277 struct Symbol * c = type->__anon1._class;
13279 if(type->classObjectType == 2)
13280 strcat(string, "typed_object");
13281 else if(type->classObjectType == 3)
13282 strcat(string, "any_object");
13286 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13288 if(type->byReference)
13289 strcat(string, " &");
13293 strcat(string, "void");
13296 strcat(string, type->isSigned ? "int" : "uint");
13299 strcat(string, type->isSigned ? "int64" : "uint64");
13302 strcat(string, type->isSigned ? "intptr" : "uintptr");
13305 strcat(string, type->isSigned ? "intsize" : "uintsize");
13308 strcat(string, type->isSigned ? "char" : "byte");
13311 strcat(string, "_Bool");
13314 strcat(string, type->isSigned ? "short" : "uint16");
13317 strcat(string, "float");
13320 strcat(string, "double");
13323 if(type->__anon1.__anon1.enumName)
13325 strcat(string, "struct ");
13326 strcat(string, type->__anon1.__anon1.enumName);
13328 else if(type->typeName)
13329 strcat(string, type->typeName);
13332 struct Type * member;
13334 strcat(string, "struct { ");
13335 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13337 PrintType(member, string, 1, fullName);
13338 strcat(string, "; ");
13340 strcat(string, "}");
13344 if(type->__anon1.__anon1.enumName)
13346 strcat(string, "union ");
13347 strcat(string, type->__anon1.__anon1.enumName);
13349 else if(type->typeName)
13350 strcat(string, type->typeName);
13353 strcat(string, "union ");
13354 strcat(string, "(unnamed)");
13358 if(type->__anon1.__anon1.enumName)
13360 strcat(string, "enum ");
13361 strcat(string, type->__anon1.__anon1.enumName);
13363 else if(type->typeName)
13364 strcat(string, type->typeName);
13366 strcat(string, "int");
13369 strcat(string, "...");
13372 strcat(string, "subclass(");
13373 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13374 strcat(string, ")");
13377 strcat(string, type->__anon1.templateParameter->identifier->string);
13380 strcat(string, "thisclass");
13383 strcat(string, "__builtin_va_list");
13389 extern char * __ecereNameSpace__ecere__sys__RSearchString(const char * buffer, const char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13391 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13393 if(type->name && type->name[0])
13396 strcat(string, type->name);
13399 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13405 strcat(string, name);
13410 static void PrintAttribs(struct Type * type, char * string)
13414 if(type->dllExport)
13415 strcat(string, "dllexport ");
13416 if(type->attrStdcall)
13417 strcat(string, "stdcall ");
13421 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13423 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13425 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13426 PrintAttribs(type, string);
13427 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13428 strcat(string, " const");
13429 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13430 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13431 strcat(string, " (");
13432 if(type->kind == 13)
13434 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13435 PrintAttribs(type->__anon1.type, string);
13437 if(type->kind == 13)
13439 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13440 strcat(string, "*");
13442 strcat(string, " *");
13444 if(printConst && type->constant && type->kind == 13)
13445 strcat(string, " const");
13448 PrintTypeSpecs(type, string, fullName, printConst);
13451 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13453 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13454 strcat(string, ")");
13455 if(type->kind == 12)
13456 PrintArraySize(type, string);
13457 else if(type->kind == 11)
13459 struct Type * param;
13461 strcat(string, "(");
13462 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13464 PrintType(param, string, 1, fullName);
13466 strcat(string, ", ");
13468 strcat(string, ")");
13470 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13471 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13474 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13476 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13477 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13478 strcat(string, " ");
13479 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13481 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13483 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13485 if(type->classObjectType == 1)
13486 strcat(string, "class");
13488 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13490 else if(_class && _class->string)
13492 char * s = _class->string;
13498 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13504 strcat(string, name);
13507 strcat(string, "::");
13509 if(printName && type->name)
13510 PrintName(type, string, fullName);
13511 PostPrintType(type, string, fullName);
13512 if(type->bitFieldCount)
13516 sprintf(count, ":%d", type->bitFieldCount);
13517 strcat(string, count);
13521 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13523 _PrintType(type, string, printName, fullName, 1);
13526 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13528 _PrintType(type, string, printName, fullName, 0);
13531 static struct Type * FindMember(struct Type * type, char * string)
13533 struct Type * memberType;
13535 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13537 if(!memberType->name)
13539 struct Type * subType = FindMember(memberType, string);
13544 else if(!strcmp(memberType->name, string))
13547 return (((void *)0));
13550 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13552 struct Type * memberType;
13554 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13556 if(!memberType->name)
13558 struct Type * subType = FindMember(memberType, string);
13562 *offset += memberType->offset;
13566 else if(!strcmp(memberType->name, string))
13568 *offset += memberType->offset;
13572 return (((void *)0));
13575 extern unsigned int parseError;
13577 unsigned int GetParseError()
13582 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13584 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13586 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13588 struct Expression * ParseExpressionString(char * expression)
13591 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13592 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
13593 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13595 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13596 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13597 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13598 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13600 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13601 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13603 parsedExpression = (((void *)0));
13605 expression_yyparse();
13606 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13607 return parsedExpression;
13610 extern char * QMkString(const char * source);
13612 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13614 struct Identifier * id = exp->__anon1.__anon1.identifier;
13615 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13616 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13617 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13618 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13620 if(_class && _class->type == 4)
13622 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13623 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13627 struct __ecereNameSpace__ecere__com__Class * baseClass;
13629 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13631 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13633 for(value = e->values.first; value; value = value->next)
13635 if(!strcmp(value->name, id->string))
13640 char constant[256];
13642 FreeExpContents(exp);
13644 exp->isConstant = 1;
13645 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13646 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13648 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13649 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13650 exp->expType = MkClassType(baseClass->fullName);
13658 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13660 ProcessMethodType(method);
13661 exp->expType = __extension__ ({
13662 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13664 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13668 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13670 if(!prop->dataType)
13671 ProcessPropertyType(prop);
13672 exp->expType = prop->dataType;
13674 prop->dataType->refCount++;
13677 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13679 if(!member->dataType)
13680 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13681 exp->expType = member->dataType;
13682 if(member->dataType)
13683 member->dataType->refCount++;
13686 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13688 if(!classProp->dataType)
13689 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13690 if(classProp->constant)
13692 FreeExpContents(exp);
13693 exp->isConstant = 1;
13694 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13697 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13701 char constant[256];
13704 sprintf(constant, "%d", (int)classProp->Get(_class));
13705 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13711 exp->expType = classProp->dataType;
13712 if(classProp->dataType)
13713 classProp->dataType->refCount++;
13719 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13721 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13722 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13723 struct __ecereNameSpace__ecere__com__NameSpace * child;
13727 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)))
13729 data = ScanGlobalData(child, name);
13737 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13739 extern char * strncpy(char * , const char * , size_t n);
13741 static struct GlobalData * FindGlobalData(char * name)
13744 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13746 nameSpace = globalData;
13747 for(c = 0; name[c]; c++)
13749 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13751 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13752 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13754 strncpy(spaceName, name + start, c - start);
13755 spaceName[c - start] = '\0';
13756 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13757 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13759 return (((void *)0));
13760 nameSpace = newSpace;
13768 return ScanGlobalData(nameSpace, name + start);
13770 return (((void *)0));
13773 static int definedExpStackPos;
13775 static void * definedExpStack[512];
13777 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13779 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13781 FreeExpContents(checkedExp);
13782 FreeType(checkedExp->expType);
13783 FreeType(checkedExp->destType);
13784 *checkedExp = *newExp;
13785 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13786 checkedExp->prev = prev;
13787 checkedExp->next = next;
13790 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13792 extern int printf(const char * , ...);
13794 void __ecereMethod_Expression_Clear();
13796 void ApplyAnyObjectLogic(struct Expression * e)
13798 struct Type * destType = e->destType;
13800 if(destType && (destType->classObjectType == 3))
13802 if(e && e->expType)
13804 struct Type * type = e->expType;
13805 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13807 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13809 _class = type->__anon1._class->__anon1.registered;
13811 else if(type->kind == 19)
13813 _class = FindClass("ecere::com::Class")->__anon1.registered;
13817 char string[1024] = "";
13818 struct Symbol * classSym;
13820 PrintTypeNoConst(type, string, 0, 1);
13821 classSym = FindClass(string);
13823 _class = classSym->__anon1.registered;
13825 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->__anon1._class || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type == 1))) || destType->byReference)))
13827 if(!_class || strcmp(_class->fullName, "char *"))
13829 struct Expression * checkedExp = e, * newExp;
13831 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13833 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13835 if(checkedExp->type == 23)
13837 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13840 checkedExp = (*checkedExp->__anon1.list).last;
13842 else if(checkedExp->type == 11)
13843 checkedExp = checkedExp->__anon1.cast.exp;
13845 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13847 newExp = checkedExp->__anon1.op.exp2;
13848 checkedExp->__anon1.op.exp2 = (((void *)0));
13849 FreeExpContents(checkedExp);
13850 if(e->expType && e->expType->passAsTemplate)
13854 ComputeTypeSize(e->expType);
13855 sprintf(size, "%d", e->expType->size);
13856 newExp = MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp), '+', MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), MkListOne(MkExpConstant(size))))));
13858 ReplaceExpContents(checkedExp, newExp);
13859 e->byReference = 1;
13861 else if(!e->byReference || (_class && _class->type == 5))
13863 struct Expression * checkedExp;
13866 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->__anon1.member.memberType == 3) || (e->type == 9 && e->__anon1.member.memberType == 3) || (e->type == 4 && !e->__anon1.op.exp1 && e->__anon1.op.op == '*') || e->type == 6;
13868 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13870 struct Context * context = PushContext();
13871 struct Declarator * decl;
13872 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13873 char typeString[1024];
13874 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13876 typeString[0] = '\0';
13878 newExp->prev = (((void *)0));
13879 newExp->next = (((void *)0));
13880 newExp->expType = (((void *)0));
13881 PrintTypeNoConst(e->expType, typeString, 0, 1);
13882 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13883 newExp->destType = ProcessType(specs, decl);
13884 curContext = context;
13888 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13891 sprintf(name, "__internalValue%03X", internalValueCounter++);
13892 if(!curCompound->__anon1.compound.declarations)
13893 curCompound->__anon1.compound.declarations = MkList();
13894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13895 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13896 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13897 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13900 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13902 struct Type * type = e->destType;
13904 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13905 CopyTypeInto(e->destType, type);
13906 e->destType->refCount = 1;
13907 e->destType->classObjectType = 0;
13910 e->__anon1.compound->__anon1.compound.context = context;
13911 PopContext(context);
13912 curContext = context->parent;
13916 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13918 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13920 if(checkedExp->type == 23)
13922 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13925 checkedExp = (*checkedExp->__anon1.list).last;
13927 else if(checkedExp->type == 11)
13928 checkedExp = checkedExp->__anon1.cast.exp;
13931 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13933 *operand = *checkedExp;
13934 __ecereMethod_Expression_Clear(checkedExp);
13935 checkedExp->destType = ProcessTypeString("void *", 0);
13936 checkedExp->expType = checkedExp->destType;
13937 checkedExp->destType->refCount++;
13938 checkedExp->type = 4;
13939 checkedExp->__anon1.op.op = '&';
13940 checkedExp->__anon1.op.exp1 = (((void *)0));
13941 checkedExp->__anon1.op.exp2 = operand;
13950 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->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))))
13952 if(e->expType->classObjectType && destType && destType->classObjectType)
13958 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13961 thisExp->prev = (((void *)0));
13962 thisExp->next = (((void *)0));
13963 __ecereMethod_Expression_Clear(e);
13965 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13966 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13967 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13969 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13970 CopyTypeInto(e->expType, thisExp->expType);
13971 e->expType->byReference = 0;
13972 e->expType->refCount = 1;
13973 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))
13975 e->expType->classObjectType = 0;
13980 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13982 if(destType->kind == 14)
13984 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13986 else if(!(destType->truth && e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && e->expType->__anon1._class->__anon1.registered->type == 1))
13988 unsigned int byReference = e->expType->byReference;
13989 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13990 struct Declarator * decl;
13991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13992 char typeString[1024];
13993 struct Type * type;
13994 int backupClassObjectType;
13995 unsigned int backupByReference;
13997 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
14001 backupClassObjectType = type->classObjectType;
14002 backupByReference = type->byReference;
14003 type->classObjectType = 0;
14004 type->byReference = 0;
14005 typeString[0] = '\0';
14006 PrintType(type, typeString, 0, 1);
14007 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14008 type->classObjectType = backupClassObjectType;
14009 type->byReference = backupByReference;
14011 thisExp->prev = (((void *)0));
14012 thisExp->next = (((void *)0));
14013 __ecereMethod_Expression_Clear(e);
14014 if((type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1000 || type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 4 || type->__anon1._class->__anon1.registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
14017 e->__anon1.op.op = '*';
14018 e->__anon1.op.exp1 = (((void *)0));
14019 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14020 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14021 CopyTypeInto(e->expType, type);
14022 e->expType->byReference = 0;
14023 e->expType->refCount = 1;
14028 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14029 e->__anon1.cast.exp = thisExp;
14030 e->byReference = 1;
14034 e->destType = destType;
14035 destType->refCount++;
14040 void ApplyLocation(struct Expression * exp, struct Location * loc)
14046 if(exp->__anon1.op.exp1)
14047 ApplyLocation(exp->__anon1.op.exp1, loc);
14048 if(exp->__anon1.op.exp2)
14049 ApplyLocation(exp->__anon1.op.exp2, loc);
14052 if(exp->__anon1.list)
14054 struct Expression * e;
14056 for(e = (*exp->__anon1.list).first; e; e = e->next)
14057 ApplyLocation(e, loc);
14061 if(exp->__anon1.index.index)
14063 struct Expression * e;
14065 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14066 ApplyLocation(e, loc);
14068 if(exp->__anon1.index.exp)
14069 ApplyLocation(exp->__anon1.index.exp, loc);
14072 if(exp->__anon1.call.arguments)
14074 struct Expression * arg;
14076 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14077 ApplyLocation(arg, loc);
14079 if(exp->__anon1.call.exp)
14080 ApplyLocation(exp->__anon1.call.exp, loc);
14084 if(exp->__anon1.member.exp)
14085 ApplyLocation(exp->__anon1.member.exp, loc);
14088 if(exp->__anon1.cast.exp)
14089 ApplyLocation(exp->__anon1.cast.exp, loc);
14092 if(exp->__anon1.cond.exp)
14094 struct Expression * e;
14096 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14097 ApplyLocation(e, loc);
14099 if(exp->__anon1.cond.cond)
14100 ApplyLocation(exp->__anon1.cond.cond, loc);
14101 if(exp->__anon1.cond.elseExp)
14102 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14105 if(exp->__anon1.vaArg.exp)
14106 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14113 extern char * strstr(const char * , const char * );
14115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14117 struct __ecereNameSpace__ecere__com__DefinedExpression
14119 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14120 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14122 const char * value;
14123 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
14124 } __attribute__ ((gcc_struct));
14126 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
14128 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
14130 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char * string, int * numBytes);
14132 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14134 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14136 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
14138 static void ProcessStatement(struct Statement * stmt);
14140 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14142 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14144 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14146 extern const char * sourceFile;
14148 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
14150 extern struct Expression * MoveExpContents(struct Expression * exp);
14152 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14154 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
14156 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14158 void ProcessExpressionType(struct Expression * exp)
14160 unsigned int unresolved = 0;
14161 struct Location oldyylloc = yylloc;
14162 unsigned int notByReference = 0;
14164 if(!exp || exp->expType)
14171 struct Identifier * id = exp->__anon1.__anon1.identifier;
14173 if(!id || !topContext)
14175 if(id->_class && id->_class->__anon1.__anon1.name)
14177 id->classSym = id->_class->__anon1.__anon1.symbol;
14179 if(!strcmp(id->string, "__runtimePlatform"))
14181 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14184 else if(strstr(id->string, "__ecereClass") == id->string)
14186 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14189 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14191 ReplaceClassMembers(exp, thisClass);
14194 ProcessExpressionType(exp);
14197 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14202 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14206 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14212 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14215 ProcessExpressionType(exp);
14219 else if(currentClass && !id->_class)
14221 if(ResolveIdWithClass(exp, currentClass, 1))
14224 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14229 struct Type * type = symbol->type;
14230 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14232 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14234 struct Context * context = SetupTemplatesContext(_class);
14236 type = ReplaceThisClassType(_class);
14237 FinishTemplatesContext(context);
14239 type->refCount = 0;
14241 FreeSpecifier(id->_class);
14242 id->_class = (((void *)0));
14243 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14244 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14245 id->classSym = (((void *)0));
14246 exp->expType = type;
14249 if(type && (type->kind == 15))
14250 exp->isConstant = 1;
14251 if(symbol->isParam || !strcmp(id->string, "this"))
14253 if(_class && _class->type == 1 && !type->declaredWithStruct)
14254 exp->byReference = 1;
14256 if(symbol->isIterator)
14258 if(symbol->isIterator == 3)
14261 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14262 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14263 exp->expType = (((void *)0));
14264 ProcessExpressionType(exp);
14266 else if(symbol->isIterator != 4)
14269 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14270 exp->__anon1.member.exp->expType = exp->expType;
14271 exp->__anon1.member.member = MkIdentifier("data");
14272 exp->expType = (((void *)0));
14273 ProcessExpressionType(exp);
14280 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14282 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14286 strcpy(name, thisNameSpace);
14287 strcat(name, "::");
14288 strcat(name, id->string);
14289 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14292 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14297 for(c = 0; c < definedExpStackPos; c++)
14298 if(definedExpStack[c] == definedExp)
14300 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14302 struct Location backupYylloc = yylloc;
14303 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14305 definedExpStack[definedExpStackPos++] = definedExp;
14306 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14307 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
14308 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14310 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14311 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14312 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14313 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14315 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14316 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14318 parsedExpression = (((void *)0));
14320 expression_yyparse();
14321 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14323 fileInput = backInput;
14324 yylloc = backupYylloc;
14325 if(parsedExpression)
14327 FreeIdentifier(id);
14329 exp->__anon1.list = MkListOne(parsedExpression);
14330 ApplyLocation(parsedExpression, &yylloc);
14331 ProcessExpressionType(exp);
14332 definedExpStackPos--;
14335 definedExpStackPos--;
14341 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14347 struct GlobalData * data = (((void *)0));
14349 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14353 strcpy(name, thisNameSpace);
14354 strcat(name, "::");
14355 strcat(name, id->string);
14356 data = FindGlobalData(name);
14359 data = FindGlobalData(id->string);
14362 DeclareGlobalData(data);
14363 exp->expType = data->dataType;
14365 data->dataType->refCount++;
14366 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14367 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14368 FreeSpecifier(id->_class);
14369 id->_class = (((void *)0));
14374 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14376 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14380 strcpy(name, thisNameSpace);
14381 strcat(name, "::");
14382 strcat(name, id->string);
14383 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14386 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14391 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14392 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14394 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14395 strcpy(name, "__ecereFunction_");
14396 FullClassNameCat(name, id->string, 0);
14397 if(DeclareFunction(function, name))
14399 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14400 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14402 exp->expType = function->dataType;
14403 if(function->dataType)
14404 function->dataType->refCount++;
14405 FreeSpecifier(id->_class);
14406 id->_class = (((void *)0));
14418 if(!exp->__anon1.instance->_class)
14420 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14422 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14425 ProcessInstantiationType(exp->__anon1.instance);
14426 exp->isConstant = exp->__anon1.instance->isConstant;
14427 if(exp->__anon1.instance->_class)
14429 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14437 char * constant = exp->__anon1.__anon1.constant;
14438 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14440 exp->expType = type;
14441 if(constant[0] == '\'')
14443 if((int)((unsigned char *)constant)[1] > 127)
14446 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14450 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14451 exp->__anon1.__anon1.constant = PrintUInt(ch);
14453 type->__anon1._class = FindClass("unichar");
14454 type->isSigned = 0;
14459 type->isSigned = 1;
14464 char * dot = strchr(constant, '.');
14465 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14470 exponent = strchr(constant, 'p');
14472 exponent = strchr(constant, 'P');
14476 exponent = strchr(constant, 'e');
14478 exponent = strchr(constant, 'E');
14480 if(dot || exponent)
14482 if(strchr(constant, 'f') || strchr(constant, 'F'))
14486 type->isSigned = 1;
14490 unsigned int isSigned = constant[0] == '-';
14491 char * endP = (((void *)0));
14492 long long i64 = strtoll(constant, &endP, 0);
14493 uint64 ui64 = strtoull(constant, &endP, 0);
14494 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14498 if(i64 < (((int)0x80000000)))
14503 if(ui64 > (((int)0x7fffffff)))
14505 if(ui64 > (0xffffffff))
14508 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14512 else if(constant[0] != '0' || !constant[1])
14515 type->kind = is64Bit ? 4 : 3;
14516 type->isSigned = isSigned;
14519 exp->isConstant = 1;
14520 if(exp->destType && exp->destType->kind == 7)
14522 else if(exp->destType && exp->destType->kind == 6)
14524 else if(exp->destType && exp->destType->kind == 4)
14531 exp->isConstant = 1;
14532 exp->expType = __extension__ ({
14533 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14535 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14536 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14538 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14539 }), __ecereInstance2;
14545 ProcessExpressionType(exp->__anon1._new.size);
14546 exp->expType = __extension__ ({
14547 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14549 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14551 DeclareType(exp->expType->__anon1.type, 0, 0);
14555 ProcessExpressionType(exp->__anon1._renew.size);
14556 ProcessExpressionType(exp->__anon1._renew.exp);
14557 exp->expType = __extension__ ({
14558 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14560 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14562 DeclareType(exp->expType->__anon1.type, 0, 0);
14566 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14567 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14568 unsigned int useDestType = 0, useSideType = 0;
14569 struct Location oldyylloc = yylloc;
14570 unsigned int useSideUnit = 0;
14571 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14572 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14574 switch(exp->__anon1.op.op)
14628 if(exp->__anon1.op.exp1)
14635 if(exp->__anon1.op.op == '&')
14637 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14639 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14640 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14642 if(symbol && symbol->isIterator == 2)
14645 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14646 exp->__anon1.member.member = MkIdentifier("key");
14647 exp->expType = (((void *)0));
14648 exp->__anon1.op.exp2->expType = symbol->type;
14649 symbol->type->refCount++;
14650 ProcessExpressionType(exp);
14656 if(exp->__anon1.op.exp1)
14658 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14660 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14662 if(exp->__anon1.op.exp1->destType)
14663 FreeType(exp->__anon1.op.exp1->destType);
14664 exp->__anon1.op.exp1->destType = exp->destType;
14665 exp->__anon1.op.exp1->opDestType = 1;
14667 exp->destType->refCount++;
14671 if(exp->__anon1.op.exp1->destType)
14672 FreeType(exp->__anon1.op.exp1->destType);
14673 exp->__anon1.op.exp1->destType = dummy;
14676 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14677 exp->__anon1.op.exp1->destType->count++;
14678 ProcessExpressionType(exp->__anon1.op.exp1);
14679 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14680 exp->__anon1.op.exp1->destType->count--;
14681 exp->__anon1.op.exp1->opDestType = 0;
14682 if(!exp->__anon1.op.exp2 && (exp->__anon1.op.op == INC_OP || exp->__anon1.op.op == DEC_OP) && exp->__anon1.op.exp1->expType && exp->__anon1.op.exp1->expType->kind == 8 && exp->__anon1.op.exp1->expType->__anon1._class && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered->type == 3)
14684 exp->__anon1.op.exp2 = MkExpConstant("1");
14685 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14688 if(exp->__anon1.op.exp1->destType == dummy)
14691 exp->__anon1.op.exp1->destType = (((void *)0));
14693 type1 = exp->__anon1.op.exp1->expType;
14695 if(exp->__anon1.op.exp2)
14697 char expString[10240];
14699 expString[0] = '\0';
14700 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14702 if(exp->__anon1.op.exp1)
14704 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14705 if(exp->__anon1.op.exp1->expType)
14706 exp->__anon1.op.exp1->expType->refCount++;
14710 exp->__anon1.op.exp2->destType = exp->destType;
14711 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14712 exp->__anon1.op.exp2->opDestType = 1;
14714 exp->destType->refCount++;
14718 exp->expType = type1;
14723 PrintExpression(exp->__anon1.op.exp2, expString);
14724 if(type1 && type1->kind == 13)
14726 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN || exp->__anon1.op.op == AND_ASSIGN || exp->__anon1.op.op == OR_ASSIGN)
14727 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14728 else if(exp->__anon1.op.op == '=')
14730 if(exp->__anon1.op.exp2->destType)
14731 FreeType(exp->__anon1.op.exp2->destType);
14732 exp->__anon1.op.exp2->destType = type1;
14739 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN)
14743 if(exp->__anon1.op.exp2->destType)
14744 FreeType(exp->__anon1.op.exp2->destType);
14745 exp->__anon1.op.exp2->destType = type1;
14752 exp->expType = type1;
14754 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14756 if(exp->__anon1.op.exp2->destType)
14757 FreeType(exp->__anon1.op.exp2->destType);
14758 exp->__anon1.op.exp2->destType = exp->destType;
14759 if(exp->__anon1.op.op != '&')
14760 exp->__anon1.op.exp2->opDestType = 1;
14762 exp->destType->refCount++;
14766 if(exp->__anon1.op.exp2->destType)
14767 FreeType(exp->__anon1.op.exp2->destType);
14768 exp->__anon1.op.exp2->destType = dummy;
14771 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && (type1->__anon1._class->__anon1.registered->type == 2 || type1->__anon1._class->__anon1.registered->type == 4))
14773 FreeType(exp->__anon1.op.exp2->destType);
14774 exp->__anon1.op.exp2->destType = type1;
14777 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14778 exp->__anon1.op.exp2->destType->count++;
14779 if(exp->__anon1.op.op == SIZEOF)
14781 struct Expression * e = exp->__anon1.op.exp2;
14783 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14785 if(e->type == 5 || e->type == 32 || e->type == 23)
14788 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14790 e = (*e->__anon1.list).last;
14793 if(e->type == 11 && e->__anon1.cast.exp)
14794 e->__anon1.cast.exp->needCast = 1;
14796 ProcessExpressionType(exp->__anon1.op.exp2);
14797 exp->__anon1.op.exp2->opDestType = 0;
14798 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14799 exp->__anon1.op.exp2->destType->count--;
14800 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14802 if(exp->__anon1.op.exp2->expType->kind == 23 || exp->__anon1.op.exp2->expType->kind == 22 || exp->__anon1.op.exp2->expType->kind == 4 || exp->__anon1.op.exp2->expType->kind == 3 || exp->__anon1.op.exp2->expType->kind == 2 || exp->__anon1.op.exp2->expType->kind == 1)
14804 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14805 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14807 else if(exp->__anon1.op.exp2->expType->kind == 13 || exp->__anon1.op.exp2->expType->kind == 12 || exp->__anon1.op.exp2->expType->kind == 11 || exp->__anon1.op.exp2->expType->kind == 16 || (type1->__anon1.type->kind == 0 && exp->__anon1.op.exp2->expType->kind == 8 && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && (exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 0 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 5)))
14809 if(exp->__anon1.op.op == ADD_ASSIGN)
14810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14812 else if((exp->__anon1.op.exp2->expType->kind == 8 && type1->kind == 13 && type1->__anon1.type->kind == 8 && type1->__anon1.type->__anon1._class == exp->__anon1.op.exp2->expType->__anon1._class && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1))
14814 if(exp->__anon1.op.op == ADD_ASSIGN)
14815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14817 else if(inCompiler)
14819 char type1String[1024];
14820 char type2String[1024];
14822 type1String[0] = '\0';
14823 type2String[0] = '\0';
14824 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14825 PrintType(type1, type2String, 0, 1);
14826 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14827 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14830 if(exp->__anon1.op.exp2->destType == dummy)
14833 exp->__anon1.op.exp2->destType = (((void *)0));
14835 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14837 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14838 type2->refCount = 1;
14839 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14840 type2->isSigned = 1;
14842 else if(exp->__anon1.op.op == '~' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && (!exp->__anon1.op.exp2->expType->isSigned || exp->__anon1.op.exp2->expType->kind != 3))
14844 type2 = __extension__ ({
14845 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14847 __ecereInstance1->kind = 3, __ecereInstance1;
14849 type2->refCount = 1;
14850 type2->isSigned = 1;
14854 type2 = exp->__anon1.op.exp2->expType;
14860 if(exp->__anon1.op.op == SIZEOF)
14862 exp->expType = __extension__ ({
14863 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14865 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14867 exp->isConstant = 1;
14869 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14871 exp->expType = Dereference(type2);
14872 if(type2 && type2->kind == 8)
14873 notByReference = 1;
14875 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14876 exp->expType = Reference(type2);
14881 if(exp->__anon1.op.exp1)
14883 if(exp->__anon1.op.exp1->destType)
14884 FreeType(exp->__anon1.op.exp1->destType);
14885 exp->__anon1.op.exp1->destType = MkClassType("bool");
14886 exp->__anon1.op.exp1->destType->truth = 1;
14887 if(!exp->__anon1.op.exp1->expType)
14888 ProcessExpressionType(exp->__anon1.op.exp1);
14890 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14891 FreeType(exp->__anon1.op.exp1->expType);
14892 exp->__anon1.op.exp1->expType = MkClassType("bool");
14893 exp->__anon1.op.exp1->expType->truth = 1;
14895 if(exp->__anon1.op.exp2)
14897 if(exp->__anon1.op.exp2->destType)
14898 FreeType(exp->__anon1.op.exp2->destType);
14899 exp->__anon1.op.exp2->destType = MkClassType("bool");
14900 exp->__anon1.op.exp2->destType->truth = 1;
14901 if(!exp->__anon1.op.exp2->expType)
14902 ProcessExpressionType(exp->__anon1.op.exp2);
14904 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14905 FreeType(exp->__anon1.op.exp2->expType);
14906 exp->__anon1.op.exp2->expType = MkClassType("bool");
14907 exp->__anon1.op.exp2->expType->truth = 1;
14910 else if(exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->__anon1._class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->__anon1._class->string, "String")))))
14912 if(type1 && type2 && ((type1->kind == 8 && type1->__anon1._class && strcmp(type1->__anon1._class->string, "String")) == (type2->kind == 8 && type2->__anon1._class && strcmp(type2->__anon1._class->string, "String"))))
14914 if(exp->__anon1.op.op == '-' && ((type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4) || (type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)))
14916 struct Type * intType;
14918 if(!type1->__anon1._class->__anon1.registered->dataType)
14919 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14920 if(!type2->__anon1._class->__anon1.registered->dataType)
14921 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14922 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14923 if(exp->__anon1.op.exp1->destType)
14924 FreeType(exp->__anon1.op.exp1->destType);
14925 if(exp->__anon1.op.exp2->destType)
14926 FreeType(exp->__anon1.op.exp2->destType);
14927 exp->__anon1.op.exp1->destType = intType;
14928 exp->__anon1.op.exp2->destType = intType;
14929 intType->refCount++;
14933 if(exp->__anon1.op.exp2->destType)
14934 FreeType(exp->__anon1.op.exp2->destType);
14935 exp->__anon1.op.exp2->destType = type1;
14937 if(exp->__anon1.op.exp1->destType)
14938 FreeType(exp->__anon1.op.exp1->destType);
14939 exp->__anon1.op.exp1->destType = type2;
14942 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1->__anon1._class->__anon1.registered != type2->__anon1._class->__anon1.registered)
14943 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->__anon1._class->string, type2->__anon1._class->string, type1->__anon1._class->string);
14944 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14946 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14950 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14952 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14953 ProcessExpressionType(exp->__anon1.op.exp1);
14954 if(type2->kind != 13)
14956 ProcessExpressionType(classExp);
14957 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14958 if(!exp->__anon1.op.exp2->expType)
14962 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14965 ProcessExpressionType(exp->__anon1.op.exp2);
14969 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->__anon1._class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
14971 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14973 exp->expType = type1;
14977 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->__anon1._class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
14979 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14980 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14981 exp->expType = type2;
14985 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))
14987 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14991 unsigned int success = 0;
14993 if(type1->kind == 13 && type2->kind == 13)
14995 if(exp->__anon1.op.op == '+')
14996 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14997 else if(exp->__anon1.op.op == '-')
14999 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
15001 exp->expType = __extension__ ({
15002 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15004 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15007 if(type1->__anon1.type->kind == 20)
15009 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15013 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15015 ProcessExpressionType(classExp);
15017 exp->__anon1.list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp1))), exp->__anon1.op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp2)))))), '/', MkExpMember(classExp, MkIdentifier("typeSize"))));
15018 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15026 if(!success && exp->__anon1.op.exp1->type == 2)
15028 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15031 FreeType(exp->expType);
15032 exp->expType = exp->__anon1.op.exp1->destType;
15033 if(exp->__anon1.op.exp1->destType)
15034 exp->__anon1.op.exp1->destType->refCount++;
15037 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15040 FreeType(exp->expType);
15041 exp->expType = exp->__anon1.op.exp2->destType;
15042 if(exp->__anon1.op.exp2->destType)
15043 exp->__anon1.op.exp2->destType->refCount++;
15049 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15052 FreeType(exp->expType);
15053 exp->expType = exp->__anon1.op.exp2->destType;
15054 if(exp->__anon1.op.exp2->destType)
15055 exp->__anon1.op.exp2->destType->refCount++;
15058 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15061 FreeType(exp->expType);
15062 exp->expType = exp->__anon1.op.exp1->destType;
15063 if(exp->__anon1.op.exp1->destType)
15064 exp->__anon1.op.exp1->destType->refCount++;
15070 char expString1[10240];
15071 char expString2[10240];
15075 expString1[0] = '\0';
15076 expString2[0] = '\0';
15081 PrintExpression(exp->__anon1.op.exp1, expString1);
15082 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15083 PrintExpression(exp->__anon1.op.exp2, expString2);
15084 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15085 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15086 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15088 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15092 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15094 if(exp->__anon1.op.exp1->destType)
15095 FreeType(exp->__anon1.op.exp1->destType);
15096 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15097 if(type2->__anon1._class->__anon1.registered->dataType)
15098 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15099 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15100 exp->expType = type2;
15104 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15106 if(exp->__anon1.op.exp2->destType)
15107 FreeType(exp->__anon1.op.exp2->destType);
15108 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15109 if(type1->__anon1._class->__anon1.registered->dataType)
15110 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15111 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15112 exp->expType = type1;
15118 unsigned int valid = 0;
15120 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15122 if(exp->__anon1.op.exp2->destType)
15123 FreeType(exp->__anon1.op.exp2->destType);
15124 if(!type1->__anon1._class->__anon1.registered->dataType)
15125 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15126 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15127 exp->__anon1.op.exp2->destType->refCount++;
15128 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15131 type2 = exp->__anon1.op.exp2->destType;
15134 exp->expType = type2;
15137 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15139 if(exp->__anon1.op.exp1->destType)
15140 FreeType(exp->__anon1.op.exp1->destType);
15141 if(!type2->__anon1._class->__anon1.registered->dataType)
15142 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15143 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15144 exp->__anon1.op.exp1->destType->refCount++;
15145 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15146 type1 = exp->__anon1.op.exp1->destType;
15147 exp->expType = type1;
15150 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15152 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15153 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15155 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15157 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15159 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15162 FreeType(exp->expType);
15163 exp->expType = exp->__anon1.op.exp2->expType;
15164 if(exp->__anon1.op.exp2->expType)
15165 exp->__anon1.op.exp2->expType->refCount++;
15169 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15171 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15174 FreeType(exp->expType);
15175 exp->expType = exp->__anon1.op.exp1->expType;
15176 if(exp->__anon1.op.exp1->expType)
15177 exp->__anon1.op.exp1->expType->refCount++;
15184 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15186 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15189 FreeType(exp->expType);
15190 exp->expType = exp->__anon1.op.exp1->expType;
15191 if(exp->__anon1.op.exp1->expType)
15192 exp->__anon1.op.exp1->expType->refCount++;
15196 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15198 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15201 FreeType(exp->expType);
15202 exp->expType = exp->__anon1.op.exp2->expType;
15203 if(exp->__anon1.op.exp2->expType)
15204 exp->__anon1.op.exp2->expType->refCount++;
15212 if(type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && (type1->kind != 8 || !type1->__anon1._class || !type1->__anon1._class->__anon1.registered || type1->__anon1._class->__anon1.registered->type != 3))
15214 if(exp->__anon1.op.exp1->destType)
15215 FreeType(exp->__anon1.op.exp1->destType);
15216 exp->__anon1.op.exp1->destType = type2;
15218 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15221 FreeType(exp->expType);
15222 exp->expType = exp->__anon1.op.exp1->destType;
15223 if(exp->__anon1.op.exp1->destType)
15224 exp->__anon1.op.exp1->destType->refCount++;
15229 if(exp->__anon1.op.exp2->destType)
15230 FreeType(exp->__anon1.op.exp2->destType);
15231 exp->__anon1.op.exp2->destType = type1;
15233 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15236 FreeType(exp->expType);
15237 exp->expType = exp->__anon1.op.exp2->destType;
15238 if(exp->__anon1.op.exp2->destType)
15239 exp->__anon1.op.exp2->destType->refCount++;
15241 else if(type1 && type2)
15243 char expString1[10240];
15244 char expString2[10240];
15245 char type1String[1024];
15246 char type2String[1024];
15248 expString1[0] = '\0';
15249 expString2[0] = '\0';
15250 type1String[0] = '\0';
15251 type2String[0] = '\0';
15254 PrintExpression(exp->__anon1.op.exp1, expString1);
15255 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15256 PrintExpression(exp->__anon1.op.exp2, expString2);
15257 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15258 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15259 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15261 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15262 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15264 exp->expType = exp->__anon1.op.exp1->expType;
15265 if(exp->__anon1.op.exp1->expType)
15266 exp->__anon1.op.exp1->expType->refCount++;
15268 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15270 exp->expType = exp->__anon1.op.exp2->expType;
15271 if(exp->__anon1.op.exp2->expType)
15272 exp->__anon1.op.exp2->expType->refCount++;
15280 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15282 struct Type * oldType = exp->__anon1.op.exp1->expType;
15284 exp->__anon1.op.exp1->expType = (((void *)0));
15285 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15288 exp->__anon1.op.exp1->expType = oldType;
15290 if(exp->__anon1.op.exp1->destType)
15291 FreeType(exp->__anon1.op.exp1->destType);
15292 exp->__anon1.op.exp1->destType = type2;
15294 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15297 FreeType(exp->expType);
15298 exp->expType = exp->__anon1.op.exp1->destType;
15299 if(exp->__anon1.op.exp1->destType)
15300 exp->__anon1.op.exp1->destType->refCount++;
15304 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15306 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15308 if(exp->__anon1.op.exp1->destType)
15309 FreeType(exp->__anon1.op.exp1->destType);
15310 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15311 if(type2->__anon1._class->__anon1.registered->dataType)
15312 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15313 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15315 if(exp->__anon1.op.op == '!')
15317 exp->expType = MkClassType("bool");
15318 exp->expType->truth = 1;
15322 exp->expType = type2;
15327 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15329 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15331 if(exp->__anon1.op.exp2->destType)
15332 FreeType(exp->__anon1.op.exp2->destType);
15333 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15334 if(type1->__anon1._class->__anon1.registered->dataType)
15335 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15336 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15338 exp->expType = type1;
15344 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15346 char expString[10000];
15348 expString[0] = '\0';
15351 PrintExpression(exp->__anon1.op.exp1, expString);
15352 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15357 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15359 char expString[10240];
15361 expString[0] = '\0';
15364 PrintExpression(exp->__anon1.op.exp2, expString);
15365 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15368 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15372 FreeType(exp->expType);
15373 exp->expType = MkClassType("bool");
15374 exp->expType->truth = 1;
15376 if(exp->__anon1.op.op != SIZEOF)
15377 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15378 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15380 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15382 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15383 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15384 yylloc = oldyylloc;
15393 struct Expression * e;
15395 exp->isConstant = 1;
15396 for(e = (*exp->__anon1.list).first; e; e = e->next)
15398 unsigned int inced = 0;
15402 FreeType(e->destType);
15403 e->opDestType = exp->opDestType;
15404 e->destType = exp->destType;
15407 exp->destType->refCount++;
15408 e->destType->count++;
15412 ProcessExpressionType(e);
15414 exp->destType->count--;
15415 if(!exp->expType && !e->next)
15417 exp->expType = e->expType;
15419 e->expType->refCount++;
15422 exp->isConstant = 0;
15424 e = (*exp->__anon1.list).first;
15425 if(!e->next && e->type == 8)
15427 struct Expression * next = exp->next, * prev = exp->prev;
15429 FreeType(exp->expType);
15430 FreeType(exp->destType);
15431 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15435 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15436 ProcessExpressionType(exp);
15442 struct Expression * e;
15444 exp->isConstant = 1;
15445 ProcessExpressionType(exp->__anon1.index.exp);
15446 if(!exp->__anon1.index.exp->isConstant)
15447 exp->isConstant = 0;
15448 if(exp->__anon1.index.exp->expType)
15450 struct Type * source = exp->__anon1.index.exp->expType;
15452 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15454 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15455 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15457 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15459 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15460 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15462 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15464 if(type->kind == 8)
15465 type->constant = 1;
15466 else if(type->kind == 13)
15468 struct Type * t = type;
15470 while(t->kind == 13)
15471 t = t->__anon1.type;
15474 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15479 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15481 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15484 FreeType(e->destType);
15485 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15487 ProcessExpressionType(e);
15492 exp->isConstant = 0;
15495 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15497 DeclareType(exp->expType, 0, 0);
15502 struct Expression * e;
15503 struct Type * functionType;
15504 struct Type * methodType = (((void *)0));
15510 PrintExpression(exp->__anon1.call.exp, name);
15511 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15513 PrintExpression(exp->__anon1.call.exp, name);
15516 if(exp->__anon1.call.exp->type == 0)
15518 struct Expression * idExp = exp->__anon1.call.exp;
15519 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15521 if(!strcmp(id->string, "__builtin_frame_address"))
15523 exp->expType = ProcessTypeString("void *", 1);
15524 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15525 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15528 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15530 exp->expType = ProcessTypeString("int", 1);
15531 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15532 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15535 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15537 struct Expression * a = (((void *)0));
15538 struct Expression * b = (((void *)0));
15539 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15541 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15543 a = (*exp->__anon1.call.arguments).first;
15544 b = (*exp->__anon1.call.arguments).last;
15548 else if((*exp->__anon1.call.arguments).count == 1)
15550 a = (*exp->__anon1.call.arguments).first;
15555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15556 idExp->__anon1.__anon1.identifier = (((void *)0));
15557 FreeExpContents(exp);
15558 ProcessExpressionType(a);
15560 ProcessExpressionType(b);
15562 exp->__anon1.list = MkList();
15563 if(a->expType && (!b || b->expType))
15565 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15570 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15571 struct Declaration * decl;
15572 char temp1[1024], temp2[1024];
15574 GetTypeSpecs(a->expType, specs);
15575 if(a && !a->isConstant && a->type != 0)
15577 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15578 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15579 tempExp1 = QMkExpId(temp1);
15580 tempExp1->expType = a->expType;
15582 a->expType->refCount++;
15583 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15585 if(b && !b->isConstant && b->type != 0)
15587 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15588 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15589 tempExp2 = QMkExpId(temp2);
15590 tempExp2->expType = b->expType;
15592 b->expType->refCount++;
15593 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15595 decl = MkDeclaration(specs, decls);
15596 if(!curCompound->__anon1.compound.declarations)
15597 curCompound->__anon1.compound.declarations = MkList();
15598 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15602 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15604 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15606 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15607 exp->expType = a->expType;
15609 a->expType->refCount++;
15611 else if(!strcmp(id->string, "Abs"))
15613 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15614 exp->expType = a->expType;
15616 a->expType->refCount++;
15618 else if(!strcmp(id->string, "Sgn"))
15620 ListAdd(exp->__anon1.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"))))));
15621 exp->expType = ProcessTypeString("int", 0);
15623 FreeExpression(tempExp1);
15625 FreeExpression(tempExp2);
15626 FreeIdentifier(id);
15632 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15634 if(!exp->__anon1.call.exp->destType)
15636 exp->__anon1.call.exp->destType = dummy;
15639 ProcessExpressionType(exp->__anon1.call.exp);
15640 if(exp->__anon1.call.exp->destType == dummy)
15643 exp->__anon1.call.exp->destType = (((void *)0));
15647 functionType = exp->__anon1.call.exp->expType;
15648 if(functionType && functionType->kind == 16)
15650 methodType = functionType;
15651 functionType = methodType->__anon1.__anon3.method->dataType;
15652 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15654 char typeString[1024];
15656 typeString[0] = '\0';
15658 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15660 functionType->__anon1.__anon2.thisClass = (((void *)0));
15661 PrintType(functionType, typeString, 1, 1);
15662 functionType->__anon1.__anon2.thisClass = back;
15664 if(strstr(typeString, "thisclass"))
15666 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15667 struct Declarator * decl;
15670 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15672 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15673 if(thisClass != (exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass ? exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass : exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass))
15674 thisClassParams = 0;
15675 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15677 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15679 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15680 ProcessDeclarator(decl);
15681 thisClass = backupThisClass;
15683 thisClassParams = 1;
15684 functionType = ProcessType(specs, decl);
15685 functionType->refCount = 0;
15686 FinishTemplatesContext(context);
15688 FreeList(specs, (void *)(FreeSpecifier));
15689 FreeDeclarator(decl);
15693 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15695 struct Type * type = functionType->__anon1.type;
15697 if(!functionType->refCount)
15699 functionType->__anon1.type = (((void *)0));
15700 FreeType(functionType);
15702 functionType = type;
15704 if(functionType && functionType->kind != 11)
15706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15708 else if(functionType)
15710 unsigned int emptyParams = 0, noParams = 0;
15711 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15712 struct Type * type = functionType->__anon1.__anon2.params.first;
15713 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15715 struct Location oldyylloc = yylloc;
15719 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15721 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15724 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15726 if(memberExp && memberExp->__anon1.member.exp && memberExp->__anon1.member.exp->expType && memberExp->__anon1.member.exp->expType->kind == 19 && memberExp->__anon1.member.exp->expType->__anon1._class)
15728 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15731 e->destType = type;
15733 type = functionType->__anon1.__anon2.params.first;
15736 type->refCount = 0;
15738 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15740 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15741 type->byReference = functionType->byReference;
15742 type->typedByReference = functionType->typedByReference;
15745 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15747 e->destType = type;
15749 type = functionType->__anon1.__anon2.params.first;
15752 type->refCount = 0;
15755 if(type && type->kind == 0)
15758 if(!type->refCount)
15760 type = (((void *)0));
15762 for(; e; e = e->next)
15764 if(!type && !emptyParams)
15767 if(methodType && methodType->__anon1.__anon3.methodClass)
15768 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15773 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15775 struct Type * templatedType = (((void *)0));
15776 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15777 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15780 if(_class && _class->templateArgs)
15782 struct __ecereNameSpace__ecere__com__Class * sClass;
15784 for(sClass = _class; sClass; sClass = sClass->base)
15786 if(sClass->templateClass)
15787 sClass = sClass->templateClass;
15789 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15791 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15793 struct __ecereNameSpace__ecere__com__Class * nextClass;
15795 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15797 if(nextClass->templateClass)
15798 nextClass = nextClass->templateClass;
15799 id += nextClass->templateParams.count;
15809 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15811 unsigned int constant = type->constant;
15812 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15815 struct Context * context = SetupTemplatesContext(_class);
15817 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15818 FinishTemplatesContext(context);
15820 if(templatedType->kind == 8 && constant)
15821 templatedType->constant = 1;
15822 else if(templatedType->kind == 13)
15824 struct Type * t = templatedType->__anon1.type;
15826 while(t->kind == 13)
15827 t = t->__anon1.type;
15829 t->constant = constant;
15831 e->destType = templatedType;
15834 templatedType->passAsTemplate = 1;
15839 e->destType = type;
15846 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15848 e->destType = type->prev;
15849 e->destType->refCount++;
15853 e->destType = type;
15858 if(type && type->kind != 14)
15860 struct Type * next = type->next;
15862 if(!type->refCount)
15867 if(type && type->kind != 14)
15869 if(methodType && methodType->__anon1.__anon3.methodClass)
15870 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15872 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15874 yylloc = oldyylloc;
15875 if(type && !type->refCount)
15880 functionType = __extension__ ({
15881 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15883 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15885 if(exp->__anon1.call.exp->type == 0)
15887 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15891 struct Symbol * symbol;
15892 struct Location oldyylloc = yylloc;
15894 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15895 if(strstr(string, "__builtin_") == string)
15899 functionType->__anon1.__anon2.returnType = exp->destType;
15900 exp->destType->refCount++;
15904 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15905 symbol = __extension__ ({
15906 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15908 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15910 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15911 if(strstr(symbol->string, "::"))
15912 globalContext->hasNameSpace = 1;
15913 yylloc = oldyylloc;
15916 else if(exp->__anon1.call.exp->type == 8)
15920 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15921 if(!functionType->__anon1.__anon2.returnType)
15923 functionType->__anon1.__anon2.returnType = __extension__ ({
15924 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15926 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15930 if(functionType && functionType->kind == 11)
15932 exp->expType = functionType->__anon1.__anon2.returnType;
15933 if(functionType->__anon1.__anon2.returnType)
15934 functionType->__anon1.__anon2.returnType->refCount++;
15935 if(!functionType->refCount)
15936 FreeType(functionType);
15938 if(exp->__anon1.call.arguments)
15940 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15941 ProcessExpressionType(e);
15947 struct Type * type;
15948 struct Location oldyylloc = yylloc;
15949 unsigned int thisPtr;
15950 struct Expression * checkExp = exp->__anon1.member.exp;
15954 if(checkExp->type == 11)
15955 checkExp = checkExp->__anon1.cast.exp;
15956 else if(checkExp->type == 5)
15957 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15961 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15962 exp->thisPtr = thisPtr;
15963 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15965 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15967 ProcessExpressionType(exp->__anon1.member.exp);
15968 if(exp->__anon1.member.exp->expType && exp->__anon1.member.exp->expType->kind == 8 && exp->__anon1.member.exp->expType->__anon1._class && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered->type == 0)
15970 exp->isConstant = 0;
15973 exp->isConstant = exp->__anon1.member.exp->isConstant;
15974 type = exp->__anon1.member.exp->expType;
15976 if(type && (type->kind == 20))
15978 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15979 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15983 for(param = _class->templateParams.first; param; param = param->next)
15985 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15989 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15991 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15995 struct Expression * expMember = exp->__anon1.member.exp;
15996 struct Declarator * decl;
15997 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15998 char thisClassTypeString[1024];
16000 FreeIdentifier(exp->__anon1.member.member);
16001 ProcessExpressionType(argExp);
16003 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16007 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16008 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16011 strcpy(thisClassTypeString, _class->fullName);
16013 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16014 exp->expType = ProcessType(specs, decl);
16015 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16017 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16018 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16019 int paramCount = 0;
16020 int lastParam = -1;
16021 char templateString[1024];
16022 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16024 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16025 for(cClass = expClass; cClass; cClass = cClass->base)
16029 for(param = cClass->templateParams.first; param; param = param->next)
16032 struct __ecereNameSpace__ecere__com__Class * sClass;
16033 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16035 for(sClass = cClass->base; sClass; sClass = sClass->base)
16036 id += sClass->templateParams.count;
16037 arg = expClass->templateArgs[id];
16038 for(sClass = _class; sClass; sClass = sClass->base)
16040 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16042 struct __ecereNameSpace__ecere__com__Class * nextClass;
16044 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16045 p += nextClass->templateParams.count;
16046 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16048 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16050 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16052 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16053 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16060 char argument[256];
16062 argument[0] = '\0';
16063 switch(param->type)
16067 char expString[1024];
16068 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16069 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16070 struct Expression * exp;
16071 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16073 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16074 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16075 ProcessExpressionType(exp);
16076 ComputeExpression(exp);
16077 expString[0] = '\0';
16078 PrintExpression(exp, expString);
16079 strcat(argument, expString);
16080 FreeExpression(exp);
16085 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16090 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16092 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16093 strcat(argument, thisClassTypeString);
16095 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16103 strcat(templateString, ", ");
16104 if(lastParam != p - 1)
16106 strcat(templateString, param->name);
16107 strcat(templateString, " = ");
16109 strcat(templateString, argument);
16118 int len = strlen(templateString);
16120 if(templateString[len - 1] == '>')
16121 templateString[len++] = ' ';
16122 templateString[len++] = '>';
16123 templateString[len++] = '\0';
16126 struct Context * context = SetupTemplatesContext(_class);
16128 FreeType(exp->expType);
16129 exp->expType = ProcessTypeString(templateString, 0);
16130 FinishTemplatesContext(context);
16134 exp->__anon1.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")))))))));
16137 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16139 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16142 if(type && (type->kind == 20))
16144 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 24 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->__anon1.type->kind == 1)))
16146 struct Identifier * id = exp->__anon1.member.member;
16147 int typeKind = type->kind;
16148 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
16150 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16152 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16157 if(typeKind == 3 || typeKind == 15)
16158 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16161 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16163 _class = type->__anon1._class->__anon1.registered;
16165 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16167 _class = FindClass("char *")->__anon1.registered;
16169 else if(type->kind == 13)
16171 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16172 FreeType(exp->expType);
16173 exp->expType = ProcessTypeString("uintptr", 0);
16174 exp->byReference = 1;
16178 char string[1024] = "";
16179 struct Symbol * classSym;
16181 PrintTypeNoConst(type, string, 0, 1);
16182 classSym = FindClass(string);
16184 _class = classSym->__anon1.registered;
16190 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16191 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16192 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16193 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16194 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16196 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16197 exp->__anon1.member.memberType = 1;
16198 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16202 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16204 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16205 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16207 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16209 member = (((void *)0));
16211 if(!member && !prop)
16212 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16213 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16214 exp->__anon1.member.thisPtr = 1;
16218 unsigned int useMemberForNonConst = 0;
16222 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16223 useMemberForNonConst = prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16224 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16225 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16227 if((!prop || useMemberForNonConst) && !member)
16229 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16232 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16233 useMemberForNonConst |= prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16234 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16235 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16240 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16241 prop = (((void *)0));
16243 member = (((void *)0));
16247 if(!prop && !member && !method)
16248 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16249 if(!prop && !member && !method)
16253 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16256 exp->__anon1.member.memberType = 5;
16257 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16261 char structName[1024];
16262 struct Identifier * id = exp->__anon1.member.member;
16263 struct Expression * classExp = exp->__anon1.member.exp;
16266 FreeType(classExp->expType);
16267 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16268 strcpy(structName, "__ecereClassData_");
16269 FullClassNameCat(structName, type->__anon1._class->string, 0);
16271 exp->__anon1.member.member = id;
16272 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type->__anon1._class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
16274 ProcessExpressionType(exp);
16280 struct Symbol * classSym = FindClass(id->string);
16284 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16287 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16291 if(exp->__anon1.member.exp->destType)
16292 FreeType(exp->__anon1.member.exp->destType);
16294 if(method && !method->_class->symbol)
16295 method->_class->symbol = FindClass(method->_class->fullName);
16296 if(prop && !prop->_class->symbol)
16297 prop->_class->symbol = FindClass(prop->_class->fullName);
16298 exp->__anon1.member.exp->destType = __extension__ ({
16299 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16301 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16306 exp->__anon1.member.memberType = 1;
16307 if(!prop->dataType)
16308 ProcessPropertyType(prop);
16309 exp->expType = prop->dataType;
16310 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16312 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16314 CopyTypeInto(type, exp->expType);
16315 type->refCount = 1;
16316 type->constant = 1;
16317 exp->expType = type;
16319 else if(prop->dataType)
16320 prop->dataType->refCount++;
16324 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16326 FreeExpContents(exp);
16328 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16329 ProcessExpressionType(exp);
16332 exp->__anon1.member.memberType = 3;
16333 DeclareStruct(_class->fullName, 0);
16334 if(!member->dataType)
16336 struct Context * context = SetupTemplatesContext(_class);
16338 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16339 FinishTemplatesContext(context);
16341 exp->expType = member->dataType;
16342 if(member->dataType)
16343 member->dataType->refCount++;
16345 else if(revConvert)
16347 exp->__anon1.member.memberType = 4;
16348 exp->expType = MkClassType(revConvert->_class->fullName);
16353 exp->__anon1.member.memberType = 2;
16355 if(!method->dataType)
16356 ProcessMethodType(method);
16357 exp->expType = __extension__ ({
16358 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16360 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16362 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16363 exp->expType->__anon1.__anon3.usedClass = _class;
16365 else if(!classProp)
16367 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16369 FreeExpContents(exp);
16371 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16372 FreeType(exp->expType);
16373 exp->expType = MkClassType("ecere::com::Class");
16376 yylloc = exp->__anon1.member.member->loc;
16377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16379 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16381 if(_class && exp->expType)
16383 struct __ecereNameSpace__ecere__com__Class * tClass;
16385 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16386 while(tClass && !tClass->templateClass)
16387 tClass = tClass->base;
16388 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16391 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16392 struct __ecereNameSpace__ecere__com__Class * sClass;
16394 for(sClass = tClass; sClass; sClass = sClass->base)
16397 if(sClass->templateClass)
16398 sClass = sClass->templateClass;
16399 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16401 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16403 for(sClass = sClass->base; sClass; sClass = sClass->base)
16404 id += sClass->templateParams.count;
16412 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16414 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16415 struct Context * context = SetupTemplatesContext(tClass);
16416 unsigned int constant = exp->expType->constant;
16418 FreeType(exp->expType);
16419 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16420 if(exp->expType->kind == 8 && constant)
16421 exp->expType->constant = 1;
16422 else if(exp->expType->kind == 13)
16424 struct Type * t = exp->expType->__anon1.type;
16426 while(t->kind == 13)
16427 t = t->__anon1.type;
16429 t->constant = constant;
16433 if(exp->expType->kind == 21)
16435 FreeType(exp->expType);
16436 exp->expType = ReplaceThisClassType(_class);
16438 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16439 exp->expType->passAsTemplate = 1;
16442 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16443 if(exp->destType->kind == 8 && constant)
16444 exp->destType->constant = 1;
16445 else if(exp->destType->kind == 13)
16447 struct Type * t = exp->destType->__anon1.type;
16449 while(t->kind == 13)
16450 t = t->__anon1.type;
16452 t->constant = constant;
16454 if(exp->destType->kind == 21)
16456 FreeType(exp->destType);
16457 exp->destType = ReplaceThisClassType(_class);
16461 FinishTemplatesContext(context);
16464 else if(tClass && exp->expType->kind == 13 && exp->expType->__anon1.type && exp->expType->__anon1.type->kind == 20 && exp->expType->__anon1.type->__anon1.templateParameter->type == 0)
16467 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16468 struct __ecereNameSpace__ecere__com__Class * sClass;
16470 for(sClass = tClass; sClass; sClass = sClass->base)
16473 if(sClass->templateClass)
16474 sClass = sClass->templateClass;
16475 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16477 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16479 for(sClass = sClass->base; sClass; sClass = sClass->base)
16480 id += sClass->templateParams.count;
16490 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16491 struct Context * context = SetupTemplatesContext(tClass);
16492 struct Type * basicType;
16494 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16497 if(basicType->kind == 21)
16499 FreeType(basicType);
16500 basicType = ReplaceThisClassType(_class);
16502 FreeType(exp->expType);
16503 exp->expType = __extension__ ({
16504 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16506 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16510 exp->destType = exp->expType;
16511 exp->destType->refCount++;
16514 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16515 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16516 struct Declarator * decl;
16518 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16521 exp->destType->refCount++;
16523 exp->expType->refCount++;
16525 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16526 exp->__anon1.cast.exp = newExp;
16529 FinishTemplatesContext(context);
16532 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16534 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16538 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16540 int paramCount = 0;
16541 int lastParam = -1;
16542 char templateString[1024];
16543 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16545 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16546 while(cClass != expClass)
16548 struct __ecereNameSpace__ecere__com__Class * sClass;
16550 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16553 for(param = cClass->templateParams.first; param; param = param->next)
16555 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16558 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16560 while(cClassCur != tClass && !paramCur)
16562 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16564 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16566 cClassCur = sClassCur;
16567 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16569 if(!strcmp(paramCur->name, param->name))
16576 if(paramCur && paramCur->type == 0)
16577 arg = tClass->templateArgs[cp];
16579 arg = expClass->templateArgs[p];
16581 char argument[256];
16583 argument[0] = '\0';
16584 switch(param->type)
16588 char expString[1024];
16589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16590 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16591 struct Expression * exp;
16592 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16594 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16595 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16596 ProcessExpressionType(exp);
16597 ComputeExpression(exp);
16598 expString[0] = '\0';
16599 PrintExpression(exp, expString);
16600 strcat(argument, expString);
16601 FreeExpression(exp);
16606 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16611 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16612 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16619 strcat(templateString, ", ");
16620 if(lastParam != p - 1)
16622 strcat(templateString, param->name);
16623 strcat(templateString, " = ");
16625 strcat(templateString, argument);
16634 int len = strlen(templateString);
16636 if(templateString[len - 1] == '>')
16637 templateString[len++] = ' ';
16638 templateString[len++] = '>';
16639 templateString[len++] = '\0';
16641 FreeType(exp->expType);
16643 struct Context * context = SetupTemplatesContext(tClass);
16645 exp->expType = ProcessTypeString(templateString, 0);
16646 FinishTemplatesContext(context);
16653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->string : (type->__anon1._class ? type->__anon1._class->string : (((void *)0)))) : "(null)");
16655 else if(type && (type->kind == 9 || type->kind == 10))
16657 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16661 exp->expType = memberType;
16663 memberType->refCount++;
16668 char expString[10240];
16670 expString[0] = '\0';
16673 PrintExpression(exp, expString);
16674 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16676 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16678 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16680 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16682 struct Identifier * id = exp->__anon1.member.member;
16683 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
16687 FreeType(exp->expType);
16688 exp->expType = ReplaceThisClassType(_class);
16692 yylloc = oldyylloc;
16697 struct Type * destType = exp->destType;
16699 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16701 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16703 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16707 ProcessExpressionType(exp);
16714 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16716 if(classSym && classSym->__anon1.registered)
16718 if(classSym->__anon1.registered->type == 5)
16723 DeclareStruct(classSym->string, 0);
16724 FreeSpecifier(exp->__anon1._class);
16726 FullClassNameCat(name, classSym->string, 0);
16727 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16731 if(classSym->__anon1.registered->fixed)
16733 FreeSpecifier(exp->__anon1._class);
16734 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16739 char className[1024];
16741 strcpy(className, "__ecereClass_");
16742 FullClassNameCat(className, classSym->string, 1);
16743 DeclareClass(classSym, className);
16744 FreeExpContents(exp);
16746 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16747 exp->__anon1.member.member = MkIdentifier("structSize");
16751 exp->expType = __extension__ ({
16752 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16754 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16760 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16762 exp->expType = __extension__ ({
16763 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16765 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16767 exp->isConstant = 1;
16768 DeclareType(type, 0, 0);
16774 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16777 FreeType(exp->__anon1.cast.exp->destType);
16778 exp->__anon1.cast.exp->destType = type;
16781 ProcessExpressionType(exp->__anon1.cast.exp);
16784 exp->expType = type;
16785 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16787 void * prev = exp->prev, * next = exp->next;
16788 struct Type * expType = exp->__anon1.cast.exp->destType;
16789 struct Expression * castExp = exp->__anon1.cast.exp;
16790 struct Type * destType = exp->destType;
16793 expType->refCount++;
16794 FreeType(exp->expType);
16795 FreeTypeName(exp->__anon1.cast.typeName);
16797 FreeType(exp->expType);
16798 FreeType(exp->destType);
16799 exp->expType = expType;
16800 exp->destType = destType;
16801 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16807 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16813 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16815 exp->expType = type;
16820 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16822 ProcessExpressionType(exp->__anon1.vaArg.exp);
16823 exp->expType = type;
16828 struct Expression * e;
16830 exp->isConstant = 1;
16831 FreeType(exp->__anon1.cond.cond->destType);
16832 exp->__anon1.cond.cond->destType = MkClassType("bool");
16833 exp->__anon1.cond.cond->destType->truth = 1;
16834 ProcessExpressionType(exp->__anon1.cond.cond);
16835 if(!exp->__anon1.cond.cond->isConstant)
16836 exp->isConstant = 0;
16837 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16841 FreeType(e->destType);
16842 e->destType = exp->destType;
16844 e->destType->refCount++;
16846 ProcessExpressionType(e);
16849 exp->expType = e->expType;
16851 e->expType->refCount++;
16854 exp->isConstant = 0;
16856 FreeType(exp->__anon1.cond.elseExp->destType);
16857 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16858 if(exp->__anon1.cond.elseExp->destType)
16859 exp->__anon1.cond.elseExp->destType->refCount++;
16860 ProcessExpressionType(exp->__anon1.cond.elseExp);
16861 if(!exp->__anon1.cond.elseExp->isConstant)
16862 exp->isConstant = 0;
16867 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16869 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16871 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16873 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16875 exp->destType->refCount++;
16877 ProcessStatement(exp->__anon1.compound);
16878 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16880 exp->expType->refCount++;
16886 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16888 if(spec && spec->type == 1)
16890 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16891 exp->expType->kind = 19;
16892 exp->byReference = 1;
16896 exp->expType = MkClassType("ecere::com::Class");
16897 exp->byReference = 1;
16903 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16907 struct Identifier * id = exp->__anon1.classData.id;
16908 char structName[1024];
16909 struct Expression * classExp;
16911 strcpy(structName, "__ecereClassData_");
16912 FullClassNameCat(structName, _class->fullName, 0);
16914 exp->__anon1.member.member = id;
16915 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16916 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16918 classExp = MkExpIdentifier(MkIdentifier("class"));
16919 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class->fullName)), (((void *)0))), MkIdentifier("offsetClass"))))))));
16920 ProcessExpressionType(exp);
16927 struct Type * type = (((void *)0));
16928 const char * typeString = (((void *)0));
16929 char typeStringBuf[1024];
16931 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->__anon1._class->__anon1.registered, containerClass))
16933 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16935 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16937 else if(exp->__anon1.list)
16939 struct Expression * e;
16941 for(e = (*exp->__anon1.list).first; e; e = e->next)
16943 ProcessExpressionType(e);
16953 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16957 e->expType = (((void *)0));
16958 e = (*exp->__anon1.list).first;
16959 ProcessExpressionType(e);
16962 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16964 FreeType(e->expType);
16965 e->expType = (((void *)0));
16967 type = (((void *)0));
16975 FreeType(e->expType);
16976 e->expType = (((void *)0));
16982 typeStringBuf[0] = '\0';
16983 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16984 typeString = typeStringBuf;
16986 type = (((void *)0));
16991 char templateString[1024];
16992 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16993 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16994 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16995 struct Expression * expExt;
16996 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16998 sprintf(templateString, "Container<%s>", typeString);
16999 if(exp->__anon1.list)
17001 struct Expression * e;
17003 type = ProcessTypeString(typeString, 0);
17004 while((e = (*exp->__anon1.list).first))
17006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17007 e->destType = type;
17009 ProcessExpressionType(e);
17010 ListAdd(initializers, MkInitializerAssignment(e));
17013 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17015 DeclareStruct("ecere::com::BuiltInContainer", 0);
17016 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17017 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17018 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17019 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17020 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17021 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17022 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17023 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17024 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17025 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17027 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17029 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17030 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
17031 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17032 exp->expType = ProcessTypeString(templateString, 0);
17034 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17035 ProcessExpressionType(expExt);
17039 exp->expType = ProcessTypeString("Container", 0);
17040 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17045 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17047 FreeType(exp->expType);
17048 exp->expType = ReplaceThisClassType(thisClass);
17050 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->__anon1.__anon1.members.first && exp->expType->__anon1.__anon1.enumName)
17052 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17056 if(exp->expType->kind != 15)
17058 struct Type * member;
17059 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17061 FreeType(exp->expType);
17062 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17063 exp->expType->kind = symbol->type->kind;
17064 exp->expType->refCount++;
17065 exp->expType->__anon1.__anon1.enumName = enumName;
17066 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17067 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17068 member->refCount++;
17072 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17074 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17076 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17078 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17084 if(exp->destType && (exp->destType->kind == 18))
17086 else if(exp->destType && !exp->destType->keepCast)
17088 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17089 exp->needTemplateCast = 1;
17090 if(exp->destType->kind == 0)
17092 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17094 if(!exp->destType->count || unresolved)
17099 if(exp->destType->kind != 14)
17106 char expString[10240];
17108 expString[0] = '\0';
17109 PrintType(exp->destType, type2, 0, 1);
17112 PrintExpression(exp, expString);
17113 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17116 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17117 else if(exp->type != 16)
17118 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17123 char expString[10240];
17125 expString[0] = '\0';
17128 PrintExpression(exp, expString);
17129 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17132 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17133 else if(exp->type != 16)
17134 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17146 PrintType(exp->expType, type1, 0, 1);
17147 PrintType(exp->destType, type2, 0, 1);
17149 if(exp->destType->truth && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && !strcmp(exp->destType->__anon1._class->__anon1.registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type != 1)))
17153 char expString[10240];
17155 expString[0] = '\0';
17158 PrintExpression(exp, expString);
17159 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17161 if(!sourceFile || (!strstr(sourceFile, "src\\lexer.ec") && !strstr(sourceFile, "src/lexer.ec") && !strstr(sourceFile, "src\\grammar.ec") && !strstr(sourceFile, "src/grammar.ec") && !strstr(sourceFile, "src\\type.ec") && !strstr(sourceFile, "src/type.ec") && !strstr(sourceFile, "src\\expression.ec") && !strstr(sourceFile, "src/expression.ec")))
17162 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17163 FreeType(exp->expType);
17164 exp->destType->refCount++;
17165 exp->expType = exp->destType;
17170 else if(exp->destType && exp->destType->kind == 13 && exp->destType->__anon1.type && exp->destType->__anon1.type->kind == 11 && exp->expType && (exp->expType->kind == 11 || exp->expType->kind == 16))
17172 struct Expression * nbExp = GetNonBracketsExp(exp);
17174 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
17176 struct Expression * e = MoveExpContents(exp);
17178 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
17180 exp->__anon1.cast.exp->destType = exp->destType;
17182 exp->destType->refCount++;
17183 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
17187 else if(unresolved)
17189 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17190 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name, exp->__anon1.__anon1.identifier->string);
17191 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17192 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17194 else if(!exp->expType && exp->type != 16)
17196 char expString[10240];
17198 expString[0] = '\0';
17201 PrintExpression(exp, expString);
17202 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17204 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17207 ApplyAnyObjectLogic(exp);
17208 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1 && exp->destType->kind != 24)))
17210 exp->byReference = 1;
17212 yylloc = oldyylloc;
17215 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)
17219 *curMember = (*curMember)->next;
17220 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17222 *curMember = subMemberStack[--(*subMemberStackPos)];
17223 *curMember = (*curMember)->next;
17225 while((*curMember) && (*curMember)->isProperty)
17226 *curMember = (*curMember)->next;
17227 if(subMemberStackPos)
17229 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17231 subMemberStack[(*subMemberStackPos)++] = *curMember;
17232 *curMember = (*curMember)->members.first;
17233 while(*curMember && (*curMember)->isProperty)
17234 *curMember = (*curMember)->next;
17242 if(subMemberStackPos && *subMemberStackPos)
17244 *curMember = subMemberStack[--(*subMemberStackPos)];
17245 *curMember = (*curMember)->next;
17249 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17251 if(*curClass == _class)
17253 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17255 *curMember = (*curClass)->membersAndProperties.first;
17257 while((*curMember) && (*curMember)->isProperty)
17258 *curMember = (*curMember)->next;
17259 if(subMemberStackPos)
17261 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17263 subMemberStack[(*subMemberStackPos)++] = *curMember;
17264 *curMember = (*curMember)->members.first;
17265 while(*curMember && (*curMember)->isProperty)
17266 *curMember = (*curMember)->next;
17273 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17278 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17280 if(init->__anon1.exp && !init->__anon1.exp->destType)
17282 FreeType(init->__anon1.exp->destType);
17283 init->__anon1.exp->destType = type;
17287 if(init->__anon1.exp)
17289 ProcessExpressionType(init->__anon1.exp);
17290 init->isConstant = init->__anon1.exp->isConstant;
17296 struct Expression * exp = init->__anon1.exp;
17297 struct Instantiation * inst = exp->__anon1.instance;
17298 struct MembersInit * members;
17301 init->__anon1.list = MkList();
17304 for(members = (*inst->members).first; members; members = members->next)
17306 if(members->type == 0)
17308 struct MemberInit * member;
17310 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17312 ListAdd(init->__anon1.list, member->initializer);
17313 member->initializer = (((void *)0));
17318 FreeExpression(exp);
17322 struct Initializer * i;
17323 struct Type * initializerType = (((void *)0));
17324 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17325 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17326 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17327 int subMemberStackPos = 0;
17329 if(type && type->kind == 12)
17330 initializerType = Dereference(type);
17331 else if(type && (type->kind == 9 || type->kind == 10))
17332 initializerType = type->__anon1.__anon1.members.first;
17333 for(i = (*init->__anon1.list).first; i; i = i->next)
17335 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17337 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17340 if(!curMember->dataType)
17341 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17342 initializerType = curMember->dataType;
17345 ProcessInitializer(i, initializerType);
17346 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17347 initializerType = initializerType->next;
17349 init->isConstant = 0;
17351 if(type && type->kind == 12)
17352 FreeType(initializerType);
17353 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type != 1))
17355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17362 extern struct Symbol * FindType(struct Context * ctx, const char * name);
17364 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17366 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17372 if(spec->__anon1.specifier == THISCLASS)
17377 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17378 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17379 ProcessSpecifier(spec, declareStruct);
17386 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17389 DeclareType(symbol->type, 1, 1);
17390 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17391 DeclareStruct(spec->__anon1.__anon1.name, 0);
17396 struct Enumerator * e;
17398 if(spec->__anon1.__anon2.list)
17400 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17403 ProcessExpressionType(e->exp);
17411 if(spec->__anon1.__anon2.definitions)
17413 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17415 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17422 static void ProcessDeclarator(struct Declarator * decl)
17427 if(decl->__anon1.identifier->classSym)
17429 FreeSpecifier(decl->__anon1.identifier->_class);
17430 decl->__anon1.identifier->_class = (((void *)0));
17434 if(decl->__anon1.array.exp)
17435 ProcessExpressionType(decl->__anon1.array.exp);
17442 if(decl->declarator)
17443 ProcessDeclarator(decl->declarator);
17444 if(decl->type == 4)
17446 struct Identifier * id = GetDeclId(decl);
17448 if(id && id->_class)
17450 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17452 if(!decl->__anon1.function.parameters)
17453 decl->__anon1.function.parameters = MkList();
17454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17455 id->_class = (((void *)0));
17457 if(decl->__anon1.function.parameters)
17459 struct TypeName * param;
17461 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17463 if(param->qualifiers && (*param->qualifiers).first)
17465 struct Specifier * spec = (*param->qualifiers).first;
17467 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17469 struct Declarator * d = param->declarator;
17470 struct TypeName * newParam = (newParam = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), newParam->qualifiers = MkListOne(MkSpecifier(VOID)), newParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d), newParam);
17473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17474 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17475 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17476 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17480 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17482 struct Declarator * d = param->declarator;
17484 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17485 param->qualifiers = MkListOne(MkSpecifier(VOID));
17487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17488 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17490 else if(spec->__anon1.specifier == THISCLASS)
17495 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17496 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17497 ProcessSpecifier(spec, 0);
17501 if(param->declarator)
17502 ProcessDeclarator(param->declarator);
17510 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17512 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17514 static void ProcessDeclaration(struct Declaration * decl)
17516 yylloc = decl->loc;
17521 unsigned int declareStruct = 0;
17523 if(decl->__anon1.__anon1.declarators)
17525 struct InitDeclarator * d;
17527 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17529 struct Type * type, * subType;
17531 ProcessDeclarator(d->declarator);
17532 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17535 ProcessInitializer(d->initializer, type);
17536 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17538 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17540 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17542 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17543 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17544 if(decl->__anon1.__anon1.specifiers)
17545 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
17546 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
17549 decl->__anon1.inst = inst;
17553 for(subType = type; subType; )
17555 if(subType->kind == 8)
17560 else if(subType->kind == 13)
17562 else if(subType->kind == 12)
17563 subType = subType->__anon1.__anon4.arrayType;
17572 if(decl->__anon1.__anon1.specifiers)
17574 struct Specifier * s;
17576 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17578 ProcessSpecifier(s, declareStruct);
17585 ProcessInstantiationType(decl->__anon1.inst);
17590 struct Specifier * spec;
17591 struct Declarator * d;
17592 unsigned int declareStruct = 0;
17594 if(decl->__anon1.__anon1.declarators)
17596 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17598 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17599 struct Type * subType;
17601 ProcessDeclarator(d);
17602 for(subType = type; subType; )
17604 if(subType->kind == 8)
17609 else if(subType->kind == 13)
17611 else if(subType->kind == 12)
17612 subType = subType->__anon1.__anon4.arrayType;
17619 if(decl->__anon1.__anon1.specifiers)
17621 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17622 ProcessSpecifier(spec, declareStruct);
17629 static struct FunctionDefinition * curFunction;
17631 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17633 char propName[1024], propNameM[1024];
17634 char getName[1024], setName[1024];
17635 struct __ecereNameSpace__ecere__sys__OldList * args;
17637 DeclareProperty(prop, setName, getName);
17638 strcpy(propName, "__ecereProp_");
17639 FullClassNameCat(propName, prop->_class->fullName, 0);
17640 strcat(propName, "_");
17641 FullClassNameCat(propName, prop->name, 1);
17642 strcpy(propNameM, "__ecerePropM_");
17643 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17644 strcat(propNameM, "_");
17645 FullClassNameCat(propNameM, prop->name, 1);
17646 if(prop->isWatchable)
17649 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17650 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17651 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17653 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17654 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17655 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17659 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17660 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17661 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17663 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17664 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17665 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17667 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17668 curFunction->propSet->fireWatchersDone = 1;
17671 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17673 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17675 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17677 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17679 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17681 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17683 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17685 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17687 static void ProcessStatement(struct Statement * stmt)
17689 yylloc = stmt->loc;
17693 ProcessStatement(stmt->__anon1.labeled.stmt);
17696 if(stmt->__anon1.caseStmt.exp)
17698 FreeType(stmt->__anon1.caseStmt.exp->destType);
17699 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17701 curSwitchType->refCount++;
17702 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17703 ComputeExpression(stmt->__anon1.caseStmt.exp);
17705 if(stmt->__anon1.caseStmt.stmt)
17706 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17710 if(stmt->__anon1.compound.context)
17712 struct Declaration * decl;
17713 struct Statement * s;
17714 struct Statement * prevCompound = curCompound;
17715 struct Context * prevContext = curContext;
17717 if(!stmt->__anon1.compound.isSwitch)
17718 curCompound = stmt;
17719 curContext = stmt->__anon1.compound.context;
17720 if(stmt->__anon1.compound.declarations)
17722 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17723 ProcessDeclaration(decl);
17725 if(stmt->__anon1.compound.statements)
17727 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17728 ProcessStatement(s);
17730 curContext = prevContext;
17731 curCompound = prevCompound;
17737 struct Expression * exp;
17739 if(stmt->__anon1.expressions)
17741 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17742 ProcessExpressionType(exp);
17748 struct Expression * exp;
17750 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17751 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17752 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17753 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17755 ProcessExpressionType(exp);
17757 if(stmt->__anon1.ifStmt.stmt)
17758 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17759 if(stmt->__anon1.ifStmt.elseStmt)
17760 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17765 struct Type * oldSwitchType = curSwitchType;
17767 if(stmt->__anon1.switchStmt.exp)
17769 struct Expression * exp;
17771 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17775 ProcessExpressionType(exp);
17778 curSwitchType = exp->expType;
17781 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17782 curSwitchType = oldSwitchType;
17787 if(stmt->__anon1.whileStmt.exp)
17789 struct Expression * exp;
17791 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17792 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17793 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17794 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17796 ProcessExpressionType(exp);
17799 if(stmt->__anon1.whileStmt.stmt)
17800 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17805 if(stmt->__anon1.doWhile.exp)
17807 struct Expression * exp;
17809 if((*stmt->__anon1.doWhile.exp).last)
17811 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17812 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17813 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17815 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17817 ProcessExpressionType(exp);
17820 if(stmt->__anon1.doWhile.stmt)
17821 ProcessStatement(stmt->__anon1.doWhile.stmt);
17826 struct Expression * exp;
17828 if(stmt->__anon1.forStmt.init)
17829 ProcessStatement(stmt->__anon1.forStmt.init);
17830 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17832 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17833 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17834 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17836 if(stmt->__anon1.forStmt.check)
17837 ProcessStatement(stmt->__anon1.forStmt.check);
17838 if(stmt->__anon1.forStmt.increment)
17840 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17841 ProcessExpressionType(exp);
17843 if(stmt->__anon1.forStmt.stmt)
17844 ProcessStatement(stmt->__anon1.forStmt.stmt);
17849 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17850 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17851 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17852 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17853 char iteratorType[1024];
17854 struct Type * source;
17855 struct Expression * e;
17856 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->__anon1.cast.exp->type == 35));
17857 struct Expression * arrayExp;
17858 const char * typeString = (((void *)0));
17859 int builtinCount = 0;
17861 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17865 FreeType(e->destType);
17866 e->destType = ProcessTypeString("Container", 0);
17868 if(!isBuiltin || e->next)
17869 ProcessExpressionType(e);
17871 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17872 if(isBuiltin || (source && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, containerClass)))
17874 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17875 struct Symbol * symbol;
17876 struct Expression * expIt = (((void *)0));
17877 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17878 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17879 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17880 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17883 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17884 stmt->__anon1.compound.context->parent = curContext;
17885 curContext = stmt->__anon1.compound.context;
17886 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17888 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17890 isCustomAVLTree = 1;
17891 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17894 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17896 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17898 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17901 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17905 struct Declarator * decl;
17906 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17908 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17909 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17910 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17914 struct Type * type = (((void *)0));
17915 char typeStringBuf[1024];
17917 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17918 if(((struct Expression *)(*exp).last)->type == 11)
17920 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17923 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17925 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->__anon1._class && arrayExp->destType->__anon1._class->__anon1.registered && arrayExp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->__anon1._class->__anon1.registered, containerClass) && arrayExp->destType->__anon1._class->__anon1.registered->templateArgs)
17927 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17929 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17931 else if(arrayExp->__anon1.list)
17933 struct Expression * e;
17935 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17937 ProcessExpressionType(e);
17947 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17951 e->expType = (((void *)0));
17952 e = (*arrayExp->__anon1.list).first;
17953 ProcessExpressionType(e);
17956 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17958 FreeType(e->expType);
17959 e->expType = (((void *)0));
17961 type = (((void *)0));
17969 FreeType(e->expType);
17970 e->expType = (((void *)0));
17976 typeStringBuf[0] = '\0';
17977 PrintType(type, typeStringBuf, 0, 1);
17978 typeString = typeStringBuf;
17984 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17985 struct Declarator * decl;
17986 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17988 if(arrayExp->__anon1.list)
17990 struct Expression * e;
17992 builtinCount = (*arrayExp->__anon1.list).count;
17993 type = ProcessTypeString(typeString, 0);
17994 while((e = (*arrayExp->__anon1.list).first))
17996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17997 e->destType = type;
17999 ProcessExpressionType(e);
18000 ListAdd(initializers, MkInitializerAssignment(e));
18003 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
18005 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
18006 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
18007 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
18008 FreeList(exp, (void *)(FreeExpression));
18012 arrayExp->expType = ProcessTypeString("Container", 0);
18013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18016 else if(isLinkList && !isList)
18018 struct Declarator * decl;
18019 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18021 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18022 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18023 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18025 else if(_class->templateArgs)
18028 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18030 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18031 stmt->__anon1.compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
18033 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18036 switch(block->type)
18039 if(block->__anon1.compound.context)
18040 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18043 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18044 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18045 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18046 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18049 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18050 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18053 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18054 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18057 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18058 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18061 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18062 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18065 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18066 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18072 block = MkIfStmt(filter, block, (((void *)0)));
18076 stmt->__anon1.compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array")), '+', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
18077 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18078 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18079 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18085 sprintf(count, "%d", builtinCount);
18086 stmt->__anon1.compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpIdentifier(MkIdentifier("__internalArray"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpIdentifier(MkIdentifier("__internalArray")), '+', MkExpConstant(count))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
18087 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18088 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18089 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18091 else if(isLinkList && !isList)
18093 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18094 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18096 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18098 stmt->__anon1.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));
18102 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18103 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18105 stmt->__anon1.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));
18107 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18108 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18109 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18113 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18115 ProcessExpressionType(expIt);
18116 if((*stmt->__anon1.compound.declarations).first)
18117 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18119 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18120 ProcessStatement(stmt);
18121 curContext = stmt->__anon1.compound.context->parent;
18126 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18138 struct Expression * exp;
18140 if(stmt->__anon1.expressions)
18142 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18146 if(curFunction && !curFunction->type)
18147 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18148 FreeType(exp->destType);
18149 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18151 exp->destType->refCount++;
18153 ProcessExpressionType(exp);
18160 ProcessDeclaration(stmt->__anon1.decl);
18165 struct AsmField * field;
18167 if(stmt->__anon1.asmStmt.inputFields)
18169 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18170 if(field->expression)
18171 ProcessExpressionType(field->expression);
18173 if(stmt->__anon1.asmStmt.outputFields)
18175 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18176 if(field->expression)
18177 ProcessExpressionType(field->expression);
18179 if(stmt->__anon1.asmStmt.clobberedFields)
18181 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18183 if(field->expression)
18184 ProcessExpressionType(field->expression);
18191 struct PropertyWatch * propWatch;
18192 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18193 struct Expression * object = stmt->__anon1._watch.object;
18194 struct Expression * watcher = stmt->__anon1._watch.watcher;
18197 ProcessExpressionType(watcher);
18199 ProcessExpressionType(object);
18202 if(watcher || thisClass)
18204 struct External * external = curExternal;
18205 struct Context * context = curContext;
18208 stmt->__anon1.expressions = MkList();
18209 curExternal = external->prev;
18210 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18212 struct ClassFunction * func;
18213 char watcherName[1024];
18214 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->__anon1._class) ? watcher->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18215 struct External * createdExternal;
18216 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18219 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18220 if(propWatch->deleteWatch)
18221 strcat(watcherName, "_delete");
18224 struct Identifier * propID;
18226 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18228 strcat(watcherName, "_");
18229 strcat(watcherName, propID->string);
18232 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18234 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->__anon1._class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
18235 ProcessClassFunctionBody(func, propWatch->compound);
18236 propWatch->compound = (((void *)0));
18237 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18238 createdExternal->symbol->idCode = external->symbol->idCode;
18239 curExternal = createdExternal;
18240 ProcessFunction(createdExternal->__anon1.function);
18242 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18244 externalDecl->__anon1.declaration = decl;
18245 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18246 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18248 if(propWatch->deleteWatch)
18250 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18252 ListAdd(args, CopyExpression(object));
18253 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18254 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18255 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18259 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18260 struct Identifier * propID;
18262 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18264 char propName[1024];
18265 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18269 char getName[1024], setName[1024];
18270 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18272 DeclareProperty(prop, setName, getName);
18273 strcpy(propName, "__ecereProp_");
18274 FullClassNameCat(propName, prop->_class->fullName, 0);
18275 strcat(propName, "_");
18276 FullClassNameCat(propName, prop->name, 1);
18277 ListAdd(args, CopyExpression(object));
18278 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18279 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18280 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
18281 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18291 curExternal = external;
18292 curContext = context;
18294 FreeExpression(watcher);
18296 FreeExpression(object);
18297 FreeList(watches, (void *)(FreePropertyWatch));
18300 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18304 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18306 ProcessStatement(propWatch->compound);
18313 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18314 struct Expression * object = stmt->__anon1._watch.object;
18315 struct __ecereNameSpace__ecere__com__Class * _class;
18318 ProcessExpressionType(object);
18321 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18324 struct Identifier * propID;
18327 stmt->__anon1.expressions = MkList();
18328 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18330 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18337 for(propID = (*watches).first; propID; propID = propID->next)
18339 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18343 CreateFireWatcher(prop, object, stmt);
18346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18351 struct __ecereNameSpace__ecere__com__Property * prop;
18352 struct __ecereNameSpace__ecere__com__Class * base;
18354 for(base = _class; base; base = base->base)
18356 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18358 if(prop->isProperty && prop->isWatchable)
18360 CreateFireWatcher(prop, object, stmt);
18366 FreeExpression(object);
18367 FreeList(watches, (void *)(FreeIdentifier));
18370 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18376 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18377 struct Expression * object = stmt->__anon1._watch.object;
18378 struct Expression * watcher = stmt->__anon1._watch.watcher;
18379 struct __ecereNameSpace__ecere__com__Class * _class;
18382 ProcessExpressionType(object);
18384 ProcessExpressionType(watcher);
18387 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18388 if(watcher || thisClass)
18392 struct Identifier * propID;
18395 stmt->__anon1.expressions = MkList();
18398 struct __ecereNameSpace__ecere__sys__OldList * args;
18401 ListAdd(args, CopyExpression(object));
18402 ListAdd(args, MkExpConstant("0"));
18403 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18404 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18408 for(propID = (*watches).first; propID; propID = propID->next)
18410 char propName[1024];
18411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18415 char getName[1024], setName[1024];
18416 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18418 DeclareProperty(prop, setName, getName);
18419 strcpy(propName, "__ecereProp_");
18420 FullClassNameCat(propName, prop->_class->fullName, 0);
18421 strcat(propName, "_");
18422 FullClassNameCat(propName, prop->name, 1);
18423 ListAdd(args, CopyExpression(object));
18424 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18425 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18426 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18433 FreeExpression(object);
18435 FreeExpression(watcher);
18436 FreeList(watches, (void *)(FreeIdentifier));
18439 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18449 extern struct Expression * QBrackets(struct Expression * exp);
18451 extern struct TypeName * QMkType(const char * spec, struct Declarator * decl);
18453 extern struct Declarator * QMkPtrDecl(const char * id);
18455 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18457 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18459 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18461 static void ProcessFunction(struct FunctionDefinition * function)
18463 struct Identifier * id = GetDeclId(function->declarator);
18464 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18465 struct Type * type = symbol ? symbol->type : (((void *)0));
18466 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18467 struct Context * oldTopContext = topContext;
18469 yylloc = function->loc;
18470 if(type && type->__anon1.__anon2.thisClass)
18472 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18473 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18474 char className[1024];
18475 char structName[1024];
18476 struct Declarator * funcDecl;
18477 struct Symbol * thisSymbol;
18478 unsigned int typedObject = 0;
18480 if(_class && !_class->base)
18482 _class = currentClass;
18483 if(_class && !_class->symbol)
18484 _class->symbol = FindClass(_class->fullName);
18485 classSym = _class ? _class->symbol : (((void *)0));
18488 thisClass = _class;
18489 if(inCompiler && _class)
18491 if(type->kind == 11)
18493 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18495 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18500 if(type->classObjectType != 1)
18502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18503 symbol->type->__anon1.__anon2.staticMethod = 1;
18504 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18505 symbol->type->extraParam = 0;
18508 strcpy(className, "__ecereClass_");
18509 FullClassNameCat(className, _class->fullName, 1);
18510 structName[0] = (char)0;
18511 FullClassNameCat(structName, _class->fullName, 0);
18512 funcDecl = GetFuncDecl(function->declarator);
18515 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18517 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18519 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18522 FreeTypeName(param);
18525 if(!function->propertyNoThis)
18527 struct TypeName * thisParam = (((void *)0));
18529 if(type->classObjectType != 1)
18531 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18532 if(!funcDecl->__anon1.function.parameters)
18533 funcDecl->__anon1.function.parameters = MkList();
18534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18538 if(type->classObjectType != 1)
18540 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18541 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18543 thisParam = __extension__ ({
18544 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18546 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18552 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18554 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18556 funcDecl = GetFuncDecl(initDecl->declarator);
18559 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18561 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18563 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18566 FreeTypeName(param);
18569 if(type->classObjectType != 1)
18571 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18573 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18575 if(!funcDecl->__anon1.function.parameters)
18576 funcDecl->__anon1.function.parameters = MkList();
18577 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18585 if(type->classObjectType != 1)
18587 thisSymbol = __extension__ ({
18588 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18590 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18592 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18593 if(typedObject && thisSymbol->type)
18595 thisSymbol->type->classObjectType = 2;
18596 thisSymbol->type->byReference = type->byReference;
18597 thisSymbol->type->typedByReference = type->byReference;
18601 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18603 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18606 struct __ecereNameSpace__ecere__com__Class * base;
18608 for(base = _class; base && base->type != 1000; base = base->next)
18610 for(member = base->membersAndProperties.first; member; member = member->next)
18611 if(!member->isProperty)
18617 for(member = _class->membersAndProperties.first; member; member = member->next)
18618 if(!member->isProperty)
18622 char pointerName[1024];
18623 struct Declaration * decl;
18624 struct Initializer * initializer;
18625 struct Expression * exp, * bytePtr;
18627 strcpy(pointerName, "__ecerePointer_");
18628 FullClassNameCat(pointerName, _class->fullName, 0);
18630 char className[1024];
18632 strcpy(className, "__ecereClass_");
18633 FullClassNameCat(className, classSym->string, 1);
18634 DeclareClass(classSym, className);
18636 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18641 sprintf(string, "%d", _class->offset);
18642 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18646 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18648 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18649 exp->expType = __extension__ ({
18650 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18652 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18653 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18655 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18656 }), __ecereInstance2;
18660 yylloc = function->body->loc;
18661 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18663 struct Context * prevContext = curContext;
18664 struct __ecereNameSpace__ecere__sys__OldList * list;
18666 curContext = function->body->__anon1.compound.context;
18667 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18668 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18669 curContext = prevContext;
18671 decl->symbol = (((void *)0));
18672 if(!function->body->__anon1.compound.declarations)
18673 function->body->__anon1.compound.declarations = MkList();
18674 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18680 thisClass = (((void *)0));
18683 FreeSpecifier(id->_class);
18684 id->_class = (((void *)0));
18685 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18687 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18689 id = GetDeclId(initDecl->declarator);
18690 FreeSpecifier(id->_class);
18691 id->_class = (((void *)0));
18695 topContext = function->body->__anon1.compound.context;
18697 struct FunctionDefinition * oldFunction = curFunction;
18699 curFunction = function;
18701 ProcessStatement(function->body);
18702 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18704 struct Statement * prevCompound = curCompound;
18705 struct Context * prevContext = curContext;
18706 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18708 if(!function->body->__anon1.compound.statements)
18709 function->body->__anon1.compound.statements = MkList();
18710 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18711 curCompound = function->body;
18712 curContext = function->body->__anon1.compound.context;
18713 ProcessStatement(fireWatchers);
18714 curContext = prevContext;
18715 curCompound = prevCompound;
18717 curFunction = oldFunction;
18719 if(function->declarator)
18721 ProcessDeclarator(function->declarator);
18723 topContext = oldTopContext;
18724 thisClass = oldThisClass;
18727 extern void FreeSymbol(struct Symbol * symbol);
18729 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18731 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18733 struct ClassDef * def;
18734 struct External * external = curExternal;
18735 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18737 for(def = definitions->first; def; def = def->next)
18741 if(def->__anon1.function->declarator)
18742 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18744 curExternal = external;
18745 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18747 else if(def->type == 2)
18749 if(def->__anon1.decl->type == 2)
18751 thisClass = regClass;
18752 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18753 thisClass = (((void *)0));
18757 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18760 thisClass = regClass;
18761 ProcessDeclaration(def->__anon1.decl);
18762 thisClass = backThisClass;
18765 else if(def->type == 1 && def->__anon1.defProperties)
18767 struct MemberInit * defProperty;
18768 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);
18770 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18771 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18773 thisClass = regClass;
18774 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18775 thisClass = (((void *)0));
18777 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18778 FreeSymbol(thisSymbol);
18780 else if(def->type == 3 && def->__anon1.propertyDef)
18782 struct PropertyDef * prop = def->__anon1.propertyDef;
18784 thisClass = regClass;
18789 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18791 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18793 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18794 ProcessStatement(prop->setStmt);
18800 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18802 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18804 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18805 ProcessStatement(prop->getStmt);
18807 if(prop->issetStmt)
18811 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18813 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18815 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18816 ProcessStatement(prop->issetStmt);
18818 thisClass = (((void *)0));
18820 else if(def->type == 4 && def->__anon1.propertyWatch)
18822 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18824 thisClass = regClass;
18825 if(propertyWatch->compound)
18827 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);
18829 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18830 curExternal = (((void *)0));
18831 ProcessStatement(propertyWatch->compound);
18833 thisClass = (((void *)0));
18838 void DeclareFunctionUtil(const char * s)
18840 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18847 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18848 strcpy(name, "__ecereFunction_");
18849 FullClassNameCat(name, s, 0);
18850 DeclareFunction(function, name);
18854 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18856 void ComputeDataTypes()
18858 struct External * external;
18859 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18860 struct External * after = (((void *)0));
18862 currentClass = (((void *)0));
18863 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18864 for(external = (*ast).first; external; external = external->next)
18866 if(external->type == 1)
18868 struct Declaration * decl = external->__anon1.declaration;
18872 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18876 struct InitDeclarator * initDecl = (*decls).first;
18880 struct Declarator * declarator = initDecl->declarator;
18882 if(declarator && declarator->type == 1)
18884 struct Identifier * id = declarator->__anon1.identifier;
18886 if(id && id->string)
18888 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18890 external->symbol->id = -1001, external->symbol->idCode = -1001;
18901 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18903 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18906 temp->symbol = __extension__ ({
18907 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18909 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18912 curExternal = temp;
18913 DeclareFunctionUtil("eSystem_New");
18914 DeclareFunctionUtil("eSystem_New0");
18915 DeclareFunctionUtil("eSystem_Renew");
18916 DeclareFunctionUtil("eSystem_Renew0");
18917 DeclareFunctionUtil("eSystem_Delete");
18918 DeclareFunctionUtil("eClass_GetProperty");
18919 DeclareFunctionUtil("eClass_SetProperty");
18920 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18921 DeclareFunctionUtil("eInstance_SetMethod");
18922 DeclareFunctionUtil("eInstance_IncRef");
18923 DeclareFunctionUtil("eInstance_StopWatching");
18924 DeclareFunctionUtil("eInstance_Watch");
18925 DeclareFunctionUtil("eInstance_FireWatchers");
18926 DeclareStruct("ecere::com::Class", 0);
18927 DeclareStruct("ecere::com::Instance", 0);
18928 DeclareStruct("ecere::com::Property", 0);
18929 DeclareStruct("ecere::com::DataMember", 0);
18930 DeclareStruct("ecere::com::Method", 0);
18931 DeclareStruct("ecere::com::SerialBuffer", 0);
18932 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18934 for(external = (*ast).first; external; external = external->next)
18936 afterExternal = curExternal = external;
18937 if(external->type == 0)
18939 currentClass = external->__anon1.function->_class;
18940 ProcessFunction(external->__anon1.function);
18942 else if(external->type == 1)
18944 currentClass = (((void *)0));
18945 if(external->__anon1.declaration)
18946 ProcessDeclaration(external->__anon1.declaration);
18948 else if(external->type == 2)
18950 struct ClassDefinition * _class = external->__anon1._class;
18952 currentClass = external->symbol->__anon1.registered;
18953 if(_class->definitions)
18955 ProcessClass(_class->definitions, _class->symbol);
18959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18960 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18963 else if(external->type == 4)
18965 thisNameSpace = external->__anon1.id->string;
18968 currentClass = (((void *)0));
18969 thisNameSpace = (((void *)0));
18970 curExternal = (((void *)0));
18971 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18972 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18975 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
18977 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char * name, const char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18979 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18981 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18983 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19038 __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);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19051 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19052 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19053 __ecereClass_Conversion = class;
19054 __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, bool warnConst)", MatchTypes, module, 1);
19055 __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);
19056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19057 __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);
19058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19082 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)