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, 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 __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3340 struct PropertyImport
3342 struct PropertyImport * prev;
3343 struct PropertyImport * next;
3345 unsigned int isVirtual;
3346 unsigned int hasSet;
3347 unsigned int hasGet;
3348 } __attribute__ ((gcc_struct));
3350 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3352 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3354 struct Symbol * symbol = prop->symbol;
3356 strcpy(setName, "__ecereProp_");
3357 FullClassNameCat(setName, prop->_class->fullName, 0);
3358 strcat(setName, "_Set_");
3359 FullClassNameCat(setName, prop->name, 1);
3360 strcpy(getName, "__ecereProp_");
3361 FullClassNameCat(getName, prop->_class->fullName, 0);
3362 strcat(getName, "_Get_");
3363 FullClassNameCat(getName, prop->name, 1);
3364 if(prop->_class->type == 1)
3365 DeclareStruct(prop->_class->fullName, 0);
3366 if(!symbol || curExternal->symbol->idCode < symbol->id)
3368 unsigned int imported = 0;
3369 unsigned int dllImport = 0;
3371 if(!symbol || symbol->_import)
3375 struct Symbol * classSym;
3377 if(!prop->_class->symbol)
3378 prop->_class->symbol = FindClass(prop->_class->fullName);
3379 classSym = prop->_class->symbol;
3380 if(classSym && !classSym->_import)
3382 struct ModuleImport * module;
3384 if(prop->_class->module)
3385 module = FindModule(prop->_class->module);
3387 module = mainModule;
3388 classSym->_import = __extension__ ({
3389 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3391 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3395 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3396 symbol->_import = (struct ClassImport *)__extension__ ({
3397 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3399 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3402 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3405 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)
3410 struct Context * context = SetupTemplatesContext(prop->_class);
3412 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3413 FinishTemplatesContext(context);
3417 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3419 struct Declaration * decl;
3420 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3421 struct Declarator * d;
3422 struct __ecereNameSpace__ecere__sys__OldList * params;
3423 struct Specifier * spec;
3424 struct External * external;
3425 struct Declarator * typeDecl;
3426 unsigned int simple = 0;
3428 specifiers = MkList();
3429 declarators = MkList();
3431 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3432 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3434 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3436 struct Context * context = SetupTemplatesContext(prop->_class);
3438 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3439 FinishTemplatesContext(context);
3441 for(spec = (*specifiers).first; spec; spec = spec->next)
3445 if((!typeDecl || typeDecl->type == 1))
3447 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3449 symbol->_class = classSym->__anon1.registered;
3450 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3452 DeclareStruct(spec->__anon1.__anon1.name, 0);
3459 d = PlugDeclarator(typeDecl, d);
3462 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3463 specifiers = MkList();
3465 d = MkDeclaratorFunction(d, params);
3467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3468 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3469 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3471 ListAdd(specifiers, MkSpecifier(VOID));
3472 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3473 decl = MkDeclaration(specifiers, declarators);
3474 external = MkExternalDeclaration(decl);
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3476 external->symbol = symbol;
3477 symbol->__anon2.__anon2.externalGet = external;
3478 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3480 FreeDeclarator(typeDecl);
3484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3489 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3491 struct Declaration * decl;
3492 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3493 struct Declarator * d;
3494 struct __ecereNameSpace__ecere__sys__OldList * params;
3495 struct Specifier * spec;
3496 struct External * external;
3497 struct Declarator * typeDecl;
3499 declarators = MkList();
3501 if(!prop->conversion || prop->_class->type == 1)
3503 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3505 specifiers = MkList();
3507 struct Context * context = SetupTemplatesContext(prop->_class);
3509 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3510 FinishTemplatesContext(context);
3512 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3514 ListAdd(params, MkTypeName(specifiers, d));
3515 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3517 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3518 d = MkDeclaratorFunction(d, params);
3519 for(spec = (*specifiers).first; spec; spec = spec->next)
3523 if((!typeDecl || typeDecl->type == 1))
3525 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3527 symbol->_class = classSym->__anon1.registered;
3528 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3529 DeclareStruct(spec->__anon1.__anon1.name, 0);
3533 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3534 specifiers = MkList();
3536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3537 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3539 if(!prop->conversion || prop->_class->type == 1)
3540 ListAdd(specifiers, MkSpecifier(VOID));
3542 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3543 decl = MkDeclaration(specifiers, declarators);
3544 external = MkExternalDeclaration(decl);
3545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3546 external->symbol = symbol;
3547 symbol->__anon2.__anon2.externalSet = external;
3548 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3555 if(!symbol->__anon2.__anon2.externalPtr)
3557 struct Declaration * decl;
3558 struct External * external;
3559 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3560 char propName[1024];
3563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3566 ListAdd(specifiers, MkSpecifierName("Property"));
3567 strcpy(propName, "__ecereProp_");
3568 FullClassNameCat(propName, prop->_class->fullName, 0);
3569 strcat(propName, "_");
3570 FullClassNameCat(propName, prop->name, 1);
3572 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3574 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3577 strcpy(propName, "__ecerePropM_");
3578 FullClassNameCat(propName, prop->_class->fullName, 0);
3579 strcat(propName, "_");
3580 FullClassNameCat(propName, prop->name, 1);
3581 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3583 decl = MkDeclaration(specifiers, list);
3585 external = MkExternalDeclaration(decl);
3586 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3587 external->symbol = symbol;
3588 symbol->__anon2.__anon2.externalPtr = external;
3592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3594 symbol->id = curExternal->symbol->idCode;
3598 struct Type * Dereference(struct Type * source)
3600 struct Type * type = (((void *)0));
3604 if(source->kind == 13 || source->kind == 12)
3606 type = source->__anon1.type;
3607 source->__anon1.type->refCount++;
3609 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3611 type = __extension__ ({
3612 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3614 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3617 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3628 static struct Type * Reference(struct Type * source)
3630 struct Type * type = (((void *)0));
3634 type = __extension__ ({
3635 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3637 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3644 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);
3646 extern void * memcpy(void * , const void * , size_t size);
3648 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3650 extern void FreeExpression(struct Expression * exp);
3652 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3654 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);
3656 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3658 extern struct Type * MkClassType(const char * name);
3660 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);
3662 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)
3664 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3665 unsigned int found = 0;
3666 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3667 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3668 unsigned int freeType = 0;
3670 yylloc = member->loc;
3675 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3679 dataMember = *curMember;
3685 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3686 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3687 int _subMemberStackPos = 0;
3690 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3693 dataMember = thisMember;
3694 if(curMember && thisMember->memberAccess == 1)
3696 *curMember = thisMember;
3697 *curClass = thisMember->_class;
3698 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3699 *subMemberStackPos = _subMemberStackPos;
3705 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3706 if(method && method->type == 1)
3709 method = (((void *)0));
3714 struct Type * type = (((void *)0));
3718 if(!dataMember->dataType && dataMember->dataTypeString)
3720 struct Context * context = SetupTemplatesContext(_class);
3722 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3723 FinishTemplatesContext(context);
3725 type = dataMember->dataType;
3729 if(!method->dataType)
3730 ProcessMethodType(method);
3731 type = method->dataType;
3733 if(ident && ident->next)
3735 for(ident = ident->next; ident && type; ident = ident->next)
3739 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3741 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3743 type = dataMember->dataType;
3745 else if(type->kind == 9 || type->kind == 10)
3747 struct Type * memberType;
3749 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3751 if(!strcmp(memberType->name, ident->string))
3760 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3763 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3764 struct __ecereNameSpace__ecere__com__Class * sClass;
3766 for(sClass = _class; sClass; sClass = sClass->base)
3769 if(sClass->templateClass)
3770 sClass = sClass->templateClass;
3771 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3773 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3775 for(sClass = sClass->base; sClass; sClass = sClass->base)
3777 if(sClass->templateClass)
3778 sClass = sClass->templateClass;
3779 id += sClass->templateParams.count;
3790 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3792 if(arg.__anon1.__anon1.dataTypeString)
3794 unsigned int constant = type->constant;
3796 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3797 if(type->kind == 8 && constant)
3799 else if(type->kind == 13)
3801 struct Type * t = type->__anon1.type;
3803 while(t->kind == 13)
3804 t = t->__anon1.type;
3806 t->constant = constant;
3809 if(type && _class->templateClass)
3810 type->passAsTemplate = 1;
3817 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3819 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3820 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3823 char templateString[1024];
3824 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3826 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3827 for(cClass = expClass; cClass; cClass = cClass->base)
3831 if(cClass->templateClass)
3832 cClass = cClass->templateClass;
3833 for(param = cClass->templateParams.first; param; param = param->next)
3836 struct __ecereNameSpace__ecere__com__Class * sClass;
3837 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3839 for(sClass = cClass->base; sClass; sClass = sClass->base)
3841 if(sClass->templateClass)
3842 sClass = sClass->templateClass;
3843 id += sClass->templateParams.count;
3845 arg = expClass->templateArgs[id];
3846 for(sClass = _class; sClass; sClass = sClass->base)
3848 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3850 struct __ecereNameSpace__ecere__com__Class * nextClass;
3852 if(sClass->templateClass)
3853 sClass = sClass->templateClass;
3854 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3856 if(nextClass->templateClass)
3857 nextClass = nextClass->templateClass;
3858 p += nextClass->templateParams.count;
3860 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3862 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3864 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3866 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3867 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3881 char expString[1024];
3882 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3883 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3884 struct Expression * exp;
3885 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3887 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3888 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3889 ProcessExpressionType(exp);
3890 ComputeExpression(exp);
3891 expString[0] = '\0';
3892 PrintExpression(exp, expString);
3893 strcat(argument, expString);
3894 FreeExpression(exp);
3899 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3904 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3905 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3912 strcat(templateString, ", ");
3913 if(lastParam != p - 1)
3915 strcat(templateString, param->name);
3916 strcat(templateString, " = ");
3918 strcat(templateString, argument);
3927 int len = strlen(templateString);
3929 if(templateString[len - 1] == '<')
3933 if(templateString[len - 1] == '>')
3934 templateString[len++] = ' ';
3935 templateString[len++] = '>';
3937 templateString[len++] = '\0';
3940 struct Context * context = SetupTemplatesContext(_class);
3944 type = ProcessTypeString(templateString, 0);
3946 FinishTemplatesContext(context);
3949 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3951 ProcessExpressionType(member->initializer->__anon1.exp);
3952 if(!member->initializer->__anon1.exp->expType)
3956 char expString[10240];
3958 expString[0] = '\0';
3959 PrintExpression(member->initializer->__anon1.exp, expString);
3960 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3961 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3964 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3966 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3969 else if(member->initializer)
3971 ProcessInitializer(member->initializer, type);
3978 if(_class && _class->type == 3)
3980 if(member->initializer)
3982 struct Type * type = MkClassType(_class->fullName);
3984 ProcessInitializer(member->initializer, type);
3990 if(member->initializer)
3992 ProcessInitializer(member->initializer, (((void *)0)));
3998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4002 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4004 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4008 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4013 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);
4015 extern void FreeSpecifier(struct Specifier * spec);
4017 static void ProcessFunction(struct FunctionDefinition * function);
4019 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
4021 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4023 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4025 extern void FreeClassFunction(struct ClassFunction * func);
4027 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4029 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4031 void ProcessInstantiationType(struct Instantiation * inst)
4036 struct MembersInit * members;
4037 struct Symbol * classSym;
4038 struct __ecereNameSpace__ecere__com__Class * _class;
4040 classSym = inst->_class->__anon1.__anon1.symbol;
4041 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4042 if(!_class || _class->type != 5)
4043 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4044 afterExternal = afterExternal ? afterExternal : curExternal;
4046 ProcessExpressionType(inst->exp);
4047 inst->isConstant = 1;
4050 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4051 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4052 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4053 int subMemberStackPos = 0;
4055 for(members = (*inst->members).first; members; members = members->next)
4057 switch(members->type)
4062 static unsigned int instMethodID = 0;
4063 struct External * external = curExternal;
4064 struct Context * context = curContext;
4065 struct Declarator * declarator = members->__anon1.function->declarator;
4066 struct Identifier * nameID = GetDeclId(declarator);
4067 char * unmangled = nameID ? nameID->string : (((void *)0));
4068 struct Expression * exp;
4069 struct External * createdExternal = (((void *)0));
4075 strcpy(name, "__ecereInstMeth_");
4076 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4078 strcat(name, nameID->string);
4080 sprintf(number, "_%08d", instMethodID++);
4081 strcat(name, number);
4082 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4086 struct Symbol * symbol = declarator->symbol;
4087 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4089 if(method && method->type == 1)
4091 symbol->__anon1.method = method;
4092 ProcessMethodType(method);
4093 if(!symbol->type->__anon1.__anon2.thisClass)
4095 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4097 if(!currentClass->symbol)
4098 currentClass->symbol = FindClass(currentClass->fullName);
4099 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4104 _class->symbol = FindClass(_class->fullName);
4105 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4108 DeclareType(symbol->type, 1, 1);
4112 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4115 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4118 FreeSpecifier(nameID->_class);
4119 nameID->_class = (((void *)0));
4123 struct External * oldExternal = curExternal;
4125 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4127 struct External * externalDecl;
4129 externalDecl = MkExternalDeclaration((((void *)0)));
4130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4131 if(createdExternal->__anon1.function)
4133 ProcessFunction(createdExternal->__anon1.function);
4135 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4137 externalDecl->__anon1.declaration = decl;
4138 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4139 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4140 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4147 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4148 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4150 curExternal = external;
4151 curContext = context;
4154 FreeClassFunction(members->__anon1.function);
4155 exp = QMkExpId(name);
4157 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4158 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4164 if(members->__anon1.dataMembers && classSym)
4166 struct MemberInit * member;
4167 struct Location oldyyloc = yylloc;
4169 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4171 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4172 if(member->initializer && !member->initializer->isConstant)
4173 inst->isConstant = 0;
4185 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4189 if(type->kind == 11)
4191 struct Type * param;
4195 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4196 DeclareType(param, declarePointers, 1);
4198 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4200 else if(type->kind == 13 && declarePointers)
4201 DeclareType(type->__anon1.type, declarePointers, 0);
4202 else if(type->kind == 8)
4204 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4205 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4207 else if(type->kind == 9 || type->kind == 10)
4209 struct Type * member;
4211 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4212 DeclareType(member, 0, 0);
4214 else if(type->kind == 12)
4215 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4219 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
4221 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4223 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4225 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4226 struct __ecereNameSpace__ecere__com__Class * sClass;
4228 for(sClass = _class; sClass; sClass = sClass->base)
4231 if(sClass->templateClass)
4232 sClass = sClass->templateClass;
4233 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4235 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4237 for(sClass = sClass->base; sClass; sClass = sClass->base)
4239 if(sClass->templateClass)
4240 sClass = sClass->templateClass;
4241 id += sClass->templateParams.count;
4252 arg = &_class->templateArgs[id];
4253 if(arg && param->type == 0)
4254 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4259 extern struct Context * PushContext(void);
4261 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4263 struct TemplatedType
4266 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4267 struct __ecereNameSpace__ecere__sys__BTNode * left;
4268 struct __ecereNameSpace__ecere__sys__BTNode * right;
4270 struct TemplateParameter * param;
4271 } __attribute__ ((gcc_struct));
4273 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4275 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4277 struct Context * context = PushContext();
4279 context->templateTypesOnly = 1;
4280 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4282 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4284 for(; param; param = param->next)
4286 if(param->type == 0 && param->identifier)
4288 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4290 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4296 struct __ecereNameSpace__ecere__com__Class * sClass;
4298 for(sClass = _class; sClass; sClass = sClass->base)
4300 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4302 for(p = sClass->templateParams.first; p; p = p->next)
4306 struct TemplateParameter * param = p->param;
4307 struct TemplatedType * type;
4311 p->param = param = __extension__ ({
4312 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4314 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4317 type = __extension__ ({
4318 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4320 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4322 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4330 extern void PopContext(struct Context * ctx);
4332 extern void FreeContext(struct Context * context);
4334 void FinishTemplatesContext(struct Context * context)
4336 PopContext(context);
4337 FreeContext(context);
4338 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4341 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4343 if(!method->dataType)
4345 struct Context * context = SetupTemplatesContext(method->_class);
4347 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4348 FinishTemplatesContext(context);
4349 if(method->type != 1 && method->dataType)
4351 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4353 if(!method->_class->symbol)
4354 method->_class->symbol = FindClass(method->_class->fullName);
4355 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4361 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4365 struct Context * context = SetupTemplatesContext(prop->_class);
4367 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4368 FinishTemplatesContext(context);
4372 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4374 extern void FreeTypeName(struct TypeName * typeName);
4376 static void ProcessDeclarator(struct Declarator * decl);
4378 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4384 struct MethodImport * prev;
4385 struct MethodImport * next;
4387 unsigned int isVirtual;
4388 } __attribute__ ((gcc_struct));
4390 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4392 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4394 struct Symbol * symbol = method->symbol;
4396 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4398 unsigned int dllImport = 0;
4400 if(!method->dataType)
4401 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4402 if(!symbol || symbol->_import || method->type == 1)
4404 if(!symbol || method->type == 1)
4406 struct Symbol * classSym;
4408 if(!method->_class->symbol)
4409 method->_class->symbol = FindClass(method->_class->fullName);
4410 classSym = method->_class->symbol;
4411 if(!classSym->_import)
4413 struct ModuleImport * module;
4415 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4416 module = FindModule(method->_class->module);
4418 module = mainModule;
4419 classSym->_import = __extension__ ({
4420 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4422 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4428 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4430 if(!symbol->_import)
4432 symbol->_import = (struct ClassImport *)__extension__ ({
4433 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4435 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4441 symbol->type = method->dataType;
4443 symbol->type->refCount++;
4446 if(!method->dataType->dllExport)
4448 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)
4452 if(method->type != 1 && method->dataType)
4453 DeclareType(method->dataType, 1, 1);
4454 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4456 struct Declaration * decl;
4457 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4458 struct Declarator * d;
4459 struct Declarator * funcDecl;
4460 struct External * external;
4462 specifiers = MkList();
4463 declarators = MkList();
4465 ListAdd(specifiers, MkSpecifier(EXTERN));
4466 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4467 ListAdd(specifiers, MkSpecifier(STATIC));
4468 if(method->type == 1)
4470 ListAdd(specifiers, MkSpecifier(INT));
4471 d = MkDeclaratorIdentifier(MkIdentifier(name));
4475 d = MkDeclaratorIdentifier(MkIdentifier(name));
4477 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4479 struct Context * context = SetupTemplatesContext(method->_class);
4481 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4482 FinishTemplatesContext(context);
4484 funcDecl = GetFuncDecl(d);
4487 struct Specifier * spec, * next;
4489 for(spec = (*specifiers).first; spec; spec = next)
4494 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4495 FreeSpecifier(spec);
4499 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4501 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4503 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4504 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")));
4505 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4506 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4508 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4510 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4513 FreeTypeName(param);
4515 if(!funcDecl->__anon1.function.parameters)
4516 funcDecl->__anon1.function.parameters = MkList();
4517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4521 ProcessDeclarator(d);
4522 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4523 decl = MkDeclaration(specifiers, declarators);
4524 ReplaceThisClassSpecifiers(specifiers, method->_class);
4525 if(symbol->__anon2.__anon1.pointerExternal)
4527 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4530 *functionSymbol = *symbol;
4531 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4532 if(functionSymbol->type)
4533 functionSymbol->type->refCount++;
4535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4536 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4538 external = MkExternalDeclaration(decl);
4540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4541 external->symbol = symbol;
4542 symbol->__anon2.__anon1.pointerExternal = external;
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4548 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4552 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4554 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4556 unsigned int first = 1;
4558 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4560 char className[1024];
4562 strcpy(className, _class->fullName);
4563 for(param = _class->templateParams.first; param; param = param->next)
4567 strcat(className, "<");
4569 strcat(className, ", ");
4570 if(lastParam + 1 != p)
4572 strcat(className, param->name);
4573 strcat(className, " = ");
4575 strcat(className, param->name);
4583 int len = strlen(className);
4585 if(className[len - 1] == '>')
4586 className[len++] = ' ';
4587 className[len++] = '>';
4588 className[len++] = '\0';
4590 return __ecereNameSpace__ecere__sys__CopyString(className);
4593 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4596 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4600 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4602 unsigned int first = 1;
4604 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4606 char className[1024];
4608 strcpy(className, _class->fullName);
4609 for(param = _class->templateParams.first; param; param = param->next)
4613 strcat(className, "<");
4615 strcat(className, ", ");
4616 if(lastParam + 1 != p)
4618 strcat(className, param->name);
4619 strcat(className, " = ");
4621 strcat(className, param->name);
4629 int len = strlen(className);
4631 if(className[len - 1] == '>')
4632 className[len++] = ' ';
4633 className[len++] = '>';
4634 className[len++] = '\0';
4636 type = MkClassType(className);
4640 type = MkClassType(_class->fullName);
4645 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4647 if(specs != (((void *)0)) && _class)
4649 struct Specifier * spec;
4651 for(spec = specs->first; spec; spec = spec->next)
4653 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4656 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4657 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4663 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4665 struct __ecereNameSpace__ecere__com__GlobalFunction
4667 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4668 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4671 struct __ecereNameSpace__ecere__com__Instance * module;
4672 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4673 const char * dataTypeString;
4674 struct Type * dataType;
4676 } __attribute__ ((gcc_struct));
4678 extern struct Context * globalContext;
4680 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4682 struct FunctionImport
4684 struct FunctionImport * prev;
4685 struct FunctionImport * next;
4687 } __attribute__ ((gcc_struct));
4689 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4691 struct Symbol * symbol = function->symbol;
4693 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4695 unsigned int imported = 0;
4696 unsigned int dllImport = 0;
4698 if(!function->dataType)
4700 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4701 if(!function->dataType->__anon1.__anon2.thisClass)
4702 function->dataType->__anon1.__anon2.staticMethod = 1;
4708 struct ModuleImport * module = FindModule(function->module);
4710 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4713 if(!function->dataType->dllExport)
4715 symbol->_import = (struct ClassImport *)__extension__ ({
4716 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4718 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4720 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4724 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4725 if(!symbol->type->__anon1.__anon2.thisClass)
4726 symbol->type->__anon1.__anon2.staticMethod = 1;
4729 imported = symbol->_import ? 1 : 0;
4730 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4733 DeclareType(function->dataType, 1, 1);
4736 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4738 struct Declaration * decl;
4739 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4740 struct Declarator * d;
4741 struct Declarator * funcDecl;
4742 struct External * external;
4744 specifiers = MkList();
4745 declarators = MkList();
4746 ListAdd(specifiers, MkSpecifier(EXTERN));
4747 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4749 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4750 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4751 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4753 struct Specifier * spec;
4755 for(spec = (*specifiers).first; spec; spec = spec->next)
4756 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4759 FreeSpecifier(spec);
4763 funcDecl = GetFuncDecl(d);
4764 if(funcDecl && !funcDecl->__anon1.function.parameters)
4766 funcDecl->__anon1.function.parameters = MkList();
4767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4769 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4771 struct Context * oldCtx = curContext;
4773 curContext = globalContext;
4774 decl = MkDeclaration(specifiers, declarators);
4775 curContext = oldCtx;
4777 if(symbol->__anon2.__anon1.pointerExternal)
4779 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4782 *functionSymbol = *symbol;
4783 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4784 if(functionSymbol->type)
4785 functionSymbol->type->refCount++;
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4788 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4790 external = MkExternalDeclaration(decl);
4792 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4793 external->symbol = symbol;
4794 symbol->__anon2.__anon1.pointerExternal = external;
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4801 symbol->id = curExternal->symbol->idCode;
4804 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4807 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4812 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4813 struct __ecereNameSpace__ecere__sys__BTNode * left;
4814 struct __ecereNameSpace__ecere__sys__BTNode * right;
4816 struct __ecereNameSpace__ecere__com__Instance * module;
4817 char * dataTypeString;
4818 struct Type * dataType;
4821 } __attribute__ ((gcc_struct));
4823 void DeclareGlobalData(struct GlobalData * data)
4825 struct Symbol * symbol = data->symbol;
4827 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4832 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4835 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4836 DeclareType(data->dataType, 1, 1);
4839 if(!symbol->__anon2.__anon1.pointerExternal)
4841 struct Declaration * decl;
4842 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4843 struct Declarator * d;
4844 struct External * external;
4846 specifiers = MkList();
4847 declarators = MkList();
4848 ListAdd(specifiers, MkSpecifier(EXTERN));
4849 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4850 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4851 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4852 decl = MkDeclaration(specifiers, declarators);
4853 external = MkExternalDeclaration(decl);
4855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4856 external->symbol = symbol;
4857 symbol->__anon2.__anon1.pointerExternal = external;
4861 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4864 symbol->id = curExternal->symbol->idCode;
4871 struct Conversion * prev, * next;
4872 struct __ecereNameSpace__ecere__com__Property * convert;
4874 struct Type * resultType;
4875 } __attribute__ ((gcc_struct));
4877 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4879 extern void Compiler_Warning(const char * format, ...);
4881 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4883 unsigned int status = 1;
4885 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))
4887 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4888 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4890 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4892 struct Type * sourceType = source, * destType = dest;
4894 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4895 sourceType = sourceType->__anon1.type;
4896 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4897 destType = destType->__anon1.type;
4898 if(!destType->constant && sourceType->constant)
4902 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4909 extern void CopyTypeInto(struct Type * type, struct Type * src);
4911 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4913 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)
4918 CheckConstCompatibility(source, dest, 1);
4919 if(source->kind == 20 && dest->kind != 20)
4921 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4926 if(dest->kind == 20 && source->kind != 20)
4928 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4933 if(dest->classObjectType == 2 && dest->kind != 11)
4935 if(source->classObjectType != 3)
4939 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4947 if(source->kind != 11 && source->classObjectType == 3)
4949 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4952 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4954 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))
4957 if(dest->kind == 14 && source->kind != 0)
4959 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))
4961 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))
4963 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4965 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4967 if(conversions != (((void *)0)))
4969 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4974 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4976 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4978 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4980 if(sourceBase == destBase)
4984 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))
4988 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))
4990 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4997 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
5001 if(source->kind == 8)
5003 struct __ecereNameSpace__ecere__com__Class * _class;
5005 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5007 struct __ecereNameSpace__ecere__com__Property * convert;
5009 for(convert = _class->conversions.first; convert; convert = convert->next)
5011 if(convert->memberAccess == 1 || _class->module == privateModule)
5013 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5015 if(!convert->dataType)
5016 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5017 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))
5019 if(!conversions && !convert->Get)
5021 else if(conversions != (((void *)0)))
5023 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))
5027 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5040 struct __ecereNameSpace__ecere__com__Class * _class;
5042 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5044 struct __ecereNameSpace__ecere__com__Property * convert;
5046 for(convert = _class->conversions.first; convert; convert = convert->next)
5048 if(convert->memberAccess == 1 || _class->module == privateModule)
5050 struct Type * constType = (((void *)0));
5051 unsigned int success = 0;
5053 if(!convert->dataType)
5054 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5055 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5057 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5059 constType = __extension__ ({
5060 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5062 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5064 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5065 ptrType->constant = 1;
5067 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5069 if(!conversions && !convert->Set)
5071 else if(conversions != (((void *)0)))
5073 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))
5077 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5085 FreeType(constType);
5091 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5093 if(!dest->__anon1._class->__anon1.registered->dataType)
5094 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5095 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5097 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))
5104 if(source->kind == 8)
5106 struct __ecereNameSpace__ecere__com__Class * _class;
5108 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5110 struct __ecereNameSpace__ecere__com__Property * convert;
5112 for(convert = _class->conversions.first; convert; convert = convert->next)
5114 if(convert->memberAccess == 1 || _class->module == privateModule)
5116 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5118 if(!convert->dataType)
5119 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5120 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))
5122 if(!conversions && !convert->Get)
5124 else if(conversions != (((void *)0)))
5126 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))
5130 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5140 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5142 if(!source->__anon1._class->__anon1.registered->dataType)
5143 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5144 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5146 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))
5148 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5154 if(source->kind == 8 || source->kind == 19)
5156 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5158 else if(dest->kind == 7 && source->kind == 6)
5160 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5162 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5164 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5166 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5168 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5170 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))
5172 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))
5174 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)))
5176 struct Type * paramSource, * paramDest;
5178 if(dest->kind == 16)
5179 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5180 if(source->kind == 16)
5181 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5182 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5183 dest = dest->__anon1.type;
5184 if(source->kind == 13 && source->__anon1.type->kind == 11)
5185 source = source->__anon1.type;
5186 if(dest->kind == 16)
5187 dest = dest->__anon1.__anon3.method->dataType;
5188 if(source->kind == 16)
5189 source = source->__anon1.__anon3.method->dataType;
5190 paramSource = source->__anon1.__anon2.params.first;
5191 if(paramSource && paramSource->kind == 0)
5192 paramSource = (((void *)0));
5193 paramDest = dest->__anon1.__anon2.params.first;
5194 if(paramDest && paramDest->kind == 0)
5195 paramDest = (((void *)0));
5196 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5198 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))))
5200 if(paramDest && paramDest->kind == 8)
5201 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5203 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5206 paramDest = paramDest->next;
5208 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5210 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5212 if(dest->__anon1.__anon2.thisClass)
5214 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5216 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5222 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5231 paramSource = paramSource->next;
5235 if(dest->__anon1.__anon2.thisClass)
5237 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5239 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5245 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5253 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5255 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5259 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5260 for(; paramDest; paramDest = paramDest->next)
5264 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5268 struct Type * paramDestType = paramDest;
5269 struct Type * paramSourceType = paramSource;
5270 struct Type * type = paramDestType;
5272 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5275 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5276 struct __ecereNameSpace__ecere__com__Class * sClass;
5278 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5281 if(sClass->templateClass)
5282 sClass = sClass->templateClass;
5283 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5285 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5287 for(sClass = sClass->base; sClass; sClass = sClass->base)
5289 if(sClass->templateClass)
5290 sClass = sClass->templateClass;
5291 id += sClass->templateParams.count;
5302 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5304 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5307 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)))
5312 PrintType(paramDest, type, 0, 1);
5313 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5314 if(paramDestType != paramDest)
5315 FreeType(paramDestType);
5318 if(paramDestType != paramDest)
5319 FreeType(paramDestType);
5321 paramSource = paramSource->next;
5325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5330 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5334 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5336 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5343 static void FreeConvert(struct Conversion * convert)
5345 if(convert->resultType)
5346 FreeType(convert->resultType);
5349 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5351 struct __ecereNameSpace__ecere__com__BTNamedLink
5354 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5355 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5356 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5359 } __attribute__ ((gcc_struct));
5361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5363 struct __ecereNameSpace__ecere__com__EnumClassData
5365 struct __ecereNameSpace__ecere__sys__OldList values;
5367 } __attribute__ ((gcc_struct));
5369 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5371 struct __ecereNameSpace__ecere__sys__NamedLink64
5373 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5374 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5377 } __attribute__ ((gcc_struct));
5379 extern void FreeExpContents(struct Expression * exp);
5381 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5383 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5385 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5387 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5389 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5391 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5393 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5395 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)))
5397 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5399 if(_class->type == 4)
5401 struct __ecereNameSpace__ecere__sys__OldList converts =
5405 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5409 _class->symbol = FindClass(_class->fullName);
5410 type->__anon1._class = _class->symbol;
5411 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5413 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5414 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5418 struct __ecereNameSpace__ecere__com__Class * baseClass;
5420 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5422 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5424 for(value = e->values.first; value; value = value->next)
5426 if(!strcmp(value->name, string))
5431 FreeExpContents(sourceExp);
5432 FreeType(sourceExp->expType);
5433 sourceExp->isConstant = 1;
5434 sourceExp->expType = MkClassType(baseClass->fullName);
5438 sourceExp->type = 2;
5439 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5440 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5442 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5443 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5445 while(converts.first)
5447 struct Conversion * convert = converts.first;
5449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5450 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5452 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5460 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5463 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)))
5464 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5469 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5471 struct __ecereNameSpace__ecere__com__SubModule
5473 struct __ecereNameSpace__ecere__com__SubModule * prev;
5474 struct __ecereNameSpace__ecere__com__SubModule * next;
5475 struct __ecereNameSpace__ecere__com__Instance * module;
5477 } __attribute__ ((gcc_struct));
5479 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5481 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5483 if(searchFor == searchIn)
5485 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5487 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5489 if(ModuleVisibility(subModule->module, searchFor))
5496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5498 struct __ecereNameSpace__ecere__com__Application
5501 const char * * argv;
5503 unsigned int isGUIApp;
5504 struct __ecereNameSpace__ecere__sys__OldList allModules;
5505 char * parsedCommand;
5506 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5507 } __attribute__ ((gcc_struct));
5509 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5511 struct __ecereNameSpace__ecere__com__Instance * module;
5513 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))
5515 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))
5517 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))
5519 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)
5521 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5527 extern struct Expression * CopyExpression(struct Expression * exp);
5529 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5531 void ReadString(char * output, char * string);
5533 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5535 extern struct TypeName * QMkClass(const char * spec, struct Declarator * decl);
5537 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5539 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5541 struct Type * source;
5542 struct Type * realDest = dest;
5543 struct Type * backupSourceExpType = (((void *)0));
5544 struct Expression * computedExp = sourceExp;
5547 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)
5549 computedExp = CopyExpression(sourceExp);
5550 ComputeExpression(computedExp);
5552 source = sourceExp->expType;
5553 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5555 if(computedExp != sourceExp)
5557 FreeExpression(computedExp);
5558 computedExp = sourceExp;
5563 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5565 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5567 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5569 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5571 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5573 if(sourceBase == destBase)
5575 if(computedExp != sourceExp)
5577 FreeExpression(computedExp);
5578 computedExp = sourceExp;
5587 struct __ecereNameSpace__ecere__sys__OldList * specs;
5588 unsigned int flag = 0;
5589 long long value = (((int)0x7fffffff));
5592 if(computedExp->type == 2)
5594 if(source->isSigned)
5595 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5597 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5599 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5601 if(source->isSigned)
5602 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5604 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5606 if(computedExp != sourceExp)
5608 FreeExpression(computedExp);
5609 computedExp = sourceExp;
5611 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"))
5614 source = __extension__ ({
5615 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5617 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5622 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5624 if(_class && _class->type == 3)
5626 if(source->kind != 8)
5628 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5629 struct Type * tempDest, * tempSource;
5631 for(; _class->base->type != 1000; _class = _class->base)
5634 tempDest = tempType;
5637 _class->symbol = FindClass(_class->fullName);
5638 tempType->__anon1._class = _class->symbol;
5639 tempType->truth = dest->truth;
5640 if(tempType->__anon1._class)
5641 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5642 backupSourceExpType = sourceExp->expType;
5643 sourceExp->expType = dest;
5646 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5649 if(_class && _class->type == 2 && source->kind != 8)
5651 if(!dest->__anon1._class->__anon1.registered->dataType)
5652 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5653 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5656 FreeType(sourceExp->expType);
5657 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5661 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5663 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5664 struct Declarator * decl;
5667 ReadString(string, sourceExp->__anon1.__anon2.string);
5668 decl = SpecDeclFromString(string, specs, (((void *)0)));
5669 FreeExpContents(sourceExp);
5670 FreeType(sourceExp->expType);
5671 sourceExp->type = 24;
5672 sourceExp->__anon1._classExp.specifiers = specs;
5673 sourceExp->__anon1._classExp.decl = decl;
5674 sourceExp->expType = dest;
5678 if(backupSourceExpType)
5679 FreeType(backupSourceExpType);
5683 else if(source->kind == 8)
5685 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5687 if(_class && (_class->type == 3 || _class->type == 2))
5691 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5692 struct Type * tempDest, * tempSource;
5694 if(!source->__anon1._class->__anon1.registered->dataType)
5695 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5696 for(; _class->base->type != 1000; _class = _class->base)
5699 tempSource = tempType;
5701 tempType->__anon1._class = FindClass(_class->fullName);
5702 tempType->truth = source->truth;
5703 tempType->classObjectType = source->classObjectType;
5704 if(tempType->__anon1._class)
5705 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5706 if(conversions->last)
5708 ((struct Conversion *)conversions->last)->resultType = dest;
5711 FreeType(sourceExp->expType);
5712 sourceExp->expType = MkClassType(_class->fullName);
5713 sourceExp->expType->truth = source->truth;
5714 sourceExp->expType->classObjectType = source->classObjectType;
5715 if(!sourceExp->destType)
5717 FreeType(sourceExp->destType);
5718 sourceExp->destType = sourceExp->expType;
5719 if(sourceExp->expType)
5720 sourceExp->expType->refCount++;
5722 if(!_class->dataType)
5723 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5725 dest = MkClassType(source->__anon1._class->string);
5726 dest->truth = source->truth;
5727 dest->classObjectType = source->classObjectType;
5729 source = _class->dataType;
5731 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5737 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5746 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5747 unsigned int fittingValue = 0;
5749 if(_class && _class->type == 4)
5751 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5752 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5754 if(c && value >= 0 && value <= c->largest)
5757 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5759 if(_class->type == 0 || _class->type == 5)
5761 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5763 *newExp = *sourceExp;
5764 if(sourceExp->destType)
5765 sourceExp->destType->refCount++;
5766 if(sourceExp->expType)
5767 sourceExp->expType->refCount++;
5768 sourceExp->type = 11;
5769 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5770 sourceExp->__anon1.cast.exp = newExp;
5771 FreeType(sourceExp->expType);
5772 sourceExp->expType = (((void *)0));
5773 ProcessExpressionType(sourceExp);
5776 FreeType(sourceExp->expType);
5777 sourceExp->expType = dest;
5782 if(backupSourceExpType)
5783 FreeType(backupSourceExpType);
5786 if(!_class->dataType)
5787 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5789 dest = _class->dataType;
5792 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))
5794 specs = MkListOne(MkSpecifier(DOUBLE));
5796 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))
5798 specs = MkListOne(MkSpecifier(FLOAT));
5800 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))
5804 ListAdd(specs, MkSpecifier(UNSIGNED));
5805 ListAdd(specs, MkSpecifier(INT64));
5807 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5811 ListAdd(specs, MkSpecifier(UNSIGNED));
5812 ListAdd(specs, MkSpecifier(INT));
5814 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5818 ListAdd(specs, MkSpecifier(UNSIGNED));
5819 ListAdd(specs, MkSpecifier(SHORT));
5821 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5825 ListAdd(specs, MkSpecifier(UNSIGNED));
5826 ListAdd(specs, MkSpecifier(CHAR));
5832 if(backupSourceExpType)
5834 if(sourceExp->expType)
5835 FreeType(sourceExp->expType);
5836 sourceExp->expType = backupSourceExpType;
5841 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))
5843 specs = MkListOne(MkSpecifier(DOUBLE));
5845 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))
5847 specs = MkListOne(MkSpecifier(FLOAT));
5849 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5852 ListAdd(specs, MkSpecifier(BOOL));
5854 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)))
5858 ListAdd(specs, MkSpecifier(UNSIGNED));
5859 ListAdd(specs, MkSpecifier(CHAR));
5861 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)))))
5865 ListAdd(specs, MkSpecifier(UNSIGNED));
5866 ListAdd(specs, MkSpecifier(SHORT));
5868 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5872 ListAdd(specs, MkSpecifier(UNSIGNED));
5873 ListAdd(specs, MkSpecifier(INT));
5875 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5879 ListAdd(specs, MkSpecifier(UNSIGNED));
5880 ListAdd(specs, MkSpecifier(INT64));
5882 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5884 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5890 if(backupSourceExpType)
5892 if(sourceExp->expType)
5893 FreeType(sourceExp->expType);
5894 sourceExp->expType = backupSourceExpType;
5898 if(!flag && !sourceExp->opDestType)
5900 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5902 *newExp = *sourceExp;
5903 newExp->prev = (((void *)0));
5904 newExp->next = (((void *)0));
5905 if(sourceExp->destType)
5906 sourceExp->destType->refCount++;
5907 if(sourceExp->expType)
5908 sourceExp->expType->refCount++;
5909 sourceExp->type = 11;
5910 if(realDest->kind == 8)
5912 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5913 FreeList(specs, FreeSpecifier);
5916 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5917 if(newExp->type == 4)
5919 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5922 sourceExp->__anon1.cast.exp = newExp;
5923 FreeType(sourceExp->expType);
5924 sourceExp->expType = (((void *)0));
5925 ProcessExpressionType(sourceExp);
5928 FreeList(specs, FreeSpecifier);
5931 if(backupSourceExpType)
5932 FreeType(backupSourceExpType);
5937 if(computedExp != sourceExp)
5939 FreeExpression(computedExp);
5940 computedExp = sourceExp;
5942 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5943 sourceExp = (*sourceExp->__anon1.list).last;
5944 if(sourceExp->type == 0)
5946 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5950 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5952 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5953 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5957 for(; _class && _class->type == 4; _class = _class->base)
5959 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5960 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5962 for(value = e->values.first; value; value = value->next)
5964 if(!strcmp(value->name, id->string))
5969 FreeExpContents(sourceExp);
5970 FreeType(sourceExp->expType);
5971 sourceExp->isConstant = 1;
5972 sourceExp->expType = MkClassType(_class->fullName);
5974 sourceExp->type = 2;
5975 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5976 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5978 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5987 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5998 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 int value2 = op2->__anon1.i;
6003 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6006 exp->expType = op1->type;
6008 op1->type->refCount++;
6013 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 unsigned int value2 = op2->__anon1.ui;
6018 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6021 exp->expType = op1->type;
6023 op1->type->refCount++;
6028 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 long long value2 = op2->__anon1.i64;
6033 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6036 exp->expType = op1->type;
6038 op1->type->refCount++;
6043 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6045 uint64 value2 = op2->__anon1.ui64;
6048 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6051 exp->expType = op1->type;
6053 op1->type->refCount++;
6058 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6060 short value2 = op2->__anon1.s;
6063 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6066 exp->expType = op1->type;
6068 op1->type->refCount++;
6073 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6075 unsigned short value2 = op2->__anon1.us;
6078 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6081 exp->expType = op1->type;
6083 op1->type->refCount++;
6088 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6090 char value2 = op2->__anon1.c;
6093 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6096 exp->expType = op1->type;
6098 op1->type->refCount++;
6103 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6105 unsigned char value2 = op2->__anon1.uc;
6108 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6111 exp->expType = op1->type;
6113 op1->type->refCount++;
6118 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6120 float value2 = op2->__anon1.f;
6123 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6126 exp->expType = op1->type;
6128 op1->type->refCount++;
6133 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6135 double value2 = op2->__anon1.d;
6138 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6141 exp->expType = op1->type;
6143 op1->type->refCount++;
6148 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6150 int value2 = op2->__anon1.i;
6153 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6156 exp->expType = op1->type;
6158 op1->type->refCount++;
6163 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6165 unsigned int value2 = op2->__anon1.ui;
6168 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6171 exp->expType = op1->type;
6173 op1->type->refCount++;
6178 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6180 long long value2 = op2->__anon1.i64;
6183 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6195 uint64 value2 = op2->__anon1.ui64;
6198 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6201 exp->expType = op1->type;
6203 op1->type->refCount++;
6208 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6210 short value2 = op2->__anon1.s;
6213 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6216 exp->expType = op1->type;
6218 op1->type->refCount++;
6223 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6225 unsigned short value2 = op2->__anon1.us;
6228 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6231 exp->expType = op1->type;
6233 op1->type->refCount++;
6238 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6240 char value2 = op2->__anon1.c;
6243 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6246 exp->expType = op1->type;
6248 op1->type->refCount++;
6253 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6255 unsigned char value2 = op2->__anon1.uc;
6258 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6261 exp->expType = op1->type;
6263 op1->type->refCount++;
6268 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6270 float value2 = op2->__anon1.f;
6273 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6276 exp->expType = op1->type;
6278 op1->type->refCount++;
6283 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6285 double value2 = op2->__anon1.d;
6288 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6291 exp->expType = op1->type;
6293 op1->type->refCount++;
6298 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6300 int value2 = op2->__anon1.i;
6303 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6306 exp->expType = op1->type;
6308 op1->type->refCount++;
6313 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6315 unsigned int value2 = op2->__anon1.ui;
6318 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6321 exp->expType = op1->type;
6323 op1->type->refCount++;
6328 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6330 long long value2 = op2->__anon1.i64;
6333 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6345 uint64 value2 = op2->__anon1.ui64;
6348 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6351 exp->expType = op1->type;
6353 op1->type->refCount++;
6358 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6360 short value2 = op2->__anon1.s;
6363 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6366 exp->expType = op1->type;
6368 op1->type->refCount++;
6373 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6375 unsigned short value2 = op2->__anon1.us;
6378 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6381 exp->expType = op1->type;
6383 op1->type->refCount++;
6388 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6390 char value2 = op2->__anon1.c;
6393 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6396 exp->expType = op1->type;
6398 op1->type->refCount++;
6403 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6405 unsigned char value2 = op2->__anon1.uc;
6408 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6411 exp->expType = op1->type;
6413 op1->type->refCount++;
6418 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6420 float value2 = op2->__anon1.f;
6423 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6426 exp->expType = op1->type;
6428 op1->type->refCount++;
6433 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6435 double value2 = op2->__anon1.d;
6438 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6441 exp->expType = op1->type;
6443 op1->type->refCount++;
6448 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6450 int value2 = op2->__anon1.i;
6453 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6456 exp->expType = op1->type;
6458 op1->type->refCount++;
6463 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6465 unsigned int value2 = op2->__anon1.ui;
6468 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6471 exp->expType = op1->type;
6473 op1->type->refCount++;
6478 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6480 long long value2 = op2->__anon1.i64;
6483 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6486 exp->expType = op1->type;
6488 op1->type->refCount++;
6493 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6495 uint64 value2 = op2->__anon1.ui64;
6498 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6501 exp->expType = op1->type;
6503 op1->type->refCount++;
6508 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6510 short value2 = op2->__anon1.s;
6513 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6516 exp->expType = op1->type;
6518 op1->type->refCount++;
6523 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6525 unsigned short value2 = op2->__anon1.us;
6528 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6531 exp->expType = op1->type;
6533 op1->type->refCount++;
6538 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6540 char value2 = op2->__anon1.c;
6543 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6546 exp->expType = op1->type;
6548 op1->type->refCount++;
6553 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6555 unsigned char value2 = op2->__anon1.uc;
6558 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6561 exp->expType = op1->type;
6563 op1->type->refCount++;
6568 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6570 float value2 = op2->__anon1.f;
6573 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6576 exp->expType = op1->type;
6578 op1->type->refCount++;
6583 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6585 double value2 = op2->__anon1.d;
6588 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6591 exp->expType = op1->type;
6593 op1->type->refCount++;
6598 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6600 int value2 = op2->__anon1.i;
6603 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6606 exp->expType = op1->type;
6608 op1->type->refCount++;
6613 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6615 unsigned int value2 = op2->__anon1.ui;
6618 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6621 exp->expType = op1->type;
6623 op1->type->refCount++;
6628 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6630 long long value2 = op2->__anon1.i64;
6633 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6636 exp->expType = op1->type;
6638 op1->type->refCount++;
6643 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6645 uint64 value2 = op2->__anon1.ui64;
6648 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6651 exp->expType = op1->type;
6653 op1->type->refCount++;
6658 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6660 short value2 = op2->__anon1.s;
6663 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6666 exp->expType = op1->type;
6668 op1->type->refCount++;
6673 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6675 unsigned short value2 = op2->__anon1.us;
6678 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6681 exp->expType = op1->type;
6683 op1->type->refCount++;
6688 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6690 char value2 = op2->__anon1.c;
6693 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6696 exp->expType = op1->type;
6698 op1->type->refCount++;
6703 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6705 unsigned char value2 = op2->__anon1.uc;
6708 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6711 exp->expType = op1->type;
6713 op1->type->refCount++;
6718 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6721 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6724 exp->expType = op1->type;
6726 op1->type->refCount++;
6731 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6734 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6737 exp->expType = op1->type;
6739 op1->type->refCount++;
6744 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6747 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6750 exp->expType = op1->type;
6752 op1->type->refCount++;
6757 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6760 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6763 exp->expType = op1->type;
6765 op1->type->refCount++;
6770 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6773 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6776 exp->expType = op1->type;
6778 op1->type->refCount++;
6783 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6786 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6789 exp->expType = op1->type;
6791 op1->type->refCount++;
6796 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6799 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6802 exp->expType = op1->type;
6804 op1->type->refCount++;
6809 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6812 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6815 exp->expType = op1->type;
6817 op1->type->refCount++;
6822 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6825 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6828 exp->expType = op1->type;
6830 op1->type->refCount++;
6835 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6838 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6841 exp->expType = op1->type;
6843 op1->type->refCount++;
6848 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6851 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6864 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6867 exp->expType = op1->type;
6869 op1->type->refCount++;
6874 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6877 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6880 exp->expType = op1->type;
6882 op1->type->refCount++;
6887 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6890 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6893 exp->expType = op1->type;
6895 op1->type->refCount++;
6900 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6903 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6906 exp->expType = op1->type;
6908 op1->type->refCount++;
6913 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6916 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6919 exp->expType = op1->type;
6921 op1->type->refCount++;
6926 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6929 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6932 exp->expType = op1->type;
6934 op1->type->refCount++;
6939 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6942 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6945 exp->expType = op1->type;
6947 op1->type->refCount++;
6952 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6955 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6958 exp->expType = op1->type;
6960 op1->type->refCount++;
6965 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6968 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6971 exp->expType = op1->type;
6973 op1->type->refCount++;
6978 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6981 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6984 exp->expType = op1->type;
6986 op1->type->refCount++;
6991 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6994 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6997 exp->expType = op1->type;
6999 op1->type->refCount++;
7004 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7007 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7010 exp->expType = op1->type;
7012 op1->type->refCount++;
7017 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7020 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7023 exp->expType = op1->type;
7025 op1->type->refCount++;
7030 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7033 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7036 exp->expType = op1->type;
7038 op1->type->refCount++;
7043 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7046 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7049 exp->expType = op1->type;
7051 op1->type->refCount++;
7056 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7059 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7062 exp->expType = op1->type;
7064 op1->type->refCount++;
7069 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7072 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7075 exp->expType = op1->type;
7077 op1->type->refCount++;
7082 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7085 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7088 exp->expType = op1->type;
7090 op1->type->refCount++;
7095 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7098 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7101 exp->expType = op1->type;
7103 op1->type->refCount++;
7108 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7110 int value2 = op2->__anon1.i;
7113 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7116 exp->expType = op1->type;
7118 op1->type->refCount++;
7123 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7125 unsigned int value2 = op2->__anon1.ui;
7128 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7131 exp->expType = op1->type;
7133 op1->type->refCount++;
7138 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7140 long long value2 = op2->__anon1.i64;
7143 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7146 exp->expType = op1->type;
7148 op1->type->refCount++;
7153 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7155 uint64 value2 = op2->__anon1.ui64;
7158 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7161 exp->expType = op1->type;
7163 op1->type->refCount++;
7168 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7170 short value2 = op2->__anon1.s;
7173 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7176 exp->expType = op1->type;
7178 op1->type->refCount++;
7183 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7185 unsigned short value2 = op2->__anon1.us;
7188 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7191 exp->expType = op1->type;
7193 op1->type->refCount++;
7198 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7200 char value2 = op2->__anon1.c;
7203 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7206 exp->expType = op1->type;
7208 op1->type->refCount++;
7213 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7215 unsigned char value2 = op2->__anon1.uc;
7218 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7221 exp->expType = op1->type;
7223 op1->type->refCount++;
7228 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7230 float value2 = op2->__anon1.f;
7233 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7236 exp->expType = op1->type;
7238 op1->type->refCount++;
7243 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7245 double value2 = op2->__anon1.d;
7248 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7251 exp->expType = op1->type;
7253 op1->type->refCount++;
7258 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7260 int value2 = op2->__anon1.i;
7263 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7266 exp->expType = op1->type;
7268 op1->type->refCount++;
7273 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7275 unsigned int value2 = op2->__anon1.ui;
7278 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7281 exp->expType = op1->type;
7283 op1->type->refCount++;
7288 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7290 long long value2 = op2->__anon1.i64;
7293 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7296 exp->expType = op1->type;
7298 op1->type->refCount++;
7303 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7305 uint64 value2 = op2->__anon1.ui64;
7308 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7311 exp->expType = op1->type;
7313 op1->type->refCount++;
7318 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7320 short value2 = op2->__anon1.s;
7323 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7326 exp->expType = op1->type;
7328 op1->type->refCount++;
7333 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7335 unsigned short value2 = op2->__anon1.us;
7338 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7341 exp->expType = op1->type;
7343 op1->type->refCount++;
7348 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7350 char value2 = op2->__anon1.c;
7353 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7356 exp->expType = op1->type;
7358 op1->type->refCount++;
7363 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7365 unsigned char value2 = op2->__anon1.uc;
7368 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7371 exp->expType = op1->type;
7373 op1->type->refCount++;
7378 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7380 float value2 = op2->__anon1.f;
7383 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7386 exp->expType = op1->type;
7388 op1->type->refCount++;
7393 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7395 double value2 = op2->__anon1.d;
7398 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7401 exp->expType = op1->type;
7403 op1->type->refCount++;
7408 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7410 int value2 = op2->__anon1.i;
7413 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7416 exp->expType = op1->type;
7418 op1->type->refCount++;
7423 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7425 unsigned int value2 = op2->__anon1.ui;
7428 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7431 exp->expType = op1->type;
7433 op1->type->refCount++;
7438 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7440 long long value2 = op2->__anon1.i64;
7443 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7446 exp->expType = op1->type;
7448 op1->type->refCount++;
7453 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7455 uint64 value2 = op2->__anon1.ui64;
7458 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7461 exp->expType = op1->type;
7463 op1->type->refCount++;
7468 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7470 short value2 = op2->__anon1.s;
7473 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7476 exp->expType = op1->type;
7478 op1->type->refCount++;
7483 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7485 unsigned short value2 = op2->__anon1.us;
7488 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7491 exp->expType = op1->type;
7493 op1->type->refCount++;
7498 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7500 char value2 = op2->__anon1.c;
7503 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7506 exp->expType = op1->type;
7508 op1->type->refCount++;
7513 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7515 unsigned char value2 = op2->__anon1.uc;
7518 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7521 exp->expType = op1->type;
7523 op1->type->refCount++;
7528 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7530 float value2 = op2->__anon1.f;
7533 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7536 exp->expType = op1->type;
7538 op1->type->refCount++;
7543 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7545 double value2 = op2->__anon1.d;
7548 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7551 exp->expType = op1->type;
7553 op1->type->refCount++;
7558 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7560 int value2 = op2->__anon1.i;
7563 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7566 exp->expType = op1->type;
7568 op1->type->refCount++;
7573 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7575 unsigned int value2 = op2->__anon1.ui;
7578 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7581 exp->expType = op1->type;
7583 op1->type->refCount++;
7588 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7590 long long value2 = op2->__anon1.i64;
7593 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7596 exp->expType = op1->type;
7598 op1->type->refCount++;
7603 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7605 uint64 value2 = op2->__anon1.ui64;
7608 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7611 exp->expType = op1->type;
7613 op1->type->refCount++;
7618 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7620 short value2 = op2->__anon1.s;
7623 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7626 exp->expType = op1->type;
7628 op1->type->refCount++;
7633 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7635 unsigned short value2 = op2->__anon1.us;
7638 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7641 exp->expType = op1->type;
7643 op1->type->refCount++;
7648 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7650 char value2 = op2->__anon1.c;
7653 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7656 exp->expType = op1->type;
7658 op1->type->refCount++;
7663 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7665 unsigned char value2 = op2->__anon1.uc;
7668 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7680 float value2 = op2->__anon1.f;
7683 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7686 exp->expType = op1->type;
7688 op1->type->refCount++;
7693 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7695 double value2 = op2->__anon1.d;
7698 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7701 exp->expType = op1->type;
7703 op1->type->refCount++;
7708 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7710 int value2 = op2->__anon1.i;
7713 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7716 exp->expType = op1->type;
7718 op1->type->refCount++;
7723 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7725 unsigned int value2 = op2->__anon1.ui;
7728 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7731 exp->expType = op1->type;
7733 op1->type->refCount++;
7738 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7740 long long value2 = op2->__anon1.i64;
7743 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7746 exp->expType = op1->type;
7748 op1->type->refCount++;
7753 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7755 uint64 value2 = op2->__anon1.ui64;
7758 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7761 exp->expType = op1->type;
7763 op1->type->refCount++;
7768 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7770 short value2 = op2->__anon1.s;
7773 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7776 exp->expType = op1->type;
7778 op1->type->refCount++;
7783 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7785 unsigned short value2 = op2->__anon1.us;
7788 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7791 exp->expType = op1->type;
7793 op1->type->refCount++;
7798 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7800 char value2 = op2->__anon1.c;
7803 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7806 exp->expType = op1->type;
7808 op1->type->refCount++;
7813 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7815 unsigned char value2 = op2->__anon1.uc;
7818 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7821 exp->expType = op1->type;
7823 op1->type->refCount++;
7828 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7830 float value2 = op2->__anon1.f;
7833 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7836 exp->expType = op1->type;
7838 op1->type->refCount++;
7843 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7845 double value2 = op2->__anon1.d;
7848 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7851 exp->expType = op1->type;
7853 op1->type->refCount++;
7858 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7860 int value2 = op2->__anon1.i;
7863 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7866 exp->expType = op1->type;
7868 op1->type->refCount++;
7873 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7875 unsigned int value2 = op2->__anon1.ui;
7878 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7881 exp->expType = op1->type;
7883 op1->type->refCount++;
7888 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7890 long long value2 = op2->__anon1.i64;
7893 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7896 exp->expType = op1->type;
7898 op1->type->refCount++;
7903 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7905 uint64 value2 = op2->__anon1.ui64;
7908 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7911 exp->expType = op1->type;
7913 op1->type->refCount++;
7918 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7920 short value2 = op2->__anon1.s;
7923 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7926 exp->expType = op1->type;
7928 op1->type->refCount++;
7933 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7935 unsigned short value2 = op2->__anon1.us;
7938 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7941 exp->expType = op1->type;
7943 op1->type->refCount++;
7948 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7950 char value2 = op2->__anon1.c;
7953 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7956 exp->expType = op1->type;
7958 op1->type->refCount++;
7963 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7965 unsigned char value2 = op2->__anon1.uc;
7968 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7971 exp->expType = op1->type;
7973 op1->type->refCount++;
7978 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7980 int value2 = op2->__anon1.i;
7983 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7986 exp->expType = op1->type;
7988 op1->type->refCount++;
7993 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7995 unsigned int value2 = op2->__anon1.ui;
7998 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8001 exp->expType = op1->type;
8003 op1->type->refCount++;
8008 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8010 long long value2 = op2->__anon1.i64;
8013 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8016 exp->expType = op1->type;
8018 op1->type->refCount++;
8023 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8025 uint64 value2 = op2->__anon1.ui64;
8028 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8031 exp->expType = op1->type;
8033 op1->type->refCount++;
8038 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8040 short value2 = op2->__anon1.s;
8043 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8046 exp->expType = op1->type;
8048 op1->type->refCount++;
8053 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8055 unsigned short value2 = op2->__anon1.us;
8058 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8061 exp->expType = op1->type;
8063 op1->type->refCount++;
8068 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8070 char value2 = op2->__anon1.c;
8073 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8076 exp->expType = op1->type;
8078 op1->type->refCount++;
8083 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8085 unsigned char value2 = op2->__anon1.uc;
8088 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8091 exp->expType = op1->type;
8093 op1->type->refCount++;
8098 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8100 int value2 = op2->__anon1.i;
8103 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8106 exp->expType = op1->type;
8108 op1->type->refCount++;
8113 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8115 unsigned int value2 = op2->__anon1.ui;
8118 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8121 exp->expType = op1->type;
8123 op1->type->refCount++;
8128 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 long long value2 = op2->__anon1.i64;
8133 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8136 exp->expType = op1->type;
8138 op1->type->refCount++;
8143 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 uint64 value2 = op2->__anon1.ui64;
8148 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8151 exp->expType = op1->type;
8153 op1->type->refCount++;
8158 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 short value2 = op2->__anon1.s;
8163 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 unsigned short value2 = op2->__anon1.us;
8178 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8181 exp->expType = op1->type;
8183 op1->type->refCount++;
8188 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 char value2 = op2->__anon1.c;
8193 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8196 exp->expType = op1->type;
8198 op1->type->refCount++;
8203 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 unsigned char value2 = op2->__anon1.uc;
8208 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8211 exp->expType = op1->type;
8213 op1->type->refCount++;
8218 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8220 int value2 = op2->__anon1.i;
8223 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8226 exp->expType = op1->type;
8228 op1->type->refCount++;
8233 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8235 unsigned int value2 = op2->__anon1.ui;
8238 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8241 exp->expType = op1->type;
8243 op1->type->refCount++;
8248 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 long long value2 = op2->__anon1.i64;
8253 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8256 exp->expType = op1->type;
8258 op1->type->refCount++;
8263 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 uint64 value2 = op2->__anon1.ui64;
8268 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8271 exp->expType = op1->type;
8273 op1->type->refCount++;
8278 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 short value2 = op2->__anon1.s;
8283 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8286 exp->expType = op1->type;
8288 op1->type->refCount++;
8293 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 unsigned short value2 = op2->__anon1.us;
8298 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8301 exp->expType = op1->type;
8303 op1->type->refCount++;
8308 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 char value2 = op2->__anon1.c;
8313 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 unsigned char value2 = op2->__anon1.uc;
8328 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 int value2 = op2->__anon1.i;
8343 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 unsigned int value2 = op2->__anon1.ui;
8358 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 long long value2 = op2->__anon1.i64;
8373 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 uint64 value2 = op2->__anon1.ui64;
8388 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 short value2 = op2->__anon1.s;
8403 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 unsigned short value2 = op2->__anon1.us;
8418 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 char value2 = op2->__anon1.c;
8433 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8436 exp->expType = op1->type;
8438 op1->type->refCount++;
8443 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 unsigned char value2 = op2->__anon1.uc;
8448 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8451 exp->expType = op1->type;
8453 op1->type->refCount++;
8458 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 int value2 = op2->__anon1.i;
8463 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8466 exp->expType = op1->type;
8468 op1->type->refCount++;
8473 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 unsigned int value2 = op2->__anon1.ui;
8478 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8481 exp->expType = op1->type;
8483 op1->type->refCount++;
8488 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 long long value2 = op2->__anon1.i64;
8493 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 uint64 value2 = op2->__anon1.ui64;
8508 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 short value2 = op2->__anon1.s;
8523 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8526 exp->expType = op1->type;
8528 op1->type->refCount++;
8533 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 unsigned short value2 = op2->__anon1.us;
8538 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8541 exp->expType = op1->type;
8543 op1->type->refCount++;
8548 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 char value2 = op2->__anon1.c;
8553 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8556 exp->expType = op1->type;
8558 op1->type->refCount++;
8563 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 unsigned char value2 = op2->__anon1.uc;
8568 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8571 exp->expType = op1->type;
8573 op1->type->refCount++;
8578 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8581 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8584 exp->expType = op1->type;
8586 op1->type->refCount++;
8591 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8594 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8597 exp->expType = op1->type;
8599 op1->type->refCount++;
8604 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8607 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8610 exp->expType = op1->type;
8612 op1->type->refCount++;
8617 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8620 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8623 exp->expType = op1->type;
8625 op1->type->refCount++;
8630 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8633 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8636 exp->expType = op1->type;
8638 op1->type->refCount++;
8643 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8646 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8649 exp->expType = op1->type;
8651 op1->type->refCount++;
8656 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8659 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8662 exp->expType = op1->type;
8664 op1->type->refCount++;
8669 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8672 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 int value2 = op2->__anon1.i;
8687 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 unsigned int value2 = op2->__anon1.ui;
8702 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 long long value2 = op2->__anon1.i64;
8717 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 uint64 value2 = op2->__anon1.ui64;
8732 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 short value2 = op2->__anon1.s;
8747 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 unsigned short value2 = op2->__anon1.us;
8762 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 char value2 = op2->__anon1.c;
8777 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 unsigned char value2 = op2->__anon1.uc;
8792 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 int value2 = op2->__anon1.i;
8807 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 unsigned int value2 = op2->__anon1.ui;
8822 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 long long value2 = op2->__anon1.i64;
8837 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 uint64 value2 = op2->__anon1.ui64;
8852 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 short value2 = op2->__anon1.s;
8867 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 unsigned short value2 = op2->__anon1.us;
8882 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 char value2 = op2->__anon1.c;
8897 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 unsigned char value2 = op2->__anon1.uc;
8912 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8924 int value2 = op2->__anon1.i;
8927 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8939 unsigned int value2 = op2->__anon1.ui;
8942 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8954 long long value2 = op2->__anon1.i64;
8957 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8960 exp->expType = op1->type;
8962 op1->type->refCount++;
8967 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8969 uint64 value2 = op2->__anon1.ui64;
8972 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8984 short value2 = op2->__anon1.s;
8987 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8990 exp->expType = op1->type;
8992 op1->type->refCount++;
8997 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8999 unsigned short value2 = op2->__anon1.us;
9002 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9005 exp->expType = op1->type;
9007 op1->type->refCount++;
9012 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9014 char value2 = op2->__anon1.c;
9017 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 unsigned char value2 = op2->__anon1.uc;
9032 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 int value2 = op2->__anon1.i;
9047 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 unsigned int value2 = op2->__anon1.ui;
9062 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 long long value2 = op2->__anon1.i64;
9077 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 uint64 value2 = op2->__anon1.ui64;
9092 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 short value2 = op2->__anon1.s;
9107 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9110 exp->expType = op1->type;
9112 op1->type->refCount++;
9117 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 unsigned short value2 = op2->__anon1.us;
9122 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9125 exp->expType = op1->type;
9127 op1->type->refCount++;
9132 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9134 char value2 = op2->__anon1.c;
9137 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9140 exp->expType = op1->type;
9142 op1->type->refCount++;
9147 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9149 unsigned char value2 = op2->__anon1.uc;
9152 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9155 exp->expType = op1->type;
9157 op1->type->refCount++;
9162 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 int value2 = op2->__anon1.i;
9167 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9170 exp->expType = op1->type;
9172 op1->type->refCount++;
9177 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 unsigned int value2 = op2->__anon1.ui;
9182 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9185 exp->expType = op1->type;
9187 op1->type->refCount++;
9192 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9194 long long value2 = op2->__anon1.i64;
9197 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9200 exp->expType = op1->type;
9202 op1->type->refCount++;
9207 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9209 uint64 value2 = op2->__anon1.ui64;
9212 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9215 exp->expType = op1->type;
9217 op1->type->refCount++;
9222 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9224 short value2 = op2->__anon1.s;
9227 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9230 exp->expType = op1->type;
9232 op1->type->refCount++;
9237 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9239 unsigned short value2 = op2->__anon1.us;
9242 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9245 exp->expType = op1->type;
9247 op1->type->refCount++;
9252 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9254 char value2 = op2->__anon1.c;
9257 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9260 exp->expType = op1->type;
9262 op1->type->refCount++;
9267 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9269 unsigned char value2 = op2->__anon1.uc;
9272 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9275 exp->expType = op1->type;
9277 op1->type->refCount++;
9282 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9285 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9288 exp->expType = op1->type;
9290 op1->type->refCount++;
9295 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9298 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9301 exp->expType = op1->type;
9303 op1->type->refCount++;
9308 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9311 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9314 exp->expType = op1->type;
9316 op1->type->refCount++;
9321 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9324 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9327 exp->expType = op1->type;
9329 op1->type->refCount++;
9334 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9337 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9340 exp->expType = op1->type;
9342 op1->type->refCount++;
9347 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9350 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9353 exp->expType = op1->type;
9355 op1->type->refCount++;
9360 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9363 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9366 exp->expType = op1->type;
9368 op1->type->refCount++;
9373 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9376 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9379 exp->expType = op1->type;
9381 op1->type->refCount++;
9386 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9388 int value2 = op2->__anon1.i;
9391 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9394 exp->expType = op1->type;
9396 op1->type->refCount++;
9401 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9403 unsigned int value2 = op2->__anon1.ui;
9406 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9409 exp->expType = op1->type;
9411 op1->type->refCount++;
9416 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9418 long long value2 = op2->__anon1.i64;
9421 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9424 exp->expType = op1->type;
9426 op1->type->refCount++;
9431 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9433 uint64 value2 = op2->__anon1.ui64;
9436 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9439 exp->expType = op1->type;
9441 op1->type->refCount++;
9446 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9448 short value2 = op2->__anon1.s;
9451 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9454 exp->expType = op1->type;
9456 op1->type->refCount++;
9461 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9463 unsigned short value2 = op2->__anon1.us;
9466 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9469 exp->expType = op1->type;
9471 op1->type->refCount++;
9476 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9478 char value2 = op2->__anon1.c;
9481 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9484 exp->expType = op1->type;
9486 op1->type->refCount++;
9491 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9493 unsigned char value2 = op2->__anon1.uc;
9496 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9499 exp->expType = op1->type;
9501 op1->type->refCount++;
9506 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9508 float value2 = op2->__anon1.f;
9511 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9514 exp->expType = op1->type;
9516 op1->type->refCount++;
9521 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9523 double value2 = op2->__anon1.d;
9526 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9529 exp->expType = op1->type;
9531 op1->type->refCount++;
9536 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9538 int value2 = op2->__anon1.i;
9541 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9544 exp->expType = op1->type;
9546 op1->type->refCount++;
9551 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9553 unsigned int value2 = op2->__anon1.ui;
9556 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9559 exp->expType = op1->type;
9561 op1->type->refCount++;
9566 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9568 long long value2 = op2->__anon1.i64;
9571 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9574 exp->expType = op1->type;
9576 op1->type->refCount++;
9581 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9583 uint64 value2 = op2->__anon1.ui64;
9586 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9589 exp->expType = op1->type;
9591 op1->type->refCount++;
9596 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9598 short value2 = op2->__anon1.s;
9601 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9604 exp->expType = op1->type;
9606 op1->type->refCount++;
9611 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9613 unsigned short value2 = op2->__anon1.us;
9616 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9619 exp->expType = op1->type;
9621 op1->type->refCount++;
9626 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9628 char value2 = op2->__anon1.c;
9631 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9634 exp->expType = op1->type;
9636 op1->type->refCount++;
9641 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9643 unsigned char value2 = op2->__anon1.uc;
9646 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9649 exp->expType = op1->type;
9651 op1->type->refCount++;
9656 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9658 float value2 = op2->__anon1.f;
9661 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9664 exp->expType = op1->type;
9666 op1->type->refCount++;
9671 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9673 double value2 = op2->__anon1.d;
9676 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9679 exp->expType = op1->type;
9681 op1->type->refCount++;
9686 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9688 int value2 = op2->__anon1.i;
9691 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9694 exp->expType = op1->type;
9696 op1->type->refCount++;
9701 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9703 unsigned int value2 = op2->__anon1.ui;
9706 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9709 exp->expType = op1->type;
9711 op1->type->refCount++;
9716 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9718 long long value2 = op2->__anon1.i64;
9721 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9724 exp->expType = op1->type;
9726 op1->type->refCount++;
9731 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9733 uint64 value2 = op2->__anon1.ui64;
9736 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9739 exp->expType = op1->type;
9741 op1->type->refCount++;
9746 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9748 short value2 = op2->__anon1.s;
9751 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9754 exp->expType = op1->type;
9756 op1->type->refCount++;
9761 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9763 unsigned short value2 = op2->__anon1.us;
9766 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9769 exp->expType = op1->type;
9771 op1->type->refCount++;
9776 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9778 char value2 = op2->__anon1.c;
9781 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9784 exp->expType = op1->type;
9786 op1->type->refCount++;
9791 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9793 unsigned char value2 = op2->__anon1.uc;
9796 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9799 exp->expType = op1->type;
9801 op1->type->refCount++;
9806 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9808 float value2 = op2->__anon1.f;
9811 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9814 exp->expType = op1->type;
9816 op1->type->refCount++;
9821 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9823 double value2 = op2->__anon1.d;
9826 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9829 exp->expType = op1->type;
9831 op1->type->refCount++;
9836 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9838 int value2 = op2->__anon1.i;
9841 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9844 exp->expType = op1->type;
9846 op1->type->refCount++;
9851 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9853 unsigned int value2 = op2->__anon1.ui;
9856 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9859 exp->expType = op1->type;
9861 op1->type->refCount++;
9866 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9868 long long value2 = op2->__anon1.i64;
9871 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9874 exp->expType = op1->type;
9876 op1->type->refCount++;
9881 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9883 uint64 value2 = op2->__anon1.ui64;
9886 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9889 exp->expType = op1->type;
9891 op1->type->refCount++;
9896 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9898 short value2 = op2->__anon1.s;
9901 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9904 exp->expType = op1->type;
9906 op1->type->refCount++;
9911 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9913 unsigned short value2 = op2->__anon1.us;
9916 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9919 exp->expType = op1->type;
9921 op1->type->refCount++;
9926 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9928 char value2 = op2->__anon1.c;
9931 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9934 exp->expType = op1->type;
9936 op1->type->refCount++;
9941 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9943 unsigned char value2 = op2->__anon1.uc;
9946 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9949 exp->expType = op1->type;
9951 op1->type->refCount++;
9956 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9958 float value2 = op2->__anon1.f;
9961 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9964 exp->expType = op1->type;
9966 op1->type->refCount++;
9971 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9973 double value2 = op2->__anon1.d;
9976 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9979 exp->expType = op1->type;
9981 op1->type->refCount++;
9986 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9988 int value2 = op2->__anon1.i;
9991 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
9994 exp->expType = op1->type;
9996 op1->type->refCount++;
10001 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10003 unsigned int value2 = op2->__anon1.ui;
10006 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10009 exp->expType = op1->type;
10011 op1->type->refCount++;
10016 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10018 long long value2 = op2->__anon1.i64;
10021 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10024 exp->expType = op1->type;
10026 op1->type->refCount++;
10031 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10033 uint64 value2 = op2->__anon1.ui64;
10036 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10039 exp->expType = op1->type;
10041 op1->type->refCount++;
10046 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10048 short value2 = op2->__anon1.s;
10051 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10054 exp->expType = op1->type;
10056 op1->type->refCount++;
10061 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10063 unsigned short value2 = op2->__anon1.us;
10066 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10069 exp->expType = op1->type;
10071 op1->type->refCount++;
10076 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10078 char value2 = op2->__anon1.c;
10081 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10084 exp->expType = op1->type;
10086 op1->type->refCount++;
10091 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10093 unsigned char value2 = op2->__anon1.uc;
10096 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10099 exp->expType = op1->type;
10101 op1->type->refCount++;
10106 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10108 float value2 = op2->__anon1.f;
10111 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10114 exp->expType = op1->type;
10116 op1->type->refCount++;
10121 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10123 double value2 = op2->__anon1.d;
10126 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10129 exp->expType = op1->type;
10131 op1->type->refCount++;
10136 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10138 int value2 = op2->__anon1.i;
10141 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10144 exp->expType = op1->type;
10146 op1->type->refCount++;
10151 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10153 unsigned int value2 = op2->__anon1.ui;
10156 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10159 exp->expType = op1->type;
10161 op1->type->refCount++;
10166 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10168 long long value2 = op2->__anon1.i64;
10171 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10174 exp->expType = op1->type;
10176 op1->type->refCount++;
10181 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10183 uint64 value2 = op2->__anon1.ui64;
10186 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10189 exp->expType = op1->type;
10191 op1->type->refCount++;
10196 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10198 short value2 = op2->__anon1.s;
10201 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10204 exp->expType = op1->type;
10206 op1->type->refCount++;
10211 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10213 unsigned short value2 = op2->__anon1.us;
10216 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10219 exp->expType = op1->type;
10221 op1->type->refCount++;
10226 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10228 char value2 = op2->__anon1.c;
10231 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10234 exp->expType = op1->type;
10236 op1->type->refCount++;
10241 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10243 unsigned char value2 = op2->__anon1.uc;
10246 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10249 exp->expType = op1->type;
10251 op1->type->refCount++;
10256 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10258 float value2 = op2->__anon1.f;
10261 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10264 exp->expType = op1->type;
10266 op1->type->refCount++;
10271 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10273 double value2 = op2->__anon1.d;
10276 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10279 exp->expType = op1->type;
10281 op1->type->refCount++;
10286 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10288 int value2 = op2->__anon1.i;
10291 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10294 exp->expType = op1->type;
10296 op1->type->refCount++;
10301 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10303 unsigned int value2 = op2->__anon1.ui;
10306 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10309 exp->expType = op1->type;
10311 op1->type->refCount++;
10316 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10318 long long value2 = op2->__anon1.i64;
10321 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10324 exp->expType = op1->type;
10326 op1->type->refCount++;
10331 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10333 uint64 value2 = op2->__anon1.ui64;
10336 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10339 exp->expType = op1->type;
10341 op1->type->refCount++;
10346 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10348 short value2 = op2->__anon1.s;
10351 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10354 exp->expType = op1->type;
10356 op1->type->refCount++;
10361 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10363 unsigned short value2 = op2->__anon1.us;
10366 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10369 exp->expType = op1->type;
10371 op1->type->refCount++;
10376 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10378 char value2 = op2->__anon1.c;
10381 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10384 exp->expType = op1->type;
10386 op1->type->refCount++;
10391 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10393 unsigned char value2 = op2->__anon1.uc;
10396 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10399 exp->expType = op1->type;
10401 op1->type->refCount++;
10406 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10408 float value2 = op2->__anon1.f;
10411 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10414 exp->expType = op1->type;
10416 op1->type->refCount++;
10421 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10423 double value2 = op2->__anon1.d;
10426 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10429 exp->expType = op1->type;
10431 op1->type->refCount++;
10436 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10438 int value2 = op2->__anon1.i;
10441 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10444 exp->expType = op1->type;
10446 op1->type->refCount++;
10451 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10453 unsigned int value2 = op2->__anon1.ui;
10456 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10459 exp->expType = op1->type;
10461 op1->type->refCount++;
10466 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10468 long long value2 = op2->__anon1.i64;
10471 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10474 exp->expType = op1->type;
10476 op1->type->refCount++;
10481 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10483 uint64 value2 = op2->__anon1.ui64;
10486 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10489 exp->expType = op1->type;
10491 op1->type->refCount++;
10496 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10498 short value2 = op2->__anon1.s;
10501 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10504 exp->expType = op1->type;
10506 op1->type->refCount++;
10511 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10513 unsigned short value2 = op2->__anon1.us;
10516 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10519 exp->expType = op1->type;
10521 op1->type->refCount++;
10526 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10528 char value2 = op2->__anon1.c;
10531 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10534 exp->expType = op1->type;
10536 op1->type->refCount++;
10541 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10543 unsigned char value2 = op2->__anon1.uc;
10546 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10549 exp->expType = op1->type;
10551 op1->type->refCount++;
10556 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10558 float value2 = op2->__anon1.f;
10561 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10564 exp->expType = op1->type;
10566 op1->type->refCount++;
10571 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10573 double value2 = op2->__anon1.d;
10576 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10579 exp->expType = op1->type;
10581 op1->type->refCount++;
10586 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10589 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10592 exp->expType = op1->type;
10594 op1->type->refCount++;
10599 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10602 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10605 exp->expType = op1->type;
10607 op1->type->refCount++;
10612 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10615 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10618 exp->expType = op1->type;
10620 op1->type->refCount++;
10625 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10628 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10631 exp->expType = op1->type;
10633 op1->type->refCount++;
10638 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10641 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10644 exp->expType = op1->type;
10646 op1->type->refCount++;
10651 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10654 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10657 exp->expType = op1->type;
10659 op1->type->refCount++;
10664 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10667 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10670 exp->expType = op1->type;
10672 op1->type->refCount++;
10677 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10680 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10683 exp->expType = op1->type;
10685 op1->type->refCount++;
10690 struct OpTable intOps =
10692 IntAdd, IntSub, IntMul, IntDiv, IntMod, IntNeg, IntInc, IntDec, IntAsign, IntAddAsign, IntSubAsign, IntMulAsign, IntDivAsign, IntModAsign, IntBitAnd, IntBitOr, IntBitXor, IntLShift, IntRShift, IntBitNot, IntAndAsign, IntOrAsign, IntXorAsign, IntLShiftAsign, IntRShiftAsign, IntNot, IntEqu, IntNqu, IntAnd, IntOr, IntGrt, IntSma, IntGrtEqu, IntSmaEqu, IntCond
10695 struct OpTable uintOps =
10697 UIntAdd, UIntSub, UIntMul, UIntDiv, UIntMod, UIntNeg, UIntInc, UIntDec, UIntAsign, UIntAddAsign, UIntSubAsign, UIntMulAsign, UIntDivAsign, UIntModAsign, UIntBitAnd, UIntBitOr, UIntBitXor, UIntLShift, UIntRShift, UIntBitNot, UIntAndAsign, UIntOrAsign, UIntXorAsign, UIntLShiftAsign, UIntRShiftAsign, UIntNot, UIntEqu, UIntNqu, UIntAnd, UIntOr, UIntGrt, UIntSma, UIntGrtEqu, UIntSmaEqu, UIntCond
10700 struct OpTable int64Ops =
10702 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10705 struct OpTable uint64Ops =
10707 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10710 struct OpTable shortOps =
10712 ShortAdd, ShortSub, ShortMul, ShortDiv, ShortMod, ShortNeg, ShortInc, ShortDec, ShortAsign, ShortAddAsign, ShortSubAsign, ShortMulAsign, ShortDivAsign, ShortModAsign, ShortBitAnd, ShortBitOr, ShortBitXor, ShortLShift, ShortRShift, ShortBitNot, ShortAndAsign, ShortOrAsign, ShortXorAsign, ShortLShiftAsign, ShortRShiftAsign, ShortNot, ShortEqu, ShortNqu, ShortAnd, ShortOr, ShortGrt, ShortSma, ShortGrtEqu, ShortSmaEqu, ShortCond
10715 struct OpTable ushortOps =
10717 UShortAdd, UShortSub, UShortMul, UShortDiv, UShortMod, UShortNeg, UShortInc, UShortDec, UShortAsign, UShortAddAsign, UShortSubAsign, UShortMulAsign, UShortDivAsign, UShortModAsign, UShortBitAnd, UShortBitOr, UShortBitXor, UShortLShift, UShortRShift, UShortBitNot, UShortAndAsign, UShortOrAsign, UShortXorAsign, UShortLShiftAsign, UShortRShiftAsign, UShortNot, UShortEqu, UShortNqu, UShortAnd, UShortOr, UShortGrt, UShortSma, UShortGrtEqu, UShortSmaEqu, UShortCond
10720 struct OpTable floatOps =
10722 FloatAdd, FloatSub, FloatMul, FloatDiv, (((void *)0)), FloatNeg, FloatInc, FloatDec, FloatAsign, FloatAddAsign, FloatSubAsign, FloatMulAsign, FloatDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), FloatEqu, FloatNqu, FloatAnd, FloatOr, FloatGrt, FloatSma, FloatGrtEqu, FloatSmaEqu
10725 struct OpTable doubleOps =
10727 DoubleAdd, DoubleSub, DoubleMul, DoubleDiv, (((void *)0)), DoubleNeg, DoubleInc, DoubleDec, DoubleAsign, DoubleAddAsign, DoubleSubAsign, DoubleMulAsign, DoubleDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), DoubleEqu, DoubleNqu, DoubleAnd, DoubleOr, DoubleGrt, DoubleSma, DoubleGrtEqu, DoubleSmaEqu
10730 struct OpTable charOps =
10732 CharAdd, CharSub, CharMul, CharDiv, CharMod, CharNeg, CharInc, CharDec, CharAsign, CharAddAsign, CharSubAsign, CharMulAsign, CharDivAsign, CharModAsign, CharBitAnd, CharBitOr, CharBitXor, CharLShift, CharRShift, CharBitNot, CharAndAsign, CharOrAsign, CharXorAsign, CharLShiftAsign, CharRShiftAsign, CharNot, CharEqu, CharNqu, CharAnd, CharOr, CharGrt, CharSma, CharGrtEqu, CharSmaEqu, CharCond
10735 struct OpTable ucharOps =
10737 UCharAdd, UCharSub, UCharMul, UCharDiv, UCharMod, UCharNeg, UCharInc, UCharDec, UCharAsign, UCharAddAsign, UCharSubAsign, UCharMulAsign, UCharDivAsign, UCharModAsign, UCharBitAnd, UCharBitOr, UCharBitXor, UCharLShift, UCharRShift, UCharBitNot, UCharAndAsign, UCharOrAsign, UCharXorAsign, UCharLShiftAsign, UCharRShiftAsign, UCharNot, UCharEqu, UCharNqu, UCharAnd, UCharOr, UCharGrt, UCharSma, UCharGrtEqu, UCharSmaEqu, UCharCond
10740 void ReadString(char * output, char * string)
10742 int len = strlen(string);
10744 unsigned int quoted = 0, escaped = 0;
10746 for(c = 0; c < len; c++)
10748 char ch = string[c];
10806 int UnescapeString(char * d, char * s, int len)
10811 while(j < len && (ch = s[j]))
10816 switch((ch = s[++j]))
10862 char * OffsetEscapedString(char * s, int len, int offset)
10867 while(j < len && k < offset && (ch = s[j]))
10873 return (k == offset) ? s + j : (((void *)0));
10876 extern long long __ecereNameSpace__ecere__com___strtoi64(const char * string, const char * * endString, int base);
10878 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char * string, const char * * endString, int base);
10880 extern double strtod(const char * , char * * );
10882 extern float (* __ecereMethod_float_inf)(void);
10884 extern float (* __ecereMethod_float_nan)(void);
10886 extern double (* __ecereMethod_double_inf)(void);
10888 extern double (* __ecereMethod_double_nan)(void);
10890 struct Operand GetOperand(struct Expression * exp)
10892 struct Operand op =
10899 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10902 struct Type * type = exp->expType;
10906 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))
10908 if(!type->__anon1._class->__anon1.registered->dataType)
10909 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10910 type = type->__anon1._class->__anon1.registered->dataType;
10912 if(exp->type == 3 && op.kind == 13)
10914 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10916 op.ops = uint64Ops;
10918 else if(exp->isConstant && exp->type == 2)
10920 op.kind = type->kind;
10927 if(exp->__anon1.__anon1.constant[0] == '\'')
10929 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10932 else if(type->isSigned)
10934 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10939 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10947 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10952 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10953 op.ops = ushortOps;
10960 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10965 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10973 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10978 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10979 op.ops = uint64Ops;
10986 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10991 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10992 op.ops = uint64Ops;
10999 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11004 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11005 op.ops = uint64Ops;
11010 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11011 op.__anon1.f = __ecereMethod_float_inf();
11012 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11013 op.__anon1.f = -__ecereMethod_float_inf();
11014 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11015 op.__anon1.f = __ecereMethod_float_nan();
11016 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11017 op.__anon1.f = -__ecereMethod_float_nan();
11019 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11023 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11024 op.__anon1.d = __ecereMethod_double_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11026 op.__anon1.d = -__ecereMethod_double_inf();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11028 op.__anon1.d = __ecereMethod_double_nan();
11029 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11030 op.__anon1.d = -__ecereMethod_double_nan();
11032 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11033 op.ops = doubleOps;
11038 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11040 op.ops = uint64Ops;
11048 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11052 switch(_class->typeSize)
11055 if(!strcmp(_class->dataTypeString, "uint64"))
11056 v = (long long)*(uint64 *)ptr;
11058 v = *(long long *)ptr;
11061 if(!strcmp(_class->dataTypeString, "uint"))
11062 v = (long long)*(unsigned int *)ptr;
11064 v = (long long)*(int *)ptr;
11067 if(!strcmp(_class->dataTypeString, "uint16"))
11068 v = (long long)*(unsigned short *)ptr;
11070 v = (long long)*(short *)ptr;
11073 if(!strcmp(_class->dataTypeString, "byte"))
11074 v = (long long)*(unsigned char *)ptr;
11076 v = (long long)*(char *)ptr;
11082 int __ecereVMethodID_class_OnGetString;
11084 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11086 static __attribute__((unused)) void UnusedFunction()
11090 ((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);
11093 extern int __ecereVMethodID_class_OnGetString;
11095 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11097 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11099 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11101 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11102 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11105 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11106 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11107 struct Type * type;
11108 void * ptr = inst->data + dataMember->offset + offset;
11109 char * result = (((void *)0));
11111 exp->loc = member->loc = inst->loc;
11112 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11113 if(!dataMember->dataType)
11114 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11115 type = dataMember->dataType;
11116 if(type->kind == 8)
11118 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11120 if(_class->type == 4)
11122 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11126 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11127 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11129 for(item = e->values.first; item; item = item->next)
11131 if(item->data == GetEnumValue(_class, ptr))
11133 result = item->name;
11139 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11141 exp->destType = MkClassType(_class->fullName);
11142 ProcessExpressionType(exp);
11146 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11148 if(!_class->dataType)
11149 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11150 type = _class->dataType;
11159 FreeExpContents(exp);
11160 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11166 FreeExpContents(exp);
11167 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11173 FreeExpContents(exp);
11174 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11180 FreeExpContents(exp);
11181 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11187 FreeExpContents(exp);
11188 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11194 FreeExpContents(exp);
11195 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11200 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11203 ListAdd(memberList, member);
11205 if(parentDataMember->type == 1)
11210 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11212 void PopulateInstance(struct Instantiation * inst)
11214 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11215 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11216 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11217 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11220 inst->members = MkListOne(MkMembersInitList(memberList));
11222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11223 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11225 if(!dataMember->isProperty)
11227 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11228 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11231 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11232 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11233 struct Type * type;
11234 void * ptr = inst->data + dataMember->offset;
11235 char * result = (((void *)0));
11237 exp->loc = member->loc = inst->loc;
11238 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11239 if(!dataMember->dataType)
11240 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11241 type = dataMember->dataType;
11242 if(type->kind == 8)
11244 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11246 if(_class->type == 4)
11248 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11252 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11253 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11255 for(item = e->values.first; item; item = item->next)
11257 if(item->data == GetEnumValue(_class, ptr))
11259 result = item->name;
11266 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11268 exp->destType = MkClassType(_class->fullName);
11269 ProcessExpressionType(exp);
11272 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11274 if(!_class->dataType)
11275 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11276 type = _class->dataType;
11285 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11291 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11297 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11303 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11309 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11314 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11317 ListAdd(memberList, member);
11323 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);
11325 extern void FreeInstance(struct Instantiation * inst);
11327 void ComputeInstantiation(struct Expression * exp)
11329 struct Instantiation * inst = exp->__anon1.instance;
11330 struct MembersInit * members;
11331 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11332 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11333 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11334 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11335 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11336 int subMemberStackPos = 0;
11339 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11343 if(_class->type == 0 || _class->type == 5)
11345 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11346 if(_class->type == 0)
11347 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11350 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11354 for(members = (*inst->members).first; members; members = members->next)
11356 switch(members->type)
11360 if(members->__anon1.dataMembers)
11362 struct MemberInit * member;
11364 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11366 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11367 unsigned int found = 0;
11368 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11369 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11370 unsigned int dataMemberOffset;
11374 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11377 if(curMember->isProperty)
11378 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11381 dataMember = curMember;
11382 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11383 if(_class->type == 0)
11384 dataMemberOffset += _class->base->structSize;
11391 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11395 if(prop->memberAccess == 1)
11397 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11398 curClass = prop->_class;
11403 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11404 int _subMemberStackPos = 0;
11406 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11410 if(dataMember->memberAccess == 1)
11412 curMember = dataMember;
11413 curClass = dataMember->_class;
11414 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11415 subMemberStackPos = _subMemberStackPos;
11420 if(found && member->initializer && member->initializer->type == 0)
11422 struct Expression * value = member->initializer->__anon1.exp;
11423 struct Type * type = (((void *)0));
11424 unsigned int deepMember = 0;
11428 type = prop->dataType;
11430 else if(dataMember)
11432 if(!dataMember->dataType)
11433 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11434 type = dataMember->dataType;
11436 if(ident && ident->next)
11439 for(ident = ident->next; ident && type; ident = ident->next)
11441 if(type->kind == 8)
11443 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11445 type = prop->dataType;
11448 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11450 type = dataMember->dataType;
11453 else if(type->kind == 9 || type->kind == 10)
11455 struct Type * memberType;
11457 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11459 if(!strcmp(memberType->name, ident->string))
11470 FreeType(value->destType);
11471 value->destType = type;
11474 ComputeExpression(value);
11476 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11478 if(type->kind == 8)
11480 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11482 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11484 if(!_class->dataType)
11485 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11486 type = _class->dataType;
11491 void * ptr = inst->data + dataMemberOffset;
11493 if(value->type == 2)
11499 GetInt(value, (int *)ptr);
11504 GetInt64(value, (long long *)ptr);
11509 GetIntPtr(value, (intptr_t *)ptr);
11514 GetIntSize(value, (ssize_t *)ptr);
11519 GetFloat(value, (float *)ptr);
11524 GetDouble(value, (double *)ptr);
11529 else if(value->type == 1)
11531 if(type->kind == 8)
11533 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11535 if(_class->type == 1)
11537 ComputeTypeSize(type);
11538 if(value->__anon1.instance->data)
11539 memcpy(ptr, value->__anon1.instance->data, type->size);
11546 if(value->type == 1 && value->__anon1.instance->data)
11548 if(type->kind == 8)
11550 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11552 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)))
11554 void (* Set)(void *, void *) = (void *)prop->Set;
11556 Set(inst->data, value->__anon1.instance->data);
11557 PopulateInstance(inst);
11561 else if(value->type == 2)
11567 void (* Set)(void *, double) = (void *)prop->Set;
11569 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11574 void (* Set)(void *, float) = (void *)prop->Set;
11576 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11581 void (* Set)(void *, int) = (void *)prop->Set;
11583 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11588 void (* Set)(void *, long long) = (void *)prop->Set;
11590 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11595 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11597 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11602 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11604 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11609 else if(value->type == 3)
11613 ReadString(temp, value->__anon1.__anon2.string);
11614 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11618 else if(!deepMember && type && _class->type == 3)
11622 if(value->type == 2)
11624 if(type->kind == 8)
11626 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11628 if(_class->type == 3)
11630 if(!_class->dataType)
11631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11632 type = _class->dataType;
11640 float (* Set)(float) = (void *)prop->Set;
11642 GetFloat(member->initializer->__anon1.exp, &fValue);
11643 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11650 double (* Set)(double) = (void *)prop->Set;
11652 GetDouble(member->initializer->__anon1.exp, &dValue);
11653 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11661 else if(!deepMember && type && _class->type == 2)
11665 if(value->type == 1 && value->__anon1.instance->data)
11667 unsigned int (* Set)(void *) = (void *)prop->Set;
11669 bits = Set(value->__anon1.instance->data);
11671 else if(value->type == 2)
11675 else if(dataMember)
11677 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11678 struct Type * type;
11681 bits = (bits & ~bitMember->mask);
11682 if(!bitMember->dataType)
11683 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11684 type = bitMember->dataType;
11685 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11687 if(!type->__anon1._class->__anon1.registered->dataType)
11688 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11689 type = type->__anon1._class->__anon1.registered->dataType;
11698 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11706 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11715 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11723 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11731 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11739 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11744 bits |= part << bitMember->pos;
11750 if(_class && _class->type == 3)
11752 ComputeExpression(member->initializer->__anon1.exp);
11753 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11755 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11765 if(_class && _class->type == 2)
11767 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11772 FreeInstance(inst);
11776 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11778 unsigned int result = 0;
11783 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11784 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11788 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11789 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11792 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)
11793 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11796 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)
11797 result = GetOpFloat(op, &op->__anon1.f);
11800 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)
11801 result = GetOpDouble(op, &op->__anon1.d);
11804 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)
11805 result = GetOpUInt64(op, &op->__anon1.ui64);
11808 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)
11809 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11812 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11813 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11816 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11817 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11823 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11825 if(exp->__anon1.op.op == SIZEOF)
11827 FreeExpContents(exp);
11829 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11833 if(!exp->__anon1.op.exp1)
11835 switch(exp->__anon1.op.op)
11839 struct Expression * exp2 = exp->__anon1.op.exp2;
11841 exp->__anon1.op.exp2 = (((void *)0));
11842 FreeExpContents(exp);
11843 FreeType(exp->expType);
11844 FreeType(exp->destType);
11846 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11852 FreeExpContents(exp);
11853 op1->ops.Neg(exp, op1);
11857 if(op1->ops.BitNot)
11859 FreeExpContents(exp);
11860 op1->ops.BitNot(exp, op1);
11866 FreeExpContents(exp);
11867 op1->ops.Not(exp, op1);
11874 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11876 if(Promote(op2, op1->kind, op1->type->isSigned))
11877 op2->kind = op1->kind, op2->ops = op1->ops;
11878 else if(Promote(op1, op2->kind, op2->type->isSigned))
11879 op1->kind = op2->kind, op1->ops = op2->ops;
11881 switch(exp->__anon1.op.op)
11886 FreeExpContents(exp);
11887 op1->ops.Add(exp, op1, op2);
11893 FreeExpContents(exp);
11894 op1->ops.Sub(exp, op1, op2);
11900 FreeExpContents(exp);
11901 op1->ops.Mul(exp, op1, op2);
11907 FreeExpContents(exp);
11908 op1->ops.Div(exp, op1, op2);
11914 FreeExpContents(exp);
11915 op1->ops.Mod(exp, op1, op2);
11919 if(exp->__anon1.op.exp2)
11921 if(op1->ops.BitAnd)
11923 FreeExpContents(exp);
11924 op1->ops.BitAnd(exp, op1, op2);
11931 FreeExpContents(exp);
11932 op1->ops.BitOr(exp, op1, op2);
11936 if(op1->ops.BitXor)
11938 FreeExpContents(exp);
11939 op1->ops.BitXor(exp, op1, op2);
11943 if(op1->ops.LShift)
11945 FreeExpContents(exp);
11946 op1->ops.LShift(exp, op1, op2);
11950 if(op1->ops.RShift)
11952 FreeExpContents(exp);
11953 op1->ops.RShift(exp, op1, op2);
11959 FreeExpContents(exp);
11960 op1->ops.Equ(exp, op1, op2);
11966 FreeExpContents(exp);
11967 op1->ops.Nqu(exp, op1, op2);
11973 FreeExpContents(exp);
11974 op1->ops.And(exp, op1, op2);
11980 FreeExpContents(exp);
11981 op1->ops.Or(exp, op1, op2);
11987 FreeExpContents(exp);
11988 op1->ops.Grt(exp, op1, op2);
11994 FreeExpContents(exp);
11995 op1->ops.Sma(exp, op1, op2);
11999 if(op1->ops.GrtEqu)
12001 FreeExpContents(exp);
12002 op1->ops.GrtEqu(exp, op1, op2);
12006 if(op1->ops.SmaEqu)
12008 FreeExpContents(exp);
12009 op1->ops.SmaEqu(exp, op1, op2);
12017 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
12019 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12021 void ComputeExpression(struct Expression * exp)
12027 ComputeInstantiation(exp);
12032 struct Expression * exp1, * exp2 = (((void *)0));
12033 struct Operand op1 =
12040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12043 struct Operand op2 =
12050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 if(exp->__anon1.op.exp2)
12056 struct Expression * e = exp->__anon1.op.exp2;
12058 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12060 if(e->type == 5 || e->type == 32 || e->type == 23)
12063 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12065 e = (*e->__anon1.list).last;
12068 if(exp->__anon1.op.op == 261 && e && e->expType)
12070 if(e->type == 3 && e->__anon1.__anon2.string)
12072 char * string = e->__anon1.__anon2.string;
12073 int len = strlen(string);
12074 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12076 len = UnescapeString(tmp, string + 1, len - 2);
12077 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12078 FreeExpContents(exp);
12080 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12084 struct Type * type = e->expType;
12087 FreeExpContents(exp);
12089 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12095 ComputeExpression(exp->__anon1.op.exp2);
12097 if(exp->__anon1.op.exp1)
12099 ComputeExpression(exp->__anon1.op.exp1);
12100 exp1 = exp->__anon1.op.exp1;
12101 exp2 = exp->__anon1.op.exp2;
12102 op1 = GetOperand(exp1);
12104 op1.type->refCount++;
12107 op2 = GetOperand(exp2);
12109 op2.type->refCount++;
12114 exp1 = exp->__anon1.op.exp2;
12115 op1 = GetOperand(exp1);
12117 op1.type->refCount++;
12119 CallOperator(exp, exp1, exp2, &op1, &op2);
12121 FreeType(op1.type);
12123 FreeType(op2.type);
12129 struct Expression * e, * n;
12131 for(e = (*exp->__anon1.list).first; e; e = n)
12136 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12137 struct Expression * prev = exp->prev;
12138 struct Expression * next = exp->next;
12140 ComputeExpression(e);
12141 FreeType(exp->expType);
12142 FreeType(exp->destType);
12146 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12147 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12158 struct Expression * memberExp = exp->__anon1.member.exp;
12159 struct Identifier * memberID = exp->__anon1.member.member;
12160 struct Type * type;
12162 ComputeExpression(exp->__anon1.member.exp);
12163 type = exp->__anon1.member.exp->expType;
12166 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)));
12167 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12168 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12169 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12171 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12172 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12176 struct Symbol * classSym;
12179 PrintTypeNoConst(type, string, 0, 1);
12180 classSym = FindClass(string);
12181 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12183 if(exp->__anon1.member.member)
12185 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12187 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12189 if(!prop && !member && _class && exp->__anon1.member.member)
12191 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12193 convertTo = _class;
12194 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12195 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12201 struct Type * type = prop->dataType;
12203 if(_class->type == 3)
12205 if(type->kind == 8)
12207 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12209 if(_class->type == 3)
12211 if(!_class->dataType)
12212 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12213 type = _class->dataType;
12221 float (* Get)(float) = (void *)prop->Get;
12223 GetFloat(exp->__anon1.member.exp, &value);
12224 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12231 double (* Get)(double);
12233 GetDouble(exp->__anon1.member.exp, &value);
12235 Get = (void *)prop->Set;
12237 Get = (void *)prop->Get;
12238 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12248 struct Expression * value = exp->__anon1.member.exp;
12249 struct Type * type;
12251 if(!prop->dataType)
12252 ProcessPropertyType(prop);
12253 type = prop->dataType;
12257 else if(_class->type == 1)
12263 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12265 if(propertyClass->type == 1 && value->type == 1)
12267 void (* Set)(void *, void *) = (void *)prop->Set;
12269 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12270 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12271 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12272 exp->__anon1.instance->loc = exp->loc;
12274 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12275 PopulateInstance(exp->__anon1.instance);
12282 void (* Set)(void *, int) = (void *)prop->Set;
12284 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12285 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12286 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12287 exp->__anon1.instance->loc = exp->loc;
12289 GetInt(value, &intValue);
12290 Set(exp->__anon1.instance->data, intValue);
12291 PopulateInstance(exp->__anon1.instance);
12296 long long intValue;
12297 void (* Set)(void *, long long) = (void *)prop->Set;
12299 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12300 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12301 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12302 exp->__anon1.instance->loc = exp->loc;
12304 GetInt64(value, &intValue);
12305 Set(exp->__anon1.instance->data, intValue);
12306 PopulateInstance(exp->__anon1.instance);
12312 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12314 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12315 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12316 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12317 exp->__anon1.instance->loc = exp->loc;
12319 GetIntPtr(value, &intValue);
12320 Set(exp->__anon1.instance->data, intValue);
12321 PopulateInstance(exp->__anon1.instance);
12327 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12329 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12330 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12331 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12332 exp->__anon1.instance->loc = exp->loc;
12334 GetIntSize(value, &intValue);
12335 Set(exp->__anon1.instance->data, intValue);
12336 PopulateInstance(exp->__anon1.instance);
12342 void (* Set)(void *, float) = (void *)prop->Set;
12344 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12345 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12346 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12347 exp->__anon1.instance->loc = exp->loc;
12349 GetFloat(value, &floatValue);
12350 Set(exp->__anon1.instance->data, floatValue);
12351 PopulateInstance(exp->__anon1.instance);
12356 double doubleValue;
12357 void (* Set)(void *, double) = (void *)prop->Set;
12359 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12360 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12361 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12362 exp->__anon1.instance->loc = exp->loc;
12364 GetDouble(value, &doubleValue);
12365 Set(exp->__anon1.instance->data, doubleValue);
12366 PopulateInstance(exp->__anon1.instance);
12371 else if(_class->type == 2)
12377 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12379 if(propertyClass->type == 1 && value->__anon1.instance->data)
12381 unsigned int (* Set)(void *) = (void *)prop->Set;
12382 unsigned int bits = Set(value->__anon1.instance->data);
12384 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12388 else if(_class->type == 2)
12390 unsigned int value;
12391 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12394 GetUInt(exp->__anon1.member.exp, &value);
12396 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12405 if(_class->type == 2)
12407 unsigned int value;
12409 GetUInt(exp->__anon1.member.exp, &value);
12414 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12416 if(_class->type == 1)
12418 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12420 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12421 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12422 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12423 exp->__anon1.instance->loc = exp->loc;
12425 Get(value, exp->__anon1.instance->data);
12426 PopulateInstance(exp->__anon1.instance);
12428 else if(_class->type == 2)
12430 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12431 uint64 bits = Get(value);
12433 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12440 else if(_class->type == 1)
12442 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12448 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12450 if(_class->type == 1 && value)
12452 void (* Get)(void *, void *) = (void *)prop->Get;
12454 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12455 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12456 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12457 exp->__anon1.instance->loc = exp->loc;
12459 Get(value, exp->__anon1.instance->data);
12460 PopulateInstance(exp->__anon1.instance);
12471 exp->isConstant = 0;
12480 FreeExpression(memberExp);
12481 FreeIdentifier(memberID);
12487 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12489 FreeExpContents(exp);
12490 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12497 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12499 if(classSym && classSym->__anon1.registered)
12501 if(classSym->__anon1.registered->fixed)
12503 FreeSpecifier(exp->__anon1._class);
12504 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12509 char className[1024];
12511 strcpy(className, "__ecereClass_");
12512 FullClassNameCat(className, classSym->string, 1);
12513 DeclareClass(classSym, className);
12514 FreeExpContents(exp);
12516 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12517 exp->__anon1.member.member = MkIdentifier("structSize");
12524 struct Type * type;
12525 struct Expression * e = exp;
12527 if(exp->type == 11)
12529 if(exp->__anon1.cast.exp)
12530 ComputeExpression(exp->__anon1.cast.exp);
12531 e = exp->__anon1.cast.exp;
12533 if(e && exp->expType)
12535 type = exp->expType;
12536 if(type->kind == 8)
12538 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12540 if(_class && (_class->type == 3 || _class->type == 2))
12542 if(!_class->dataType)
12543 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12544 type = _class->dataType;
12553 char value = (char)0;
12555 if(GetChar(e, &value))
12557 FreeExpContents(exp);
12558 exp->__anon1.__anon1.constant = PrintChar(value);
12564 unsigned char value = (unsigned char)0;
12566 if(GetUChar(e, &value))
12568 FreeExpContents(exp);
12569 exp->__anon1.__anon1.constant = PrintUChar(value);
12577 short value = (short)0;
12579 if(GetShort(e, &value))
12581 FreeExpContents(exp);
12582 exp->__anon1.__anon1.constant = PrintShort(value);
12588 unsigned short value = (unsigned short)0;
12590 if(GetUShort(e, &value))
12592 FreeExpContents(exp);
12593 exp->__anon1.__anon1.constant = PrintUShort(value);
12603 if(GetInt(e, &value))
12605 FreeExpContents(exp);
12606 exp->__anon1.__anon1.constant = PrintInt(value);
12612 unsigned int value = 0;
12614 if(GetUInt(e, &value))
12616 FreeExpContents(exp);
12617 exp->__anon1.__anon1.constant = PrintUInt(value);
12625 long long value = 0;
12627 if(GetInt64(e, &value))
12629 FreeExpContents(exp);
12630 exp->__anon1.__anon1.constant = PrintInt64(value);
12638 if(GetUInt64(e, &value))
12640 FreeExpContents(exp);
12641 exp->__anon1.__anon1.constant = PrintUInt64(value);
12649 intptr_t value = 0;
12651 if(GetIntPtr(e, &value))
12653 FreeExpContents(exp);
12654 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12660 uintptr_t value = 0;
12662 if(GetUIntPtr(e, &value))
12664 FreeExpContents(exp);
12665 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12675 if(GetIntSize(e, &value))
12677 FreeExpContents(exp);
12678 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12686 if(GetUIntSize(e, &value))
12688 FreeExpContents(exp);
12689 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12698 if(GetFloat(e, &value))
12700 FreeExpContents(exp);
12701 exp->__anon1.__anon1.constant = PrintFloat(value);
12710 if(GetDouble(e, &value))
12712 FreeExpContents(exp);
12713 exp->__anon1.__anon1.constant = PrintDouble(value);
12724 struct Operand op1 =
12731 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12734 struct Operand op2 =
12741 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12744 struct Operand op3 =
12751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 if(exp->__anon1.cond.exp)
12756 ComputeExpression((*exp->__anon1.cond.exp).last);
12757 if(exp->__anon1.cond.elseExp)
12758 ComputeExpression(exp->__anon1.cond.elseExp);
12759 if(exp->__anon1.cond.cond)
12760 ComputeExpression(exp->__anon1.cond.cond);
12761 op1 = GetOperand(exp->__anon1.cond.cond);
12763 op1.type->refCount++;
12764 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12766 op2.type->refCount++;
12767 op3 = GetOperand(exp->__anon1.cond.elseExp);
12769 op3.type->refCount++;
12772 FreeExpContents(exp);
12773 op1.ops.Cond(exp, &op1, &op2, &op3);
12776 FreeType(op1.type);
12778 FreeType(op2.type);
12780 FreeType(op3.type);
12786 void ApplyAnyObjectLogic(struct Expression * e);
12788 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12790 unsigned int result = 1;
12794 struct __ecereNameSpace__ecere__sys__OldList converts =
12798 struct Conversion * convert;
12800 if(destType->kind == 0)
12802 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12806 for(convert = converts.first; convert; convert = convert->next)
12808 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12812 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12813 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12816 newExp->prev = (((void *)0));
12817 newExp->next = (((void *)0));
12818 newExp->destType = (((void *)0));
12822 exp->addedThis = 1;
12823 exp->__anon1.member.exp = newExp;
12824 FreeType(exp->__anon1.member.exp->expType);
12825 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12826 exp->__anon1.member.exp->expType->classObjectType = objectType;
12827 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12828 exp->__anon1.member.memberType = 1;
12829 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12832 exp->expType->refCount++;
12833 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12839 exp->addedThis = 1;
12840 exp->__anon1.member.exp = newExp;
12841 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)
12843 newExp->byReference = 1;
12845 FreeType(exp->__anon1.member.exp->expType);
12846 exp->__anon1.member.exp->expType = (((void *)0));
12847 if(convert->convert->dataType)
12849 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12850 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12851 exp->__anon1.member.exp->expType->refCount = 1;
12852 exp->__anon1.member.exp->expType->classObjectType = objectType;
12853 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12855 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12856 exp->__anon1.member.memberType = 4;
12857 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12859 if(convert->resultType)
12860 convert->resultType->refCount++;
12866 FreeType(exp->expType);
12869 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12870 if(exp->destType->casted)
12873 exp->expType->refCount++;
12877 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12878 if(exp->destType->casted)
12880 if(convert->resultType)
12881 convert->resultType->refCount++;
12885 if(exp->isConstant && inCompiler)
12886 ComputeExpression(exp);
12887 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12889 if(!result && exp->expType && converts.count)
12891 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12893 if(!result && exp->expType && exp->destType)
12895 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))
12902 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12904 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12906 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12908 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12910 void CheckTemplateTypes(struct Expression * exp)
12912 struct Expression * nbExp = GetNonBracketsExp(exp);
12914 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12916 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12917 struct Context * context;
12921 exp->destType->refCount++;
12923 exp->expType->refCount++;
12924 newExp->prev = (((void *)0));
12925 newExp->next = (((void *)0));
12926 switch(exp->expType->kind)
12929 if(exp->destType->classObjectType)
12932 exp->destType->refCount--;
12934 exp->expType->refCount--;
12935 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12939 struct __ecereNameSpace__ecere__sys__OldList * specs;
12940 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12941 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12943 context = PushContext();
12944 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12945 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12946 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12948 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12949 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12950 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12951 exp->__anon1.compound->__anon1.compound.context = context;
12952 PopContext(context);
12957 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12958 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12963 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12965 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12966 struct Context * context;
12970 exp->destType->refCount++;
12972 exp->expType->refCount++;
12973 newExp->prev = (((void *)0));
12974 newExp->next = (((void *)0));
12975 switch(exp->expType->kind)
12978 if(exp->destType->classObjectType)
12981 exp->destType->refCount--;
12983 exp->expType->refCount--;
12984 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12988 struct __ecereNameSpace__ecere__sys__OldList * specs;
12989 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12990 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12992 context = PushContext();
12993 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12994 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12995 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12997 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12998 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12999 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13000 exp->__anon1.compound->__anon1.compound.context = context;
13001 PopContext(context);
13006 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13009 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)));
13010 ProcessExpressionType((*exp->__anon1.list).first);
13016 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13017 exp->needTemplateCast = 2;
13018 newExp->needCast = 1;
13019 newExp->needTemplateCast = 2;
13020 ProcessExpressionType((*exp->__anon1.list).first);
13026 if(exp->expType->kind == 20)
13028 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13032 FreeType(exp->destType);
13033 FreeType(exp->expType);
13034 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13038 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13041 exp->__anon1.op.op = '*';
13042 exp->__anon1.op.exp1 = (((void *)0));
13043 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13047 char typeString[1024];
13048 struct Declarator * decl;
13049 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13051 typeString[0] = '\0';
13052 PrintType(exp->expType, typeString, 0, 0);
13053 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13055 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13056 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13057 exp->__anon1.cast.exp->needCast = 1;
13065 extern int strncmp(const char * , const char * , size_t n);
13067 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
13069 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13071 int nsLen = strlen(nameSpace);
13072 struct Symbol * symbol;
13074 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)))
13076 char * s = symbol->string;
13078 if(!strncmp(s, nameSpace, nsLen))
13083 for(c = strlen(s) - 1; c >= 0; c--)
13086 namePart = s + c + 1;
13087 if(!strcmp(namePart, name))
13095 return (((void *)0));
13098 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13101 char nameSpace[1024];
13102 const char * namePart;
13103 unsigned int gotColon = 0;
13105 nameSpace[0] = '\0';
13106 for(c = strlen(name) - 1; c >= 0; c--)
13112 namePart = name + c + 1;
13113 while(c >= 0 && name[c] == ':')
13117 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13121 memcpy(nameSpace, name, c + 1);
13122 nameSpace[c + 1] = (char)0;
13123 return ScanWithNameSpace(tree, nameSpace, namePart);
13127 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13133 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13137 return ScanWithNameSpace(tree, "", namePart);
13139 return (((void *)0));
13142 static void ProcessDeclaration(struct Declaration * decl);
13144 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13146 struct Context * ctx;
13147 struct Symbol * symbol = (((void *)0));
13149 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13151 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13153 symbol = (((void *)0));
13156 char curName[1024];
13158 strcpy(curName, thisNameSpace);
13159 strcat(curName, "::");
13160 strcat(curName, name);
13161 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13164 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13167 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13168 if(symbol || ctx == endContext)
13171 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13173 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13175 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13176 struct Context * tmpContext = curContext;
13178 curContext = (((void *)0));
13179 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13180 curContext = tmpContext;
13181 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13182 DeclareType(symbol->type, 1, 1);
13183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13184 symbol->id = curExternal->symbol->idCode;
13186 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13189 symbol->id = curExternal->symbol->idCode;
13195 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13197 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13198 ListAdd(specs, MkSpecifier(UNSIGNED));
13203 if(type->__anon1._class->__anon1.registered)
13205 if(!type->__anon1._class->__anon1.registered->dataType)
13206 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13207 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13212 ListAdd(specs, MkSpecifier(DOUBLE));
13215 ListAdd(specs, MkSpecifier(FLOAT));
13218 ListAdd(specs, MkSpecifier(CHAR));
13221 ListAdd(specs, MkSpecifier(_BOOL));
13224 ListAdd(specs, MkSpecifier(SHORT));
13227 ListAdd(specs, MkSpecifier(INT64));
13230 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13233 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13237 ListAdd(specs, MkSpecifier(INT));
13242 static void PrintArraySize(struct Type * arrayType, char * string)
13248 if(arrayType->__anon1.__anon4.enumClass)
13249 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13250 else if(arrayType->__anon1.__anon4.arraySizeExp)
13251 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13253 strcat(string, size);
13256 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13260 if(printConst && type->constant)
13261 strcat(string, "const ");
13266 struct Symbol * c = type->__anon1._class;
13268 if(type->classObjectType == 2)
13269 strcat(string, "typed_object");
13270 else if(type->classObjectType == 3)
13271 strcat(string, "any_object");
13275 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13277 if(type->byReference)
13278 strcat(string, " &");
13282 strcat(string, "void");
13285 strcat(string, type->isSigned ? "int" : "uint");
13288 strcat(string, type->isSigned ? "int64" : "uint64");
13291 strcat(string, type->isSigned ? "intptr" : "uintptr");
13294 strcat(string, type->isSigned ? "intsize" : "uintsize");
13297 strcat(string, type->isSigned ? "char" : "byte");
13300 strcat(string, "_Bool");
13303 strcat(string, type->isSigned ? "short" : "uint16");
13306 strcat(string, "float");
13309 strcat(string, "double");
13312 if(type->__anon1.__anon1.enumName)
13314 strcat(string, "struct ");
13315 strcat(string, type->__anon1.__anon1.enumName);
13317 else if(type->typeName)
13318 strcat(string, type->typeName);
13321 struct Type * member;
13323 strcat(string, "struct { ");
13324 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13326 PrintType(member, string, 1, fullName);
13327 strcat(string, "; ");
13329 strcat(string, "}");
13333 if(type->__anon1.__anon1.enumName)
13335 strcat(string, "union ");
13336 strcat(string, type->__anon1.__anon1.enumName);
13338 else if(type->typeName)
13339 strcat(string, type->typeName);
13342 strcat(string, "union ");
13343 strcat(string, "(unnamed)");
13347 if(type->__anon1.__anon1.enumName)
13349 strcat(string, "enum ");
13350 strcat(string, type->__anon1.__anon1.enumName);
13352 else if(type->typeName)
13353 strcat(string, type->typeName);
13355 strcat(string, "int");
13358 strcat(string, "...");
13361 strcat(string, "subclass(");
13362 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13363 strcat(string, ")");
13366 strcat(string, type->__anon1.templateParameter->identifier->string);
13369 strcat(string, "thisclass");
13372 strcat(string, "__builtin_va_list");
13378 extern char * __ecereNameSpace__ecere__sys__RSearchString(const char * buffer, const char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13380 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13382 if(type->name && type->name[0])
13385 strcat(string, type->name);
13388 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13394 strcat(string, name);
13399 static void PrintAttribs(struct Type * type, char * string)
13403 if(type->dllExport)
13404 strcat(string, "dllexport ");
13405 if(type->attrStdcall)
13406 strcat(string, "stdcall ");
13410 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13412 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13414 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13415 PrintAttribs(type, string);
13416 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13417 strcat(string, " const");
13418 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13419 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13420 strcat(string, " (");
13421 if(type->kind == 13)
13423 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13424 PrintAttribs(type->__anon1.type, string);
13426 if(type->kind == 13)
13428 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13429 strcat(string, "*");
13431 strcat(string, " *");
13433 if(printConst && type->constant && type->kind == 13)
13434 strcat(string, " const");
13437 PrintTypeSpecs(type, string, fullName, printConst);
13440 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13442 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13443 strcat(string, ")");
13444 if(type->kind == 12)
13445 PrintArraySize(type, string);
13446 else if(type->kind == 11)
13448 struct Type * param;
13450 strcat(string, "(");
13451 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13453 PrintType(param, string, 1, fullName);
13455 strcat(string, ", ");
13457 strcat(string, ")");
13459 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13460 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13463 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13465 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13466 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13467 strcat(string, " ");
13468 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13470 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13472 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13474 if(type->classObjectType == 1)
13475 strcat(string, "class");
13477 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13479 else if(_class && _class->string)
13481 char * s = _class->string;
13487 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13493 strcat(string, name);
13496 strcat(string, "::");
13498 if(printName && type->name)
13499 PrintName(type, string, fullName);
13500 PostPrintType(type, string, fullName);
13501 if(type->bitFieldCount)
13505 sprintf(count, ":%d", type->bitFieldCount);
13506 strcat(string, count);
13510 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13512 _PrintType(type, string, printName, fullName, 1);
13515 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13517 _PrintType(type, string, printName, fullName, 0);
13520 static struct Type * FindMember(struct Type * type, char * string)
13522 struct Type * memberType;
13524 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13526 if(!memberType->name)
13528 struct Type * subType = FindMember(memberType, string);
13533 else if(!strcmp(memberType->name, string))
13536 return (((void *)0));
13539 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13541 struct Type * memberType;
13543 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13545 if(!memberType->name)
13547 struct Type * subType = FindMember(memberType, string);
13551 *offset += memberType->offset;
13555 else if(!strcmp(memberType->name, string))
13557 *offset += memberType->offset;
13561 return (((void *)0));
13564 extern unsigned int parseError;
13566 unsigned int GetParseError()
13571 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13573 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13577 struct Expression * ParseExpressionString(char * expression)
13580 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13581 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
13582 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13584 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13585 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13586 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13587 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13589 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13590 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13592 parsedExpression = (((void *)0));
13594 expression_yyparse();
13595 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13596 return parsedExpression;
13599 extern char * QMkString(const char * source);
13601 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13603 struct Identifier * id = exp->__anon1.__anon1.identifier;
13604 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13605 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13606 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13607 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13609 if(_class && _class->type == 4)
13611 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13612 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13616 struct __ecereNameSpace__ecere__com__Class * baseClass;
13618 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13620 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13622 for(value = e->values.first; value; value = value->next)
13624 if(!strcmp(value->name, id->string))
13629 char constant[256];
13631 FreeExpContents(exp);
13633 exp->isConstant = 1;
13634 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13635 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13637 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13638 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13639 exp->expType = MkClassType(baseClass->fullName);
13647 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13649 ProcessMethodType(method);
13650 exp->expType = __extension__ ({
13651 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13653 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13657 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13659 if(!prop->dataType)
13660 ProcessPropertyType(prop);
13661 exp->expType = prop->dataType;
13663 prop->dataType->refCount++;
13666 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13668 if(!member->dataType)
13669 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13670 exp->expType = member->dataType;
13671 if(member->dataType)
13672 member->dataType->refCount++;
13675 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13677 if(!classProp->dataType)
13678 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13679 if(classProp->constant)
13681 FreeExpContents(exp);
13682 exp->isConstant = 1;
13683 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13686 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13690 char constant[256];
13693 sprintf(constant, "%d", (int)classProp->Get(_class));
13694 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13700 exp->expType = classProp->dataType;
13701 if(classProp->dataType)
13702 classProp->dataType->refCount++;
13708 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13710 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13711 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13712 struct __ecereNameSpace__ecere__com__NameSpace * child;
13716 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)))
13718 data = ScanGlobalData(child, name);
13726 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13728 extern char * strncpy(char * , const char * , size_t n);
13730 static struct GlobalData * FindGlobalData(char * name)
13733 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13735 nameSpace = globalData;
13736 for(c = 0; name[c]; c++)
13738 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13740 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13741 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13743 strncpy(spaceName, name + start, c - start);
13744 spaceName[c - start] = '\0';
13745 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13746 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13748 return (((void *)0));
13749 nameSpace = newSpace;
13757 return ScanGlobalData(nameSpace, name + start);
13759 return (((void *)0));
13762 static int definedExpStackPos;
13764 static void * definedExpStack[512];
13766 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13768 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13770 FreeExpContents(checkedExp);
13771 FreeType(checkedExp->expType);
13772 FreeType(checkedExp->destType);
13773 *checkedExp = *newExp;
13774 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13775 checkedExp->prev = prev;
13776 checkedExp->next = next;
13779 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13781 extern int printf(const char * , ...);
13783 void __ecereMethod_Expression_Clear();
13785 void ApplyAnyObjectLogic(struct Expression * e)
13787 struct Type * destType = e->destType;
13789 if(destType && (destType->classObjectType == 3))
13791 if(e && e->expType)
13793 struct Type * type = e->expType;
13794 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13796 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13798 _class = type->__anon1._class->__anon1.registered;
13800 else if(type->kind == 19)
13802 _class = FindClass("ecere::com::Class")->__anon1.registered;
13806 char string[1024] = "";
13807 struct Symbol * classSym;
13809 PrintTypeNoConst(type, string, 0, 1);
13810 classSym = FindClass(string);
13812 _class = classSym->__anon1.registered;
13814 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)))
13816 if(!_class || strcmp(_class->fullName, "char *"))
13818 struct Expression * checkedExp = e, * newExp;
13820 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13822 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13824 if(checkedExp->type == 23)
13826 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13829 checkedExp = (*checkedExp->__anon1.list).last;
13831 else if(checkedExp->type == 11)
13832 checkedExp = checkedExp->__anon1.cast.exp;
13834 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13836 newExp = checkedExp->__anon1.op.exp2;
13837 checkedExp->__anon1.op.exp2 = (((void *)0));
13838 FreeExpContents(checkedExp);
13839 if(e->expType && e->expType->passAsTemplate)
13843 ComputeTypeSize(e->expType);
13844 sprintf(size, "%d", e->expType->size);
13845 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))))));
13847 ReplaceExpContents(checkedExp, newExp);
13848 e->byReference = 1;
13850 else if(!e->byReference || (_class && _class->type == 5))
13852 struct Expression * checkedExp;
13855 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;
13857 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13859 struct Context * context = PushContext();
13860 struct Declarator * decl;
13861 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13862 char typeString[1024];
13863 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13865 typeString[0] = '\0';
13867 newExp->prev = (((void *)0));
13868 newExp->next = (((void *)0));
13869 newExp->expType = (((void *)0));
13870 PrintTypeNoConst(e->expType, typeString, 0, 1);
13871 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13872 newExp->destType = ProcessType(specs, decl);
13873 curContext = context;
13877 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13880 sprintf(name, "__internalValue%03X", internalValueCounter++);
13881 if(!curCompound->__anon1.compound.declarations)
13882 curCompound->__anon1.compound.declarations = MkList();
13883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13884 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13885 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13886 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13889 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13891 struct Type * type = e->destType;
13893 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13894 CopyTypeInto(e->destType, type);
13895 e->destType->refCount = 1;
13896 e->destType->classObjectType = 0;
13899 e->__anon1.compound->__anon1.compound.context = context;
13900 PopContext(context);
13901 curContext = context->parent;
13905 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13907 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13909 if(checkedExp->type == 23)
13911 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13914 checkedExp = (*checkedExp->__anon1.list).last;
13916 else if(checkedExp->type == 11)
13917 checkedExp = checkedExp->__anon1.cast.exp;
13920 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13922 *operand = *checkedExp;
13923 __ecereMethod_Expression_Clear(checkedExp);
13924 checkedExp->destType = ProcessTypeString("void *", 0);
13925 checkedExp->expType = checkedExp->destType;
13926 checkedExp->destType->refCount++;
13927 checkedExp->type = 4;
13928 checkedExp->__anon1.op.op = '&';
13929 checkedExp->__anon1.op.exp1 = (((void *)0));
13930 checkedExp->__anon1.op.exp2 = operand;
13939 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))))
13941 if(e->expType->classObjectType && destType && destType->classObjectType)
13947 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13950 thisExp->prev = (((void *)0));
13951 thisExp->next = (((void *)0));
13952 __ecereMethod_Expression_Clear(e);
13954 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13955 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13956 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13958 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13959 CopyTypeInto(e->expType, thisExp->expType);
13960 e->expType->byReference = 0;
13961 e->expType->refCount = 1;
13962 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))
13964 e->expType->classObjectType = 0;
13969 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13971 if(destType->kind == 14)
13973 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13975 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))
13977 unsigned int byReference = e->expType->byReference;
13978 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13979 struct Declarator * decl;
13980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13981 char typeString[1024];
13982 struct Type * type;
13983 int backupClassObjectType;
13984 unsigned int backupByReference;
13986 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13990 backupClassObjectType = type->classObjectType;
13991 backupByReference = type->byReference;
13992 type->classObjectType = 0;
13993 type->byReference = 0;
13994 typeString[0] = '\0';
13995 PrintType(type, typeString, 0, 1);
13996 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13997 type->classObjectType = backupClassObjectType;
13998 type->byReference = backupByReference;
14000 thisExp->prev = (((void *)0));
14001 thisExp->next = (((void *)0));
14002 __ecereMethod_Expression_Clear(e);
14003 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)))
14006 e->__anon1.op.op = '*';
14007 e->__anon1.op.exp1 = (((void *)0));
14008 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14009 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14010 CopyTypeInto(e->expType, type);
14011 e->expType->byReference = 0;
14012 e->expType->refCount = 1;
14017 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14018 e->__anon1.cast.exp = thisExp;
14019 e->byReference = 1;
14023 e->destType = destType;
14024 destType->refCount++;
14029 void ApplyLocation(struct Expression * exp, struct Location * loc)
14035 if(exp->__anon1.op.exp1)
14036 ApplyLocation(exp->__anon1.op.exp1, loc);
14037 if(exp->__anon1.op.exp2)
14038 ApplyLocation(exp->__anon1.op.exp2, loc);
14041 if(exp->__anon1.list)
14043 struct Expression * e;
14045 for(e = (*exp->__anon1.list).first; e; e = e->next)
14046 ApplyLocation(e, loc);
14050 if(exp->__anon1.index.index)
14052 struct Expression * e;
14054 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14055 ApplyLocation(e, loc);
14057 if(exp->__anon1.index.exp)
14058 ApplyLocation(exp->__anon1.index.exp, loc);
14061 if(exp->__anon1.call.arguments)
14063 struct Expression * arg;
14065 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14066 ApplyLocation(arg, loc);
14068 if(exp->__anon1.call.exp)
14069 ApplyLocation(exp->__anon1.call.exp, loc);
14073 if(exp->__anon1.member.exp)
14074 ApplyLocation(exp->__anon1.member.exp, loc);
14077 if(exp->__anon1.cast.exp)
14078 ApplyLocation(exp->__anon1.cast.exp, loc);
14081 if(exp->__anon1.cond.exp)
14083 struct Expression * e;
14085 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14086 ApplyLocation(e, loc);
14088 if(exp->__anon1.cond.cond)
14089 ApplyLocation(exp->__anon1.cond.cond, loc);
14090 if(exp->__anon1.cond.elseExp)
14091 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14094 if(exp->__anon1.vaArg.exp)
14095 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14102 extern char * strstr(const char * , const char * );
14104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14106 struct __ecereNameSpace__ecere__com__DefinedExpression
14108 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14109 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14111 const char * value;
14112 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
14113 } __attribute__ ((gcc_struct));
14115 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
14117 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
14119 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char * string, int * numBytes);
14121 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14123 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14125 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
14127 static void ProcessStatement(struct Statement * stmt);
14129 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14131 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14133 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14135 extern const char * sourceFile;
14137 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14139 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
14141 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14143 void ProcessExpressionType(struct Expression * exp)
14145 unsigned int unresolved = 0;
14146 struct Location oldyylloc = yylloc;
14147 unsigned int notByReference = 0;
14149 if(!exp || exp->expType)
14156 struct Identifier * id = exp->__anon1.__anon1.identifier;
14158 if(!id || !topContext)
14160 if(id->_class && id->_class->__anon1.__anon1.name)
14162 id->classSym = id->_class->__anon1.__anon1.symbol;
14164 if(!strcmp(id->string, "__runtimePlatform"))
14166 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14169 else if(strstr(id->string, "__ecereClass") == id->string)
14171 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14174 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14176 ReplaceClassMembers(exp, thisClass);
14179 ProcessExpressionType(exp);
14182 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14187 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14191 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14197 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14200 ProcessExpressionType(exp);
14204 else if(currentClass && !id->_class)
14206 if(ResolveIdWithClass(exp, currentClass, 1))
14209 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14214 struct Type * type = symbol->type;
14215 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14217 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14219 struct Context * context = SetupTemplatesContext(_class);
14221 type = ReplaceThisClassType(_class);
14222 FinishTemplatesContext(context);
14224 type->refCount = 0;
14226 FreeSpecifier(id->_class);
14227 id->_class = (((void *)0));
14228 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14229 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14230 id->classSym = (((void *)0));
14231 exp->expType = type;
14234 if(type && (type->kind == 15))
14235 exp->isConstant = 1;
14236 if(symbol->isParam || !strcmp(id->string, "this"))
14238 if(_class && _class->type == 1 && !type->declaredWithStruct)
14239 exp->byReference = 1;
14241 if(symbol->isIterator)
14243 if(symbol->isIterator == 3)
14246 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14247 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14248 exp->expType = (((void *)0));
14249 ProcessExpressionType(exp);
14251 else if(symbol->isIterator != 4)
14254 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14255 exp->__anon1.member.exp->expType = exp->expType;
14256 exp->__anon1.member.member = MkIdentifier("data");
14257 exp->expType = (((void *)0));
14258 ProcessExpressionType(exp);
14265 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14267 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14271 strcpy(name, thisNameSpace);
14272 strcat(name, "::");
14273 strcat(name, id->string);
14274 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14277 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14282 for(c = 0; c < definedExpStackPos; c++)
14283 if(definedExpStack[c] == definedExp)
14285 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14287 struct Location backupYylloc = yylloc;
14288 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14290 definedExpStack[definedExpStackPos++] = definedExp;
14291 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14292 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
14293 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14295 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14296 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14297 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14298 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14300 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14301 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14303 parsedExpression = (((void *)0));
14305 expression_yyparse();
14306 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14308 fileInput = backInput;
14309 yylloc = backupYylloc;
14310 if(parsedExpression)
14312 FreeIdentifier(id);
14314 exp->__anon1.list = MkListOne(parsedExpression);
14315 ApplyLocation(parsedExpression, &yylloc);
14316 ProcessExpressionType(exp);
14317 definedExpStackPos--;
14320 definedExpStackPos--;
14326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14332 struct GlobalData * data = (((void *)0));
14334 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14338 strcpy(name, thisNameSpace);
14339 strcat(name, "::");
14340 strcat(name, id->string);
14341 data = FindGlobalData(name);
14344 data = FindGlobalData(id->string);
14347 DeclareGlobalData(data);
14348 exp->expType = data->dataType;
14350 data->dataType->refCount++;
14351 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14352 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14353 FreeSpecifier(id->_class);
14354 id->_class = (((void *)0));
14359 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14361 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14365 strcpy(name, thisNameSpace);
14366 strcat(name, "::");
14367 strcat(name, id->string);
14368 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14371 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14376 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14377 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14379 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14380 strcpy(name, "__ecereFunction_");
14381 FullClassNameCat(name, id->string, 0);
14382 if(DeclareFunction(function, name))
14384 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14385 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14387 exp->expType = function->dataType;
14388 if(function->dataType)
14389 function->dataType->refCount++;
14390 FreeSpecifier(id->_class);
14391 id->_class = (((void *)0));
14403 if(!exp->__anon1.instance->_class)
14405 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14407 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14410 ProcessInstantiationType(exp->__anon1.instance);
14411 exp->isConstant = exp->__anon1.instance->isConstant;
14412 if(exp->__anon1.instance->_class)
14414 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14422 char * constant = exp->__anon1.__anon1.constant;
14423 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14425 exp->expType = type;
14426 if(constant[0] == '\'')
14428 if((int)((unsigned char *)constant)[1] > 127)
14431 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14435 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14436 exp->__anon1.__anon1.constant = PrintUInt(ch);
14438 type->__anon1._class = FindClass("unichar");
14439 type->isSigned = 0;
14444 type->isSigned = 1;
14449 char * dot = strchr(constant, '.');
14450 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14455 exponent = strchr(constant, 'p');
14457 exponent = strchr(constant, 'P');
14461 exponent = strchr(constant, 'e');
14463 exponent = strchr(constant, 'E');
14465 if(dot || exponent)
14467 if(strchr(constant, 'f') || strchr(constant, 'F'))
14471 type->isSigned = 1;
14475 unsigned int isSigned = constant[0] == '-';
14476 char * endP = (((void *)0));
14477 long long i64 = strtoll(constant, &endP, 0);
14478 uint64 ui64 = strtoull(constant, &endP, 0);
14479 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14483 if(i64 < (((int)0x80000000)))
14488 if(ui64 > (((int)0x7fffffff)))
14490 if(ui64 > (0xffffffff))
14493 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14497 else if(constant[0] != '0' || !constant[1])
14500 type->kind = is64Bit ? 4 : 3;
14501 type->isSigned = isSigned;
14504 exp->isConstant = 1;
14505 if(exp->destType && exp->destType->kind == 7)
14507 else if(exp->destType && exp->destType->kind == 6)
14509 else if(exp->destType && exp->destType->kind == 4)
14516 exp->isConstant = 1;
14517 exp->expType = __extension__ ({
14518 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14520 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14521 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14523 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14524 }), __ecereInstance2;
14530 ProcessExpressionType(exp->__anon1._new.size);
14531 exp->expType = __extension__ ({
14532 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14534 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14536 DeclareType(exp->expType->__anon1.type, 0, 0);
14540 ProcessExpressionType(exp->__anon1._renew.size);
14541 ProcessExpressionType(exp->__anon1._renew.exp);
14542 exp->expType = __extension__ ({
14543 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14545 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14547 DeclareType(exp->expType->__anon1.type, 0, 0);
14551 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14552 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14553 unsigned int useDestType = 0, useSideType = 0;
14554 struct Location oldyylloc = yylloc;
14555 unsigned int useSideUnit = 0;
14556 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14557 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14559 switch(exp->__anon1.op.op)
14613 if(exp->__anon1.op.exp1)
14620 if(exp->__anon1.op.op == '&')
14622 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14624 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14625 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14627 if(symbol && symbol->isIterator == 2)
14630 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14631 exp->__anon1.member.member = MkIdentifier("key");
14632 exp->expType = (((void *)0));
14633 exp->__anon1.op.exp2->expType = symbol->type;
14634 symbol->type->refCount++;
14635 ProcessExpressionType(exp);
14641 if(exp->__anon1.op.exp1)
14643 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14645 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14647 if(exp->__anon1.op.exp1->destType)
14648 FreeType(exp->__anon1.op.exp1->destType);
14649 exp->__anon1.op.exp1->destType = exp->destType;
14650 exp->__anon1.op.exp1->opDestType = 1;
14652 exp->destType->refCount++;
14656 if(exp->__anon1.op.exp1->destType)
14657 FreeType(exp->__anon1.op.exp1->destType);
14658 exp->__anon1.op.exp1->destType = dummy;
14661 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14662 exp->__anon1.op.exp1->destType->count++;
14663 ProcessExpressionType(exp->__anon1.op.exp1);
14664 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14665 exp->__anon1.op.exp1->destType->count--;
14666 exp->__anon1.op.exp1->opDestType = 0;
14667 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)
14669 exp->__anon1.op.exp2 = MkExpConstant("1");
14670 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14673 if(exp->__anon1.op.exp1->destType == dummy)
14676 exp->__anon1.op.exp1->destType = (((void *)0));
14678 type1 = exp->__anon1.op.exp1->expType;
14680 if(exp->__anon1.op.exp2)
14682 char expString[10240];
14684 expString[0] = '\0';
14685 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14687 if(exp->__anon1.op.exp1)
14689 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14690 if(exp->__anon1.op.exp1->expType)
14691 exp->__anon1.op.exp1->expType->refCount++;
14695 exp->__anon1.op.exp2->destType = exp->destType;
14696 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14697 exp->__anon1.op.exp2->opDestType = 1;
14699 exp->destType->refCount++;
14703 exp->expType = type1;
14708 PrintExpression(exp->__anon1.op.exp2, expString);
14709 if(type1 && type1->kind == 13)
14711 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)
14712 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14713 else if(exp->__anon1.op.op == '=')
14715 if(exp->__anon1.op.exp2->destType)
14716 FreeType(exp->__anon1.op.exp2->destType);
14717 exp->__anon1.op.exp2->destType = type1;
14724 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)
14728 if(exp->__anon1.op.exp2->destType)
14729 FreeType(exp->__anon1.op.exp2->destType);
14730 exp->__anon1.op.exp2->destType = type1;
14737 exp->expType = type1;
14739 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14741 if(exp->__anon1.op.exp2->destType)
14742 FreeType(exp->__anon1.op.exp2->destType);
14743 exp->__anon1.op.exp2->destType = exp->destType;
14744 if(exp->__anon1.op.op != '&')
14745 exp->__anon1.op.exp2->opDestType = 1;
14747 exp->destType->refCount++;
14751 if(exp->__anon1.op.exp2->destType)
14752 FreeType(exp->__anon1.op.exp2->destType);
14753 exp->__anon1.op.exp2->destType = dummy;
14756 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))
14758 FreeType(exp->__anon1.op.exp2->destType);
14759 exp->__anon1.op.exp2->destType = type1;
14762 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14763 exp->__anon1.op.exp2->destType->count++;
14764 if(exp->__anon1.op.op == SIZEOF)
14766 struct Expression * e = exp->__anon1.op.exp2;
14768 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14770 if(e->type == 5 || e->type == 32 || e->type == 23)
14773 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14775 e = (*e->__anon1.list).last;
14778 if(e->type == 11 && e->__anon1.cast.exp)
14779 e->__anon1.cast.exp->needCast = 1;
14781 ProcessExpressionType(exp->__anon1.op.exp2);
14782 exp->__anon1.op.exp2->opDestType = 0;
14783 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14784 exp->__anon1.op.exp2->destType->count--;
14785 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14787 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)
14789 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14792 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)))
14794 if(exp->__anon1.op.op == ADD_ASSIGN)
14795 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14797 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))
14799 if(exp->__anon1.op.op == ADD_ASSIGN)
14800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14802 else if(inCompiler)
14804 char type1String[1024];
14805 char type2String[1024];
14807 type1String[0] = '\0';
14808 type2String[0] = '\0';
14809 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14810 PrintType(type1, type2String, 0, 1);
14811 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14812 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14815 if(exp->__anon1.op.exp2->destType == dummy)
14818 exp->__anon1.op.exp2->destType = (((void *)0));
14820 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14822 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14823 type2->refCount = 1;
14824 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14825 type2->isSigned = 1;
14827 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))
14829 type2 = __extension__ ({
14830 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14832 __ecereInstance1->kind = 3, __ecereInstance1;
14834 type2->refCount = 1;
14835 type2->isSigned = 1;
14839 type2 = exp->__anon1.op.exp2->expType;
14845 if(exp->__anon1.op.op == SIZEOF)
14847 exp->expType = __extension__ ({
14848 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14850 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14852 exp->isConstant = 1;
14854 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14856 exp->expType = Dereference(type2);
14857 if(type2 && type2->kind == 8)
14858 notByReference = 1;
14860 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14861 exp->expType = Reference(type2);
14866 if(exp->__anon1.op.exp1)
14868 if(exp->__anon1.op.exp1->destType)
14869 FreeType(exp->__anon1.op.exp1->destType);
14870 exp->__anon1.op.exp1->destType = MkClassType("bool");
14871 exp->__anon1.op.exp1->destType->truth = 1;
14872 if(!exp->__anon1.op.exp1->expType)
14873 ProcessExpressionType(exp->__anon1.op.exp1);
14875 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14876 FreeType(exp->__anon1.op.exp1->expType);
14877 exp->__anon1.op.exp1->expType = MkClassType("bool");
14878 exp->__anon1.op.exp1->expType->truth = 1;
14880 if(exp->__anon1.op.exp2)
14882 if(exp->__anon1.op.exp2->destType)
14883 FreeType(exp->__anon1.op.exp2->destType);
14884 exp->__anon1.op.exp2->destType = MkClassType("bool");
14885 exp->__anon1.op.exp2->destType->truth = 1;
14886 if(!exp->__anon1.op.exp2->expType)
14887 ProcessExpressionType(exp->__anon1.op.exp2);
14889 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14890 FreeType(exp->__anon1.op.exp2->expType);
14891 exp->__anon1.op.exp2->expType = MkClassType("bool");
14892 exp->__anon1.op.exp2->expType->truth = 1;
14895 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")))))
14897 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"))))
14899 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)))
14901 struct Type * intType;
14903 if(!type1->__anon1._class->__anon1.registered->dataType)
14904 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14905 if(!type2->__anon1._class->__anon1.registered->dataType)
14906 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14907 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14908 if(exp->__anon1.op.exp1->destType)
14909 FreeType(exp->__anon1.op.exp1->destType);
14910 if(exp->__anon1.op.exp2->destType)
14911 FreeType(exp->__anon1.op.exp2->destType);
14912 exp->__anon1.op.exp1->destType = intType;
14913 exp->__anon1.op.exp2->destType = intType;
14914 intType->refCount++;
14918 if(exp->__anon1.op.exp2->destType)
14919 FreeType(exp->__anon1.op.exp2->destType);
14920 exp->__anon1.op.exp2->destType = type1;
14922 if(exp->__anon1.op.exp1->destType)
14923 FreeType(exp->__anon1.op.exp1->destType);
14924 exp->__anon1.op.exp1->destType = type2;
14927 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)
14928 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);
14929 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14931 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14935 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14937 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14938 ProcessExpressionType(exp->__anon1.op.exp1);
14939 if(type2->kind != 13)
14941 ProcessExpressionType(classExp);
14942 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14943 if(!exp->__anon1.op.exp2->expType)
14947 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14950 ProcessExpressionType(exp->__anon1.op.exp2);
14954 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)))
14956 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14958 exp->expType = type1;
14962 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)))
14964 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14965 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14966 exp->expType = type2;
14970 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))
14972 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14976 unsigned int success = 0;
14978 if(type1->kind == 13 && type2->kind == 13)
14980 if(exp->__anon1.op.op == '+')
14981 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14982 else if(exp->__anon1.op.op == '-')
14984 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
14986 exp->expType = __extension__ ({
14987 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14989 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14992 if(type1->__anon1.type->kind == 20)
14994 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14998 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15000 ProcessExpressionType(classExp);
15002 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"))));
15003 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15011 if(!success && exp->__anon1.op.exp1->type == 2)
15013 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15016 FreeType(exp->expType);
15017 exp->expType = exp->__anon1.op.exp1->destType;
15018 if(exp->__anon1.op.exp1->destType)
15019 exp->__anon1.op.exp1->destType->refCount++;
15022 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15025 FreeType(exp->expType);
15026 exp->expType = exp->__anon1.op.exp2->destType;
15027 if(exp->__anon1.op.exp2->destType)
15028 exp->__anon1.op.exp2->destType->refCount++;
15034 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15037 FreeType(exp->expType);
15038 exp->expType = exp->__anon1.op.exp2->destType;
15039 if(exp->__anon1.op.exp2->destType)
15040 exp->__anon1.op.exp2->destType->refCount++;
15043 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15046 FreeType(exp->expType);
15047 exp->expType = exp->__anon1.op.exp1->destType;
15048 if(exp->__anon1.op.exp1->destType)
15049 exp->__anon1.op.exp1->destType->refCount++;
15055 char expString1[10240];
15056 char expString2[10240];
15060 expString1[0] = '\0';
15061 expString2[0] = '\0';
15066 PrintExpression(exp->__anon1.op.exp1, expString1);
15067 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15068 PrintExpression(exp->__anon1.op.exp2, expString2);
15069 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15070 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15071 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15073 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15077 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)
15079 if(exp->__anon1.op.exp1->destType)
15080 FreeType(exp->__anon1.op.exp1->destType);
15081 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15082 if(type2->__anon1._class->__anon1.registered->dataType)
15083 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15084 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15085 exp->expType = type2;
15089 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)
15091 if(exp->__anon1.op.exp2->destType)
15092 FreeType(exp->__anon1.op.exp2->destType);
15093 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15094 if(type1->__anon1._class->__anon1.registered->dataType)
15095 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15096 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15097 exp->expType = type1;
15103 unsigned int valid = 0;
15105 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15107 if(exp->__anon1.op.exp2->destType)
15108 FreeType(exp->__anon1.op.exp2->destType);
15109 if(!type1->__anon1._class->__anon1.registered->dataType)
15110 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15111 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15112 exp->__anon1.op.exp2->destType->refCount++;
15113 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15116 type2 = exp->__anon1.op.exp2->destType;
15119 exp->expType = type2;
15122 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15124 if(exp->__anon1.op.exp1->destType)
15125 FreeType(exp->__anon1.op.exp1->destType);
15126 if(!type2->__anon1._class->__anon1.registered->dataType)
15127 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15128 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15129 exp->__anon1.op.exp1->destType->refCount++;
15130 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15131 type1 = exp->__anon1.op.exp1->destType;
15132 exp->expType = type1;
15135 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15137 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15138 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15140 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15142 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15144 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15147 FreeType(exp->expType);
15148 exp->expType = exp->__anon1.op.exp2->expType;
15149 if(exp->__anon1.op.exp2->expType)
15150 exp->__anon1.op.exp2->expType->refCount++;
15154 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15156 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15159 FreeType(exp->expType);
15160 exp->expType = exp->__anon1.op.exp1->expType;
15161 if(exp->__anon1.op.exp1->expType)
15162 exp->__anon1.op.exp1->expType->refCount++;
15169 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15171 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->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++;
15181 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15183 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15186 FreeType(exp->expType);
15187 exp->expType = exp->__anon1.op.exp2->expType;
15188 if(exp->__anon1.op.exp2->expType)
15189 exp->__anon1.op.exp2->expType->refCount++;
15197 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))
15199 if(exp->__anon1.op.exp1->destType)
15200 FreeType(exp->__anon1.op.exp1->destType);
15201 exp->__anon1.op.exp1->destType = type2;
15203 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15206 FreeType(exp->expType);
15207 exp->expType = exp->__anon1.op.exp1->destType;
15208 if(exp->__anon1.op.exp1->destType)
15209 exp->__anon1.op.exp1->destType->refCount++;
15214 if(exp->__anon1.op.exp2->destType)
15215 FreeType(exp->__anon1.op.exp2->destType);
15216 exp->__anon1.op.exp2->destType = type1;
15218 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15221 FreeType(exp->expType);
15222 exp->expType = exp->__anon1.op.exp2->destType;
15223 if(exp->__anon1.op.exp2->destType)
15224 exp->__anon1.op.exp2->destType->refCount++;
15226 else if(type1 && type2)
15228 char expString1[10240];
15229 char expString2[10240];
15230 char type1String[1024];
15231 char type2String[1024];
15233 expString1[0] = '\0';
15234 expString2[0] = '\0';
15235 type1String[0] = '\0';
15236 type2String[0] = '\0';
15239 PrintExpression(exp->__anon1.op.exp1, expString1);
15240 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15241 PrintExpression(exp->__anon1.op.exp2, expString2);
15242 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15243 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15244 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15246 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15247 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15249 exp->expType = exp->__anon1.op.exp1->expType;
15250 if(exp->__anon1.op.exp1->expType)
15251 exp->__anon1.op.exp1->expType->refCount++;
15253 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15255 exp->expType = exp->__anon1.op.exp2->expType;
15256 if(exp->__anon1.op.exp2->expType)
15257 exp->__anon1.op.exp2->expType->refCount++;
15265 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15267 struct Type * oldType = exp->__anon1.op.exp1->expType;
15269 exp->__anon1.op.exp1->expType = (((void *)0));
15270 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15273 exp->__anon1.op.exp1->expType = oldType;
15275 if(exp->__anon1.op.exp1->destType)
15276 FreeType(exp->__anon1.op.exp1->destType);
15277 exp->__anon1.op.exp1->destType = type2;
15279 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15282 FreeType(exp->expType);
15283 exp->expType = exp->__anon1.op.exp1->destType;
15284 if(exp->__anon1.op.exp1->destType)
15285 exp->__anon1.op.exp1->destType->refCount++;
15289 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15291 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15293 if(exp->__anon1.op.exp1->destType)
15294 FreeType(exp->__anon1.op.exp1->destType);
15295 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15296 if(type2->__anon1._class->__anon1.registered->dataType)
15297 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15298 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15300 if(exp->__anon1.op.op == '!')
15302 exp->expType = MkClassType("bool");
15303 exp->expType->truth = 1;
15307 exp->expType = type2;
15312 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15314 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15316 if(exp->__anon1.op.exp2->destType)
15317 FreeType(exp->__anon1.op.exp2->destType);
15318 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15319 if(type1->__anon1._class->__anon1.registered->dataType)
15320 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15321 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15323 exp->expType = type1;
15329 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15331 char expString[10000];
15333 expString[0] = '\0';
15336 PrintExpression(exp->__anon1.op.exp1, expString);
15337 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15342 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15344 char expString[10240];
15346 expString[0] = '\0';
15349 PrintExpression(exp->__anon1.op.exp2, expString);
15350 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15353 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15357 FreeType(exp->expType);
15358 exp->expType = MkClassType("bool");
15359 exp->expType->truth = 1;
15361 if(exp->__anon1.op.op != SIZEOF)
15362 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15363 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15365 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15367 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15368 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15369 yylloc = oldyylloc;
15378 struct Expression * e;
15380 exp->isConstant = 1;
15381 for(e = (*exp->__anon1.list).first; e; e = e->next)
15383 unsigned int inced = 0;
15387 FreeType(e->destType);
15388 e->opDestType = exp->opDestType;
15389 e->destType = exp->destType;
15392 exp->destType->refCount++;
15393 e->destType->count++;
15397 ProcessExpressionType(e);
15399 exp->destType->count--;
15400 if(!exp->expType && !e->next)
15402 exp->expType = e->expType;
15404 e->expType->refCount++;
15407 exp->isConstant = 0;
15409 e = (*exp->__anon1.list).first;
15410 if(!e->next && e->type == 8)
15412 struct Expression * next = exp->next, * prev = exp->prev;
15414 FreeType(exp->expType);
15415 FreeType(exp->destType);
15416 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15420 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15421 ProcessExpressionType(exp);
15427 struct Expression * e;
15429 exp->isConstant = 1;
15430 ProcessExpressionType(exp->__anon1.index.exp);
15431 if(!exp->__anon1.index.exp->isConstant)
15432 exp->isConstant = 0;
15433 if(exp->__anon1.index.exp->expType)
15435 struct Type * source = exp->__anon1.index.exp->expType;
15437 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15439 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15440 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15442 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15444 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15445 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15447 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15449 if(type->kind == 8)
15450 type->constant = 1;
15451 else if(type->kind == 13)
15453 struct Type * t = type;
15455 while(t->kind == 13)
15456 t = t->__anon1.type;
15459 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15464 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15466 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15469 FreeType(e->destType);
15470 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15472 ProcessExpressionType(e);
15477 exp->isConstant = 0;
15480 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15482 DeclareType(exp->expType, 0, 0);
15487 struct Expression * e;
15488 struct Type * functionType;
15489 struct Type * methodType = (((void *)0));
15495 PrintExpression(exp->__anon1.call.exp, name);
15496 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15498 PrintExpression(exp->__anon1.call.exp, name);
15501 if(exp->__anon1.call.exp->type == 0)
15503 struct Expression * idExp = exp->__anon1.call.exp;
15504 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15506 if(!strcmp(id->string, "__builtin_frame_address"))
15508 exp->expType = ProcessTypeString("void *", 1);
15509 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15510 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15513 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15515 exp->expType = ProcessTypeString("int", 1);
15516 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15517 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15520 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15522 struct Expression * a = (((void *)0));
15523 struct Expression * b = (((void *)0));
15524 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15526 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15528 a = (*exp->__anon1.call.arguments).first;
15529 b = (*exp->__anon1.call.arguments).last;
15533 else if((*exp->__anon1.call.arguments).count == 1)
15535 a = (*exp->__anon1.call.arguments).first;
15540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15541 idExp->__anon1.__anon1.identifier = (((void *)0));
15542 FreeExpContents(exp);
15543 ProcessExpressionType(a);
15545 ProcessExpressionType(b);
15547 exp->__anon1.list = MkList();
15548 if(a->expType && (!b || b->expType))
15550 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15555 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15556 struct Declaration * decl;
15557 char temp1[1024], temp2[1024];
15559 GetTypeSpecs(a->expType, specs);
15560 if(a && !a->isConstant && a->type != 0)
15562 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15563 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15564 tempExp1 = QMkExpId(temp1);
15565 tempExp1->expType = a->expType;
15567 a->expType->refCount++;
15568 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15570 if(b && !b->isConstant && b->type != 0)
15572 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15573 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15574 tempExp2 = QMkExpId(temp2);
15575 tempExp2->expType = b->expType;
15577 b->expType->refCount++;
15578 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15580 decl = MkDeclaration(specs, decls);
15581 if(!curCompound->__anon1.compound.declarations)
15582 curCompound->__anon1.compound.declarations = MkList();
15583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15587 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15589 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15591 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15592 exp->expType = a->expType;
15594 a->expType->refCount++;
15596 else if(!strcmp(id->string, "Abs"))
15598 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15599 exp->expType = a->expType;
15601 a->expType->refCount++;
15603 else if(!strcmp(id->string, "Sgn"))
15605 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"))))));
15606 exp->expType = ProcessTypeString("int", 0);
15608 FreeExpression(tempExp1);
15610 FreeExpression(tempExp2);
15611 FreeIdentifier(id);
15617 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15619 if(!exp->__anon1.call.exp->destType)
15621 exp->__anon1.call.exp->destType = dummy;
15624 ProcessExpressionType(exp->__anon1.call.exp);
15625 if(exp->__anon1.call.exp->destType == dummy)
15628 exp->__anon1.call.exp->destType = (((void *)0));
15632 functionType = exp->__anon1.call.exp->expType;
15633 if(functionType && functionType->kind == 16)
15635 methodType = functionType;
15636 functionType = methodType->__anon1.__anon3.method->dataType;
15637 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15639 char typeString[1024];
15641 typeString[0] = '\0';
15643 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15645 functionType->__anon1.__anon2.thisClass = (((void *)0));
15646 PrintType(functionType, typeString, 1, 1);
15647 functionType->__anon1.__anon2.thisClass = back;
15649 if(strstr(typeString, "thisclass"))
15651 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15652 struct Declarator * decl;
15655 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15657 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15658 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))
15659 thisClassParams = 0;
15660 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15662 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15664 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15665 ProcessDeclarator(decl);
15666 thisClass = backupThisClass;
15668 thisClassParams = 1;
15669 functionType = ProcessType(specs, decl);
15670 functionType->refCount = 0;
15671 FinishTemplatesContext(context);
15673 FreeList(specs, FreeSpecifier);
15674 FreeDeclarator(decl);
15678 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15680 struct Type * type = functionType->__anon1.type;
15682 if(!functionType->refCount)
15684 functionType->__anon1.type = (((void *)0));
15685 FreeType(functionType);
15687 functionType = type;
15689 if(functionType && functionType->kind != 11)
15691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15693 else if(functionType)
15695 unsigned int emptyParams = 0, noParams = 0;
15696 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15697 struct Type * type = functionType->__anon1.__anon2.params.first;
15698 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15700 struct Location oldyylloc = yylloc;
15704 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15706 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15709 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15711 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)
15713 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15716 e->destType = type;
15718 type = functionType->__anon1.__anon2.params.first;
15721 type->refCount = 0;
15723 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15725 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15726 type->byReference = functionType->byReference;
15727 type->typedByReference = functionType->typedByReference;
15730 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15732 e->destType = type;
15734 type = functionType->__anon1.__anon2.params.first;
15737 type->refCount = 0;
15740 if(type && type->kind == 0)
15743 if(!type->refCount)
15745 type = (((void *)0));
15747 for(; e; e = e->next)
15749 if(!type && !emptyParams)
15752 if(methodType && methodType->__anon1.__anon3.methodClass)
15753 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);
15755 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);
15758 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15760 struct Type * templatedType = (((void *)0));
15761 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15762 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15765 if(_class && _class->templateArgs)
15767 struct __ecereNameSpace__ecere__com__Class * sClass;
15769 for(sClass = _class; sClass; sClass = sClass->base)
15771 if(sClass->templateClass)
15772 sClass = sClass->templateClass;
15774 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15776 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15778 struct __ecereNameSpace__ecere__com__Class * nextClass;
15780 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15782 if(nextClass->templateClass)
15783 nextClass = nextClass->templateClass;
15784 id += nextClass->templateParams.count;
15794 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15796 unsigned int constant = type->constant;
15797 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15800 struct Context * context = SetupTemplatesContext(_class);
15802 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15803 FinishTemplatesContext(context);
15805 if(templatedType->kind == 8 && constant)
15806 templatedType->constant = 1;
15807 else if(templatedType->kind == 13)
15809 struct Type * t = templatedType->__anon1.type;
15811 while(t->kind == 13)
15812 t = t->__anon1.type;
15814 t->constant = constant;
15816 e->destType = templatedType;
15819 templatedType->passAsTemplate = 1;
15824 e->destType = type;
15831 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15833 e->destType = type->prev;
15834 e->destType->refCount++;
15838 e->destType = type;
15843 if(type && type->kind != 14)
15845 struct Type * next = type->next;
15847 if(!type->refCount)
15852 if(type && type->kind != 14)
15854 if(methodType && methodType->__anon1.__anon3.methodClass)
15855 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);
15857 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);
15859 yylloc = oldyylloc;
15860 if(type && !type->refCount)
15865 functionType = __extension__ ({
15866 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15868 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15870 if(exp->__anon1.call.exp->type == 0)
15872 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15876 struct Symbol * symbol;
15877 struct Location oldyylloc = yylloc;
15879 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15880 if(strstr(string, "__builtin_") == string)
15884 functionType->__anon1.__anon2.returnType = exp->destType;
15885 exp->destType->refCount++;
15889 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15890 symbol = __extension__ ({
15891 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15893 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15895 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15896 if(strstr(symbol->string, "::"))
15897 globalContext->hasNameSpace = 1;
15898 yylloc = oldyylloc;
15901 else if(exp->__anon1.call.exp->type == 8)
15905 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15906 if(!functionType->__anon1.__anon2.returnType)
15908 functionType->__anon1.__anon2.returnType = __extension__ ({
15909 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15911 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15915 if(functionType && functionType->kind == 11)
15917 exp->expType = functionType->__anon1.__anon2.returnType;
15918 if(functionType->__anon1.__anon2.returnType)
15919 functionType->__anon1.__anon2.returnType->refCount++;
15920 if(!functionType->refCount)
15921 FreeType(functionType);
15923 if(exp->__anon1.call.arguments)
15925 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15926 ProcessExpressionType(e);
15932 struct Type * type;
15933 struct Location oldyylloc = yylloc;
15934 unsigned int thisPtr;
15935 struct Expression * checkExp = exp->__anon1.member.exp;
15939 if(checkExp->type == 11)
15940 checkExp = checkExp->__anon1.cast.exp;
15941 else if(checkExp->type == 5)
15942 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15946 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15947 exp->thisPtr = thisPtr;
15948 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15950 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15952 ProcessExpressionType(exp->__anon1.member.exp);
15953 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)
15955 exp->isConstant = 0;
15958 exp->isConstant = exp->__anon1.member.exp->isConstant;
15959 type = exp->__anon1.member.exp->expType;
15961 if(type && (type->kind == 20))
15963 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15964 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15968 for(param = _class->templateParams.first; param; param = param->next)
15970 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15974 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15976 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15980 struct Expression * expMember = exp->__anon1.member.exp;
15981 struct Declarator * decl;
15982 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15983 char thisClassTypeString[1024];
15985 FreeIdentifier(exp->__anon1.member.member);
15986 ProcessExpressionType(argExp);
15988 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15992 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15993 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15996 strcpy(thisClassTypeString, _class->fullName);
15998 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15999 exp->expType = ProcessType(specs, decl);
16000 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16002 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16003 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16004 int paramCount = 0;
16005 int lastParam = -1;
16006 char templateString[1024];
16007 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16009 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16010 for(cClass = expClass; cClass; cClass = cClass->base)
16014 for(param = cClass->templateParams.first; param; param = param->next)
16017 struct __ecereNameSpace__ecere__com__Class * sClass;
16018 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16020 for(sClass = cClass->base; sClass; sClass = sClass->base)
16021 id += sClass->templateParams.count;
16022 arg = expClass->templateArgs[id];
16023 for(sClass = _class; sClass; sClass = sClass->base)
16025 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16027 struct __ecereNameSpace__ecere__com__Class * nextClass;
16029 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16030 p += nextClass->templateParams.count;
16031 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16033 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16035 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16037 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16038 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16045 char argument[256];
16047 argument[0] = '\0';
16048 switch(param->type)
16052 char expString[1024];
16053 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16054 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16055 struct Expression * exp;
16056 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16058 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16059 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16060 ProcessExpressionType(exp);
16061 ComputeExpression(exp);
16062 expString[0] = '\0';
16063 PrintExpression(exp, expString);
16064 strcat(argument, expString);
16065 FreeExpression(exp);
16070 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16075 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16077 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16078 strcat(argument, thisClassTypeString);
16080 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16088 strcat(templateString, ", ");
16089 if(lastParam != p - 1)
16091 strcat(templateString, param->name);
16092 strcat(templateString, " = ");
16094 strcat(templateString, argument);
16103 int len = strlen(templateString);
16105 if(templateString[len - 1] == '>')
16106 templateString[len++] = ' ';
16107 templateString[len++] = '>';
16108 templateString[len++] = '\0';
16111 struct Context * context = SetupTemplatesContext(_class);
16113 FreeType(exp->expType);
16114 exp->expType = ProcessTypeString(templateString, 0);
16115 FinishTemplatesContext(context);
16119 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")))))))));
16122 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16124 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16127 if(type && (type->kind == 20))
16129 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)))
16131 struct Identifier * id = exp->__anon1.member.member;
16132 int typeKind = type->kind;
16133 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));
16135 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16137 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16142 if(typeKind == 3 || typeKind == 15)
16143 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16146 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16148 _class = type->__anon1._class->__anon1.registered;
16150 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16152 _class = FindClass("char *")->__anon1.registered;
16154 else if(type->kind == 13)
16156 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16157 FreeType(exp->expType);
16158 exp->expType = ProcessTypeString("uintptr", 0);
16159 exp->byReference = 1;
16163 char string[1024] = "";
16164 struct Symbol * classSym;
16166 PrintTypeNoConst(type, string, 0, 1);
16167 classSym = FindClass(string);
16169 _class = classSym->__anon1.registered;
16175 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16176 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16177 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16178 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16179 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16181 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16182 exp->__anon1.member.memberType = 1;
16183 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16187 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16189 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16190 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16192 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16194 member = (((void *)0));
16196 if(!member && !prop)
16197 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16198 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16199 exp->__anon1.member.thisPtr = 1;
16203 unsigned int useMemberForNonConst = 0;
16207 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16208 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);
16209 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16210 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16212 if((!prop || useMemberForNonConst) && !member)
16214 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16217 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16218 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);
16219 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16220 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16225 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16226 prop = (((void *)0));
16228 member = (((void *)0));
16232 if(!prop && !member && !method)
16233 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16234 if(!prop && !member && !method)
16238 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16241 exp->__anon1.member.memberType = 5;
16242 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16246 char structName[1024];
16247 struct Identifier * id = exp->__anon1.member.member;
16248 struct Expression * classExp = exp->__anon1.member.exp;
16251 FreeType(classExp->expType);
16252 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16253 strcpy(structName, "__ecereClassData_");
16254 FullClassNameCat(structName, type->__anon1._class->string, 0);
16256 exp->__anon1.member.member = id;
16257 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"))))))));
16259 ProcessExpressionType(exp);
16265 struct Symbol * classSym = FindClass(id->string);
16269 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16272 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16276 if(exp->__anon1.member.exp->destType)
16277 FreeType(exp->__anon1.member.exp->destType);
16279 if(method && !method->_class->symbol)
16280 method->_class->symbol = FindClass(method->_class->fullName);
16281 if(prop && !prop->_class->symbol)
16282 prop->_class->symbol = FindClass(prop->_class->fullName);
16283 exp->__anon1.member.exp->destType = __extension__ ({
16284 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16286 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16291 exp->__anon1.member.memberType = 1;
16292 if(!prop->dataType)
16293 ProcessPropertyType(prop);
16294 exp->expType = prop->dataType;
16295 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16297 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16299 CopyTypeInto(type, exp->expType);
16300 type->refCount = 1;
16301 type->constant = 1;
16302 exp->expType = type;
16304 else if(prop->dataType)
16305 prop->dataType->refCount++;
16309 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16311 FreeExpContents(exp);
16313 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16314 ProcessExpressionType(exp);
16317 exp->__anon1.member.memberType = 3;
16318 DeclareStruct(_class->fullName, 0);
16319 if(!member->dataType)
16321 struct Context * context = SetupTemplatesContext(_class);
16323 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16324 FinishTemplatesContext(context);
16326 exp->expType = member->dataType;
16327 if(member->dataType)
16328 member->dataType->refCount++;
16330 else if(revConvert)
16332 exp->__anon1.member.memberType = 4;
16333 exp->expType = MkClassType(revConvert->_class->fullName);
16338 exp->__anon1.member.memberType = 2;
16340 if(!method->dataType)
16341 ProcessMethodType(method);
16342 exp->expType = __extension__ ({
16343 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16345 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16347 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16348 exp->expType->__anon1.__anon3.usedClass = _class;
16350 else if(!classProp)
16352 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16354 FreeExpContents(exp);
16356 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16357 FreeType(exp->expType);
16358 exp->expType = MkClassType("ecere::com::Class");
16361 yylloc = exp->__anon1.member.member->loc;
16362 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16364 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16366 if(_class && exp->expType)
16368 struct __ecereNameSpace__ecere__com__Class * tClass;
16370 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16371 while(tClass && !tClass->templateClass)
16372 tClass = tClass->base;
16373 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16377 struct __ecereNameSpace__ecere__com__Class * sClass;
16379 for(sClass = tClass; sClass; sClass = sClass->base)
16382 if(sClass->templateClass)
16383 sClass = sClass->templateClass;
16384 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16386 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16388 for(sClass = sClass->base; sClass; sClass = sClass->base)
16389 id += sClass->templateParams.count;
16397 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16399 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16400 struct Context * context = SetupTemplatesContext(tClass);
16401 unsigned int constant = exp->expType->constant;
16403 FreeType(exp->expType);
16404 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16405 if(exp->expType->kind == 8 && constant)
16406 exp->expType->constant = 1;
16407 else if(exp->expType->kind == 13)
16409 struct Type * t = exp->expType->__anon1.type;
16411 while(t->kind == 13)
16412 t = t->__anon1.type;
16414 t->constant = constant;
16418 if(exp->expType->kind == 21)
16420 FreeType(exp->expType);
16421 exp->expType = ReplaceThisClassType(_class);
16423 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16424 exp->expType->passAsTemplate = 1;
16427 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16428 if(exp->destType->kind == 8 && constant)
16429 exp->destType->constant = 1;
16430 else if(exp->destType->kind == 13)
16432 struct Type * t = exp->destType->__anon1.type;
16434 while(t->kind == 13)
16435 t = t->__anon1.type;
16437 t->constant = constant;
16439 if(exp->destType->kind == 21)
16441 FreeType(exp->destType);
16442 exp->destType = ReplaceThisClassType(_class);
16446 FinishTemplatesContext(context);
16449 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)
16452 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16453 struct __ecereNameSpace__ecere__com__Class * sClass;
16455 for(sClass = tClass; sClass; sClass = sClass->base)
16458 if(sClass->templateClass)
16459 sClass = sClass->templateClass;
16460 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16462 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16464 for(sClass = sClass->base; sClass; sClass = sClass->base)
16465 id += sClass->templateParams.count;
16475 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16476 struct Context * context = SetupTemplatesContext(tClass);
16477 struct Type * basicType;
16479 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16482 if(basicType->kind == 21)
16484 FreeType(basicType);
16485 basicType = ReplaceThisClassType(_class);
16487 FreeType(exp->expType);
16488 exp->expType = __extension__ ({
16489 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16491 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16495 exp->destType = exp->expType;
16496 exp->destType->refCount++;
16499 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16500 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16501 struct Declarator * decl;
16503 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16506 exp->destType->refCount++;
16508 exp->expType->refCount++;
16510 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16511 exp->__anon1.cast.exp = newExp;
16514 FinishTemplatesContext(context);
16517 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16519 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16523 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16525 int paramCount = 0;
16526 int lastParam = -1;
16527 char templateString[1024];
16528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16530 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16531 while(cClass != expClass)
16533 struct __ecereNameSpace__ecere__com__Class * sClass;
16535 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16538 for(param = cClass->templateParams.first; param; param = param->next)
16540 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16542 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16543 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16545 while(cClassCur != tClass && !paramCur)
16547 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16549 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16551 cClassCur = sClassCur;
16552 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16554 if(!strcmp(paramCur->name, param->name))
16561 if(paramCur && paramCur->type == 0)
16562 arg = tClass->templateArgs[cp];
16564 arg = expClass->templateArgs[p];
16566 char argument[256];
16568 argument[0] = '\0';
16569 switch(param->type)
16573 char expString[1024];
16574 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16575 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16576 struct Expression * exp;
16577 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16579 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16580 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16581 ProcessExpressionType(exp);
16582 ComputeExpression(exp);
16583 expString[0] = '\0';
16584 PrintExpression(exp, expString);
16585 strcat(argument, expString);
16586 FreeExpression(exp);
16591 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16596 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16597 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16604 strcat(templateString, ", ");
16605 if(lastParam != p - 1)
16607 strcat(templateString, param->name);
16608 strcat(templateString, " = ");
16610 strcat(templateString, argument);
16619 int len = strlen(templateString);
16621 if(templateString[len - 1] == '>')
16622 templateString[len++] = ' ';
16623 templateString[len++] = '>';
16624 templateString[len++] = '\0';
16626 FreeType(exp->expType);
16628 struct Context * context = SetupTemplatesContext(tClass);
16630 exp->expType = ProcessTypeString(templateString, 0);
16631 FinishTemplatesContext(context);
16638 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)");
16640 else if(type && (type->kind == 9 || type->kind == 10))
16642 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16646 exp->expType = memberType;
16648 memberType->refCount++;
16653 char expString[10240];
16655 expString[0] = '\0';
16658 PrintExpression(exp, expString);
16659 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16663 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16665 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16667 struct Identifier * id = exp->__anon1.member.member;
16668 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));
16672 FreeType(exp->expType);
16673 exp->expType = ReplaceThisClassType(_class);
16677 yylloc = oldyylloc;
16682 struct Type * destType = exp->destType;
16684 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16686 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16688 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16692 ProcessExpressionType(exp);
16699 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16701 if(classSym && classSym->__anon1.registered)
16703 if(classSym->__anon1.registered->type == 5)
16708 DeclareStruct(classSym->string, 0);
16709 FreeSpecifier(exp->__anon1._class);
16711 FullClassNameCat(name, classSym->string, 0);
16712 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16716 if(classSym->__anon1.registered->fixed)
16718 FreeSpecifier(exp->__anon1._class);
16719 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16724 char className[1024];
16726 strcpy(className, "__ecereClass_");
16727 FullClassNameCat(className, classSym->string, 1);
16728 DeclareClass(classSym, className);
16729 FreeExpContents(exp);
16731 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16732 exp->__anon1.member.member = MkIdentifier("structSize");
16736 exp->expType = __extension__ ({
16737 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16739 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16745 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16747 exp->expType = __extension__ ({
16748 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16750 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16752 exp->isConstant = 1;
16753 DeclareType(type, 0, 0);
16759 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16762 FreeType(exp->__anon1.cast.exp->destType);
16763 exp->__anon1.cast.exp->destType = type;
16766 ProcessExpressionType(exp->__anon1.cast.exp);
16769 exp->expType = type;
16770 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16772 void * prev = exp->prev, * next = exp->next;
16773 struct Type * expType = exp->__anon1.cast.exp->destType;
16774 struct Expression * castExp = exp->__anon1.cast.exp;
16775 struct Type * destType = exp->destType;
16778 expType->refCount++;
16779 FreeType(exp->expType);
16780 FreeTypeName(exp->__anon1.cast.typeName);
16782 FreeType(exp->expType);
16783 FreeType(exp->destType);
16784 exp->expType = expType;
16785 exp->destType = destType;
16786 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16792 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16798 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16800 exp->expType = type;
16805 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16807 ProcessExpressionType(exp->__anon1.vaArg.exp);
16808 exp->expType = type;
16813 struct Expression * e;
16815 exp->isConstant = 1;
16816 FreeType(exp->__anon1.cond.cond->destType);
16817 exp->__anon1.cond.cond->destType = MkClassType("bool");
16818 exp->__anon1.cond.cond->destType->truth = 1;
16819 ProcessExpressionType(exp->__anon1.cond.cond);
16820 if(!exp->__anon1.cond.cond->isConstant)
16821 exp->isConstant = 0;
16822 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16826 FreeType(e->destType);
16827 e->destType = exp->destType;
16829 e->destType->refCount++;
16831 ProcessExpressionType(e);
16834 exp->expType = e->expType;
16836 e->expType->refCount++;
16839 exp->isConstant = 0;
16841 FreeType(exp->__anon1.cond.elseExp->destType);
16842 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16843 if(exp->__anon1.cond.elseExp->destType)
16844 exp->__anon1.cond.elseExp->destType->refCount++;
16845 ProcessExpressionType(exp->__anon1.cond.elseExp);
16846 if(!exp->__anon1.cond.elseExp->isConstant)
16847 exp->isConstant = 0;
16852 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16854 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16856 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16858 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16860 exp->destType->refCount++;
16862 ProcessStatement(exp->__anon1.compound);
16863 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16865 exp->expType->refCount++;
16871 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16873 if(spec && spec->type == 1)
16875 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16876 exp->expType->kind = 19;
16877 exp->byReference = 1;
16881 exp->expType = MkClassType("ecere::com::Class");
16882 exp->byReference = 1;
16888 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16892 struct Identifier * id = exp->__anon1.classData.id;
16893 char structName[1024];
16894 struct Expression * classExp;
16896 strcpy(structName, "__ecereClassData_");
16897 FullClassNameCat(structName, _class->fullName, 0);
16899 exp->__anon1.member.member = id;
16900 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16901 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16903 classExp = MkExpIdentifier(MkIdentifier("class"));
16904 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"))))))));
16905 ProcessExpressionType(exp);
16912 struct Type * type = (((void *)0));
16913 const char * typeString = (((void *)0));
16914 char typeStringBuf[1024];
16916 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))
16918 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16920 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16922 else if(exp->__anon1.list)
16924 struct Expression * e;
16926 for(e = (*exp->__anon1.list).first; e; e = e->next)
16928 ProcessExpressionType(e);
16938 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16942 e->expType = (((void *)0));
16943 e = (*exp->__anon1.list).first;
16944 ProcessExpressionType(e);
16947 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16949 FreeType(e->expType);
16950 e->expType = (((void *)0));
16952 type = (((void *)0));
16960 FreeType(e->expType);
16961 e->expType = (((void *)0));
16967 typeStringBuf[0] = '\0';
16968 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16969 typeString = typeStringBuf;
16971 type = (((void *)0));
16976 char templateString[1024];
16977 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16978 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16979 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16980 struct Expression * expExt;
16981 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16983 sprintf(templateString, "Container<%s>", typeString);
16984 if(exp->__anon1.list)
16986 struct Expression * e;
16988 type = ProcessTypeString(typeString, 0);
16989 while((e = (*exp->__anon1.list).first))
16991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16992 e->destType = type;
16994 ProcessExpressionType(e);
16995 ListAdd(initializers, MkInitializerAssignment(e));
16998 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17000 DeclareStruct("ecere::com::BuiltInContainer", 0);
17001 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17002 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17003 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17004 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17005 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17006 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17007 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17008 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17009 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17010 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17012 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17014 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17015 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
17016 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17017 exp->expType = ProcessTypeString(templateString, 0);
17019 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17020 ProcessExpressionType(expExt);
17024 exp->expType = ProcessTypeString("Container", 0);
17025 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17030 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17032 FreeType(exp->expType);
17033 exp->expType = ReplaceThisClassType(thisClass);
17035 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)
17037 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17041 if(exp->expType->kind != 15)
17043 struct Type * member;
17044 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17046 FreeType(exp->expType);
17047 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17048 exp->expType->kind = symbol->type->kind;
17049 exp->expType->refCount++;
17050 exp->expType->__anon1.__anon1.enumName = enumName;
17051 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17052 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17053 member->refCount++;
17057 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17059 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17061 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17069 if(exp->destType && (exp->destType->kind == 18))
17071 else if(exp->destType && !exp->destType->keepCast)
17073 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17074 exp->needTemplateCast = 1;
17075 if(exp->destType->kind == 0)
17077 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17079 if(!exp->destType->count || unresolved)
17084 if(exp->destType->kind != 14)
17091 char expString[10240];
17093 expString[0] = '\0';
17094 PrintType(exp->destType, type2, 0, 1);
17097 PrintExpression(exp, expString);
17098 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17101 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17102 else if(exp->type != 16)
17103 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17108 char expString[10240];
17110 expString[0] = '\0';
17113 PrintExpression(exp, expString);
17114 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17118 else if(exp->type != 16)
17119 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17131 PrintType(exp->expType, type1, 0, 1);
17132 PrintType(exp->destType, type2, 0, 1);
17134 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)))
17138 char expString[10240];
17140 expString[0] = '\0';
17143 PrintExpression(exp, expString);
17144 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17146 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17147 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17148 FreeType(exp->expType);
17149 exp->destType->refCount++;
17150 exp->expType = exp->destType;
17156 else if(unresolved)
17158 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17159 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);
17160 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17161 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17163 else if(!exp->expType && exp->type != 16)
17165 char expString[10240];
17167 expString[0] = '\0';
17170 PrintExpression(exp, expString);
17171 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17173 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17176 ApplyAnyObjectLogic(exp);
17177 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)))
17179 exp->byReference = 1;
17181 yylloc = oldyylloc;
17184 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)
17188 *curMember = (*curMember)->next;
17189 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17191 *curMember = subMemberStack[--(*subMemberStackPos)];
17192 *curMember = (*curMember)->next;
17194 while((*curMember) && (*curMember)->isProperty)
17195 *curMember = (*curMember)->next;
17196 if(subMemberStackPos)
17198 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17200 subMemberStack[(*subMemberStackPos)++] = *curMember;
17201 *curMember = (*curMember)->members.first;
17202 while(*curMember && (*curMember)->isProperty)
17203 *curMember = (*curMember)->next;
17211 if(subMemberStackPos && *subMemberStackPos)
17213 *curMember = subMemberStack[--(*subMemberStackPos)];
17214 *curMember = (*curMember)->next;
17218 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17220 if(*curClass == _class)
17222 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17224 *curMember = (*curClass)->membersAndProperties.first;
17226 while((*curMember) && (*curMember)->isProperty)
17227 *curMember = (*curMember)->next;
17228 if(subMemberStackPos)
17230 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17232 subMemberStack[(*subMemberStackPos)++] = *curMember;
17233 *curMember = (*curMember)->members.first;
17234 while(*curMember && (*curMember)->isProperty)
17235 *curMember = (*curMember)->next;
17242 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17247 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17249 if(init->__anon1.exp && !init->__anon1.exp->destType)
17251 FreeType(init->__anon1.exp->destType);
17252 init->__anon1.exp->destType = type;
17256 if(init->__anon1.exp)
17258 ProcessExpressionType(init->__anon1.exp);
17259 init->isConstant = init->__anon1.exp->isConstant;
17265 struct Expression * exp = init->__anon1.exp;
17266 struct Instantiation * inst = exp->__anon1.instance;
17267 struct MembersInit * members;
17270 init->__anon1.list = MkList();
17273 for(members = (*inst->members).first; members; members = members->next)
17275 if(members->type == 0)
17277 struct MemberInit * member;
17279 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17281 ListAdd(init->__anon1.list, member->initializer);
17282 member->initializer = (((void *)0));
17287 FreeExpression(exp);
17291 struct Initializer * i;
17292 struct Type * initializerType = (((void *)0));
17293 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17294 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17295 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17296 int subMemberStackPos = 0;
17298 if(type && type->kind == 12)
17299 initializerType = Dereference(type);
17300 else if(type && (type->kind == 9 || type->kind == 10))
17301 initializerType = type->__anon1.__anon1.members.first;
17302 for(i = (*init->__anon1.list).first; i; i = i->next)
17304 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17306 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17309 if(!curMember->dataType)
17310 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17311 initializerType = curMember->dataType;
17314 ProcessInitializer(i, initializerType);
17315 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17316 initializerType = initializerType->next;
17318 init->isConstant = 0;
17320 if(type && type->kind == 12)
17321 FreeType(initializerType);
17322 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))
17324 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17331 extern struct Symbol * FindType(struct Context * ctx, const char * name);
17333 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17335 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17341 if(spec->__anon1.specifier == THISCLASS)
17346 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17347 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17348 ProcessSpecifier(spec, declareStruct);
17355 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17358 DeclareType(symbol->type, 1, 1);
17359 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17360 DeclareStruct(spec->__anon1.__anon1.name, 0);
17365 struct Enumerator * e;
17367 if(spec->__anon1.__anon2.list)
17369 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17372 ProcessExpressionType(e->exp);
17380 if(spec->__anon1.__anon2.definitions)
17382 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17384 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17391 static void ProcessDeclarator(struct Declarator * decl)
17396 if(decl->__anon1.identifier->classSym)
17398 FreeSpecifier(decl->__anon1.identifier->_class);
17399 decl->__anon1.identifier->_class = (((void *)0));
17403 if(decl->__anon1.array.exp)
17404 ProcessExpressionType(decl->__anon1.array.exp);
17411 if(decl->declarator)
17412 ProcessDeclarator(decl->declarator);
17413 if(decl->type == 4)
17415 struct Identifier * id = GetDeclId(decl);
17417 if(id && id->_class)
17419 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17421 if(!decl->__anon1.function.parameters)
17422 decl->__anon1.function.parameters = MkList();
17423 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17424 id->_class = (((void *)0));
17426 if(decl->__anon1.function.parameters)
17428 struct TypeName * param;
17430 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17432 if(param->qualifiers && (*param->qualifiers).first)
17434 struct Specifier * spec = (*param->qualifiers).first;
17436 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17438 struct Declarator * d = param->declarator;
17439 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);
17442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17443 FreeList(param->qualifiers, FreeSpecifier);
17444 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17445 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17449 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17451 struct Declarator * d = param->declarator;
17453 FreeList(param->qualifiers, FreeSpecifier);
17454 param->qualifiers = MkListOne(MkSpecifier(VOID));
17456 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17457 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17459 else if(spec->__anon1.specifier == THISCLASS)
17464 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17465 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17466 ProcessSpecifier(spec, 0);
17470 if(param->declarator)
17471 ProcessDeclarator(param->declarator);
17479 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17481 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17483 static void ProcessDeclaration(struct Declaration * decl)
17485 yylloc = decl->loc;
17490 unsigned int declareStruct = 0;
17492 if(decl->__anon1.__anon1.declarators)
17494 struct InitDeclarator * d;
17496 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17498 struct Type * type, * subType;
17500 ProcessDeclarator(d->declarator);
17501 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17504 ProcessInitializer(d->initializer, type);
17505 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17507 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17509 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17511 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17512 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17513 if(decl->__anon1.__anon1.specifiers)
17514 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17515 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17518 decl->__anon1.inst = inst;
17522 for(subType = type; subType; )
17524 if(subType->kind == 8)
17529 else if(subType->kind == 13)
17531 else if(subType->kind == 12)
17532 subType = subType->__anon1.__anon4.arrayType;
17541 if(decl->__anon1.__anon1.specifiers)
17543 struct Specifier * s;
17545 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17547 ProcessSpecifier(s, declareStruct);
17554 ProcessInstantiationType(decl->__anon1.inst);
17559 struct Specifier * spec;
17560 struct Declarator * d;
17561 unsigned int declareStruct = 0;
17563 if(decl->__anon1.__anon1.declarators)
17565 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17567 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17568 struct Type * subType;
17570 ProcessDeclarator(d);
17571 for(subType = type; subType; )
17573 if(subType->kind == 8)
17578 else if(subType->kind == 13)
17580 else if(subType->kind == 12)
17581 subType = subType->__anon1.__anon4.arrayType;
17588 if(decl->__anon1.__anon1.specifiers)
17590 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17591 ProcessSpecifier(spec, declareStruct);
17598 static struct FunctionDefinition * curFunction;
17600 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17602 char propName[1024], propNameM[1024];
17603 char getName[1024], setName[1024];
17604 struct __ecereNameSpace__ecere__sys__OldList * args;
17606 DeclareProperty(prop, setName, getName);
17607 strcpy(propName, "__ecereProp_");
17608 FullClassNameCat(propName, prop->_class->fullName, 0);
17609 strcat(propName, "_");
17610 FullClassNameCat(propName, prop->name, 1);
17611 strcpy(propNameM, "__ecerePropM_");
17612 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17613 strcat(propNameM, "_");
17614 FullClassNameCat(propNameM, prop->name, 1);
17615 if(prop->isWatchable)
17618 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17619 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17620 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17622 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17623 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17624 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17628 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17629 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17630 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17632 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17633 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17634 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17636 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17637 curFunction->propSet->fireWatchersDone = 1;
17640 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17642 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17644 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17646 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17648 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17650 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17652 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17654 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17656 static void ProcessStatement(struct Statement * stmt)
17658 yylloc = stmt->loc;
17662 ProcessStatement(stmt->__anon1.labeled.stmt);
17665 if(stmt->__anon1.caseStmt.exp)
17667 FreeType(stmt->__anon1.caseStmt.exp->destType);
17668 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17670 curSwitchType->refCount++;
17671 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17672 ComputeExpression(stmt->__anon1.caseStmt.exp);
17674 if(stmt->__anon1.caseStmt.stmt)
17675 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17679 if(stmt->__anon1.compound.context)
17681 struct Declaration * decl;
17682 struct Statement * s;
17683 struct Statement * prevCompound = curCompound;
17684 struct Context * prevContext = curContext;
17686 if(!stmt->__anon1.compound.isSwitch)
17687 curCompound = stmt;
17688 curContext = stmt->__anon1.compound.context;
17689 if(stmt->__anon1.compound.declarations)
17691 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17692 ProcessDeclaration(decl);
17694 if(stmt->__anon1.compound.statements)
17696 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17697 ProcessStatement(s);
17699 curContext = prevContext;
17700 curCompound = prevCompound;
17706 struct Expression * exp;
17708 if(stmt->__anon1.expressions)
17710 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17711 ProcessExpressionType(exp);
17717 struct Expression * exp;
17719 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17720 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17721 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17722 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17724 ProcessExpressionType(exp);
17726 if(stmt->__anon1.ifStmt.stmt)
17727 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17728 if(stmt->__anon1.ifStmt.elseStmt)
17729 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17734 struct Type * oldSwitchType = curSwitchType;
17736 if(stmt->__anon1.switchStmt.exp)
17738 struct Expression * exp;
17740 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17744 ProcessExpressionType(exp);
17747 curSwitchType = exp->expType;
17750 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17751 curSwitchType = oldSwitchType;
17756 if(stmt->__anon1.whileStmt.exp)
17758 struct Expression * exp;
17760 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17761 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17762 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17763 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17765 ProcessExpressionType(exp);
17768 if(stmt->__anon1.whileStmt.stmt)
17769 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17774 if(stmt->__anon1.doWhile.exp)
17776 struct Expression * exp;
17778 if((*stmt->__anon1.doWhile.exp).last)
17780 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17781 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17782 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17784 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17786 ProcessExpressionType(exp);
17789 if(stmt->__anon1.doWhile.stmt)
17790 ProcessStatement(stmt->__anon1.doWhile.stmt);
17795 struct Expression * exp;
17797 if(stmt->__anon1.forStmt.init)
17798 ProcessStatement(stmt->__anon1.forStmt.init);
17799 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17801 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17802 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17803 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17805 if(stmt->__anon1.forStmt.check)
17806 ProcessStatement(stmt->__anon1.forStmt.check);
17807 if(stmt->__anon1.forStmt.increment)
17809 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17810 ProcessExpressionType(exp);
17812 if(stmt->__anon1.forStmt.stmt)
17813 ProcessStatement(stmt->__anon1.forStmt.stmt);
17818 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17819 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17820 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17821 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17822 char iteratorType[1024];
17823 struct Type * source;
17824 struct Expression * e;
17825 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));
17826 struct Expression * arrayExp;
17827 const char * typeString = (((void *)0));
17828 int builtinCount = 0;
17830 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17834 FreeType(e->destType);
17835 e->destType = ProcessTypeString("Container", 0);
17837 if(!isBuiltin || e->next)
17838 ProcessExpressionType(e);
17840 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17841 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)))
17843 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17844 struct Symbol * symbol;
17845 struct Expression * expIt = (((void *)0));
17846 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17847 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17848 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17849 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17852 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17853 stmt->__anon1.compound.context->parent = curContext;
17854 curContext = stmt->__anon1.compound.context;
17855 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17857 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17859 isCustomAVLTree = 1;
17860 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17863 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17865 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17867 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17870 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17874 struct Declarator * decl;
17875 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17877 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17878 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17879 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17883 struct Type * type = (((void *)0));
17884 char typeStringBuf[1024];
17886 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17887 if(((struct Expression *)(*exp).last)->type == 11)
17889 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17892 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17894 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)
17896 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17898 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17900 else if(arrayExp->__anon1.list)
17902 struct Expression * e;
17904 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17906 ProcessExpressionType(e);
17916 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17920 e->expType = (((void *)0));
17921 e = (*arrayExp->__anon1.list).first;
17922 ProcessExpressionType(e);
17925 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17927 FreeType(e->expType);
17928 e->expType = (((void *)0));
17930 type = (((void *)0));
17938 FreeType(e->expType);
17939 e->expType = (((void *)0));
17945 typeStringBuf[0] = '\0';
17946 PrintType(type, typeStringBuf, 0, 1);
17947 typeString = typeStringBuf;
17953 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17954 struct Declarator * decl;
17955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17957 if(arrayExp->__anon1.list)
17959 struct Expression * e;
17961 builtinCount = (*arrayExp->__anon1.list).count;
17962 type = ProcessTypeString(typeString, 0);
17963 while((e = (*arrayExp->__anon1.list).first))
17965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17966 e->destType = type;
17968 ProcessExpressionType(e);
17969 ListAdd(initializers, MkInitializerAssignment(e));
17972 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17974 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17975 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17976 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17977 FreeList(exp, FreeExpression);
17981 arrayExp->expType = ProcessTypeString("Container", 0);
17982 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17985 else if(isLinkList && !isList)
17987 struct Declarator * decl;
17988 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17990 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17991 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17992 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17994 else if(_class->templateArgs)
17997 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17999 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18000 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)))))))));
18002 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18005 switch(block->type)
18008 if(block->__anon1.compound.context)
18009 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18012 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18013 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18014 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18015 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18018 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18019 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18022 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18023 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18026 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18027 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18030 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18031 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18034 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18035 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18041 block = MkIfStmt(filter, block, (((void *)0)));
18045 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));
18046 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18047 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18048 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18054 sprintf(count, "%d", builtinCount);
18055 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));
18056 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18057 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18058 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18060 else if(isLinkList && !isList)
18062 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18063 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18065 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18067 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));
18071 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18072 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18074 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));
18076 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18077 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18078 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18082 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18084 ProcessExpressionType(expIt);
18085 if((*stmt->__anon1.compound.declarations).first)
18086 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18088 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18089 ProcessStatement(stmt);
18090 curContext = stmt->__anon1.compound.context->parent;
18095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18107 struct Expression * exp;
18109 if(stmt->__anon1.expressions)
18111 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18115 if(curFunction && !curFunction->type)
18116 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18117 FreeType(exp->destType);
18118 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18120 exp->destType->refCount++;
18122 ProcessExpressionType(exp);
18129 ProcessDeclaration(stmt->__anon1.decl);
18134 struct AsmField * field;
18136 if(stmt->__anon1.asmStmt.inputFields)
18138 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18139 if(field->expression)
18140 ProcessExpressionType(field->expression);
18142 if(stmt->__anon1.asmStmt.outputFields)
18144 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18145 if(field->expression)
18146 ProcessExpressionType(field->expression);
18148 if(stmt->__anon1.asmStmt.clobberedFields)
18150 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18152 if(field->expression)
18153 ProcessExpressionType(field->expression);
18160 struct PropertyWatch * propWatch;
18161 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18162 struct Expression * object = stmt->__anon1._watch.object;
18163 struct Expression * watcher = stmt->__anon1._watch.watcher;
18166 ProcessExpressionType(watcher);
18168 ProcessExpressionType(object);
18171 if(watcher || thisClass)
18173 struct External * external = curExternal;
18174 struct Context * context = curContext;
18177 stmt->__anon1.expressions = MkList();
18178 curExternal = external->prev;
18179 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18181 struct ClassFunction * func;
18182 char watcherName[1024];
18183 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;
18184 struct External * createdExternal;
18185 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18188 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18189 if(propWatch->deleteWatch)
18190 strcat(watcherName, "_delete");
18193 struct Identifier * propID;
18195 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18197 strcat(watcherName, "_");
18198 strcat(watcherName, propID->string);
18201 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18203 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)));
18204 ProcessClassFunctionBody(func, propWatch->compound);
18205 propWatch->compound = (((void *)0));
18206 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18207 createdExternal->symbol->idCode = external->symbol->idCode;
18208 curExternal = createdExternal;
18209 ProcessFunction(createdExternal->__anon1.function);
18211 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18213 externalDecl->__anon1.declaration = decl;
18214 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18215 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18217 if(propWatch->deleteWatch)
18219 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18221 ListAdd(args, CopyExpression(object));
18222 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18223 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18224 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18228 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18229 struct Identifier * propID;
18231 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18233 char propName[1024];
18234 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18238 char getName[1024], setName[1024];
18239 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18241 DeclareProperty(prop, setName, getName);
18242 strcpy(propName, "__ecereProp_");
18243 FullClassNameCat(propName, prop->_class->fullName, 0);
18244 strcat(propName, "_");
18245 FullClassNameCat(propName, prop->name, 1);
18246 ListAdd(args, CopyExpression(object));
18247 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18248 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18249 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18250 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18253 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18260 curExternal = external;
18261 curContext = context;
18263 FreeExpression(watcher);
18265 FreeExpression(object);
18266 FreeList(watches, FreePropertyWatch);
18269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18273 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18275 ProcessStatement(propWatch->compound);
18282 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18283 struct Expression * object = stmt->__anon1._watch.object;
18284 struct __ecereNameSpace__ecere__com__Class * _class;
18287 ProcessExpressionType(object);
18290 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18293 struct Identifier * propID;
18296 stmt->__anon1.expressions = MkList();
18297 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18299 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18306 for(propID = (*watches).first; propID; propID = propID->next)
18308 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18312 CreateFireWatcher(prop, object, stmt);
18315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18320 struct __ecereNameSpace__ecere__com__Property * prop;
18321 struct __ecereNameSpace__ecere__com__Class * base;
18323 for(base = _class; base; base = base->base)
18325 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18327 if(prop->isProperty && prop->isWatchable)
18329 CreateFireWatcher(prop, object, stmt);
18335 FreeExpression(object);
18336 FreeList(watches, FreeIdentifier);
18339 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18345 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18346 struct Expression * object = stmt->__anon1._watch.object;
18347 struct Expression * watcher = stmt->__anon1._watch.watcher;
18348 struct __ecereNameSpace__ecere__com__Class * _class;
18351 ProcessExpressionType(object);
18353 ProcessExpressionType(watcher);
18356 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18357 if(watcher || thisClass)
18361 struct Identifier * propID;
18364 stmt->__anon1.expressions = MkList();
18367 struct __ecereNameSpace__ecere__sys__OldList * args;
18370 ListAdd(args, CopyExpression(object));
18371 ListAdd(args, MkExpConstant("0"));
18372 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18373 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18377 for(propID = (*watches).first; propID; propID = propID->next)
18379 char propName[1024];
18380 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18384 char getName[1024], setName[1024];
18385 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18387 DeclareProperty(prop, setName, getName);
18388 strcpy(propName, "__ecereProp_");
18389 FullClassNameCat(propName, prop->_class->fullName, 0);
18390 strcat(propName, "_");
18391 FullClassNameCat(propName, prop->name, 1);
18392 ListAdd(args, CopyExpression(object));
18393 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18394 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18395 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18402 FreeExpression(object);
18404 FreeExpression(watcher);
18405 FreeList(watches, FreeIdentifier);
18408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18418 extern struct Expression * QBrackets(struct Expression * exp);
18420 extern struct TypeName * QMkType(const char * spec, struct Declarator * decl);
18422 extern struct Declarator * QMkPtrDecl(const char * id);
18424 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18426 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18428 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18430 static void ProcessFunction(struct FunctionDefinition * function)
18432 struct Identifier * id = GetDeclId(function->declarator);
18433 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18434 struct Type * type = symbol ? symbol->type : (((void *)0));
18435 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18436 struct Context * oldTopContext = topContext;
18438 yylloc = function->loc;
18439 if(type && type->__anon1.__anon2.thisClass)
18441 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18442 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18443 char className[1024];
18444 char structName[1024];
18445 struct Declarator * funcDecl;
18446 struct Symbol * thisSymbol;
18447 unsigned int typedObject = 0;
18449 if(_class && !_class->base)
18451 _class = currentClass;
18452 if(_class && !_class->symbol)
18453 _class->symbol = FindClass(_class->fullName);
18454 classSym = _class ? _class->symbol : (((void *)0));
18457 thisClass = _class;
18458 if(inCompiler && _class)
18460 if(type->kind == 11)
18462 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18464 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18469 if(type->classObjectType != 1)
18471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18472 symbol->type->__anon1.__anon2.staticMethod = 1;
18473 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18474 symbol->type->extraParam = 0;
18477 strcpy(className, "__ecereClass_");
18478 FullClassNameCat(className, _class->fullName, 1);
18479 structName[0] = (char)0;
18480 FullClassNameCat(structName, _class->fullName, 0);
18481 funcDecl = GetFuncDecl(function->declarator);
18484 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18486 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18488 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18490 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18491 FreeTypeName(param);
18494 if(!function->propertyNoThis)
18496 struct TypeName * thisParam = (((void *)0));
18498 if(type->classObjectType != 1)
18500 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18501 if(!funcDecl->__anon1.function.parameters)
18502 funcDecl->__anon1.function.parameters = MkList();
18503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18507 if(type->classObjectType != 1)
18509 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18510 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18512 thisParam = __extension__ ({
18513 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18515 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18521 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18523 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18525 funcDecl = GetFuncDecl(initDecl->declarator);
18528 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18530 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18532 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18535 FreeTypeName(param);
18538 if(type->classObjectType != 1)
18540 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18542 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18544 if(!funcDecl->__anon1.function.parameters)
18545 funcDecl->__anon1.function.parameters = MkList();
18546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18554 if(type->classObjectType != 1)
18556 thisSymbol = __extension__ ({
18557 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18559 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18561 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18562 if(typedObject && thisSymbol->type)
18564 thisSymbol->type->classObjectType = 2;
18565 thisSymbol->type->byReference = type->byReference;
18566 thisSymbol->type->typedByReference = type->byReference;
18570 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18572 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18575 struct __ecereNameSpace__ecere__com__Class * base;
18577 for(base = _class; base && base->type != 1000; base = base->next)
18579 for(member = base->membersAndProperties.first; member; member = member->next)
18580 if(!member->isProperty)
18586 for(member = _class->membersAndProperties.first; member; member = member->next)
18587 if(!member->isProperty)
18591 char pointerName[1024];
18592 struct Declaration * decl;
18593 struct Initializer * initializer;
18594 struct Expression * exp, * bytePtr;
18596 strcpy(pointerName, "__ecerePointer_");
18597 FullClassNameCat(pointerName, _class->fullName, 0);
18599 char className[1024];
18601 strcpy(className, "__ecereClass_");
18602 FullClassNameCat(className, classSym->string, 1);
18603 DeclareClass(classSym, className);
18605 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18610 sprintf(string, "%d", _class->offset);
18611 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18615 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18617 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18618 exp->expType = __extension__ ({
18619 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18621 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18622 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18624 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18625 }), __ecereInstance2;
18629 yylloc = function->body->loc;
18630 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18632 struct Context * prevContext = curContext;
18634 curContext = function->body->__anon1.compound.context;
18635 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18636 curContext = prevContext;
18638 decl->symbol = (((void *)0));
18639 if(!function->body->__anon1.compound.declarations)
18640 function->body->__anon1.compound.declarations = MkList();
18641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18647 thisClass = (((void *)0));
18650 FreeSpecifier(id->_class);
18651 id->_class = (((void *)0));
18652 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18654 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18656 id = GetDeclId(initDecl->declarator);
18657 FreeSpecifier(id->_class);
18658 id->_class = (((void *)0));
18662 topContext = function->body->__anon1.compound.context;
18664 struct FunctionDefinition * oldFunction = curFunction;
18666 curFunction = function;
18668 ProcessStatement(function->body);
18669 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18671 struct Statement * prevCompound = curCompound;
18672 struct Context * prevContext = curContext;
18673 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18675 if(!function->body->__anon1.compound.statements)
18676 function->body->__anon1.compound.statements = MkList();
18677 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18678 curCompound = function->body;
18679 curContext = function->body->__anon1.compound.context;
18680 ProcessStatement(fireWatchers);
18681 curContext = prevContext;
18682 curCompound = prevCompound;
18684 curFunction = oldFunction;
18686 if(function->declarator)
18688 ProcessDeclarator(function->declarator);
18690 topContext = oldTopContext;
18691 thisClass = oldThisClass;
18694 extern void FreeSymbol(struct Symbol * symbol);
18696 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18698 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18700 struct ClassDef * def;
18701 struct External * external = curExternal;
18702 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18704 for(def = definitions->first; def; def = def->next)
18708 if(def->__anon1.function->declarator)
18709 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18711 curExternal = external;
18712 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18714 else if(def->type == 2)
18716 if(def->__anon1.decl->type == 2)
18718 thisClass = regClass;
18719 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18720 thisClass = (((void *)0));
18724 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18727 thisClass = regClass;
18728 ProcessDeclaration(def->__anon1.decl);
18729 thisClass = backThisClass;
18732 else if(def->type == 1 && def->__anon1.defProperties)
18734 struct MemberInit * defProperty;
18735 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);
18737 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18738 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18740 thisClass = regClass;
18741 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18742 thisClass = (((void *)0));
18744 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18745 FreeSymbol(thisSymbol);
18747 else if(def->type == 3 && def->__anon1.propertyDef)
18749 struct PropertyDef * prop = def->__anon1.propertyDef;
18751 thisClass = regClass;
18756 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18758 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18760 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18761 ProcessStatement(prop->setStmt);
18767 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18769 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18771 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18772 ProcessStatement(prop->getStmt);
18774 if(prop->issetStmt)
18778 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18780 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18782 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18783 ProcessStatement(prop->issetStmt);
18785 thisClass = (((void *)0));
18787 else if(def->type == 4 && def->__anon1.propertyWatch)
18789 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18791 thisClass = regClass;
18792 if(propertyWatch->compound)
18794 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);
18796 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18797 curExternal = (((void *)0));
18798 ProcessStatement(propertyWatch->compound);
18800 thisClass = (((void *)0));
18805 void DeclareFunctionUtil(const char * s)
18807 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18814 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18815 strcpy(name, "__ecereFunction_");
18816 FullClassNameCat(name, s, 0);
18817 DeclareFunction(function, name);
18821 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18823 void ComputeDataTypes()
18825 struct External * external;
18826 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18827 struct External * after = (((void *)0));
18829 currentClass = (((void *)0));
18830 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18831 for(external = (*ast).first; external; external = external->next)
18833 if(external->type == 1)
18835 struct Declaration * decl = external->__anon1.declaration;
18839 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18843 struct InitDeclarator * initDecl = (*decls).first;
18847 struct Declarator * declarator = initDecl->declarator;
18849 if(declarator && declarator->type == 1)
18851 struct Identifier * id = declarator->__anon1.identifier;
18853 if(id && id->string)
18855 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18857 external->symbol->id = -1001, external->symbol->idCode = -1001;
18868 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18873 temp->symbol = __extension__ ({
18874 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18876 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18879 curExternal = temp;
18880 DeclareFunctionUtil("eSystem_New");
18881 DeclareFunctionUtil("eSystem_New0");
18882 DeclareFunctionUtil("eSystem_Renew");
18883 DeclareFunctionUtil("eSystem_Renew0");
18884 DeclareFunctionUtil("eSystem_Delete");
18885 DeclareFunctionUtil("eClass_GetProperty");
18886 DeclareFunctionUtil("eClass_SetProperty");
18887 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18888 DeclareFunctionUtil("eInstance_SetMethod");
18889 DeclareFunctionUtil("eInstance_IncRef");
18890 DeclareFunctionUtil("eInstance_StopWatching");
18891 DeclareFunctionUtil("eInstance_Watch");
18892 DeclareFunctionUtil("eInstance_FireWatchers");
18893 DeclareStruct("ecere::com::Class", 0);
18894 DeclareStruct("ecere::com::Instance", 0);
18895 DeclareStruct("ecere::com::Property", 0);
18896 DeclareStruct("ecere::com::DataMember", 0);
18897 DeclareStruct("ecere::com::Method", 0);
18898 DeclareStruct("ecere::com::SerialBuffer", 0);
18899 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18900 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18901 for(external = (*ast).first; external; external = external->next)
18903 afterExternal = curExternal = external;
18904 if(external->type == 0)
18906 currentClass = external->__anon1.function->_class;
18907 ProcessFunction(external->__anon1.function);
18909 else if(external->type == 1)
18911 currentClass = (((void *)0));
18912 if(external->__anon1.declaration)
18913 ProcessDeclaration(external->__anon1.declaration);
18915 else if(external->type == 2)
18917 struct ClassDefinition * _class = external->__anon1._class;
18919 currentClass = external->symbol->__anon1.registered;
18920 if(_class->definitions)
18922 ProcessClass(_class->definitions, _class->symbol);
18926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18927 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18930 else if(external->type == 4)
18932 thisNameSpace = external->__anon1.id->string;
18935 currentClass = (((void *)0));
18936 thisNameSpace = (((void *)0));
18937 curExternal = (((void *)0));
18938 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18939 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18942 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);
18944 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);
18946 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18948 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18950 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19001 __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);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19005 __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);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19018 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
19019 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19020 __ecereClass_Conversion = class;
19021 __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);
19022 __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);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19024 __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);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19049 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)