2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
14 typedef long long int64;
15 typedef unsigned long long uint64;
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
21 #define __ENDIAN_PAD(x) (8 - (x))
23 #define __ENDIAN_PAD(x) 0
25 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
27 struct __ecereNameSpace__ecere__sys__BTNode;
29 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
31 struct __ecereNameSpace__ecere__sys__BinaryTree
33 struct __ecereNameSpace__ecere__sys__BTNode * root;
35 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int a, unsigned int b);
36 void (* FreeKey)(void * key);
37 } __attribute__ ((gcc_struct));
39 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
41 struct __ecereNameSpace__ecere__sys__OldList
48 } __attribute__ ((gcc_struct));
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
52 struct __ecereNameSpace__ecere__com__Method
55 struct __ecereNameSpace__ecere__com__Method * parent;
56 struct __ecereNameSpace__ecere__com__Method * left;
57 struct __ecereNameSpace__ecere__com__Method * right;
62 struct __ecereNameSpace__ecere__com__Class * _class;
64 char * dataTypeString;
65 struct Type * dataType;
67 } __attribute__ ((gcc_struct));
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
71 struct __ecereNameSpace__ecere__com__Property
73 struct __ecereNameSpace__ecere__com__Property * prev;
74 struct __ecereNameSpace__ecere__com__Property * next;
76 unsigned int isProperty;
79 struct __ecereNameSpace__ecere__com__Class * _class;
80 char * dataTypeString;
81 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
82 struct Type * dataType;
85 unsigned int (* IsSet)();
89 unsigned int conversion;
90 unsigned int watcherOffset;
92 unsigned int compiled;
93 unsigned int selfWatchable;
94 unsigned int isWatchable;
95 } __attribute__ ((gcc_struct));
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
104 unsigned int included;
105 } __attribute__ ((gcc_struct));
107 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
111 struct CodePosition start;
112 struct CodePosition end;
113 } __attribute__ ((gcc_struct));
115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
119 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
128 struct Attrib * attr;
129 } __attribute__ ((gcc_struct));
130 } __attribute__ ((gcc_struct));
132 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
134 struct ClassDefinition
136 struct ClassDefinition * prev;
137 struct ClassDefinition * next;
139 struct Specifier * _class;
140 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
141 struct __ecereNameSpace__ecere__sys__OldList * definitions;
142 struct Symbol * symbol;
143 struct Location blockStart;
144 struct Location nameLoc;
147 unsigned int deleteWatchable;
148 } __attribute__ ((gcc_struct));
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
154 struct Context * parent;
155 struct __ecereNameSpace__ecere__sys__BinaryTree types;
156 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
157 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
158 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
161 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
162 struct ClassDefinition * classDef;
163 unsigned int templateTypesOnly;
164 unsigned int hasNameSpace;
165 } __attribute__ ((gcc_struct));
167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
171 struct Instantiation * prev;
172 struct Instantiation * next;
174 struct Specifier * _class;
175 struct Expression * exp;
176 struct __ecereNameSpace__ecere__sys__OldList * members;
177 struct Symbol * symbol;
178 unsigned int fullSet;
179 unsigned int isConstant;
180 unsigned char * data;
181 struct Location nameLoc;
182 struct Location insideLoc;
184 } __attribute__ ((gcc_struct));
186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
190 struct Declaration * prev;
191 struct Declaration * next;
198 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
199 struct __ecereNameSpace__ecere__sys__OldList * declarators;
200 } __attribute__ ((gcc_struct));
201 struct Instantiation * inst;
204 struct Identifier * id;
205 struct Expression * exp;
206 } __attribute__ ((gcc_struct));
207 } __attribute__ ((gcc_struct));
208 struct Specifier * extStorage;
209 struct Symbol * symbol;
211 } __attribute__ ((gcc_struct));
213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
217 struct Statement * prev;
218 struct Statement * next;
223 struct __ecereNameSpace__ecere__sys__OldList * expressions;
226 struct Identifier * id;
227 struct Statement * stmt;
228 } __attribute__ ((gcc_struct)) labeled;
231 struct Expression * exp;
232 struct Statement * stmt;
233 } __attribute__ ((gcc_struct)) caseStmt;
236 struct __ecereNameSpace__ecere__sys__OldList * declarations;
237 struct __ecereNameSpace__ecere__sys__OldList * statements;
238 struct Context * context;
239 unsigned int isSwitch;
240 } __attribute__ ((gcc_struct)) compound;
243 struct __ecereNameSpace__ecere__sys__OldList * exp;
244 struct Statement * stmt;
245 struct Statement * elseStmt;
246 } __attribute__ ((gcc_struct)) ifStmt;
249 struct __ecereNameSpace__ecere__sys__OldList * exp;
250 struct Statement * stmt;
251 } __attribute__ ((gcc_struct)) switchStmt;
254 struct __ecereNameSpace__ecere__sys__OldList * exp;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) whileStmt;
259 struct __ecereNameSpace__ecere__sys__OldList * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) doWhile;
264 struct Statement * init;
265 struct Statement * check;
266 struct __ecereNameSpace__ecere__sys__OldList * increment;
267 struct Statement * stmt;
268 } __attribute__ ((gcc_struct)) forStmt;
271 struct Identifier * id;
272 } __attribute__ ((gcc_struct)) gotoStmt;
275 struct Specifier * spec;
277 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
278 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
279 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
280 } __attribute__ ((gcc_struct)) asmStmt;
283 struct Expression * watcher;
284 struct Expression * object;
285 struct __ecereNameSpace__ecere__sys__OldList * watches;
286 } __attribute__ ((gcc_struct)) _watch;
289 struct Identifier * id;
290 struct __ecereNameSpace__ecere__sys__OldList * exp;
291 struct __ecereNameSpace__ecere__sys__OldList * filter;
292 struct Statement * stmt;
293 } __attribute__ ((gcc_struct)) forEachStmt;
294 struct Declaration * decl;
295 } __attribute__ ((gcc_struct));
296 } __attribute__ ((gcc_struct));
298 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
302 struct TypeName * prev;
303 struct TypeName * next;
305 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
306 struct Declarator * declarator;
308 struct Expression * bitCount;
309 } __attribute__ ((gcc_struct));
311 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
315 struct Initializer * prev;
316 struct Initializer * next;
321 struct Expression * exp;
322 struct __ecereNameSpace__ecere__sys__OldList * list;
323 } __attribute__ ((gcc_struct));
324 unsigned int isConstant;
325 } __attribute__ ((gcc_struct));
327 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
329 struct __ecereNameSpace__ecere__com__DataValue
344 } __attribute__ ((gcc_struct));
345 } __attribute__ ((gcc_struct));
347 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
351 struct Expression * prev;
352 struct Expression * next;
360 struct Identifier * identifier;
361 } __attribute__ ((gcc_struct));
362 struct Statement * compound;
363 struct Instantiation * instance;
365 struct __ecereNameSpace__ecere__sys__OldList * list;
368 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
369 struct Declarator * decl;
370 } __attribute__ ((gcc_struct)) _classExp;
373 struct Identifier * id;
374 } __attribute__ ((gcc_struct)) classData;
377 struct Expression * exp;
378 struct __ecereNameSpace__ecere__sys__OldList * arguments;
379 struct Location argLoc;
380 } __attribute__ ((gcc_struct)) call;
383 struct Expression * exp;
384 struct __ecereNameSpace__ecere__sys__OldList * index;
385 } __attribute__ ((gcc_struct)) index;
388 struct Expression * exp;
389 struct Identifier * member;
391 unsigned int thisPtr;
392 } __attribute__ ((gcc_struct)) member;
396 struct Expression * exp1;
397 struct Expression * exp2;
398 } __attribute__ ((gcc_struct)) op;
399 struct TypeName * typeName;
400 struct Specifier * _class;
403 struct TypeName * typeName;
404 struct Expression * exp;
405 } __attribute__ ((gcc_struct)) cast;
408 struct Expression * cond;
409 struct __ecereNameSpace__ecere__sys__OldList * exp;
410 struct Expression * elseExp;
411 } __attribute__ ((gcc_struct)) cond;
414 struct TypeName * typeName;
415 struct Expression * size;
416 } __attribute__ ((gcc_struct)) _new;
419 struct TypeName * typeName;
420 struct Expression * size;
421 struct Expression * exp;
422 } __attribute__ ((gcc_struct)) _renew;
426 struct Identifier * id;
427 } __attribute__ ((gcc_struct)) db;
430 struct Expression * ds;
431 struct Expression * name;
432 } __attribute__ ((gcc_struct)) dbopen;
435 struct TypeName * typeName;
436 struct Initializer * initializer;
437 } __attribute__ ((gcc_struct)) initializer;
440 struct Expression * exp;
441 struct TypeName * typeName;
442 } __attribute__ ((gcc_struct)) vaArg;
443 } __attribute__ ((gcc_struct));
444 unsigned int debugValue;
445 struct __ecereNameSpace__ecere__com__DataValue val;
446 unsigned int address;
447 unsigned int hasAddress;
448 struct Type * expType;
449 struct Type * destType;
452 unsigned int byReference;
453 unsigned int isConstant;
454 unsigned int addedThis;
455 unsigned int needCast;
456 unsigned int thisPtr;
457 } __attribute__ ((gcc_struct));
459 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
461 struct TemplateDatatype
463 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
464 struct Declarator * decl;
465 } __attribute__ ((gcc_struct));
467 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
469 struct TemplateArgument;
471 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
473 struct TemplateParameter
475 struct TemplateParameter * prev;
476 struct TemplateParameter * next;
479 struct Identifier * identifier;
482 struct TemplateDatatype * dataType;
484 } __attribute__ ((gcc_struct));
485 struct TemplateArgument * defaultArgument;
486 char * dataTypeString;
487 struct Type * baseType;
488 } __attribute__ ((gcc_struct));
490 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
494 struct Specifier * prev;
495 struct Specifier * next;
503 struct ExtDecl * extDecl;
505 struct Symbol * symbol;
506 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
507 } __attribute__ ((gcc_struct));
510 struct Identifier * id;
511 struct __ecereNameSpace__ecere__sys__OldList * list;
512 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
513 struct __ecereNameSpace__ecere__sys__OldList * definitions;
514 unsigned int addNameSpace;
515 struct Context * ctx;
516 } __attribute__ ((gcc_struct));
517 struct Expression * expression;
518 struct Specifier * _class;
519 struct TemplateParameter * templateParameter;
520 } __attribute__ ((gcc_struct));
521 } __attribute__ ((gcc_struct));
523 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
527 struct Identifier * prev;
528 struct Identifier * next;
530 struct Symbol * classSym;
531 struct Specifier * _class;
533 struct Identifier * badID;
534 } __attribute__ ((gcc_struct));
536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
544 struct Declarator * prev;
545 struct Declarator * next;
548 struct Symbol * symbol;
549 struct Declarator * declarator;
552 struct Identifier * identifier;
555 struct Expression * exp;
556 struct Expression * posExp;
557 struct Attrib * attrib;
558 } __attribute__ ((gcc_struct)) structDecl;
561 struct Expression * exp;
562 struct Specifier * enumClass;
563 } __attribute__ ((gcc_struct)) array;
566 struct __ecereNameSpace__ecere__sys__OldList * parameters;
567 } __attribute__ ((gcc_struct)) function;
570 struct Pointer * pointer;
571 } __attribute__ ((gcc_struct)) pointer;
574 struct ExtDecl * extended;
575 } __attribute__ ((gcc_struct)) extended;
576 } __attribute__ ((gcc_struct));
577 } __attribute__ ((gcc_struct));
579 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
581 struct FunctionDefinition
583 struct FunctionDefinition * prev;
584 struct FunctionDefinition * next;
586 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
587 struct Declarator * declarator;
588 struct __ecereNameSpace__ecere__sys__OldList * declarations;
589 struct Statement * body;
590 struct __ecereNameSpace__ecere__com__Class * _class;
591 struct __ecereNameSpace__ecere__sys__OldList attached;
594 struct Symbol * propSet;
596 unsigned int propertyNoThis;
597 } __attribute__ ((gcc_struct));
599 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
603 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
607 struct External * prev;
608 struct External * next;
611 struct Symbol * symbol;
614 struct FunctionDefinition * function;
615 struct ClassDefinition * _class;
616 struct Declaration * declaration;
618 struct Identifier * id;
619 struct DBTableDef * table;
620 } __attribute__ ((gcc_struct));
622 } __attribute__ ((gcc_struct));
624 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
628 struct ModuleImport * prev;
629 struct ModuleImport * next;
631 struct __ecereNameSpace__ecere__sys__OldList classes;
632 struct __ecereNameSpace__ecere__sys__OldList functions;
635 } __attribute__ ((gcc_struct));
637 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
641 struct ClassImport * prev;
642 struct ClassImport * next;
644 struct __ecereNameSpace__ecere__sys__OldList methods;
645 struct __ecereNameSpace__ecere__sys__OldList properties;
647 unsigned int isRemote;
648 } __attribute__ ((gcc_struct));
650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
655 struct Symbol * parent;
656 struct Symbol * left;
657 struct Symbol * right;
662 struct __ecereNameSpace__ecere__com__Method * method;
663 struct __ecereNameSpace__ecere__com__Property * _property;
664 struct __ecereNameSpace__ecere__com__Class * registered;
665 } __attribute__ ((gcc_struct));
672 struct External * pointerExternal;
673 struct External * structExternal;
674 } __attribute__ ((gcc_struct));
677 struct External * externalGet;
678 struct External * externalSet;
679 struct External * externalPtr;
680 struct External * externalIsSet;
681 } __attribute__ ((gcc_struct));
684 struct External * methodExternal;
685 struct External * methodCodeExternal;
686 } __attribute__ ((gcc_struct));
687 } __attribute__ ((gcc_struct));
688 unsigned int imported;
689 unsigned int declaredStructSym;
690 struct __ecereNameSpace__ecere__com__Class * _class;
691 unsigned int declaredStruct;
692 unsigned int needConstructor;
693 unsigned int needDestructor;
694 char * constructorName;
697 char * destructorName;
698 struct ModuleImport * module;
699 struct ClassImport * _import;
700 struct Location nameLoc;
701 unsigned int isParam;
702 unsigned int isRemote;
703 unsigned int isStruct;
704 unsigned int fireWatchersDone;
706 unsigned int classData;
707 unsigned int isStatic;
709 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
710 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
711 struct Context * ctx;
713 struct Expression * propCategory;
714 } __attribute__ ((gcc_struct));
716 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
725 struct Symbol * _class;
728 struct __ecereNameSpace__ecere__sys__OldList members;
730 } __attribute__ ((gcc_struct));
733 struct Type * returnType;
734 struct __ecereNameSpace__ecere__sys__OldList params;
735 struct Symbol * thisClass;
736 unsigned int staticMethod;
737 struct TemplateParameter * thisClassTemplate;
738 } __attribute__ ((gcc_struct));
741 struct __ecereNameSpace__ecere__com__Method * method;
742 struct __ecereNameSpace__ecere__com__Class * methodClass;
743 struct __ecereNameSpace__ecere__com__Class * usedClass;
744 } __attribute__ ((gcc_struct));
747 struct Type * arrayType;
749 struct Expression * arraySizeExp;
750 unsigned int freeExp;
751 struct Symbol * enumClass;
752 } __attribute__ ((gcc_struct));
754 struct TemplateParameter * templateParameter;
755 } __attribute__ ((gcc_struct));
756 unsigned int isSigned;
758 unsigned int constant;
765 unsigned int byReference;
766 unsigned int extraParam;
768 unsigned int directClassAccess;
769 unsigned int computing;
770 unsigned int dllExport;
772 unsigned int keepCast;
773 unsigned int passAsTemplate;
775 } __attribute__ ((gcc_struct));
777 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
779 struct __ecereNameSpace__ecere__com__Class
781 struct __ecereNameSpace__ecere__com__Class * prev;
782 struct __ecereNameSpace__ecere__com__Class * next;
788 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
789 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
792 struct __ecereNameSpace__ecere__com__Class * base;
793 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
794 struct __ecereNameSpace__ecere__sys__BinaryTree members;
795 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
796 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
797 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
798 struct __ecereNameSpace__ecere__sys__OldList derivatives;
802 struct __ecereNameSpace__ecere__com__Instance * module;
803 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
804 char * dataTypeString;
805 struct Type * dataType;
807 int defaultAlignment;
808 void (* Initialize)();
810 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
811 char * designerClass;
812 unsigned int noExpansion;
813 char * defaultProperty;
814 unsigned int comRedefinition;
816 unsigned int isRemote;
817 unsigned int internalDecl;
819 unsigned int computeSize;
821 int destructionWatchOffset;
823 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
824 int inheritanceAccess;
827 struct __ecereNameSpace__ecere__sys__OldList conversions;
828 struct __ecereNameSpace__ecere__sys__OldList templateParams;
829 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
830 struct __ecereNameSpace__ecere__com__Class * templateClass;
831 struct __ecereNameSpace__ecere__sys__OldList templatized;
833 } __attribute__ ((gcc_struct));
835 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
837 struct __ecereNameSpace__ecere__com__Instance
840 struct __ecereNameSpace__ecere__com__Class * _class;
842 } __attribute__ ((gcc_struct));
844 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
846 struct __ecereNameSpace__ecere__com__DataMember
848 struct __ecereNameSpace__ecere__com__DataMember * prev;
849 struct __ecereNameSpace__ecere__com__DataMember * next;
851 unsigned int isProperty;
854 struct __ecereNameSpace__ecere__com__Class * _class;
855 char * dataTypeString;
856 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
857 struct Type * dataType;
861 struct __ecereNameSpace__ecere__sys__OldList members;
862 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
865 } __attribute__ ((gcc_struct));
867 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
869 struct __ecereNameSpace__ecere__com__SerialBuffer
871 unsigned char * _buffer;
875 } __attribute__ ((gcc_struct));
877 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
879 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
885 char * dataTypeString;
886 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
887 } __attribute__ ((gcc_struct));
888 struct __ecereNameSpace__ecere__com__DataValue expression;
894 struct __ecereNameSpace__ecere__com__DataMember * member;
895 struct __ecereNameSpace__ecere__com__Property * prop;
896 struct __ecereNameSpace__ecere__com__Method * method;
897 } __attribute__ ((gcc_struct));
898 } __attribute__ ((gcc_struct));
899 } __attribute__ ((gcc_struct));
900 } __attribute__ ((gcc_struct));
902 typedef unsigned int size_t;
904 void exit(int status);
906 void * calloc(size_t nmemb, size_t size);
908 void free(void * ptr);
910 void * malloc(size_t size);
912 void * realloc(void * ptr, size_t size);
914 long int strtol(const char * nptr, char ** endptr, int base);
916 long long int strtoll(const char * nptr, char ** endptr, int base);
918 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
922 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
925 typedef union YYSTYPE
930 struct Identifier * id;
931 struct Expression * exp;
932 struct Specifier * specifier;
933 struct __ecereNameSpace__ecere__sys__OldList * list;
934 struct Enumerator * enumerator;
935 struct Declarator * declarator;
936 struct Pointer * pointer;
937 struct Initializer * initializer;
938 struct InitDeclarator * initDeclarator;
939 struct TypeName * typeName;
940 struct Declaration * declaration;
941 struct Statement * stmt;
942 struct FunctionDefinition * function;
943 struct External * external;
944 struct Context * context;
945 struct AsmField * asmField;
946 struct Attrib * attrib;
947 struct ExtDecl * extDecl;
948 struct Attribute * attribute;
949 struct Instantiation * instance;
950 struct MembersInit * membersInit;
951 struct MemberInit * memberInit;
952 struct ClassFunction * classFunction;
953 struct ClassDefinition * _class;
954 struct ClassDef * classDef;
955 struct PropertyDef * prop;
957 struct Symbol * symbol;
958 struct PropertyWatch * propertyWatch;
959 struct TemplateParameter * templateParameter;
960 struct TemplateArgument * templateArgument;
961 struct TemplateDatatype * templateDatatype;
962 struct DBTableEntry * dbtableEntry;
963 struct DBIndexItem * dbindexItem;
964 struct DBTableDef * dbtableDef;
965 } __attribute__ ((gcc_struct)) YYSTYPE;
967 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
971 struct Enumerator * prev;
972 struct Enumerator * next;
974 struct Identifier * id;
975 struct Expression * exp;
976 } __attribute__ ((gcc_struct));
978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
980 struct InitDeclarator
982 struct InitDeclarator * prev;
983 struct InitDeclarator * next;
985 struct Declarator * declarator;
986 struct Initializer * initializer;
987 } __attribute__ ((gcc_struct));
989 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
993 struct AsmField * prev;
994 struct AsmField * next;
997 struct Expression * expression;
998 } __attribute__ ((gcc_struct));
1000 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1004 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1006 struct ClassFunction
1008 struct ClassFunction * prev;
1009 struct ClassFunction * next;
1010 struct Location loc;
1011 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1012 struct Declarator * declarator;
1013 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1014 struct Statement * body;
1015 struct __ecereNameSpace__ecere__com__Class * _class;
1016 struct __ecereNameSpace__ecere__sys__OldList attached;
1019 struct Symbol * propSet;
1020 unsigned int isVirtual;
1021 unsigned int isConstructor;
1022 unsigned int isDestructor;
1023 unsigned int dontMangle;
1026 } __attribute__ ((gcc_struct));
1028 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1032 struct MembersInit * prev;
1033 struct MembersInit * next;
1034 struct Location loc;
1038 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1039 struct ClassFunction * function;
1040 } __attribute__ ((gcc_struct));
1041 } __attribute__ ((gcc_struct));
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1047 struct MemberInit * prev;
1048 struct MemberInit * next;
1049 struct Location loc;
1050 struct Location realLoc;
1051 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1052 struct Initializer * initializer;
1054 unsigned int variable;
1055 unsigned int takeOutExp;
1056 } __attribute__ ((gcc_struct));
1058 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1062 struct PropertyDef * prev;
1063 struct PropertyDef * next;
1064 struct Location loc;
1065 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1066 struct Declarator * declarator;
1067 struct Identifier * id;
1068 struct Statement * getStmt;
1069 struct Statement * setStmt;
1070 struct Statement * issetStmt;
1071 struct Symbol * symbol;
1072 unsigned int conversion;
1073 unsigned int isWatchable;
1074 struct Expression * category;
1075 } __attribute__ ((gcc_struct));
1077 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1079 struct PropertyWatch
1081 struct PropertyWatch * prev;
1082 struct PropertyWatch * next;
1083 struct Location loc;
1084 struct Statement * compound;
1085 struct __ecereNameSpace__ecere__sys__OldList * properties;
1086 unsigned int deleteWatch;
1087 } __attribute__ ((gcc_struct));
1089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1093 struct ClassDef * prev;
1094 struct ClassDef * next;
1095 struct Location loc;
1099 struct Declaration * decl;
1100 struct ClassFunction * function;
1101 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1102 struct PropertyDef * propertyDef;
1103 struct PropertyWatch * propertyWatch;
1105 struct Identifier * defaultProperty;
1108 struct Identifier * id;
1109 struct Initializer * initializer;
1110 } __attribute__ ((gcc_struct));
1111 } __attribute__ ((gcc_struct));
1114 } __attribute__ ((gcc_struct));
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1118 struct DBTableEntry;
1120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1124 extern YYSTYPE yylval;
1126 extern struct Location yylloc;
1128 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1130 extern int returnCode;
1132 extern struct Expression * parsedExpression;
1134 extern unsigned int yydebug;
1136 void SetYydebug(unsigned int b)
1141 extern unsigned int echoOn;
1143 void resetScanner();
1147 int expression_yyparse();
1149 static struct Statement * curCompound;
1151 struct External * curExternal, * afterExternal;
1153 static struct Type * curSwitchType;
1155 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1157 struct __ecereNameSpace__ecere__com__Class * thisClass;
1159 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1164 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1169 static char * thisNameSpace;
1171 struct __ecereNameSpace__ecere__com__Class * containerClass;
1173 unsigned int thisClassParams = 0x1;
1175 unsigned int internalValueCounter;
1177 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1179 struct __ecereNameSpace__ecere__sys__TempFile
1181 char __ecere_padding[24];
1182 } __attribute__ ((gcc_struct));
1184 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1186 extern int strlen(const char * );
1188 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1190 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1192 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1194 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1196 void PrintExpression(struct Expression * exp, char * string)
1199 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1203 OutputExpression(exp, f);
1204 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1205 count = strlen(string);
1206 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1207 string[count] = '\0';
1208 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1212 extern int isspace(int c);
1214 long long _strtoi64(char * string, char ** endString, int base)
1216 long long value = 0;
1221 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1233 if(ch == (char)0 && string[c + 1] == 'x')
1246 for(; (ch = string[c]); c++)
1250 else if(ch >= '1' && ch <= '9')
1252 else if(ch >= 'a' && ch <= 'z')
1254 else if(ch >= 'A' && ch <= 'Z')
1259 *endString = string + c;
1270 *endString = string + c;
1274 return sign * value;
1277 uint64 _strtoui64(char * string, char ** endString, int base)
1284 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1296 if(ch == (char)0 && string[c + 1] == 'x')
1309 for(; (ch = string[c]); c++)
1313 else if(ch >= '1' && ch <= '9')
1315 else if(ch >= 'a' && ch <= 'z')
1317 else if(ch >= 'A' && ch <= 'Z')
1322 *endString = string + c;
1333 *endString = string + c;
1337 return sign * value;
1340 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1342 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1344 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1346 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1348 if(!param->baseType)
1350 if(param->dataTypeString)
1351 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1353 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1355 return param->baseType;
1357 return (((void *)0));
1360 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1362 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1364 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1368 if(type1->kind == type2->kind)
1376 if(type1->passAsTemplate && !type2->passAsTemplate)
1378 return type1->isSigned != type2->isSigned;
1380 return type1->_class != type2->_class;
1382 return NeedCast(type1->type, type2->type);
1390 extern int strcmp(const char * , const char * );
1392 extern struct Context * curContext;
1394 extern struct Context * topContext;
1396 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1398 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1400 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1402 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1404 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1408 struct __ecereNameSpace__ecere__com__ClassProperty
1411 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1412 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1413 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1415 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1416 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1417 char * dataTypeString;
1418 struct Type * dataType;
1419 unsigned int constant;
1420 } __attribute__ ((gcc_struct));
1422 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1424 extern struct Expression * QMkExpId(char * id);
1426 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1428 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1431 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1436 char * dataTypeString;
1438 } __attribute__ ((gcc_struct));
1439 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1441 char __ecere_padding[4];
1442 } __attribute__ ((gcc_struct));
1444 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1446 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1448 extern void FreeIdentifier(struct Identifier * id);
1450 void ProcessExpressionType(struct Expression * exp);
1452 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1454 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1456 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1458 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1460 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1462 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1464 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1466 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1468 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1470 if(exp->type == 0 && exp->identifier)
1472 struct Identifier * id = exp->identifier;
1473 struct Context * ctx;
1474 struct Symbol * symbol = (((void *)0));
1476 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1478 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1480 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1485 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1487 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1488 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1489 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1490 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1494 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1496 if(!prop && !method)
1497 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1498 if(!prop && !method && !member)
1500 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1502 if(prop || method || member || classProp)
1505 exp->member.member = id;
1506 exp->member.memberType = 0;
1507 exp->member.exp = QMkExpId("this");
1508 exp->addedThis = 0x1;
1510 else if(_class && _class->templateParams.first)
1512 struct __ecereNameSpace__ecere__com__Class * sClass;
1514 for(sClass = _class; sClass; sClass = sClass->base)
1516 if(sClass->templateParams.first)
1518 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1520 for(param = sClass->templateParams.first; param; param = param->next)
1522 if(param->type == 2 && !strcmp(param->name, id->string))
1524 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1528 struct Declarator * decl;
1529 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1531 FreeIdentifier(exp->member.member);
1532 ProcessExpressionType(argExp);
1533 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1534 exp->expType = ProcessType(specs, decl);
1536 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1547 extern int sprintf(char * , char * , ...);
1549 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1551 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1553 char * PrintInt(long long result)
1557 if(result > (((long long)0x7fffffffffffffffLL)))
1558 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1560 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1561 return __ecereNameSpace__ecere__sys__CopyString(temp);
1564 char * PrintUInt(uint64 result)
1568 if(result > (0xffffffff))
1569 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1570 else if(result > (((int)0x7fffffff)))
1571 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1573 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1574 return __ecereNameSpace__ecere__sys__CopyString(temp);
1577 char * PrintInt64(long long result)
1581 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1582 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 char * PrintUInt64(uint64 result)
1589 if(result > (((long long)0x7fffffffffffffffLL)))
1590 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1592 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1593 return __ecereNameSpace__ecere__sys__CopyString(temp);
1596 char * PrintHexUInt(uint64 result)
1600 if(result > (0xffffffff))
1601 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1603 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1604 return __ecereNameSpace__ecere__sys__CopyString(temp);
1607 char * PrintHexUInt64(uint64 result)
1611 if(result > (0xffffffff))
1612 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1614 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1615 return __ecereNameSpace__ecere__sys__CopyString(temp);
1618 char * PrintShort(short result)
1622 sprintf(temp, "%d", (unsigned short)result);
1623 return __ecereNameSpace__ecere__sys__CopyString(temp);
1626 char * PrintUShort(unsigned short result)
1630 if(result > (unsigned short)32767)
1631 sprintf(temp, "0x%X", (int)result);
1633 sprintf(temp, "%d", result);
1634 return __ecereNameSpace__ecere__sys__CopyString(temp);
1637 extern int isprint(int c);
1639 char * PrintChar(char result)
1643 if(result > (char)0 && isprint(result))
1644 sprintf(temp, "'%c'", result);
1645 else if(result < (char)0)
1646 sprintf(temp, "%d", result);
1648 sprintf(temp, "0x%X", (unsigned char)result);
1649 return __ecereNameSpace__ecere__sys__CopyString(temp);
1652 char * PrintUChar(unsigned char result)
1656 sprintf(temp, "0x%X", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 char * PrintFloat(float result)
1664 sprintf(temp, "%.16ff", result);
1665 return __ecereNameSpace__ecere__sys__CopyString(temp);
1668 char * PrintDouble(double result)
1672 sprintf(temp, "%.16f", result);
1673 return __ecereNameSpace__ecere__sys__CopyString(temp);
1676 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1680 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* Neg)(struct Expression *, struct Operand *);
1686 unsigned int (* Inc)(struct Expression *, struct Operand *);
1687 unsigned int (* Dec)(struct Expression *, struct Operand *);
1688 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1700 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* Not)(struct Expression *, struct Operand *);
1706 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1715 } __attribute__ ((gcc_struct));
1717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1723 unsigned int ptrSize;
1737 } __attribute__ ((gcc_struct));
1739 } __attribute__ ((gcc_struct));
1741 struct Operand GetOperand(struct Expression * exp);
1743 unsigned int GetInt(struct Expression * exp, int * value2)
1745 struct Operand op2 = GetOperand(exp);
1747 if(op2.kind == 3 && op2.type->isSigned)
1749 else if(op2.kind == 3)
1750 *value2 = (int)op2.ui;
1751 if(op2.kind == 4 && op2.type->isSigned)
1752 *value2 = (int)op2.i64;
1753 else if(op2.kind == 4)
1754 *value2 = (int)op2.ui64;
1755 else if(op2.kind == 2 && op2.type->isSigned)
1756 *value2 = (int)op2.s;
1757 else if(op2.kind == 2)
1758 *value2 = (int)op2.us;
1759 else if(op2.kind == 1 && op2.type->isSigned)
1760 *value2 = (int)op2.c;
1761 else if(op2.kind == 1)
1762 *value2 = (int)op2.uc;
1763 else if(op2.kind == 6)
1764 *value2 = (int)op2.f;
1765 else if(op2.kind == 7)
1766 *value2 = (int)op2.d;
1767 else if(op2.kind == 13)
1768 *value2 = (int)op2.ui;
1774 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1776 struct Operand op2 = GetOperand(exp);
1778 if(op2.kind == 3 && op2.type->isSigned)
1779 *value2 = (unsigned int)op2.i;
1780 else if(op2.kind == 3)
1782 if(op2.kind == 4 && op2.type->isSigned)
1783 *value2 = (unsigned int)op2.i64;
1784 else if(op2.kind == 4)
1785 *value2 = (unsigned int)op2.ui64;
1786 else if(op2.kind == 2 && op2.type->isSigned)
1787 *value2 = (unsigned int)op2.s;
1788 else if(op2.kind == 2)
1789 *value2 = (unsigned int)op2.us;
1790 else if(op2.kind == 1 && op2.type->isSigned)
1791 *value2 = (unsigned int)op2.c;
1792 else if(op2.kind == 1)
1793 *value2 = (unsigned int)op2.uc;
1794 else if(op2.kind == 6)
1795 *value2 = (unsigned int)op2.f;
1796 else if(op2.kind == 7)
1797 *value2 = (unsigned int)op2.d;
1798 else if(op2.kind == 13)
1805 unsigned int GetInt64(struct Expression * exp, long long * value2)
1807 struct Operand op2 = GetOperand(exp);
1809 if(op2.kind == 3 && op2.type->isSigned)
1810 *value2 = (long long)op2.i;
1811 else if(op2.kind == 3)
1812 *value2 = (long long)op2.ui;
1813 if(op2.kind == 4 && op2.type->isSigned)
1815 else if(op2.kind == 4)
1816 *value2 = (long long)op2.ui64;
1817 else if(op2.kind == 2 && op2.type->isSigned)
1818 *value2 = (long long)op2.s;
1819 else if(op2.kind == 2)
1820 *value2 = (long long)op2.us;
1821 else if(op2.kind == 1 && op2.type->isSigned)
1822 *value2 = (long long)op2.c;
1823 else if(op2.kind == 1)
1824 *value2 = (long long)op2.uc;
1825 else if(op2.kind == 6)
1826 *value2 = (long long)op2.f;
1827 else if(op2.kind == 7)
1828 *value2 = (long long)op2.d;
1829 else if(op2.kind == 13)
1830 *value2 = (long long)op2.ui;
1836 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1838 struct Operand op2 = GetOperand(exp);
1840 if(op2.kind == 3 && op2.type->isSigned)
1841 *value2 = (uint64)op2.i;
1842 else if(op2.kind == 3)
1843 *value2 = (uint64)op2.ui;
1844 if(op2.kind == 4 && op2.type->isSigned)
1845 *value2 = (uint64)op2.i64;
1846 else if(op2.kind == 4)
1848 else if(op2.kind == 2 && op2.type->isSigned)
1849 *value2 = (uint64)op2.s;
1850 else if(op2.kind == 2)
1851 *value2 = (uint64)op2.us;
1852 else if(op2.kind == 1 && op2.type->isSigned)
1853 *value2 = (uint64)op2.c;
1854 else if(op2.kind == 1)
1855 *value2 = (uint64)op2.uc;
1856 else if(op2.kind == 6)
1857 *value2 = (uint64)op2.f;
1858 else if(op2.kind == 7)
1859 *value2 = (uint64)op2.d;
1860 else if(op2.kind == 13)
1861 *value2 = (uint64)op2.ui;
1867 unsigned int GetShort(struct Expression * exp, short * value2)
1869 struct Operand op2 = GetOperand(exp);
1871 if(op2.kind == 3 && op2.type->isSigned)
1872 *value2 = (short)op2.i;
1873 else if(op2.kind == 3)
1874 *value2 = (short)op2.ui;
1875 if(op2.kind == 4 && op2.type->isSigned)
1876 *value2 = (short)op2.i64;
1877 else if(op2.kind == 4)
1878 *value2 = (short)op2.ui64;
1879 else if(op2.kind == 2 && op2.type->isSigned)
1881 else if(op2.kind == 2)
1882 *value2 = (short)op2.us;
1883 else if(op2.kind == 1 && op2.type->isSigned)
1884 *value2 = (short)op2.c;
1885 else if(op2.kind == 1)
1886 *value2 = (short)op2.uc;
1887 else if(op2.kind == 6)
1888 *value2 = (short)op2.f;
1889 else if(op2.kind == 7)
1890 *value2 = (short)op2.d;
1891 else if(op2.kind == 13)
1892 *value2 = (short)op2.ui;
1898 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1900 struct Operand op2 = GetOperand(exp);
1902 if(op2.kind == 3 && op2.type->isSigned)
1903 *value2 = (unsigned short)op2.i;
1904 else if(op2.kind == 3)
1905 *value2 = (unsigned short)op2.ui;
1906 if(op2.kind == 4 && op2.type->isSigned)
1907 *value2 = (unsigned short)op2.i64;
1908 else if(op2.kind == 4)
1909 *value2 = (unsigned short)op2.ui64;
1910 else if(op2.kind == 2 && op2.type->isSigned)
1911 *value2 = (unsigned short)op2.s;
1912 else if(op2.kind == 2)
1914 else if(op2.kind == 1 && op2.type->isSigned)
1915 *value2 = (unsigned short)op2.c;
1916 else if(op2.kind == 1)
1917 *value2 = (unsigned short)op2.uc;
1918 else if(op2.kind == 6)
1919 *value2 = (unsigned short)op2.f;
1920 else if(op2.kind == 7)
1921 *value2 = (unsigned short)op2.d;
1922 else if(op2.kind == 13)
1923 *value2 = (unsigned short)op2.ui;
1929 unsigned int GetChar(struct Expression * exp, char * value2)
1931 struct Operand op2 = GetOperand(exp);
1933 if(op2.kind == 3 && op2.type->isSigned)
1934 *value2 = (char)op2.i;
1935 else if(op2.kind == 3)
1936 *value2 = (char)op2.ui;
1937 if(op2.kind == 4 && op2.type->isSigned)
1938 *value2 = (char)op2.i64;
1939 else if(op2.kind == 4)
1940 *value2 = (char)op2.ui64;
1941 else if(op2.kind == 2 && op2.type->isSigned)
1942 *value2 = (char)op2.s;
1943 else if(op2.kind == 2)
1944 *value2 = (char)op2.us;
1945 else if(op2.kind == 1 && op2.type->isSigned)
1947 else if(op2.kind == 1)
1948 *value2 = (char)op2.uc;
1949 else if(op2.kind == 6)
1950 *value2 = (char)op2.f;
1951 else if(op2.kind == 7)
1952 *value2 = (char)op2.d;
1953 else if(op2.kind == 13)
1954 *value2 = (char)op2.ui;
1960 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1962 struct Operand op2 = GetOperand(exp);
1964 if(op2.kind == 3 && op2.type->isSigned)
1965 *value2 = (unsigned char)op2.i;
1966 else if(op2.kind == 3)
1967 *value2 = (unsigned char)op2.ui;
1968 if(op2.kind == 4 && op2.type->isSigned)
1969 *value2 = (unsigned char)op2.i64;
1970 else if(op2.kind == 4)
1971 *value2 = (unsigned char)op2.ui64;
1972 else if(op2.kind == 2 && op2.type->isSigned)
1973 *value2 = (unsigned char)op2.s;
1974 else if(op2.kind == 2)
1975 *value2 = (unsigned char)op2.us;
1976 else if(op2.kind == 1 && op2.type->isSigned)
1977 *value2 = (unsigned char)op2.c;
1978 else if(op2.kind == 1)
1980 else if(op2.kind == 6)
1981 *value2 = (unsigned char)op2.f;
1982 else if(op2.kind == 7)
1983 *value2 = (unsigned char)op2.d;
1984 else if(op2.kind == 13)
1985 *value2 = (unsigned char)op2.ui;
1991 unsigned int GetFloat(struct Expression * exp, float * value2)
1993 struct Operand op2 = GetOperand(exp);
1995 if(op2.kind == 3 && op2.type->isSigned)
1996 *value2 = (float)(float)op2.i;
1997 else if(op2.kind == 3)
1998 *value2 = (float)(float)op2.ui;
1999 if(op2.kind == 4 && op2.type->isSigned)
2000 *value2 = (float)(float)op2.i64;
2001 else if(op2.kind == 4)
2002 *value2 = (float)(float)op2.ui64;
2003 else if(op2.kind == 2 && op2.type->isSigned)
2004 *value2 = (float)(float)op2.s;
2005 else if(op2.kind == 2)
2006 *value2 = (float)(float)op2.us;
2007 else if(op2.kind == 1 && op2.type->isSigned)
2008 *value2 = (float)(float)op2.c;
2009 else if(op2.kind == 1)
2010 *value2 = (float)(float)op2.uc;
2011 else if(op2.kind == 6)
2012 *value2 = (float)op2.f;
2013 else if(op2.kind == 7)
2014 *value2 = (float)op2.d;
2015 else if(op2.kind == 13)
2016 *value2 = (float)(float)op2.ui;
2022 unsigned int GetDouble(struct Expression * exp, double * value2)
2024 struct Operand op2 = GetOperand(exp);
2026 if(op2.kind == 3 && op2.type->isSigned)
2027 *value2 = (double)(double)op2.i;
2028 else if(op2.kind == 3)
2029 *value2 = (double)(double)op2.ui;
2030 if(op2.kind == 4 && op2.type->isSigned)
2031 *value2 = (double)(double)op2.i64;
2032 else if(op2.kind == 4)
2033 *value2 = (double)(double)op2.ui64;
2034 else if(op2.kind == 2 && op2.type->isSigned)
2035 *value2 = (double)(double)op2.s;
2036 else if(op2.kind == 2)
2037 *value2 = (double)(double)op2.us;
2038 else if(op2.kind == 1 && op2.type->isSigned)
2039 *value2 = (double)(double)op2.c;
2040 else if(op2.kind == 1)
2041 *value2 = (double)(double)op2.uc;
2042 else if(op2.kind == 6)
2043 *value2 = (double)op2.f;
2044 else if(op2.kind == 7)
2045 *value2 = (double)op2.d;
2046 else if(op2.kind == 13)
2047 *value2 = (double)(double)op2.ui;
2053 void ComputeExpression(struct Expression * exp);
2055 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2057 int ComputeTypeSize(struct Type * type);
2059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2061 struct __ecereNameSpace__ecere__com__BitMember
2063 struct __ecereNameSpace__ecere__com__BitMember * prev;
2064 struct __ecereNameSpace__ecere__com__BitMember * next;
2066 unsigned int isProperty;
2069 struct __ecereNameSpace__ecere__com__Class * _class;
2070 char * dataTypeString;
2071 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2072 struct Type * dataType;
2077 } __attribute__ ((gcc_struct));
2079 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2081 struct __ecereNameSpace__ecere__sys__OldLink
2083 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2084 struct __ecereNameSpace__ecere__sys__OldLink * next;
2086 } __attribute__ ((gcc_struct));
2088 void FinishTemplatesContext(struct Context * context);
2090 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2092 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2093 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2095 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2098 int unionMemberOffset = 0;
2101 if(!member && _class->destructionWatchOffset)
2102 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2104 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2106 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2108 if(!dataMember->isProperty)
2110 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2112 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2118 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2120 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2122 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2124 if(!isMember && _class->type == 2 && dataMember->dataType)
2126 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2130 ComputeTypeSize(dataMember->dataType);
2131 if(bitMember->pos == -1)
2132 bitMember->pos = _class->memberOffset;
2133 if(!bitMember->size)
2134 bitMember->size = dataMember->dataType->size * 8;
2135 _class->memberOffset = bitMember->pos + bitMember->size;
2136 for(d = 0; d < bitMember->size; d++)
2142 bitMember->mask = mask << bitMember->pos;
2144 else if(dataMember->type == 0 && dataMember->dataType)
2149 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2150 ComputeTypeSize(dataMember->dataType);
2151 if(dataMember->dataType->bitFieldCount)
2153 bitFields += dataMember->dataType->bitFieldCount;
2160 int size = (bitFields + 7) / 8;
2164 int __simpleStruct0;
2168 int __simpleStruct0;
2170 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2171 if(member->memberOffset % alignment)
2172 member->memberOffset += alignment - (member->memberOffset % alignment);
2174 dataMember->offset = member->memberOffset;
2175 if(member->type == 1)
2176 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2179 member->memberOffset += size;
2186 int __simpleStruct0;
2188 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2189 if(_class->memberOffset % alignment)
2190 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2192 dataMember->offset = _class->memberOffset;
2193 _class->memberOffset += size;
2197 size = dataMember->dataType->size;
2198 alignment = dataMember->dataType->alignment;
2202 int __simpleStruct0;
2206 int __simpleStruct0;
2208 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2209 if(member->memberOffset % alignment)
2210 member->memberOffset += alignment - (member->memberOffset % alignment);
2212 dataMember->offset = member->memberOffset;
2213 if(member->type == 1)
2214 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2217 member->memberOffset += size;
2224 int __simpleStruct0;
2226 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2227 if(_class->memberOffset % alignment)
2228 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2230 dataMember->offset = _class->memberOffset;
2231 _class->memberOffset += size;
2236 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2239 int __simpleStruct2;
2240 int __simpleStruct0, __simpleStruct1;
2242 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2243 dataMember->offset = member->memberOffset;
2244 if(member->type == 1)
2245 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2247 member->memberOffset += dataMember->memberOffset;
2251 int __simpleStruct0, __simpleStruct1;
2253 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2254 dataMember->offset = _class->memberOffset;
2255 _class->memberOffset += dataMember->memberOffset;
2263 int size = (bitFields + 7) / 8;
2267 int __simpleStruct0;
2271 int __simpleStruct0;
2273 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2274 if(member->memberOffset % alignment)
2275 member->memberOffset += alignment - (member->memberOffset % alignment);
2277 if(member->type == 1)
2278 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2281 member->memberOffset += size;
2288 int __simpleStruct0;
2290 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2291 if(_class->memberOffset % alignment)
2292 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2294 _class->memberOffset += size;
2299 if(member && member->type == 1)
2301 member->memberOffset = unionMemberOffset;
2305 if(_class->type != 2)
2307 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2310 struct __ecereNameSpace__ecere__com__Property * prop;
2312 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2314 if(prop->isProperty && prop->isWatchable)
2316 prop->watcherOffset = _class->structSize;
2317 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2322 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2324 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2326 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2328 if(deriv->computeSize)
2330 deriv->offset = _class->structSize;
2331 deriv->memberOffset = 0;
2332 deriv->structSize = deriv->offset;
2333 ComputeClassMembers(deriv, 0x0);
2341 FinishTemplatesContext(context);
2344 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2346 struct __ecereNameSpace__ecere__com__NameSpace
2349 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2350 struct __ecereNameSpace__ecere__com__NameSpace * left;
2351 struct __ecereNameSpace__ecere__com__NameSpace * right;
2353 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2354 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2355 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2356 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2357 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2358 } __attribute__ ((gcc_struct));
2360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2362 struct __ecereNameSpace__ecere__com__Module
2364 struct __ecereNameSpace__ecere__com__Instance * application;
2365 struct __ecereNameSpace__ecere__sys__OldList classes;
2366 struct __ecereNameSpace__ecere__sys__OldList defines;
2367 struct __ecereNameSpace__ecere__sys__OldList functions;
2368 struct __ecereNameSpace__ecere__sys__OldList modules;
2369 struct __ecereNameSpace__ecere__com__Instance * prev;
2370 struct __ecereNameSpace__ecere__com__Instance * next;
2376 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2377 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2378 } __attribute__ ((gcc_struct));
2380 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2382 struct __ecereNameSpace__ecere__com__Class * _class;
2383 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2385 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2386 ComputeModuleClasses(subModule->data);
2387 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2388 ComputeClassMembers(_class, 0x0);
2391 extern unsigned int inCompiler;
2393 extern void Compiler_Error(char * format, ...);
2395 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2397 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2399 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2401 int ComputeTypeSize(struct Type * type)
2403 unsigned int size = type ? type->size : 0;
2405 if(!size && type && !type->computing)
2407 type->computing = 0x1;
2411 type->alignment = size = sizeof(char);
2414 type->alignment = size = sizeof(int);
2417 type->alignment = size = sizeof(long long);
2420 type->alignment = size = sizeof(long);
2423 type->alignment = size = sizeof(short);
2426 type->alignment = size = sizeof(float);
2429 type->alignment = size = sizeof(double);
2433 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2435 if(_class && _class->type == 1)
2437 ComputeClassMembers(_class, 0x0);
2438 type->alignment = _class->structAlignment;
2439 size = _class->structSize;
2440 if(type->alignment && size % type->alignment)
2441 size += type->alignment - (size % type->alignment);
2443 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2445 if(!_class->dataType)
2446 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2447 size = type->alignment = ComputeTypeSize(_class->dataType);
2450 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2455 size = type->alignment = sizeof(void *);
2458 if(type->arraySizeExp)
2460 ProcessExpressionType(type->arraySizeExp);
2461 ComputeExpression(type->arraySizeExp);
2462 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2464 struct Location oldLoc = yylloc;
2465 char expression[10240];
2467 expression[0] = '\0';
2468 type->arraySizeExp->expType = (((void *)0));
2469 yylloc = type->arraySizeExp->loc;
2471 PrintExpression(type->arraySizeExp, expression);
2472 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2475 GetInt(type->arraySizeExp, &type->arraySize);
2477 else if(type->enumClass)
2479 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2481 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2484 type->arraySize = 0;
2488 type->arraySize = 0;
2490 size = ComputeTypeSize(type->type) * type->arraySize;
2491 type->alignment = type->type->alignment;
2495 struct Type * member;
2497 for(member = type->members.first; member; member = member->next)
2499 int __simpleStruct0, __simpleStruct1;
2500 unsigned int addSize = ComputeTypeSize(member);
2502 member->offset = size;
2503 if(member->alignment && size % member->alignment)
2504 member->offset += member->alignment - (size % member->alignment);
2505 size = member->offset;
2506 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2509 if(type->alignment && size % type->alignment)
2510 size += type->alignment - (size % type->alignment);
2515 struct Type * member;
2517 for(member = type->members.first; member; member = member->next)
2519 int __simpleStruct0, __simpleStruct1;
2520 unsigned int addSize = ComputeTypeSize(member);
2522 member->offset = size;
2523 if(member->alignment && size % member->alignment)
2524 member->offset += member->alignment - (size % member->alignment);
2525 size = member->offset;
2526 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2527 size = ((size > addSize) ? size : addSize);
2529 if(type->alignment && size % type->alignment)
2530 size += type->alignment - (size % type->alignment);
2535 struct TemplateParameter * param = type->templateParameter;
2536 struct Type * baseType = ProcessTemplateParameterType(param);
2539 size = ComputeTypeSize(baseType);
2541 size = sizeof(uint64);
2554 size = sizeof(void *);
2559 type->computing = 0x0;
2564 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2566 extern struct Identifier * MkIdentifier(char * string);
2568 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2570 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2572 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2574 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2576 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2578 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2580 extern void FreeType(struct Type * type);
2582 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2584 extern struct Specifier * MkSpecifier(int specifier);
2586 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2588 extern struct Expression * MkExpConstant(char * string);
2590 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)
2592 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2593 unsigned int totalSize = 0;
2594 unsigned int maxSize = 0;
2595 int alignment, size;
2596 struct __ecereNameSpace__ecere__com__DataMember * member;
2597 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2599 if(!isMember && _class->base)
2601 maxSize = _class->structSize;
2603 if(_class->type == 1 || _class->type == 5)
2604 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2606 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2609 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2611 if(!member->isProperty)
2613 switch(member->type)
2617 if(member->dataTypeString)
2619 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2620 struct Declarator * decl;
2622 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2623 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2624 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2625 if(!member->dataType)
2626 member->dataType = ProcessType(specs, decl);
2627 ReplaceThisClassSpecifiers(specs, topClass);
2629 struct Type * type = ProcessType(specs, decl);
2631 DeclareType(member->dataType, 0x0, 0x0);
2634 ComputeTypeSize(member->dataType);
2635 size = member->dataType->size;
2636 alignment = member->dataType->alignment;
2639 if(totalSize % alignment)
2640 totalSize += alignment - (totalSize % alignment);
2649 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2652 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2653 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2654 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2655 alignment = member->structAlignment;
2658 if(totalSize % alignment)
2659 totalSize += alignment - (totalSize % alignment);
2669 unsigned int __simpleStruct0;
2671 if(topMember && topMember->type == 1)
2672 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2674 *retSize += totalSize;
2676 else if(totalSize < maxSize && _class->type != 1000)
2678 char sizeString[50];
2680 sprintf(sizeString, "%d", maxSize - totalSize);
2681 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2684 FinishTemplatesContext(context);
2685 return topMember ? topMember->memberID : _class->memberID;
2688 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2690 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2691 unsigned int totalSize = 0;
2692 struct __ecereNameSpace__ecere__com__DataMember * member;
2693 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2695 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2696 DeclareMembers(_class->base, 0x0);
2697 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2699 if(!member->isProperty)
2701 switch(member->type)
2705 if(!member->dataType && member->dataTypeString)
2706 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2707 if(member->dataType)
2708 DeclareType(member->dataType, 0x0, 0x0);
2714 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2721 FinishTemplatesContext(context);
2722 return topMember ? topMember->memberID : _class->memberID;
2725 extern struct Symbol * FindClass(char * name);
2727 extern char * strchr(char * , int);
2729 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2731 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2733 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2735 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2737 extern char * strcpy(char * , const char * );
2739 extern void MangleClassName(char * className);
2741 extern void DeclareClass(struct Symbol * classSym, char * className);
2743 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2745 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2747 void DeclareStruct(char * name, unsigned int skipNoHead)
2749 struct External * external = (((void *)0));
2750 struct Symbol * classSym = FindClass(name);
2752 if(!inCompiler || !classSym)
2753 return (((void *)0));
2754 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2755 return (((void *)0));
2756 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2758 struct Declaration * decl;
2759 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2760 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2761 char structName[1024];
2763 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2764 classSym->declaring++;
2765 if(strchr(classSym->string, '<'))
2767 if(classSym->registered->templateClass)
2769 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2770 classSym->declaring--;
2772 return (((void *)0));
2774 DeclareMembers(classSym->registered, 0x0);
2775 structName[0] = (char)0;
2776 FullClassNameCat(structName, name, 0x0);
2779 classSym->declaredStructSym = 0x1;
2780 declarations = MkList();
2781 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2782 if(!(*declarations).count)
2784 FreeList(declarations, (((void *)0)));
2785 declarations = (((void *)0));
2788 if(skipNoHead || declarations)
2790 if(external && external->declaration)
2792 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2793 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2795 if(classSym->structExternal)
2796 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2797 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2798 classSym->id = curExternal->symbol->idCode;
2799 classSym->idCode = curExternal->symbol->idCode;
2805 external = MkExternalDeclaration((((void *)0)));
2806 specifiers = MkList();
2807 declarators = MkList();
2808 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2809 external->declaration = decl = MkDeclaration(specifiers, declarators);
2810 if(decl->symbol && !decl->symbol->pointerExternal)
2811 decl->symbol->pointerExternal = external;
2812 if(classSym->registered && classSym->registered->type == 1)
2814 char className[1024];
2816 strcpy(className, "__ecereClass_");
2817 FullClassNameCat(className, classSym->string, 0x1);
2818 MangleClassName(className);
2819 DeclareClass(classSym, className);
2820 external->symbol = classSym;
2821 classSym->pointerExternal = external;
2822 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2823 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2827 char className[1024];
2829 strcpy(className, "__ecereClass_");
2830 FullClassNameCat(className, classSym->string, 0x1);
2831 MangleClassName(className);
2832 classSym->structExternal = external;
2833 DeclareClass(classSym, className);
2834 external->symbol = classSym;
2836 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2839 classSym->declaring--;
2841 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2843 classSym->declaring++;
2845 if(classSym->registered)
2846 DeclareMembers(classSym->registered, 0x0);
2848 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2850 if(classSym->structExternal)
2851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2853 classSym->id = curExternal->symbol->idCode;
2854 classSym->idCode = curExternal->symbol->idCode;
2856 classSym->declaring--;
2860 extern char * strcat(char * , const char * );
2862 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2864 extern struct ModuleImport * mainModule;
2866 extern struct Specifier * MkSpecifierName(char * name);
2868 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2870 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2872 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2874 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2876 extern void FreeDeclarator(struct Declarator * decl);
2878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2880 struct PropertyImport
2882 struct PropertyImport * prev;
2883 struct PropertyImport * next;
2885 unsigned int isVirtual;
2886 unsigned int hasSet;
2887 unsigned int hasGet;
2888 } __attribute__ ((gcc_struct));
2890 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2892 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2894 void * __ecereTemp1;
2895 struct Symbol * symbol = prop->symbol;
2896 char propName[1024];
2898 strcpy(setName, "__ecereProp_");
2899 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2900 strcat(setName, "_Set_");
2901 FullClassNameCat(setName, prop->name, 0x1);
2902 strcpy(getName, "__ecereProp_");
2903 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2904 strcat(getName, "_Get_");
2905 FullClassNameCat(getName, prop->name, 0x1);
2906 strcpy(propName, "__ecereProp_");
2907 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2908 strcat(propName, "_");
2909 FullClassNameCat(propName, prop->name, 0x1);
2910 MangleClassName(getName);
2911 MangleClassName(setName);
2912 MangleClassName(propName);
2913 if(prop->_class->type == 1)
2914 DeclareStruct(prop->_class->fullName, 0x0);
2915 if(!symbol || curExternal->symbol->idCode < symbol->id)
2917 unsigned int imported = 0x0;
2918 unsigned int dllImport = 0x0;
2920 if(!symbol || symbol->_import)
2924 struct Symbol * classSym;
2926 if(!prop->_class->symbol)
2927 prop->_class->symbol = FindClass(prop->_class->fullName);
2928 classSym = prop->_class->symbol;
2929 if(classSym && !classSym->_import)
2931 struct ModuleImport * module;
2933 if(prop->_class->module)
2934 module = FindModule(prop->_class->module);
2936 module = mainModule;
2937 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
2938 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2940 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2941 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
2943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2946 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2951 struct Context * context = SetupTemplatesContext(prop->_class);
2953 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2954 FinishTemplatesContext(context);
2958 if(!symbol->externalGet || symbol->externalGet->type == 0)
2960 struct Declaration * decl;
2961 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2962 struct Declarator * d;
2963 struct __ecereNameSpace__ecere__sys__OldList * params;
2964 struct Specifier * spec;
2965 struct External * external;
2966 struct Declarator * typeDecl;
2967 unsigned int simple = 0x0;
2969 specifiers = MkList();
2970 declarators = MkList();
2972 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2973 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2975 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2977 struct Context * context = SetupTemplatesContext(prop->_class);
2979 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2980 FinishTemplatesContext(context);
2982 for(spec = (*specifiers).first; spec; spec = spec->next)
2986 if((!typeDecl || typeDecl->type == 1))
2988 struct Symbol * classSym = spec->symbol;
2990 symbol->_class = classSym->registered;
2991 if(classSym->registered && classSym->registered->type == 1)
2993 DeclareStruct(spec->name, 0x0);
3000 d = PlugDeclarator(typeDecl, d);
3003 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3004 specifiers = MkList();
3006 d = MkDeclaratorFunction(d, params);
3008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3009 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3012 ListAdd(specifiers, MkSpecifier(VOID));
3013 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3014 decl = MkDeclaration(specifiers, declarators);
3015 external = MkExternalDeclaration(decl);
3016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3017 external->symbol = symbol;
3018 symbol->externalGet = external;
3019 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3021 FreeDeclarator(typeDecl);
3025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3030 if(!symbol->externalSet || symbol->externalSet->type == 0)
3032 struct Declaration * decl;
3033 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3034 struct Declarator * d;
3035 struct __ecereNameSpace__ecere__sys__OldList * params;
3036 struct Specifier * spec;
3037 struct External * external;
3038 struct Declarator * typeDecl;
3040 declarators = MkList();
3042 if(!prop->conversion || prop->_class->type == 1)
3044 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3046 specifiers = MkList();
3048 struct Context * context = SetupTemplatesContext(prop->_class);
3050 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3051 FinishTemplatesContext(context);
3053 ListAdd(params, MkTypeName(specifiers, d));
3054 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3056 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3057 d = MkDeclaratorFunction(d, params);
3058 for(spec = (*specifiers).first; spec; spec = spec->next)
3062 if((!typeDecl || typeDecl->type == 1))
3064 struct Symbol * classSym = spec->symbol;
3066 symbol->_class = classSym->registered;
3067 if(classSym->registered && classSym->registered->type == 1)
3068 DeclareStruct(spec->name, 0x0);
3072 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3073 specifiers = MkList();
3075 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3076 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3077 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3078 if(!prop->conversion || prop->_class->type == 1)
3079 ListAdd(specifiers, MkSpecifier(VOID));
3081 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3082 decl = MkDeclaration(specifiers, declarators);
3083 external = MkExternalDeclaration(decl);
3084 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3085 external->symbol = symbol;
3086 symbol->externalSet = external;
3087 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3091 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3094 if(!symbol->externalPtr)
3096 struct Declaration * decl;
3097 struct External * external;
3098 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3101 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3103 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3104 ListAdd(specifiers, MkSpecifierName("Property"));
3106 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3108 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3111 strcpy(propName, "__ecerePropM_");
3112 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3113 strcat(propName, "_");
3114 FullClassNameCat(propName, prop->name, 0x1);
3115 MangleClassName(propName);
3116 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3118 decl = MkDeclaration(specifiers, list);
3120 external = MkExternalDeclaration(decl);
3121 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3122 external->symbol = symbol;
3123 symbol->externalPtr = external;
3127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3129 symbol->id = curExternal->symbol->idCode;
3133 struct Type * Dereference(struct Type * source)
3135 void * __ecereTemp1;
3136 struct Type * type = (((void *)0));
3140 if(source->kind == 13 || source->kind == 12)
3142 type = source->type;
3143 source->type->refCount++;
3145 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3147 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3149 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3160 static struct Type * Reference(struct Type * source)
3162 void * __ecereTemp1;
3163 struct Type * type = (((void *)0));
3167 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3173 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);
3175 extern void * memcpy(void * , const void * , unsigned int size);
3177 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3179 extern void FreeExpression(struct Expression * exp);
3181 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3183 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);
3185 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3187 extern struct Type * MkClassType(char * name);
3189 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, unsigned int size, unsigned int alignment, int declMode);
3191 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)
3193 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3194 unsigned int found = 0x0;
3195 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3196 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3197 unsigned int freeType = 0x0;
3199 yylloc = member->loc;
3204 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3208 dataMember = *curMember;
3214 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3215 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3216 int _subMemberStackPos = 0;
3219 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3222 dataMember = thisMember;
3223 if(curMember && thisMember->memberAccess == 1)
3225 *curMember = thisMember;
3226 *curClass = thisMember->_class;
3227 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3228 *subMemberStackPos = _subMemberStackPos;
3234 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3235 if(method && method->type == 1)
3238 method = (((void *)0));
3243 struct Type * type = (((void *)0));
3247 if(!dataMember->dataType && dataMember->dataTypeString)
3249 struct Context * context = SetupTemplatesContext(_class);
3251 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3252 FinishTemplatesContext(context);
3254 type = dataMember->dataType;
3258 if(!method->dataType)
3259 ProcessMethodType(method);
3260 type = method->dataType;
3262 if(ident && ident->next)
3264 for(ident = ident->next; ident && type; ident = ident->next)
3268 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3270 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3272 type = dataMember->dataType;
3274 else if(type->kind == 9 || type->kind == 10)
3276 struct Type * memberType;
3278 for(memberType = type->members.first; memberType; memberType = memberType->next)
3280 if(!strcmp(memberType->name, ident->string))
3289 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3292 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3293 struct __ecereNameSpace__ecere__com__Class * sClass;
3295 for(sClass = _class; sClass; sClass = sClass->base)
3298 if(sClass->templateClass)
3299 sClass = sClass->templateClass;
3300 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3302 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3304 for(sClass = sClass->base; sClass; sClass = sClass->base)
3306 if(sClass->templateClass)
3307 sClass = sClass->templateClass;
3308 id += sClass->templateParams.count;
3319 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3321 if(arg.dataTypeString)
3323 type = ProcessTypeString(arg.dataTypeString, 0x0);
3325 if(type && _class->templateClass)
3326 type->passAsTemplate = 0x1;
3333 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3335 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3336 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3340 char templateString[1024];
3341 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3343 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3344 for(cClass = expClass; cClass; cClass = cClass->base)
3348 if(cClass->templateClass)
3349 cClass = cClass->templateClass;
3350 for(param = cClass->templateParams.first; param; param = param->next)
3353 struct __ecereNameSpace__ecere__com__Class * sClass;
3354 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3356 for(sClass = cClass->base; sClass; sClass = sClass->base)
3358 if(sClass->templateClass)
3359 sClass = sClass->templateClass;
3360 id += sClass->templateParams.count;
3362 arg = expClass->templateArgs[id];
3363 for(sClass = _class; sClass; sClass = sClass->base)
3365 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3367 struct __ecereNameSpace__ecere__com__Class * nextClass;
3369 if(sClass->templateClass)
3370 sClass = sClass->templateClass;
3371 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3373 if(nextClass->templateClass)
3374 nextClass = nextClass->templateClass;
3375 p += nextClass->templateParams.count;
3377 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3379 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3381 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3383 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3384 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3398 char expString[1024];
3399 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3400 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3401 struct Expression * exp;
3402 char * string = PrintHexUInt64(arg.expression.ui64);
3404 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3405 ProcessExpressionType(exp);
3406 ComputeExpression(exp);
3407 expString[0] = '\0';
3408 PrintExpression(exp, expString);
3409 strcat(argument, expString);
3410 FreeExpression(exp);
3415 strcat(argument, arg.member->name);
3420 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3421 strcat(argument, arg.dataTypeString);
3428 strcat(templateString, ", ");
3429 if(lastParam != p - 1)
3431 strcat(templateString, param->name);
3432 strcat(templateString, " = ");
3434 strcat(templateString, argument);
3443 int len = strlen(templateString);
3445 if(templateString[len - 1] == '<')
3449 if(templateString[len - 1] == '>')
3450 templateString[len++] = ' ';
3451 templateString[len++] = '>';
3453 templateString[len++] = '\0';
3456 struct Context * context = SetupTemplatesContext(_class);
3460 type = ProcessTypeString(templateString, 0x0);
3462 FinishTemplatesContext(context);
3465 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3467 ProcessExpressionType(member->initializer->exp);
3468 if(!member->initializer->exp->expType)
3472 char expString[10240];
3474 expString[0] = '\0';
3475 PrintExpression(member->initializer->exp, expString);
3476 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3477 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3480 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3485 else if(member->initializer)
3487 ProcessInitializer(member->initializer, type);
3494 if(_class && _class->type == 3)
3496 if(member->initializer)
3498 struct Type * type = MkClassType(_class->fullName);
3500 ProcessInitializer(member->initializer, type);
3506 if(member->initializer)
3508 ProcessInitializer(member->initializer, (((void *)0)));
3514 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3518 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3520 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3524 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3529 extern struct Identifier * GetDeclId(struct Declarator * decl);
3531 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);
3533 extern void FreeSpecifier(struct Specifier * spec);
3535 static void ProcessFunction(struct FunctionDefinition * function);
3537 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3539 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3541 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3543 extern void FreeClassFunction(struct ClassFunction * func);
3545 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3547 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3549 void ProcessInstantiationType(struct Instantiation * inst)
3554 struct MembersInit * members;
3555 struct Symbol * classSym;
3556 struct __ecereNameSpace__ecere__com__Class * _class;
3558 classSym = inst->_class->symbol;
3559 _class = classSym ? classSym->registered : (((void *)0));
3560 if(!_class || _class->type != 5)
3561 DeclareStruct(inst->_class->name, 0x0);
3562 afterExternal = afterExternal ? afterExternal : curExternal;
3564 ProcessExpressionType(inst->exp);
3565 inst->isConstant = 0x1;
3568 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3569 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3570 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3571 int subMemberStackPos = 0;
3573 for(members = (*inst->members).first; members; members = members->next)
3575 switch(members->type)
3580 static unsigned int instMethodID = 0;
3581 struct External * external = curExternal;
3582 struct Context * context = curContext;
3583 struct Declarator * declarator = members->function->declarator;
3584 struct Identifier * nameID = GetDeclId(declarator);
3585 char * unmangled = nameID ? nameID->string : (((void *)0));
3586 struct Expression * exp;
3587 struct External * createdExternal = (((void *)0));
3593 strcpy(name, "__ecereInstMeth_");
3594 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3596 strcat(name, nameID->string);
3598 sprintf(number, "_%08d", instMethodID++);
3599 strcat(name, number);
3600 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3604 struct Symbol * symbol = declarator->symbol;
3605 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3607 if(method && method->type == 1)
3609 symbol->method = method;
3610 ProcessMethodType(method);
3611 if(!symbol->type->thisClass)
3613 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3615 if(!currentClass->symbol)
3616 currentClass->symbol = FindClass(currentClass->fullName);
3617 symbol->type->thisClass = currentClass->symbol;
3622 _class->symbol = FindClass(_class->fullName);
3623 symbol->type->thisClass = _class->symbol;
3626 DeclareType(symbol->type, 0x1, 0x1);
3630 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3633 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3636 FreeSpecifier(nameID->_class);
3637 nameID->_class = (((void *)0));
3641 struct Type * type = declarator->symbol->type;
3642 struct External * oldExternal = curExternal;
3644 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3646 struct External * externalDecl;
3648 externalDecl = MkExternalDeclaration((((void *)0)));
3649 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3650 if(createdExternal->function)
3652 ProcessFunction(createdExternal->function);
3654 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3656 externalDecl->declaration = decl;
3657 if(decl->symbol && !decl->symbol->pointerExternal)
3658 decl->symbol->pointerExternal = externalDecl;
3659 declarator->symbol->pointerExternal = externalDecl;
3666 curExternal = declarator->symbol->pointerExternal;
3667 ProcessFunction((struct FunctionDefinition *)members->function);
3669 curExternal = external;
3670 curContext = context;
3673 FreeClassFunction(members->function);
3674 exp = QMkExpId(name);
3676 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3677 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3683 if(members->dataMembers && classSym)
3685 struct MemberInit * member;
3686 struct Location oldyyloc = yylloc;
3688 for(member = (*members->dataMembers).first; member; member = member->next)
3690 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3691 if(member->initializer && !member->initializer->isConstant)
3692 inst->isConstant = 0x0;
3704 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3708 if(type->kind == 11)
3710 struct Type * param;
3714 for(param = type->params.first; param; param = param->next)
3715 DeclareType(param, declarePointers, 0x1);
3717 DeclareType(type->returnType, declarePointers, 0x1);
3719 else if(type->kind == 13 && declarePointers)
3720 DeclareType(type->type, declarePointers, 0x0);
3721 else if(type->kind == 8)
3723 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3724 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3726 else if(type->kind == 9 || type->kind == 10)
3728 struct Type * member;
3730 for(member = type->members.first; member; member = member->next)
3731 DeclareType(member, 0x0, 0x0);
3733 else if(type->kind == 12)
3734 DeclareType(type->arrayType, declarePointers, 0x0);
3738 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3740 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3742 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3744 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3745 struct __ecereNameSpace__ecere__com__Class * sClass;
3747 for(sClass = _class; sClass; sClass = sClass->base)
3750 if(sClass->templateClass)
3751 sClass = sClass->templateClass;
3752 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3754 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3756 for(sClass = sClass->base; sClass; sClass = sClass->base)
3758 if(sClass->templateClass)
3759 sClass = sClass->templateClass;
3760 id += sClass->templateParams.count;
3771 arg = &_class->templateArgs[id];
3772 if(arg && param->type == 0)
3773 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3778 extern struct Context * PushContext(void);
3780 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3782 struct TemplatedType
3785 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3786 struct __ecereNameSpace__ecere__sys__BTNode * left;
3787 struct __ecereNameSpace__ecere__sys__BTNode * right;
3789 struct TemplateParameter * param;
3790 } __attribute__ ((gcc_struct));
3792 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3794 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3796 void * __ecereTemp1;
3797 struct Context * context = PushContext();
3799 context->templateTypesOnly = 0x1;
3800 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3802 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3804 for(; param; param = param->next)
3806 if(param->type == 0 && param->identifier)
3808 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3810 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3816 struct __ecereNameSpace__ecere__com__Class * sClass;
3818 for(sClass = _class; sClass; sClass = sClass->base)
3820 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3822 for(p = sClass->templateParams.first; p; p = p->next)
3826 struct TemplateParameter * param = p->param;
3827 struct TemplatedType * type;
3831 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
3833 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (unsigned int)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3834 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3842 extern void PopContext(struct Context * ctx);
3844 extern void FreeContext(struct Context * context);
3846 void FinishTemplatesContext(struct Context * context)
3848 PopContext(context);
3849 FreeContext(context);
3850 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3853 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3855 if(!method->dataType)
3857 struct Context * context = SetupTemplatesContext(method->_class);
3859 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3860 FinishTemplatesContext(context);
3861 if(method->type != 1 && method->dataType)
3863 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3865 if(!method->_class->symbol)
3866 method->_class->symbol = FindClass(method->_class->fullName);
3867 method->dataType->thisClass = method->_class->symbol;
3873 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3877 struct Context * context = SetupTemplatesContext(prop->_class);
3879 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3880 FinishTemplatesContext(context);
3884 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3886 extern void FreeTypeName(struct TypeName * typeName);
3888 static void ProcessDeclarator(struct Declarator * decl);
3890 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3892 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3896 struct MethodImport * prev;
3897 struct MethodImport * next;
3899 unsigned int isVirtual;
3900 } __attribute__ ((gcc_struct));
3902 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3904 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3906 void * __ecereTemp1;
3907 struct Symbol * symbol = method->symbol;
3909 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3911 unsigned int imported = 0x0;
3912 unsigned int dllImport = 0x0;
3914 if(!method->dataType)
3915 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3916 if(!symbol || symbol->_import || method->type == 1)
3918 if(!symbol || method->type == 1)
3920 struct Symbol * classSym;
3922 if(!method->_class->symbol)
3923 method->_class->symbol = FindClass(method->_class->fullName);
3924 classSym = method->_class->symbol;
3925 if(!classSym->_import)
3927 struct ModuleImport * module;
3929 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3930 module = FindModule(method->_class->module);
3932 module = mainModule;
3933 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3934 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3938 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3940 if(!symbol->_import)
3942 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
3943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3947 symbol->type = method->dataType;
3949 symbol->type->refCount++;
3952 if(!method->dataType->dllExport)
3955 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3959 if(method->type != 1 && method->dataType)
3960 DeclareType(method->dataType, 0x1, 0x1);
3961 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3963 struct Declaration * decl;
3964 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3965 struct Declarator * d;
3966 struct Declarator * funcDecl;
3967 struct External * external;
3969 specifiers = MkList();
3970 declarators = MkList();
3972 ListAdd(specifiers, MkSpecifier(EXTERN));
3973 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3974 ListAdd(specifiers, MkSpecifier(STATIC));
3975 if(method->type == 1)
3977 ListAdd(specifiers, MkSpecifier(INT));
3978 d = MkDeclaratorIdentifier(MkIdentifier(name));
3982 d = MkDeclaratorIdentifier(MkIdentifier(name));
3984 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3986 struct Context * context = SetupTemplatesContext(method->_class);
3988 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3989 FinishTemplatesContext(context);
3991 funcDecl = GetFuncDecl(d);
3994 struct Specifier * spec, * next;
3996 for(spec = (*specifiers).first; spec; spec = next)
4001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4002 FreeSpecifier(spec);
4006 if(method->dataType && !method->dataType->staticMethod)
4008 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4010 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4011 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->thisClass ? method->dataType->thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4012 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4013 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4015 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4017 struct TypeName * param = (*funcDecl->function.parameters).first;
4019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4020 FreeTypeName(param);
4022 if(!funcDecl->function.parameters)
4023 funcDecl->function.parameters = MkList();
4024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4028 ProcessDeclarator(d);
4029 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4030 decl = MkDeclaration(specifiers, declarators);
4031 ReplaceThisClassSpecifiers(specifiers, method->_class);
4032 if(symbol->pointerExternal)
4034 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4037 *functionSymbol = *symbol;
4038 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4039 if(functionSymbol->type)
4040 functionSymbol->type->refCount++;
4042 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4043 symbol->pointerExternal->symbol = functionSymbol;
4045 external = MkExternalDeclaration(decl);
4047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4048 external->symbol = symbol;
4049 symbol->pointerExternal = external;
4053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4055 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4059 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4061 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4063 unsigned int first = 0x1;
4065 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4067 char className[1024];
4069 strcpy(className, _class->fullName);
4070 for(param = _class->templateParams.first; param; param = param->next)
4074 strcat(className, "<");
4076 strcat(className, ", ");
4077 if(lastParam + 1 != p)
4079 strcat(className, param->name);
4080 strcat(className, " = ");
4082 strcat(className, param->name);
4090 int len = strlen(className);
4092 if(className[len - 1] == '>')
4093 className[len++] = ' ';
4094 className[len++] = '>';
4095 className[len++] = '\0';
4097 return __ecereNameSpace__ecere__sys__CopyString(className);
4100 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4103 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4105 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4107 unsigned int first = 0x1;
4109 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4111 char className[1024];
4113 strcpy(className, _class->fullName);
4114 for(param = _class->templateParams.first; param; param = param->next)
4118 strcat(className, "<");
4120 strcat(className, ", ");
4121 if(lastParam + 1 != p)
4123 strcat(className, param->name);
4124 strcat(className, " = ");
4126 strcat(className, param->name);
4134 int len = strlen(className);
4136 if(className[len - 1] == '>')
4137 className[len++] = ' ';
4138 className[len++] = '>';
4139 className[len++] = '\0';
4141 return MkClassType(className);
4145 return MkClassType(_class->fullName);
4149 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4151 if(specs != (((void *)0)) && _class)
4153 struct Specifier * spec;
4155 for(spec = specs->first; spec; spec = spec->next)
4157 if(spec->type == 0 && spec->specifier == THISCLASS)
4160 spec->name = ReplaceThisClass(_class);
4161 spec->symbol = FindClass(spec->name);
4167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4169 struct __ecereNameSpace__ecere__com__GlobalFunction
4171 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4172 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4175 struct __ecereNameSpace__ecere__com__Instance * module;
4176 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4177 char * dataTypeString;
4178 struct Type * dataType;
4180 } __attribute__ ((gcc_struct));
4182 extern struct Context * globalContext;
4184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4186 struct FunctionImport
4188 struct FunctionImport * prev;
4189 struct FunctionImport * next;
4191 } __attribute__ ((gcc_struct));
4193 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4195 void * __ecereTemp1;
4196 struct Symbol * symbol = function->symbol;
4198 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4200 unsigned int imported = 0x0;
4201 unsigned int dllImport = 0x0;
4203 if(!function->dataType)
4205 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4206 if(!function->dataType->thisClass)
4207 function->dataType->staticMethod = 0x1;
4213 struct ModuleImport * module = FindModule(function->module);
4215 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4218 if(!function->dataType->dllExport)
4220 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4225 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4226 if(!symbol->type->thisClass)
4227 symbol->type->staticMethod = 0x1;
4230 imported = symbol->_import ? 0x1 : 0x0;
4231 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4234 DeclareType(function->dataType, 0x1, 0x1);
4237 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4239 struct Declaration * decl;
4240 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4241 struct Declarator * d;
4242 struct Declarator * funcDecl;
4243 struct External * external;
4245 specifiers = MkList();
4246 declarators = MkList();
4247 ListAdd(specifiers, MkSpecifier(EXTERN));
4248 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4250 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4251 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4252 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4254 struct Specifier * spec;
4256 for(spec = (*specifiers).first; spec; spec = spec->next)
4257 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4259 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4260 FreeSpecifier(spec);
4264 funcDecl = GetFuncDecl(d);
4265 if(funcDecl && !funcDecl->function.parameters)
4267 funcDecl->function.parameters = MkList();
4268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4270 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4272 struct Context * oldCtx = curContext;
4274 curContext = globalContext;
4275 decl = MkDeclaration(specifiers, declarators);
4276 curContext = oldCtx;
4278 if(symbol->pointerExternal)
4280 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4283 *functionSymbol = *symbol;
4284 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4285 if(functionSymbol->type)
4286 functionSymbol->type->refCount++;
4288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4289 symbol->pointerExternal->symbol = functionSymbol;
4291 external = MkExternalDeclaration(decl);
4293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4294 external->symbol = symbol;
4295 symbol->pointerExternal = external;
4299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4302 symbol->id = curExternal->symbol->idCode;
4305 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4308 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4313 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4314 struct __ecereNameSpace__ecere__sys__BTNode * left;
4315 struct __ecereNameSpace__ecere__sys__BTNode * right;
4317 struct __ecereNameSpace__ecere__com__Instance * module;
4318 char * dataTypeString;
4319 struct Type * dataType;
4322 } __attribute__ ((gcc_struct));
4324 void DeclareGlobalData(struct GlobalData * data)
4326 struct Symbol * symbol = data->symbol;
4328 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4333 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4336 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4337 DeclareType(data->dataType, 0x1, 0x1);
4340 if(!symbol->pointerExternal)
4342 struct Declaration * decl;
4343 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4344 struct Declarator * d;
4345 struct External * external;
4347 specifiers = MkList();
4348 declarators = MkList();
4349 ListAdd(specifiers, MkSpecifier(EXTERN));
4350 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4351 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4352 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4353 decl = MkDeclaration(specifiers, declarators);
4354 external = MkExternalDeclaration(decl);
4356 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4357 external->symbol = symbol;
4358 symbol->pointerExternal = external;
4362 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4365 symbol->id = curExternal->symbol->idCode;
4372 struct Conversion * prev, * next;
4373 struct __ecereNameSpace__ecere__com__Property * convert;
4375 struct Type * resultType;
4376 } __attribute__ ((gcc_struct));
4378 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4380 extern void Compiler_Warning(char * format, ...);
4382 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4384 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)
4388 if(source->kind == 20 && dest->kind != 20)
4390 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4395 if(dest->kind == 20 && source->kind != 20)
4397 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4402 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4406 if(source->classObjectType == 3 && dest->classObjectType != 2)
4410 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4412 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4415 if(dest->kind == 14 && source->kind != 0)
4417 if(dest->kind == 13 && dest->type->kind == 0 && ((source->kind == 8 && (!source->_class || !source->_class->registered || source->_class->registered->type == 1 || source->_class->registered->type == 0 || source->_class->registered->type == 5 || source->_class->registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4419 if(!isConversionExploration && source->kind == 13 && source->type->kind == 0 && ((dest->kind == 8 && (!dest->_class || !dest->_class->registered || dest->_class->registered->type == 1 || dest->_class->registered->type == 0 || dest->_class->registered->type == 5 || dest->_class->registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4421 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4423 if(source->_class->registered && source->_class->registered->type == 3)
4425 if(conversions != (((void *)0)))
4427 if(source->_class->registered == dest->_class->registered)
4432 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4434 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4436 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4438 if(sourceBase == destBase)
4442 else if(source->_class && dest->_class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->_class->registered || source->_class->registered->type != 4) || (!dest->_class->registered || dest->_class->registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, dest->_class->registered))
4446 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4448 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4455 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4459 if(source->kind == 8)
4461 struct __ecereNameSpace__ecere__com__Class * _class;
4463 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4465 struct __ecereNameSpace__ecere__com__Property * convert;
4467 for(convert = _class->conversions.first; convert; convert = convert->next)
4469 if(convert->memberAccess == 1 || _class->module == privateModule)
4471 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4473 if(!convert->dataType)
4474 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4475 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4477 if(!conversions && !convert->Get)
4479 else if(conversions != (((void *)0)))
4481 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4485 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4498 struct __ecereNameSpace__ecere__com__Class * _class;
4500 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4502 struct __ecereNameSpace__ecere__com__Property * convert;
4504 for(convert = _class->conversions.first; convert; convert = convert->next)
4506 if(convert->memberAccess == 1 || _class->module == privateModule)
4508 if(!convert->dataType)
4509 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4510 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4512 if(!conversions && !convert->Set)
4514 else if(conversions != (((void *)0)))
4516 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (source->kind != 8 || source->_class->registered != _class->base))
4520 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4522 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4530 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4532 if(!dest->_class->registered->dataType)
4533 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4534 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4536 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4543 if(source->kind == 8)
4545 struct __ecereNameSpace__ecere__com__Class * _class;
4547 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4549 struct __ecereNameSpace__ecere__com__Property * convert;
4551 for(convert = _class->conversions.first; convert; convert = convert->next)
4553 if(convert->memberAccess == 1 || _class->module == privateModule)
4555 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4557 if(!convert->dataType)
4558 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4559 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4561 if(!conversions && !convert->Get)
4563 else if(conversions != (((void *)0)))
4565 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4569 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4579 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4581 if(!source->_class->registered->dataType)
4582 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4583 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4590 if(source->kind == 8 || source->kind == 19)
4592 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4594 else if(dest->kind == 7 && source->kind == 6)
4596 else if(dest->kind == 2 && source->kind == 1)
4598 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4600 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4602 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4604 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4606 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
4608 struct Type * paramSource, * paramDest;
4610 if(dest->kind == 16)
4611 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4612 if(source->kind == 16)
4613 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4614 if(dest->kind == 13 && dest->type->kind == 11)
4616 if(source->kind == 13 && source->type->kind == 11)
4617 source = source->type;
4618 if(dest->kind == 16)
4619 dest = dest->method->dataType;
4620 if(source->kind == 16)
4621 source = source->method->dataType;
4622 paramSource = source->params.first;
4623 if(paramSource && paramSource->kind == 0)
4624 paramSource = (((void *)0));
4625 paramDest = dest->params.first;
4626 if(paramDest && paramDest->kind == 0)
4627 paramDest = (((void *)0));
4628 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4630 if(!paramDest || (!(paramDest->kind == 13 && paramDest->type && paramDest->type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, paramDest->_class->registered))))
4632 if(paramDest && paramDest->kind == 8)
4633 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4635 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4638 paramDest = paramDest->next;
4640 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4642 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4646 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4648 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4654 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4663 paramSource = paramSource->next;
4669 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4671 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4677 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4679 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4685 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4687 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4690 for(; paramDest; paramDest = paramDest->next)
4694 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4698 struct Type * paramDestType = paramDest;
4699 struct Type * paramSourceType = paramSource;
4700 struct Type * type = paramDestType;
4702 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4705 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4706 struct __ecereNameSpace__ecere__com__Class * sClass;
4708 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4711 if(sClass->templateClass)
4712 sClass = sClass->templateClass;
4713 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4715 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4717 for(sClass = sClass->base; sClass; sClass = sClass->base)
4719 if(sClass->templateClass)
4720 sClass = sClass->templateClass;
4721 id += sClass->templateParams.count;
4732 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4734 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4737 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
4742 PrintType(paramDest, type, 0x0, 0x1);
4743 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4744 if(paramDestType != paramDest)
4745 FreeType(paramDestType);
4748 if(paramDestType != paramDest)
4749 FreeType(paramDestType);
4751 paramSource = paramSource->next;
4755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4760 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4764 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4766 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4773 static void FreeConvert(struct Conversion * convert)
4775 if(convert->resultType)
4776 FreeType(convert->resultType);
4779 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4781 struct __ecereNameSpace__ecere__com__BTNamedLink
4784 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4785 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4786 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4789 } __attribute__ ((gcc_struct));
4791 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4793 struct __ecereNameSpace__ecere__com__EnumClassData
4795 struct __ecereNameSpace__ecere__sys__OldList values;
4797 } __attribute__ ((gcc_struct));
4799 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4801 struct __ecereNameSpace__ecere__sys__NamedLink
4803 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4804 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4807 } __attribute__ ((gcc_struct));
4809 extern void FreeExpContents(struct Expression * exp);
4811 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4813 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4815 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4817 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4819 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4821 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4823 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4825 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)))
4827 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4829 if(_class->type == 4)
4831 struct __ecereNameSpace__ecere__sys__OldList converts =
4835 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4839 _class->symbol = FindClass(_class->fullName);
4840 type->_class = _class->symbol;
4841 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4843 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4844 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4848 struct __ecereNameSpace__ecere__com__Class * baseClass;
4850 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4852 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4854 for(value = e->values.first; value; value = value->next)
4856 if(!strcmp(value->name, string))
4861 FreeExpContents(sourceExp);
4862 FreeType(sourceExp->expType);
4863 sourceExp->isConstant = 0x1;
4864 sourceExp->expType = MkClassType(baseClass->fullName);
4868 sourceExp->type = 2;
4869 if(!strcmp(baseClass->dataTypeString, "int"))
4870 sprintf(constant, "%d", value->data);
4872 sprintf(constant, "0x%X", value->data);
4873 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4875 while(converts.first)
4877 struct Conversion * convert = converts.first;
4879 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4882 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4889 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4890 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4893 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)))
4894 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4901 struct __ecereNameSpace__ecere__com__SubModule
4903 struct __ecereNameSpace__ecere__com__SubModule * prev;
4904 struct __ecereNameSpace__ecere__com__SubModule * next;
4905 struct __ecereNameSpace__ecere__com__Instance * module;
4907 } __attribute__ ((gcc_struct));
4909 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4911 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4913 if(searchFor == searchIn)
4915 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4917 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4919 if(ModuleVisibility(subModule->module, searchFor))
4926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4928 struct __ecereNameSpace__ecere__com__Application
4933 unsigned int isGUIApp;
4934 struct __ecereNameSpace__ecere__sys__OldList allModules;
4935 char * parsedCommand;
4936 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4937 } __attribute__ ((gcc_struct));
4939 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4941 struct __ecereNameSpace__ecere__com__Instance * module;
4943 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
4945 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4947 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4949 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4951 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4957 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
4959 void ReadString(char * output, char * string);
4961 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4963 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
4965 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4967 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4969 void * __ecereTemp1;
4970 struct Type * source = sourceExp->expType;
4971 struct Type * realDest = dest;
4973 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4975 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4977 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4979 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4981 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4983 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4985 if(sourceBase == destBase)
4991 struct __ecereNameSpace__ecere__sys__OldList * specs;
4992 unsigned int flag = 0x0;
4993 long long value = (((int)0x7fffffff));
4997 if(sourceExp->type == 2)
4999 if(source->isSigned)
5000 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5002 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5004 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5006 if(source->isSigned)
5007 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5009 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5011 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5014 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5018 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5020 if(_class && _class->type == 3)
5022 if(source->kind != 8)
5024 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5025 struct Type * tempDest, * tempSource;
5027 for(; _class->base->type != 1000; _class = _class->base)
5030 tempDest = tempType;
5033 _class->symbol = FindClass(_class->fullName);
5034 tempType->_class = _class->symbol;
5035 tempType->truth = dest->truth;
5036 if(tempType->_class)
5037 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5038 FreeType(sourceExp->expType);
5039 sourceExp->expType = dest;
5042 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5045 if(_class && _class->type == 2 && source->kind != 8)
5047 if(!dest->_class->registered->dataType)
5048 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5049 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5052 FreeType(sourceExp->expType);
5053 source = sourceExp->expType = MkClassType(dest->_class->string);
5057 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5059 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5060 struct Declarator * decl;
5063 ReadString(string, sourceExp->string);
5064 decl = SpecDeclFromString(string, specs, (((void *)0)));
5065 FreeExpContents(sourceExp);
5066 FreeType(sourceExp->expType);
5067 sourceExp->type = 26;
5068 sourceExp->_classExp.specifiers = specs;
5069 sourceExp->_classExp.decl = decl;
5070 sourceExp->expType = dest;
5077 else if(source->kind == 8)
5079 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5081 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5085 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5086 struct Type * tempDest, * tempSource;
5088 if(!source->_class->registered->dataType)
5089 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5090 for(; _class->base->type != 1000; _class = _class->base)
5093 tempSource = tempType;
5095 tempType->_class = FindClass(_class->fullName);
5096 tempType->truth = source->truth;
5097 tempType->classObjectType = source->classObjectType;
5098 if(tempType->_class)
5099 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5100 if(conversions->last)
5102 ((struct Conversion *)conversions->last)->resultType = dest;
5105 FreeType(sourceExp->expType);
5106 sourceExp->expType = MkClassType(_class->fullName);
5107 sourceExp->expType->truth = source->truth;
5108 sourceExp->expType->classObjectType = source->classObjectType;
5109 if(!sourceExp->destType)
5111 FreeType(sourceExp->destType);
5112 sourceExp->destType = sourceExp->expType;
5113 if(sourceExp->expType)
5114 sourceExp->expType->refCount++;
5116 if(!_class->dataType)
5117 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5119 dest = MkClassType(source->_class->string);
5120 dest->truth = source->truth;
5121 dest->classObjectType = source->classObjectType;
5123 source = _class->dataType;
5125 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5131 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5140 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5142 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5144 if(_class->type == 0 || _class->type == 5)
5146 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5148 *newExp = *sourceExp;
5149 if(sourceExp->destType)
5150 sourceExp->destType->refCount++;
5151 if(sourceExp->expType)
5152 sourceExp->expType->refCount++;
5153 sourceExp->type = 11;
5154 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5155 sourceExp->cast.exp = newExp;
5156 FreeType(sourceExp->expType);
5157 sourceExp->expType = (((void *)0));
5158 ProcessExpressionType(sourceExp);
5161 FreeType(sourceExp->expType);
5162 sourceExp->expType = dest;
5169 if(!_class->dataType)
5170 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5172 dest = _class->dataType;
5175 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5177 specs = MkListOne(MkSpecifier(DOUBLE));
5179 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5181 specs = MkListOne(MkSpecifier(FLOAT));
5183 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5187 ListAdd(specs, MkSpecifier(UNSIGNED));
5188 ListAdd(specs, MkSpecifier(INT64));
5190 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5194 ListAdd(specs, MkSpecifier(UNSIGNED));
5195 ListAdd(specs, MkSpecifier(INT));
5197 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5201 ListAdd(specs, MkSpecifier(UNSIGNED));
5202 ListAdd(specs, MkSpecifier(SHORT));
5204 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5208 ListAdd(specs, MkSpecifier(UNSIGNED));
5209 ListAdd(specs, MkSpecifier(CHAR));
5218 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 1))
5220 specs = MkListOne(MkSpecifier(DOUBLE));
5222 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5224 specs = MkListOne(MkSpecifier(FLOAT));
5226 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5230 ListAdd(specs, MkSpecifier(UNSIGNED));
5231 ListAdd(specs, MkSpecifier(CHAR));
5233 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5237 ListAdd(specs, MkSpecifier(UNSIGNED));
5238 ListAdd(specs, MkSpecifier(SHORT));
5240 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5244 ListAdd(specs, MkSpecifier(UNSIGNED));
5245 ListAdd(specs, MkSpecifier(INT));
5247 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5251 ListAdd(specs, MkSpecifier(UNSIGNED));
5252 ListAdd(specs, MkSpecifier(INT64));
5254 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5256 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5266 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5268 *newExp = *sourceExp;
5269 newExp->prev = (((void *)0));
5270 newExp->next = (((void *)0));
5271 if(sourceExp->destType)
5272 sourceExp->destType->refCount++;
5273 if(sourceExp->expType)
5274 sourceExp->expType->refCount++;
5275 sourceExp->type = 11;
5276 if(realDest->kind == 8)
5278 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5279 FreeList(specs, FreeSpecifier);
5282 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5283 if(newExp->type == 4)
5285 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5288 sourceExp->cast.exp = newExp;
5289 FreeType(sourceExp->expType);
5290 sourceExp->expType = (((void *)0));
5291 ProcessExpressionType(sourceExp);
5294 FreeList(specs, FreeSpecifier);
5301 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5302 sourceExp = (*sourceExp->list).last;
5303 if(sourceExp->type == 0)
5305 struct Identifier * id = sourceExp->identifier;
5309 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5311 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5312 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5316 for(; _class && _class->type == 4; _class = _class->base)
5318 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5319 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5321 for(value = e->values.first; value; value = value->next)
5323 if(!strcmp(value->name, id->string))
5328 FreeExpContents(sourceExp);
5329 FreeType(sourceExp->expType);
5330 sourceExp->isConstant = 0x1;
5331 sourceExp->expType = MkClassType(_class->fullName);
5335 sourceExp->type = 2;
5336 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5337 sprintf(constant, "%d", value->data);
5339 sprintf(constant, "0x%X", value->data);
5340 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5348 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5355 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5357 int value2 = op2->i;
5360 exp->string = PrintInt(op1->i + value2);
5363 exp->expType = op1->type;
5365 op1->type->refCount++;
5370 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5372 unsigned int value2 = op2->ui;
5375 exp->string = PrintUInt(op1->ui + value2);
5378 exp->expType = op1->type;
5380 op1->type->refCount++;
5385 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5387 short value2 = op2->s;
5390 exp->string = PrintShort(op1->s + value2);
5393 exp->expType = op1->type;
5395 op1->type->refCount++;
5400 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5402 unsigned short value2 = op2->us;
5405 exp->string = PrintUShort(op1->us + value2);
5408 exp->expType = op1->type;
5410 op1->type->refCount++;
5415 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5417 char value2 = op2->c;
5420 exp->string = PrintChar(op1->c + value2);
5423 exp->expType = op1->type;
5425 op1->type->refCount++;
5430 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5432 unsigned char value2 = op2->uc;
5435 exp->string = PrintUChar(op1->uc + value2);
5438 exp->expType = op1->type;
5440 op1->type->refCount++;
5445 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5447 float value2 = op2->f;
5450 exp->string = PrintFloat(op1->f + value2);
5453 exp->expType = op1->type;
5455 op1->type->refCount++;
5460 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5462 double value2 = op2->d;
5465 exp->string = PrintDouble(op1->d + value2);
5468 exp->expType = op1->type;
5470 op1->type->refCount++;
5475 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5477 int value2 = op2->i;
5480 exp->string = PrintInt(op1->i - value2);
5483 exp->expType = op1->type;
5485 op1->type->refCount++;
5490 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5492 unsigned int value2 = op2->ui;
5495 exp->string = PrintUInt(op1->ui - value2);
5498 exp->expType = op1->type;
5500 op1->type->refCount++;
5505 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5507 short value2 = op2->s;
5510 exp->string = PrintShort(op1->s - value2);
5513 exp->expType = op1->type;
5515 op1->type->refCount++;
5520 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5522 unsigned short value2 = op2->us;
5525 exp->string = PrintUShort(op1->us - value2);
5528 exp->expType = op1->type;
5530 op1->type->refCount++;
5535 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5537 char value2 = op2->c;
5540 exp->string = PrintChar(op1->c - value2);
5543 exp->expType = op1->type;
5545 op1->type->refCount++;
5550 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5552 unsigned char value2 = op2->uc;
5555 exp->string = PrintUChar(op1->uc - value2);
5558 exp->expType = op1->type;
5560 op1->type->refCount++;
5565 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5567 float value2 = op2->f;
5570 exp->string = PrintFloat(op1->f - value2);
5573 exp->expType = op1->type;
5575 op1->type->refCount++;
5580 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5582 double value2 = op2->d;
5585 exp->string = PrintDouble(op1->d - value2);
5588 exp->expType = op1->type;
5590 op1->type->refCount++;
5595 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5597 int value2 = op2->i;
5600 exp->string = PrintInt(op1->i * value2);
5603 exp->expType = op1->type;
5605 op1->type->refCount++;
5610 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5612 unsigned int value2 = op2->ui;
5615 exp->string = PrintUInt(op1->ui * value2);
5618 exp->expType = op1->type;
5620 op1->type->refCount++;
5625 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5627 short value2 = op2->s;
5630 exp->string = PrintShort(op1->s * value2);
5633 exp->expType = op1->type;
5635 op1->type->refCount++;
5640 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5642 unsigned short value2 = op2->us;
5645 exp->string = PrintUShort(op1->us * value2);
5648 exp->expType = op1->type;
5650 op1->type->refCount++;
5655 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5657 char value2 = op2->c;
5660 exp->string = PrintChar(op1->c * value2);
5663 exp->expType = op1->type;
5665 op1->type->refCount++;
5670 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5672 unsigned char value2 = op2->uc;
5675 exp->string = PrintUChar(op1->uc * value2);
5678 exp->expType = op1->type;
5680 op1->type->refCount++;
5685 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5687 float value2 = op2->f;
5690 exp->string = PrintFloat(op1->f * value2);
5693 exp->expType = op1->type;
5695 op1->type->refCount++;
5700 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5702 double value2 = op2->d;
5705 exp->string = PrintDouble(op1->d * value2);
5708 exp->expType = op1->type;
5710 op1->type->refCount++;
5715 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5717 int value2 = op2->i;
5720 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5723 exp->expType = op1->type;
5725 op1->type->refCount++;
5730 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5732 unsigned int value2 = op2->ui;
5735 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5738 exp->expType = op1->type;
5740 op1->type->refCount++;
5745 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5747 short value2 = op2->s;
5750 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5753 exp->expType = op1->type;
5755 op1->type->refCount++;
5760 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5762 unsigned short value2 = op2->us;
5765 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5768 exp->expType = op1->type;
5770 op1->type->refCount++;
5775 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5777 char value2 = op2->c;
5780 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5783 exp->expType = op1->type;
5785 op1->type->refCount++;
5790 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5792 unsigned char value2 = op2->uc;
5795 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5798 exp->expType = op1->type;
5800 op1->type->refCount++;
5805 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5807 float value2 = op2->f;
5810 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5813 exp->expType = op1->type;
5815 op1->type->refCount++;
5820 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5822 double value2 = op2->d;
5825 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5828 exp->expType = op1->type;
5830 op1->type->refCount++;
5835 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5837 int value2 = op2->i;
5840 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5843 exp->expType = op1->type;
5845 op1->type->refCount++;
5850 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 unsigned int value2 = op2->ui;
5855 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5858 exp->expType = op1->type;
5860 op1->type->refCount++;
5865 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 short value2 = op2->s;
5870 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5873 exp->expType = op1->type;
5875 op1->type->refCount++;
5880 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 unsigned short value2 = op2->us;
5885 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5888 exp->expType = op1->type;
5890 op1->type->refCount++;
5895 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5897 char value2 = op2->c;
5900 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5903 exp->expType = op1->type;
5905 op1->type->refCount++;
5910 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5912 unsigned char value2 = op2->uc;
5915 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5918 exp->expType = op1->type;
5920 op1->type->refCount++;
5925 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5928 exp->string = PrintInt(-op1->i);
5931 exp->expType = op1->type;
5933 op1->type->refCount++;
5938 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5941 exp->string = PrintUInt(-op1->ui);
5944 exp->expType = op1->type;
5946 op1->type->refCount++;
5951 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5954 exp->string = PrintShort(-op1->s);
5957 exp->expType = op1->type;
5959 op1->type->refCount++;
5964 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5967 exp->string = PrintUShort(-op1->us);
5970 exp->expType = op1->type;
5972 op1->type->refCount++;
5977 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5980 exp->string = PrintChar(-op1->c);
5983 exp->expType = op1->type;
5985 op1->type->refCount++;
5990 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5993 exp->string = PrintUChar(-op1->uc);
5996 exp->expType = op1->type;
5998 op1->type->refCount++;
6003 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6006 exp->string = PrintFloat(-op1->f);
6009 exp->expType = op1->type;
6011 op1->type->refCount++;
6016 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6019 exp->string = PrintDouble(-op1->d);
6022 exp->expType = op1->type;
6024 op1->type->refCount++;
6029 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6032 exp->string = PrintInt(++op1->i);
6035 exp->expType = op1->type;
6037 op1->type->refCount++;
6042 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6045 exp->string = PrintUInt(++op1->ui);
6048 exp->expType = op1->type;
6050 op1->type->refCount++;
6055 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6058 exp->string = PrintShort(++op1->s);
6061 exp->expType = op1->type;
6063 op1->type->refCount++;
6068 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6071 exp->string = PrintUShort(++op1->us);
6074 exp->expType = op1->type;
6076 op1->type->refCount++;
6081 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6084 exp->string = PrintChar(++op1->c);
6087 exp->expType = op1->type;
6089 op1->type->refCount++;
6094 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6097 exp->string = PrintUChar(++op1->uc);
6100 exp->expType = op1->type;
6102 op1->type->refCount++;
6107 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6110 exp->string = PrintFloat(++op1->f);
6113 exp->expType = op1->type;
6115 op1->type->refCount++;
6120 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6123 exp->string = PrintDouble(++op1->d);
6126 exp->expType = op1->type;
6128 op1->type->refCount++;
6133 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6136 exp->string = PrintInt(--op1->i);
6139 exp->expType = op1->type;
6141 op1->type->refCount++;
6146 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6149 exp->string = PrintUInt(--op1->ui);
6152 exp->expType = op1->type;
6154 op1->type->refCount++;
6159 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6162 exp->string = PrintShort(--op1->s);
6165 exp->expType = op1->type;
6167 op1->type->refCount++;
6172 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6175 exp->string = PrintUShort(--op1->us);
6178 exp->expType = op1->type;
6180 op1->type->refCount++;
6185 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6188 exp->string = PrintChar(--op1->c);
6191 exp->expType = op1->type;
6193 op1->type->refCount++;
6198 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6201 exp->string = PrintUChar(--op1->uc);
6204 exp->expType = op1->type;
6206 op1->type->refCount++;
6211 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6214 exp->string = PrintFloat(--op1->f);
6217 exp->expType = op1->type;
6219 op1->type->refCount++;
6224 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6227 exp->string = PrintDouble(--op1->d);
6230 exp->expType = op1->type;
6232 op1->type->refCount++;
6237 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 int value2 = op2->i;
6242 exp->string = PrintInt(op1->i = value2);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 unsigned int value2 = op2->ui;
6257 exp->string = PrintUInt(op1->ui = value2);
6260 exp->expType = op1->type;
6262 op1->type->refCount++;
6267 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 short value2 = op2->s;
6272 exp->string = PrintShort(op1->s = value2);
6275 exp->expType = op1->type;
6277 op1->type->refCount++;
6282 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 unsigned short value2 = op2->us;
6287 exp->string = PrintUShort(op1->us = value2);
6290 exp->expType = op1->type;
6292 op1->type->refCount++;
6297 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 char value2 = op2->c;
6302 exp->string = PrintChar(op1->c = value2);
6305 exp->expType = op1->type;
6307 op1->type->refCount++;
6312 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 unsigned char value2 = op2->uc;
6317 exp->string = PrintUChar(op1->uc = value2);
6320 exp->expType = op1->type;
6322 op1->type->refCount++;
6327 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 float value2 = op2->f;
6332 exp->string = PrintFloat(op1->f = value2);
6335 exp->expType = op1->type;
6337 op1->type->refCount++;
6342 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 double value2 = op2->d;
6347 exp->string = PrintDouble(op1->d = value2);
6350 exp->expType = op1->type;
6352 op1->type->refCount++;
6357 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 int value2 = op2->i;
6362 exp->string = PrintInt(op1->i += value2);
6365 exp->expType = op1->type;
6367 op1->type->refCount++;
6372 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 unsigned int value2 = op2->ui;
6377 exp->string = PrintUInt(op1->ui += value2);
6380 exp->expType = op1->type;
6382 op1->type->refCount++;
6387 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 short value2 = op2->s;
6392 exp->string = PrintShort(op1->s += value2);
6395 exp->expType = op1->type;
6397 op1->type->refCount++;
6402 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 unsigned short value2 = op2->us;
6407 exp->string = PrintUShort(op1->us += value2);
6410 exp->expType = op1->type;
6412 op1->type->refCount++;
6417 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 char value2 = op2->c;
6422 exp->string = PrintChar(op1->c += value2);
6425 exp->expType = op1->type;
6427 op1->type->refCount++;
6432 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 unsigned char value2 = op2->uc;
6437 exp->string = PrintUChar(op1->uc += value2);
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 float value2 = op2->f;
6452 exp->string = PrintFloat(op1->f += value2);
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 double value2 = op2->d;
6467 exp->string = PrintDouble(op1->d += value2);
6470 exp->expType = op1->type;
6472 op1->type->refCount++;
6477 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 int value2 = op2->i;
6482 exp->string = PrintInt(op1->i -= value2);
6485 exp->expType = op1->type;
6487 op1->type->refCount++;
6492 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 unsigned int value2 = op2->ui;
6497 exp->string = PrintUInt(op1->ui -= value2);
6500 exp->expType = op1->type;
6502 op1->type->refCount++;
6507 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 short value2 = op2->s;
6512 exp->string = PrintShort(op1->s -= value2);
6515 exp->expType = op1->type;
6517 op1->type->refCount++;
6522 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 unsigned short value2 = op2->us;
6527 exp->string = PrintUShort(op1->us -= value2);
6530 exp->expType = op1->type;
6532 op1->type->refCount++;
6537 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 char value2 = op2->c;
6542 exp->string = PrintChar(op1->c -= value2);
6545 exp->expType = op1->type;
6547 op1->type->refCount++;
6552 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 unsigned char value2 = op2->uc;
6557 exp->string = PrintUChar(op1->uc -= value2);
6560 exp->expType = op1->type;
6562 op1->type->refCount++;
6567 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 float value2 = op2->f;
6572 exp->string = PrintFloat(op1->f -= value2);
6575 exp->expType = op1->type;
6577 op1->type->refCount++;
6582 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 double value2 = op2->d;
6587 exp->string = PrintDouble(op1->d -= value2);
6590 exp->expType = op1->type;
6592 op1->type->refCount++;
6597 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 int value2 = op2->i;
6602 exp->string = PrintInt(op1->i *= value2);
6605 exp->expType = op1->type;
6607 op1->type->refCount++;
6612 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 unsigned int value2 = op2->ui;
6617 exp->string = PrintUInt(op1->ui *= value2);
6620 exp->expType = op1->type;
6622 op1->type->refCount++;
6627 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 short value2 = op2->s;
6632 exp->string = PrintShort(op1->s *= value2);
6635 exp->expType = op1->type;
6637 op1->type->refCount++;
6642 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 unsigned short value2 = op2->us;
6647 exp->string = PrintUShort(op1->us *= value2);
6650 exp->expType = op1->type;
6652 op1->type->refCount++;
6657 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 char value2 = op2->c;
6662 exp->string = PrintChar(op1->c *= value2);
6665 exp->expType = op1->type;
6667 op1->type->refCount++;
6672 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 unsigned char value2 = op2->uc;
6677 exp->string = PrintUChar(op1->uc *= value2);
6680 exp->expType = op1->type;
6682 op1->type->refCount++;
6687 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 float value2 = op2->f;
6692 exp->string = PrintFloat(op1->f *= value2);
6695 exp->expType = op1->type;
6697 op1->type->refCount++;
6702 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 double value2 = op2->d;
6707 exp->string = PrintDouble(op1->d *= value2);
6710 exp->expType = op1->type;
6712 op1->type->refCount++;
6717 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6719 int value2 = op2->i;
6722 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6725 exp->expType = op1->type;
6727 op1->type->refCount++;
6732 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6734 unsigned int value2 = op2->ui;
6737 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6740 exp->expType = op1->type;
6742 op1->type->refCount++;
6747 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 short value2 = op2->s;
6752 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6755 exp->expType = op1->type;
6757 op1->type->refCount++;
6762 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 unsigned short value2 = op2->us;
6767 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6770 exp->expType = op1->type;
6772 op1->type->refCount++;
6777 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6779 char value2 = op2->c;
6782 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6785 exp->expType = op1->type;
6787 op1->type->refCount++;
6792 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6794 unsigned char value2 = op2->uc;
6797 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6800 exp->expType = op1->type;
6802 op1->type->refCount++;
6807 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6809 float value2 = op2->f;
6812 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6815 exp->expType = op1->type;
6817 op1->type->refCount++;
6822 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6824 double value2 = op2->d;
6827 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6830 exp->expType = op1->type;
6832 op1->type->refCount++;
6837 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6839 int value2 = op2->i;
6842 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6845 exp->expType = op1->type;
6847 op1->type->refCount++;
6852 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6854 unsigned int value2 = op2->ui;
6857 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6860 exp->expType = op1->type;
6862 op1->type->refCount++;
6867 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6869 short value2 = op2->s;
6872 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6875 exp->expType = op1->type;
6877 op1->type->refCount++;
6882 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6884 unsigned short value2 = op2->us;
6887 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6890 exp->expType = op1->type;
6892 op1->type->refCount++;
6897 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6899 char value2 = op2->c;
6902 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6905 exp->expType = op1->type;
6907 op1->type->refCount++;
6912 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6914 unsigned char value2 = op2->uc;
6917 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6920 exp->expType = op1->type;
6922 op1->type->refCount++;
6927 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6929 int value2 = op2->i;
6932 exp->string = PrintInt(op1->i & value2);
6935 exp->expType = op1->type;
6937 op1->type->refCount++;
6942 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6944 unsigned int value2 = op2->ui;
6947 exp->string = PrintUInt(op1->ui & value2);
6950 exp->expType = op1->type;
6952 op1->type->refCount++;
6957 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 short value2 = op2->s;
6962 exp->string = PrintShort(op1->s & value2);
6965 exp->expType = op1->type;
6967 op1->type->refCount++;
6972 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 unsigned short value2 = op2->us;
6977 exp->string = PrintUShort(op1->us & value2);
6980 exp->expType = op1->type;
6982 op1->type->refCount++;
6987 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 char value2 = op2->c;
6992 exp->string = PrintChar(op1->c & value2);
6995 exp->expType = op1->type;
6997 op1->type->refCount++;
7002 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 unsigned char value2 = op2->uc;
7007 exp->string = PrintUChar(op1->uc & value2);
7010 exp->expType = op1->type;
7012 op1->type->refCount++;
7017 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 int value2 = op2->i;
7022 exp->string = PrintInt(op1->i | value2);
7025 exp->expType = op1->type;
7027 op1->type->refCount++;
7032 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 unsigned int value2 = op2->ui;
7037 exp->string = PrintUInt(op1->ui | value2);
7040 exp->expType = op1->type;
7042 op1->type->refCount++;
7047 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 short value2 = op2->s;
7052 exp->string = PrintShort(op1->s | value2);
7055 exp->expType = op1->type;
7057 op1->type->refCount++;
7062 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 unsigned short value2 = op2->us;
7067 exp->string = PrintUShort(op1->us | value2);
7070 exp->expType = op1->type;
7072 op1->type->refCount++;
7077 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 char value2 = op2->c;
7082 exp->string = PrintChar(op1->c | value2);
7085 exp->expType = op1->type;
7087 op1->type->refCount++;
7092 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 unsigned char value2 = op2->uc;
7097 exp->string = PrintUChar(op1->uc | value2);
7100 exp->expType = op1->type;
7102 op1->type->refCount++;
7107 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 int value2 = op2->i;
7112 exp->string = PrintInt(op1->i ^ value2);
7115 exp->expType = op1->type;
7117 op1->type->refCount++;
7122 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 unsigned int value2 = op2->ui;
7127 exp->string = PrintUInt(op1->ui ^ value2);
7130 exp->expType = op1->type;
7132 op1->type->refCount++;
7137 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 short value2 = op2->s;
7142 exp->string = PrintShort(op1->s ^ value2);
7145 exp->expType = op1->type;
7147 op1->type->refCount++;
7152 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 unsigned short value2 = op2->us;
7157 exp->string = PrintUShort(op1->us ^ value2);
7160 exp->expType = op1->type;
7162 op1->type->refCount++;
7167 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 char value2 = op2->c;
7172 exp->string = PrintChar(op1->c ^ value2);
7175 exp->expType = op1->type;
7177 op1->type->refCount++;
7182 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 unsigned char value2 = op2->uc;
7187 exp->string = PrintUChar(op1->uc ^ value2);
7190 exp->expType = op1->type;
7192 op1->type->refCount++;
7197 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 int value2 = op2->i;
7202 exp->string = PrintInt(op1->i << value2);
7205 exp->expType = op1->type;
7207 op1->type->refCount++;
7212 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 unsigned int value2 = op2->ui;
7217 exp->string = PrintUInt(op1->ui << value2);
7220 exp->expType = op1->type;
7222 op1->type->refCount++;
7227 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 short value2 = op2->s;
7232 exp->string = PrintShort(op1->s << value2);
7235 exp->expType = op1->type;
7237 op1->type->refCount++;
7242 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 unsigned short value2 = op2->us;
7247 exp->string = PrintUShort(op1->us << value2);
7250 exp->expType = op1->type;
7252 op1->type->refCount++;
7257 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 char value2 = op2->c;
7262 exp->string = PrintChar(op1->c << value2);
7265 exp->expType = op1->type;
7267 op1->type->refCount++;
7272 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 unsigned char value2 = op2->uc;
7277 exp->string = PrintUChar(op1->uc << value2);
7280 exp->expType = op1->type;
7282 op1->type->refCount++;
7287 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 int value2 = op2->i;
7292 exp->string = PrintInt(op1->i >> value2);
7295 exp->expType = op1->type;
7297 op1->type->refCount++;
7302 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 unsigned int value2 = op2->ui;
7307 exp->string = PrintUInt(op1->ui >> value2);
7310 exp->expType = op1->type;
7312 op1->type->refCount++;
7317 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 short value2 = op2->s;
7322 exp->string = PrintShort(op1->s >> value2);
7325 exp->expType = op1->type;
7327 op1->type->refCount++;
7332 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 unsigned short value2 = op2->us;
7337 exp->string = PrintUShort(op1->us >> value2);
7340 exp->expType = op1->type;
7342 op1->type->refCount++;
7347 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 char value2 = op2->c;
7352 exp->string = PrintChar(op1->c >> value2);
7355 exp->expType = op1->type;
7357 op1->type->refCount++;
7362 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 unsigned char value2 = op2->uc;
7367 exp->string = PrintUChar(op1->uc >> value2);
7370 exp->expType = op1->type;
7372 op1->type->refCount++;
7377 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7380 exp->string = PrintInt(~op1->i);
7383 exp->expType = op1->type;
7385 op1->type->refCount++;
7390 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7393 exp->string = PrintUInt(~op1->ui);
7396 exp->expType = op1->type;
7398 op1->type->refCount++;
7403 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7406 exp->string = PrintShort(~op1->s);
7409 exp->expType = op1->type;
7411 op1->type->refCount++;
7416 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7419 exp->string = PrintUShort(~op1->us);
7422 exp->expType = op1->type;
7424 op1->type->refCount++;
7429 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7432 exp->string = PrintChar(~op1->c);
7435 exp->expType = op1->type;
7437 op1->type->refCount++;
7442 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7445 exp->string = PrintUChar(~op1->uc);
7448 exp->expType = op1->type;
7450 op1->type->refCount++;
7455 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7457 int value2 = op2->i;
7460 exp->string = PrintInt(op1->i &= value2);
7463 exp->expType = op1->type;
7465 op1->type->refCount++;
7470 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7472 unsigned int value2 = op2->ui;
7475 exp->string = PrintUInt(op1->ui &= value2);
7478 exp->expType = op1->type;
7480 op1->type->refCount++;
7485 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7487 short value2 = op2->s;
7490 exp->string = PrintShort(op1->s &= value2);
7493 exp->expType = op1->type;
7495 op1->type->refCount++;
7500 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7502 unsigned short value2 = op2->us;
7505 exp->string = PrintUShort(op1->us &= value2);
7508 exp->expType = op1->type;
7510 op1->type->refCount++;
7515 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7517 char value2 = op2->c;
7520 exp->string = PrintChar(op1->c &= value2);
7523 exp->expType = op1->type;
7525 op1->type->refCount++;
7530 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7532 unsigned char value2 = op2->uc;
7535 exp->string = PrintUChar(op1->uc &= value2);
7538 exp->expType = op1->type;
7540 op1->type->refCount++;
7545 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7547 int value2 = op2->i;
7550 exp->string = PrintInt(op1->i |= value2);
7553 exp->expType = op1->type;
7555 op1->type->refCount++;
7560 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7562 unsigned int value2 = op2->ui;
7565 exp->string = PrintUInt(op1->ui |= value2);
7568 exp->expType = op1->type;
7570 op1->type->refCount++;
7575 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7577 short value2 = op2->s;
7580 exp->string = PrintShort(op1->s |= value2);
7583 exp->expType = op1->type;
7585 op1->type->refCount++;
7590 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7592 unsigned short value2 = op2->us;
7595 exp->string = PrintUShort(op1->us |= value2);
7598 exp->expType = op1->type;
7600 op1->type->refCount++;
7605 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7607 char value2 = op2->c;
7610 exp->string = PrintChar(op1->c |= value2);
7613 exp->expType = op1->type;
7615 op1->type->refCount++;
7620 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7622 unsigned char value2 = op2->uc;
7625 exp->string = PrintUChar(op1->uc |= value2);
7628 exp->expType = op1->type;
7630 op1->type->refCount++;
7635 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7637 int value2 = op2->i;
7640 exp->string = PrintInt(op1->i ^= value2);
7643 exp->expType = op1->type;
7645 op1->type->refCount++;
7650 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7652 unsigned int value2 = op2->ui;
7655 exp->string = PrintUInt(op1->ui ^= value2);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7667 short value2 = op2->s;
7670 exp->string = PrintShort(op1->s ^= value2);
7673 exp->expType = op1->type;
7675 op1->type->refCount++;
7680 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7682 unsigned short value2 = op2->us;
7685 exp->string = PrintUShort(op1->us ^= value2);
7688 exp->expType = op1->type;
7690 op1->type->refCount++;
7695 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7697 char value2 = op2->c;
7700 exp->string = PrintChar(op1->c ^= value2);
7703 exp->expType = op1->type;
7705 op1->type->refCount++;
7710 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7712 unsigned char value2 = op2->uc;
7715 exp->string = PrintUChar(op1->uc ^= value2);
7718 exp->expType = op1->type;
7720 op1->type->refCount++;
7725 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7727 int value2 = op2->i;
7730 exp->string = PrintInt(op1->i <<= value2);
7733 exp->expType = op1->type;
7735 op1->type->refCount++;
7740 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7742 unsigned int value2 = op2->ui;
7745 exp->string = PrintUInt(op1->ui <<= value2);
7748 exp->expType = op1->type;
7750 op1->type->refCount++;
7755 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7757 short value2 = op2->s;
7760 exp->string = PrintShort(op1->s <<= value2);
7763 exp->expType = op1->type;
7765 op1->type->refCount++;
7770 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7772 unsigned short value2 = op2->us;
7775 exp->string = PrintUShort(op1->us <<= value2);
7778 exp->expType = op1->type;
7780 op1->type->refCount++;
7785 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7787 char value2 = op2->c;
7790 exp->string = PrintChar(op1->c <<= value2);
7793 exp->expType = op1->type;
7795 op1->type->refCount++;
7800 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7802 unsigned char value2 = op2->uc;
7805 exp->string = PrintUChar(op1->uc <<= value2);
7808 exp->expType = op1->type;
7810 op1->type->refCount++;
7815 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7817 int value2 = op2->i;
7820 exp->string = PrintInt(op1->i >>= value2);
7823 exp->expType = op1->type;
7825 op1->type->refCount++;
7830 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7832 unsigned int value2 = op2->ui;
7835 exp->string = PrintUInt(op1->ui >>= value2);
7838 exp->expType = op1->type;
7840 op1->type->refCount++;
7845 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7847 short value2 = op2->s;
7850 exp->string = PrintShort(op1->s >>= value2);
7853 exp->expType = op1->type;
7855 op1->type->refCount++;
7860 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7862 unsigned short value2 = op2->us;
7865 exp->string = PrintUShort(op1->us >>= value2);
7868 exp->expType = op1->type;
7870 op1->type->refCount++;
7875 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7877 char value2 = op2->c;
7880 exp->string = PrintChar(op1->c >>= value2);
7883 exp->expType = op1->type;
7885 op1->type->refCount++;
7890 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7892 unsigned char value2 = op2->uc;
7895 exp->string = PrintUChar(op1->uc >>= value2);
7898 exp->expType = op1->type;
7900 op1->type->refCount++;
7905 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7908 exp->string = PrintInt(!op1->i);
7911 exp->expType = op1->type;
7913 op1->type->refCount++;
7918 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7921 exp->string = PrintUInt(!op1->ui);
7924 exp->expType = op1->type;
7926 op1->type->refCount++;
7931 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7934 exp->string = PrintShort(!op1->s);
7937 exp->expType = op1->type;
7939 op1->type->refCount++;
7944 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7947 exp->string = PrintUShort(!op1->us);
7950 exp->expType = op1->type;
7952 op1->type->refCount++;
7957 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7960 exp->string = PrintChar(!op1->c);
7963 exp->expType = op1->type;
7965 op1->type->refCount++;
7970 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7973 exp->string = PrintUChar(!op1->uc);
7976 exp->expType = op1->type;
7978 op1->type->refCount++;
7983 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7985 int value2 = op2->i;
7988 exp->string = PrintInt(op1->i == value2);
7991 exp->expType = op1->type;
7993 op1->type->refCount++;
7998 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8000 unsigned int value2 = op2->ui;
8003 exp->string = PrintUInt(op1->ui == value2);
8006 exp->expType = op1->type;
8008 op1->type->refCount++;
8013 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8015 short value2 = op2->s;
8018 exp->string = PrintShort(op1->s == value2);
8021 exp->expType = op1->type;
8023 op1->type->refCount++;
8028 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8030 unsigned short value2 = op2->us;
8033 exp->string = PrintUShort(op1->us == value2);
8036 exp->expType = op1->type;
8038 op1->type->refCount++;
8043 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8045 char value2 = op2->c;
8048 exp->string = PrintChar(op1->c == value2);
8051 exp->expType = op1->type;
8053 op1->type->refCount++;
8058 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8060 unsigned char value2 = op2->uc;
8063 exp->string = PrintUChar(op1->uc == value2);
8066 exp->expType = op1->type;
8068 op1->type->refCount++;
8073 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8075 float value2 = op2->f;
8078 exp->string = PrintFloat(op1->f == value2);
8081 exp->expType = op1->type;
8083 op1->type->refCount++;
8088 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8090 double value2 = op2->d;
8093 exp->string = PrintDouble(op1->d == value2);
8096 exp->expType = op1->type;
8098 op1->type->refCount++;
8103 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 int value2 = op2->i;
8108 exp->string = PrintInt(op1->i != value2);
8111 exp->expType = op1->type;
8113 op1->type->refCount++;
8118 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 unsigned int value2 = op2->ui;
8123 exp->string = PrintUInt(op1->ui != value2);
8126 exp->expType = op1->type;
8128 op1->type->refCount++;
8133 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 short value2 = op2->s;
8138 exp->string = PrintShort(op1->s != value2);
8141 exp->expType = op1->type;
8143 op1->type->refCount++;
8148 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 unsigned short value2 = op2->us;
8153 exp->string = PrintUShort(op1->us != value2);
8156 exp->expType = op1->type;
8158 op1->type->refCount++;
8163 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 char value2 = op2->c;
8168 exp->string = PrintChar(op1->c != value2);
8171 exp->expType = op1->type;
8173 op1->type->refCount++;
8178 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 unsigned char value2 = op2->uc;
8183 exp->string = PrintUChar(op1->uc != value2);
8186 exp->expType = op1->type;
8188 op1->type->refCount++;
8193 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 float value2 = op2->f;
8198 exp->string = PrintFloat(op1->f != value2);
8201 exp->expType = op1->type;
8203 op1->type->refCount++;
8208 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 double value2 = op2->d;
8213 exp->string = PrintDouble(op1->d != value2);
8216 exp->expType = op1->type;
8218 op1->type->refCount++;
8223 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 int value2 = op2->i;
8228 exp->string = PrintInt(op1->i && value2);
8231 exp->expType = op1->type;
8233 op1->type->refCount++;
8238 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 unsigned int value2 = op2->ui;
8243 exp->string = PrintUInt(op1->ui && value2);
8246 exp->expType = op1->type;
8248 op1->type->refCount++;
8253 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 short value2 = op2->s;
8258 exp->string = PrintShort(op1->s && value2);
8261 exp->expType = op1->type;
8263 op1->type->refCount++;
8268 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 unsigned short value2 = op2->us;
8273 exp->string = PrintUShort(op1->us && value2);
8276 exp->expType = op1->type;
8278 op1->type->refCount++;
8283 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 char value2 = op2->c;
8288 exp->string = PrintChar(op1->c && value2);
8291 exp->expType = op1->type;
8293 op1->type->refCount++;
8298 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 unsigned char value2 = op2->uc;
8303 exp->string = PrintUChar(op1->uc && value2);
8306 exp->expType = op1->type;
8308 op1->type->refCount++;
8313 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 float value2 = op2->f;
8318 exp->string = PrintFloat(op1->f && value2);
8321 exp->expType = op1->type;
8323 op1->type->refCount++;
8328 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 double value2 = op2->d;
8333 exp->string = PrintDouble(op1->d && value2);
8336 exp->expType = op1->type;
8338 op1->type->refCount++;
8343 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 int value2 = op2->i;
8348 exp->string = PrintInt(op1->i || value2);
8351 exp->expType = op1->type;
8353 op1->type->refCount++;
8358 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8360 unsigned int value2 = op2->ui;
8363 exp->string = PrintUInt(op1->ui || value2);
8366 exp->expType = op1->type;
8368 op1->type->refCount++;
8373 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8375 short value2 = op2->s;
8378 exp->string = PrintShort(op1->s || value2);
8381 exp->expType = op1->type;
8383 op1->type->refCount++;
8388 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8390 unsigned short value2 = op2->us;
8393 exp->string = PrintUShort(op1->us || value2);
8396 exp->expType = op1->type;
8398 op1->type->refCount++;
8403 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8405 char value2 = op2->c;
8408 exp->string = PrintChar(op1->c || value2);
8411 exp->expType = op1->type;
8413 op1->type->refCount++;
8418 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8420 unsigned char value2 = op2->uc;
8423 exp->string = PrintUChar(op1->uc || value2);
8426 exp->expType = op1->type;
8428 op1->type->refCount++;
8433 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8435 float value2 = op2->f;
8438 exp->string = PrintFloat(op1->f || value2);
8441 exp->expType = op1->type;
8443 op1->type->refCount++;
8448 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8450 double value2 = op2->d;
8453 exp->string = PrintDouble(op1->d || value2);
8456 exp->expType = op1->type;
8458 op1->type->refCount++;
8463 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8465 int value2 = op2->i;
8468 exp->string = PrintInt(op1->i > value2);
8471 exp->expType = op1->type;
8473 op1->type->refCount++;
8478 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8480 unsigned int value2 = op2->ui;
8483 exp->string = PrintUInt(op1->ui > value2);
8486 exp->expType = op1->type;
8488 op1->type->refCount++;
8493 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8495 short value2 = op2->s;
8498 exp->string = PrintShort(op1->s > value2);
8501 exp->expType = op1->type;
8503 op1->type->refCount++;
8508 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8510 unsigned short value2 = op2->us;
8513 exp->string = PrintUShort(op1->us > value2);
8516 exp->expType = op1->type;
8518 op1->type->refCount++;
8523 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8525 char value2 = op2->c;
8528 exp->string = PrintChar(op1->c > value2);
8531 exp->expType = op1->type;
8533 op1->type->refCount++;
8538 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8540 unsigned char value2 = op2->uc;
8543 exp->string = PrintUChar(op1->uc > value2);
8546 exp->expType = op1->type;
8548 op1->type->refCount++;
8553 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8555 float value2 = op2->f;
8558 exp->string = PrintFloat(op1->f > value2);
8561 exp->expType = op1->type;
8563 op1->type->refCount++;
8568 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8570 double value2 = op2->d;
8573 exp->string = PrintDouble(op1->d > value2);
8576 exp->expType = op1->type;
8578 op1->type->refCount++;
8583 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8585 int value2 = op2->i;
8588 exp->string = PrintInt(op1->i < value2);
8591 exp->expType = op1->type;
8593 op1->type->refCount++;
8598 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8600 unsigned int value2 = op2->ui;
8603 exp->string = PrintUInt(op1->ui < value2);
8606 exp->expType = op1->type;
8608 op1->type->refCount++;
8613 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8615 short value2 = op2->s;
8618 exp->string = PrintShort(op1->s < value2);
8621 exp->expType = op1->type;
8623 op1->type->refCount++;
8628 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8630 unsigned short value2 = op2->us;
8633 exp->string = PrintUShort(op1->us < value2);
8636 exp->expType = op1->type;
8638 op1->type->refCount++;
8643 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8645 char value2 = op2->c;
8648 exp->string = PrintChar(op1->c < value2);
8651 exp->expType = op1->type;
8653 op1->type->refCount++;
8658 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8660 unsigned char value2 = op2->uc;
8663 exp->string = PrintUChar(op1->uc < value2);
8666 exp->expType = op1->type;
8668 op1->type->refCount++;
8673 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8675 float value2 = op2->f;
8678 exp->string = PrintFloat(op1->f < value2);
8681 exp->expType = op1->type;
8683 op1->type->refCount++;
8688 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8690 double value2 = op2->d;
8693 exp->string = PrintDouble(op1->d < value2);
8696 exp->expType = op1->type;
8698 op1->type->refCount++;
8703 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8705 int value2 = op2->i;
8708 exp->string = PrintInt(op1->i >= value2);
8711 exp->expType = op1->type;
8713 op1->type->refCount++;
8718 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8720 unsigned int value2 = op2->ui;
8723 exp->string = PrintUInt(op1->ui >= value2);
8726 exp->expType = op1->type;
8728 op1->type->refCount++;
8733 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8735 short value2 = op2->s;
8738 exp->string = PrintShort(op1->s >= value2);
8741 exp->expType = op1->type;
8743 op1->type->refCount++;
8748 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8750 unsigned short value2 = op2->us;
8753 exp->string = PrintUShort(op1->us >= value2);
8756 exp->expType = op1->type;
8758 op1->type->refCount++;
8763 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8765 char value2 = op2->c;
8768 exp->string = PrintChar(op1->c >= value2);
8771 exp->expType = op1->type;
8773 op1->type->refCount++;
8778 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8780 unsigned char value2 = op2->uc;
8783 exp->string = PrintUChar(op1->uc >= value2);
8786 exp->expType = op1->type;
8788 op1->type->refCount++;
8793 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8795 float value2 = op2->f;
8798 exp->string = PrintFloat(op1->f >= value2);
8801 exp->expType = op1->type;
8803 op1->type->refCount++;
8808 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8810 double value2 = op2->d;
8813 exp->string = PrintDouble(op1->d >= value2);
8816 exp->expType = op1->type;
8818 op1->type->refCount++;
8823 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8825 int value2 = op2->i;
8828 exp->string = PrintInt(op1->i <= value2);
8831 exp->expType = op1->type;
8833 op1->type->refCount++;
8838 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8840 unsigned int value2 = op2->ui;
8843 exp->string = PrintUInt(op1->ui <= value2);
8846 exp->expType = op1->type;
8848 op1->type->refCount++;
8853 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8855 short value2 = op2->s;
8858 exp->string = PrintShort(op1->s <= value2);
8861 exp->expType = op1->type;
8863 op1->type->refCount++;
8868 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8870 unsigned short value2 = op2->us;
8873 exp->string = PrintUShort(op1->us <= value2);
8876 exp->expType = op1->type;
8878 op1->type->refCount++;
8883 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8885 char value2 = op2->c;
8888 exp->string = PrintChar(op1->c <= value2);
8891 exp->expType = op1->type;
8893 op1->type->refCount++;
8898 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8900 unsigned char value2 = op2->uc;
8903 exp->string = PrintUChar(op1->uc <= value2);
8906 exp->expType = op1->type;
8908 op1->type->refCount++;
8913 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8915 float value2 = op2->f;
8918 exp->string = PrintFloat(op1->f <= value2);
8921 exp->expType = op1->type;
8923 op1->type->refCount++;
8928 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8930 double value2 = op2->d;
8933 exp->string = PrintDouble(op1->d <= value2);
8936 exp->expType = op1->type;
8938 op1->type->refCount++;
8943 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8946 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8949 exp->expType = op1->type;
8951 op1->type->refCount++;
8956 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8959 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8962 exp->expType = op1->type;
8964 op1->type->refCount++;
8969 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8972 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8985 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8988 exp->expType = op1->type;
8990 op1->type->refCount++;
8995 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8998 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9001 exp->expType = op1->type;
9003 op1->type->refCount++;
9008 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9011 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9014 exp->expType = op1->type;
9016 op1->type->refCount++;
9021 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9024 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9027 exp->expType = op1->type;
9029 op1->type->refCount++;
9034 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9037 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9040 exp->expType = op1->type;
9042 op1->type->refCount++;
9047 struct OpTable intOps =
9049 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
9052 struct OpTable uintOps =
9054 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
9057 struct OpTable shortOps =
9059 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
9062 struct OpTable ushortOps =
9064 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
9067 struct OpTable floatOps =
9069 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
9072 struct OpTable doubleOps =
9074 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
9077 struct OpTable charOps =
9079 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
9082 struct OpTable ucharOps =
9084 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
9087 void ReadString(char * output, char * string)
9089 int len = strlen(string);
9091 unsigned int quoted = 0x0, escaped = 0x0;
9093 for(c = 0; c < len; c++)
9095 char ch = string[c];
9151 extern double strtod(char * , char * * );
9153 struct Operand GetOperand(struct Expression * exp)
9159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9162 struct Type * type = exp->expType;
9166 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9168 if(!type->_class->registered->dataType)
9169 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9170 type = type->_class->registered->dataType;
9172 op.kind = type->kind;
9173 op.type = exp->expType;
9174 if(exp->isConstant && exp->type == 2)
9180 if(exp->constant[0] == '\'')
9181 op.c = exp->constant[1];
9182 else if(type->isSigned)
9184 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9189 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9197 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9202 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9210 op.i = strtol(exp->constant, (((void *)0)), 0);
9215 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9223 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9228 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9234 op.f = (float)strtod(exp->constant, (((void *)0)));
9238 op.d = (double)strtod(exp->constant, (((void *)0)));
9244 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9254 int __ecereVMethodID_class_OnGetString;
9256 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9258 static void UnusedFunction()
9262 ((char * (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char * tempString, void * fieldData, unsigned int * needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
9265 extern int __ecereVMethodID_class_OnGetString;
9267 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9269 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9271 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9273 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9274 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9277 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9278 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9280 void * ptr = inst->data + dataMember->offset + offset;
9281 char * result = (((void *)0));
9283 exp->loc = member->loc = inst->loc;
9284 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9285 if(!dataMember->dataType)
9286 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9287 type = dataMember->dataType;
9290 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9292 if(_class->type == 4)
9294 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9298 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9299 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9301 for(item = e->values.first; item; item = item->next)
9303 if((int)item->data == *(int *)ptr)
9305 result = item->name;
9311 exp->identifier = MkIdentifier(result);
9313 exp->destType = MkClassType(_class->fullName);
9314 ProcessExpressionType(exp);
9318 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9320 if(!_class->dataType)
9321 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9322 type = _class->dataType;
9331 FreeExpContents(exp);
9332 exp->constant = PrintFloat(*(float *)ptr);
9338 FreeExpContents(exp);
9339 exp->constant = PrintDouble(*(double *)ptr);
9345 FreeExpContents(exp);
9346 exp->constant = PrintInt(*(int *)ptr);
9352 FreeExpContents(exp);
9353 exp->constant = PrintInt64(*(long long *)ptr);
9358 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9361 ListAdd(memberList, member);
9363 if(parentDataMember->type == 1)
9368 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9370 void PopulateInstance(struct Instantiation * inst)
9372 struct Symbol * classSym = inst->_class->symbol;
9373 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9374 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9375 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9377 inst->members = MkListOne(MkMembersInitList(memberList));
9378 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9380 if(!dataMember->isProperty)
9382 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9383 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9386 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9387 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9389 void * ptr = inst->data + dataMember->offset;
9390 char * result = (((void *)0));
9392 exp->loc = member->loc = inst->loc;
9393 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9394 if(!dataMember->dataType)
9395 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9396 type = dataMember->dataType;
9399 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9401 if(_class->type == 4)
9403 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9407 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9408 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9410 for(item = e->values.first; item; item = item->next)
9412 if((int)item->data == *(int *)ptr)
9414 result = item->name;
9421 exp->identifier = MkIdentifier(result);
9423 exp->destType = MkClassType(_class->fullName);
9424 ProcessExpressionType(exp);
9427 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9429 if(!_class->dataType)
9430 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9431 type = _class->dataType;
9440 exp->constant = PrintFloat(*(float *)ptr);
9446 exp->constant = PrintDouble(*(double *)ptr);
9452 exp->constant = PrintInt(*(int *)ptr);
9458 exp->constant = PrintInt64(*(long long *)ptr);
9463 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9466 ListAdd(memberList, member);
9472 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, char * name, unsigned int * offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
9474 extern void FreeInstance(struct Instantiation * inst);
9476 void ComputeInstantiation(struct Expression * exp)
9478 struct Instantiation * inst = exp->instance;
9479 struct MembersInit * members;
9480 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9481 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9482 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9483 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9484 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9485 int subMemberStackPos = 0;
9488 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9492 if(_class->type == 0 || _class->type == 5)
9493 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9495 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9499 for(members = (*inst->members).first; members; members = members->next)
9501 switch(members->type)
9505 if(members->dataMembers)
9507 struct MemberInit * member;
9509 for(member = (*members->dataMembers).first; member; member = member->next)
9511 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9512 unsigned int found = 0x0;
9513 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9514 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9515 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9516 unsigned int dataMemberOffset;
9520 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9523 if(curMember->isProperty)
9524 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9527 dataMember = curMember;
9528 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9535 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9539 if(prop->memberAccess == 1)
9541 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9542 curClass = prop->_class;
9547 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9548 int _subMemberStackPos = 0;
9550 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9554 if(dataMember->memberAccess == 1)
9556 curMember = dataMember;
9557 curClass = dataMember->_class;
9558 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9559 subMemberStackPos = _subMemberStackPos;
9564 if(found && member->initializer && member->initializer->type == 0)
9566 struct Expression * value = member->initializer->exp;
9567 struct Type * type = (((void *)0));
9571 type = prop->dataType;
9575 if(!dataMember->dataType)
9576 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9577 type = dataMember->dataType;
9579 if(ident && ident->next)
9581 for(ident = ident->next; ident && type; ident = ident->next)
9585 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9587 type = prop->dataType;
9590 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9592 type = dataMember->dataType;
9595 else if(type->kind == 9 || type->kind == 10)
9597 struct Type * memberType;
9599 for(memberType = type->members.first; memberType; memberType = memberType->next)
9601 if(!strcmp(memberType->name, ident->string))
9612 FreeType(value->destType);
9613 value->destType = type;
9616 ComputeExpression(value);
9618 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9622 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9624 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9626 if(!_class->dataType)
9627 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9628 type = _class->dataType;
9633 void * ptr = inst->data + dataMemberOffset;
9635 if(value->type == 2)
9641 GetInt(value, (int *)ptr);
9646 GetInt64(value, (long long *)ptr);
9651 GetFloat(value, (float *)ptr);
9656 GetDouble(value, (double *)ptr);
9661 else if(value->type == 1)
9665 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9667 if(_class->type == 1)
9669 ComputeTypeSize(type);
9670 if(value->instance->data)
9671 memcpy(ptr, value->instance->data, type->size);
9678 if(value->type == 1 && value->instance->data)
9680 void (* Set)(void *, void *) = (void *)prop->Set;
9682 Set(inst->data, value->instance->data);
9683 PopulateInstance(inst);
9685 else if(value->type == 2)
9691 void (* Set)(void *, double) = (void *)prop->Set;
9693 Set(inst->data, strtod(value->constant, (((void *)0))));
9698 void (* Set)(void *, float) = (void *)prop->Set;
9700 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9705 void (* Set)(void *, int) = (void *)prop->Set;
9707 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9712 void (* Set)(void *, long long) = (void *)prop->Set;
9714 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9719 else if(value->type == 3)
9723 ReadString(temp, value->string);
9724 prop->Set(inst->data, temp);
9728 else if(_class->type == 3)
9732 if(value->type == 2)
9736 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9738 if(_class->type == 3)
9740 if(!_class->dataType)
9741 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9742 type = _class->dataType;
9750 float (* Set)(float) = (void *)prop->Set;
9752 GetFloat(member->initializer->exp, &fValue);
9753 exp->constant = PrintFloat(Set(fValue));
9760 double (* Set)(double) = (void *)prop->Set;
9762 GetDouble(member->initializer->exp, &dValue);
9763 exp->constant = PrintDouble(Set(dValue));
9771 else if(_class->type == 2)
9775 if(value->type == 1 && value->instance->data)
9777 unsigned int (* Set)(void *) = (void *)prop->Set;
9779 bits = Set(value->instance->data);
9781 else if(value->type == 2)
9787 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9791 GetInt(value, &part);
9792 bits = (bits & ~bitMember->mask);
9793 if(!bitMember->dataType)
9794 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9795 type = bitMember->dataType;
9796 if(type->kind == 8 && type->_class && type->_class->registered)
9798 if(!type->_class->registered->dataType)
9799 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9800 type = type->_class->registered->dataType;
9806 bits |= ((char)part << bitMember->pos);
9808 bits |= ((unsigned char)part << bitMember->pos);
9812 bits |= ((short)part << bitMember->pos);
9814 bits |= ((unsigned short)part << bitMember->pos);
9819 bits |= (part << bitMember->pos);
9821 bits |= ((unsigned int)part << bitMember->pos);
9825 bits |= ((long long)part << bitMember->pos);
9827 bits |= ((uint64)part << bitMember->pos);
9835 if(_class && _class->type == 3)
9837 ComputeExpression(member->initializer->exp);
9838 exp->constant = member->initializer->exp->constant;
9840 member->initializer->exp->constant = (((void *)0));
9850 if(_class && _class->type == 2)
9852 exp->constant = PrintHexUInt(bits);
9861 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9863 if(exp->op.op == SIZEOF)
9865 FreeExpContents(exp);
9867 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9877 struct Expression * exp2 = exp->op.exp2;
9879 exp->op.exp2 = (((void *)0));
9880 FreeExpContents(exp);
9881 FreeType(exp->expType);
9882 FreeType(exp->destType);
9884 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9890 FreeExpContents(exp);
9891 op1->ops.Neg(exp, op1);
9897 FreeExpContents(exp);
9898 op1->ops.BitNot(exp, op1);
9904 FreeExpContents(exp);
9905 op1->ops.Not(exp, op1);
9917 FreeExpContents(exp);
9918 op1->ops.Add(exp, op1, op2);
9924 FreeExpContents(exp);
9925 op1->ops.Sub(exp, op1, op2);
9931 FreeExpContents(exp);
9932 op1->ops.Mul(exp, op1, op2);
9938 FreeExpContents(exp);
9939 op1->ops.Div(exp, op1, op2);
9945 FreeExpContents(exp);
9946 op1->ops.Mod(exp, op1, op2);
9954 FreeExpContents(exp);
9955 op1->ops.BitAnd(exp, op1, op2);
9962 FreeExpContents(exp);
9963 op1->ops.BitOr(exp, op1, op2);
9969 FreeExpContents(exp);
9970 op1->ops.BitXor(exp, op1, op2);
9976 FreeExpContents(exp);
9977 op1->ops.LShift(exp, op1, op2);
9983 FreeExpContents(exp);
9984 op1->ops.RShift(exp, op1, op2);
9990 FreeExpContents(exp);
9991 op1->ops.Equ(exp, op1, op2);
9997 FreeExpContents(exp);
9998 op1->ops.Nqu(exp, op1, op2);
10004 FreeExpContents(exp);
10005 op1->ops.And(exp, op1, op2);
10011 FreeExpContents(exp);
10012 op1->ops.Or(exp, op1, op2);
10018 FreeExpContents(exp);
10019 op1->ops.Grt(exp, op1, op2);
10025 FreeExpContents(exp);
10026 op1->ops.Sma(exp, op1, op2);
10030 if(op1->ops.GrtEqu)
10032 FreeExpContents(exp);
10033 op1->ops.GrtEqu(exp, op1, op2);
10037 if(op1->ops.SmaEqu)
10039 FreeExpContents(exp);
10040 op1->ops.SmaEqu(exp, op1, op2);
10048 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10050 void ComputeExpression(struct Expression * exp)
10052 char expString[10240];
10054 expString[0] = '\0';
10059 ComputeInstantiation(exp);
10064 struct Expression * exp1, * exp2 = (((void *)0));
10065 struct Operand op1 =
10069 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10072 struct Operand op2 =
10076 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10081 ComputeExpression(exp->op.exp2);
10084 ComputeExpression(exp->op.exp1);
10085 exp1 = exp->op.exp1;
10086 exp2 = exp->op.exp2;
10087 op1 = GetOperand(exp1);
10089 op1.type->refCount++;
10092 op2 = GetOperand(exp2);
10094 op2.type->refCount++;
10099 exp1 = exp->op.exp2;
10100 op1 = GetOperand(exp1);
10102 op1.type->refCount++;
10104 CallOperator(exp, exp1, exp2, &op1, &op2);
10106 FreeType(op1.type);
10108 FreeType(op2.type);
10114 struct Expression * e, * n;
10116 for(e = (*exp->list).first; e; e = n)
10121 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10123 ComputeExpression(e);
10124 FreeType(exp->expType);
10125 FreeType(exp->destType);
10127 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10128 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10139 struct Expression * memberExp = exp->member.exp;
10140 struct Identifier * memberID = exp->member.member;
10141 struct Type * type;
10143 ComputeExpression(exp->member.exp);
10144 type = exp->member.exp->expType;
10147 struct __ecereNameSpace__ecere__com__Class * _class = (exp->member.member && exp->member.member->classSym) ? exp->member.member->classSym->registered : (((type->kind == 8 || type->kind == 19) && type->_class) ? type->_class->registered : (((void *)0)));
10148 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10149 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10150 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10152 if(type->kind == 19 && exp->member.exp->type == 26)
10153 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10157 struct Symbol * classSym;
10160 PrintType(type, string, 0x0, 0x1);
10161 classSym = FindClass(string);
10162 _class = classSym ? classSym->registered : (((void *)0));
10164 if(exp->member.member)
10166 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10168 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10170 if(!prop && !member && _class && exp->member.member)
10172 struct Symbol * classSym = FindClass(exp->member.member->string);
10174 convertTo = _class;
10175 _class = classSym ? classSym->registered : (((void *)0));
10176 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10182 struct Type * type = prop->dataType;
10184 if(_class->type == 3)
10186 if(type->kind == 8)
10188 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10190 if(_class->type == 3)
10192 if(!_class->dataType)
10193 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10194 type = _class->dataType;
10202 float (* Get)(float) = (void *)prop->Get;
10204 GetFloat(exp->member.exp, &value);
10205 exp->constant = PrintFloat(Get ? Get(value) : value);
10212 double (* Get)(double);
10214 GetDouble(exp->member.exp, &value);
10216 Get = (void *)prop->Set;
10218 Get = (void *)prop->Get;
10219 exp->constant = PrintDouble(Get ? Get(value) : value);
10229 struct Expression * value = exp->member.exp;
10230 struct Type * type;
10232 if(!prop->dataType)
10233 ProcessPropertyType(prop);
10234 type = prop->dataType;
10238 else if(_class->type == 1)
10244 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10246 if(propertyClass->type == 1 && value->type == 1)
10248 void (* Set)(void *, void *) = (void *)prop->Set;
10250 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10251 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10252 exp->instance->_class = MkSpecifierName(_class->fullName);
10253 exp->instance->loc = exp->loc;
10255 Set(exp->instance->data, value->instance->data);
10256 PopulateInstance(exp->instance);
10263 void (* Set)(void *, int) = (void *)prop->Set;
10265 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10266 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10267 exp->instance->_class = MkSpecifierName(_class->fullName);
10268 exp->instance->loc = exp->loc;
10270 GetInt(value, &intValue);
10271 Set(exp->instance->data, intValue);
10272 PopulateInstance(exp->instance);
10277 long long intValue;
10278 void (* Set)(void *, long long) = (void *)prop->Set;
10280 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10281 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10282 exp->instance->_class = MkSpecifierName(_class->fullName);
10283 exp->instance->loc = exp->loc;
10285 GetInt64(value, &intValue);
10286 Set(exp->instance->data, intValue);
10287 PopulateInstance(exp->instance);
10292 double doubleValue;
10293 void (* Set)(void *, double) = (void *)prop->Set;
10295 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10296 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10297 exp->instance->_class = MkSpecifierName(_class->fullName);
10298 exp->instance->loc = exp->loc;
10300 GetDouble(value, &doubleValue);
10301 Set(exp->instance->data, doubleValue);
10302 PopulateInstance(exp->instance);
10307 else if(_class->type == 2)
10313 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10315 if(propertyClass->type == 1 && value->instance->data)
10317 unsigned int (* Set)(void *) = (void *)prop->Set;
10318 unsigned int bits = Set(value->instance->data);
10320 exp->constant = PrintHexUInt(bits);
10324 else if(_class->type == 2)
10326 unsigned int value;
10327 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10330 GetUInt(exp->member.exp, &value);
10332 exp->constant = PrintHexUInt(bits);
10341 if(_class->type == 2)
10343 unsigned int value;
10345 GetUInt(exp->member.exp, &value);
10350 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10352 if(_class->type == 1)
10354 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10356 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10357 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10358 exp->instance->_class = MkSpecifierName(_class->fullName);
10359 exp->instance->loc = exp->loc;
10361 Get(value, exp->instance->data);
10362 PopulateInstance(exp->instance);
10364 else if(_class->type == 2)
10366 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10367 uint64 bits = Get(value);
10369 exp->constant = PrintHexUInt64(bits);
10376 else if(_class->type == 1)
10378 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10384 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10386 if(_class->type == 1 && value)
10388 void (* Get)(void *, void *) = (void *)prop->Get;
10390 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10391 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10392 exp->instance->_class = MkSpecifierName(_class->fullName);
10393 exp->instance->loc = exp->loc;
10395 Get(value, exp->instance->data);
10396 PopulateInstance(exp->instance);
10407 exp->isConstant = 0x0;
10416 FreeExpression(memberExp);
10417 FreeIdentifier(memberID);
10423 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10425 FreeExpContents(exp);
10426 exp->constant = PrintUInt(ComputeTypeSize(type));
10433 struct Symbol * classSym = exp->_class->symbol;
10435 if(classSym && classSym->registered)
10437 if(classSym->registered->fixed)
10439 FreeSpecifier(exp->_class);
10440 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10445 char className[1024];
10447 strcpy(className, "__ecereClass_");
10448 FullClassNameCat(className, classSym->string, 0x1);
10449 MangleClassName(className);
10450 FreeExpContents(exp);
10452 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10453 exp->member.member = MkIdentifier("structSize");
10460 struct Type * type;
10461 struct Expression * e = exp;
10463 if(exp->type == 11)
10466 ComputeExpression(exp->cast.exp);
10469 if(e && exp->expType)
10471 type = exp->expType;
10472 if(type->kind == 8)
10474 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10476 if(_class && (_class->type == 3 || _class->type == 2))
10478 if(!_class->dataType)
10479 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10480 type = _class->dataType;
10490 GetChar(e, &value);
10491 FreeExpContents(exp);
10492 exp->constant = PrintChar(value);
10497 unsigned char value;
10499 GetUChar(e, &value);
10500 FreeExpContents(exp);
10501 exp->constant = PrintUChar(value);
10510 GetShort(e, &value);
10511 FreeExpContents(exp);
10512 exp->constant = PrintShort(value);
10517 unsigned short value;
10519 GetUShort(e, &value);
10520 FreeExpContents(exp);
10521 exp->constant = PrintUShort(value);
10531 FreeExpContents(exp);
10532 exp->constant = PrintInt(value);
10537 unsigned int value;
10539 GetUInt(e, &value);
10540 FreeExpContents(exp);
10541 exp->constant = PrintUInt(value);
10550 GetInt64(e, &value);
10551 FreeExpContents(exp);
10552 exp->constant = PrintInt64(value);
10559 GetUInt64(e, &value);
10560 FreeExpContents(exp);
10561 exp->constant = PrintUInt64(value);
10569 GetFloat(e, &value);
10570 FreeExpContents(exp);
10571 exp->constant = PrintFloat(value);
10579 GetDouble(e, &value);
10580 FreeExpContents(exp);
10581 exp->constant = PrintDouble(value);
10591 struct Operand op1 =
10595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10598 struct Operand op2 =
10602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10605 struct Operand op3 =
10609 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10614 ComputeExpression((*exp->cond.exp).last);
10615 if(exp->cond.elseExp)
10616 ComputeExpression(exp->cond.elseExp);
10618 ComputeExpression(exp->cond.cond);
10619 op1 = GetOperand(exp->cond.cond);
10621 op1.type->refCount++;
10622 op2 = GetOperand((*exp->cond.exp).last);
10624 op2.type->refCount++;
10625 op3 = GetOperand(exp->cond.elseExp);
10627 op3.type->refCount++;
10630 FreeExpContents(exp);
10631 op1.ops.Cond(exp, &op1, &op2, &op3);
10634 FreeType(op1.type);
10636 FreeType(op2.type);
10638 FreeType(op3.type);
10644 void ApplyAnyObjectLogic(struct Expression * e);
10646 extern void CopyTypeInto(struct Type * type, struct Type * src);
10648 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10650 unsigned int result = 0x1;
10654 struct __ecereNameSpace__ecere__sys__OldList converts =
10658 struct Conversion * convert;
10660 if(destType->kind == 0)
10662 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10666 for(convert = converts.first; convert; convert = convert->next)
10668 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10672 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10673 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10676 newExp->destType = (((void *)0));
10680 exp->addedThis = 0x1;
10681 exp->member.exp = newExp;
10682 FreeType(exp->member.exp->expType);
10683 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10684 exp->member.exp->expType->classObjectType = objectType;
10685 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10686 exp->member.memberType = 1;
10687 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10688 exp->needCast = 0x1;
10690 exp->expType->refCount++;
10691 ApplyAnyObjectLogic(exp->member.exp);
10697 exp->addedThis = 0x1;
10698 exp->member.exp = newExp;
10699 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10701 newExp->byReference = 0x1;
10703 FreeType(exp->member.exp->expType);
10704 exp->member.exp->expType = (((void *)0));
10705 if(convert->convert->dataType)
10707 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10708 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10709 exp->member.exp->expType->refCount = 1;
10710 exp->member.exp->expType->classObjectType = objectType;
10711 ApplyAnyObjectLogic(exp->member.exp);
10713 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10714 exp->member.memberType = 4;
10715 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10716 exp->needCast = 0x1;
10717 if(convert->resultType)
10718 convert->resultType->refCount++;
10724 FreeType(exp->expType);
10727 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10728 exp->needCast = 0x1;
10730 exp->expType->refCount++;
10734 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10735 exp->needCast = 0x1;
10736 if(convert->resultType)
10737 convert->resultType->refCount++;
10741 if(exp->isConstant && inCompiler)
10742 ComputeExpression(exp);
10743 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10745 if(!result && exp->expType && converts.count)
10747 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10749 if(!result && exp->expType && exp->destType)
10751 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->type->kind == 8 && exp->expType->type->_class == exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->type->kind == 8 && exp->destType->type->_class == exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1))
10758 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10760 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10762 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10764 void CheckTemplateTypes(struct Expression * exp)
10766 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10768 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10769 struct Statement * compound;
10770 struct Context * context;
10774 exp->destType->refCount++;
10776 exp->expType->refCount++;
10777 newExp->prev = (((void *)0));
10778 newExp->next = (((void *)0));
10779 switch(exp->expType->kind)
10782 if(exp->destType->classObjectType)
10785 exp->destType->refCount--;
10787 exp->expType->refCount--;
10788 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10792 struct __ecereNameSpace__ecere__sys__OldList * specs;
10793 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10794 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10796 context = PushContext();
10797 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10798 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10799 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10801 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10802 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10803 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10804 exp->compound->compound.context = context;
10805 PopContext(context);
10810 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10811 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10815 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10817 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10818 struct Statement * compound;
10819 struct Context * context;
10823 exp->destType->refCount++;
10825 exp->expType->refCount++;
10826 newExp->prev = (((void *)0));
10827 newExp->next = (((void *)0));
10828 switch(exp->expType->kind)
10831 if(exp->destType->classObjectType)
10834 exp->destType->refCount--;
10836 exp->expType->refCount--;
10837 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10841 struct __ecereNameSpace__ecere__sys__OldList * specs;
10842 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10843 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10845 context = PushContext();
10846 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10847 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10848 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10850 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10851 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10852 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10853 exp->compound->compound.context = context;
10854 PopContext(context);
10859 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10862 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10863 ProcessExpressionType((*exp->list).first);
10869 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10870 newExp->needCast = 0x1;
10871 ProcessExpressionType((*exp->list).first);
10877 if(exp->expType->kind == 20)
10879 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10883 FreeType(exp->destType);
10884 FreeType(exp->expType);
10885 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10889 if(newExp->type == 8 && newExp->member.memberType == 3)
10893 exp->op.exp1 = (((void *)0));
10894 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10898 char typeString[1024];
10899 struct Declarator * decl;
10900 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10902 typeString[0] = '\0';
10903 PrintType(exp->expType, typeString, 0x0, 0x0);
10904 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10906 exp->cast.typeName = MkTypeName(specs, decl);
10907 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10908 exp->cast.exp->needCast = 0x1;
10916 extern int strncmp(const char * , const char * , int n);
10918 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
10920 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10922 int nsLen = strlen(nameSpace);
10923 struct Symbol * symbol;
10925 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)))
10927 char * s = symbol->string;
10929 if(!strncmp(s, nameSpace, nsLen))
10934 for(c = strlen(s) - 1; c >= 0; c--)
10937 namePart = s + c + 1;
10938 if(!strcmp(namePart, name))
10946 return (((void *)0));
10949 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10952 char nameSpace[1024];
10954 unsigned int gotColon = 0x0;
10956 nameSpace[0] = '\0';
10957 for(c = strlen(name) - 1; c >= 0; c--)
10963 namePart = name + c + 1;
10964 while(c >= 0 && name[c] == ':')
10968 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10972 memcpy(nameSpace, name, c + 1);
10973 nameSpace[c + 1] = (char)0;
10974 return ScanWithNameSpace(tree, nameSpace, namePart);
10978 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10984 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10988 return ScanWithNameSpace(tree, "", namePart);
10990 return (((void *)0));
10993 static void ProcessDeclaration(struct Declaration * decl);
10995 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10997 struct Context * ctx;
10998 struct Symbol * symbol = (((void *)0));
11000 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11002 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11004 symbol = (((void *)0));
11007 char curName[1024];
11009 strcpy(curName, thisNameSpace);
11010 strcat(curName, "::");
11011 strcat(curName, name);
11012 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11015 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11018 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11019 if(symbol || ctx == endContext)
11022 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11024 if(symbol->pointerExternal->type == 0)
11026 struct FunctionDefinition * function = symbol->pointerExternal->function;
11027 struct Context * tmpContext = curContext;
11029 curContext = (((void *)0));
11030 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11031 curContext = tmpContext;
11032 symbol->pointerExternal->symbol = symbol;
11033 DeclareType(symbol->type, 0x1, 0x1);
11034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11035 symbol->id = curExternal->symbol->idCode;
11037 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11040 symbol->id = curExternal->symbol->idCode;
11046 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11048 if(!type->isSigned)
11049 ListAdd(specs, MkSpecifier(UNSIGNED));
11054 if(type->_class->registered)
11056 if(!type->_class->registered->dataType)
11057 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11058 GetTypeSpecs(type->_class->registered->dataType, specs);
11063 ListAdd(specs, MkSpecifier(DOUBLE));
11066 ListAdd(specs, MkSpecifier(FLOAT));
11069 ListAdd(specs, MkSpecifier(CHAR));
11072 ListAdd(specs, MkSpecifier(SHORT));
11075 ListAdd(specs, MkSpecifier(INT64));
11079 ListAdd(specs, MkSpecifier(INT));
11084 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11086 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11093 if(type->_class && type->_class->string)
11095 if(type->classObjectType == 2)
11096 strcat(string, "typed_object");
11098 strcat(string, type->_class->string);
11101 if(type->_class->registered)
11102 strcat(string, type->_class->registered->name);
11104 strcat(string, type->_class->string);
11111 _PrintType(type->type, string, 0x0, printFunction, fullName);
11112 strcat(string, " *");
11117 strcat(string, "void");
11120 strcat(string, type->isSigned ? "int" : "uint");
11123 strcat(string, type->isSigned ? "int64" : "uint64");
11126 strcat(string, type->isSigned ? "char" : "byte");
11129 strcat(string, type->isSigned ? "short" : "uint16");
11132 strcat(string, "float");
11135 strcat(string, "double");
11140 strcat(string, "struct ");
11141 strcat(string, type->enumName);
11143 else if(type->typeName)
11145 strcat(string, type->typeName);
11149 struct Type * member;
11151 strcat(string, "struct {");
11152 for(member = type->members.first; member; member = member->next)
11154 PrintType(member, string, 0x1, fullName);
11155 strcat(string, "; ");
11157 strcat(string, "}");
11163 strcat(string, "union ");
11164 strcat(string, type->enumName);
11166 else if(type->typeName)
11168 strcat(string, type->typeName);
11172 strcat(string, "union ");
11173 strcat(string, "(unnamed)");
11179 strcat(string, "enum ");
11180 strcat(string, type->enumName);
11182 else if(type->typeName)
11184 strcat(string, type->typeName);
11187 strcat(string, "enum");
11193 if(type->dllExport)
11194 strcat(string, "dllexport ");
11195 PrintType(type->returnType, string, 0x0, fullName);
11196 strcat(string, " ");
11203 strcat(string, type->name);
11206 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11212 strcat(string, name);
11218 struct Type * param;
11220 strcat(string, "(");
11221 for(param = type->params.first; param; param = param->next)
11223 PrintType(param, string, 0x1, fullName);
11225 strcat(string, ", ");
11227 strcat(string, ")");
11234 char baseType[1024], size[256];
11235 struct Type * arrayType = type;
11237 baseType[0] = '\0';
11239 while(arrayType->kind == 12)
11242 if(arrayType->enumClass)
11243 strcat(size, arrayType->enumClass->string);
11244 else if(arrayType->arraySizeExp)
11245 PrintExpression(arrayType->arraySizeExp, size);
11247 arrayType = arrayType->arrayType;
11249 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11250 strcat(string, baseType);
11251 strcat(string, size);
11257 strcat(string, "...");
11260 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11263 strcat(string, "subclass(");
11264 strcat(string, type->_class ? type->_class->string : "int");
11265 strcat(string, ")");
11268 strcat(string, type->templateParameter->identifier->string);
11271 strcat(string, "thisclass");
11274 strcat(string, "__builtin_va_list");
11277 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11279 strcat(string, " ");
11280 strcat(string, type->name);
11285 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11287 struct Type * funcType;
11289 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11291 if(funcType && funcType->kind == 11 && type != funcType)
11293 char typeString[1024];
11294 struct Type * param;
11296 PrintType(funcType->returnType, string, 0x0, fullName);
11297 strcat(string, "(");
11298 _PrintType(type, string, printName, 0x0, fullName);
11299 strcat(string, ")");
11300 strcat(string, "(");
11301 for(param = funcType->params.first; param; param = param->next)
11303 PrintType(param, string, 0x1, fullName);
11305 strcat(string, ", ");
11307 strcat(string, ")");
11310 _PrintType(type, string, printName, 0x1, fullName);
11311 if(type->bitFieldCount)
11315 sprintf(count, ":%d", type->bitFieldCount);
11316 strcat(string, count);
11320 static struct Type * FindMember(struct Type * type, char * string)
11322 struct Type * memberType;
11324 for(memberType = type->members.first; memberType; memberType = memberType->next)
11326 if(!memberType->name)
11328 struct Type * subType = FindMember(memberType, string);
11333 else if(!strcmp(memberType->name, string))
11336 return (((void *)0));
11339 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11341 struct Type * memberType;
11343 for(memberType = type->members.first; memberType; memberType = memberType->next)
11345 if(!memberType->name)
11347 struct Type * subType = FindMember(memberType, string);
11351 *offset += memberType->offset;
11355 else if(!strcmp(memberType->name, string))
11357 *offset += memberType->offset;
11361 return (((void *)0));
11364 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11366 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11368 struct Expression * ParseExpressionString(char * expression)
11370 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11371 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11372 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11374 parsedExpression = (((void *)0));
11376 expression_yyparse();
11377 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11378 return parsedExpression;
11381 extern char * QMkString(char * source);
11383 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11385 void * __ecereTemp1;
11386 struct Identifier * id = exp->identifier;
11387 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11388 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11389 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11390 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11392 if(_class && _class->type == 4)
11394 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11395 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11399 struct __ecereNameSpace__ecere__com__Class * baseClass;
11401 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11403 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11405 for(value = e->values.first; value; value = value->next)
11407 if(!strcmp(value->name, id->string))
11412 char constant[256];
11414 FreeExpContents(exp);
11416 exp->isConstant = 0x1;
11417 if(!strcmp(baseClass->dataTypeString, "int"))
11418 sprintf(constant, "%d", value->data);
11420 sprintf(constant, "0x%X", value->data);
11421 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11422 exp->expType = MkClassType(baseClass->fullName);
11430 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11432 ProcessMethodType(method);
11433 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11436 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11438 if(!prop->dataType)
11439 ProcessPropertyType(prop);
11440 exp->expType = prop->dataType;
11442 prop->dataType->refCount++;
11445 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11447 if(!member->dataType)
11448 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11449 exp->expType = member->dataType;
11450 if(member->dataType)
11451 member->dataType->refCount++;
11454 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11456 if(!classProp->dataType)
11457 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11458 if(classProp->constant)
11460 FreeExpContents(exp);
11461 exp->isConstant = 0x1;
11462 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11465 exp->constant = QMkString((char *)classProp->Get(_class));
11469 char constant[256];
11472 sprintf(constant, "%d", classProp->Get(_class));
11473 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11479 exp->expType = classProp->dataType;
11480 if(classProp->dataType)
11481 classProp->dataType->refCount++;
11487 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11489 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11490 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11491 struct __ecereNameSpace__ecere__com__NameSpace * child;
11495 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)))
11497 data = ScanGlobalData(child, name);
11505 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11507 extern char * strncpy(char * , const char * , int n);
11509 static struct GlobalData * FindGlobalData(char * name)
11512 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11514 nameSpace = globalData;
11515 for(c = 0; name[c]; c++)
11517 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11519 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11520 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11522 strncpy(spaceName, name + start, c - start);
11523 spaceName[c - start] = '\0';
11524 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11525 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11527 return (((void *)0));
11528 nameSpace = newSpace;
11536 return ScanGlobalData(nameSpace, name + start);
11538 return (((void *)0));
11541 static int definedExpStackPos;
11543 static void * definedExpStack[512];
11545 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11547 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11549 FreeExpContents(checkedExp);
11550 FreeType(checkedExp->expType);
11551 FreeType(checkedExp->destType);
11552 *checkedExp = *newExp;
11553 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11554 checkedExp->prev = prev;
11555 checkedExp->next = next;
11558 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11560 extern int printf(char * , ...);
11562 void __ecereMethod_Expression_Clear();
11564 void ApplyAnyObjectLogic(struct Expression * e)
11566 struct Type * destType = e->destType;
11568 if(destType && (destType->classObjectType == 3))
11570 if(e && e->expType)
11572 struct Type * type = e->expType;
11573 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11575 if(type->kind == 8 && type->_class && type->_class->registered)
11577 _class = type->_class->registered;
11579 else if(type->kind == 19)
11581 _class = FindClass("ecere::com::Class")->registered;
11585 char string[1024] = "";
11586 struct Symbol * classSym;
11588 PrintType(type, string, 0x0, 0x1);
11589 classSym = FindClass(string);
11591 _class = classSym->registered;
11593 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11595 if(!_class || strcmp(_class->fullName, "char *"))
11597 struct Expression * checkedExp = e, * newExp;
11599 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11601 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11603 if(checkedExp->type == 25)
11605 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11608 checkedExp = (*checkedExp->list).last;
11610 else if(checkedExp->type == 11)
11611 checkedExp = checkedExp->cast.exp;
11613 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11615 newExp = checkedExp->op.exp2;
11616 checkedExp->op.exp2 = (((void *)0));
11617 FreeExpContents(checkedExp);
11618 if(e->expType && e->expType->passAsTemplate)
11622 ComputeTypeSize(e->expType);
11623 sprintf(size, "%d", e->expType->size);
11624 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))))));
11626 ReplaceExpContents(checkedExp, newExp);
11627 e->byReference = 0x1;
11629 else if(!e->byReference || (_class && _class->type == 5))
11631 struct Expression * checkedExp, * newExp;
11634 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->member.memberType == 3) || (e->type == 9 && e->member.memberType == 3) || (e->type == 4 && !e->op.exp1 && e->op.op == '*') || e->type == 6;
11636 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11638 struct Context * context = PushContext();
11639 struct Declarator * decl;
11640 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11641 char typeString[1024];
11642 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11644 typeString[0] = '\0';
11646 newExp->prev = (((void *)0));
11647 newExp->next = (((void *)0));
11648 newExp->expType = (((void *)0));
11649 PrintType(e->expType, typeString, 0x0, 0x1);
11650 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11651 newExp->destType = ProcessType(specs, decl);
11652 curContext = context;
11657 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11659 sprintf(name, "__internalValue%03X", internalValueCounter++);
11660 if(!curCompound->compound.declarations)
11661 curCompound->compound.declarations = MkList();
11662 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11663 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11664 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11665 e->compound = MkCompoundStmt((((void *)0)), stmts);
11668 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11670 struct Type * type = e->destType;
11672 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11673 CopyTypeInto(e->destType, type);
11674 e->destType->refCount = 1;
11675 e->destType->classObjectType = 0;
11678 e->compound->compound.context = context;
11679 PopContext(context);
11680 curContext = context->parent;
11684 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11686 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11688 if(checkedExp->type == 25)
11690 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11693 checkedExp = (*checkedExp->list).last;
11695 else if(checkedExp->type == 11)
11696 checkedExp = checkedExp->cast.exp;
11699 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11701 *operand = *checkedExp;
11702 checkedExp->destType = (((void *)0));
11703 checkedExp->expType = (((void *)0));
11704 __ecereMethod_Expression_Clear(checkedExp);
11705 checkedExp->type = 4;
11706 checkedExp->op.op = '&';
11707 checkedExp->op.exp1 = (((void *)0));
11708 checkedExp->op.exp2 = operand;
11717 if((!destType || destType->kind == 14 || destType->kind == 0) && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && (e->expType->byReference || (e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))))
11719 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11725 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11728 thisExp->prev = (((void *)0));
11729 thisExp->next = (((void *)0));
11730 __ecereMethod_Expression_Clear(e);
11732 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11733 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11734 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11736 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11737 CopyTypeInto(e->expType, thisExp->expType);
11738 e->expType->byReference = 0x0;
11739 e->expType->refCount = 1;
11740 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))
11742 e->expType->classObjectType = 0;
11747 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11749 if(destType->kind == 14)
11751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11753 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11755 unsigned int byReference = e->expType->byReference;
11756 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11757 struct Declarator * decl;
11758 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11759 char typeString[1024];
11760 struct Type * type;
11761 int backupClassObjectType;
11763 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11767 backupClassObjectType = type->classObjectType;
11768 type->classObjectType = 0;
11769 typeString[0] = '\0';
11770 PrintType(type, typeString, 0x0, 0x1);
11771 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11772 type->classObjectType = backupClassObjectType;
11774 thisExp->prev = (((void *)0));
11775 thisExp->next = (((void *)0));
11776 __ecereMethod_Expression_Clear(e);
11777 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
11781 e->op.exp1 = (((void *)0));
11782 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11787 e->cast.typeName = MkTypeName(specs, decl);
11788 e->cast.exp = thisExp;
11789 e->byReference = 0x1;
11792 e->destType = destType;
11794 destType->refCount++;
11799 extern char * strstr(char * , const char * );
11801 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11803 struct __ecereNameSpace__ecere__com__DefinedExpression
11805 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11806 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11809 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11810 } __attribute__ ((gcc_struct));
11812 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11814 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11816 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11818 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11820 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11822 extern struct Expression * CopyExpression(struct Expression * exp);
11824 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11826 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11828 static void ProcessStatement(struct Statement * stmt);
11830 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
11832 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11834 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
11836 extern char * sourceFile;
11838 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11840 void ProcessExpressionType(struct Expression * exp)
11842 void * __ecereTemp2;
11843 void * __ecereTemp1;
11844 unsigned int unresolved = 0x0;
11845 struct Location oldyylloc = yylloc;
11846 unsigned int notByReference = 0x0;
11848 if(!exp || exp->expType)
11855 struct Identifier * id = exp->identifier;
11859 if(id->_class && id->_class->name)
11861 id->classSym = id->_class->symbol;
11863 if(strstr(id->string, "__ecereClass") == id->string)
11865 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11868 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11870 ReplaceClassMembers(exp, thisClass);
11873 ProcessExpressionType(exp);
11876 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11881 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11885 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11891 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11894 ProcessExpressionType(exp);
11898 else if(currentClass && !id->_class)
11900 if(ResolveIdWithClass(exp, currentClass, 0x1))
11903 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11908 struct Type * type = symbol->type;
11909 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11911 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11913 struct Context * context = SetupTemplatesContext(_class);
11915 type = ReplaceThisClassType(_class);
11916 FinishTemplatesContext(context);
11918 type->refCount = 0;
11920 FreeSpecifier(id->_class);
11921 id->_class = (((void *)0));
11922 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11923 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11924 id->classSym = (((void *)0));
11925 exp->expType = type;
11928 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11929 exp->isConstant = 0x1;
11930 if(symbol->isParam || !strcmp(id->string, "this"))
11932 if(_class && _class->type == 1)
11933 exp->byReference = 0x1;
11935 if(symbol->isIterator)
11937 if(symbol->isIterator == 3)
11940 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11941 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11942 exp->expType = (((void *)0));
11943 ProcessExpressionType(exp);
11945 else if(symbol->isIterator != 4)
11948 exp->member.exp = MkExpIdentifier(exp->identifier);
11949 exp->member.exp->expType = exp->expType;
11950 exp->member.member = MkIdentifier("data");
11951 exp->expType = (((void *)0));
11952 ProcessExpressionType(exp);
11959 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11961 if(thisNameSpace && !(id->_class && !id->_class->name))
11965 strcpy(name, thisNameSpace);
11966 strcat(name, "::");
11967 strcat(name, id->string);
11968 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11971 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11976 for(c = 0; c < definedExpStackPos; c++)
11977 if(definedExpStack[c] == definedExp)
11979 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11981 struct Location backupYylloc = yylloc;
11983 definedExpStack[definedExpStackPos++] = definedExp;
11984 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11985 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
11986 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11988 parsedExpression = (((void *)0));
11990 expression_yyparse();
11991 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11992 yylloc = backupYylloc;
11993 if(parsedExpression)
11995 FreeIdentifier(id);
11997 exp->list = MkListOne(parsedExpression);
11998 parsedExpression->loc = yylloc;
11999 ProcessExpressionType(exp);
12000 definedExpStackPos--;
12003 definedExpStackPos--;
12009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12015 struct GlobalData * data = (((void *)0));
12017 if(thisNameSpace && !(id->_class && !id->_class->name))
12021 strcpy(name, thisNameSpace);
12022 strcat(name, "::");
12023 strcat(name, id->string);
12024 data = FindGlobalData(name);
12027 data = FindGlobalData(id->string);
12030 DeclareGlobalData(data);
12031 exp->expType = data->dataType;
12033 data->dataType->refCount++;
12034 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12035 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12036 FreeSpecifier(id->_class);
12037 id->_class = (((void *)0));
12042 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12044 if(thisNameSpace && !(id->_class && !id->_class->name))
12048 strcpy(name, thisNameSpace);
12049 strcat(name, "::");
12050 strcat(name, id->string);
12051 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12054 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12059 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12060 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12062 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12063 strcpy(name, "__ecereFunction_");
12064 FullClassNameCat(name, id->string, 0x0);
12065 if(DeclareFunction(function, name))
12067 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12068 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12070 exp->expType = function->dataType;
12071 if(function->dataType)
12072 function->dataType->refCount++;
12073 FreeSpecifier(id->_class);
12074 id->_class = (((void *)0));
12086 struct __ecereNameSpace__ecere__com__Class * _class;
12088 if(!exp->instance->_class)
12090 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12092 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12095 ProcessInstantiationType(exp->instance);
12096 exp->isConstant = exp->instance->isConstant;
12097 if(exp->instance->_class)
12099 exp->expType = MkClassType(exp->instance->_class->name);
12107 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12109 exp->expType = type;
12110 if(exp->constant[0] == '\'')
12112 if((int)((unsigned char *)exp->constant)[1] > 127)
12115 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12118 ch = exp->constant[1];
12119 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12120 exp->constant = PrintUInt(ch);
12122 type->_class = FindClass("unichar");
12123 type->isSigned = 0x0;
12128 type->isSigned = 0x1;
12131 else if(strchr(exp->constant, '.'))
12133 char ch = exp->constant[strlen(exp->constant) - 1];
12139 type->isSigned = 0x1;
12143 if(exp->constant[0] == '0' && exp->constant[1])
12144 type->isSigned = 0x0;
12145 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12146 type->isSigned = 0x0;
12147 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12148 type->isSigned = 0x0;
12150 type->isSigned = 0x1;
12153 exp->isConstant = 0x1;
12159 exp->isConstant = 0x1;
12160 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12165 ProcessExpressionType(exp->_new.size);
12166 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12167 DeclareType(exp->expType->type, 0x0, 0x0);
12171 ProcessExpressionType(exp->_renew.size);
12172 ProcessExpressionType(exp->_renew.exp);
12173 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12174 DeclareType(exp->expType->type, 0x0, 0x0);
12178 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12179 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12180 unsigned int useDestType = 0x0, useSideType = 0x0;
12181 struct Location oldyylloc = yylloc;
12182 unsigned int useSideUnit = 0x0;
12183 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12225 if(exp->op.op != '*' || exp->op.exp1)
12232 if(exp->op.op == '&')
12234 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12236 struct Identifier * id = exp->op.exp2->identifier;
12237 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12239 if(symbol && symbol->isIterator == 2)
12242 exp->member.exp = exp->op.exp2;
12243 exp->member.member = MkIdentifier("key");
12244 exp->expType = (((void *)0));
12245 exp->op.exp2->expType = symbol->type;
12246 symbol->type->refCount++;
12247 ProcessExpressionType(exp);
12255 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
12257 if(exp->op.exp1->destType)
12258 FreeType(exp->op.exp1->destType);
12259 exp->op.exp1->destType = exp->destType;
12261 exp->destType->refCount++;
12265 if(exp->op.exp1->destType)
12266 FreeType(exp->op.exp1->destType);
12267 exp->op.exp1->destType = dummy;
12270 if(exp->op.exp1->destType && exp->op.op != '=')
12271 exp->op.exp1->destType->count++;
12272 ProcessExpressionType(exp->op.exp1);
12273 if(exp->op.exp1->destType && exp->op.op != '=')
12274 exp->op.exp1->destType->count--;
12275 if(exp->op.exp1->destType == dummy)
12278 exp->op.exp1->destType = (((void *)0));
12280 type1 = exp->op.exp1->expType;
12284 char expString[10240];
12286 expString[0] = '\0';
12287 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12291 exp->op.exp2->destType = exp->op.exp1->expType;
12292 if(exp->op.exp1->expType)
12293 exp->op.exp1->expType->refCount++;
12297 exp->op.exp2->destType = exp->destType;
12299 exp->destType->refCount++;
12303 exp->expType = type1;
12308 PrintExpression(exp->op.exp2, expString);
12309 if(type1 && type1->kind == 13)
12311 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN || exp->op.op == AND_ASSIGN || exp->op.op == OR_ASSIGN)
12312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12313 else if(exp->op.op == '=')
12315 if(exp->op.exp2->destType)
12316 FreeType(exp->op.exp2->destType);
12317 exp->op.exp2->destType = type1;
12324 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN)
12328 if(exp->op.exp2->destType)
12329 FreeType(exp->op.exp2->destType);
12330 exp->op.exp2->destType = type1;
12337 exp->expType = type1;
12339 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
12341 if(exp->op.exp2->destType)
12342 FreeType(exp->op.exp2->destType);
12343 exp->op.exp2->destType = exp->destType;
12345 exp->destType->refCount++;
12349 if(exp->op.exp2->destType)
12350 FreeType(exp->op.exp2->destType);
12351 exp->op.exp2->destType = dummy;
12354 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12356 FreeType(exp->op.exp2->destType);
12357 exp->op.exp2->destType = type1;
12360 if(exp->op.exp2->destType && exp->op.op != '=')
12361 exp->op.exp2->destType->count++;
12362 ProcessExpressionType(exp->op.exp2);
12363 if(exp->op.exp2->destType && exp->op.op != '=')
12364 exp->op.exp2->destType->count--;
12365 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12367 if(exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12369 if(exp->op.op != '=' && type1->type->kind == 0)
12370 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12372 else if(exp->op.exp2->expType->kind == 13 || exp->op.exp2->expType->kind == 12 || exp->op.exp2->expType->kind == 11 || exp->op.exp2->expType->kind == 16 || (type1->type->kind == 0 && exp->op.exp2->expType->kind == 8 && exp->op.exp2->expType->_class->registered && (exp->op.exp2->expType->_class->registered->type == 0 || exp->op.exp2->expType->_class->registered->type == 1 || exp->op.exp2->expType->_class->registered->type == 5)))
12374 if(exp->op.op == ADD_ASSIGN)
12375 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12377 else if((exp->op.exp2->expType->kind == 8 && type1->kind == 13 && type1->type->kind == 8 && type1->type->_class == exp->op.exp2->expType->_class && exp->op.exp2->expType->_class->registered && exp->op.exp2->expType->_class->registered->type == 1))
12379 if(exp->op.op == ADD_ASSIGN)
12380 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12382 else if(inCompiler)
12384 char type1String[1024];
12385 char type2String[1024];
12387 type1String[0] = '\0';
12388 type2String[0] = '\0';
12389 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12390 PrintType(type1, type2String, 0x0, 0x1);
12391 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12392 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12395 if(exp->op.exp2->destType == dummy)
12398 exp->op.exp2->destType = (((void *)0));
12400 type2 = exp->op.exp2->expType;
12403 if(exp->op.op == SIZEOF)
12405 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12406 exp->isConstant = 0x1;
12408 else if(exp->op.op == '*' && !exp->op.exp1)
12410 exp->expType = Dereference(type2);
12411 if(type2 && type2->kind == 8)
12412 notByReference = 0x1;
12414 else if(exp->op.op == '&' && !exp->op.exp1)
12415 exp->expType = Reference(type2);
12422 if(exp->op.exp1->destType)
12423 FreeType(exp->op.exp1->destType);
12424 exp->op.exp1->destType = MkClassType("bool");
12425 exp->op.exp1->destType->truth = 0x1;
12426 if(!exp->op.exp1->expType)
12427 ProcessExpressionType(exp->op.exp1);
12429 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12430 FreeType(exp->op.exp1->expType);
12431 exp->op.exp1->expType = MkClassType("bool");
12432 exp->op.exp1->expType->truth = 0x1;
12436 if(exp->op.exp2->destType)
12437 FreeType(exp->op.exp2->destType);
12438 exp->op.exp2->destType = MkClassType("bool");
12439 exp->op.exp2->destType->truth = 0x1;
12440 if(!exp->op.exp2->expType)
12441 ProcessExpressionType(exp->op.exp2);
12443 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12444 FreeType(exp->op.exp2->expType);
12445 exp->op.exp2->expType = MkClassType("bool");
12446 exp->op.exp2->expType->truth = 0x1;
12449 else if(exp->op.exp1 && exp->op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->_class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->_class->string, "String")))))
12451 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12453 if(exp->op.exp2->destType)
12454 FreeType(exp->op.exp2->destType);
12455 exp->op.exp2->destType = type1;
12457 if(exp->op.exp1->destType)
12458 FreeType(exp->op.exp1->destType);
12459 exp->op.exp1->destType = type2;
12461 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->_class->registered && type1->_class->registered->type == 3 && type2->_class->registered && type2->_class->registered->type == 3 && type1->_class->registered != type2->_class->registered)
12462 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
12463 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12465 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12469 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12471 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12472 ProcessExpressionType(exp->op.exp1);
12473 if(type2->kind != 13)
12475 ProcessExpressionType(classExp);
12476 exp->op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
12477 if(!exp->op.exp2->expType)
12478 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12479 ProcessExpressionType(exp->op.exp2);
12483 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12485 if(type1->kind != 8 && type1->type->kind == 0)
12486 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12487 exp->expType = type1;
12491 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12493 if(type2->kind != 8 && type2->type->kind == 0)
12494 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12495 exp->expType = type2;
12499 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))
12501 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12505 unsigned int success = 0x0;
12507 if(type1->kind == 13 && type2->kind == 13)
12509 if(exp->op.op == '+')
12510 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12511 else if(exp->op.op == '-')
12513 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12515 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12517 if(type1->type->kind == 20)
12519 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12523 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12525 ProcessExpressionType(classExp);
12527 exp->list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp1))), exp->op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp2)))))), '/', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
12528 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12536 if(!success && exp->op.exp1->type == 2)
12538 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12541 FreeType(exp->expType);
12542 exp->expType = exp->op.exp1->destType;
12543 if(exp->op.exp1->destType)
12544 exp->op.exp1->destType->refCount++;
12547 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12550 FreeType(exp->expType);
12551 exp->expType = exp->op.exp2->destType;
12552 if(exp->op.exp2->destType)
12553 exp->op.exp2->destType->refCount++;
12559 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12562 FreeType(exp->expType);
12563 exp->expType = exp->op.exp2->destType;
12564 if(exp->op.exp2->destType)
12565 exp->op.exp2->destType->refCount++;
12568 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12571 FreeType(exp->expType);
12572 exp->expType = exp->op.exp1->destType;
12573 if(exp->op.exp1->destType)
12574 exp->op.exp1->destType->refCount++;
12580 char expString1[10240];
12581 char expString2[10240];
12585 expString1[0] = '\0';
12586 expString2[0] = '\0';
12591 PrintExpression(exp->op.exp1, expString1);
12592 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12593 PrintExpression(exp->op.exp2, expString2);
12594 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12595 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12596 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12598 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12602 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12604 if(exp->op.exp1->destType)
12605 FreeType(exp->op.exp1->destType);
12606 exp->op.exp1->destType = type2->_class->registered->dataType;
12607 if(type2->_class->registered->dataType)
12608 type2->_class->registered->dataType->refCount++;
12609 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12610 exp->expType = type2;
12614 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12616 if(exp->op.exp2->destType)
12617 FreeType(exp->op.exp2->destType);
12618 exp->op.exp2->destType = type1->_class->registered->dataType;
12619 if(type1->_class->registered->dataType)
12620 type1->_class->registered->dataType->refCount++;
12621 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12622 exp->expType = type1;
12628 unsigned int valid = 0x0;
12630 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12632 if(exp->op.exp2->destType)
12633 FreeType(exp->op.exp2->destType);
12634 if(!type1->_class->registered->dataType)
12635 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12636 exp->op.exp2->destType = type1->_class->registered->dataType;
12637 exp->op.exp2->destType->refCount++;
12638 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12639 type2 = exp->op.exp2->destType;
12640 exp->expType = type2;
12643 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12645 if(exp->op.exp1->destType)
12646 FreeType(exp->op.exp1->destType);
12647 if(!type2->_class->registered->dataType)
12648 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12649 exp->op.exp1->destType = type2->_class->registered->dataType;
12650 exp->op.exp1->destType->refCount++;
12651 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12652 type1 = exp->op.exp1->destType;
12653 exp->expType = type1;
12656 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12658 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12660 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12663 FreeType(exp->expType);
12664 exp->expType = exp->op.exp1->expType;
12665 if(exp->op.exp2->expType)
12666 exp->op.exp1->expType->refCount++;
12670 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12672 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12675 FreeType(exp->expType);
12676 exp->expType = exp->op.exp2->expType;
12677 if(exp->op.exp2->expType)
12678 exp->op.exp2->expType->refCount++;
12685 if(exp->op.exp2->destType)
12686 FreeType(exp->op.exp2->destType);
12687 exp->op.exp2->destType = type1;
12689 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12692 FreeType(exp->expType);
12693 exp->expType = exp->op.exp2->destType;
12694 if(exp->op.exp2->destType)
12695 exp->op.exp2->destType->refCount++;
12697 else if(type1 && type2)
12699 char expString1[10240];
12700 char expString2[10240];
12701 char type1String[1024];
12702 char type2String[1024];
12704 expString1[0] = '\0';
12705 expString2[0] = '\0';
12706 type1String[0] = '\0';
12707 type2String[0] = '\0';
12710 PrintExpression(exp->op.exp1, expString1);
12711 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12712 PrintExpression(exp->op.exp2, expString2);
12713 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12714 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12715 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12717 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12718 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12720 exp->expType = exp->op.exp1->expType;
12721 if(exp->op.exp1->expType)
12722 exp->op.exp1->expType->refCount++;
12724 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12726 exp->expType = exp->op.exp2->expType;
12727 if(exp->op.exp2->expType)
12728 exp->op.exp2->expType->refCount++;
12735 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12737 struct Type * oldType = exp->op.exp1->expType;
12739 exp->op.exp1->expType = (((void *)0));
12740 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12743 exp->op.exp1->expType = oldType;
12745 if(exp->op.exp1->destType)
12746 FreeType(exp->op.exp1->destType);
12747 exp->op.exp1->destType = type2;
12749 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12752 FreeType(exp->expType);
12753 exp->expType = exp->op.exp1->destType;
12754 if(exp->op.exp1->destType)
12755 exp->op.exp1->destType->refCount++;
12759 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12761 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12763 if(exp->op.exp1->destType)
12764 FreeType(exp->op.exp1->destType);
12765 exp->op.exp1->destType = type2->_class->registered->dataType;
12766 if(type2->_class->registered->dataType)
12767 type2->_class->registered->dataType->refCount++;
12768 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12770 if(exp->op.op == '!')
12772 exp->expType = MkClassType("bool");
12773 exp->expType->truth = 0x1;
12777 exp->expType = type2;
12782 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12784 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12786 if(exp->op.exp2->destType)
12787 FreeType(exp->op.exp2->destType);
12788 exp->op.exp2->destType = type1->_class->registered->dataType;
12789 if(type1->_class->registered->dataType)
12790 type1->_class->registered->dataType->refCount++;
12791 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12793 exp->expType = type1;
12799 if(exp->op.exp1 && !exp->op.exp1->expType)
12801 char expString[10000];
12803 expString[0] = '\0';
12806 PrintExpression(exp->op.exp1, expString);
12807 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12812 if(exp->op.exp2 && !exp->op.exp2->expType)
12814 char expString[10240];
12816 expString[0] = '\0';
12819 PrintExpression(exp->op.exp2, expString);
12820 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12827 FreeType(exp->expType);
12828 exp->expType = MkClassType("bool");
12829 exp->expType->truth = 0x1;
12831 if(exp->op.op != SIZEOF)
12832 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12833 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12835 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12837 yylloc = oldyylloc;
12844 struct Expression * e;
12846 exp->isConstant = 0x1;
12847 for(e = (*exp->list).first; e; e = e->next)
12849 unsigned int inced = 0x0;
12853 FreeType(e->destType);
12854 e->destType = exp->destType;
12857 exp->destType->refCount++;
12858 e->destType->count++;
12862 ProcessExpressionType(e);
12864 exp->destType->count--;
12865 if(!exp->expType && !e->next)
12867 exp->expType = e->expType;
12869 e->expType->refCount++;
12872 exp->isConstant = 0x0;
12874 e = (*exp->list).first;
12875 if(!e->next && e->type == 8)
12877 struct Expression * next = exp->next, * prev = exp->prev;
12879 FreeType(exp->expType);
12880 FreeType(exp->destType);
12881 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12885 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12886 ProcessExpressionType(exp);
12892 struct Expression * e;
12894 exp->isConstant = 0x1;
12895 ProcessExpressionType(exp->index.exp);
12896 if(!exp->index.exp->isConstant)
12897 exp->isConstant = 0x0;
12898 if(exp->index.exp->expType)
12900 struct Type * source = exp->index.exp->expType;
12902 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
12904 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12906 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12907 if(exp->index.index && (*exp->index.index).last)
12909 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12913 for(e = (*exp->index.index).first; e; e = e->next)
12915 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12918 FreeType(e->destType);
12919 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12921 ProcessExpressionType(e);
12926 exp->isConstant = 0x0;
12929 exp->expType = Dereference(exp->index.exp->expType);
12931 DeclareType(exp->expType, 0x0, 0x0);
12936 struct Expression * e;
12937 struct Type * functionType;
12938 struct Type * methodType = (((void *)0));
12944 PrintExpression(exp->call.exp, name);
12945 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12947 PrintExpression(exp->call.exp, name);
12950 if(exp->call.exp->type == 0)
12952 struct Expression * idExp = exp->call.exp;
12953 struct Identifier * id = idExp->identifier;
12955 if(!strcmp(id->string, "__ENDIAN_PAD"))
12957 exp->expType = ProcessTypeString("int", 0x1);
12958 if(exp->call.arguments && (*exp->call.arguments).first)
12959 ProcessExpressionType((*exp->call.arguments).first);
12962 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12964 struct Expression * a = (((void *)0));
12965 struct Expression * b = (((void *)0));
12966 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12968 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12970 a = (*exp->call.arguments).first;
12971 b = (*exp->call.arguments).last;
12975 else if((*exp->call.arguments).count == 1)
12977 a = (*exp->call.arguments).first;
12982 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12983 idExp->identifier = (((void *)0));
12984 FreeExpContents(exp);
12985 ProcessExpressionType(a);
12987 ProcessExpressionType(b);
12989 exp->list = MkList();
12990 if(a->expType && (!b || b->expType))
12992 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12996 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12997 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12998 struct Declaration * decl;
12999 char temp1[1024], temp2[1024];
13001 GetTypeSpecs(a->expType, specs);
13002 if(a && !a->isConstant && a->type != 0)
13004 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13005 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13006 tempExp1 = QMkExpId(temp1);
13007 tempExp1->expType = a->expType;
13009 a->expType->refCount++;
13010 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13012 if(b && !b->isConstant && b->type != 0)
13014 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13015 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13016 tempExp2 = QMkExpId(temp2);
13017 tempExp2->expType = b->expType;
13019 b->expType->refCount++;
13020 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13022 decl = MkDeclaration(specs, decls);
13023 if(!curCompound->compound.declarations)
13024 curCompound->compound.declarations = MkList();
13025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13029 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13031 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13033 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13034 exp->expType = a->expType;
13036 a->expType->refCount++;
13038 else if(!strcmp(id->string, "Abs"))
13040 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13041 exp->expType = a->expType;
13043 a->expType->refCount++;
13045 else if(!strcmp(id->string, "Sgn"))
13047 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '!', CopyExpression(tempExp1)))), MkListOne(MkExpConstant("0")), MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpConstant("-1")), MkExpConstant("1"))))));
13048 exp->expType = ProcessTypeString("int", 0x0);
13050 FreeExpression(tempExp1);
13052 FreeExpression(tempExp2);
13053 FreeIdentifier(id);
13059 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13061 if(!exp->call.exp->destType)
13063 exp->call.exp->destType = dummy;
13066 ProcessExpressionType(exp->call.exp);
13067 if(exp->call.exp->destType == dummy)
13070 exp->call.exp->destType = (((void *)0));
13074 functionType = exp->call.exp->expType;
13075 if(functionType && functionType->kind == 16)
13077 methodType = functionType;
13078 functionType = methodType->method->dataType;
13079 if(exp->call.exp->expType->usedClass)
13081 char typeString[1024];
13083 typeString[0] = '\0';
13084 PrintType(functionType, typeString, 0x1, 0x1);
13085 if(strstr(typeString, "thisclass"))
13087 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13088 struct Declarator * decl;
13091 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13093 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13094 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13095 thisClassParams = 0x0;
13096 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13098 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13100 thisClass = exp->call.exp->expType->usedClass;
13101 ProcessDeclarator(decl);
13102 thisClass = backupThisClass;
13104 thisClassParams = 0x1;
13105 functionType = ProcessType(specs, decl);
13106 functionType->refCount = 0;
13107 FinishTemplatesContext(context);
13109 FreeList(specs, FreeSpecifier);
13110 FreeDeclarator(decl);
13114 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13116 struct Type * type = functionType->type;
13118 if(!functionType->refCount)
13120 functionType->type = (((void *)0));
13121 FreeType(functionType);
13123 functionType = type;
13125 if(functionType && functionType->kind != 11)
13127 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13129 else if(functionType)
13131 unsigned int emptyParams = 0x0, noParams = 0x0;
13132 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13133 struct Type * type = functionType->params.first;
13134 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13136 struct Location oldyylloc = yylloc;
13140 if(functionType->extraParam && e)
13142 e->destType = MkClassType(functionType->thisClass->string);
13145 if(!functionType->staticMethod)
13147 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13149 type = MkClassType(memberExp->member.exp->expType->_class->string);
13152 e->destType = type;
13154 type = functionType->params.first;
13157 type->refCount = 0;
13159 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13161 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13164 e->destType = type;
13166 type = functionType->params.first;
13169 type->refCount = 0;
13172 if(type && type->kind == 0)
13175 if(!type->refCount)
13177 type = (((void *)0));
13179 for(; e; e = e->next)
13181 if(!type && !emptyParams)
13184 if(methodType && methodType->methodClass)
13185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13187 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13190 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13192 struct Type * templatedType = (((void *)0));
13193 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13194 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13197 if(_class && _class->templateArgs)
13199 struct __ecereNameSpace__ecere__com__Class * sClass;
13201 for(sClass = _class; sClass; sClass = sClass->base)
13203 if(sClass->templateClass)
13204 sClass = sClass->templateClass;
13206 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13208 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13210 struct __ecereNameSpace__ecere__com__Class * nextClass;
13212 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13214 if(nextClass->templateClass)
13215 nextClass = nextClass->templateClass;
13216 id += nextClass->templateParams.count;
13226 if(curParam && _class->templateArgs[id].dataTypeString)
13228 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13231 struct Context * context = SetupTemplatesContext(_class);
13233 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13234 FinishTemplatesContext(context);
13236 e->destType = templatedType;
13239 templatedType->passAsTemplate = 0x1;
13244 e->destType = type;
13251 e->destType = type;
13255 if(type && type->kind != 14)
13257 struct Type * next = type->next;
13259 if(!type->refCount)
13264 if(type && type->kind != 14)
13266 if(methodType && methodType->methodClass)
13267 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13269 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13271 yylloc = oldyylloc;
13272 if(type && !type->refCount)
13277 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13278 if(exp->call.exp->type == 0)
13280 char * string = exp->call.exp->identifier->string;
13284 struct Symbol * symbol;
13285 struct Location oldyylloc = yylloc;
13287 yylloc = exp->call.exp->identifier->loc;
13288 if(strstr(string, "__builtin_") == string)
13291 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13292 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13293 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13294 if(strstr(symbol->string, "::"))
13295 globalContext->hasNameSpace = 0x1;
13296 yylloc = oldyylloc;
13299 else if(exp->call.exp->type == 8)
13303 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13304 if(!functionType->returnType)
13306 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13309 if(functionType && functionType->kind == 11)
13311 exp->expType = functionType->returnType;
13312 if(functionType->returnType)
13313 functionType->returnType->refCount++;
13314 if(!functionType->refCount)
13315 FreeType(functionType);
13317 if(exp->call.arguments)
13319 for(e = (*exp->call.arguments).first; e; e = e->next)
13321 struct Type * destType = e->destType;
13323 ProcessExpressionType(e);
13330 struct Type * type;
13331 struct Location oldyylloc = yylloc;
13332 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13334 exp->thisPtr = thisPtr;
13335 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13337 exp->member.member->classSym = exp->member.member->_class->symbol;
13339 ProcessExpressionType(exp->member.exp);
13340 if(exp->member.exp->expType && exp->member.exp->expType->kind == 8 && exp->member.exp->expType->_class && exp->member.exp->expType->_class->registered && exp->member.exp->expType->_class->registered->type == 0)
13342 exp->isConstant = 0x0;
13345 exp->isConstant = exp->member.exp->isConstant;
13346 type = exp->member.exp->expType;
13348 if(type && (type->kind == 20))
13350 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13351 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13355 for(param = _class->templateParams.first; param; param = param->next)
13357 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13361 if(param && param->defaultArg.member)
13363 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13367 struct Expression * expMember = exp->member.exp;
13368 struct Declarator * decl;
13369 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13370 char thisClassTypeString[1024];
13372 FreeIdentifier(exp->member.member);
13373 ProcessExpressionType(argExp);
13375 char * colon = strstr(param->defaultArg.memberString, "::");
13379 char className[1024];
13380 struct __ecereNameSpace__ecere__com__Class * sClass;
13382 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13383 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13386 strcpy(thisClassTypeString, _class->fullName);
13388 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13389 exp->expType = ProcessType(specs, decl);
13390 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13392 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13393 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13395 int paramCount = 0;
13396 int lastParam = -1;
13397 char templateString[1024];
13398 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13400 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13401 for(cClass = expClass; cClass; cClass = cClass->base)
13405 for(param = cClass->templateParams.first; param; param = param->next)
13408 struct __ecereNameSpace__ecere__com__Class * sClass;
13409 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13411 for(sClass = cClass->base; sClass; sClass = sClass->base)
13412 id += sClass->templateParams.count;
13413 arg = expClass->templateArgs[id];
13414 for(sClass = _class; sClass; sClass = sClass->base)
13416 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13418 struct __ecereNameSpace__ecere__com__Class * nextClass;
13420 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13421 p += nextClass->templateParams.count;
13422 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13424 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13426 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13428 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13429 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13436 char argument[256];
13438 argument[0] = '\0';
13439 switch(param->type)
13443 char expString[1024];
13444 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13445 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13446 struct Expression * exp;
13447 char * string = PrintHexUInt64(arg.expression.ui64);
13449 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13450 ProcessExpressionType(exp);
13451 ComputeExpression(exp);
13452 expString[0] = '\0';
13453 PrintExpression(exp, expString);
13454 strcat(argument, expString);
13455 FreeExpression(exp);
13460 strcat(argument, arg.member->name);
13465 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13467 if(!strcmp(arg.dataTypeString, "thisclass"))
13468 strcat(argument, thisClassTypeString);
13470 strcat(argument, arg.dataTypeString);
13478 strcat(templateString, ", ");
13479 if(lastParam != p - 1)
13481 strcat(templateString, param->name);
13482 strcat(templateString, " = ");
13484 strcat(templateString, argument);
13493 int len = strlen(templateString);
13495 if(templateString[len - 1] == '>')
13496 templateString[len++] = ' ';
13497 templateString[len++] = '>';
13498 templateString[len++] = '\0';
13501 struct Context * context = SetupTemplatesContext(_class);
13503 FreeType(exp->expType);
13504 exp->expType = ProcessTypeString(templateString, 0x0);
13505 FinishTemplatesContext(context);
13509 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), expMember))), '+', MkExpOp(MkExpMember(MkExpMember(argExp, MkIdentifier("member")), MkIdentifier("offset")), '+', MkExpMember(MkExpMember(MkExpMember(CopyExpression(argExp), MkIdentifier("member")), MkIdentifier("_class")), MkIdentifier("offset")))))))));
13512 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13514 type = ProcessTemplateParameterType(type->templateParameter);
13517 if(type && (type->kind == 20))
13519 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13521 struct Identifier * id = exp->member.member;
13522 int typeKind = type->kind;
13523 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
13525 if(typeKind == 19 && exp->member.exp->type == 26)
13527 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13530 if(id && (typeKind == 3 || typeKind == 15))
13531 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13534 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13535 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13536 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13537 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13538 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13540 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13541 exp->member.memberType = 1;
13542 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13543 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13546 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13548 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13549 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13551 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13553 member = (((void *)0));
13555 if(!member && !prop)
13556 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13557 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13558 exp->member.thisPtr = 0x1;
13564 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13565 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13566 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13568 if(!prop && !member)
13570 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13573 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13574 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13575 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13580 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13581 prop = (((void *)0));
13583 member = (((void *)0));
13587 if(!prop && !member)
13588 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13589 if(!prop && !member && !method)
13593 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13596 exp->member.memberType = 5;
13597 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13601 char structName[1024];
13602 struct Identifier * id = exp->member.member;
13603 struct Expression * classExp = exp->member.exp;
13606 FreeType(classExp->expType);
13607 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13608 strcpy(structName, "__ecereClassData_");
13609 FullClassNameCat(structName, type->_class->string, 0x0);
13611 exp->member.member = id;
13612 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type->_class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
13614 ProcessExpressionType(exp);
13620 struct Symbol * classSym = FindClass(id->string);
13624 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13627 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13633 exp->member.memberType = 1;
13634 if(!prop->dataType)
13635 ProcessPropertyType(prop);
13636 exp->expType = prop->dataType;
13638 prop->dataType->refCount++;
13642 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13644 FreeExpContents(exp);
13646 exp->identifier = MkIdentifier("class");
13647 ProcessExpressionType(exp);
13650 exp->member.memberType = 3;
13651 DeclareStruct(_class->fullName, 0x0);
13652 if(!member->dataType)
13654 struct Context * context = SetupTemplatesContext(_class);
13656 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13657 FinishTemplatesContext(context);
13659 exp->expType = member->dataType;
13660 if(member->dataType)
13661 member->dataType->refCount++;
13663 else if(revConvert)
13665 exp->member.memberType = 4;
13666 exp->expType = MkClassType(revConvert->_class->fullName);
13672 exp->member.memberType = 2;
13674 if(!method->dataType)
13675 ProcessMethodType(method);
13676 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
13677 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13678 exp->expType->usedClass = _class;
13680 else if(!classProp)
13682 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13684 FreeExpContents(exp);
13686 exp->identifier = MkIdentifier("class");
13687 ProcessExpressionType(exp);
13690 yylloc = exp->member.member->loc;
13691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13693 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13695 if(_class && exp->expType)
13697 struct __ecereNameSpace__ecere__com__Class * tClass;
13700 while(tClass && !tClass->templateClass)
13701 tClass = tClass->base;
13702 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13705 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13706 struct __ecereNameSpace__ecere__com__Class * sClass;
13708 for(sClass = tClass; sClass; sClass = sClass->base)
13711 if(sClass->templateClass)
13712 sClass = sClass->templateClass;
13713 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13715 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13717 for(sClass = sClass->base; sClass; sClass = sClass->base)
13718 id += sClass->templateParams.count;
13726 if(curParam && tClass->templateArgs[id].dataTypeString)
13728 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13729 struct Context * context = SetupTemplatesContext(tClass);
13731 FreeType(exp->expType);
13732 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13735 if(exp->expType->kind == 21)
13737 FreeType(exp->expType);
13738 exp->expType = ReplaceThisClassType(_class);
13740 if(tClass->templateClass)
13741 exp->expType->passAsTemplate = 0x1;
13744 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13745 if(exp->destType->kind == 21)
13747 FreeType(exp->destType);
13748 exp->destType = ReplaceThisClassType(_class);
13752 FinishTemplatesContext(context);
13755 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13758 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13759 struct __ecereNameSpace__ecere__com__Class * sClass;
13761 for(sClass = tClass; sClass; sClass = sClass->base)
13764 if(sClass->templateClass)
13765 sClass = sClass->templateClass;
13766 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13768 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13770 for(sClass = sClass->base; sClass; sClass = sClass->base)
13771 id += sClass->templateParams.count;
13781 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13782 struct Context * context = SetupTemplatesContext(tClass);
13783 struct Type * basicType;
13785 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13788 if(basicType->kind == 21)
13790 FreeType(basicType);
13791 basicType = ReplaceThisClassType(_class);
13793 FreeType(exp->expType);
13794 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
13797 exp->destType = exp->expType;
13798 exp->destType->refCount++;
13801 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13802 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13803 struct Declarator * decl;
13805 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13808 exp->destType->refCount++;
13810 exp->expType->refCount++;
13812 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13813 exp->cast.exp = newExp;
13816 FinishTemplatesContext(context);
13819 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13821 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13825 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13828 int paramCount = 0;
13829 int lastParam = -1;
13830 char templateString[1024];
13831 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13833 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13834 while(cClass != expClass)
13836 struct __ecereNameSpace__ecere__com__Class * sClass;
13838 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13841 for(param = cClass->templateParams.first; param; param = param->next)
13843 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13846 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13847 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13849 while(cClassCur != tClass && !paramCur)
13851 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13853 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13855 cClassCur = sClassCur;
13856 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13858 if(!strcmp(paramCur->name, param->name))
13865 if(paramCur && paramCur->type == 0)
13866 arg = tClass->templateArgs[cp];
13868 arg = expClass->templateArgs[p];
13870 char argument[256];
13872 argument[0] = '\0';
13873 switch(param->type)
13877 char expString[1024];
13878 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13879 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13880 struct Expression * exp;
13881 char * string = PrintHexUInt64(arg.expression.ui64);
13883 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13884 ProcessExpressionType(exp);
13885 ComputeExpression(exp);
13886 expString[0] = '\0';
13887 PrintExpression(exp, expString);
13888 strcat(argument, expString);
13889 FreeExpression(exp);
13894 strcat(argument, arg.member->name);
13899 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13900 strcat(argument, arg.dataTypeString);
13907 strcat(templateString, ", ");
13908 if(lastParam != p - 1)
13910 strcat(templateString, param->name);
13911 strcat(templateString, " = ");
13913 strcat(templateString, argument);
13922 int len = strlen(templateString);
13924 if(templateString[len - 1] == '>')
13925 templateString[len++] = ' ';
13926 templateString[len++] = '>';
13927 templateString[len++] = '\0';
13929 FreeType(exp->expType);
13931 struct Context * context = SetupTemplatesContext(tClass);
13933 exp->expType = ProcessTypeString(templateString, 0x0);
13934 FinishTemplatesContext(context);
13941 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
13943 else if(type && (type->kind == 9 || type->kind == 10))
13945 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13949 exp->expType = memberType;
13951 memberType->refCount++;
13956 char expString[10240];
13958 expString[0] = '\0';
13961 PrintExpression(exp, expString);
13962 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13964 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13966 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13968 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13970 struct Identifier * id = exp->member.member;
13971 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
13975 FreeType(exp->expType);
13976 exp->expType = ReplaceThisClassType(_class);
13980 yylloc = oldyylloc;
13985 struct Type * destType = exp->destType;
13987 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13989 exp->member.member->classSym = exp->member.member->_class->symbol;
13991 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13995 ProcessExpressionType(exp);
14002 struct Symbol * classSym = exp->_class->symbol;
14004 if(classSym && classSym->registered)
14006 if(classSym->registered->type == 5)
14011 DeclareStruct(classSym->string, 0x0);
14012 FreeSpecifier(exp->_class);
14014 FullClassNameCat(name, classSym->string, 0x0);
14015 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14019 if(classSym->registered->fixed)
14021 FreeSpecifier(exp->_class);
14022 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14027 char className[1024];
14029 strcpy(className, "__ecereClass_");
14030 FullClassNameCat(className, classSym->string, 0x1);
14031 MangleClassName(className);
14032 DeclareClass(classSym, className);
14033 FreeExpContents(exp);
14035 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14036 exp->member.member = MkIdentifier("structSize");
14040 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14045 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14047 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14048 exp->isConstant = 0x1;
14049 DeclareType(type, 0x0, 0x0);
14055 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14057 type->count = (unsigned int)1;
14058 FreeType(exp->cast.exp->destType);
14059 exp->cast.exp->destType = type;
14061 ProcessExpressionType(exp->cast.exp);
14062 type->count = (unsigned int)0;
14063 exp->expType = type;
14064 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14066 void * prev = exp->prev, * next = exp->next;
14067 struct Type * expType = exp->cast.exp->destType;
14068 struct Expression * castExp = exp->cast.exp;
14069 struct Type * destType = exp->destType;
14072 expType->refCount++;
14073 FreeType(exp->expType);
14074 FreeTypeName(exp->cast.typeName);
14076 FreeType(exp->expType);
14077 FreeType(exp->destType);
14078 exp->expType = expType;
14079 exp->destType = destType;
14080 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14086 exp->isConstant = exp->cast.exp->isConstant;
14092 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14095 exp->expType = type;
14100 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14102 ProcessExpressionType(exp->vaArg.exp);
14104 exp->expType = type;
14109 struct Expression * e;
14111 exp->isConstant = 0x1;
14112 FreeType(exp->cond.cond->destType);
14113 exp->cond.cond->destType = MkClassType("bool");
14114 exp->cond.cond->destType->truth = 0x1;
14115 ProcessExpressionType(exp->cond.cond);
14116 if(!exp->cond.cond->isConstant)
14117 exp->isConstant = 0x0;
14118 for(e = (*exp->cond.exp).first; e; e = e->next)
14122 FreeType(e->destType);
14123 e->destType = exp->destType;
14125 e->destType->refCount++;
14127 ProcessExpressionType(e);
14130 exp->expType = e->expType;
14132 e->expType->refCount++;
14135 exp->isConstant = 0x0;
14137 FreeType(exp->cond.elseExp->destType);
14138 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14139 if(exp->cond.elseExp->destType)
14140 exp->cond.elseExp->destType->refCount++;
14141 ProcessExpressionType(exp->cond.elseExp);
14142 if(!exp->cond.elseExp->isConstant)
14143 exp->isConstant = 0x0;
14148 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14150 struct Statement * last = (*exp->compound->compound.statements).last;
14152 if(last->type == 3 && last->expressions && (*last->expressions).last)
14154 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14156 exp->destType->refCount++;
14158 ProcessStatement(exp->compound);
14159 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14160 if(((struct Expression *)(*last->expressions).last)->expType)
14161 exp->expType->refCount++;
14167 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14169 if(spec && spec->type == 1)
14171 exp->expType = MkClassType(spec->name);
14172 exp->expType->kind = 19;
14173 exp->byReference = 0x1;
14177 exp->expType = MkClassType("ecere::com::Class");
14178 exp->byReference = 0x1;
14184 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14188 struct Identifier * id = exp->classData.id;
14189 char structName[1024];
14190 struct Expression * classExp;
14192 strcpy(structName, "__ecereClassData_");
14193 FullClassNameCat(structName, _class->fullName, 0x0);
14195 exp->member.member = id;
14196 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14197 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14199 classExp = MkExpIdentifier(MkIdentifier("class"));
14200 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class->fullName)), (((void *)0))), MkIdentifier("offsetClass"))))))));
14201 ProcessExpressionType(exp);
14208 struct Type * type = (((void *)0));
14209 char * typeString = (((void *)0));
14210 char typeStringBuf[1024];
14212 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->_class->registered, containerClass))
14214 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14216 typeString = templateClass->templateArgs[2].dataTypeString;
14220 struct Expression * e;
14222 for(e = (*exp->list).first; e; e = e->next)
14224 ProcessExpressionType(e);
14234 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14238 e->expType = (((void *)0));
14239 e = (*exp->list).first;
14240 ProcessExpressionType(e);
14243 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14245 FreeType(e->expType);
14246 e->expType = (((void *)0));
14248 type = (((void *)0));
14256 FreeType(e->expType);
14257 e->expType = (((void *)0));
14263 typeStringBuf[0] = '\0';
14264 PrintType(type, typeStringBuf, 0x0, 0x1);
14265 typeString = typeStringBuf;
14267 type = (((void *)0));
14272 char templateString[1024];
14273 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14274 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14275 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14276 struct Expression * expExt;
14277 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14279 sprintf(templateString, "Container<%s>", typeString);
14282 struct Expression * e;
14284 type = ProcessTypeString(typeString, 0x0);
14285 while(e = (*exp->list).first)
14287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14288 e->destType = type;
14290 ProcessExpressionType(e);
14291 ListAdd(initializers, MkInitializerAssignment(e));
14294 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14296 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14297 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14298 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14299 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14300 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14301 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14302 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14303 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14304 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14305 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, 0), ((struct Expression *)__ecereTemp1))));
14306 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14307 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14308 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14309 exp->expType = ProcessTypeString(templateString, 0x0);
14311 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14312 ProcessExpressionType(expExt);
14316 exp->expType = ProcessTypeString("Container", 0x0);
14317 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14322 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14324 FreeType(exp->expType);
14325 exp->expType = ReplaceThisClassType(thisClass);
14327 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14329 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14333 if(exp->expType->kind != 15)
14335 struct Type * member;
14336 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14338 FreeType(exp->expType);
14339 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14340 exp->expType->kind = symbol->type->kind;
14341 exp->expType->refCount++;
14342 exp->expType->enumName = enumName;
14343 exp->expType->members = symbol->type->members;
14344 for(member = symbol->type->members.first; member; member = member->next)
14345 member->refCount++;
14349 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14351 for(member = symbol->type->members.first; member; member = member->next)
14353 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14355 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14361 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14363 else if(exp->destType && !exp->destType->keepCast)
14365 if(!CheckExpressionType(exp, exp->destType, 0x0))
14367 if(!exp->destType->count || unresolved)
14372 if(exp->destType->kind != 14)
14379 char expString[10240];
14381 expString[0] = '\0';
14382 PrintType(exp->destType, type2, 0x0, 0x1);
14385 PrintExpression(exp, expString);
14386 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14389 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14390 else if(exp->type != 16)
14391 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14396 char expString[10240];
14398 expString[0] = '\0';
14401 PrintExpression(exp, expString);
14402 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14406 else if(exp->type != 16)
14407 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14419 PrintType(exp->expType, type1, 0x0, 0x1);
14420 PrintType(exp->destType, type2, 0x0, 0x1);
14422 if(exp->destType->truth && exp->destType->_class && exp->destType->_class->registered && !strcmp(exp->destType->_class->registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type != 1)))
14426 char expString[10240];
14428 expString[0] = '\0';
14431 PrintExpression(exp, expString);
14432 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14434 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14435 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14436 FreeType(exp->expType);
14437 exp->destType->refCount++;
14438 exp->expType = exp->destType;
14443 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14445 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14446 char typeString[1024];
14447 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14448 struct Declarator * decl;
14450 typeString[0] = '\0';
14453 exp->expType->refCount++;
14455 exp->expType->refCount++;
14457 newExp->destType = exp->expType;
14458 PrintType(exp->expType, typeString, 0x0, 0x0);
14459 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14460 exp->cast.typeName = MkTypeName(specs, decl);
14461 exp->cast.exp = newExp;
14464 else if(unresolved)
14466 if(exp->identifier->_class && exp->identifier->_class->name)
14467 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14468 else if(exp->identifier->string && exp->identifier->string[0])
14469 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14471 else if(!exp->expType && exp->type != 16)
14473 char expString[10240];
14475 expString[0] = '\0';
14478 PrintExpression(exp, expString);
14479 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14481 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14483 ApplyAnyObjectLogic(exp);
14484 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14486 exp->byReference = 0x1;
14488 yylloc = oldyylloc;
14491 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)
14495 *curMember = (*curMember)->next;
14496 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14498 *curMember = subMemberStack[--(*subMemberStackPos)];
14499 *curMember = (*curMember)->next;
14501 while((*curMember) && (*curMember)->isProperty)
14502 *curMember = (*curMember)->next;
14503 if(subMemberStackPos)
14505 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14507 subMemberStack[(*subMemberStackPos)++] = *curMember;
14508 *curMember = (*curMember)->members.first;
14509 while(*curMember && (*curMember)->isProperty)
14510 *curMember = (*curMember)->next;
14518 if(subMemberStackPos && *subMemberStackPos)
14520 *curMember = subMemberStack[--(*subMemberStackPos)];
14521 *curMember = (*curMember)->next;
14525 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14527 if(*curClass == _class)
14529 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14531 *curMember = (*curClass)->membersAndProperties.first;
14533 while((*curMember) && (*curMember)->isProperty)
14534 *curMember = (*curMember)->next;
14535 if(subMemberStackPos)
14537 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14539 subMemberStack[(*subMemberStackPos)++] = *curMember;
14540 *curMember = (*curMember)->members.first;
14541 while(*curMember && (*curMember)->isProperty)
14542 *curMember = (*curMember)->next;
14549 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14554 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14556 if(init->exp && !init->exp->destType)
14558 FreeType(init->exp->destType);
14559 init->exp->destType = type;
14565 ProcessExpressionType(init->exp);
14566 init->isConstant = init->exp->isConstant;
14572 struct Expression * exp = init->exp;
14573 struct Instantiation * inst = exp->instance;
14574 struct MembersInit * members;
14577 init->list = MkList();
14580 for(members = (*inst->members).first; members; members = members->next)
14582 if(members->type == 0)
14584 struct MemberInit * member;
14586 for(member = (*members->dataMembers).first; member; member = member->next)
14588 ListAdd(init->list, member->initializer);
14589 member->initializer = (((void *)0));
14594 FreeExpression(exp);
14598 struct Initializer * i;
14599 struct Type * initializerType = (((void *)0));
14600 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14601 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14602 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14603 int subMemberStackPos = 0;
14605 if(type && type->kind == 12)
14606 initializerType = Dereference(type);
14607 else if(type && (type->kind == 9 || type->kind == 10))
14608 initializerType = type->members.first;
14609 for(i = (*init->list).first; i; i = i->next)
14611 if(type && type->kind == 8 && type->_class && type->_class->registered)
14613 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14616 if(!curMember->dataType)
14617 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14618 initializerType = curMember->dataType;
14621 ProcessInitializer(i, initializerType);
14622 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14623 initializerType = initializerType->next;
14625 init->isConstant = 0x0;
14627 if(type && type->kind == 12)
14628 FreeType(initializerType);
14629 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14631 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14638 extern struct Symbol * FindType(struct Context * ctx, char * name);
14640 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14642 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14648 if(spec->specifier == THISCLASS)
14653 spec->name = ReplaceThisClass(thisClass);
14654 spec->symbol = FindClass(spec->name);
14655 ProcessSpecifier(spec, declareStruct);
14662 struct Symbol * symbol = FindType(curContext, spec->name);
14665 DeclareType(symbol->type, 0x1, 0x1);
14666 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14667 DeclareStruct(spec->name, 0x0);
14672 struct Enumerator * e;
14676 for(e = (*spec->list).first; e; e = e->next)
14679 ProcessExpressionType(e->exp);
14687 if(spec->definitions)
14689 struct ClassDef * def;
14690 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14692 ProcessClass(spec->definitions, symbol);
14699 static void ProcessDeclarator(struct Declarator * decl)
14704 if(decl->identifier->classSym)
14706 FreeSpecifier(decl->identifier->_class);
14707 decl->identifier->_class = (((void *)0));
14711 if(decl->array.exp)
14712 ProcessExpressionType(decl->array.exp);
14719 if(decl->declarator)
14720 ProcessDeclarator(decl->declarator);
14721 if(decl->type == 4)
14723 struct Identifier * id = GetDeclId(decl);
14725 if(id && id->_class)
14727 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14729 if(!decl->function.parameters)
14730 decl->function.parameters = MkList();
14731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14732 id->_class = (((void *)0));
14734 if(decl->function.parameters)
14736 struct TypeName * param;
14738 for(param = (*decl->function.parameters).first; param; param = param->next)
14740 if(param->qualifiers && (*param->qualifiers).first)
14742 struct Specifier * spec = (*param->qualifiers).first;
14744 if(spec && spec->specifier == TYPED_OBJECT)
14746 struct Declarator * d = param->declarator;
14747 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);
14749 FreeList(param->qualifiers, FreeSpecifier);
14750 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14751 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14755 else if(spec && spec->specifier == ANY_OBJECT)
14757 struct Declarator * d = param->declarator;
14759 FreeList(param->qualifiers, FreeSpecifier);
14760 param->qualifiers = MkListOne(MkSpecifier(VOID));
14761 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14763 else if(spec->specifier == THISCLASS)
14768 spec->name = ReplaceThisClass(thisClass);
14769 spec->symbol = FindClass(spec->name);
14770 ProcessSpecifier(spec, 0x0);
14774 if(param->declarator)
14775 ProcessDeclarator(param->declarator);
14783 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14785 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14787 static void ProcessDeclaration(struct Declaration * decl)
14789 yylloc = decl->loc;
14794 unsigned int declareStruct = 0x0;
14796 if(decl->declarators)
14798 struct InitDeclarator * d;
14800 for(d = (*decl->declarators).first; d; d = d->next)
14802 struct Type * type, * subType;
14804 ProcessDeclarator(d->declarator);
14805 type = ProcessType(decl->specifiers, d->declarator);
14808 ProcessInitializer(d->initializer, type);
14809 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14811 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14813 struct Instantiation * inst = d->initializer->exp->instance;
14815 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14816 d->initializer->exp->instance = (((void *)0));
14817 if(decl->specifiers)
14818 FreeList(decl->specifiers, FreeSpecifier);
14819 FreeList(decl->declarators, FreeInitDeclarator);
14826 for(subType = type; subType; )
14828 if(subType->kind == 8)
14830 declareStruct = 0x1;
14833 else if(subType->kind == 13)
14835 else if(subType->kind == 12)
14836 subType = subType->arrayType;
14845 if(decl->specifiers)
14847 struct Specifier * s;
14849 for(s = (*decl->specifiers).first; s; s = s->next)
14851 ProcessSpecifier(s, declareStruct);
14858 ProcessInstantiationType(decl->inst);
14863 struct Specifier * spec;
14864 struct Declarator * d;
14865 unsigned int declareStruct = 0x0;
14867 if(decl->declarators)
14869 for(d = (*decl->declarators).first; d; d = d->next)
14871 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14872 struct Type * subType;
14874 ProcessDeclarator(d);
14875 for(subType = type; subType; )
14877 if(subType->kind == 8)
14879 declareStruct = 0x1;
14882 else if(subType->kind == 13)
14884 else if(subType->kind == 12)
14885 subType = subType->arrayType;
14892 if(decl->specifiers)
14894 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14895 ProcessSpecifier(spec, declareStruct);
14902 static struct FunctionDefinition * curFunction;
14904 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14906 char propName[1024], propNameM[1024];
14907 char getName[1024], setName[1024];
14908 struct __ecereNameSpace__ecere__sys__OldList * args;
14910 DeclareProperty(prop, setName, getName);
14911 strcpy(propName, "__ecereProp_");
14912 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14913 strcat(propName, "_");
14914 FullClassNameCat(propName, prop->name, 0x1);
14915 MangleClassName(propName);
14916 strcpy(propNameM, "__ecerePropM_");
14917 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14918 strcat(propNameM, "_");
14919 FullClassNameCat(propNameM, prop->name, 0x1);
14920 MangleClassName(propNameM);
14921 if(prop->isWatchable)
14924 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14925 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14926 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14928 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14929 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14930 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14934 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14935 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14936 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14938 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14939 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14940 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14942 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14943 curFunction->propSet->fireWatchersDone = 0x1;
14946 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
14948 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
14950 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14952 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14954 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14956 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14958 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14960 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14962 static void ProcessStatement(struct Statement * stmt)
14964 yylloc = stmt->loc;
14968 ProcessStatement(stmt->labeled.stmt);
14971 if(stmt->caseStmt.exp)
14973 FreeType(stmt->caseStmt.exp->destType);
14974 stmt->caseStmt.exp->destType = curSwitchType;
14976 curSwitchType->refCount++;
14977 ProcessExpressionType(stmt->caseStmt.exp);
14978 ComputeExpression(stmt->caseStmt.exp);
14980 if(stmt->caseStmt.stmt)
14981 ProcessStatement(stmt->caseStmt.stmt);
14985 if(stmt->compound.context)
14987 struct Declaration * decl;
14988 struct Statement * s;
14989 struct Statement * prevCompound = curCompound;
14990 struct Context * prevContext = curContext;
14992 if(!stmt->compound.isSwitch)
14994 curCompound = stmt;
14995 curContext = stmt->compound.context;
14997 if(stmt->compound.declarations)
14999 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15000 ProcessDeclaration(decl);
15002 if(stmt->compound.statements)
15004 for(s = (*stmt->compound.statements).first; s; s = s->next)
15005 ProcessStatement(s);
15007 curContext = prevContext;
15008 curCompound = prevCompound;
15014 struct Expression * exp;
15016 if(stmt->expressions)
15018 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15019 ProcessExpressionType(exp);
15025 struct Expression * exp;
15027 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15028 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15029 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15030 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15032 ProcessExpressionType(exp);
15034 if(stmt->ifStmt.stmt)
15035 ProcessStatement(stmt->ifStmt.stmt);
15036 if(stmt->ifStmt.elseStmt)
15037 ProcessStatement(stmt->ifStmt.elseStmt);
15042 struct Type * oldSwitchType = curSwitchType;
15044 if(stmt->switchStmt.exp)
15046 struct Expression * exp;
15048 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15052 ProcessExpressionType(exp);
15055 curSwitchType = exp->expType;
15058 ProcessStatement(stmt->switchStmt.stmt);
15059 curSwitchType = oldSwitchType;
15064 if(stmt->whileStmt.exp)
15066 struct Expression * exp;
15068 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15069 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15070 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15071 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15073 ProcessExpressionType(exp);
15076 if(stmt->whileStmt.stmt)
15077 ProcessStatement(stmt->whileStmt.stmt);
15082 if(stmt->doWhile.exp)
15084 struct Expression * exp;
15086 if((*stmt->doWhile.exp).last)
15088 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15089 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15090 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15092 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15094 ProcessExpressionType(exp);
15097 if(stmt->doWhile.stmt)
15098 ProcessStatement(stmt->doWhile.stmt);
15103 struct Expression * exp;
15105 if(stmt->forStmt.init)
15106 ProcessStatement(stmt->forStmt.init);
15107 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15109 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15110 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15111 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15113 if(stmt->forStmt.check)
15114 ProcessStatement(stmt->forStmt.check);
15115 if(stmt->forStmt.increment)
15117 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15118 ProcessExpressionType(exp);
15120 if(stmt->forStmt.stmt)
15121 ProcessStatement(stmt->forStmt.stmt);
15126 struct Identifier * id = stmt->forEachStmt.id;
15127 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15128 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15129 struct Statement * block = stmt->forEachStmt.stmt;
15130 char iteratorType[1024];
15131 struct Type * source;
15132 struct Expression * e;
15133 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
15134 struct Expression * arrayExp;
15135 char * typeString = (((void *)0));
15136 int builtinCount = 0;
15138 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15142 FreeType(e->destType);
15143 e->destType = ProcessTypeString("Container", 0x0);
15145 if(!isBuiltin || e->next)
15146 ProcessExpressionType(e);
15148 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15149 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15151 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15152 struct Symbol * symbol;
15153 struct Expression * expIt = (((void *)0));
15154 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15155 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15156 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15157 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15160 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15161 stmt->compound.context->parent = curContext;
15162 curContext = stmt->compound.context;
15163 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15165 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15166 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15168 isCustomAVLTree = 0x1;
15169 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15171 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15174 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15176 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15178 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15181 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15185 struct Declarator * decl;
15186 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15188 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15189 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15190 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15194 struct Type * type = (((void *)0));
15195 char typeStringBuf[1024];
15197 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15198 if(((struct Expression *)(*exp).last)->type == 11)
15200 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15203 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15205 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->_class && arrayExp->destType->_class->registered && arrayExp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->_class->registered, containerClass) && arrayExp->destType->_class->registered->templateArgs)
15207 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15209 typeString = templateClass->templateArgs[2].dataTypeString;
15211 else if(arrayExp->list)
15213 struct Expression * e;
15215 for(e = (*arrayExp->list).first; e; e = e->next)
15217 ProcessExpressionType(e);
15227 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15231 e->expType = (((void *)0));
15232 e = (*arrayExp->list).first;
15233 ProcessExpressionType(e);
15236 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15238 FreeType(e->expType);
15239 e->expType = (((void *)0));
15241 type = (((void *)0));
15249 FreeType(e->expType);
15250 e->expType = (((void *)0));
15256 typeStringBuf[0] = '\0';
15257 PrintType(type, typeStringBuf, 0x0, 0x1);
15258 typeString = typeStringBuf;
15264 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15265 struct Declarator * decl;
15266 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15270 struct Expression * e;
15272 builtinCount = (*arrayExp->list).count;
15273 type = ProcessTypeString(typeString, 0x0);
15274 while(e = (*arrayExp->list).first)
15276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15277 e->destType = type;
15279 ProcessExpressionType(e);
15280 ListAdd(initializers, MkInitializerAssignment(e));
15283 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15285 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15286 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15287 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15288 FreeList(exp, FreeExpression);
15292 arrayExp->expType = ProcessTypeString("Container", 0x0);
15293 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15296 else if(isLinkList && !isList)
15298 struct Declarator * decl;
15299 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15301 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15302 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15303 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15305 else if(_class->templateArgs)
15308 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15310 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15311 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15313 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15314 if(block && block->type == 2 && block->compound.context)
15316 block->compound.context->parent = stmt->compound.context;
15320 block = MkIfStmt(filter, block, (((void *)0)));
15324 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array")), '+', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15325 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15326 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15327 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15333 sprintf(count, "%d", builtinCount);
15334 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpIdentifier(MkIdentifier("__internalArray"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpIdentifier(MkIdentifier("__internalArray")), '+', MkExpConstant(count))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15335 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15336 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15337 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15339 else if(isLinkList && !isList)
15341 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15342 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15344 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15346 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("next")))), block));
15350 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15351 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15353 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpCast(MkTypeName(specs, decl), MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("GetNext")), MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("IteratorPointer")), (((void *)0))), MkExpIdentifier(CopyIdentifier(id)))))))), block));
15355 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15356 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15357 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15361 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15363 ProcessExpressionType(expIt);
15364 if((*stmt->compound.declarations).first)
15365 ProcessDeclaration((*stmt->compound.declarations).first);
15367 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15368 ProcessStatement(stmt);
15369 curContext = stmt->compound.context->parent;
15374 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15386 struct Expression * exp;
15388 if(stmt->expressions)
15390 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15394 if(curFunction && !curFunction->type)
15395 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15396 FreeType(exp->destType);
15397 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15399 exp->destType->refCount++;
15401 ProcessExpressionType(exp);
15408 ProcessDeclaration(stmt->decl);
15413 struct AsmField * field;
15415 if(stmt->asmStmt.inputFields)
15417 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15418 if(field->expression)
15419 ProcessExpressionType(field->expression);
15421 if(stmt->asmStmt.outputFields)
15423 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15424 if(field->expression)
15425 ProcessExpressionType(field->expression);
15427 if(stmt->asmStmt.clobberedFields)
15429 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15431 if(field->expression)
15432 ProcessExpressionType(field->expression);
15439 struct PropertyWatch * propWatch;
15440 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15441 struct Expression * object = stmt->_watch.object;
15442 struct Expression * watcher = stmt->_watch.watcher;
15445 ProcessExpressionType(watcher);
15447 ProcessExpressionType(object);
15450 if(watcher || thisClass)
15452 struct External * external = curExternal;
15453 struct Context * context = curContext;
15456 stmt->expressions = MkList();
15457 curExternal = external->prev;
15458 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15460 struct ClassFunction * func;
15461 char watcherName[1024];
15462 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15463 struct External * createdExternal;
15464 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15467 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15468 if(propWatch->deleteWatch)
15469 strcat(watcherName, "_delete");
15472 struct Identifier * propID;
15474 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15476 strcat(watcherName, "_");
15477 strcat(watcherName, propID->string);
15480 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15482 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15483 ProcessClassFunctionBody(func, propWatch->compound);
15484 propWatch->compound = (((void *)0));
15485 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15486 createdExternal->symbol->idCode = external->symbol->idCode;
15487 curExternal = createdExternal;
15488 ProcessFunction(createdExternal->function);
15490 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15492 externalDecl->declaration = decl;
15493 if(decl->symbol && !decl->symbol->pointerExternal)
15494 decl->symbol->pointerExternal = externalDecl;
15496 if(propWatch->deleteWatch)
15498 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15500 ListAdd(args, CopyExpression(object));
15501 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15502 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15503 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15507 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15508 struct Identifier * propID;
15510 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15512 char propName[1024];
15513 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15517 char getName[1024], setName[1024];
15518 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15520 DeclareProperty(prop, setName, getName);
15521 strcpy(propName, "__ecereProp_");
15522 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15523 strcat(propName, "_");
15524 FullClassNameCat(propName, prop->name, 0x1);
15525 ListAdd(args, CopyExpression(object));
15526 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15527 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15528 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15529 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15532 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15537 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15539 curExternal = external;
15540 curContext = context;
15542 FreeExpression(watcher);
15544 FreeExpression(object);
15545 FreeList(watches, FreePropertyWatch);
15548 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15552 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15554 ProcessStatement(propWatch->compound);
15561 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15562 struct Expression * object = stmt->_watch.object;
15563 struct __ecereNameSpace__ecere__com__Class * _class;
15566 ProcessExpressionType(object);
15569 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15572 struct Identifier * propID;
15575 stmt->expressions = MkList();
15576 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15578 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15585 for(propID = (*watches).first; propID; propID = propID->next)
15587 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15591 CreateFireWatcher(prop, object, stmt);
15594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15599 struct __ecereNameSpace__ecere__com__Property * prop;
15600 struct __ecereNameSpace__ecere__com__Class * base;
15602 for(base = _class; base; base = base->base)
15604 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15606 if(prop->isProperty && prop->isWatchable)
15608 CreateFireWatcher(prop, object, stmt);
15614 FreeExpression(object);
15615 FreeList(watches, FreeIdentifier);
15618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15624 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15625 struct Expression * object = stmt->_watch.object;
15626 struct Expression * watcher = stmt->_watch.watcher;
15627 struct __ecereNameSpace__ecere__com__Class * _class;
15630 ProcessExpressionType(object);
15632 ProcessExpressionType(watcher);
15635 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15636 if(watcher || thisClass)
15640 struct Identifier * propID;
15643 stmt->expressions = MkList();
15646 struct __ecereNameSpace__ecere__sys__OldList * args;
15649 ListAdd(args, CopyExpression(object));
15650 ListAdd(args, MkExpConstant("0"));
15651 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15652 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15656 for(propID = (*watches).first; propID; propID = propID->next)
15658 char propName[1024];
15659 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15663 char getName[1024], setName[1024];
15664 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15666 DeclareProperty(prop, setName, getName);
15667 strcpy(propName, "__ecereProp_");
15668 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15669 strcat(propName, "_");
15670 FullClassNameCat(propName, prop->name, 0x1);
15671 MangleClassName(propName);
15672 ListAdd(args, CopyExpression(object));
15673 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15674 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15675 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15678 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15682 FreeExpression(object);
15684 FreeExpression(watcher);
15685 FreeList(watches, FreeIdentifier);
15688 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15698 extern struct Expression * QBrackets(struct Expression * exp);
15700 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15702 extern struct Declarator * QMkPtrDecl(char * id);
15704 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15706 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15708 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15710 static void ProcessFunction(struct FunctionDefinition * function)
15712 void * __ecereTemp2;
15713 void * __ecereTemp1;
15714 struct Identifier * id = GetDeclId(function->declarator);
15715 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15716 struct Type * type = symbol ? symbol->type : (((void *)0));
15717 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15718 struct Context * oldTopContext = topContext;
15720 yylloc = function->loc;
15721 if(type && type->thisClass)
15723 struct Symbol * classSym = type->thisClass;
15724 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15725 char className[1024];
15726 char structName[1024];
15727 struct Declarator * funcDecl;
15728 struct Symbol * thisSymbol;
15729 unsigned int typedObject = 0x0;
15731 if(_class && !_class->base)
15733 _class = currentClass;
15734 if(_class && !_class->symbol)
15735 _class->symbol = FindClass(_class->fullName);
15736 classSym = _class ? _class->symbol : (((void *)0));
15739 thisClass = _class;
15740 if(inCompiler && _class)
15742 if(type->kind == 11)
15744 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15746 struct Type * param = symbol->type->params.first;
15748 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15751 if(type->classObjectType != 1)
15753 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15754 symbol->type->staticMethod = 0x1;
15755 symbol->type->thisClass = (((void *)0));
15756 symbol->type->extraParam = 0x0;
15759 strcpy(className, "__ecereClass_");
15760 FullClassNameCat(className, _class->fullName, 0x1);
15761 MangleClassName(className);
15762 structName[0] = (char)0;
15763 FullClassNameCat(structName, _class->fullName, 0x0);
15764 funcDecl = GetFuncDecl(function->declarator);
15767 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15769 struct TypeName * param = (*funcDecl->function.parameters).first;
15771 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15773 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15774 FreeTypeName(param);
15777 if(!function->propertyNoThis)
15779 struct TypeName * thisParam;
15781 if(type->classObjectType != 1)
15783 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15784 if(!funcDecl->function.parameters)
15785 funcDecl->function.parameters = MkList();
15786 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15790 if(type->classObjectType != 1)
15792 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15793 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15795 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
15796 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15800 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15802 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15804 funcDecl = GetFuncDecl(initDecl->declarator);
15807 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15809 struct TypeName * param = (*funcDecl->function.parameters).first;
15811 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15813 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15814 FreeTypeName(param);
15817 if(type->classObjectType != 1)
15819 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15821 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15823 if(!funcDecl->function.parameters)
15824 funcDecl->function.parameters = MkList();
15825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15833 if(type->classObjectType != 1)
15835 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
15836 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15837 if(typedObject && thisSymbol->type)
15839 thisSymbol->type->classObjectType = 2;
15840 thisSymbol->type->byReference = type->byReference;
15844 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15846 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15849 struct __ecereNameSpace__ecere__com__Class * base;
15851 for(base = _class; base && base->type != 1000; base = base->next)
15853 for(member = base->membersAndProperties.first; member; member = member->next)
15854 if(!member->isProperty)
15860 for(member = _class->membersAndProperties.first; member; member = member->next)
15861 if(!member->isProperty)
15865 char pointerName[1024];
15866 struct Declaration * decl;
15867 struct Initializer * initializer;
15868 struct Expression * exp, * bytePtr;
15870 strcpy(pointerName, "__ecerePointer_");
15871 FullClassNameCat(pointerName, _class->fullName, 0x0);
15873 char className[1024];
15875 strcpy(className, "__ecereClass_");
15876 FullClassNameCat(className, classSym->string, 0x1);
15877 MangleClassName(className);
15878 DeclareClass(classSym, className);
15880 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15885 sprintf(string, "%d", _class->offset);
15886 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15890 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15892 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15893 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
15896 yylloc = function->body->loc;
15897 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15899 struct Context * prevContext = curContext;
15901 curContext = function->body->compound.context;
15902 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15903 curContext = prevContext;
15905 decl->symbol = (((void *)0));
15906 if(!function->body->compound.declarations)
15907 function->body->compound.declarations = MkList();
15908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15914 thisClass = (((void *)0));
15917 FreeSpecifier(id->_class);
15918 id->_class = (((void *)0));
15919 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15921 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15923 id = GetDeclId(initDecl->declarator);
15924 FreeSpecifier(id->_class);
15925 id->_class = (((void *)0));
15929 topContext = function->body->compound.context;
15931 struct FunctionDefinition * oldFunction = curFunction;
15933 curFunction = function;
15935 ProcessStatement(function->body);
15936 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15938 struct Statement * prevCompound = curCompound;
15939 struct Context * prevContext = curContext;
15940 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15942 if(!function->body->compound.statements)
15943 function->body->compound.statements = MkList();
15944 ListAdd(function->body->compound.statements, fireWatchers);
15945 curCompound = function->body;
15946 curContext = function->body->compound.context;
15947 ProcessStatement(fireWatchers);
15948 curContext = prevContext;
15949 curCompound = prevCompound;
15951 curFunction = oldFunction;
15953 if(function->declarator)
15955 ProcessDeclarator(function->declarator);
15957 topContext = oldTopContext;
15958 thisClass = oldThisClass;
15961 extern void FreeSymbol(struct Symbol * symbol);
15963 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15965 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15967 struct ClassDef * def;
15968 struct External * external = curExternal;
15969 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15971 for(def = definitions->first; def; def = def->next)
15975 if(def->function->declarator)
15976 curExternal = def->function->declarator->symbol->pointerExternal;
15978 curExternal = external;
15979 ProcessFunction((struct FunctionDefinition *)def->function);
15981 else if(def->type == 2)
15983 if(def->decl->type == 2)
15985 thisClass = regClass;
15986 ProcessInstantiationType(def->decl->inst);
15987 thisClass = (((void *)0));
15991 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15994 thisClass = regClass;
15995 ProcessDeclaration(def->decl);
15996 thisClass = backThisClass;
15999 else if(def->type == 1 && def->defProperties)
16001 struct MemberInit * defProperty;
16002 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);
16004 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16005 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16007 thisClass = regClass;
16008 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16009 thisClass = (((void *)0));
16011 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16012 FreeSymbol(thisSymbol);
16014 else if(def->type == 3 && def->propertyDef)
16016 struct PropertyDef * prop = def->propertyDef;
16018 thisClass = regClass;
16023 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16025 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16027 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16028 ProcessStatement(prop->setStmt);
16034 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16036 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16038 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16039 ProcessStatement(prop->getStmt);
16041 if(prop->issetStmt)
16045 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16047 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16049 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16050 ProcessStatement(prop->issetStmt);
16052 thisClass = (((void *)0));
16054 else if(def->type == 4 && def->propertyWatch)
16056 struct PropertyWatch * propertyWatch = def->propertyWatch;
16058 thisClass = regClass;
16059 if(propertyWatch->compound)
16061 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);
16063 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16064 curExternal = (((void *)0));
16065 ProcessStatement(propertyWatch->compound);
16067 thisClass = (((void *)0));
16072 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16074 void ComputeDataTypes()
16076 void * __ecereTemp1;
16077 struct External * external;
16078 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16080 currentClass = (((void *)0));
16081 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16082 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16083 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16084 curExternal = temp;
16085 DeclareStruct("ecere::com::Class", 0x0);
16086 DeclareStruct("ecere::com::Instance", 0x0);
16087 DeclareStruct("ecere::com::Property", 0x0);
16088 DeclareStruct("ecere::com::DataMember", 0x0);
16089 DeclareStruct("ecere::com::Method", 0x0);
16090 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16091 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16093 for(external = (*ast).first; external; external = external->next)
16095 afterExternal = curExternal = external;
16096 if(external->type == 0)
16098 currentClass = external->function->_class;
16099 ProcessFunction(external->function);
16101 else if(external->type == 1)
16103 currentClass = (((void *)0));
16104 ProcessDeclaration(external->declaration);
16106 else if(external->type == 2)
16108 struct ClassDefinition * _class = external->_class;
16110 currentClass = external->symbol->registered;
16111 if(_class->definitions)
16113 ProcessClass(_class->definitions, _class->symbol);
16117 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16118 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16121 else if(external->type == 4)
16123 thisNameSpace = external->id->string;
16126 currentClass = (((void *)0));
16127 thisNameSpace = (((void *)0));
16128 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16129 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16132 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char * name, char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
16134 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16136 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16138 struct __ecereNameSpace__ecere__com__Class * class;
16140 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16141 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16142 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16143 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16144 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16145 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16146 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16147 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16148 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16149 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16150 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16151 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16152 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16153 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16154 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16155 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16156 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16157 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16158 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16159 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16160 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16162 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16163 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16164 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16165 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16166 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16167 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16168 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16169 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16171 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16175 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16176 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16177 __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);
16178 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16179 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16180 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16181 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16185 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16188 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16189 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16190 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16191 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16192 __ecereClass_Conversion = class;
16193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypes", "bool MatchTypes(Type source, Type dest, ecere::sys::OldList conversions, ecere::com::Class owningClassSource, ecere::com::Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams, bool isConversionExploration)", MatchTypes, module, 1);
16194 __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);
16195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16196 __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);
16197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16215 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)