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
26 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
28 struct __ecereNameSpace__ecere__sys__BTNode;
30 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
32 struct __ecereNameSpace__ecere__sys__BinaryTree
34 struct __ecereNameSpace__ecere__sys__BTNode * root;
36 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
37 void (* FreeKey)(void * key);
38 } __attribute__ ((gcc_struct));
40 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
42 struct __ecereNameSpace__ecere__sys__OldList
49 } __attribute__ ((gcc_struct));
51 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
53 struct __ecereNameSpace__ecere__com__Method
56 struct __ecereNameSpace__ecere__com__Method * parent;
57 struct __ecereNameSpace__ecere__com__Method * left;
58 struct __ecereNameSpace__ecere__com__Method * right;
63 struct __ecereNameSpace__ecere__com__Class * _class;
65 char * dataTypeString;
66 struct Type * dataType;
68 } __attribute__ ((gcc_struct));
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
72 struct __ecereNameSpace__ecere__com__Property
74 struct __ecereNameSpace__ecere__com__Property * prev;
75 struct __ecereNameSpace__ecere__com__Property * next;
77 unsigned int isProperty;
80 struct __ecereNameSpace__ecere__com__Class * _class;
81 char * dataTypeString;
82 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
83 struct Type * dataType;
86 unsigned int (* IsSet)();
90 unsigned int conversion;
91 unsigned int watcherOffset;
93 unsigned int compiled;
94 unsigned int selfWatchable;
95 unsigned int isWatchable;
96 } __attribute__ ((gcc_struct));
98 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
105 unsigned int included;
106 } __attribute__ ((gcc_struct));
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
112 struct CodePosition start;
113 struct CodePosition end;
114 } __attribute__ ((gcc_struct));
116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
129 struct Attrib * attr;
130 } __attribute__ ((gcc_struct));
131 } __attribute__ ((gcc_struct));
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
135 struct ClassDefinition
137 struct ClassDefinition * prev;
138 struct ClassDefinition * next;
140 struct Specifier * _class;
141 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
142 struct __ecereNameSpace__ecere__sys__OldList * definitions;
143 struct Symbol * symbol;
144 struct Location blockStart;
145 struct Location nameLoc;
148 unsigned int deleteWatchable;
149 } __attribute__ ((gcc_struct));
151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
155 struct Context * parent;
156 struct __ecereNameSpace__ecere__sys__BinaryTree types;
157 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
158 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
159 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
162 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
163 struct ClassDefinition * classDef;
164 unsigned int templateTypesOnly;
165 unsigned int hasNameSpace;
166 } __attribute__ ((gcc_struct));
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
172 struct Instantiation * prev;
173 struct Instantiation * next;
175 struct Specifier * _class;
176 struct Expression * exp;
177 struct __ecereNameSpace__ecere__sys__OldList * members;
178 struct Symbol * symbol;
179 unsigned int fullSet;
180 unsigned int isConstant;
181 unsigned char * data;
182 struct Location nameLoc;
183 struct Location insideLoc;
185 } __attribute__ ((gcc_struct));
187 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
191 struct Declaration * prev;
192 struct Declaration * next;
199 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
200 struct __ecereNameSpace__ecere__sys__OldList * declarators;
201 } __attribute__ ((gcc_struct));
202 struct Instantiation * inst;
205 struct Identifier * id;
206 struct Expression * exp;
207 } __attribute__ ((gcc_struct));
208 } __attribute__ ((gcc_struct));
209 struct Specifier * extStorage;
210 struct Symbol * symbol;
212 } __attribute__ ((gcc_struct));
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
218 struct Statement * prev;
219 struct Statement * next;
224 struct __ecereNameSpace__ecere__sys__OldList * expressions;
227 struct Identifier * id;
228 struct Statement * stmt;
229 } __attribute__ ((gcc_struct)) labeled;
232 struct Expression * exp;
233 struct Statement * stmt;
234 } __attribute__ ((gcc_struct)) caseStmt;
237 struct __ecereNameSpace__ecere__sys__OldList * declarations;
238 struct __ecereNameSpace__ecere__sys__OldList * statements;
239 struct Context * context;
240 unsigned int isSwitch;
241 } __attribute__ ((gcc_struct)) compound;
244 struct __ecereNameSpace__ecere__sys__OldList * exp;
245 struct Statement * stmt;
246 struct Statement * elseStmt;
247 } __attribute__ ((gcc_struct)) ifStmt;
250 struct __ecereNameSpace__ecere__sys__OldList * exp;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) switchStmt;
255 struct __ecereNameSpace__ecere__sys__OldList * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) whileStmt;
260 struct __ecereNameSpace__ecere__sys__OldList * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) doWhile;
265 struct Statement * init;
266 struct Statement * check;
267 struct __ecereNameSpace__ecere__sys__OldList * increment;
268 struct Statement * stmt;
269 } __attribute__ ((gcc_struct)) forStmt;
272 struct Identifier * id;
273 } __attribute__ ((gcc_struct)) gotoStmt;
276 struct Specifier * spec;
278 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
279 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
280 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
281 } __attribute__ ((gcc_struct)) asmStmt;
284 struct Expression * watcher;
285 struct Expression * object;
286 struct __ecereNameSpace__ecere__sys__OldList * watches;
287 } __attribute__ ((gcc_struct)) _watch;
290 struct Identifier * id;
291 struct __ecereNameSpace__ecere__sys__OldList * exp;
292 struct __ecereNameSpace__ecere__sys__OldList * filter;
293 struct Statement * stmt;
294 } __attribute__ ((gcc_struct)) forEachStmt;
295 struct Declaration * decl;
296 } __attribute__ ((gcc_struct));
297 } __attribute__ ((gcc_struct));
299 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
303 struct TypeName * prev;
304 struct TypeName * next;
306 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
307 struct Declarator * declarator;
309 struct Expression * bitCount;
310 } __attribute__ ((gcc_struct));
312 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
316 struct Initializer * prev;
317 struct Initializer * next;
322 struct Expression * exp;
323 struct __ecereNameSpace__ecere__sys__OldList * list;
324 } __attribute__ ((gcc_struct));
325 unsigned int isConstant;
326 } __attribute__ ((gcc_struct));
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
330 struct __ecereNameSpace__ecere__com__DataValue
345 } __attribute__ ((gcc_struct));
346 } __attribute__ ((gcc_struct));
348 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
352 struct Expression * prev;
353 struct Expression * next;
361 struct Identifier * identifier;
362 } __attribute__ ((gcc_struct));
363 struct Statement * compound;
364 struct Instantiation * instance;
366 struct __ecereNameSpace__ecere__sys__OldList * list;
369 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
370 struct Declarator * decl;
371 } __attribute__ ((gcc_struct)) _classExp;
374 struct Identifier * id;
375 } __attribute__ ((gcc_struct)) classData;
378 struct Expression * exp;
379 struct __ecereNameSpace__ecere__sys__OldList * arguments;
380 struct Location argLoc;
381 } __attribute__ ((gcc_struct)) call;
384 struct Expression * exp;
385 struct __ecereNameSpace__ecere__sys__OldList * index;
386 } __attribute__ ((gcc_struct)) index;
389 struct Expression * exp;
390 struct Identifier * member;
392 unsigned int thisPtr;
393 } __attribute__ ((gcc_struct)) member;
397 struct Expression * exp1;
398 struct Expression * exp2;
399 } __attribute__ ((gcc_struct)) op;
400 struct TypeName * typeName;
401 struct Specifier * _class;
404 struct TypeName * typeName;
405 struct Expression * exp;
406 } __attribute__ ((gcc_struct)) cast;
409 struct Expression * cond;
410 struct __ecereNameSpace__ecere__sys__OldList * exp;
411 struct Expression * elseExp;
412 } __attribute__ ((gcc_struct)) cond;
415 struct TypeName * typeName;
416 struct Expression * size;
417 } __attribute__ ((gcc_struct)) _new;
420 struct TypeName * typeName;
421 struct Expression * size;
422 struct Expression * exp;
423 } __attribute__ ((gcc_struct)) _renew;
427 struct Identifier * id;
428 } __attribute__ ((gcc_struct)) db;
431 struct Expression * ds;
432 struct Expression * name;
433 } __attribute__ ((gcc_struct)) dbopen;
436 struct TypeName * typeName;
437 struct Initializer * initializer;
438 } __attribute__ ((gcc_struct)) initializer;
441 struct Expression * exp;
442 struct TypeName * typeName;
443 } __attribute__ ((gcc_struct)) vaArg;
444 } __attribute__ ((gcc_struct));
445 unsigned int debugValue;
446 struct __ecereNameSpace__ecere__com__DataValue val;
447 unsigned int address;
448 unsigned int hasAddress;
449 struct Type * expType;
450 struct Type * destType;
453 unsigned int byReference;
454 unsigned int isConstant;
455 unsigned int addedThis;
456 unsigned int needCast;
457 unsigned int thisPtr;
458 } __attribute__ ((gcc_struct));
460 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
462 struct TemplateDatatype
464 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
465 struct Declarator * decl;
466 } __attribute__ ((gcc_struct));
468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
470 struct TemplateArgument;
472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
474 struct TemplateParameter
476 struct TemplateParameter * prev;
477 struct TemplateParameter * next;
480 struct Identifier * identifier;
483 struct TemplateDatatype * dataType;
485 } __attribute__ ((gcc_struct));
486 struct TemplateArgument * defaultArgument;
487 char * dataTypeString;
488 struct Type * baseType;
489 } __attribute__ ((gcc_struct));
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
495 struct Specifier * prev;
496 struct Specifier * next;
504 struct ExtDecl * extDecl;
506 struct Symbol * symbol;
507 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
508 } __attribute__ ((gcc_struct));
511 struct Identifier * id;
512 struct __ecereNameSpace__ecere__sys__OldList * list;
513 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
514 struct __ecereNameSpace__ecere__sys__OldList * definitions;
515 unsigned int addNameSpace;
516 struct Context * ctx;
517 } __attribute__ ((gcc_struct));
518 struct Expression * expression;
519 struct Specifier * _class;
520 struct TemplateParameter * templateParameter;
521 } __attribute__ ((gcc_struct));
522 } __attribute__ ((gcc_struct));
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
528 struct Identifier * prev;
529 struct Identifier * next;
531 struct Symbol * classSym;
532 struct Specifier * _class;
534 struct Identifier * badID;
535 } __attribute__ ((gcc_struct));
537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
541 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
545 struct Declarator * prev;
546 struct Declarator * next;
549 struct Symbol * symbol;
550 struct Declarator * declarator;
553 struct Identifier * identifier;
556 struct Expression * exp;
557 struct Expression * posExp;
558 struct Attrib * attrib;
559 } __attribute__ ((gcc_struct)) structDecl;
562 struct Expression * exp;
563 struct Specifier * enumClass;
564 } __attribute__ ((gcc_struct)) array;
567 struct __ecereNameSpace__ecere__sys__OldList * parameters;
568 } __attribute__ ((gcc_struct)) function;
571 struct Pointer * pointer;
572 } __attribute__ ((gcc_struct)) pointer;
575 struct ExtDecl * extended;
576 } __attribute__ ((gcc_struct)) extended;
577 } __attribute__ ((gcc_struct));
578 } __attribute__ ((gcc_struct));
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
582 struct FunctionDefinition
584 struct FunctionDefinition * prev;
585 struct FunctionDefinition * next;
587 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
588 struct Declarator * declarator;
589 struct __ecereNameSpace__ecere__sys__OldList * declarations;
590 struct Statement * body;
591 struct __ecereNameSpace__ecere__com__Class * _class;
592 struct __ecereNameSpace__ecere__sys__OldList attached;
595 struct Symbol * propSet;
597 unsigned int propertyNoThis;
598 } __attribute__ ((gcc_struct));
600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
608 struct External * prev;
609 struct External * next;
612 struct Symbol * symbol;
615 struct FunctionDefinition * function;
616 struct ClassDefinition * _class;
617 struct Declaration * declaration;
619 struct Identifier * id;
620 struct DBTableDef * table;
621 } __attribute__ ((gcc_struct));
623 } __attribute__ ((gcc_struct));
625 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
629 struct ModuleImport * prev;
630 struct ModuleImport * next;
632 struct __ecereNameSpace__ecere__sys__OldList classes;
633 struct __ecereNameSpace__ecere__sys__OldList functions;
636 } __attribute__ ((gcc_struct));
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
642 struct ClassImport * prev;
643 struct ClassImport * next;
645 struct __ecereNameSpace__ecere__sys__OldList methods;
646 struct __ecereNameSpace__ecere__sys__OldList properties;
648 unsigned int isRemote;
649 } __attribute__ ((gcc_struct));
651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
656 struct Symbol * parent;
657 struct Symbol * left;
658 struct Symbol * right;
663 struct __ecereNameSpace__ecere__com__Method * method;
664 struct __ecereNameSpace__ecere__com__Property * _property;
665 struct __ecereNameSpace__ecere__com__Class * registered;
666 } __attribute__ ((gcc_struct));
673 struct External * pointerExternal;
674 struct External * structExternal;
675 } __attribute__ ((gcc_struct));
678 struct External * externalGet;
679 struct External * externalSet;
680 struct External * externalPtr;
681 struct External * externalIsSet;
682 } __attribute__ ((gcc_struct));
685 struct External * methodExternal;
686 struct External * methodCodeExternal;
687 } __attribute__ ((gcc_struct));
688 } __attribute__ ((gcc_struct));
689 unsigned int imported;
690 unsigned int declaredStructSym;
691 struct __ecereNameSpace__ecere__com__Class * _class;
692 unsigned int declaredStruct;
693 unsigned int needConstructor;
694 unsigned int needDestructor;
695 char * constructorName;
698 char * destructorName;
699 struct ModuleImport * module;
700 struct ClassImport * _import;
701 struct Location nameLoc;
702 unsigned int isParam;
703 unsigned int isRemote;
704 unsigned int isStruct;
705 unsigned int fireWatchersDone;
707 unsigned int classData;
708 unsigned int isStatic;
710 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
711 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
712 struct Context * ctx;
714 struct Expression * propCategory;
715 } __attribute__ ((gcc_struct));
717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
726 struct Symbol * _class;
729 struct __ecereNameSpace__ecere__sys__OldList members;
731 } __attribute__ ((gcc_struct));
734 struct Type * returnType;
735 struct __ecereNameSpace__ecere__sys__OldList params;
736 struct Symbol * thisClass;
737 unsigned int staticMethod;
738 struct TemplateParameter * thisClassTemplate;
739 } __attribute__ ((gcc_struct));
742 struct __ecereNameSpace__ecere__com__Method * method;
743 struct __ecereNameSpace__ecere__com__Class * methodClass;
744 struct __ecereNameSpace__ecere__com__Class * usedClass;
745 } __attribute__ ((gcc_struct));
748 struct Type * arrayType;
750 struct Expression * arraySizeExp;
751 unsigned int freeExp;
752 struct Symbol * enumClass;
753 } __attribute__ ((gcc_struct));
755 struct TemplateParameter * templateParameter;
756 } __attribute__ ((gcc_struct));
757 unsigned int isSigned;
759 unsigned int constant;
766 unsigned int byReference;
767 unsigned int extraParam;
769 unsigned int directClassAccess;
770 unsigned int computing;
771 unsigned int dllExport;
773 unsigned int keepCast;
774 unsigned int passAsTemplate;
776 } __attribute__ ((gcc_struct));
778 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
780 struct __ecereNameSpace__ecere__com__Class
782 struct __ecereNameSpace__ecere__com__Class * prev;
783 struct __ecereNameSpace__ecere__com__Class * next;
789 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
790 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
793 struct __ecereNameSpace__ecere__com__Class * base;
794 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
795 struct __ecereNameSpace__ecere__sys__BinaryTree members;
796 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
797 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
798 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
799 struct __ecereNameSpace__ecere__sys__OldList derivatives;
803 struct __ecereNameSpace__ecere__com__Instance * module;
804 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
805 char * dataTypeString;
806 struct Type * dataType;
808 int defaultAlignment;
809 void (* Initialize)();
811 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
812 char * designerClass;
813 unsigned int noExpansion;
814 char * defaultProperty;
815 unsigned int comRedefinition;
817 unsigned int isRemote;
818 unsigned int internalDecl;
820 unsigned int computeSize;
822 int destructionWatchOffset;
824 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
825 int inheritanceAccess;
828 struct __ecereNameSpace__ecere__sys__OldList conversions;
829 struct __ecereNameSpace__ecere__sys__OldList templateParams;
830 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
831 struct __ecereNameSpace__ecere__com__Class * templateClass;
832 struct __ecereNameSpace__ecere__sys__OldList templatized;
834 } __attribute__ ((gcc_struct));
836 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
838 struct __ecereNameSpace__ecere__com__Instance
841 struct __ecereNameSpace__ecere__com__Class * _class;
843 } __attribute__ ((gcc_struct));
845 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
847 struct __ecereNameSpace__ecere__com__DataMember
849 struct __ecereNameSpace__ecere__com__DataMember * prev;
850 struct __ecereNameSpace__ecere__com__DataMember * next;
852 unsigned int isProperty;
855 struct __ecereNameSpace__ecere__com__Class * _class;
856 char * dataTypeString;
857 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
858 struct Type * dataType;
862 struct __ecereNameSpace__ecere__sys__OldList members;
863 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
866 } __attribute__ ((gcc_struct));
868 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
870 struct __ecereNameSpace__ecere__com__SerialBuffer
872 unsigned char * _buffer;
876 } __attribute__ ((gcc_struct));
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
886 char * dataTypeString;
887 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
888 } __attribute__ ((gcc_struct));
889 struct __ecereNameSpace__ecere__com__DataValue expression;
895 struct __ecereNameSpace__ecere__com__DataMember * member;
896 struct __ecereNameSpace__ecere__com__Property * prop;
897 struct __ecereNameSpace__ecere__com__Method * method;
898 } __attribute__ ((gcc_struct));
899 } __attribute__ ((gcc_struct));
900 } __attribute__ ((gcc_struct));
901 } __attribute__ ((gcc_struct));
903 typedef unsigned int size_t;
905 void exit(int status);
907 void * calloc(size_t nmemb, size_t size);
909 void free(void * ptr);
911 void * malloc(size_t size);
913 void * realloc(void * ptr, size_t size);
915 long int strtol(const char * nptr, char ** endptr, int base);
917 long long int strtoll(const char * nptr, char ** endptr, int base);
919 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
923 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
926 typedef union YYSTYPE
931 struct Identifier * id;
932 struct Expression * exp;
933 struct Specifier * specifier;
934 struct __ecereNameSpace__ecere__sys__OldList * list;
935 struct Enumerator * enumerator;
936 struct Declarator * declarator;
937 struct Pointer * pointer;
938 struct Initializer * initializer;
939 struct InitDeclarator * initDeclarator;
940 struct TypeName * typeName;
941 struct Declaration * declaration;
942 struct Statement * stmt;
943 struct FunctionDefinition * function;
944 struct External * external;
945 struct Context * context;
946 struct AsmField * asmField;
947 struct Attrib * attrib;
948 struct ExtDecl * extDecl;
949 struct Attribute * attribute;
950 struct Instantiation * instance;
951 struct MembersInit * membersInit;
952 struct MemberInit * memberInit;
953 struct ClassFunction * classFunction;
954 struct ClassDefinition * _class;
955 struct ClassDef * classDef;
956 struct PropertyDef * prop;
958 struct Symbol * symbol;
959 struct PropertyWatch * propertyWatch;
960 struct TemplateParameter * templateParameter;
961 struct TemplateArgument * templateArgument;
962 struct TemplateDatatype * templateDatatype;
963 struct DBTableEntry * dbtableEntry;
964 struct DBIndexItem * dbindexItem;
965 struct DBTableDef * dbtableDef;
966 } __attribute__ ((gcc_struct)) YYSTYPE;
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
972 struct Enumerator * prev;
973 struct Enumerator * next;
975 struct Identifier * id;
976 struct Expression * exp;
977 } __attribute__ ((gcc_struct));
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
981 struct InitDeclarator
983 struct InitDeclarator * prev;
984 struct InitDeclarator * next;
986 struct Declarator * declarator;
987 struct Initializer * initializer;
988 } __attribute__ ((gcc_struct));
990 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
994 struct AsmField * prev;
995 struct AsmField * next;
998 struct Expression * expression;
999 } __attribute__ ((gcc_struct));
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1007 struct ClassFunction
1009 struct ClassFunction * prev;
1010 struct ClassFunction * next;
1011 struct Location loc;
1012 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1013 struct Declarator * declarator;
1014 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1015 struct Statement * body;
1016 struct __ecereNameSpace__ecere__com__Class * _class;
1017 struct __ecereNameSpace__ecere__sys__OldList attached;
1020 struct Symbol * propSet;
1021 unsigned int isVirtual;
1022 unsigned int isConstructor;
1023 unsigned int isDestructor;
1024 unsigned int dontMangle;
1027 } __attribute__ ((gcc_struct));
1029 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1033 struct MembersInit * prev;
1034 struct MembersInit * next;
1035 struct Location loc;
1039 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1040 struct ClassFunction * function;
1041 } __attribute__ ((gcc_struct));
1042 } __attribute__ ((gcc_struct));
1044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1048 struct MemberInit * prev;
1049 struct MemberInit * next;
1050 struct Location loc;
1051 struct Location realLoc;
1052 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1053 struct Initializer * initializer;
1055 unsigned int variable;
1056 unsigned int takeOutExp;
1057 } __attribute__ ((gcc_struct));
1059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1063 struct PropertyDef * prev;
1064 struct PropertyDef * next;
1065 struct Location loc;
1066 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1067 struct Declarator * declarator;
1068 struct Identifier * id;
1069 struct Statement * getStmt;
1070 struct Statement * setStmt;
1071 struct Statement * issetStmt;
1072 struct Symbol * symbol;
1073 unsigned int conversion;
1074 unsigned int isWatchable;
1075 struct Expression * category;
1076 } __attribute__ ((gcc_struct));
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1080 struct PropertyWatch
1082 struct PropertyWatch * prev;
1083 struct PropertyWatch * next;
1084 struct Location loc;
1085 struct Statement * compound;
1086 struct __ecereNameSpace__ecere__sys__OldList * properties;
1087 unsigned int deleteWatch;
1088 } __attribute__ ((gcc_struct));
1090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1094 struct ClassDef * prev;
1095 struct ClassDef * next;
1096 struct Location loc;
1100 struct Declaration * decl;
1101 struct ClassFunction * function;
1102 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1103 struct PropertyDef * propertyDef;
1104 struct PropertyWatch * propertyWatch;
1106 struct Identifier * defaultProperty;
1109 struct Identifier * id;
1110 struct Initializer * initializer;
1111 } __attribute__ ((gcc_struct));
1112 } __attribute__ ((gcc_struct));
1115 } __attribute__ ((gcc_struct));
1117 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1119 struct DBTableEntry;
1121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1125 extern YYSTYPE yylval;
1127 extern struct Location yylloc;
1129 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1131 extern int returnCode;
1133 extern struct Expression * parsedExpression;
1135 extern unsigned int yydebug;
1137 void SetYydebug(unsigned int b)
1142 extern unsigned int echoOn;
1144 void resetScanner();
1148 int expression_yyparse();
1150 static struct Statement * curCompound;
1152 struct External * curExternal, * afterExternal;
1154 static struct Type * curSwitchType;
1156 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1158 struct __ecereNameSpace__ecere__com__Class * thisClass;
1160 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1165 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1170 static char * thisNameSpace;
1172 struct __ecereNameSpace__ecere__com__Class * containerClass;
1174 unsigned int thisClassParams = 0x1;
1176 unsigned int internalValueCounter;
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1180 struct __ecereNameSpace__ecere__sys__TempFile
1182 char __ecere_padding[24];
1183 } __attribute__ ((gcc_struct));
1185 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1187 extern int strlen(const char * );
1189 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1191 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1193 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1195 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1197 void PrintExpression(struct Expression * exp, char * string)
1200 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1204 OutputExpression(exp, f);
1205 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1206 count = strlen(string);
1207 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);
1208 string[count] = '\0';
1209 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1213 extern int isspace(int c);
1215 long long _strtoi64(char * string, char ** endString, int base)
1217 long long value = 0;
1222 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1234 if(ch == (char)0 && string[c + 1] == 'x')
1247 for(; (ch = string[c]); c++)
1251 else if(ch >= '1' && ch <= '9')
1253 else if(ch >= 'a' && ch <= 'z')
1255 else if(ch >= 'A' && ch <= 'Z')
1260 *endString = string + c;
1271 *endString = string + c;
1275 return sign * value;
1278 uint64 _strtoui64(char * string, char ** endString, int base)
1285 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1297 if(ch == (char)0 && string[c + 1] == 'x')
1310 for(; (ch = string[c]); c++)
1314 else if(ch >= '1' && ch <= '9')
1316 else if(ch >= 'a' && ch <= 'z')
1318 else if(ch >= 'A' && ch <= 'Z')
1323 *endString = string + c;
1334 *endString = string + c;
1338 return sign * value;
1341 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1343 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1345 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1347 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1349 if(!param->baseType)
1351 if(param->dataTypeString)
1352 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1354 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1356 return param->baseType;
1358 return (((void *)0));
1361 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1363 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1365 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1369 if(type1->kind == type2->kind)
1378 if(type1->passAsTemplate && !type2->passAsTemplate)
1380 return type1->isSigned != type2->isSigned;
1382 return type1->_class != type2->_class;
1384 return NeedCast(type1->type, type2->type);
1392 extern int strcmp(const char * , const char * );
1394 extern struct Context * curContext;
1396 extern struct Context * topContext;
1398 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1400 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);
1402 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1404 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);
1406 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);
1408 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1410 struct __ecereNameSpace__ecere__com__ClassProperty
1413 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1414 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1415 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1417 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1418 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1419 char * dataTypeString;
1420 struct Type * dataType;
1421 unsigned int constant;
1422 } __attribute__ ((gcc_struct));
1424 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1426 extern struct Expression * QMkExpId(char * id);
1428 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1432 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1433 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1438 char * dataTypeString;
1440 } __attribute__ ((gcc_struct));
1441 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1443 char __ecere_padding[4];
1444 } __attribute__ ((gcc_struct));
1446 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1448 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1450 extern void FreeIdentifier(struct Identifier * id);
1452 void ProcessExpressionType(struct Expression * exp);
1454 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1456 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1458 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1460 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1462 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1464 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1466 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1468 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1470 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1472 if(exp->type == 0 && exp->identifier)
1474 struct Identifier * id = exp->identifier;
1475 struct Context * ctx;
1476 struct Symbol * symbol = (((void *)0));
1478 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1480 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1482 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1487 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1489 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1490 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1491 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1492 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1496 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1498 if(!prop && !method)
1499 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1500 if(!prop && !method && !member)
1502 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1504 if(prop || method || member || classProp)
1507 exp->member.member = id;
1508 exp->member.memberType = 0;
1509 exp->member.exp = QMkExpId("this");
1510 exp->addedThis = 0x1;
1512 else if(_class && _class->templateParams.first)
1514 struct __ecereNameSpace__ecere__com__Class * sClass;
1516 for(sClass = _class; sClass; sClass = sClass->base)
1518 if(sClass->templateParams.first)
1520 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1522 for(param = sClass->templateParams.first; param; param = param->next)
1524 if(param->type == 2 && !strcmp(param->name, id->string))
1526 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1530 struct Declarator * decl;
1531 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1533 FreeIdentifier(exp->member.member);
1534 ProcessExpressionType(argExp);
1535 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1536 exp->expType = ProcessType(specs, decl);
1538 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1549 extern int sprintf(char * , char * , ...);
1551 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1553 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1555 char * PrintInt(long long result)
1559 if(result > (((long long)0x7fffffffffffffffLL)))
1560 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1562 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1563 return __ecereNameSpace__ecere__sys__CopyString(temp);
1566 char * PrintUInt(uint64 result)
1570 if(result > (0xffffffff))
1571 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1572 else if(result > (((int)0x7fffffff)))
1573 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1575 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1579 char * PrintInt64(long long result)
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 char * PrintUInt64(uint64 result)
1591 if(result > (((long long)0x7fffffffffffffffLL)))
1592 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1594 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1595 return __ecereNameSpace__ecere__sys__CopyString(temp);
1598 char * PrintHexUInt(uint64 result)
1602 if(result > (0xffffffff))
1603 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1605 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1606 return __ecereNameSpace__ecere__sys__CopyString(temp);
1609 char * PrintHexUInt64(uint64 result)
1613 if(result > (0xffffffff))
1614 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1616 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1617 return __ecereNameSpace__ecere__sys__CopyString(temp);
1620 char * PrintShort(short result)
1624 sprintf(temp, "%d", (unsigned short)result);
1625 return __ecereNameSpace__ecere__sys__CopyString(temp);
1628 char * PrintUShort(unsigned short result)
1632 if(result > (unsigned short)32767)
1633 sprintf(temp, "0x%X", (int)result);
1635 sprintf(temp, "%d", result);
1636 return __ecereNameSpace__ecere__sys__CopyString(temp);
1639 extern int isprint(int c);
1641 char * PrintChar(char result)
1645 if(result > (char)0 && isprint(result))
1646 sprintf(temp, "'%c'", result);
1647 else if(result < (char)0)
1648 sprintf(temp, "%d", result);
1650 sprintf(temp, "0x%X", (unsigned char)result);
1651 return __ecereNameSpace__ecere__sys__CopyString(temp);
1654 char * PrintUChar(unsigned char result)
1658 sprintf(temp, "0x%X", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1662 char * PrintFloat(float result)
1666 sprintf(temp, "%.16ff", result);
1667 return __ecereNameSpace__ecere__sys__CopyString(temp);
1670 char * PrintDouble(double result)
1674 sprintf(temp, "%.16f", result);
1675 return __ecereNameSpace__ecere__sys__CopyString(temp);
1678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1682 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* Neg)(struct Expression *, struct Operand *);
1688 unsigned int (* Inc)(struct Expression *, struct Operand *);
1689 unsigned int (* Dec)(struct Expression *, struct Operand *);
1690 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1702 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* Not)(struct Expression *, struct Operand *);
1708 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1717 } __attribute__ ((gcc_struct));
1719 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1725 unsigned int ptrSize;
1741 } __attribute__ ((gcc_struct));
1743 } __attribute__ ((gcc_struct));
1745 struct Operand GetOperand(struct Expression * exp);
1747 unsigned int GetInt(struct Expression * exp, int * value2)
1749 struct Operand op2 = GetOperand(exp);
1751 if(op2.kind == 3 && op2.type->isSigned)
1753 else if(op2.kind == 3)
1754 *value2 = (int)op2.ui;
1755 if(op2.kind == 4 && op2.type->isSigned)
1756 *value2 = (int)op2.i64;
1757 else if(op2.kind == 4)
1758 *value2 = (int)op2.ui64;
1759 else if(op2.kind == 22 && op2.type->isSigned)
1760 *value2 = (int)op2.iptr;
1761 else if(op2.kind == 22)
1762 *value2 = (int)op2.uiptr;
1763 else if(op2.kind == 2 && op2.type->isSigned)
1764 *value2 = (int)op2.s;
1765 else if(op2.kind == 2)
1766 *value2 = (int)op2.us;
1767 else if(op2.kind == 1 && op2.type->isSigned)
1768 *value2 = (int)op2.c;
1769 else if(op2.kind == 1)
1770 *value2 = (int)op2.uc;
1771 else if(op2.kind == 6)
1772 *value2 = (int)op2.f;
1773 else if(op2.kind == 7)
1774 *value2 = (int)op2.d;
1775 else if(op2.kind == 13)
1776 *value2 = (int)op2.ui;
1782 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1784 struct Operand op2 = GetOperand(exp);
1786 if(op2.kind == 3 && op2.type->isSigned)
1787 *value2 = (unsigned int)op2.i;
1788 else if(op2.kind == 3)
1790 if(op2.kind == 4 && op2.type->isSigned)
1791 *value2 = (unsigned int)op2.i64;
1792 else if(op2.kind == 4)
1793 *value2 = (unsigned int)op2.ui64;
1794 else if(op2.kind == 22 && op2.type->isSigned)
1795 *value2 = (unsigned int)op2.iptr;
1796 else if(op2.kind == 22)
1797 *value2 = (unsigned int)op2.uiptr;
1798 else if(op2.kind == 2 && op2.type->isSigned)
1799 *value2 = (unsigned int)op2.s;
1800 else if(op2.kind == 2)
1801 *value2 = (unsigned int)op2.us;
1802 else if(op2.kind == 1 && op2.type->isSigned)
1803 *value2 = (unsigned int)op2.c;
1804 else if(op2.kind == 1)
1805 *value2 = (unsigned int)op2.uc;
1806 else if(op2.kind == 6)
1807 *value2 = (unsigned int)op2.f;
1808 else if(op2.kind == 7)
1809 *value2 = (unsigned int)op2.d;
1810 else if(op2.kind == 13)
1817 unsigned int GetInt64(struct Expression * exp, long long * value2)
1819 struct Operand op2 = GetOperand(exp);
1821 if(op2.kind == 3 && op2.type->isSigned)
1822 *value2 = (long long)op2.i;
1823 else if(op2.kind == 3)
1824 *value2 = (long long)op2.ui;
1825 if(op2.kind == 4 && op2.type->isSigned)
1827 else if(op2.kind == 4)
1828 *value2 = (long long)op2.ui64;
1829 else if(op2.kind == 22 && op2.type->isSigned)
1830 *value2 = (long long)op2.iptr;
1831 else if(op2.kind == 22)
1832 *value2 = (long long)op2.uiptr;
1833 else if(op2.kind == 2 && op2.type->isSigned)
1834 *value2 = (long long)op2.s;
1835 else if(op2.kind == 2)
1836 *value2 = (long long)op2.us;
1837 else if(op2.kind == 1 && op2.type->isSigned)
1838 *value2 = (long long)op2.c;
1839 else if(op2.kind == 1)
1840 *value2 = (long long)op2.uc;
1841 else if(op2.kind == 6)
1842 *value2 = (long long)op2.f;
1843 else if(op2.kind == 7)
1844 *value2 = (long long)op2.d;
1845 else if(op2.kind == 13)
1846 *value2 = (long long)op2.ui;
1852 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1854 struct Operand op2 = GetOperand(exp);
1856 if(op2.kind == 3 && op2.type->isSigned)
1857 *value2 = (uint64)op2.i;
1858 else if(op2.kind == 3)
1859 *value2 = (uint64)op2.ui;
1860 if(op2.kind == 4 && op2.type->isSigned)
1861 *value2 = (uint64)op2.i64;
1862 else if(op2.kind == 4)
1864 else if(op2.kind == 22 && op2.type->isSigned)
1865 *value2 = (uint64)op2.iptr;
1866 else if(op2.kind == 22)
1867 *value2 = (uint64)op2.uiptr;
1868 else if(op2.kind == 2 && op2.type->isSigned)
1869 *value2 = (uint64)op2.s;
1870 else if(op2.kind == 2)
1871 *value2 = (uint64)op2.us;
1872 else if(op2.kind == 1 && op2.type->isSigned)
1873 *value2 = (uint64)op2.c;
1874 else if(op2.kind == 1)
1875 *value2 = (uint64)op2.uc;
1876 else if(op2.kind == 6)
1877 *value2 = (uint64)op2.f;
1878 else if(op2.kind == 7)
1879 *value2 = (uint64)op2.d;
1880 else if(op2.kind == 13)
1881 *value2 = (uint64)op2.ui;
1887 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1889 struct Operand op2 = GetOperand(exp);
1891 if(op2.kind == 3 && op2.type->isSigned)
1892 *value2 = (intptr_t)op2.i;
1893 else if(op2.kind == 3)
1894 *value2 = (intptr_t)op2.ui;
1895 if(op2.kind == 4 && op2.type->isSigned)
1896 *value2 = (intptr_t)op2.i64;
1897 else if(op2.kind == 4)
1898 *value2 = (intptr_t)op2.ui64;
1899 else if(op2.kind == 22 && op2.type->isSigned)
1901 else if(op2.kind == 22)
1902 *value2 = (intptr_t)op2.uiptr;
1903 else if(op2.kind == 2 && op2.type->isSigned)
1904 *value2 = (intptr_t)op2.s;
1905 else if(op2.kind == 2)
1906 *value2 = (intptr_t)op2.us;
1907 else if(op2.kind == 1 && op2.type->isSigned)
1908 *value2 = (intptr_t)op2.c;
1909 else if(op2.kind == 1)
1910 *value2 = (intptr_t)op2.uc;
1911 else if(op2.kind == 6)
1912 *value2 = (intptr_t)op2.f;
1913 else if(op2.kind == 7)
1914 *value2 = (intptr_t)op2.d;
1915 else if(op2.kind == 13)
1916 *value2 = (intptr_t)op2.ui;
1922 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1924 struct Operand op2 = GetOperand(exp);
1926 if(op2.kind == 3 && op2.type->isSigned)
1927 *value2 = (uintptr_t)op2.i;
1928 else if(op2.kind == 3)
1929 *value2 = (uintptr_t)op2.ui;
1930 if(op2.kind == 4 && op2.type->isSigned)
1931 *value2 = (uintptr_t)op2.i64;
1932 else if(op2.kind == 4)
1933 *value2 = (uintptr_t)op2.ui64;
1934 else if(op2.kind == 22 && op2.type->isSigned)
1935 *value2 = (uintptr_t)op2.iptr;
1936 else if(op2.kind == 22)
1937 *value2 = op2.uiptr;
1938 else if(op2.kind == 2 && op2.type->isSigned)
1939 *value2 = (uintptr_t)op2.s;
1940 else if(op2.kind == 2)
1941 *value2 = (uintptr_t)op2.us;
1942 else if(op2.kind == 1 && op2.type->isSigned)
1943 *value2 = (uintptr_t)op2.c;
1944 else if(op2.kind == 1)
1945 *value2 = (uintptr_t)op2.uc;
1946 else if(op2.kind == 6)
1947 *value2 = (uintptr_t)op2.f;
1948 else if(op2.kind == 7)
1949 *value2 = (uintptr_t)op2.d;
1950 else if(op2.kind == 13)
1951 *value2 = (uintptr_t)op2.ui;
1957 unsigned int GetShort(struct Expression * exp, short * value2)
1959 struct Operand op2 = GetOperand(exp);
1961 if(op2.kind == 3 && op2.type->isSigned)
1962 *value2 = (short)op2.i;
1963 else if(op2.kind == 3)
1964 *value2 = (short)op2.ui;
1965 if(op2.kind == 4 && op2.type->isSigned)
1966 *value2 = (short)op2.i64;
1967 else if(op2.kind == 4)
1968 *value2 = (short)op2.ui64;
1969 else if(op2.kind == 22 && op2.type->isSigned)
1970 *value2 = (short)op2.iptr;
1971 else if(op2.kind == 22)
1972 *value2 = (short)op2.uiptr;
1973 else if(op2.kind == 2 && op2.type->isSigned)
1975 else if(op2.kind == 2)
1976 *value2 = (short)op2.us;
1977 else if(op2.kind == 1 && op2.type->isSigned)
1978 *value2 = (short)op2.c;
1979 else if(op2.kind == 1)
1980 *value2 = (short)op2.uc;
1981 else if(op2.kind == 6)
1982 *value2 = (short)op2.f;
1983 else if(op2.kind == 7)
1984 *value2 = (short)op2.d;
1985 else if(op2.kind == 13)
1986 *value2 = (short)op2.ui;
1992 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1994 struct Operand op2 = GetOperand(exp);
1996 if(op2.kind == 3 && op2.type->isSigned)
1997 *value2 = (unsigned short)op2.i;
1998 else if(op2.kind == 3)
1999 *value2 = (unsigned short)op2.ui;
2000 if(op2.kind == 4 && op2.type->isSigned)
2001 *value2 = (unsigned short)op2.i64;
2002 else if(op2.kind == 4)
2003 *value2 = (unsigned short)op2.ui64;
2004 else if(op2.kind == 22 && op2.type->isSigned)
2005 *value2 = (unsigned short)op2.iptr;
2006 else if(op2.kind == 22)
2007 *value2 = (unsigned short)op2.uiptr;
2008 else if(op2.kind == 2 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.s;
2010 else if(op2.kind == 2)
2012 else if(op2.kind == 1 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.c;
2014 else if(op2.kind == 1)
2015 *value2 = (unsigned short)op2.uc;
2016 else if(op2.kind == 6)
2017 *value2 = (unsigned short)op2.f;
2018 else if(op2.kind == 7)
2019 *value2 = (unsigned short)op2.d;
2020 else if(op2.kind == 13)
2021 *value2 = (unsigned short)op2.ui;
2027 unsigned int GetChar(struct Expression * exp, char * value2)
2029 struct Operand op2 = GetOperand(exp);
2031 if(op2.kind == 3 && op2.type->isSigned)
2032 *value2 = (char)op2.i;
2033 else if(op2.kind == 3)
2034 *value2 = (char)op2.ui;
2035 if(op2.kind == 4 && op2.type->isSigned)
2036 *value2 = (char)op2.i64;
2037 else if(op2.kind == 4)
2038 *value2 = (char)op2.ui64;
2039 else if(op2.kind == 22 && op2.type->isSigned)
2040 *value2 = (char)op2.iptr;
2041 else if(op2.kind == 22)
2042 *value2 = (char)op2.uiptr;
2043 else if(op2.kind == 2 && op2.type->isSigned)
2044 *value2 = (char)op2.s;
2045 else if(op2.kind == 2)
2046 *value2 = (char)op2.us;
2047 else if(op2.kind == 1 && op2.type->isSigned)
2049 else if(op2.kind == 1)
2050 *value2 = (char)op2.uc;
2051 else if(op2.kind == 6)
2052 *value2 = (char)op2.f;
2053 else if(op2.kind == 7)
2054 *value2 = (char)op2.d;
2055 else if(op2.kind == 13)
2056 *value2 = (char)op2.ui;
2062 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2064 struct Operand op2 = GetOperand(exp);
2066 if(op2.kind == 3 && op2.type->isSigned)
2067 *value2 = (unsigned char)op2.i;
2068 else if(op2.kind == 3)
2069 *value2 = (unsigned char)op2.ui;
2070 if(op2.kind == 4 && op2.type->isSigned)
2071 *value2 = (unsigned char)op2.i64;
2072 else if(op2.kind == 4)
2073 *value2 = (unsigned char)op2.ui64;
2074 else if(op2.kind == 22 && op2.type->isSigned)
2075 *value2 = (unsigned char)op2.iptr;
2076 else if(op2.kind == 22)
2077 *value2 = (unsigned char)op2.uiptr;
2078 else if(op2.kind == 2 && op2.type->isSigned)
2079 *value2 = (unsigned char)op2.s;
2080 else if(op2.kind == 2)
2081 *value2 = (unsigned char)op2.us;
2082 else if(op2.kind == 1 && op2.type->isSigned)
2083 *value2 = (unsigned char)op2.c;
2084 else if(op2.kind == 1)
2086 else if(op2.kind == 6)
2087 *value2 = (unsigned char)op2.f;
2088 else if(op2.kind == 7)
2089 *value2 = (unsigned char)op2.d;
2090 else if(op2.kind == 13)
2091 *value2 = (unsigned char)op2.ui;
2097 unsigned int GetFloat(struct Expression * exp, float * value2)
2099 struct Operand op2 = GetOperand(exp);
2101 if(op2.kind == 3 && op2.type->isSigned)
2102 *value2 = (float)(float)op2.i;
2103 else if(op2.kind == 3)
2104 *value2 = (float)(float)op2.ui;
2105 if(op2.kind == 4 && op2.type->isSigned)
2106 *value2 = (float)(float)op2.i64;
2107 else if(op2.kind == 4)
2108 *value2 = (float)(float)op2.ui64;
2109 else if(op2.kind == 22 && op2.type->isSigned)
2110 *value2 = (float)op2.iptr;
2111 else if(op2.kind == 22)
2112 *value2 = (float)op2.uiptr;
2113 else if(op2.kind == 2 && op2.type->isSigned)
2114 *value2 = (float)(float)op2.s;
2115 else if(op2.kind == 2)
2116 *value2 = (float)(float)op2.us;
2117 else if(op2.kind == 1 && op2.type->isSigned)
2118 *value2 = (float)(float)op2.c;
2119 else if(op2.kind == 1)
2120 *value2 = (float)(float)op2.uc;
2121 else if(op2.kind == 6)
2122 *value2 = (float)op2.f;
2123 else if(op2.kind == 7)
2124 *value2 = (float)op2.d;
2125 else if(op2.kind == 13)
2126 *value2 = (float)(float)op2.ui;
2132 unsigned int GetDouble(struct Expression * exp, double * value2)
2134 struct Operand op2 = GetOperand(exp);
2136 if(op2.kind == 3 && op2.type->isSigned)
2137 *value2 = (double)(double)op2.i;
2138 else if(op2.kind == 3)
2139 *value2 = (double)(double)op2.ui;
2140 if(op2.kind == 4 && op2.type->isSigned)
2141 *value2 = (double)(double)op2.i64;
2142 else if(op2.kind == 4)
2143 *value2 = (double)(double)op2.ui64;
2144 else if(op2.kind == 22 && op2.type->isSigned)
2145 *value2 = (double)op2.iptr;
2146 else if(op2.kind == 22)
2147 *value2 = (double)op2.uiptr;
2148 else if(op2.kind == 2 && op2.type->isSigned)
2149 *value2 = (double)(double)op2.s;
2150 else if(op2.kind == 2)
2151 *value2 = (double)(double)op2.us;
2152 else if(op2.kind == 1 && op2.type->isSigned)
2153 *value2 = (double)(double)op2.c;
2154 else if(op2.kind == 1)
2155 *value2 = (double)(double)op2.uc;
2156 else if(op2.kind == 6)
2157 *value2 = (double)op2.f;
2158 else if(op2.kind == 7)
2159 *value2 = (double)op2.d;
2160 else if(op2.kind == 13)
2161 *value2 = (double)(double)op2.ui;
2167 void ComputeExpression(struct Expression * exp);
2169 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2171 int ComputeTypeSize(struct Type * type);
2173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2175 struct __ecereNameSpace__ecere__com__BitMember
2177 struct __ecereNameSpace__ecere__com__BitMember * prev;
2178 struct __ecereNameSpace__ecere__com__BitMember * next;
2180 unsigned int isProperty;
2183 struct __ecereNameSpace__ecere__com__Class * _class;
2184 char * dataTypeString;
2185 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2186 struct Type * dataType;
2191 } __attribute__ ((gcc_struct));
2193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2195 struct __ecereNameSpace__ecere__sys__OldLink
2197 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2198 struct __ecereNameSpace__ecere__sys__OldLink * next;
2200 } __attribute__ ((gcc_struct));
2202 void FinishTemplatesContext(struct Context * context);
2204 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2206 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2207 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2209 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2212 int unionMemberOffset = 0;
2215 if(!member && _class->destructionWatchOffset)
2216 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2218 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2220 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2222 if(!dataMember->isProperty)
2224 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2226 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2232 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2234 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2236 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2238 if(!isMember && _class->type == 2 && dataMember->dataType)
2240 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2244 ComputeTypeSize(dataMember->dataType);
2245 if(bitMember->pos == -1)
2246 bitMember->pos = _class->memberOffset;
2247 if(!bitMember->size)
2248 bitMember->size = dataMember->dataType->size * 8;
2249 _class->memberOffset = bitMember->pos + bitMember->size;
2250 for(d = 0; d < bitMember->size; d++)
2256 bitMember->mask = mask << bitMember->pos;
2258 else if(dataMember->type == 0 && dataMember->dataType)
2263 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2264 ComputeTypeSize(dataMember->dataType);
2265 if(dataMember->dataType->bitFieldCount)
2267 bitFields += dataMember->dataType->bitFieldCount;
2274 int size = (bitFields + 7) / 8;
2278 int __simpleStruct0;
2282 int __simpleStruct0;
2284 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2285 if(member->memberOffset % alignment)
2286 member->memberOffset += alignment - (member->memberOffset % alignment);
2288 dataMember->offset = member->memberOffset;
2289 if(member->type == 1)
2290 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2293 member->memberOffset += size;
2300 int __simpleStruct0;
2302 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2303 if(_class->memberOffset % alignment)
2304 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2306 dataMember->offset = _class->memberOffset;
2307 _class->memberOffset += size;
2311 size = dataMember->dataType->size;
2312 alignment = dataMember->dataType->alignment;
2316 int __simpleStruct0;
2320 int __simpleStruct0;
2322 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2323 if(member->memberOffset % alignment)
2324 member->memberOffset += alignment - (member->memberOffset % alignment);
2326 dataMember->offset = member->memberOffset;
2327 if(member->type == 1)
2328 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2331 member->memberOffset += size;
2338 int __simpleStruct0;
2340 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2341 if(_class->memberOffset % alignment)
2342 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2344 dataMember->offset = _class->memberOffset;
2345 _class->memberOffset += size;
2350 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2353 int __simpleStruct2;
2354 int __simpleStruct0, __simpleStruct1;
2356 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2357 dataMember->offset = member->memberOffset;
2358 if(member->type == 1)
2359 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2361 member->memberOffset += dataMember->memberOffset;
2365 int __simpleStruct0, __simpleStruct1;
2367 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2368 dataMember->offset = _class->memberOffset;
2369 _class->memberOffset += dataMember->memberOffset;
2377 int size = (bitFields + 7) / 8;
2381 int __simpleStruct0;
2385 int __simpleStruct0;
2387 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2388 if(member->memberOffset % alignment)
2389 member->memberOffset += alignment - (member->memberOffset % alignment);
2391 if(member->type == 1)
2392 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2395 member->memberOffset += size;
2402 int __simpleStruct0;
2404 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2405 if(_class->memberOffset % alignment)
2406 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2408 _class->memberOffset += size;
2413 if(member && member->type == 1)
2415 member->memberOffset = unionMemberOffset;
2419 if(_class->type != 2)
2421 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2424 struct __ecereNameSpace__ecere__com__Property * prop;
2426 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2428 if(prop->isProperty && prop->isWatchable)
2430 prop->watcherOffset = _class->structSize;
2431 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2436 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2438 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2440 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2442 if(deriv->computeSize)
2444 deriv->offset = _class->structSize;
2445 deriv->memberOffset = 0;
2446 deriv->structSize = deriv->offset;
2447 ComputeClassMembers(deriv, 0x0);
2455 FinishTemplatesContext(context);
2458 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2460 struct __ecereNameSpace__ecere__com__NameSpace
2463 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2464 struct __ecereNameSpace__ecere__com__NameSpace * left;
2465 struct __ecereNameSpace__ecere__com__NameSpace * right;
2467 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2468 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2469 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2470 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2471 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2472 } __attribute__ ((gcc_struct));
2474 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2476 struct __ecereNameSpace__ecere__com__Module
2478 struct __ecereNameSpace__ecere__com__Instance * application;
2479 struct __ecereNameSpace__ecere__sys__OldList classes;
2480 struct __ecereNameSpace__ecere__sys__OldList defines;
2481 struct __ecereNameSpace__ecere__sys__OldList functions;
2482 struct __ecereNameSpace__ecere__sys__OldList modules;
2483 struct __ecereNameSpace__ecere__com__Instance * prev;
2484 struct __ecereNameSpace__ecere__com__Instance * next;
2490 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2491 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2492 } __attribute__ ((gcc_struct));
2494 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2496 struct __ecereNameSpace__ecere__com__Class * _class;
2497 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2499 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2500 ComputeModuleClasses(subModule->data);
2501 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2502 ComputeClassMembers(_class, 0x0);
2505 extern unsigned int inCompiler;
2507 extern void Compiler_Error(char * format, ...);
2509 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2511 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2513 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2515 int ComputeTypeSize(struct Type * type)
2517 unsigned int size = type ? type->size : 0;
2519 if(!size && type && !type->computing)
2521 type->computing = 0x1;
2525 type->alignment = size = sizeof(char);
2528 type->alignment = size = sizeof(int);
2531 type->alignment = size = sizeof(long long);
2534 type->alignment = size = sizeof(intptr_t);
2537 type->alignment = size = sizeof(long);
2540 type->alignment = size = sizeof(short);
2543 type->alignment = size = sizeof(float);
2546 type->alignment = size = sizeof(double);
2550 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2552 if(_class && _class->type == 1)
2554 ComputeClassMembers(_class, 0x0);
2555 type->alignment = _class->structAlignment;
2556 size = _class->structSize;
2557 if(type->alignment && size % type->alignment)
2558 size += type->alignment - (size % type->alignment);
2560 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2562 if(!_class->dataType)
2563 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2564 size = type->alignment = ComputeTypeSize(_class->dataType);
2567 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2572 size = type->alignment = sizeof(void *);
2575 if(type->arraySizeExp)
2577 ProcessExpressionType(type->arraySizeExp);
2578 ComputeExpression(type->arraySizeExp);
2579 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)))
2581 struct Location oldLoc = yylloc;
2582 char expression[10240];
2584 expression[0] = '\0';
2585 type->arraySizeExp->expType = (((void *)0));
2586 yylloc = type->arraySizeExp->loc;
2588 PrintExpression(type->arraySizeExp, expression);
2589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2592 GetInt(type->arraySizeExp, &type->arraySize);
2594 else if(type->enumClass)
2596 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2598 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2601 type->arraySize = 0;
2605 type->arraySize = 0;
2607 size = ComputeTypeSize(type->type) * type->arraySize;
2608 type->alignment = type->type->alignment;
2612 struct Type * member;
2614 for(member = type->members.first; member; member = member->next)
2616 int __simpleStruct0, __simpleStruct1;
2617 unsigned int addSize = ComputeTypeSize(member);
2619 member->offset = size;
2620 if(member->alignment && size % member->alignment)
2621 member->offset += member->alignment - (size % member->alignment);
2622 size = member->offset;
2623 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2626 if(type->alignment && size % type->alignment)
2627 size += type->alignment - (size % type->alignment);
2632 struct Type * member;
2634 for(member = type->members.first; member; member = member->next)
2636 int __simpleStruct0, __simpleStruct1;
2637 unsigned int addSize = ComputeTypeSize(member);
2639 member->offset = size;
2640 if(member->alignment && size % member->alignment)
2641 member->offset += member->alignment - (size % member->alignment);
2642 size = member->offset;
2643 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2644 size = ((size > addSize) ? size : addSize);
2646 if(type->alignment && size % type->alignment)
2647 size += type->alignment - (size % type->alignment);
2652 struct TemplateParameter * param = type->templateParameter;
2653 struct Type * baseType = ProcessTemplateParameterType(param);
2656 size = ComputeTypeSize(baseType);
2658 size = sizeof(uint64);
2671 size = sizeof(void *);
2676 type->computing = 0x0;
2681 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2683 extern struct Identifier * MkIdentifier(char * string);
2685 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2687 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2689 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2691 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2693 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2695 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2697 extern void FreeType(struct Type * type);
2699 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2701 extern struct Specifier * MkSpecifier(int specifier);
2703 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2705 extern struct Expression * MkExpConstant(char * string);
2707 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)
2709 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2710 unsigned int totalSize = 0;
2711 unsigned int maxSize = 0;
2712 int alignment, size;
2713 struct __ecereNameSpace__ecere__com__DataMember * member;
2714 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2716 if(!isMember && _class->base)
2718 maxSize = _class->structSize;
2720 if(_class->type == 1 || _class->type == 5)
2721 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2723 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2726 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2728 if(!member->isProperty)
2730 switch(member->type)
2734 if(member->dataTypeString)
2736 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2737 struct Declarator * decl;
2739 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2740 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2741 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2742 if(!member->dataType)
2743 member->dataType = ProcessType(specs, decl);
2744 ReplaceThisClassSpecifiers(specs, topClass);
2746 struct Type * type = ProcessType(specs, decl);
2748 DeclareType(member->dataType, 0x0, 0x0);
2751 ComputeTypeSize(member->dataType);
2752 size = member->dataType->size;
2753 alignment = member->dataType->alignment;
2756 if(totalSize % alignment)
2757 totalSize += alignment - (totalSize % alignment);
2766 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2769 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2770 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2771 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2772 alignment = member->structAlignment;
2775 if(totalSize % alignment)
2776 totalSize += alignment - (totalSize % alignment);
2786 unsigned int __simpleStruct0;
2788 if(topMember && topMember->type == 1)
2789 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2791 *retSize += totalSize;
2793 else if(totalSize < maxSize && _class->type != 1000)
2795 char sizeString[50];
2797 sprintf(sizeString, "%d", maxSize - totalSize);
2798 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2801 FinishTemplatesContext(context);
2802 return topMember ? topMember->memberID : _class->memberID;
2805 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2807 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2808 unsigned int totalSize = 0;
2809 struct __ecereNameSpace__ecere__com__DataMember * member;
2810 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2812 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2813 DeclareMembers(_class->base, 0x0);
2814 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2816 if(!member->isProperty)
2818 switch(member->type)
2822 if(!member->dataType && member->dataTypeString)
2823 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2824 if(member->dataType)
2825 DeclareType(member->dataType, 0x0, 0x0);
2831 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2838 FinishTemplatesContext(context);
2839 return topMember ? topMember->memberID : _class->memberID;
2842 extern struct Symbol * FindClass(char * name);
2844 extern char * strchr(char * , int);
2846 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2848 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2850 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2852 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2854 extern char * strcpy(char * , const char * );
2856 extern void MangleClassName(char * className);
2858 extern void DeclareClass(struct Symbol * classSym, char * className);
2860 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2862 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2864 void DeclareStruct(char * name, unsigned int skipNoHead)
2866 struct External * external = (((void *)0));
2867 struct Symbol * classSym = FindClass(name);
2869 if(!inCompiler || !classSym)
2870 return (((void *)0));
2871 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2872 return (((void *)0));
2873 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2875 struct Declaration * decl;
2876 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2877 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2878 char structName[1024];
2880 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2881 classSym->declaring++;
2882 if(strchr(classSym->string, '<'))
2884 if(classSym->registered->templateClass)
2886 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2887 classSym->declaring--;
2889 return (((void *)0));
2891 DeclareMembers(classSym->registered, 0x0);
2892 structName[0] = (char)0;
2893 FullClassNameCat(structName, name, 0x0);
2896 classSym->declaredStructSym = 0x1;
2897 declarations = MkList();
2898 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2899 if(!(*declarations).count)
2901 FreeList(declarations, (((void *)0)));
2902 declarations = (((void *)0));
2905 if(skipNoHead || declarations)
2907 if(external && external->declaration)
2909 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2910 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2912 if(classSym->structExternal)
2913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2915 classSym->id = curExternal->symbol->idCode;
2916 classSym->idCode = curExternal->symbol->idCode;
2922 external = MkExternalDeclaration((((void *)0)));
2923 specifiers = MkList();
2924 declarators = MkList();
2925 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2926 external->declaration = decl = MkDeclaration(specifiers, declarators);
2927 if(decl->symbol && !decl->symbol->pointerExternal)
2928 decl->symbol->pointerExternal = external;
2929 if(classSym->registered && classSym->registered->type == 1)
2931 char className[1024];
2933 strcpy(className, "__ecereClass_");
2934 FullClassNameCat(className, classSym->string, 0x1);
2935 MangleClassName(className);
2936 DeclareClass(classSym, className);
2937 external->symbol = classSym;
2938 classSym->pointerExternal = external;
2939 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2940 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2944 char className[1024];
2946 strcpy(className, "__ecereClass_");
2947 FullClassNameCat(className, classSym->string, 0x1);
2948 MangleClassName(className);
2949 classSym->structExternal = external;
2950 DeclareClass(classSym, className);
2951 external->symbol = classSym;
2953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2956 classSym->declaring--;
2958 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2960 classSym->declaring++;
2962 if(classSym->registered)
2963 DeclareMembers(classSym->registered, 0x0);
2965 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2967 if(classSym->structExternal)
2968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2970 classSym->id = curExternal->symbol->idCode;
2971 classSym->idCode = curExternal->symbol->idCode;
2973 classSym->declaring--;
2977 extern char * strcat(char * , const char * );
2979 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2981 extern struct ModuleImport * mainModule;
2983 extern struct Specifier * MkSpecifierName(char * name);
2985 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2987 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2989 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2991 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2993 extern void FreeDeclarator(struct Declarator * decl);
2995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2997 struct PropertyImport
2999 struct PropertyImport * prev;
3000 struct PropertyImport * next;
3002 unsigned int isVirtual;
3003 unsigned int hasSet;
3004 unsigned int hasGet;
3005 } __attribute__ ((gcc_struct));
3007 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3009 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3011 void * __ecereTemp1;
3012 struct Symbol * symbol = prop->symbol;
3013 char propName[1024];
3015 strcpy(setName, "__ecereProp_");
3016 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3017 strcat(setName, "_Set_");
3018 FullClassNameCat(setName, prop->name, 0x1);
3019 strcpy(getName, "__ecereProp_");
3020 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3021 strcat(getName, "_Get_");
3022 FullClassNameCat(getName, prop->name, 0x1);
3023 strcpy(propName, "__ecereProp_");
3024 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3025 strcat(propName, "_");
3026 FullClassNameCat(propName, prop->name, 0x1);
3027 MangleClassName(getName);
3028 MangleClassName(setName);
3029 MangleClassName(propName);
3030 if(prop->_class->type == 1)
3031 DeclareStruct(prop->_class->fullName, 0x0);
3032 if(!symbol || curExternal->symbol->idCode < symbol->id)
3034 unsigned int imported = 0x0;
3035 unsigned int dllImport = 0x0;
3037 if(!symbol || symbol->_import)
3041 struct Symbol * classSym;
3043 if(!prop->_class->symbol)
3044 prop->_class->symbol = FindClass(prop->_class->fullName);
3045 classSym = prop->_class->symbol;
3046 if(classSym && !classSym->_import)
3048 struct ModuleImport * module;
3050 if(prop->_class->module)
3051 module = FindModule(prop->_class->module);
3053 module = mainModule;
3054 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));
3055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3057 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3058 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));
3060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3063 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3068 struct Context * context = SetupTemplatesContext(prop->_class);
3070 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3071 FinishTemplatesContext(context);
3075 if(!symbol->externalGet || symbol->externalGet->type == 0)
3077 struct Declaration * decl;
3078 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3079 struct Declarator * d;
3080 struct __ecereNameSpace__ecere__sys__OldList * params;
3081 struct Specifier * spec;
3082 struct External * external;
3083 struct Declarator * typeDecl;
3084 unsigned int simple = 0x0;
3086 specifiers = MkList();
3087 declarators = MkList();
3089 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3090 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3092 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3094 struct Context * context = SetupTemplatesContext(prop->_class);
3096 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3097 FinishTemplatesContext(context);
3099 for(spec = (*specifiers).first; spec; spec = spec->next)
3103 if((!typeDecl || typeDecl->type == 1))
3105 struct Symbol * classSym = spec->symbol;
3107 symbol->_class = classSym->registered;
3108 if(classSym->registered && classSym->registered->type == 1)
3110 DeclareStruct(spec->name, 0x0);
3117 d = PlugDeclarator(typeDecl, d);
3120 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3121 specifiers = MkList();
3123 d = MkDeclaratorFunction(d, params);
3125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3126 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3129 ListAdd(specifiers, MkSpecifier(VOID));
3130 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3131 decl = MkDeclaration(specifiers, declarators);
3132 external = MkExternalDeclaration(decl);
3133 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3134 external->symbol = symbol;
3135 symbol->externalGet = external;
3136 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3138 FreeDeclarator(typeDecl);
3142 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3147 if(!symbol->externalSet || symbol->externalSet->type == 0)
3149 struct Declaration * decl;
3150 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3151 struct Declarator * d;
3152 struct __ecereNameSpace__ecere__sys__OldList * params;
3153 struct Specifier * spec;
3154 struct External * external;
3155 struct Declarator * typeDecl;
3157 declarators = MkList();
3159 if(!prop->conversion || prop->_class->type == 1)
3161 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3163 specifiers = MkList();
3165 struct Context * context = SetupTemplatesContext(prop->_class);
3167 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3168 FinishTemplatesContext(context);
3170 ListAdd(params, MkTypeName(specifiers, d));
3171 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3173 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3174 d = MkDeclaratorFunction(d, params);
3175 for(spec = (*specifiers).first; spec; spec = spec->next)
3179 if((!typeDecl || typeDecl->type == 1))
3181 struct Symbol * classSym = spec->symbol;
3183 symbol->_class = classSym->registered;
3184 if(classSym->registered && classSym->registered->type == 1)
3185 DeclareStruct(spec->name, 0x0);
3189 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3190 specifiers = MkList();
3192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3193 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3195 if(!prop->conversion || prop->_class->type == 1)
3196 ListAdd(specifiers, MkSpecifier(VOID));
3198 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3199 decl = MkDeclaration(specifiers, declarators);
3200 external = MkExternalDeclaration(decl);
3201 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3202 external->symbol = symbol;
3203 symbol->externalSet = external;
3204 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3208 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3211 if(!symbol->externalPtr)
3213 struct Declaration * decl;
3214 struct External * external;
3215 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3221 ListAdd(specifiers, MkSpecifierName("Property"));
3223 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3225 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3228 strcpy(propName, "__ecerePropM_");
3229 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3230 strcat(propName, "_");
3231 FullClassNameCat(propName, prop->name, 0x1);
3232 MangleClassName(propName);
3233 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3235 decl = MkDeclaration(specifiers, list);
3237 external = MkExternalDeclaration(decl);
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3239 external->symbol = symbol;
3240 symbol->externalPtr = external;
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3246 symbol->id = curExternal->symbol->idCode;
3250 struct Type * Dereference(struct Type * source)
3252 void * __ecereTemp1;
3253 struct Type * type = (((void *)0));
3257 if(source->kind == 13 || source->kind == 12)
3259 type = source->type;
3260 source->type->refCount++;
3262 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3264 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3266 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3277 static struct Type * Reference(struct Type * source)
3279 void * __ecereTemp1;
3280 struct Type * type = (((void *)0));
3284 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));
3290 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);
3292 extern void * memcpy(void * , const void * , unsigned int size);
3294 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3296 extern void FreeExpression(struct Expression * exp);
3298 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3300 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);
3302 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3304 extern struct Type * MkClassType(char * name);
3306 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);
3308 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)
3310 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3311 unsigned int found = 0x0;
3312 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3313 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3314 unsigned int freeType = 0x0;
3316 yylloc = member->loc;
3321 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3325 dataMember = *curMember;
3331 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3332 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3333 int _subMemberStackPos = 0;
3336 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3339 dataMember = thisMember;
3340 if(curMember && thisMember->memberAccess == 1)
3342 *curMember = thisMember;
3343 *curClass = thisMember->_class;
3344 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3345 *subMemberStackPos = _subMemberStackPos;
3351 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3352 if(method && method->type == 1)
3355 method = (((void *)0));
3360 struct Type * type = (((void *)0));
3364 if(!dataMember->dataType && dataMember->dataTypeString)
3366 struct Context * context = SetupTemplatesContext(_class);
3368 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3369 FinishTemplatesContext(context);
3371 type = dataMember->dataType;
3375 if(!method->dataType)
3376 ProcessMethodType(method);
3377 type = method->dataType;
3379 if(ident && ident->next)
3381 for(ident = ident->next; ident && type; ident = ident->next)
3385 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3387 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3389 type = dataMember->dataType;
3391 else if(type->kind == 9 || type->kind == 10)
3393 struct Type * memberType;
3395 for(memberType = type->members.first; memberType; memberType = memberType->next)
3397 if(!strcmp(memberType->name, ident->string))
3406 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3409 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3410 struct __ecereNameSpace__ecere__com__Class * sClass;
3412 for(sClass = _class; sClass; sClass = sClass->base)
3415 if(sClass->templateClass)
3416 sClass = sClass->templateClass;
3417 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3419 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3421 for(sClass = sClass->base; sClass; sClass = sClass->base)
3423 if(sClass->templateClass)
3424 sClass = sClass->templateClass;
3425 id += sClass->templateParams.count;
3436 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3438 if(arg.dataTypeString)
3440 type = ProcessTypeString(arg.dataTypeString, 0x0);
3442 if(type && _class->templateClass)
3443 type->passAsTemplate = 0x1;
3450 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3452 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3453 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3457 char templateString[1024];
3458 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3460 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3461 for(cClass = expClass; cClass; cClass = cClass->base)
3465 if(cClass->templateClass)
3466 cClass = cClass->templateClass;
3467 for(param = cClass->templateParams.first; param; param = param->next)
3470 struct __ecereNameSpace__ecere__com__Class * sClass;
3471 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3473 for(sClass = cClass->base; sClass; sClass = sClass->base)
3475 if(sClass->templateClass)
3476 sClass = sClass->templateClass;
3477 id += sClass->templateParams.count;
3479 arg = expClass->templateArgs[id];
3480 for(sClass = _class; sClass; sClass = sClass->base)
3482 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3484 struct __ecereNameSpace__ecere__com__Class * nextClass;
3486 if(sClass->templateClass)
3487 sClass = sClass->templateClass;
3488 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3490 if(nextClass->templateClass)
3491 nextClass = nextClass->templateClass;
3492 p += nextClass->templateParams.count;
3494 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3496 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3498 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3500 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3501 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3515 char expString[1024];
3516 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3517 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3518 struct Expression * exp;
3519 char * string = PrintHexUInt64(arg.expression.ui64);
3521 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3522 ProcessExpressionType(exp);
3523 ComputeExpression(exp);
3524 expString[0] = '\0';
3525 PrintExpression(exp, expString);
3526 strcat(argument, expString);
3527 FreeExpression(exp);
3532 strcat(argument, arg.member->name);
3537 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3538 strcat(argument, arg.dataTypeString);
3545 strcat(templateString, ", ");
3546 if(lastParam != p - 1)
3548 strcat(templateString, param->name);
3549 strcat(templateString, " = ");
3551 strcat(templateString, argument);
3560 int len = strlen(templateString);
3562 if(templateString[len - 1] == '<')
3566 if(templateString[len - 1] == '>')
3567 templateString[len++] = ' ';
3568 templateString[len++] = '>';
3570 templateString[len++] = '\0';
3573 struct Context * context = SetupTemplatesContext(_class);
3577 type = ProcessTypeString(templateString, 0x0);
3579 FinishTemplatesContext(context);
3582 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3584 ProcessExpressionType(member->initializer->exp);
3585 if(!member->initializer->exp->expType)
3589 char expString[10240];
3591 expString[0] = '\0';
3592 PrintExpression(member->initializer->exp, expString);
3593 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3597 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3602 else if(member->initializer)
3604 ProcessInitializer(member->initializer, type);
3611 if(_class && _class->type == 3)
3613 if(member->initializer)
3615 struct Type * type = MkClassType(_class->fullName);
3617 ProcessInitializer(member->initializer, type);
3623 if(member->initializer)
3625 ProcessInitializer(member->initializer, (((void *)0)));
3631 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3635 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3637 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3646 extern struct Identifier * GetDeclId(struct Declarator * decl);
3648 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);
3650 extern void FreeSpecifier(struct Specifier * spec);
3652 static void ProcessFunction(struct FunctionDefinition * function);
3654 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3656 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3658 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3660 extern void FreeClassFunction(struct ClassFunction * func);
3662 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3664 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3666 void ProcessInstantiationType(struct Instantiation * inst)
3671 struct MembersInit * members;
3672 struct Symbol * classSym;
3673 struct __ecereNameSpace__ecere__com__Class * _class;
3675 classSym = inst->_class->symbol;
3676 _class = classSym ? classSym->registered : (((void *)0));
3677 if(!_class || _class->type != 5)
3678 DeclareStruct(inst->_class->name, 0x0);
3679 afterExternal = afterExternal ? afterExternal : curExternal;
3681 ProcessExpressionType(inst->exp);
3682 inst->isConstant = 0x1;
3685 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3686 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3687 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3688 int subMemberStackPos = 0;
3690 for(members = (*inst->members).first; members; members = members->next)
3692 switch(members->type)
3697 static unsigned int instMethodID = 0;
3698 struct External * external = curExternal;
3699 struct Context * context = curContext;
3700 struct Declarator * declarator = members->function->declarator;
3701 struct Identifier * nameID = GetDeclId(declarator);
3702 char * unmangled = nameID ? nameID->string : (((void *)0));
3703 struct Expression * exp;
3704 struct External * createdExternal = (((void *)0));
3710 strcpy(name, "__ecereInstMeth_");
3711 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3713 strcat(name, nameID->string);
3715 sprintf(number, "_%08d", instMethodID++);
3716 strcat(name, number);
3717 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3721 struct Symbol * symbol = declarator->symbol;
3722 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3724 if(method && method->type == 1)
3726 symbol->method = method;
3727 ProcessMethodType(method);
3728 if(!symbol->type->thisClass)
3730 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3732 if(!currentClass->symbol)
3733 currentClass->symbol = FindClass(currentClass->fullName);
3734 symbol->type->thisClass = currentClass->symbol;
3739 _class->symbol = FindClass(_class->fullName);
3740 symbol->type->thisClass = _class->symbol;
3743 DeclareType(symbol->type, 0x1, 0x1);
3747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3750 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3753 FreeSpecifier(nameID->_class);
3754 nameID->_class = (((void *)0));
3758 struct Type * type = declarator->symbol->type;
3759 struct External * oldExternal = curExternal;
3761 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3763 struct External * externalDecl;
3765 externalDecl = MkExternalDeclaration((((void *)0)));
3766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3767 if(createdExternal->function)
3769 ProcessFunction(createdExternal->function);
3771 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3773 externalDecl->declaration = decl;
3774 if(decl->symbol && !decl->symbol->pointerExternal)
3775 decl->symbol->pointerExternal = externalDecl;
3776 declarator->symbol->pointerExternal = externalDecl;
3783 curExternal = declarator->symbol->pointerExternal;
3784 ProcessFunction((struct FunctionDefinition *)members->function);
3786 curExternal = external;
3787 curContext = context;
3790 FreeClassFunction(members->function);
3791 exp = QMkExpId(name);
3793 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3794 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3800 if(members->dataMembers && classSym)
3802 struct MemberInit * member;
3803 struct Location oldyyloc = yylloc;
3805 for(member = (*members->dataMembers).first; member; member = member->next)
3807 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3808 if(member->initializer && !member->initializer->isConstant)
3809 inst->isConstant = 0x0;
3821 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3825 if(type->kind == 11)
3827 struct Type * param;
3831 for(param = type->params.first; param; param = param->next)
3832 DeclareType(param, declarePointers, 0x1);
3834 DeclareType(type->returnType, declarePointers, 0x1);
3836 else if(type->kind == 13 && declarePointers)
3837 DeclareType(type->type, declarePointers, 0x0);
3838 else if(type->kind == 8)
3840 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3841 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3843 else if(type->kind == 9 || type->kind == 10)
3845 struct Type * member;
3847 for(member = type->members.first; member; member = member->next)
3848 DeclareType(member, 0x0, 0x0);
3850 else if(type->kind == 12)
3851 DeclareType(type->arrayType, declarePointers, 0x0);
3855 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3857 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3861 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3862 struct __ecereNameSpace__ecere__com__Class * sClass;
3864 for(sClass = _class; sClass; sClass = sClass->base)
3867 if(sClass->templateClass)
3868 sClass = sClass->templateClass;
3869 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3871 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3873 for(sClass = sClass->base; sClass; sClass = sClass->base)
3875 if(sClass->templateClass)
3876 sClass = sClass->templateClass;
3877 id += sClass->templateParams.count;
3888 arg = &_class->templateArgs[id];
3889 if(arg && param->type == 0)
3890 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3895 extern struct Context * PushContext(void);
3897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3899 struct TemplatedType
3902 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3903 struct __ecereNameSpace__ecere__sys__BTNode * left;
3904 struct __ecereNameSpace__ecere__sys__BTNode * right;
3906 struct TemplateParameter * param;
3907 } __attribute__ ((gcc_struct));
3909 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3911 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3913 void * __ecereTemp1;
3914 struct Context * context = PushContext();
3916 context->templateTypesOnly = 0x1;
3917 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3919 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3921 for(; param; param = param->next)
3923 if(param->type == 0 && param->identifier)
3925 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3927 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3933 struct __ecereNameSpace__ecere__com__Class * sClass;
3935 for(sClass = _class; sClass; sClass = sClass->base)
3937 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3939 for(p = sClass->templateParams.first; p; p = p->next)
3943 struct TemplateParameter * param = p->param;
3944 struct TemplatedType * type;
3948 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));
3950 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3951 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3959 extern void PopContext(struct Context * ctx);
3961 extern void FreeContext(struct Context * context);
3963 void FinishTemplatesContext(struct Context * context)
3965 PopContext(context);
3966 FreeContext(context);
3967 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3970 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3972 if(!method->dataType)
3974 struct Context * context = SetupTemplatesContext(method->_class);
3976 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3977 FinishTemplatesContext(context);
3978 if(method->type != 1 && method->dataType)
3980 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3982 if(!method->_class->symbol)
3983 method->_class->symbol = FindClass(method->_class->fullName);
3984 method->dataType->thisClass = method->_class->symbol;
3990 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3994 struct Context * context = SetupTemplatesContext(prop->_class);
3996 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3997 FinishTemplatesContext(context);
4001 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4003 extern void FreeTypeName(struct TypeName * typeName);
4005 static void ProcessDeclarator(struct Declarator * decl);
4007 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4013 struct MethodImport * prev;
4014 struct MethodImport * next;
4016 unsigned int isVirtual;
4017 } __attribute__ ((gcc_struct));
4019 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4021 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4023 void * __ecereTemp1;
4024 struct Symbol * symbol = method->symbol;
4026 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4028 unsigned int imported = 0x0;
4029 unsigned int dllImport = 0x0;
4031 if(!method->dataType)
4032 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4033 if(!symbol || symbol->_import || method->type == 1)
4035 if(!symbol || method->type == 1)
4037 struct Symbol * classSym;
4039 if(!method->_class->symbol)
4040 method->_class->symbol = FindClass(method->_class->fullName);
4041 classSym = method->_class->symbol;
4042 if(!classSym->_import)
4044 struct ModuleImport * module;
4046 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4047 module = FindModule(method->_class->module);
4049 module = mainModule;
4050 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));
4051 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4055 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4057 if(!symbol->_import)
4059 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));
4060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4064 symbol->type = method->dataType;
4066 symbol->type->refCount++;
4069 if(!method->dataType->dllExport)
4072 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4076 if(method->type != 1 && method->dataType)
4077 DeclareType(method->dataType, 0x1, 0x1);
4078 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4080 struct Declaration * decl;
4081 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4082 struct Declarator * d;
4083 struct Declarator * funcDecl;
4084 struct External * external;
4086 specifiers = MkList();
4087 declarators = MkList();
4089 ListAdd(specifiers, MkSpecifier(EXTERN));
4090 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4091 ListAdd(specifiers, MkSpecifier(STATIC));
4092 if(method->type == 1)
4094 ListAdd(specifiers, MkSpecifier(INT));
4095 d = MkDeclaratorIdentifier(MkIdentifier(name));
4099 d = MkDeclaratorIdentifier(MkIdentifier(name));
4101 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4103 struct Context * context = SetupTemplatesContext(method->_class);
4105 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4106 FinishTemplatesContext(context);
4108 funcDecl = GetFuncDecl(d);
4111 struct Specifier * spec, * next;
4113 for(spec = (*specifiers).first; spec; spec = next)
4118 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4119 FreeSpecifier(spec);
4123 if(method->dataType && !method->dataType->staticMethod)
4125 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4127 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4128 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")));
4129 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4130 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4132 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4134 struct TypeName * param = (*funcDecl->function.parameters).first;
4136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4137 FreeTypeName(param);
4139 if(!funcDecl->function.parameters)
4140 funcDecl->function.parameters = MkList();
4141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4145 ProcessDeclarator(d);
4146 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4147 decl = MkDeclaration(specifiers, declarators);
4148 ReplaceThisClassSpecifiers(specifiers, method->_class);
4149 if(symbol->pointerExternal)
4151 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4154 *functionSymbol = *symbol;
4155 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4156 if(functionSymbol->type)
4157 functionSymbol->type->refCount++;
4159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4160 symbol->pointerExternal->symbol = functionSymbol;
4162 external = MkExternalDeclaration(decl);
4164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4165 external->symbol = symbol;
4166 symbol->pointerExternal = external;
4170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4172 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4176 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4178 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4180 unsigned int first = 0x1;
4182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4184 char className[1024];
4186 strcpy(className, _class->fullName);
4187 for(param = _class->templateParams.first; param; param = param->next)
4191 strcat(className, "<");
4193 strcat(className, ", ");
4194 if(lastParam + 1 != p)
4196 strcat(className, param->name);
4197 strcat(className, " = ");
4199 strcat(className, param->name);
4207 int len = strlen(className);
4209 if(className[len - 1] == '>')
4210 className[len++] = ' ';
4211 className[len++] = '>';
4212 className[len++] = '\0';
4214 return __ecereNameSpace__ecere__sys__CopyString(className);
4217 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4220 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4222 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4224 unsigned int first = 0x1;
4226 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4228 char className[1024];
4230 strcpy(className, _class->fullName);
4231 for(param = _class->templateParams.first; param; param = param->next)
4235 strcat(className, "<");
4237 strcat(className, ", ");
4238 if(lastParam + 1 != p)
4240 strcat(className, param->name);
4241 strcat(className, " = ");
4243 strcat(className, param->name);
4251 int len = strlen(className);
4253 if(className[len - 1] == '>')
4254 className[len++] = ' ';
4255 className[len++] = '>';
4256 className[len++] = '\0';
4258 return MkClassType(className);
4262 return MkClassType(_class->fullName);
4266 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4268 if(specs != (((void *)0)) && _class)
4270 struct Specifier * spec;
4272 for(spec = specs->first; spec; spec = spec->next)
4274 if(spec->type == 0 && spec->specifier == THISCLASS)
4277 spec->name = ReplaceThisClass(_class);
4278 spec->symbol = FindClass(spec->name);
4284 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4286 struct __ecereNameSpace__ecere__com__GlobalFunction
4288 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4289 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4292 struct __ecereNameSpace__ecere__com__Instance * module;
4293 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4294 char * dataTypeString;
4295 struct Type * dataType;
4297 } __attribute__ ((gcc_struct));
4299 extern struct Context * globalContext;
4301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4303 struct FunctionImport
4305 struct FunctionImport * prev;
4306 struct FunctionImport * next;
4308 } __attribute__ ((gcc_struct));
4310 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4312 void * __ecereTemp1;
4313 struct Symbol * symbol = function->symbol;
4315 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4317 unsigned int imported = 0x0;
4318 unsigned int dllImport = 0x0;
4320 if(!function->dataType)
4322 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4323 if(!function->dataType->thisClass)
4324 function->dataType->staticMethod = 0x1;
4330 struct ModuleImport * module = FindModule(function->module);
4332 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4335 if(!function->dataType->dllExport)
4337 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));
4338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4342 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4343 if(!symbol->type->thisClass)
4344 symbol->type->staticMethod = 0x1;
4347 imported = symbol->_import ? 0x1 : 0x0;
4348 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4351 DeclareType(function->dataType, 0x1, 0x1);
4354 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4356 struct Declaration * decl;
4357 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4358 struct Declarator * d;
4359 struct Declarator * funcDecl;
4360 struct External * external;
4362 specifiers = MkList();
4363 declarators = MkList();
4364 ListAdd(specifiers, MkSpecifier(EXTERN));
4365 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4367 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4368 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4369 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4371 struct Specifier * spec;
4373 for(spec = (*specifiers).first; spec; spec = spec->next)
4374 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4377 FreeSpecifier(spec);
4381 funcDecl = GetFuncDecl(d);
4382 if(funcDecl && !funcDecl->function.parameters)
4384 funcDecl->function.parameters = MkList();
4385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4387 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4389 struct Context * oldCtx = curContext;
4391 curContext = globalContext;
4392 decl = MkDeclaration(specifiers, declarators);
4393 curContext = oldCtx;
4395 if(symbol->pointerExternal)
4397 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4400 *functionSymbol = *symbol;
4401 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4402 if(functionSymbol->type)
4403 functionSymbol->type->refCount++;
4405 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4406 symbol->pointerExternal->symbol = functionSymbol;
4408 external = MkExternalDeclaration(decl);
4410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4411 external->symbol = symbol;
4412 symbol->pointerExternal = external;
4416 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4419 symbol->id = curExternal->symbol->idCode;
4422 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4425 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4430 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4431 struct __ecereNameSpace__ecere__sys__BTNode * left;
4432 struct __ecereNameSpace__ecere__sys__BTNode * right;
4434 struct __ecereNameSpace__ecere__com__Instance * module;
4435 char * dataTypeString;
4436 struct Type * dataType;
4439 } __attribute__ ((gcc_struct));
4441 void DeclareGlobalData(struct GlobalData * data)
4443 struct Symbol * symbol = data->symbol;
4445 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4450 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4453 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4454 DeclareType(data->dataType, 0x1, 0x1);
4457 if(!symbol->pointerExternal)
4459 struct Declaration * decl;
4460 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4461 struct Declarator * d;
4462 struct External * external;
4464 specifiers = MkList();
4465 declarators = MkList();
4466 ListAdd(specifiers, MkSpecifier(EXTERN));
4467 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4468 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4469 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4470 decl = MkDeclaration(specifiers, declarators);
4471 external = MkExternalDeclaration(decl);
4473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4474 external->symbol = symbol;
4475 symbol->pointerExternal = external;
4479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4482 symbol->id = curExternal->symbol->idCode;
4489 struct Conversion * prev, * next;
4490 struct __ecereNameSpace__ecere__com__Property * convert;
4492 struct Type * resultType;
4493 } __attribute__ ((gcc_struct));
4495 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4497 extern void Compiler_Warning(char * format, ...);
4499 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4501 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)
4505 if(source->kind == 20 && dest->kind != 20)
4507 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4512 if(dest->kind == 20 && source->kind != 20)
4514 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4519 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4523 if(source->classObjectType == 3 && dest->classObjectType != 2)
4527 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4529 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4532 if(dest->kind == 14 && source->kind != 0)
4534 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))
4536 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))
4538 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4540 if(source->_class->registered && source->_class->registered->type == 3)
4542 if(conversions != (((void *)0)))
4544 if(source->_class->registered == dest->_class->registered)
4549 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4551 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4553 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4555 if(sourceBase == destBase)
4559 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))
4563 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4565 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4572 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4576 if(source->kind == 8)
4578 struct __ecereNameSpace__ecere__com__Class * _class;
4580 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4582 struct __ecereNameSpace__ecere__com__Property * convert;
4584 for(convert = _class->conversions.first; convert; convert = convert->next)
4586 if(convert->memberAccess == 1 || _class->module == privateModule)
4588 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4590 if(!convert->dataType)
4591 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4592 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4594 if(!conversions && !convert->Get)
4596 else if(conversions != (((void *)0)))
4598 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))
4602 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4615 struct __ecereNameSpace__ecere__com__Class * _class;
4617 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4619 struct __ecereNameSpace__ecere__com__Property * convert;
4621 for(convert = _class->conversions.first; convert; convert = convert->next)
4623 if(convert->memberAccess == 1 || _class->module == privateModule)
4625 if(!convert->dataType)
4626 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4627 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4629 if(!conversions && !convert->Set)
4631 else if(conversions != (((void *)0)))
4633 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))
4637 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4647 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4649 if(!dest->_class->registered->dataType)
4650 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4651 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4653 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4660 if(source->kind == 8)
4662 struct __ecereNameSpace__ecere__com__Class * _class;
4664 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4666 struct __ecereNameSpace__ecere__com__Property * convert;
4668 for(convert = _class->conversions.first; convert; convert = convert->next)
4670 if(convert->memberAccess == 1 || _class->module == privateModule)
4672 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4674 if(!convert->dataType)
4675 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4676 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4678 if(!conversions && !convert->Get)
4680 else if(conversions != (((void *)0)))
4682 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))
4686 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4688 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4696 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4698 if(!source->_class->registered->dataType)
4699 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4700 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4707 if(source->kind == 8 || source->kind == 19)
4709 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4711 else if(dest->kind == 7 && source->kind == 6)
4713 else if(dest->kind == 2 && source->kind == 1)
4715 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4717 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4719 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4721 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4723 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4725 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)))
4727 struct Type * paramSource, * paramDest;
4729 if(dest->kind == 16)
4730 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4731 if(source->kind == 16)
4732 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4733 if(dest->kind == 13 && dest->type->kind == 11)
4735 if(source->kind == 13 && source->type->kind == 11)
4736 source = source->type;
4737 if(dest->kind == 16)
4738 dest = dest->method->dataType;
4739 if(source->kind == 16)
4740 source = source->method->dataType;
4741 paramSource = source->params.first;
4742 if(paramSource && paramSource->kind == 0)
4743 paramSource = (((void *)0));
4744 paramDest = dest->params.first;
4745 if(paramDest && paramDest->kind == 0)
4746 paramDest = (((void *)0));
4747 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4749 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))))
4751 if(paramDest && paramDest->kind == 8)
4752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4757 paramDest = paramDest->next;
4759 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4761 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4765 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4773 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4776 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4782 paramSource = paramSource->next;
4788 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4796 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4804 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4806 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4809 for(; paramDest; paramDest = paramDest->next)
4813 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4817 struct Type * paramDestType = paramDest;
4818 struct Type * paramSourceType = paramSource;
4819 struct Type * type = paramDestType;
4821 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4824 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4825 struct __ecereNameSpace__ecere__com__Class * sClass;
4827 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4830 if(sClass->templateClass)
4831 sClass = sClass->templateClass;
4832 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4834 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4836 for(sClass = sClass->base; sClass; sClass = sClass->base)
4838 if(sClass->templateClass)
4839 sClass = sClass->templateClass;
4840 id += sClass->templateParams.count;
4851 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4853 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4856 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)))
4861 PrintType(paramDest, type, 0x0, 0x1);
4862 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4863 if(paramDestType != paramDest)
4864 FreeType(paramDestType);
4867 if(paramDestType != paramDest)
4868 FreeType(paramDestType);
4870 paramSource = paramSource->next;
4874 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4879 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4883 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4885 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4892 static void FreeConvert(struct Conversion * convert)
4894 if(convert->resultType)
4895 FreeType(convert->resultType);
4898 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4900 struct __ecereNameSpace__ecere__com__BTNamedLink
4903 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4904 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4905 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4908 } __attribute__ ((gcc_struct));
4910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4912 struct __ecereNameSpace__ecere__com__EnumClassData
4914 struct __ecereNameSpace__ecere__sys__OldList values;
4916 } __attribute__ ((gcc_struct));
4918 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4920 struct __ecereNameSpace__ecere__sys__NamedLink
4922 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4923 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4926 } __attribute__ ((gcc_struct));
4928 extern void FreeExpContents(struct Expression * exp);
4930 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4932 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4934 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4936 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4938 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4940 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4942 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4944 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)))
4946 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4948 if(_class->type == 4)
4950 struct __ecereNameSpace__ecere__sys__OldList converts =
4954 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4958 _class->symbol = FindClass(_class->fullName);
4959 type->_class = _class->symbol;
4960 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4962 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4963 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4967 struct __ecereNameSpace__ecere__com__Class * baseClass;
4969 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4971 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4973 for(value = e->values.first; value; value = value->next)
4975 if(!strcmp(value->name, string))
4980 FreeExpContents(sourceExp);
4981 FreeType(sourceExp->expType);
4982 sourceExp->isConstant = 0x1;
4983 sourceExp->expType = MkClassType(baseClass->fullName);
4987 sourceExp->type = 2;
4988 if(!strcmp(baseClass->dataTypeString, "int"))
4989 sprintf(constant, "%d", value->data);
4991 sprintf(constant, "0x%X", value->data);
4992 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4994 while(converts.first)
4996 struct Conversion * convert = converts.first;
4998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5001 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5009 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5012 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)))
5013 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5020 struct __ecereNameSpace__ecere__com__SubModule
5022 struct __ecereNameSpace__ecere__com__SubModule * prev;
5023 struct __ecereNameSpace__ecere__com__SubModule * next;
5024 struct __ecereNameSpace__ecere__com__Instance * module;
5026 } __attribute__ ((gcc_struct));
5028 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5030 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5032 if(searchFor == searchIn)
5034 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5036 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5038 if(ModuleVisibility(subModule->module, searchFor))
5045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5047 struct __ecereNameSpace__ecere__com__Application
5052 unsigned int isGUIApp;
5053 struct __ecereNameSpace__ecere__sys__OldList allModules;
5054 char * parsedCommand;
5055 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5056 } __attribute__ ((gcc_struct));
5058 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5060 struct __ecereNameSpace__ecere__com__Instance * module;
5062 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5064 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5066 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5068 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)
5070 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5076 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5078 void ReadString(char * output, char * string);
5080 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5082 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5084 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5086 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5088 void * __ecereTemp1;
5089 struct Type * source = sourceExp->expType;
5090 struct Type * realDest = dest;
5092 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5094 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5096 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5098 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5100 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5102 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5104 if(sourceBase == destBase)
5110 struct __ecereNameSpace__ecere__sys__OldList * specs;
5111 unsigned int flag = 0x0;
5112 long long value = (((int)0x7fffffff));
5116 if(sourceExp->type == 2)
5118 if(source->isSigned)
5119 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5121 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5123 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5125 if(source->isSigned)
5126 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5128 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5130 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5133 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));
5137 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5139 if(_class && _class->type == 3)
5141 if(source->kind != 8)
5143 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5144 struct Type * tempDest, * tempSource;
5146 for(; _class->base->type != 1000; _class = _class->base)
5149 tempDest = tempType;
5152 _class->symbol = FindClass(_class->fullName);
5153 tempType->_class = _class->symbol;
5154 tempType->truth = dest->truth;
5155 if(tempType->_class)
5156 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5157 FreeType(sourceExp->expType);
5158 sourceExp->expType = dest;
5161 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5164 if(_class && _class->type == 2 && source->kind != 8)
5166 if(!dest->_class->registered->dataType)
5167 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5168 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5171 FreeType(sourceExp->expType);
5172 source = sourceExp->expType = MkClassType(dest->_class->string);
5176 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5178 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5179 struct Declarator * decl;
5182 ReadString(string, sourceExp->string);
5183 decl = SpecDeclFromString(string, specs, (((void *)0)));
5184 FreeExpContents(sourceExp);
5185 FreeType(sourceExp->expType);
5186 sourceExp->type = 26;
5187 sourceExp->_classExp.specifiers = specs;
5188 sourceExp->_classExp.decl = decl;
5189 sourceExp->expType = dest;
5196 else if(source->kind == 8)
5198 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5200 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5204 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5205 struct Type * tempDest, * tempSource;
5207 if(!source->_class->registered->dataType)
5208 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5209 for(; _class->base->type != 1000; _class = _class->base)
5212 tempSource = tempType;
5214 tempType->_class = FindClass(_class->fullName);
5215 tempType->truth = source->truth;
5216 tempType->classObjectType = source->classObjectType;
5217 if(tempType->_class)
5218 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5219 if(conversions->last)
5221 ((struct Conversion *)conversions->last)->resultType = dest;
5224 FreeType(sourceExp->expType);
5225 sourceExp->expType = MkClassType(_class->fullName);
5226 sourceExp->expType->truth = source->truth;
5227 sourceExp->expType->classObjectType = source->classObjectType;
5228 if(!sourceExp->destType)
5230 FreeType(sourceExp->destType);
5231 sourceExp->destType = sourceExp->expType;
5232 if(sourceExp->expType)
5233 sourceExp->expType->refCount++;
5235 if(!_class->dataType)
5236 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5238 dest = MkClassType(source->_class->string);
5239 dest->truth = source->truth;
5240 dest->classObjectType = source->classObjectType;
5242 source = _class->dataType;
5244 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5250 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5259 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5261 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5263 if(_class->type == 0 || _class->type == 5)
5265 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5267 *newExp = *sourceExp;
5268 if(sourceExp->destType)
5269 sourceExp->destType->refCount++;
5270 if(sourceExp->expType)
5271 sourceExp->expType->refCount++;
5272 sourceExp->type = 11;
5273 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5274 sourceExp->cast.exp = newExp;
5275 FreeType(sourceExp->expType);
5276 sourceExp->expType = (((void *)0));
5277 ProcessExpressionType(sourceExp);
5280 FreeType(sourceExp->expType);
5281 sourceExp->expType = dest;
5288 if(!_class->dataType)
5289 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5291 dest = _class->dataType;
5294 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5296 specs = MkListOne(MkSpecifier(DOUBLE));
5298 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5300 specs = MkListOne(MkSpecifier(FLOAT));
5302 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5306 ListAdd(specs, MkSpecifier(UNSIGNED));
5307 ListAdd(specs, MkSpecifier(INT64));
5309 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5313 ListAdd(specs, MkSpecifier(UNSIGNED));
5314 ListAdd(specs, MkSpecifier(INT));
5316 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5320 ListAdd(specs, MkSpecifier(UNSIGNED));
5321 ListAdd(specs, MkSpecifier(SHORT));
5323 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5327 ListAdd(specs, MkSpecifier(UNSIGNED));
5328 ListAdd(specs, MkSpecifier(CHAR));
5337 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))
5339 specs = MkListOne(MkSpecifier(DOUBLE));
5341 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5343 specs = MkListOne(MkSpecifier(FLOAT));
5345 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)))
5349 ListAdd(specs, MkSpecifier(UNSIGNED));
5350 ListAdd(specs, MkSpecifier(CHAR));
5352 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)))))
5356 ListAdd(specs, MkSpecifier(UNSIGNED));
5357 ListAdd(specs, MkSpecifier(SHORT));
5359 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5363 ListAdd(specs, MkSpecifier(UNSIGNED));
5364 ListAdd(specs, MkSpecifier(INT));
5366 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5370 ListAdd(specs, MkSpecifier(UNSIGNED));
5371 ListAdd(specs, MkSpecifier(INT64));
5373 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5375 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5385 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5387 *newExp = *sourceExp;
5388 newExp->prev = (((void *)0));
5389 newExp->next = (((void *)0));
5390 if(sourceExp->destType)
5391 sourceExp->destType->refCount++;
5392 if(sourceExp->expType)
5393 sourceExp->expType->refCount++;
5394 sourceExp->type = 11;
5395 if(realDest->kind == 8)
5397 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5398 FreeList(specs, FreeSpecifier);
5401 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5402 if(newExp->type == 4)
5404 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5407 sourceExp->cast.exp = newExp;
5408 FreeType(sourceExp->expType);
5409 sourceExp->expType = (((void *)0));
5410 ProcessExpressionType(sourceExp);
5413 FreeList(specs, FreeSpecifier);
5420 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5421 sourceExp = (*sourceExp->list).last;
5422 if(sourceExp->type == 0)
5424 struct Identifier * id = sourceExp->identifier;
5428 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5430 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5431 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5435 for(; _class && _class->type == 4; _class = _class->base)
5437 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5438 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5440 for(value = e->values.first; value; value = value->next)
5442 if(!strcmp(value->name, id->string))
5447 FreeExpContents(sourceExp);
5448 FreeType(sourceExp->expType);
5449 sourceExp->isConstant = 0x1;
5450 sourceExp->expType = MkClassType(_class->fullName);
5454 sourceExp->type = 2;
5455 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5456 sprintf(constant, "%d", value->data);
5458 sprintf(constant, "0x%X", value->data);
5459 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5467 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5474 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5476 int value2 = op2->i;
5479 exp->string = PrintInt(op1->i + value2);
5482 exp->expType = op1->type;
5484 op1->type->refCount++;
5489 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5491 unsigned int value2 = op2->ui;
5494 exp->string = PrintUInt(op1->ui + value2);
5497 exp->expType = op1->type;
5499 op1->type->refCount++;
5504 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5506 short value2 = op2->s;
5509 exp->string = PrintShort(op1->s + value2);
5512 exp->expType = op1->type;
5514 op1->type->refCount++;
5519 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5521 unsigned short value2 = op2->us;
5524 exp->string = PrintUShort(op1->us + value2);
5527 exp->expType = op1->type;
5529 op1->type->refCount++;
5534 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5536 char value2 = op2->c;
5539 exp->string = PrintChar(op1->c + value2);
5542 exp->expType = op1->type;
5544 op1->type->refCount++;
5549 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5551 unsigned char value2 = op2->uc;
5554 exp->string = PrintUChar(op1->uc + value2);
5557 exp->expType = op1->type;
5559 op1->type->refCount++;
5564 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5566 float value2 = op2->f;
5569 exp->string = PrintFloat(op1->f + value2);
5572 exp->expType = op1->type;
5574 op1->type->refCount++;
5579 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5581 double value2 = op2->d;
5584 exp->string = PrintDouble(op1->d + value2);
5587 exp->expType = op1->type;
5589 op1->type->refCount++;
5594 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5596 int value2 = op2->i;
5599 exp->string = PrintInt(op1->i - value2);
5602 exp->expType = op1->type;
5604 op1->type->refCount++;
5609 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5611 unsigned int value2 = op2->ui;
5614 exp->string = PrintUInt(op1->ui - value2);
5617 exp->expType = op1->type;
5619 op1->type->refCount++;
5624 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5626 short value2 = op2->s;
5629 exp->string = PrintShort(op1->s - value2);
5632 exp->expType = op1->type;
5634 op1->type->refCount++;
5639 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 unsigned short value2 = op2->us;
5644 exp->string = PrintUShort(op1->us - value2);
5647 exp->expType = op1->type;
5649 op1->type->refCount++;
5654 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 char value2 = op2->c;
5659 exp->string = PrintChar(op1->c - value2);
5662 exp->expType = op1->type;
5664 op1->type->refCount++;
5669 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 unsigned char value2 = op2->uc;
5674 exp->string = PrintUChar(op1->uc - value2);
5677 exp->expType = op1->type;
5679 op1->type->refCount++;
5684 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 float value2 = op2->f;
5689 exp->string = PrintFloat(op1->f - value2);
5692 exp->expType = op1->type;
5694 op1->type->refCount++;
5699 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 double value2 = op2->d;
5704 exp->string = PrintDouble(op1->d - value2);
5707 exp->expType = op1->type;
5709 op1->type->refCount++;
5714 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 int value2 = op2->i;
5719 exp->string = PrintInt(op1->i * value2);
5722 exp->expType = op1->type;
5724 op1->type->refCount++;
5729 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 unsigned int value2 = op2->ui;
5734 exp->string = PrintUInt(op1->ui * value2);
5737 exp->expType = op1->type;
5739 op1->type->refCount++;
5744 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 short value2 = op2->s;
5749 exp->string = PrintShort(op1->s * value2);
5752 exp->expType = op1->type;
5754 op1->type->refCount++;
5759 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 unsigned short value2 = op2->us;
5764 exp->string = PrintUShort(op1->us * value2);
5767 exp->expType = op1->type;
5769 op1->type->refCount++;
5774 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 char value2 = op2->c;
5779 exp->string = PrintChar(op1->c * value2);
5782 exp->expType = op1->type;
5784 op1->type->refCount++;
5789 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 unsigned char value2 = op2->uc;
5794 exp->string = PrintUChar(op1->uc * value2);
5797 exp->expType = op1->type;
5799 op1->type->refCount++;
5804 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 float value2 = op2->f;
5809 exp->string = PrintFloat(op1->f * value2);
5812 exp->expType = op1->type;
5814 op1->type->refCount++;
5819 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 double value2 = op2->d;
5824 exp->string = PrintDouble(op1->d * value2);
5827 exp->expType = op1->type;
5829 op1->type->refCount++;
5834 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 int value2 = op2->i;
5839 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5842 exp->expType = op1->type;
5844 op1->type->refCount++;
5849 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 unsigned int value2 = op2->ui;
5854 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5857 exp->expType = op1->type;
5859 op1->type->refCount++;
5864 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 short value2 = op2->s;
5869 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5872 exp->expType = op1->type;
5874 op1->type->refCount++;
5879 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 unsigned short value2 = op2->us;
5884 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5887 exp->expType = op1->type;
5889 op1->type->refCount++;
5894 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 char value2 = op2->c;
5899 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5902 exp->expType = op1->type;
5904 op1->type->refCount++;
5909 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 unsigned char value2 = op2->uc;
5914 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5917 exp->expType = op1->type;
5919 op1->type->refCount++;
5924 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 float value2 = op2->f;
5929 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5932 exp->expType = op1->type;
5934 op1->type->refCount++;
5939 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 double value2 = op2->d;
5944 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5947 exp->expType = op1->type;
5949 op1->type->refCount++;
5954 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 int value2 = op2->i;
5959 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5962 exp->expType = op1->type;
5964 op1->type->refCount++;
5969 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 unsigned int value2 = op2->ui;
5974 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5977 exp->expType = op1->type;
5979 op1->type->refCount++;
5984 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 short value2 = op2->s;
5989 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 unsigned short value2 = op2->us;
6004 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6007 exp->expType = op1->type;
6009 op1->type->refCount++;
6014 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 char value2 = op2->c;
6019 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6022 exp->expType = op1->type;
6024 op1->type->refCount++;
6029 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 unsigned char value2 = op2->uc;
6034 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6037 exp->expType = op1->type;
6039 op1->type->refCount++;
6044 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6047 exp->string = PrintInt(-op1->i);
6050 exp->expType = op1->type;
6052 op1->type->refCount++;
6057 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6060 exp->string = PrintUInt(-op1->ui);
6063 exp->expType = op1->type;
6065 op1->type->refCount++;
6070 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6073 exp->string = PrintShort(-op1->s);
6076 exp->expType = op1->type;
6078 op1->type->refCount++;
6083 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6086 exp->string = PrintUShort(-op1->us);
6089 exp->expType = op1->type;
6091 op1->type->refCount++;
6096 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6099 exp->string = PrintChar(-op1->c);
6102 exp->expType = op1->type;
6104 op1->type->refCount++;
6109 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6112 exp->string = PrintUChar(-op1->uc);
6115 exp->expType = op1->type;
6117 op1->type->refCount++;
6122 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6125 exp->string = PrintFloat(-op1->f);
6128 exp->expType = op1->type;
6130 op1->type->refCount++;
6135 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6138 exp->string = PrintDouble(-op1->d);
6141 exp->expType = op1->type;
6143 op1->type->refCount++;
6148 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6151 exp->string = PrintInt(++op1->i);
6154 exp->expType = op1->type;
6156 op1->type->refCount++;
6161 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6164 exp->string = PrintUInt(++op1->ui);
6167 exp->expType = op1->type;
6169 op1->type->refCount++;
6174 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6177 exp->string = PrintShort(++op1->s);
6180 exp->expType = op1->type;
6182 op1->type->refCount++;
6187 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6190 exp->string = PrintUShort(++op1->us);
6193 exp->expType = op1->type;
6195 op1->type->refCount++;
6200 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6203 exp->string = PrintChar(++op1->c);
6206 exp->expType = op1->type;
6208 op1->type->refCount++;
6213 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6216 exp->string = PrintUChar(++op1->uc);
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6229 exp->string = PrintFloat(++op1->f);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6242 exp->string = PrintDouble(++op1->d);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6255 exp->string = PrintInt(--op1->i);
6258 exp->expType = op1->type;
6260 op1->type->refCount++;
6265 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6268 exp->string = PrintUInt(--op1->ui);
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6281 exp->string = PrintShort(--op1->s);
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6294 exp->string = PrintUShort(--op1->us);
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6307 exp->string = PrintChar(--op1->c);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6320 exp->string = PrintUChar(--op1->uc);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6333 exp->string = PrintFloat(--op1->f);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6346 exp->string = PrintDouble(--op1->d);
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6358 int value2 = op2->i;
6361 exp->string = PrintInt(op1->i = value2);
6364 exp->expType = op1->type;
6366 op1->type->refCount++;
6371 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6373 unsigned int value2 = op2->ui;
6376 exp->string = PrintUInt(op1->ui = value2);
6379 exp->expType = op1->type;
6381 op1->type->refCount++;
6386 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6388 short value2 = op2->s;
6391 exp->string = PrintShort(op1->s = value2);
6394 exp->expType = op1->type;
6396 op1->type->refCount++;
6401 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6403 unsigned short value2 = op2->us;
6406 exp->string = PrintUShort(op1->us = value2);
6409 exp->expType = op1->type;
6411 op1->type->refCount++;
6416 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6418 char value2 = op2->c;
6421 exp->string = PrintChar(op1->c = value2);
6424 exp->expType = op1->type;
6426 op1->type->refCount++;
6431 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6433 unsigned char value2 = op2->uc;
6436 exp->string = PrintUChar(op1->uc = value2);
6439 exp->expType = op1->type;
6441 op1->type->refCount++;
6446 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6448 float value2 = op2->f;
6451 exp->string = PrintFloat(op1->f = value2);
6454 exp->expType = op1->type;
6456 op1->type->refCount++;
6461 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6463 double value2 = op2->d;
6466 exp->string = PrintDouble(op1->d = value2);
6469 exp->expType = op1->type;
6471 op1->type->refCount++;
6476 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6478 int value2 = op2->i;
6481 exp->string = PrintInt(op1->i += value2);
6484 exp->expType = op1->type;
6486 op1->type->refCount++;
6491 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6493 unsigned int value2 = op2->ui;
6496 exp->string = PrintUInt(op1->ui += value2);
6499 exp->expType = op1->type;
6501 op1->type->refCount++;
6506 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6508 short value2 = op2->s;
6511 exp->string = PrintShort(op1->s += value2);
6514 exp->expType = op1->type;
6516 op1->type->refCount++;
6521 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6523 unsigned short value2 = op2->us;
6526 exp->string = PrintUShort(op1->us += value2);
6529 exp->expType = op1->type;
6531 op1->type->refCount++;
6536 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6538 char value2 = op2->c;
6541 exp->string = PrintChar(op1->c += value2);
6544 exp->expType = op1->type;
6546 op1->type->refCount++;
6551 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6553 unsigned char value2 = op2->uc;
6556 exp->string = PrintUChar(op1->uc += value2);
6559 exp->expType = op1->type;
6561 op1->type->refCount++;
6566 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6568 float value2 = op2->f;
6571 exp->string = PrintFloat(op1->f += value2);
6574 exp->expType = op1->type;
6576 op1->type->refCount++;
6581 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6583 double value2 = op2->d;
6586 exp->string = PrintDouble(op1->d += value2);
6589 exp->expType = op1->type;
6591 op1->type->refCount++;
6596 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6598 int value2 = op2->i;
6601 exp->string = PrintInt(op1->i -= value2);
6604 exp->expType = op1->type;
6606 op1->type->refCount++;
6611 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6613 unsigned int value2 = op2->ui;
6616 exp->string = PrintUInt(op1->ui -= value2);
6619 exp->expType = op1->type;
6621 op1->type->refCount++;
6626 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6628 short value2 = op2->s;
6631 exp->string = PrintShort(op1->s -= value2);
6634 exp->expType = op1->type;
6636 op1->type->refCount++;
6641 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6643 unsigned short value2 = op2->us;
6646 exp->string = PrintUShort(op1->us -= value2);
6649 exp->expType = op1->type;
6651 op1->type->refCount++;
6656 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6658 char value2 = op2->c;
6661 exp->string = PrintChar(op1->c -= value2);
6664 exp->expType = op1->type;
6666 op1->type->refCount++;
6671 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6673 unsigned char value2 = op2->uc;
6676 exp->string = PrintUChar(op1->uc -= value2);
6679 exp->expType = op1->type;
6681 op1->type->refCount++;
6686 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6688 float value2 = op2->f;
6691 exp->string = PrintFloat(op1->f -= value2);
6694 exp->expType = op1->type;
6696 op1->type->refCount++;
6701 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6703 double value2 = op2->d;
6706 exp->string = PrintDouble(op1->d -= value2);
6709 exp->expType = op1->type;
6711 op1->type->refCount++;
6716 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6718 int value2 = op2->i;
6721 exp->string = PrintInt(op1->i *= value2);
6724 exp->expType = op1->type;
6726 op1->type->refCount++;
6731 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6733 unsigned int value2 = op2->ui;
6736 exp->string = PrintUInt(op1->ui *= value2);
6739 exp->expType = op1->type;
6741 op1->type->refCount++;
6746 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6748 short value2 = op2->s;
6751 exp->string = PrintShort(op1->s *= value2);
6754 exp->expType = op1->type;
6756 op1->type->refCount++;
6761 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6763 unsigned short value2 = op2->us;
6766 exp->string = PrintUShort(op1->us *= value2);
6769 exp->expType = op1->type;
6771 op1->type->refCount++;
6776 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6778 char value2 = op2->c;
6781 exp->string = PrintChar(op1->c *= value2);
6784 exp->expType = op1->type;
6786 op1->type->refCount++;
6791 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6793 unsigned char value2 = op2->uc;
6796 exp->string = PrintUChar(op1->uc *= value2);
6799 exp->expType = op1->type;
6801 op1->type->refCount++;
6806 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6808 float value2 = op2->f;
6811 exp->string = PrintFloat(op1->f *= value2);
6814 exp->expType = op1->type;
6816 op1->type->refCount++;
6821 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6823 double value2 = op2->d;
6826 exp->string = PrintDouble(op1->d *= value2);
6829 exp->expType = op1->type;
6831 op1->type->refCount++;
6836 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6838 int value2 = op2->i;
6841 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6844 exp->expType = op1->type;
6846 op1->type->refCount++;
6851 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6853 unsigned int value2 = op2->ui;
6856 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6859 exp->expType = op1->type;
6861 op1->type->refCount++;
6866 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6868 short value2 = op2->s;
6871 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6874 exp->expType = op1->type;
6876 op1->type->refCount++;
6881 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6883 unsigned short value2 = op2->us;
6886 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6889 exp->expType = op1->type;
6891 op1->type->refCount++;
6896 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6898 char value2 = op2->c;
6901 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6904 exp->expType = op1->type;
6906 op1->type->refCount++;
6911 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6913 unsigned char value2 = op2->uc;
6916 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6919 exp->expType = op1->type;
6921 op1->type->refCount++;
6926 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6928 float value2 = op2->f;
6931 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6934 exp->expType = op1->type;
6936 op1->type->refCount++;
6941 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6943 double value2 = op2->d;
6946 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6949 exp->expType = op1->type;
6951 op1->type->refCount++;
6956 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6958 int value2 = op2->i;
6961 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6964 exp->expType = op1->type;
6966 op1->type->refCount++;
6971 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6973 unsigned int value2 = op2->ui;
6976 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6979 exp->expType = op1->type;
6981 op1->type->refCount++;
6986 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6988 short value2 = op2->s;
6991 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6994 exp->expType = op1->type;
6996 op1->type->refCount++;
7001 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7003 unsigned short value2 = op2->us;
7006 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7009 exp->expType = op1->type;
7011 op1->type->refCount++;
7016 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7018 char value2 = op2->c;
7021 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7024 exp->expType = op1->type;
7026 op1->type->refCount++;
7031 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7033 unsigned char value2 = op2->uc;
7036 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7039 exp->expType = op1->type;
7041 op1->type->refCount++;
7046 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7048 int value2 = op2->i;
7051 exp->string = PrintInt(op1->i & value2);
7054 exp->expType = op1->type;
7056 op1->type->refCount++;
7061 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7063 unsigned int value2 = op2->ui;
7066 exp->string = PrintUInt(op1->ui & value2);
7069 exp->expType = op1->type;
7071 op1->type->refCount++;
7076 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7078 short value2 = op2->s;
7081 exp->string = PrintShort(op1->s & value2);
7084 exp->expType = op1->type;
7086 op1->type->refCount++;
7091 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7093 unsigned short value2 = op2->us;
7096 exp->string = PrintUShort(op1->us & value2);
7099 exp->expType = op1->type;
7101 op1->type->refCount++;
7106 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 char value2 = op2->c;
7111 exp->string = PrintChar(op1->c & value2);
7114 exp->expType = op1->type;
7116 op1->type->refCount++;
7121 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 unsigned char value2 = op2->uc;
7126 exp->string = PrintUChar(op1->uc & value2);
7129 exp->expType = op1->type;
7131 op1->type->refCount++;
7136 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 int value2 = op2->i;
7141 exp->string = PrintInt(op1->i | value2);
7144 exp->expType = op1->type;
7146 op1->type->refCount++;
7151 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 unsigned int value2 = op2->ui;
7156 exp->string = PrintUInt(op1->ui | value2);
7159 exp->expType = op1->type;
7161 op1->type->refCount++;
7166 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 short value2 = op2->s;
7171 exp->string = PrintShort(op1->s | value2);
7174 exp->expType = op1->type;
7176 op1->type->refCount++;
7181 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 unsigned short value2 = op2->us;
7186 exp->string = PrintUShort(op1->us | value2);
7189 exp->expType = op1->type;
7191 op1->type->refCount++;
7196 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 char value2 = op2->c;
7201 exp->string = PrintChar(op1->c | value2);
7204 exp->expType = op1->type;
7206 op1->type->refCount++;
7211 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 unsigned char value2 = op2->uc;
7216 exp->string = PrintUChar(op1->uc | value2);
7219 exp->expType = op1->type;
7221 op1->type->refCount++;
7226 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 int value2 = op2->i;
7231 exp->string = PrintInt(op1->i ^ value2);
7234 exp->expType = op1->type;
7236 op1->type->refCount++;
7241 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 unsigned int value2 = op2->ui;
7246 exp->string = PrintUInt(op1->ui ^ value2);
7249 exp->expType = op1->type;
7251 op1->type->refCount++;
7256 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 short value2 = op2->s;
7261 exp->string = PrintShort(op1->s ^ value2);
7264 exp->expType = op1->type;
7266 op1->type->refCount++;
7271 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 unsigned short value2 = op2->us;
7276 exp->string = PrintUShort(op1->us ^ value2);
7279 exp->expType = op1->type;
7281 op1->type->refCount++;
7286 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 char value2 = op2->c;
7291 exp->string = PrintChar(op1->c ^ value2);
7294 exp->expType = op1->type;
7296 op1->type->refCount++;
7301 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 unsigned char value2 = op2->uc;
7306 exp->string = PrintUChar(op1->uc ^ value2);
7309 exp->expType = op1->type;
7311 op1->type->refCount++;
7316 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 int value2 = op2->i;
7321 exp->string = PrintInt(op1->i << value2);
7324 exp->expType = op1->type;
7326 op1->type->refCount++;
7331 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 unsigned int value2 = op2->ui;
7336 exp->string = PrintUInt(op1->ui << value2);
7339 exp->expType = op1->type;
7341 op1->type->refCount++;
7346 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7348 short value2 = op2->s;
7351 exp->string = PrintShort(op1->s << value2);
7354 exp->expType = op1->type;
7356 op1->type->refCount++;
7361 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7363 unsigned short value2 = op2->us;
7366 exp->string = PrintUShort(op1->us << value2);
7369 exp->expType = op1->type;
7371 op1->type->refCount++;
7376 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7378 char value2 = op2->c;
7381 exp->string = PrintChar(op1->c << value2);
7384 exp->expType = op1->type;
7386 op1->type->refCount++;
7391 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7393 unsigned char value2 = op2->uc;
7396 exp->string = PrintUChar(op1->uc << value2);
7399 exp->expType = op1->type;
7401 op1->type->refCount++;
7406 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7408 int value2 = op2->i;
7411 exp->string = PrintInt(op1->i >> value2);
7414 exp->expType = op1->type;
7416 op1->type->refCount++;
7421 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7423 unsigned int value2 = op2->ui;
7426 exp->string = PrintUInt(op1->ui >> value2);
7429 exp->expType = op1->type;
7431 op1->type->refCount++;
7436 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7438 short value2 = op2->s;
7441 exp->string = PrintShort(op1->s >> value2);
7444 exp->expType = op1->type;
7446 op1->type->refCount++;
7451 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7453 unsigned short value2 = op2->us;
7456 exp->string = PrintUShort(op1->us >> value2);
7459 exp->expType = op1->type;
7461 op1->type->refCount++;
7466 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7468 char value2 = op2->c;
7471 exp->string = PrintChar(op1->c >> value2);
7474 exp->expType = op1->type;
7476 op1->type->refCount++;
7481 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7483 unsigned char value2 = op2->uc;
7486 exp->string = PrintUChar(op1->uc >> value2);
7489 exp->expType = op1->type;
7491 op1->type->refCount++;
7496 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7499 exp->string = PrintInt(~op1->i);
7502 exp->expType = op1->type;
7504 op1->type->refCount++;
7509 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7512 exp->string = PrintUInt(~op1->ui);
7515 exp->expType = op1->type;
7517 op1->type->refCount++;
7522 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7525 exp->string = PrintShort(~op1->s);
7528 exp->expType = op1->type;
7530 op1->type->refCount++;
7535 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7538 exp->string = PrintUShort(~op1->us);
7541 exp->expType = op1->type;
7543 op1->type->refCount++;
7548 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7551 exp->string = PrintChar(~op1->c);
7554 exp->expType = op1->type;
7556 op1->type->refCount++;
7561 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7564 exp->string = PrintUChar(~op1->uc);
7567 exp->expType = op1->type;
7569 op1->type->refCount++;
7574 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7576 int value2 = op2->i;
7579 exp->string = PrintInt(op1->i &= value2);
7582 exp->expType = op1->type;
7584 op1->type->refCount++;
7589 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7591 unsigned int value2 = op2->ui;
7594 exp->string = PrintUInt(op1->ui &= value2);
7597 exp->expType = op1->type;
7599 op1->type->refCount++;
7604 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7606 short value2 = op2->s;
7609 exp->string = PrintShort(op1->s &= value2);
7612 exp->expType = op1->type;
7614 op1->type->refCount++;
7619 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7621 unsigned short value2 = op2->us;
7624 exp->string = PrintUShort(op1->us &= value2);
7627 exp->expType = op1->type;
7629 op1->type->refCount++;
7634 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7636 char value2 = op2->c;
7639 exp->string = PrintChar(op1->c &= value2);
7642 exp->expType = op1->type;
7644 op1->type->refCount++;
7649 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7651 unsigned char value2 = op2->uc;
7654 exp->string = PrintUChar(op1->uc &= value2);
7657 exp->expType = op1->type;
7659 op1->type->refCount++;
7664 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 int value2 = op2->i;
7669 exp->string = PrintInt(op1->i |= value2);
7672 exp->expType = op1->type;
7674 op1->type->refCount++;
7679 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 unsigned int value2 = op2->ui;
7684 exp->string = PrintUInt(op1->ui |= value2);
7687 exp->expType = op1->type;
7689 op1->type->refCount++;
7694 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 short value2 = op2->s;
7699 exp->string = PrintShort(op1->s |= value2);
7702 exp->expType = op1->type;
7704 op1->type->refCount++;
7709 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 unsigned short value2 = op2->us;
7714 exp->string = PrintUShort(op1->us |= value2);
7717 exp->expType = op1->type;
7719 op1->type->refCount++;
7724 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 char value2 = op2->c;
7729 exp->string = PrintChar(op1->c |= value2);
7732 exp->expType = op1->type;
7734 op1->type->refCount++;
7739 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 unsigned char value2 = op2->uc;
7744 exp->string = PrintUChar(op1->uc |= value2);
7747 exp->expType = op1->type;
7749 op1->type->refCount++;
7754 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 int value2 = op2->i;
7759 exp->string = PrintInt(op1->i ^= value2);
7762 exp->expType = op1->type;
7764 op1->type->refCount++;
7769 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 unsigned int value2 = op2->ui;
7774 exp->string = PrintUInt(op1->ui ^= value2);
7777 exp->expType = op1->type;
7779 op1->type->refCount++;
7784 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 short value2 = op2->s;
7789 exp->string = PrintShort(op1->s ^= value2);
7792 exp->expType = op1->type;
7794 op1->type->refCount++;
7799 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 unsigned short value2 = op2->us;
7804 exp->string = PrintUShort(op1->us ^= value2);
7807 exp->expType = op1->type;
7809 op1->type->refCount++;
7814 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 char value2 = op2->c;
7819 exp->string = PrintChar(op1->c ^= value2);
7822 exp->expType = op1->type;
7824 op1->type->refCount++;
7829 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 unsigned char value2 = op2->uc;
7834 exp->string = PrintUChar(op1->uc ^= value2);
7837 exp->expType = op1->type;
7839 op1->type->refCount++;
7844 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 int value2 = op2->i;
7849 exp->string = PrintInt(op1->i <<= value2);
7852 exp->expType = op1->type;
7854 op1->type->refCount++;
7859 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 unsigned int value2 = op2->ui;
7864 exp->string = PrintUInt(op1->ui <<= value2);
7867 exp->expType = op1->type;
7869 op1->type->refCount++;
7874 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 short value2 = op2->s;
7879 exp->string = PrintShort(op1->s <<= value2);
7882 exp->expType = op1->type;
7884 op1->type->refCount++;
7889 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 unsigned short value2 = op2->us;
7894 exp->string = PrintUShort(op1->us <<= value2);
7897 exp->expType = op1->type;
7899 op1->type->refCount++;
7904 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 char value2 = op2->c;
7909 exp->string = PrintChar(op1->c <<= value2);
7912 exp->expType = op1->type;
7914 op1->type->refCount++;
7919 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 unsigned char value2 = op2->uc;
7924 exp->string = PrintUChar(op1->uc <<= value2);
7927 exp->expType = op1->type;
7929 op1->type->refCount++;
7934 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 int value2 = op2->i;
7939 exp->string = PrintInt(op1->i >>= value2);
7942 exp->expType = op1->type;
7944 op1->type->refCount++;
7949 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 unsigned int value2 = op2->ui;
7954 exp->string = PrintUInt(op1->ui >>= value2);
7957 exp->expType = op1->type;
7959 op1->type->refCount++;
7964 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 short value2 = op2->s;
7969 exp->string = PrintShort(op1->s >>= value2);
7972 exp->expType = op1->type;
7974 op1->type->refCount++;
7979 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 unsigned short value2 = op2->us;
7984 exp->string = PrintUShort(op1->us >>= value2);
7987 exp->expType = op1->type;
7989 op1->type->refCount++;
7994 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 char value2 = op2->c;
7999 exp->string = PrintChar(op1->c >>= value2);
8002 exp->expType = op1->type;
8004 op1->type->refCount++;
8009 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 unsigned char value2 = op2->uc;
8014 exp->string = PrintUChar(op1->uc >>= value2);
8017 exp->expType = op1->type;
8019 op1->type->refCount++;
8024 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8027 exp->string = PrintInt(!op1->i);
8030 exp->expType = op1->type;
8032 op1->type->refCount++;
8037 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8040 exp->string = PrintUInt(!op1->ui);
8043 exp->expType = op1->type;
8045 op1->type->refCount++;
8050 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8053 exp->string = PrintShort(!op1->s);
8056 exp->expType = op1->type;
8058 op1->type->refCount++;
8063 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8066 exp->string = PrintUShort(!op1->us);
8069 exp->expType = op1->type;
8071 op1->type->refCount++;
8076 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8079 exp->string = PrintChar(!op1->c);
8082 exp->expType = op1->type;
8084 op1->type->refCount++;
8089 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8092 exp->string = PrintUChar(!op1->uc);
8095 exp->expType = op1->type;
8097 op1->type->refCount++;
8102 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8104 int value2 = op2->i;
8107 exp->string = PrintInt(op1->i == value2);
8110 exp->expType = op1->type;
8112 op1->type->refCount++;
8117 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8119 unsigned int value2 = op2->ui;
8122 exp->string = PrintUInt(op1->ui == value2);
8125 exp->expType = op1->type;
8127 op1->type->refCount++;
8132 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8134 short value2 = op2->s;
8137 exp->string = PrintShort(op1->s == value2);
8140 exp->expType = op1->type;
8142 op1->type->refCount++;
8147 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8149 unsigned short value2 = op2->us;
8152 exp->string = PrintUShort(op1->us == value2);
8155 exp->expType = op1->type;
8157 op1->type->refCount++;
8162 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8164 char value2 = op2->c;
8167 exp->string = PrintChar(op1->c == value2);
8170 exp->expType = op1->type;
8172 op1->type->refCount++;
8177 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8179 unsigned char value2 = op2->uc;
8182 exp->string = PrintUChar(op1->uc == value2);
8185 exp->expType = op1->type;
8187 op1->type->refCount++;
8192 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8194 float value2 = op2->f;
8197 exp->string = PrintFloat(op1->f == value2);
8200 exp->expType = op1->type;
8202 op1->type->refCount++;
8207 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8209 double value2 = op2->d;
8212 exp->string = PrintDouble(op1->d == value2);
8215 exp->expType = op1->type;
8217 op1->type->refCount++;
8222 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8224 int value2 = op2->i;
8227 exp->string = PrintInt(op1->i != value2);
8230 exp->expType = op1->type;
8232 op1->type->refCount++;
8237 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8239 unsigned int value2 = op2->ui;
8242 exp->string = PrintUInt(op1->ui != value2);
8245 exp->expType = op1->type;
8247 op1->type->refCount++;
8252 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8254 short value2 = op2->s;
8257 exp->string = PrintShort(op1->s != value2);
8260 exp->expType = op1->type;
8262 op1->type->refCount++;
8267 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8269 unsigned short value2 = op2->us;
8272 exp->string = PrintUShort(op1->us != value2);
8275 exp->expType = op1->type;
8277 op1->type->refCount++;
8282 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8284 char value2 = op2->c;
8287 exp->string = PrintChar(op1->c != value2);
8290 exp->expType = op1->type;
8292 op1->type->refCount++;
8297 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8299 unsigned char value2 = op2->uc;
8302 exp->string = PrintUChar(op1->uc != value2);
8305 exp->expType = op1->type;
8307 op1->type->refCount++;
8312 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8314 float value2 = op2->f;
8317 exp->string = PrintFloat(op1->f != value2);
8320 exp->expType = op1->type;
8322 op1->type->refCount++;
8327 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8329 double value2 = op2->d;
8332 exp->string = PrintDouble(op1->d != value2);
8335 exp->expType = op1->type;
8337 op1->type->refCount++;
8342 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8344 int value2 = op2->i;
8347 exp->string = PrintInt(op1->i && value2);
8350 exp->expType = op1->type;
8352 op1->type->refCount++;
8357 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8359 unsigned int value2 = op2->ui;
8362 exp->string = PrintUInt(op1->ui && value2);
8365 exp->expType = op1->type;
8367 op1->type->refCount++;
8372 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8374 short value2 = op2->s;
8377 exp->string = PrintShort(op1->s && value2);
8380 exp->expType = op1->type;
8382 op1->type->refCount++;
8387 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8389 unsigned short value2 = op2->us;
8392 exp->string = PrintUShort(op1->us && value2);
8395 exp->expType = op1->type;
8397 op1->type->refCount++;
8402 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8404 char value2 = op2->c;
8407 exp->string = PrintChar(op1->c && value2);
8410 exp->expType = op1->type;
8412 op1->type->refCount++;
8417 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8419 unsigned char value2 = op2->uc;
8422 exp->string = PrintUChar(op1->uc && value2);
8425 exp->expType = op1->type;
8427 op1->type->refCount++;
8432 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8434 float value2 = op2->f;
8437 exp->string = PrintFloat(op1->f && value2);
8440 exp->expType = op1->type;
8442 op1->type->refCount++;
8447 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8449 double value2 = op2->d;
8452 exp->string = PrintDouble(op1->d && value2);
8455 exp->expType = op1->type;
8457 op1->type->refCount++;
8462 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 int value2 = op2->i;
8467 exp->string = PrintInt(op1->i || value2);
8470 exp->expType = op1->type;
8472 op1->type->refCount++;
8477 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 unsigned int value2 = op2->ui;
8482 exp->string = PrintUInt(op1->ui || value2);
8485 exp->expType = op1->type;
8487 op1->type->refCount++;
8492 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 short value2 = op2->s;
8497 exp->string = PrintShort(op1->s || value2);
8500 exp->expType = op1->type;
8502 op1->type->refCount++;
8507 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 unsigned short value2 = op2->us;
8512 exp->string = PrintUShort(op1->us || value2);
8515 exp->expType = op1->type;
8517 op1->type->refCount++;
8522 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 char value2 = op2->c;
8527 exp->string = PrintChar(op1->c || value2);
8530 exp->expType = op1->type;
8532 op1->type->refCount++;
8537 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 unsigned char value2 = op2->uc;
8542 exp->string = PrintUChar(op1->uc || value2);
8545 exp->expType = op1->type;
8547 op1->type->refCount++;
8552 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 float value2 = op2->f;
8557 exp->string = PrintFloat(op1->f || value2);
8560 exp->expType = op1->type;
8562 op1->type->refCount++;
8567 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 double value2 = op2->d;
8572 exp->string = PrintDouble(op1->d || value2);
8575 exp->expType = op1->type;
8577 op1->type->refCount++;
8582 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 int value2 = op2->i;
8587 exp->string = PrintInt(op1->i > value2);
8590 exp->expType = op1->type;
8592 op1->type->refCount++;
8597 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 unsigned int value2 = op2->ui;
8602 exp->string = PrintUInt(op1->ui > value2);
8605 exp->expType = op1->type;
8607 op1->type->refCount++;
8612 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 short value2 = op2->s;
8617 exp->string = PrintShort(op1->s > value2);
8620 exp->expType = op1->type;
8622 op1->type->refCount++;
8627 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 unsigned short value2 = op2->us;
8632 exp->string = PrintUShort(op1->us > value2);
8635 exp->expType = op1->type;
8637 op1->type->refCount++;
8642 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 char value2 = op2->c;
8647 exp->string = PrintChar(op1->c > value2);
8650 exp->expType = op1->type;
8652 op1->type->refCount++;
8657 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 unsigned char value2 = op2->uc;
8662 exp->string = PrintUChar(op1->uc > value2);
8665 exp->expType = op1->type;
8667 op1->type->refCount++;
8672 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 float value2 = op2->f;
8677 exp->string = PrintFloat(op1->f > value2);
8680 exp->expType = op1->type;
8682 op1->type->refCount++;
8687 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 double value2 = op2->d;
8692 exp->string = PrintDouble(op1->d > value2);
8695 exp->expType = op1->type;
8697 op1->type->refCount++;
8702 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 int value2 = op2->i;
8707 exp->string = PrintInt(op1->i < value2);
8710 exp->expType = op1->type;
8712 op1->type->refCount++;
8717 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 unsigned int value2 = op2->ui;
8722 exp->string = PrintUInt(op1->ui < value2);
8725 exp->expType = op1->type;
8727 op1->type->refCount++;
8732 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 short value2 = op2->s;
8737 exp->string = PrintShort(op1->s < value2);
8740 exp->expType = op1->type;
8742 op1->type->refCount++;
8747 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 unsigned short value2 = op2->us;
8752 exp->string = PrintUShort(op1->us < value2);
8755 exp->expType = op1->type;
8757 op1->type->refCount++;
8762 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 char value2 = op2->c;
8767 exp->string = PrintChar(op1->c < value2);
8770 exp->expType = op1->type;
8772 op1->type->refCount++;
8777 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 unsigned char value2 = op2->uc;
8782 exp->string = PrintUChar(op1->uc < value2);
8785 exp->expType = op1->type;
8787 op1->type->refCount++;
8792 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 float value2 = op2->f;
8797 exp->string = PrintFloat(op1->f < value2);
8800 exp->expType = op1->type;
8802 op1->type->refCount++;
8807 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 double value2 = op2->d;
8812 exp->string = PrintDouble(op1->d < value2);
8815 exp->expType = op1->type;
8817 op1->type->refCount++;
8822 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 int value2 = op2->i;
8827 exp->string = PrintInt(op1->i >= value2);
8830 exp->expType = op1->type;
8832 op1->type->refCount++;
8837 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 unsigned int value2 = op2->ui;
8842 exp->string = PrintUInt(op1->ui >= value2);
8845 exp->expType = op1->type;
8847 op1->type->refCount++;
8852 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 short value2 = op2->s;
8857 exp->string = PrintShort(op1->s >= value2);
8860 exp->expType = op1->type;
8862 op1->type->refCount++;
8867 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 unsigned short value2 = op2->us;
8872 exp->string = PrintUShort(op1->us >= value2);
8875 exp->expType = op1->type;
8877 op1->type->refCount++;
8882 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 char value2 = op2->c;
8887 exp->string = PrintChar(op1->c >= value2);
8890 exp->expType = op1->type;
8892 op1->type->refCount++;
8897 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 unsigned char value2 = op2->uc;
8902 exp->string = PrintUChar(op1->uc >= value2);
8905 exp->expType = op1->type;
8907 op1->type->refCount++;
8912 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 float value2 = op2->f;
8917 exp->string = PrintFloat(op1->f >= value2);
8920 exp->expType = op1->type;
8922 op1->type->refCount++;
8927 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 double value2 = op2->d;
8932 exp->string = PrintDouble(op1->d >= value2);
8935 exp->expType = op1->type;
8937 op1->type->refCount++;
8942 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 int value2 = op2->i;
8947 exp->string = PrintInt(op1->i <= value2);
8950 exp->expType = op1->type;
8952 op1->type->refCount++;
8957 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 unsigned int value2 = op2->ui;
8962 exp->string = PrintUInt(op1->ui <= value2);
8965 exp->expType = op1->type;
8967 op1->type->refCount++;
8972 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 short value2 = op2->s;
8977 exp->string = PrintShort(op1->s <= value2);
8980 exp->expType = op1->type;
8982 op1->type->refCount++;
8987 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 unsigned short value2 = op2->us;
8992 exp->string = PrintUShort(op1->us <= value2);
8995 exp->expType = op1->type;
8997 op1->type->refCount++;
9002 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 char value2 = op2->c;
9007 exp->string = PrintChar(op1->c <= value2);
9010 exp->expType = op1->type;
9012 op1->type->refCount++;
9017 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 unsigned char value2 = op2->uc;
9022 exp->string = PrintUChar(op1->uc <= value2);
9025 exp->expType = op1->type;
9027 op1->type->refCount++;
9032 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 float value2 = op2->f;
9037 exp->string = PrintFloat(op1->f <= value2);
9040 exp->expType = op1->type;
9042 op1->type->refCount++;
9047 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 double value2 = op2->d;
9052 exp->string = PrintDouble(op1->d <= value2);
9055 exp->expType = op1->type;
9057 op1->type->refCount++;
9062 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9065 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9068 exp->expType = op1->type;
9070 op1->type->refCount++;
9075 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9078 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9081 exp->expType = op1->type;
9083 op1->type->refCount++;
9088 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9091 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9094 exp->expType = op1->type;
9096 op1->type->refCount++;
9101 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9104 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9107 exp->expType = op1->type;
9109 op1->type->refCount++;
9114 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9117 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9120 exp->expType = op1->type;
9122 op1->type->refCount++;
9127 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9130 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9133 exp->expType = op1->type;
9135 op1->type->refCount++;
9140 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9143 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9146 exp->expType = op1->type;
9148 op1->type->refCount++;
9153 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9156 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9159 exp->expType = op1->type;
9161 op1->type->refCount++;
9166 struct OpTable intOps =
9168 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
9171 struct OpTable uintOps =
9173 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
9176 struct OpTable shortOps =
9178 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
9181 struct OpTable ushortOps =
9183 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
9186 struct OpTable floatOps =
9188 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
9191 struct OpTable doubleOps =
9193 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
9196 struct OpTable charOps =
9198 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
9201 struct OpTable ucharOps =
9203 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
9206 void ReadString(char * output, char * string)
9208 int len = strlen(string);
9210 unsigned int quoted = 0x0, escaped = 0x0;
9212 for(c = 0; c < len; c++)
9214 char ch = string[c];
9270 extern double strtod(char * , char * * );
9272 struct Operand GetOperand(struct Expression * exp)
9278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9281 struct Type * type = exp->expType;
9285 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9287 if(!type->_class->registered->dataType)
9288 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9289 type = type->_class->registered->dataType;
9291 op.kind = type->kind;
9292 op.type = exp->expType;
9293 if(exp->isConstant && exp->type == 2)
9299 if(exp->constant[0] == '\'')
9300 op.c = exp->constant[1];
9301 else if(type->isSigned)
9303 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9308 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9316 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9321 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9329 op.i = strtol(exp->constant, (((void *)0)), 0);
9334 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9342 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9347 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9355 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9360 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9366 op.f = (float)strtod(exp->constant, (((void *)0)));
9370 op.d = (double)strtod(exp->constant, (((void *)0)));
9376 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9386 int __ecereVMethodID_class_OnGetString;
9388 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9390 static void UnusedFunction()
9394 ((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);
9397 extern int __ecereVMethodID_class_OnGetString;
9399 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9401 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9403 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9405 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9406 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9409 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9410 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9412 void * ptr = inst->data + dataMember->offset + offset;
9413 char * result = (((void *)0));
9415 exp->loc = member->loc = inst->loc;
9416 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9417 if(!dataMember->dataType)
9418 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9419 type = dataMember->dataType;
9422 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9424 if(_class->type == 4)
9426 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9430 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9431 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9433 for(item = e->values.first; item; item = item->next)
9435 if((int)item->data == *(int *)ptr)
9437 result = item->name;
9443 exp->identifier = MkIdentifier(result);
9445 exp->destType = MkClassType(_class->fullName);
9446 ProcessExpressionType(exp);
9450 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9452 if(!_class->dataType)
9453 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9454 type = _class->dataType;
9463 FreeExpContents(exp);
9464 exp->constant = PrintFloat(*(float *)ptr);
9470 FreeExpContents(exp);
9471 exp->constant = PrintDouble(*(double *)ptr);
9477 FreeExpContents(exp);
9478 exp->constant = PrintInt(*(int *)ptr);
9484 FreeExpContents(exp);
9485 exp->constant = PrintInt64(*(long long *)ptr);
9491 FreeExpContents(exp);
9492 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9500 ListAdd(memberList, member);
9502 if(parentDataMember->type == 1)
9507 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9509 void PopulateInstance(struct Instantiation * inst)
9511 struct Symbol * classSym = inst->_class->symbol;
9512 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9513 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9514 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9516 inst->members = MkListOne(MkMembersInitList(memberList));
9517 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9519 if(!dataMember->isProperty)
9521 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9522 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9525 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9526 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9528 void * ptr = inst->data + dataMember->offset;
9529 char * result = (((void *)0));
9531 exp->loc = member->loc = inst->loc;
9532 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9533 if(!dataMember->dataType)
9534 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9535 type = dataMember->dataType;
9538 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9540 if(_class->type == 4)
9542 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9546 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9547 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9549 for(item = e->values.first; item; item = item->next)
9551 if((int)item->data == *(int *)ptr)
9553 result = item->name;
9560 exp->identifier = MkIdentifier(result);
9562 exp->destType = MkClassType(_class->fullName);
9563 ProcessExpressionType(exp);
9566 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9568 if(!_class->dataType)
9569 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9570 type = _class->dataType;
9579 exp->constant = PrintFloat(*(float *)ptr);
9585 exp->constant = PrintDouble(*(double *)ptr);
9591 exp->constant = PrintInt(*(int *)ptr);
9597 exp->constant = PrintInt64(*(long long *)ptr);
9603 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9611 ListAdd(memberList, member);
9617 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);
9619 extern void FreeInstance(struct Instantiation * inst);
9621 void ComputeInstantiation(struct Expression * exp)
9623 struct Instantiation * inst = exp->instance;
9624 struct MembersInit * members;
9625 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9626 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9627 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9628 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9629 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9630 int subMemberStackPos = 0;
9633 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9637 if(_class->type == 0 || _class->type == 5)
9638 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9640 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9644 for(members = (*inst->members).first; members; members = members->next)
9646 switch(members->type)
9650 if(members->dataMembers)
9652 struct MemberInit * member;
9654 for(member = (*members->dataMembers).first; member; member = member->next)
9656 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9657 unsigned int found = 0x0;
9658 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9659 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9660 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9661 unsigned int dataMemberOffset;
9665 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9668 if(curMember->isProperty)
9669 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9672 dataMember = curMember;
9673 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9680 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9684 if(prop->memberAccess == 1)
9686 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9687 curClass = prop->_class;
9692 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9693 int _subMemberStackPos = 0;
9695 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9699 if(dataMember->memberAccess == 1)
9701 curMember = dataMember;
9702 curClass = dataMember->_class;
9703 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9704 subMemberStackPos = _subMemberStackPos;
9709 if(found && member->initializer && member->initializer->type == 0)
9711 struct Expression * value = member->initializer->exp;
9712 struct Type * type = (((void *)0));
9716 type = prop->dataType;
9720 if(!dataMember->dataType)
9721 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9722 type = dataMember->dataType;
9724 if(ident && ident->next)
9726 for(ident = ident->next; ident && type; ident = ident->next)
9730 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9732 type = prop->dataType;
9735 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9737 type = dataMember->dataType;
9740 else if(type->kind == 9 || type->kind == 10)
9742 struct Type * memberType;
9744 for(memberType = type->members.first; memberType; memberType = memberType->next)
9746 if(!strcmp(memberType->name, ident->string))
9757 FreeType(value->destType);
9758 value->destType = type;
9761 ComputeExpression(value);
9763 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9767 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9769 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9771 if(!_class->dataType)
9772 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9773 type = _class->dataType;
9778 void * ptr = inst->data + dataMemberOffset;
9780 if(value->type == 2)
9786 GetInt(value, (int *)ptr);
9791 GetInt64(value, (long long *)ptr);
9796 GetIntPtr(value, (intptr_t *)ptr);
9801 GetFloat(value, (float *)ptr);
9806 GetDouble(value, (double *)ptr);
9811 else if(value->type == 1)
9815 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9817 if(_class->type == 1)
9819 ComputeTypeSize(type);
9820 if(value->instance->data)
9821 memcpy(ptr, value->instance->data, type->size);
9828 if(value->type == 1 && value->instance->data)
9830 void (* Set)(void *, void *) = (void *)prop->Set;
9832 Set(inst->data, value->instance->data);
9833 PopulateInstance(inst);
9835 else if(value->type == 2)
9841 void (* Set)(void *, double) = (void *)prop->Set;
9843 Set(inst->data, strtod(value->constant, (((void *)0))));
9848 void (* Set)(void *, float) = (void *)prop->Set;
9850 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9855 void (* Set)(void *, int) = (void *)prop->Set;
9857 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9862 void (* Set)(void *, long long) = (void *)prop->Set;
9864 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9869 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9871 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9876 else if(value->type == 3)
9880 ReadString(temp, value->string);
9881 prop->Set(inst->data, temp);
9885 else if(_class->type == 3)
9889 if(value->type == 2)
9893 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9895 if(_class->type == 3)
9897 if(!_class->dataType)
9898 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9899 type = _class->dataType;
9907 float (* Set)(float) = (void *)prop->Set;
9909 GetFloat(member->initializer->exp, &fValue);
9910 exp->constant = PrintFloat(Set(fValue));
9917 double (* Set)(double) = (void *)prop->Set;
9919 GetDouble(member->initializer->exp, &dValue);
9920 exp->constant = PrintDouble(Set(dValue));
9928 else if(_class->type == 2)
9932 if(value->type == 1 && value->instance->data)
9934 unsigned int (* Set)(void *) = (void *)prop->Set;
9936 bits = Set(value->instance->data);
9938 else if(value->type == 2)
9944 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9948 GetInt(value, &part);
9949 bits = (bits & ~bitMember->mask);
9950 if(!bitMember->dataType)
9951 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9952 type = bitMember->dataType;
9953 if(type->kind == 8 && type->_class && type->_class->registered)
9955 if(!type->_class->registered->dataType)
9956 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9957 type = type->_class->registered->dataType;
9963 bits |= ((char)part << bitMember->pos);
9965 bits |= ((unsigned char)part << bitMember->pos);
9969 bits |= ((short)part << bitMember->pos);
9971 bits |= ((unsigned short)part << bitMember->pos);
9976 bits |= (part << bitMember->pos);
9978 bits |= ((unsigned int)part << bitMember->pos);
9982 bits |= ((long long)part << bitMember->pos);
9984 bits |= ((uint64)part << bitMember->pos);
9988 bits |= ((intptr_t)part << bitMember->pos);
9990 bits |= ((uintptr_t)part << bitMember->pos);
9998 if(_class && _class->type == 3)
10000 ComputeExpression(member->initializer->exp);
10001 exp->constant = member->initializer->exp->constant;
10003 member->initializer->exp->constant = (((void *)0));
10013 if(_class && _class->type == 2)
10015 exp->constant = PrintHexUInt(bits);
10020 FreeInstance(inst);
10024 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10026 if(exp->op.op == SIZEOF)
10028 FreeExpContents(exp);
10030 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10040 struct Expression * exp2 = exp->op.exp2;
10042 exp->op.exp2 = (((void *)0));
10043 FreeExpContents(exp);
10044 FreeType(exp->expType);
10045 FreeType(exp->destType);
10047 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10053 FreeExpContents(exp);
10054 op1->ops.Neg(exp, op1);
10058 if(op1->ops.BitNot)
10060 FreeExpContents(exp);
10061 op1->ops.BitNot(exp, op1);
10067 FreeExpContents(exp);
10068 op1->ops.Not(exp, op1);
10080 FreeExpContents(exp);
10081 op1->ops.Add(exp, op1, op2);
10087 FreeExpContents(exp);
10088 op1->ops.Sub(exp, op1, op2);
10094 FreeExpContents(exp);
10095 op1->ops.Mul(exp, op1, op2);
10101 FreeExpContents(exp);
10102 op1->ops.Div(exp, op1, op2);
10108 FreeExpContents(exp);
10109 op1->ops.Mod(exp, op1, op2);
10115 if(op1->ops.BitAnd)
10117 FreeExpContents(exp);
10118 op1->ops.BitAnd(exp, op1, op2);
10125 FreeExpContents(exp);
10126 op1->ops.BitOr(exp, op1, op2);
10130 if(op1->ops.BitXor)
10132 FreeExpContents(exp);
10133 op1->ops.BitXor(exp, op1, op2);
10137 if(op1->ops.LShift)
10139 FreeExpContents(exp);
10140 op1->ops.LShift(exp, op1, op2);
10144 if(op1->ops.RShift)
10146 FreeExpContents(exp);
10147 op1->ops.RShift(exp, op1, op2);
10153 FreeExpContents(exp);
10154 op1->ops.Equ(exp, op1, op2);
10160 FreeExpContents(exp);
10161 op1->ops.Nqu(exp, op1, op2);
10167 FreeExpContents(exp);
10168 op1->ops.And(exp, op1, op2);
10174 FreeExpContents(exp);
10175 op1->ops.Or(exp, op1, op2);
10181 FreeExpContents(exp);
10182 op1->ops.Grt(exp, op1, op2);
10188 FreeExpContents(exp);
10189 op1->ops.Sma(exp, op1, op2);
10193 if(op1->ops.GrtEqu)
10195 FreeExpContents(exp);
10196 op1->ops.GrtEqu(exp, op1, op2);
10200 if(op1->ops.SmaEqu)
10202 FreeExpContents(exp);
10203 op1->ops.SmaEqu(exp, op1, op2);
10211 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10213 void ComputeExpression(struct Expression * exp)
10215 char expString[10240];
10217 expString[0] = '\0';
10222 ComputeInstantiation(exp);
10227 struct Expression * exp1, * exp2 = (((void *)0));
10228 struct Operand op1 =
10232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10235 struct Operand op2 =
10239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10244 ComputeExpression(exp->op.exp2);
10247 ComputeExpression(exp->op.exp1);
10248 exp1 = exp->op.exp1;
10249 exp2 = exp->op.exp2;
10250 op1 = GetOperand(exp1);
10252 op1.type->refCount++;
10255 op2 = GetOperand(exp2);
10257 op2.type->refCount++;
10262 exp1 = exp->op.exp2;
10263 op1 = GetOperand(exp1);
10265 op1.type->refCount++;
10267 CallOperator(exp, exp1, exp2, &op1, &op2);
10269 FreeType(op1.type);
10271 FreeType(op2.type);
10277 struct Expression * e, * n;
10279 for(e = (*exp->list).first; e; e = n)
10284 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10286 ComputeExpression(e);
10287 FreeType(exp->expType);
10288 FreeType(exp->destType);
10290 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10291 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10302 struct Expression * memberExp = exp->member.exp;
10303 struct Identifier * memberID = exp->member.member;
10304 struct Type * type;
10306 ComputeExpression(exp->member.exp);
10307 type = exp->member.exp->expType;
10310 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)));
10311 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10312 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10313 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10315 if(type->kind == 19 && exp->member.exp->type == 26)
10316 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10320 struct Symbol * classSym;
10323 PrintType(type, string, 0x0, 0x1);
10324 classSym = FindClass(string);
10325 _class = classSym ? classSym->registered : (((void *)0));
10327 if(exp->member.member)
10329 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10331 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10333 if(!prop && !member && _class && exp->member.member)
10335 struct Symbol * classSym = FindClass(exp->member.member->string);
10337 convertTo = _class;
10338 _class = classSym ? classSym->registered : (((void *)0));
10339 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10345 struct Type * type = prop->dataType;
10347 if(_class->type == 3)
10349 if(type->kind == 8)
10351 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10353 if(_class->type == 3)
10355 if(!_class->dataType)
10356 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10357 type = _class->dataType;
10365 float (* Get)(float) = (void *)prop->Get;
10367 GetFloat(exp->member.exp, &value);
10368 exp->constant = PrintFloat(Get ? Get(value) : value);
10375 double (* Get)(double);
10377 GetDouble(exp->member.exp, &value);
10379 Get = (void *)prop->Set;
10381 Get = (void *)prop->Get;
10382 exp->constant = PrintDouble(Get ? Get(value) : value);
10392 struct Expression * value = exp->member.exp;
10393 struct Type * type;
10395 if(!prop->dataType)
10396 ProcessPropertyType(prop);
10397 type = prop->dataType;
10401 else if(_class->type == 1)
10407 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10409 if(propertyClass->type == 1 && value->type == 1)
10411 void (* Set)(void *, void *) = (void *)prop->Set;
10413 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10414 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10415 exp->instance->_class = MkSpecifierName(_class->fullName);
10416 exp->instance->loc = exp->loc;
10418 Set(exp->instance->data, value->instance->data);
10419 PopulateInstance(exp->instance);
10426 void (* Set)(void *, int) = (void *)prop->Set;
10428 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10429 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10430 exp->instance->_class = MkSpecifierName(_class->fullName);
10431 exp->instance->loc = exp->loc;
10433 GetInt(value, &intValue);
10434 Set(exp->instance->data, intValue);
10435 PopulateInstance(exp->instance);
10440 long long intValue;
10441 void (* Set)(void *, long long) = (void *)prop->Set;
10443 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10444 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10445 exp->instance->_class = MkSpecifierName(_class->fullName);
10446 exp->instance->loc = exp->loc;
10448 GetInt64(value, &intValue);
10449 Set(exp->instance->data, intValue);
10450 PopulateInstance(exp->instance);
10456 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10458 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10459 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10460 exp->instance->_class = MkSpecifierName(_class->fullName);
10461 exp->instance->loc = exp->loc;
10463 GetIntPtr(value, &intValue);
10464 Set(exp->instance->data, intValue);
10465 PopulateInstance(exp->instance);
10470 double doubleValue;
10471 void (* Set)(void *, double) = (void *)prop->Set;
10473 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10474 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10475 exp->instance->_class = MkSpecifierName(_class->fullName);
10476 exp->instance->loc = exp->loc;
10478 GetDouble(value, &doubleValue);
10479 Set(exp->instance->data, doubleValue);
10480 PopulateInstance(exp->instance);
10485 else if(_class->type == 2)
10491 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10493 if(propertyClass->type == 1 && value->instance->data)
10495 unsigned int (* Set)(void *) = (void *)prop->Set;
10496 unsigned int bits = Set(value->instance->data);
10498 exp->constant = PrintHexUInt(bits);
10502 else if(_class->type == 2)
10504 unsigned int value;
10505 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10508 GetUInt(exp->member.exp, &value);
10510 exp->constant = PrintHexUInt(bits);
10519 if(_class->type == 2)
10521 unsigned int value;
10523 GetUInt(exp->member.exp, &value);
10528 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10530 if(_class->type == 1)
10532 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10534 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10535 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10536 exp->instance->_class = MkSpecifierName(_class->fullName);
10537 exp->instance->loc = exp->loc;
10539 Get(value, exp->instance->data);
10540 PopulateInstance(exp->instance);
10542 else if(_class->type == 2)
10544 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10545 uint64 bits = Get(value);
10547 exp->constant = PrintHexUInt64(bits);
10554 else if(_class->type == 1)
10556 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10562 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10564 if(_class->type == 1 && value)
10566 void (* Get)(void *, void *) = (void *)prop->Get;
10568 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10569 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10570 exp->instance->_class = MkSpecifierName(_class->fullName);
10571 exp->instance->loc = exp->loc;
10573 Get(value, exp->instance->data);
10574 PopulateInstance(exp->instance);
10585 exp->isConstant = 0x0;
10594 FreeExpression(memberExp);
10595 FreeIdentifier(memberID);
10601 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10603 FreeExpContents(exp);
10604 exp->constant = PrintUInt(ComputeTypeSize(type));
10611 struct Symbol * classSym = exp->_class->symbol;
10613 if(classSym && classSym->registered)
10615 if(classSym->registered->fixed)
10617 FreeSpecifier(exp->_class);
10618 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10623 char className[1024];
10625 strcpy(className, "__ecereClass_");
10626 FullClassNameCat(className, classSym->string, 0x1);
10627 MangleClassName(className);
10628 FreeExpContents(exp);
10630 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10631 exp->member.member = MkIdentifier("structSize");
10638 struct Type * type;
10639 struct Expression * e = exp;
10641 if(exp->type == 11)
10644 ComputeExpression(exp->cast.exp);
10647 if(e && exp->expType)
10649 type = exp->expType;
10650 if(type->kind == 8)
10652 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10654 if(_class && (_class->type == 3 || _class->type == 2))
10656 if(!_class->dataType)
10657 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10658 type = _class->dataType;
10668 GetChar(e, &value);
10669 FreeExpContents(exp);
10670 exp->constant = PrintChar(value);
10675 unsigned char value;
10677 GetUChar(e, &value);
10678 FreeExpContents(exp);
10679 exp->constant = PrintUChar(value);
10688 GetShort(e, &value);
10689 FreeExpContents(exp);
10690 exp->constant = PrintShort(value);
10695 unsigned short value;
10697 GetUShort(e, &value);
10698 FreeExpContents(exp);
10699 exp->constant = PrintUShort(value);
10709 FreeExpContents(exp);
10710 exp->constant = PrintInt(value);
10715 unsigned int value;
10717 GetUInt(e, &value);
10718 FreeExpContents(exp);
10719 exp->constant = PrintUInt(value);
10728 GetInt64(e, &value);
10729 FreeExpContents(exp);
10730 exp->constant = PrintInt64(value);
10737 GetUInt64(e, &value);
10738 FreeExpContents(exp);
10739 exp->constant = PrintUInt64(value);
10748 GetIntPtr(e, &value);
10749 FreeExpContents(exp);
10750 exp->constant = PrintInt64((long long)value);
10757 GetUIntPtr(e, &value);
10758 FreeExpContents(exp);
10759 exp->constant = PrintUInt64((uint64)value);
10767 GetFloat(e, &value);
10768 FreeExpContents(exp);
10769 exp->constant = PrintFloat(value);
10777 GetDouble(e, &value);
10778 FreeExpContents(exp);
10779 exp->constant = PrintDouble(value);
10789 struct Operand op1 =
10793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10796 struct Operand op2 =
10800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10803 struct Operand op3 =
10807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10812 ComputeExpression((*exp->cond.exp).last);
10813 if(exp->cond.elseExp)
10814 ComputeExpression(exp->cond.elseExp);
10816 ComputeExpression(exp->cond.cond);
10817 op1 = GetOperand(exp->cond.cond);
10819 op1.type->refCount++;
10820 op2 = GetOperand((*exp->cond.exp).last);
10822 op2.type->refCount++;
10823 op3 = GetOperand(exp->cond.elseExp);
10825 op3.type->refCount++;
10828 FreeExpContents(exp);
10829 op1.ops.Cond(exp, &op1, &op2, &op3);
10832 FreeType(op1.type);
10834 FreeType(op2.type);
10836 FreeType(op3.type);
10842 void ApplyAnyObjectLogic(struct Expression * e);
10844 extern void CopyTypeInto(struct Type * type, struct Type * src);
10846 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10848 unsigned int result = 0x1;
10852 struct __ecereNameSpace__ecere__sys__OldList converts =
10856 struct Conversion * convert;
10858 if(destType->kind == 0)
10860 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10864 for(convert = converts.first; convert; convert = convert->next)
10866 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10870 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10871 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10874 newExp->destType = (((void *)0));
10878 exp->addedThis = 0x1;
10879 exp->member.exp = newExp;
10880 FreeType(exp->member.exp->expType);
10881 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10882 exp->member.exp->expType->classObjectType = objectType;
10883 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10884 exp->member.memberType = 1;
10885 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10886 exp->needCast = 0x1;
10888 exp->expType->refCount++;
10889 ApplyAnyObjectLogic(exp->member.exp);
10895 exp->addedThis = 0x1;
10896 exp->member.exp = newExp;
10897 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10899 newExp->byReference = 0x1;
10901 FreeType(exp->member.exp->expType);
10902 exp->member.exp->expType = (((void *)0));
10903 if(convert->convert->dataType)
10905 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10906 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10907 exp->member.exp->expType->refCount = 1;
10908 exp->member.exp->expType->classObjectType = objectType;
10909 ApplyAnyObjectLogic(exp->member.exp);
10911 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10912 exp->member.memberType = 4;
10913 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10914 exp->needCast = 0x1;
10915 if(convert->resultType)
10916 convert->resultType->refCount++;
10922 FreeType(exp->expType);
10925 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10926 exp->needCast = 0x1;
10928 exp->expType->refCount++;
10932 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10933 exp->needCast = 0x1;
10934 if(convert->resultType)
10935 convert->resultType->refCount++;
10939 if(exp->isConstant && inCompiler)
10940 ComputeExpression(exp);
10941 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10943 if(!result && exp->expType && converts.count)
10945 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10947 if(!result && exp->expType && exp->destType)
10949 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))
10956 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10958 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10960 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10962 void CheckTemplateTypes(struct Expression * exp)
10964 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10966 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10967 struct Statement * compound;
10968 struct Context * context;
10972 exp->destType->refCount++;
10974 exp->expType->refCount++;
10975 newExp->prev = (((void *)0));
10976 newExp->next = (((void *)0));
10977 switch(exp->expType->kind)
10980 if(exp->destType->classObjectType)
10983 exp->destType->refCount--;
10985 exp->expType->refCount--;
10986 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10990 struct __ecereNameSpace__ecere__sys__OldList * specs;
10991 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10992 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10994 context = PushContext();
10995 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10996 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10997 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10999 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11000 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11001 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11002 exp->compound->compound.context = context;
11003 PopContext(context);
11008 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11009 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11013 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11015 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11016 struct Statement * compound;
11017 struct Context * context;
11021 exp->destType->refCount++;
11023 exp->expType->refCount++;
11024 newExp->prev = (((void *)0));
11025 newExp->next = (((void *)0));
11026 switch(exp->expType->kind)
11029 if(exp->destType->classObjectType)
11032 exp->destType->refCount--;
11034 exp->expType->refCount--;
11035 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11039 struct __ecereNameSpace__ecere__sys__OldList * specs;
11040 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11041 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11043 context = PushContext();
11044 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11045 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11046 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11048 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11049 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11050 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11051 exp->compound->compound.context = context;
11052 PopContext(context);
11057 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11060 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11061 ProcessExpressionType((*exp->list).first);
11067 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11068 newExp->needCast = 0x1;
11069 ProcessExpressionType((*exp->list).first);
11075 if(exp->expType->kind == 20)
11077 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11081 FreeType(exp->destType);
11082 FreeType(exp->expType);
11083 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11087 if(newExp->type == 8 && newExp->member.memberType == 3)
11091 exp->op.exp1 = (((void *)0));
11092 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11096 char typeString[1024];
11097 struct Declarator * decl;
11098 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11100 typeString[0] = '\0';
11101 PrintType(exp->expType, typeString, 0x0, 0x0);
11102 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11104 exp->cast.typeName = MkTypeName(specs, decl);
11105 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11106 exp->cast.exp->needCast = 0x1;
11114 extern int strncmp(const char * , const char * , int n);
11116 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11118 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11120 int nsLen = strlen(nameSpace);
11121 struct Symbol * symbol;
11123 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)))
11125 char * s = symbol->string;
11127 if(!strncmp(s, nameSpace, nsLen))
11132 for(c = strlen(s) - 1; c >= 0; c--)
11135 namePart = s + c + 1;
11136 if(!strcmp(namePart, name))
11144 return (((void *)0));
11147 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11150 char nameSpace[1024];
11152 unsigned int gotColon = 0x0;
11154 nameSpace[0] = '\0';
11155 for(c = strlen(name) - 1; c >= 0; c--)
11161 namePart = name + c + 1;
11162 while(c >= 0 && name[c] == ':')
11166 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11170 memcpy(nameSpace, name, c + 1);
11171 nameSpace[c + 1] = (char)0;
11172 return ScanWithNameSpace(tree, nameSpace, namePart);
11176 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11182 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11186 return ScanWithNameSpace(tree, "", namePart);
11188 return (((void *)0));
11191 static void ProcessDeclaration(struct Declaration * decl);
11193 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11195 struct Context * ctx;
11196 struct Symbol * symbol = (((void *)0));
11198 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11200 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11202 symbol = (((void *)0));
11205 char curName[1024];
11207 strcpy(curName, thisNameSpace);
11208 strcat(curName, "::");
11209 strcat(curName, name);
11210 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11213 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11216 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11217 if(symbol || ctx == endContext)
11220 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11222 if(symbol->pointerExternal->type == 0)
11224 struct FunctionDefinition * function = symbol->pointerExternal->function;
11225 struct Context * tmpContext = curContext;
11227 curContext = (((void *)0));
11228 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11229 curContext = tmpContext;
11230 symbol->pointerExternal->symbol = symbol;
11231 DeclareType(symbol->type, 0x1, 0x1);
11232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11233 symbol->id = curExternal->symbol->idCode;
11235 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11237 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11238 symbol->id = curExternal->symbol->idCode;
11244 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11246 if(!type->isSigned && type->kind != 22)
11247 ListAdd(specs, MkSpecifier(UNSIGNED));
11252 if(type->_class->registered)
11254 if(!type->_class->registered->dataType)
11255 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11256 GetTypeSpecs(type->_class->registered->dataType, specs);
11261 ListAdd(specs, MkSpecifier(DOUBLE));
11264 ListAdd(specs, MkSpecifier(FLOAT));
11267 ListAdd(specs, MkSpecifier(CHAR));
11270 ListAdd(specs, MkSpecifier(SHORT));
11273 ListAdd(specs, MkSpecifier(INT64));
11276 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11280 ListAdd(specs, MkSpecifier(INT));
11285 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11287 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11294 if(type->_class && type->_class->string)
11296 if(type->classObjectType == 2)
11297 strcat(string, "typed_object");
11299 strcat(string, type->_class->string);
11302 if(type->_class->registered)
11303 strcat(string, type->_class->registered->name);
11305 strcat(string, type->_class->string);
11312 _PrintType(type->type, string, 0x0, printFunction, fullName);
11313 strcat(string, " *");
11318 strcat(string, "void");
11321 strcat(string, type->isSigned ? "int" : "uint");
11324 strcat(string, type->isSigned ? "int64" : "uint64");
11327 strcat(string, type->isSigned ? "intptr" : "uintptr");
11330 strcat(string, type->isSigned ? "char" : "byte");
11333 strcat(string, type->isSigned ? "short" : "uint16");
11336 strcat(string, "float");
11339 strcat(string, "double");
11344 strcat(string, "struct ");
11345 strcat(string, type->enumName);
11347 else if(type->typeName)
11349 strcat(string, type->typeName);
11353 struct Type * member;
11355 strcat(string, "struct {");
11356 for(member = type->members.first; member; member = member->next)
11358 PrintType(member, string, 0x1, fullName);
11359 strcat(string, "; ");
11361 strcat(string, "}");
11367 strcat(string, "union ");
11368 strcat(string, type->enumName);
11370 else if(type->typeName)
11372 strcat(string, type->typeName);
11376 strcat(string, "union ");
11377 strcat(string, "(unnamed)");
11383 strcat(string, "enum ");
11384 strcat(string, type->enumName);
11386 else if(type->typeName)
11388 strcat(string, type->typeName);
11391 strcat(string, "enum");
11397 if(type->dllExport)
11398 strcat(string, "dllexport ");
11399 PrintType(type->returnType, string, 0x0, fullName);
11400 strcat(string, " ");
11407 strcat(string, type->name);
11410 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11416 strcat(string, name);
11422 struct Type * param;
11424 strcat(string, "(");
11425 for(param = type->params.first; param; param = param->next)
11427 PrintType(param, string, 0x1, fullName);
11429 strcat(string, ", ");
11431 strcat(string, ")");
11438 char baseType[1024], size[256];
11439 struct Type * arrayType = type;
11441 baseType[0] = '\0';
11443 while(arrayType->kind == 12)
11446 if(arrayType->enumClass)
11447 strcat(size, arrayType->enumClass->string);
11448 else if(arrayType->arraySizeExp)
11449 PrintExpression(arrayType->arraySizeExp, size);
11451 arrayType = arrayType->arrayType;
11453 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11454 strcat(string, baseType);
11455 strcat(string, size);
11461 strcat(string, "...");
11464 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11467 strcat(string, "subclass(");
11468 strcat(string, type->_class ? type->_class->string : "int");
11469 strcat(string, ")");
11472 strcat(string, type->templateParameter->identifier->string);
11475 strcat(string, "thisclass");
11478 strcat(string, "__builtin_va_list");
11481 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11483 strcat(string, " ");
11484 strcat(string, type->name);
11489 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11491 struct Type * funcType;
11493 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11495 if(funcType && funcType->kind == 11 && type != funcType)
11497 char typeString[1024];
11498 struct Type * param;
11500 PrintType(funcType->returnType, string, 0x0, fullName);
11501 strcat(string, "(");
11502 _PrintType(type, string, printName, 0x0, fullName);
11503 strcat(string, ")");
11504 strcat(string, "(");
11505 for(param = funcType->params.first; param; param = param->next)
11507 PrintType(param, string, 0x1, fullName);
11509 strcat(string, ", ");
11511 strcat(string, ")");
11514 _PrintType(type, string, printName, 0x1, fullName);
11515 if(type->bitFieldCount)
11519 sprintf(count, ":%d", type->bitFieldCount);
11520 strcat(string, count);
11524 static struct Type * FindMember(struct Type * type, char * string)
11526 struct Type * memberType;
11528 for(memberType = type->members.first; memberType; memberType = memberType->next)
11530 if(!memberType->name)
11532 struct Type * subType = FindMember(memberType, string);
11537 else if(!strcmp(memberType->name, string))
11540 return (((void *)0));
11543 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11545 struct Type * memberType;
11547 for(memberType = type->members.first; memberType; memberType = memberType->next)
11549 if(!memberType->name)
11551 struct Type * subType = FindMember(memberType, string);
11555 *offset += memberType->offset;
11559 else if(!strcmp(memberType->name, string))
11561 *offset += memberType->offset;
11565 return (((void *)0));
11568 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11570 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11572 struct Expression * ParseExpressionString(char * expression)
11574 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11575 ((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));
11576 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11578 parsedExpression = (((void *)0));
11580 expression_yyparse();
11581 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11582 return parsedExpression;
11585 extern char * QMkString(char * source);
11587 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11589 void * __ecereTemp1;
11590 struct Identifier * id = exp->identifier;
11591 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11592 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11593 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11594 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11596 if(_class && _class->type == 4)
11598 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11599 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11603 struct __ecereNameSpace__ecere__com__Class * baseClass;
11605 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11607 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11609 for(value = e->values.first; value; value = value->next)
11611 if(!strcmp(value->name, id->string))
11616 char constant[256];
11618 FreeExpContents(exp);
11620 exp->isConstant = 0x1;
11621 if(!strcmp(baseClass->dataTypeString, "int"))
11622 sprintf(constant, "%d", value->data);
11624 sprintf(constant, "0x%X", value->data);
11625 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11626 exp->expType = MkClassType(baseClass->fullName);
11634 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11636 ProcessMethodType(method);
11637 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));
11640 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11642 if(!prop->dataType)
11643 ProcessPropertyType(prop);
11644 exp->expType = prop->dataType;
11646 prop->dataType->refCount++;
11649 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11651 if(!member->dataType)
11652 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11653 exp->expType = member->dataType;
11654 if(member->dataType)
11655 member->dataType->refCount++;
11658 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11660 if(!classProp->dataType)
11661 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11662 if(classProp->constant)
11664 FreeExpContents(exp);
11665 exp->isConstant = 0x1;
11666 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11669 exp->constant = QMkString((char *)classProp->Get(_class));
11673 char constant[256];
11676 sprintf(constant, "%d", classProp->Get(_class));
11677 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11683 exp->expType = classProp->dataType;
11684 if(classProp->dataType)
11685 classProp->dataType->refCount++;
11691 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11693 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11694 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11695 struct __ecereNameSpace__ecere__com__NameSpace * child;
11699 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)))
11701 data = ScanGlobalData(child, name);
11709 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11711 extern char * strncpy(char * , const char * , int n);
11713 static struct GlobalData * FindGlobalData(char * name)
11716 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11718 nameSpace = globalData;
11719 for(c = 0; name[c]; c++)
11721 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11723 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11724 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11726 strncpy(spaceName, name + start, c - start);
11727 spaceName[c - start] = '\0';
11728 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11729 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11731 return (((void *)0));
11732 nameSpace = newSpace;
11740 return ScanGlobalData(nameSpace, name + start);
11742 return (((void *)0));
11745 static int definedExpStackPos;
11747 static void * definedExpStack[512];
11749 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11751 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11753 FreeExpContents(checkedExp);
11754 FreeType(checkedExp->expType);
11755 FreeType(checkedExp->destType);
11756 *checkedExp = *newExp;
11757 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11758 checkedExp->prev = prev;
11759 checkedExp->next = next;
11762 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11764 extern int printf(char * , ...);
11766 void __ecereMethod_Expression_Clear();
11768 void ApplyAnyObjectLogic(struct Expression * e)
11770 struct Type * destType = e->destType;
11772 if(destType && (destType->classObjectType == 3))
11774 if(e && e->expType)
11776 struct Type * type = e->expType;
11777 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11779 if(type->kind == 8 && type->_class && type->_class->registered)
11781 _class = type->_class->registered;
11783 else if(type->kind == 19)
11785 _class = FindClass("ecere::com::Class")->registered;
11789 char string[1024] = "";
11790 struct Symbol * classSym;
11792 PrintType(type, string, 0x0, 0x1);
11793 classSym = FindClass(string);
11795 _class = classSym->registered;
11797 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)))
11799 if(!_class || strcmp(_class->fullName, "char *"))
11801 struct Expression * checkedExp = e, * newExp;
11803 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11805 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11807 if(checkedExp->type == 25)
11809 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11812 checkedExp = (*checkedExp->list).last;
11814 else if(checkedExp->type == 11)
11815 checkedExp = checkedExp->cast.exp;
11817 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11819 newExp = checkedExp->op.exp2;
11820 checkedExp->op.exp2 = (((void *)0));
11821 FreeExpContents(checkedExp);
11822 if(e->expType && e->expType->passAsTemplate)
11826 ComputeTypeSize(e->expType);
11827 sprintf(size, "%d", e->expType->size);
11828 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))))));
11830 ReplaceExpContents(checkedExp, newExp);
11831 e->byReference = 0x1;
11833 else if(!e->byReference || (_class && _class->type == 5))
11835 struct Expression * checkedExp, * newExp;
11838 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;
11840 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11842 struct Context * context = PushContext();
11843 struct Declarator * decl;
11844 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11845 char typeString[1024];
11846 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11848 typeString[0] = '\0';
11850 newExp->prev = (((void *)0));
11851 newExp->next = (((void *)0));
11852 newExp->expType = (((void *)0));
11853 PrintType(e->expType, typeString, 0x0, 0x1);
11854 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11855 newExp->destType = ProcessType(specs, decl);
11856 curContext = context;
11861 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11863 sprintf(name, "__internalValue%03X", internalValueCounter++);
11864 if(!curCompound->compound.declarations)
11865 curCompound->compound.declarations = MkList();
11866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11867 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11868 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11869 e->compound = MkCompoundStmt((((void *)0)), stmts);
11872 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11874 struct Type * type = e->destType;
11876 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11877 CopyTypeInto(e->destType, type);
11878 e->destType->refCount = 1;
11879 e->destType->classObjectType = 0;
11882 e->compound->compound.context = context;
11883 PopContext(context);
11884 curContext = context->parent;
11888 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11890 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11892 if(checkedExp->type == 25)
11894 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11897 checkedExp = (*checkedExp->list).last;
11899 else if(checkedExp->type == 11)
11900 checkedExp = checkedExp->cast.exp;
11903 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11905 *operand = *checkedExp;
11906 checkedExp->destType = (((void *)0));
11907 checkedExp->expType = (((void *)0));
11908 __ecereMethod_Expression_Clear(checkedExp);
11909 checkedExp->type = 4;
11910 checkedExp->op.op = '&';
11911 checkedExp->op.exp1 = (((void *)0));
11912 checkedExp->op.exp2 = operand;
11921 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))))
11923 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11929 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11932 thisExp->prev = (((void *)0));
11933 thisExp->next = (((void *)0));
11934 __ecereMethod_Expression_Clear(e);
11936 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11937 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11938 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11940 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11941 CopyTypeInto(e->expType, thisExp->expType);
11942 e->expType->byReference = 0x0;
11943 e->expType->refCount = 1;
11944 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))
11946 e->expType->classObjectType = 0;
11951 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11953 if(destType->kind == 14)
11955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11957 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11959 unsigned int byReference = e->expType->byReference;
11960 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11961 struct Declarator * decl;
11962 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11963 char typeString[1024];
11964 struct Type * type;
11965 int backupClassObjectType;
11967 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11971 backupClassObjectType = type->classObjectType;
11972 type->classObjectType = 0;
11973 typeString[0] = '\0';
11974 PrintType(type, typeString, 0x0, 0x1);
11975 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11976 type->classObjectType = backupClassObjectType;
11978 thisExp->prev = (((void *)0));
11979 thisExp->next = (((void *)0));
11980 __ecereMethod_Expression_Clear(e);
11981 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)))
11985 e->op.exp1 = (((void *)0));
11986 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11991 e->cast.typeName = MkTypeName(specs, decl);
11992 e->cast.exp = thisExp;
11993 e->byReference = 0x1;
11996 e->destType = destType;
11998 destType->refCount++;
12003 extern char * strstr(char * , const char * );
12005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12007 struct __ecereNameSpace__ecere__com__DefinedExpression
12009 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12010 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12013 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12014 } __attribute__ ((gcc_struct));
12016 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12018 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12020 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12022 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12024 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12026 extern struct Expression * CopyExpression(struct Expression * exp);
12028 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12030 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12032 static void ProcessStatement(struct Statement * stmt);
12034 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12036 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12038 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12040 extern char * sourceFile;
12042 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12044 void ProcessExpressionType(struct Expression * exp)
12046 void * __ecereTemp2;
12047 void * __ecereTemp1;
12048 unsigned int unresolved = 0x0;
12049 struct Location oldyylloc = yylloc;
12050 unsigned int notByReference = 0x0;
12052 if(!exp || exp->expType)
12059 struct Identifier * id = exp->identifier;
12063 if(id->_class && id->_class->name)
12065 id->classSym = id->_class->symbol;
12067 if(strstr(id->string, "__ecereClass") == id->string)
12069 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12072 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12074 ReplaceClassMembers(exp, thisClass);
12077 ProcessExpressionType(exp);
12080 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12085 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12089 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12095 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12098 ProcessExpressionType(exp);
12102 else if(currentClass && !id->_class)
12104 if(ResolveIdWithClass(exp, currentClass, 0x1))
12107 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12112 struct Type * type = symbol->type;
12113 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12115 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12117 struct Context * context = SetupTemplatesContext(_class);
12119 type = ReplaceThisClassType(_class);
12120 FinishTemplatesContext(context);
12122 type->refCount = 0;
12124 FreeSpecifier(id->_class);
12125 id->_class = (((void *)0));
12126 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12127 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12128 id->classSym = (((void *)0));
12129 exp->expType = type;
12132 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12133 exp->isConstant = 0x1;
12134 if(symbol->isParam || !strcmp(id->string, "this"))
12136 if(_class && _class->type == 1)
12137 exp->byReference = 0x1;
12139 if(symbol->isIterator)
12141 if(symbol->isIterator == 3)
12144 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12145 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12146 exp->expType = (((void *)0));
12147 ProcessExpressionType(exp);
12149 else if(symbol->isIterator != 4)
12152 exp->member.exp = MkExpIdentifier(exp->identifier);
12153 exp->member.exp->expType = exp->expType;
12154 exp->member.member = MkIdentifier("data");
12155 exp->expType = (((void *)0));
12156 ProcessExpressionType(exp);
12163 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12165 if(thisNameSpace && !(id->_class && !id->_class->name))
12169 strcpy(name, thisNameSpace);
12170 strcat(name, "::");
12171 strcat(name, id->string);
12172 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12175 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12180 for(c = 0; c < definedExpStackPos; c++)
12181 if(definedExpStack[c] == definedExp)
12183 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12185 struct Location backupYylloc = yylloc;
12187 definedExpStack[definedExpStackPos++] = definedExp;
12188 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12189 ((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));
12190 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12192 parsedExpression = (((void *)0));
12194 expression_yyparse();
12195 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12196 yylloc = backupYylloc;
12197 if(parsedExpression)
12199 FreeIdentifier(id);
12201 exp->list = MkListOne(parsedExpression);
12202 parsedExpression->loc = yylloc;
12203 ProcessExpressionType(exp);
12204 definedExpStackPos--;
12207 definedExpStackPos--;
12213 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12219 struct GlobalData * data = (((void *)0));
12221 if(thisNameSpace && !(id->_class && !id->_class->name))
12225 strcpy(name, thisNameSpace);
12226 strcat(name, "::");
12227 strcat(name, id->string);
12228 data = FindGlobalData(name);
12231 data = FindGlobalData(id->string);
12234 DeclareGlobalData(data);
12235 exp->expType = data->dataType;
12237 data->dataType->refCount++;
12238 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12239 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12240 FreeSpecifier(id->_class);
12241 id->_class = (((void *)0));
12246 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12248 if(thisNameSpace && !(id->_class && !id->_class->name))
12252 strcpy(name, thisNameSpace);
12253 strcat(name, "::");
12254 strcat(name, id->string);
12255 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12258 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12263 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12264 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12266 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12267 strcpy(name, "__ecereFunction_");
12268 FullClassNameCat(name, id->string, 0x0);
12269 if(DeclareFunction(function, name))
12271 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12272 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12274 exp->expType = function->dataType;
12275 if(function->dataType)
12276 function->dataType->refCount++;
12277 FreeSpecifier(id->_class);
12278 id->_class = (((void *)0));
12290 struct __ecereNameSpace__ecere__com__Class * _class;
12292 if(!exp->instance->_class)
12294 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12296 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12299 ProcessInstantiationType(exp->instance);
12300 exp->isConstant = exp->instance->isConstant;
12301 if(exp->instance->_class)
12303 exp->expType = MkClassType(exp->instance->_class->name);
12311 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12313 exp->expType = type;
12314 if(exp->constant[0] == '\'')
12316 if((int)((unsigned char *)exp->constant)[1] > 127)
12319 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12322 ch = exp->constant[1];
12323 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12324 exp->constant = PrintUInt(ch);
12326 type->_class = FindClass("unichar");
12327 type->isSigned = 0x0;
12332 type->isSigned = 0x1;
12335 else if(strchr(exp->constant, '.'))
12337 char ch = exp->constant[strlen(exp->constant) - 1];
12343 type->isSigned = 0x1;
12347 if(exp->constant[0] == '0' && exp->constant[1])
12348 type->isSigned = 0x0;
12349 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12350 type->isSigned = 0x0;
12351 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12352 type->isSigned = 0x0;
12354 type->isSigned = 0x1;
12357 exp->isConstant = 0x1;
12363 exp->isConstant = 0x1;
12364 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));
12369 ProcessExpressionType(exp->_new.size);
12370 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));
12371 DeclareType(exp->expType->type, 0x0, 0x0);
12375 ProcessExpressionType(exp->_renew.size);
12376 ProcessExpressionType(exp->_renew.exp);
12377 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));
12378 DeclareType(exp->expType->type, 0x0, 0x0);
12382 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12383 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12384 unsigned int useDestType = 0x0, useSideType = 0x0;
12385 struct Location oldyylloc = yylloc;
12386 unsigned int useSideUnit = 0x0;
12387 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12429 if(exp->op.op != '*' || exp->op.exp1)
12436 if(exp->op.op == '&')
12438 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12440 struct Identifier * id = exp->op.exp2->identifier;
12441 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12443 if(symbol && symbol->isIterator == 2)
12446 exp->member.exp = exp->op.exp2;
12447 exp->member.member = MkIdentifier("key");
12448 exp->expType = (((void *)0));
12449 exp->op.exp2->expType = symbol->type;
12450 symbol->type->refCount++;
12451 ProcessExpressionType(exp);
12459 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))
12461 if(exp->op.exp1->destType)
12462 FreeType(exp->op.exp1->destType);
12463 exp->op.exp1->destType = exp->destType;
12465 exp->destType->refCount++;
12469 if(exp->op.exp1->destType)
12470 FreeType(exp->op.exp1->destType);
12471 exp->op.exp1->destType = dummy;
12474 if(exp->op.exp1->destType && exp->op.op != '=')
12475 exp->op.exp1->destType->count++;
12476 ProcessExpressionType(exp->op.exp1);
12477 if(exp->op.exp1->destType && exp->op.op != '=')
12478 exp->op.exp1->destType->count--;
12479 if(exp->op.exp1->destType == dummy)
12482 exp->op.exp1->destType = (((void *)0));
12484 type1 = exp->op.exp1->expType;
12488 char expString[10240];
12490 expString[0] = '\0';
12491 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12495 exp->op.exp2->destType = exp->op.exp1->expType;
12496 if(exp->op.exp1->expType)
12497 exp->op.exp1->expType->refCount++;
12501 exp->op.exp2->destType = exp->destType;
12503 exp->destType->refCount++;
12507 exp->expType = type1;
12512 PrintExpression(exp->op.exp2, expString);
12513 if(type1 && type1->kind == 13)
12515 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)
12516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12517 else if(exp->op.op == '=')
12519 if(exp->op.exp2->destType)
12520 FreeType(exp->op.exp2->destType);
12521 exp->op.exp2->destType = type1;
12528 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)
12532 if(exp->op.exp2->destType)
12533 FreeType(exp->op.exp2->destType);
12534 exp->op.exp2->destType = type1;
12541 exp->expType = type1;
12543 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)))
12545 if(exp->op.exp2->destType)
12546 FreeType(exp->op.exp2->destType);
12547 exp->op.exp2->destType = exp->destType;
12549 exp->destType->refCount++;
12553 if(exp->op.exp2->destType)
12554 FreeType(exp->op.exp2->destType);
12555 exp->op.exp2->destType = dummy;
12558 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12560 FreeType(exp->op.exp2->destType);
12561 exp->op.exp2->destType = type1;
12564 if(exp->op.exp2->destType && exp->op.op != '=')
12565 exp->op.exp2->destType->count++;
12566 ProcessExpressionType(exp->op.exp2);
12567 if(exp->op.exp2->destType && exp->op.op != '=')
12568 exp->op.exp2->destType->count--;
12569 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12571 if(exp->op.exp2->expType->kind == 22 || exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12573 if(exp->op.op != '=' && type1->type->kind == 0)
12574 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12576 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)))
12578 if(exp->op.op == ADD_ASSIGN)
12579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12581 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))
12583 if(exp->op.op == ADD_ASSIGN)
12584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12586 else if(inCompiler)
12588 char type1String[1024];
12589 char type2String[1024];
12591 type1String[0] = '\0';
12592 type2String[0] = '\0';
12593 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12594 PrintType(type1, type2String, 0x0, 0x1);
12595 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12596 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12599 if(exp->op.exp2->destType == dummy)
12602 exp->op.exp2->destType = (((void *)0));
12604 type2 = exp->op.exp2->expType;
12607 if(exp->op.op == SIZEOF)
12609 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12610 exp->isConstant = 0x1;
12612 else if(exp->op.op == '*' && !exp->op.exp1)
12614 exp->expType = Dereference(type2);
12615 if(type2 && type2->kind == 8)
12616 notByReference = 0x1;
12618 else if(exp->op.op == '&' && !exp->op.exp1)
12619 exp->expType = Reference(type2);
12626 if(exp->op.exp1->destType)
12627 FreeType(exp->op.exp1->destType);
12628 exp->op.exp1->destType = MkClassType("bool");
12629 exp->op.exp1->destType->truth = 0x1;
12630 if(!exp->op.exp1->expType)
12631 ProcessExpressionType(exp->op.exp1);
12633 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12634 FreeType(exp->op.exp1->expType);
12635 exp->op.exp1->expType = MkClassType("bool");
12636 exp->op.exp1->expType->truth = 0x1;
12640 if(exp->op.exp2->destType)
12641 FreeType(exp->op.exp2->destType);
12642 exp->op.exp2->destType = MkClassType("bool");
12643 exp->op.exp2->destType->truth = 0x1;
12644 if(!exp->op.exp2->expType)
12645 ProcessExpressionType(exp->op.exp2);
12647 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12648 FreeType(exp->op.exp2->expType);
12649 exp->op.exp2->expType = MkClassType("bool");
12650 exp->op.exp2->expType->truth = 0x1;
12653 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")))))
12655 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12657 if(exp->op.exp2->destType)
12658 FreeType(exp->op.exp2->destType);
12659 exp->op.exp2->destType = type1;
12661 if(exp->op.exp1->destType)
12662 FreeType(exp->op.exp1->destType);
12663 exp->op.exp1->destType = type2;
12665 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)
12666 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);
12667 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12669 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12673 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12675 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12676 ProcessExpressionType(exp->op.exp1);
12677 if(type2->kind != 13)
12679 ProcessExpressionType(classExp);
12680 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"))))))));
12681 if(!exp->op.exp2->expType)
12682 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12683 ProcessExpressionType(exp->op.exp2);
12687 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12689 if(type1->kind != 8 && type1->type->kind == 0)
12690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12691 exp->expType = type1;
12695 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12697 if(type2->kind != 8 && type2->type->kind == 0)
12698 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12699 exp->expType = type2;
12703 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))
12705 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12709 unsigned int success = 0x0;
12711 if(type1->kind == 13 && type2->kind == 13)
12713 if(exp->op.op == '+')
12714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12715 else if(exp->op.op == '-')
12717 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12719 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12721 if(type1->type->kind == 20)
12723 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12727 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12729 ProcessExpressionType(classExp);
12731 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")))))));
12732 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12740 if(!success && exp->op.exp1->type == 2)
12742 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12745 FreeType(exp->expType);
12746 exp->expType = exp->op.exp1->destType;
12747 if(exp->op.exp1->destType)
12748 exp->op.exp1->destType->refCount++;
12751 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12754 FreeType(exp->expType);
12755 exp->expType = exp->op.exp2->destType;
12756 if(exp->op.exp2->destType)
12757 exp->op.exp2->destType->refCount++;
12763 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12766 FreeType(exp->expType);
12767 exp->expType = exp->op.exp2->destType;
12768 if(exp->op.exp2->destType)
12769 exp->op.exp2->destType->refCount++;
12772 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12775 FreeType(exp->expType);
12776 exp->expType = exp->op.exp1->destType;
12777 if(exp->op.exp1->destType)
12778 exp->op.exp1->destType->refCount++;
12784 char expString1[10240];
12785 char expString2[10240];
12789 expString1[0] = '\0';
12790 expString2[0] = '\0';
12795 PrintExpression(exp->op.exp1, expString1);
12796 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12797 PrintExpression(exp->op.exp2, expString2);
12798 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12799 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12800 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12802 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12806 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12808 if(exp->op.exp1->destType)
12809 FreeType(exp->op.exp1->destType);
12810 exp->op.exp1->destType = type2->_class->registered->dataType;
12811 if(type2->_class->registered->dataType)
12812 type2->_class->registered->dataType->refCount++;
12813 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12814 exp->expType = type2;
12818 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12820 if(exp->op.exp2->destType)
12821 FreeType(exp->op.exp2->destType);
12822 exp->op.exp2->destType = type1->_class->registered->dataType;
12823 if(type1->_class->registered->dataType)
12824 type1->_class->registered->dataType->refCount++;
12825 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12826 exp->expType = type1;
12832 unsigned int valid = 0x0;
12834 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12836 if(exp->op.exp2->destType)
12837 FreeType(exp->op.exp2->destType);
12838 if(!type1->_class->registered->dataType)
12839 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12840 exp->op.exp2->destType = type1->_class->registered->dataType;
12841 exp->op.exp2->destType->refCount++;
12842 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12843 type2 = exp->op.exp2->destType;
12844 exp->expType = type2;
12847 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12849 if(exp->op.exp1->destType)
12850 FreeType(exp->op.exp1->destType);
12851 if(!type2->_class->registered->dataType)
12852 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12853 exp->op.exp1->destType = type2->_class->registered->dataType;
12854 exp->op.exp1->destType->refCount++;
12855 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12856 type1 = exp->op.exp1->destType;
12857 exp->expType = type1;
12860 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12862 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12864 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12867 FreeType(exp->expType);
12868 exp->expType = exp->op.exp1->expType;
12869 if(exp->op.exp2->expType)
12870 exp->op.exp1->expType->refCount++;
12874 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12876 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12879 FreeType(exp->expType);
12880 exp->expType = exp->op.exp2->expType;
12881 if(exp->op.exp2->expType)
12882 exp->op.exp2->expType->refCount++;
12889 if(exp->op.exp2->destType)
12890 FreeType(exp->op.exp2->destType);
12891 exp->op.exp2->destType = type1;
12893 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12896 FreeType(exp->expType);
12897 exp->expType = exp->op.exp2->destType;
12898 if(exp->op.exp2->destType)
12899 exp->op.exp2->destType->refCount++;
12901 else if(type1 && type2)
12903 char expString1[10240];
12904 char expString2[10240];
12905 char type1String[1024];
12906 char type2String[1024];
12908 expString1[0] = '\0';
12909 expString2[0] = '\0';
12910 type1String[0] = '\0';
12911 type2String[0] = '\0';
12914 PrintExpression(exp->op.exp1, expString1);
12915 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12916 PrintExpression(exp->op.exp2, expString2);
12917 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12918 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12919 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12921 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12922 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12924 exp->expType = exp->op.exp1->expType;
12925 if(exp->op.exp1->expType)
12926 exp->op.exp1->expType->refCount++;
12928 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12930 exp->expType = exp->op.exp2->expType;
12931 if(exp->op.exp2->expType)
12932 exp->op.exp2->expType->refCount++;
12939 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12941 struct Type * oldType = exp->op.exp1->expType;
12943 exp->op.exp1->expType = (((void *)0));
12944 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12947 exp->op.exp1->expType = oldType;
12949 if(exp->op.exp1->destType)
12950 FreeType(exp->op.exp1->destType);
12951 exp->op.exp1->destType = type2;
12953 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12956 FreeType(exp->expType);
12957 exp->expType = exp->op.exp1->destType;
12958 if(exp->op.exp1->destType)
12959 exp->op.exp1->destType->refCount++;
12963 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12965 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12967 if(exp->op.exp1->destType)
12968 FreeType(exp->op.exp1->destType);
12969 exp->op.exp1->destType = type2->_class->registered->dataType;
12970 if(type2->_class->registered->dataType)
12971 type2->_class->registered->dataType->refCount++;
12972 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12974 if(exp->op.op == '!')
12976 exp->expType = MkClassType("bool");
12977 exp->expType->truth = 0x1;
12981 exp->expType = type2;
12986 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12988 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12990 if(exp->op.exp2->destType)
12991 FreeType(exp->op.exp2->destType);
12992 exp->op.exp2->destType = type1->_class->registered->dataType;
12993 if(type1->_class->registered->dataType)
12994 type1->_class->registered->dataType->refCount++;
12995 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12997 exp->expType = type1;
13003 if(exp->op.exp1 && !exp->op.exp1->expType)
13005 char expString[10000];
13007 expString[0] = '\0';
13010 PrintExpression(exp->op.exp1, expString);
13011 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13014 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13016 if(exp->op.exp2 && !exp->op.exp2->expType)
13018 char expString[10240];
13020 expString[0] = '\0';
13023 PrintExpression(exp->op.exp2, expString);
13024 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13031 FreeType(exp->expType);
13032 exp->expType = MkClassType("bool");
13033 exp->expType->truth = 0x1;
13035 if(exp->op.op != SIZEOF)
13036 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13037 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13039 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13041 yylloc = oldyylloc;
13048 struct Expression * e;
13050 exp->isConstant = 0x1;
13051 for(e = (*exp->list).first; e; e = e->next)
13053 unsigned int inced = 0x0;
13057 FreeType(e->destType);
13058 e->destType = exp->destType;
13061 exp->destType->refCount++;
13062 e->destType->count++;
13066 ProcessExpressionType(e);
13068 exp->destType->count--;
13069 if(!exp->expType && !e->next)
13071 exp->expType = e->expType;
13073 e->expType->refCount++;
13076 exp->isConstant = 0x0;
13078 e = (*exp->list).first;
13079 if(!e->next && e->type == 8)
13081 struct Expression * next = exp->next, * prev = exp->prev;
13083 FreeType(exp->expType);
13084 FreeType(exp->destType);
13085 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13089 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13090 ProcessExpressionType(exp);
13096 struct Expression * e;
13098 exp->isConstant = 0x1;
13099 ProcessExpressionType(exp->index.exp);
13100 if(!exp->index.exp->isConstant)
13101 exp->isConstant = 0x0;
13102 if(exp->index.exp->expType)
13104 struct Type * source = exp->index.exp->expType;
13106 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)
13108 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13110 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13111 if(exp->index.index && (*exp->index.index).last)
13113 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13117 for(e = (*exp->index.index).first; e; e = e->next)
13119 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13122 FreeType(e->destType);
13123 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13125 ProcessExpressionType(e);
13130 exp->isConstant = 0x0;
13133 exp->expType = Dereference(exp->index.exp->expType);
13135 DeclareType(exp->expType, 0x0, 0x0);
13140 struct Expression * e;
13141 struct Type * functionType;
13142 struct Type * methodType = (((void *)0));
13148 PrintExpression(exp->call.exp, name);
13149 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13151 PrintExpression(exp->call.exp, name);
13154 if(exp->call.exp->type == 0)
13156 struct Expression * idExp = exp->call.exp;
13157 struct Identifier * id = idExp->identifier;
13159 if(!strcmp(id->string, "__ENDIAN_PAD"))
13161 exp->expType = ProcessTypeString("int", 0x1);
13162 if(exp->call.arguments && (*exp->call.arguments).first)
13163 ProcessExpressionType((*exp->call.arguments).first);
13166 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13168 struct Expression * a = (((void *)0));
13169 struct Expression * b = (((void *)0));
13170 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13172 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13174 a = (*exp->call.arguments).first;
13175 b = (*exp->call.arguments).last;
13179 else if((*exp->call.arguments).count == 1)
13181 a = (*exp->call.arguments).first;
13186 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13187 idExp->identifier = (((void *)0));
13188 FreeExpContents(exp);
13189 ProcessExpressionType(a);
13191 ProcessExpressionType(b);
13193 exp->list = MkList();
13194 if(a->expType && (!b || b->expType))
13196 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13200 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13201 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13202 struct Declaration * decl;
13203 char temp1[1024], temp2[1024];
13205 GetTypeSpecs(a->expType, specs);
13206 if(a && !a->isConstant && a->type != 0)
13208 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13209 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13210 tempExp1 = QMkExpId(temp1);
13211 tempExp1->expType = a->expType;
13213 a->expType->refCount++;
13214 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13216 if(b && !b->isConstant && b->type != 0)
13218 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13219 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13220 tempExp2 = QMkExpId(temp2);
13221 tempExp2->expType = b->expType;
13223 b->expType->refCount++;
13224 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13226 decl = MkDeclaration(specs, decls);
13227 if(!curCompound->compound.declarations)
13228 curCompound->compound.declarations = MkList();
13229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13233 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13235 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13237 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13238 exp->expType = a->expType;
13240 a->expType->refCount++;
13242 else if(!strcmp(id->string, "Abs"))
13244 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13245 exp->expType = a->expType;
13247 a->expType->refCount++;
13249 else if(!strcmp(id->string, "Sgn"))
13251 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"))))));
13252 exp->expType = ProcessTypeString("int", 0x0);
13254 FreeExpression(tempExp1);
13256 FreeExpression(tempExp2);
13257 FreeIdentifier(id);
13263 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13265 if(!exp->call.exp->destType)
13267 exp->call.exp->destType = dummy;
13270 ProcessExpressionType(exp->call.exp);
13271 if(exp->call.exp->destType == dummy)
13274 exp->call.exp->destType = (((void *)0));
13278 functionType = exp->call.exp->expType;
13279 if(functionType && functionType->kind == 16)
13281 methodType = functionType;
13282 functionType = methodType->method->dataType;
13283 if(exp->call.exp->expType->usedClass)
13285 char typeString[1024];
13287 typeString[0] = '\0';
13288 PrintType(functionType, typeString, 0x1, 0x1);
13289 if(strstr(typeString, "thisclass"))
13291 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13292 struct Declarator * decl;
13295 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13297 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13298 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13299 thisClassParams = 0x0;
13300 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13302 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13304 thisClass = exp->call.exp->expType->usedClass;
13305 ProcessDeclarator(decl);
13306 thisClass = backupThisClass;
13308 thisClassParams = 0x1;
13309 functionType = ProcessType(specs, decl);
13310 functionType->refCount = 0;
13311 FinishTemplatesContext(context);
13313 FreeList(specs, FreeSpecifier);
13314 FreeDeclarator(decl);
13318 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13320 struct Type * type = functionType->type;
13322 if(!functionType->refCount)
13324 functionType->type = (((void *)0));
13325 FreeType(functionType);
13327 functionType = type;
13329 if(functionType && functionType->kind != 11)
13331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13333 else if(functionType)
13335 unsigned int emptyParams = 0x0, noParams = 0x0;
13336 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13337 struct Type * type = functionType->params.first;
13338 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13340 struct Location oldyylloc = yylloc;
13344 if(functionType->extraParam && e)
13346 e->destType = MkClassType(functionType->thisClass->string);
13349 if(!functionType->staticMethod)
13351 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13353 type = MkClassType(memberExp->member.exp->expType->_class->string);
13356 e->destType = type;
13358 type = functionType->params.first;
13361 type->refCount = 0;
13363 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13365 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13368 e->destType = type;
13370 type = functionType->params.first;
13373 type->refCount = 0;
13376 if(type && type->kind == 0)
13379 if(!type->refCount)
13381 type = (((void *)0));
13383 for(; e; e = e->next)
13385 if(!type && !emptyParams)
13388 if(methodType && methodType->methodClass)
13389 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);
13391 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);
13394 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13396 struct Type * templatedType = (((void *)0));
13397 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13398 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13401 if(_class && _class->templateArgs)
13403 struct __ecereNameSpace__ecere__com__Class * sClass;
13405 for(sClass = _class; sClass; sClass = sClass->base)
13407 if(sClass->templateClass)
13408 sClass = sClass->templateClass;
13410 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13412 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13414 struct __ecereNameSpace__ecere__com__Class * nextClass;
13416 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13418 if(nextClass->templateClass)
13419 nextClass = nextClass->templateClass;
13420 id += nextClass->templateParams.count;
13430 if(curParam && _class->templateArgs[id].dataTypeString)
13432 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13435 struct Context * context = SetupTemplatesContext(_class);
13437 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13438 FinishTemplatesContext(context);
13440 e->destType = templatedType;
13443 templatedType->passAsTemplate = 0x1;
13448 e->destType = type;
13455 e->destType = type;
13459 if(type && type->kind != 14)
13461 struct Type * next = type->next;
13463 if(!type->refCount)
13468 if(type && type->kind != 14)
13470 if(methodType && methodType->methodClass)
13471 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);
13473 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);
13475 yylloc = oldyylloc;
13476 if(type && !type->refCount)
13481 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13482 if(exp->call.exp->type == 0)
13484 char * string = exp->call.exp->identifier->string;
13488 struct Symbol * symbol;
13489 struct Location oldyylloc = yylloc;
13491 yylloc = exp->call.exp->identifier->loc;
13492 if(strstr(string, "__builtin_") == string)
13495 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13496 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));
13497 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13498 if(strstr(symbol->string, "::"))
13499 globalContext->hasNameSpace = 0x1;
13500 yylloc = oldyylloc;
13503 else if(exp->call.exp->type == 8)
13507 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13508 if(!functionType->returnType)
13510 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13513 if(functionType && functionType->kind == 11)
13515 exp->expType = functionType->returnType;
13516 if(functionType->returnType)
13517 functionType->returnType->refCount++;
13518 if(!functionType->refCount)
13519 FreeType(functionType);
13521 if(exp->call.arguments)
13523 for(e = (*exp->call.arguments).first; e; e = e->next)
13525 struct Type * destType = e->destType;
13527 ProcessExpressionType(e);
13534 struct Type * type;
13535 struct Location oldyylloc = yylloc;
13536 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13538 exp->thisPtr = thisPtr;
13539 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13541 exp->member.member->classSym = exp->member.member->_class->symbol;
13543 ProcessExpressionType(exp->member.exp);
13544 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)
13546 exp->isConstant = 0x0;
13549 exp->isConstant = exp->member.exp->isConstant;
13550 type = exp->member.exp->expType;
13552 if(type && (type->kind == 20))
13554 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13559 for(param = _class->templateParams.first; param; param = param->next)
13561 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13565 if(param && param->defaultArg.member)
13567 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13571 struct Expression * expMember = exp->member.exp;
13572 struct Declarator * decl;
13573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13574 char thisClassTypeString[1024];
13576 FreeIdentifier(exp->member.member);
13577 ProcessExpressionType(argExp);
13579 char * colon = strstr(param->defaultArg.memberString, "::");
13583 char className[1024];
13584 struct __ecereNameSpace__ecere__com__Class * sClass;
13586 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13587 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13590 strcpy(thisClassTypeString, _class->fullName);
13592 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13593 exp->expType = ProcessType(specs, decl);
13594 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13596 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13597 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13599 int paramCount = 0;
13600 int lastParam = -1;
13601 char templateString[1024];
13602 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13604 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13605 for(cClass = expClass; cClass; cClass = cClass->base)
13609 for(param = cClass->templateParams.first; param; param = param->next)
13612 struct __ecereNameSpace__ecere__com__Class * sClass;
13613 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13615 for(sClass = cClass->base; sClass; sClass = sClass->base)
13616 id += sClass->templateParams.count;
13617 arg = expClass->templateArgs[id];
13618 for(sClass = _class; sClass; sClass = sClass->base)
13620 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13622 struct __ecereNameSpace__ecere__com__Class * nextClass;
13624 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13625 p += nextClass->templateParams.count;
13626 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13628 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13630 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13632 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13633 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13640 char argument[256];
13642 argument[0] = '\0';
13643 switch(param->type)
13647 char expString[1024];
13648 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13649 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13650 struct Expression * exp;
13651 char * string = PrintHexUInt64(arg.expression.ui64);
13653 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13654 ProcessExpressionType(exp);
13655 ComputeExpression(exp);
13656 expString[0] = '\0';
13657 PrintExpression(exp, expString);
13658 strcat(argument, expString);
13659 FreeExpression(exp);
13664 strcat(argument, arg.member->name);
13669 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13671 if(!strcmp(arg.dataTypeString, "thisclass"))
13672 strcat(argument, thisClassTypeString);
13674 strcat(argument, arg.dataTypeString);
13682 strcat(templateString, ", ");
13683 if(lastParam != p - 1)
13685 strcat(templateString, param->name);
13686 strcat(templateString, " = ");
13688 strcat(templateString, argument);
13697 int len = strlen(templateString);
13699 if(templateString[len - 1] == '>')
13700 templateString[len++] = ' ';
13701 templateString[len++] = '>';
13702 templateString[len++] = '\0';
13705 struct Context * context = SetupTemplatesContext(_class);
13707 FreeType(exp->expType);
13708 exp->expType = ProcessTypeString(templateString, 0x0);
13709 FinishTemplatesContext(context);
13713 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")))))))));
13716 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13718 type = ProcessTemplateParameterType(type->templateParameter);
13721 if(type && (type->kind == 20))
13723 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13725 struct Identifier * id = exp->member.member;
13726 int typeKind = type->kind;
13727 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));
13729 if(typeKind == 19 && exp->member.exp->type == 26)
13731 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13734 if(id && (typeKind == 3 || typeKind == 15))
13735 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13738 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13739 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13740 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13741 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13742 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13744 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13745 exp->member.memberType = 1;
13746 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13750 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13752 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13753 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13755 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13757 member = (((void *)0));
13759 if(!member && !prop)
13760 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13761 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13762 exp->member.thisPtr = 0x1;
13768 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13769 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13770 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13772 if(!prop && !member)
13774 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13777 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13778 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13779 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13784 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13785 prop = (((void *)0));
13787 member = (((void *)0));
13791 if(!prop && !member)
13792 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13793 if(!prop && !member && !method)
13797 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13800 exp->member.memberType = 5;
13801 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13805 char structName[1024];
13806 struct Identifier * id = exp->member.member;
13807 struct Expression * classExp = exp->member.exp;
13810 FreeType(classExp->expType);
13811 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13812 strcpy(structName, "__ecereClassData_");
13813 FullClassNameCat(structName, type->_class->string, 0x0);
13815 exp->member.member = id;
13816 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"))))))));
13818 ProcessExpressionType(exp);
13824 struct Symbol * classSym = FindClass(id->string);
13828 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13831 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13837 exp->member.memberType = 1;
13838 if(!prop->dataType)
13839 ProcessPropertyType(prop);
13840 exp->expType = prop->dataType;
13842 prop->dataType->refCount++;
13846 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13848 FreeExpContents(exp);
13850 exp->identifier = MkIdentifier("class");
13851 ProcessExpressionType(exp);
13854 exp->member.memberType = 3;
13855 DeclareStruct(_class->fullName, 0x0);
13856 if(!member->dataType)
13858 struct Context * context = SetupTemplatesContext(_class);
13860 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13861 FinishTemplatesContext(context);
13863 exp->expType = member->dataType;
13864 if(member->dataType)
13865 member->dataType->refCount++;
13867 else if(revConvert)
13869 exp->member.memberType = 4;
13870 exp->expType = MkClassType(revConvert->_class->fullName);
13876 exp->member.memberType = 2;
13878 if(!method->dataType)
13879 ProcessMethodType(method);
13880 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));
13881 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13882 exp->expType->usedClass = _class;
13884 else if(!classProp)
13886 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13888 FreeExpContents(exp);
13890 exp->identifier = MkIdentifier("class");
13891 ProcessExpressionType(exp);
13894 yylloc = exp->member.member->loc;
13895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13897 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13899 if(_class && exp->expType)
13901 struct __ecereNameSpace__ecere__com__Class * tClass;
13904 while(tClass && !tClass->templateClass)
13905 tClass = tClass->base;
13906 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13909 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13910 struct __ecereNameSpace__ecere__com__Class * sClass;
13912 for(sClass = tClass; sClass; sClass = sClass->base)
13915 if(sClass->templateClass)
13916 sClass = sClass->templateClass;
13917 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13919 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13921 for(sClass = sClass->base; sClass; sClass = sClass->base)
13922 id += sClass->templateParams.count;
13930 if(curParam && tClass->templateArgs[id].dataTypeString)
13932 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13933 struct Context * context = SetupTemplatesContext(tClass);
13935 FreeType(exp->expType);
13936 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13939 if(exp->expType->kind == 21)
13941 FreeType(exp->expType);
13942 exp->expType = ReplaceThisClassType(_class);
13944 if(tClass->templateClass)
13945 exp->expType->passAsTemplate = 0x1;
13948 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13949 if(exp->destType->kind == 21)
13951 FreeType(exp->destType);
13952 exp->destType = ReplaceThisClassType(_class);
13956 FinishTemplatesContext(context);
13959 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13962 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13963 struct __ecereNameSpace__ecere__com__Class * sClass;
13965 for(sClass = tClass; sClass; sClass = sClass->base)
13968 if(sClass->templateClass)
13969 sClass = sClass->templateClass;
13970 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13972 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13974 for(sClass = sClass->base; sClass; sClass = sClass->base)
13975 id += sClass->templateParams.count;
13985 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13986 struct Context * context = SetupTemplatesContext(tClass);
13987 struct Type * basicType;
13989 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13992 if(basicType->kind == 21)
13994 FreeType(basicType);
13995 basicType = ReplaceThisClassType(_class);
13997 FreeType(exp->expType);
13998 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));
14001 exp->destType = exp->expType;
14002 exp->destType->refCount++;
14005 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14006 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14007 struct Declarator * decl;
14009 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14012 exp->destType->refCount++;
14014 exp->expType->refCount++;
14016 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14017 exp->cast.exp = newExp;
14020 FinishTemplatesContext(context);
14023 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14025 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14029 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14032 int paramCount = 0;
14033 int lastParam = -1;
14034 char templateString[1024];
14035 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14037 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14038 while(cClass != expClass)
14040 struct __ecereNameSpace__ecere__com__Class * sClass;
14042 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14045 for(param = cClass->templateParams.first; param; param = param->next)
14047 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14050 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14051 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14053 while(cClassCur != tClass && !paramCur)
14055 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14057 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14059 cClassCur = sClassCur;
14060 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14062 if(!strcmp(paramCur->name, param->name))
14069 if(paramCur && paramCur->type == 0)
14070 arg = tClass->templateArgs[cp];
14072 arg = expClass->templateArgs[p];
14074 char argument[256];
14076 argument[0] = '\0';
14077 switch(param->type)
14081 char expString[1024];
14082 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14083 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14084 struct Expression * exp;
14085 char * string = PrintHexUInt64(arg.expression.ui64);
14087 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14088 ProcessExpressionType(exp);
14089 ComputeExpression(exp);
14090 expString[0] = '\0';
14091 PrintExpression(exp, expString);
14092 strcat(argument, expString);
14093 FreeExpression(exp);
14098 strcat(argument, arg.member->name);
14103 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14104 strcat(argument, arg.dataTypeString);
14111 strcat(templateString, ", ");
14112 if(lastParam != p - 1)
14114 strcat(templateString, param->name);
14115 strcat(templateString, " = ");
14117 strcat(templateString, argument);
14126 int len = strlen(templateString);
14128 if(templateString[len - 1] == '>')
14129 templateString[len++] = ' ';
14130 templateString[len++] = '>';
14131 templateString[len++] = '\0';
14133 FreeType(exp->expType);
14135 struct Context * context = SetupTemplatesContext(tClass);
14137 exp->expType = ProcessTypeString(templateString, 0x0);
14138 FinishTemplatesContext(context);
14145 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)");
14147 else if(type && (type->kind == 9 || type->kind == 10))
14149 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14153 exp->expType = memberType;
14155 memberType->refCount++;
14160 char expString[10240];
14162 expString[0] = '\0';
14165 PrintExpression(exp, expString);
14166 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14170 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14172 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14174 struct Identifier * id = exp->member.member;
14175 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));
14179 FreeType(exp->expType);
14180 exp->expType = ReplaceThisClassType(_class);
14184 yylloc = oldyylloc;
14189 struct Type * destType = exp->destType;
14191 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14193 exp->member.member->classSym = exp->member.member->_class->symbol;
14195 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14199 ProcessExpressionType(exp);
14206 struct Symbol * classSym = exp->_class->symbol;
14208 if(classSym && classSym->registered)
14210 if(classSym->registered->type == 5)
14215 DeclareStruct(classSym->string, 0x0);
14216 FreeSpecifier(exp->_class);
14218 FullClassNameCat(name, classSym->string, 0x0);
14219 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14223 if(classSym->registered->fixed)
14225 FreeSpecifier(exp->_class);
14226 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14231 char className[1024];
14233 strcpy(className, "__ecereClass_");
14234 FullClassNameCat(className, classSym->string, 0x1);
14235 MangleClassName(className);
14236 DeclareClass(classSym, className);
14237 FreeExpContents(exp);
14239 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14240 exp->member.member = MkIdentifier("structSize");
14244 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14249 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14251 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14252 exp->isConstant = 0x1;
14253 DeclareType(type, 0x0, 0x0);
14259 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14261 type->count = (unsigned int)1;
14262 FreeType(exp->cast.exp->destType);
14263 exp->cast.exp->destType = type;
14265 ProcessExpressionType(exp->cast.exp);
14266 type->count = (unsigned int)0;
14267 exp->expType = type;
14268 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14270 void * prev = exp->prev, * next = exp->next;
14271 struct Type * expType = exp->cast.exp->destType;
14272 struct Expression * castExp = exp->cast.exp;
14273 struct Type * destType = exp->destType;
14276 expType->refCount++;
14277 FreeType(exp->expType);
14278 FreeTypeName(exp->cast.typeName);
14280 FreeType(exp->expType);
14281 FreeType(exp->destType);
14282 exp->expType = expType;
14283 exp->destType = destType;
14284 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14290 exp->isConstant = exp->cast.exp->isConstant;
14296 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14299 exp->expType = type;
14304 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14306 ProcessExpressionType(exp->vaArg.exp);
14308 exp->expType = type;
14313 struct Expression * e;
14315 exp->isConstant = 0x1;
14316 FreeType(exp->cond.cond->destType);
14317 exp->cond.cond->destType = MkClassType("bool");
14318 exp->cond.cond->destType->truth = 0x1;
14319 ProcessExpressionType(exp->cond.cond);
14320 if(!exp->cond.cond->isConstant)
14321 exp->isConstant = 0x0;
14322 for(e = (*exp->cond.exp).first; e; e = e->next)
14326 FreeType(e->destType);
14327 e->destType = exp->destType;
14329 e->destType->refCount++;
14331 ProcessExpressionType(e);
14334 exp->expType = e->expType;
14336 e->expType->refCount++;
14339 exp->isConstant = 0x0;
14341 FreeType(exp->cond.elseExp->destType);
14342 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14343 if(exp->cond.elseExp->destType)
14344 exp->cond.elseExp->destType->refCount++;
14345 ProcessExpressionType(exp->cond.elseExp);
14346 if(!exp->cond.elseExp->isConstant)
14347 exp->isConstant = 0x0;
14352 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14354 struct Statement * last = (*exp->compound->compound.statements).last;
14356 if(last->type == 3 && last->expressions && (*last->expressions).last)
14358 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14360 exp->destType->refCount++;
14362 ProcessStatement(exp->compound);
14363 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14364 if(((struct Expression *)(*last->expressions).last)->expType)
14365 exp->expType->refCount++;
14371 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14373 if(spec && spec->type == 1)
14375 exp->expType = MkClassType(spec->name);
14376 exp->expType->kind = 19;
14377 exp->byReference = 0x1;
14381 exp->expType = MkClassType("ecere::com::Class");
14382 exp->byReference = 0x1;
14388 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14392 struct Identifier * id = exp->classData.id;
14393 char structName[1024];
14394 struct Expression * classExp;
14396 strcpy(structName, "__ecereClassData_");
14397 FullClassNameCat(structName, _class->fullName, 0x0);
14399 exp->member.member = id;
14400 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14401 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14403 classExp = MkExpIdentifier(MkIdentifier("class"));
14404 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"))))))));
14405 ProcessExpressionType(exp);
14412 struct Type * type = (((void *)0));
14413 char * typeString = (((void *)0));
14414 char typeStringBuf[1024];
14416 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))
14418 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14420 typeString = templateClass->templateArgs[2].dataTypeString;
14424 struct Expression * e;
14426 for(e = (*exp->list).first; e; e = e->next)
14428 ProcessExpressionType(e);
14438 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14442 e->expType = (((void *)0));
14443 e = (*exp->list).first;
14444 ProcessExpressionType(e);
14447 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14449 FreeType(e->expType);
14450 e->expType = (((void *)0));
14452 type = (((void *)0));
14460 FreeType(e->expType);
14461 e->expType = (((void *)0));
14467 typeStringBuf[0] = '\0';
14468 PrintType(type, typeStringBuf, 0x0, 0x1);
14469 typeString = typeStringBuf;
14471 type = (((void *)0));
14476 char templateString[1024];
14477 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14478 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14479 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14480 struct Expression * expExt;
14481 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14483 sprintf(templateString, "Container<%s>", typeString);
14486 struct Expression * e;
14488 type = ProcessTypeString(typeString, 0x0);
14489 while(e = (*exp->list).first)
14491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14492 e->destType = type;
14494 ProcessExpressionType(e);
14495 ListAdd(initializers, MkInitializerAssignment(e));
14498 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14500 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14501 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14502 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14503 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14505 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14507 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14509 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))));
14510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14511 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 exp->expType = ProcessTypeString(templateString, 0x0);
14515 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14516 ProcessExpressionType(expExt);
14520 exp->expType = ProcessTypeString("Container", 0x0);
14521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14526 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14528 FreeType(exp->expType);
14529 exp->expType = ReplaceThisClassType(thisClass);
14531 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14533 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14537 if(exp->expType->kind != 15)
14539 struct Type * member;
14540 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14542 FreeType(exp->expType);
14543 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14544 exp->expType->kind = symbol->type->kind;
14545 exp->expType->refCount++;
14546 exp->expType->enumName = enumName;
14547 exp->expType->members = symbol->type->members;
14548 for(member = symbol->type->members.first; member; member = member->next)
14549 member->refCount++;
14553 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14555 for(member = symbol->type->members.first; member; member = member->next)
14557 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14565 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14567 else if(exp->destType && !exp->destType->keepCast)
14569 if(!CheckExpressionType(exp, exp->destType, 0x0))
14571 if(!exp->destType->count || unresolved)
14576 if(exp->destType->kind != 14)
14583 char expString[10240];
14585 expString[0] = '\0';
14586 PrintType(exp->destType, type2, 0x0, 0x1);
14589 PrintExpression(exp, expString);
14590 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14594 else if(exp->type != 16)
14595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14600 char expString[10240];
14602 expString[0] = '\0';
14605 PrintExpression(exp, expString);
14606 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14609 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14610 else if(exp->type != 16)
14611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14623 PrintType(exp->expType, type1, 0x0, 0x1);
14624 PrintType(exp->destType, type2, 0x0, 0x1);
14626 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)))
14630 char expString[10240];
14632 expString[0] = '\0';
14635 PrintExpression(exp, expString);
14636 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14638 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14639 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14640 FreeType(exp->expType);
14641 exp->destType->refCount++;
14642 exp->expType = exp->destType;
14647 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14649 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14650 char typeString[1024];
14651 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14652 struct Declarator * decl;
14654 typeString[0] = '\0';
14657 exp->expType->refCount++;
14659 exp->expType->refCount++;
14661 newExp->destType = exp->expType;
14662 PrintType(exp->expType, typeString, 0x0, 0x0);
14663 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14664 exp->cast.typeName = MkTypeName(specs, decl);
14665 exp->cast.exp = newExp;
14668 else if(unresolved)
14670 if(exp->identifier->_class && exp->identifier->_class->name)
14671 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14672 else if(exp->identifier->string && exp->identifier->string[0])
14673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14675 else if(!exp->expType && exp->type != 16)
14677 char expString[10240];
14679 expString[0] = '\0';
14682 PrintExpression(exp, expString);
14683 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14687 ApplyAnyObjectLogic(exp);
14688 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14690 exp->byReference = 0x1;
14692 yylloc = oldyylloc;
14695 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)
14699 *curMember = (*curMember)->next;
14700 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14702 *curMember = subMemberStack[--(*subMemberStackPos)];
14703 *curMember = (*curMember)->next;
14705 while((*curMember) && (*curMember)->isProperty)
14706 *curMember = (*curMember)->next;
14707 if(subMemberStackPos)
14709 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14711 subMemberStack[(*subMemberStackPos)++] = *curMember;
14712 *curMember = (*curMember)->members.first;
14713 while(*curMember && (*curMember)->isProperty)
14714 *curMember = (*curMember)->next;
14722 if(subMemberStackPos && *subMemberStackPos)
14724 *curMember = subMemberStack[--(*subMemberStackPos)];
14725 *curMember = (*curMember)->next;
14729 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14731 if(*curClass == _class)
14733 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14735 *curMember = (*curClass)->membersAndProperties.first;
14737 while((*curMember) && (*curMember)->isProperty)
14738 *curMember = (*curMember)->next;
14739 if(subMemberStackPos)
14741 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14743 subMemberStack[(*subMemberStackPos)++] = *curMember;
14744 *curMember = (*curMember)->members.first;
14745 while(*curMember && (*curMember)->isProperty)
14746 *curMember = (*curMember)->next;
14753 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14758 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14760 if(init->exp && !init->exp->destType)
14762 FreeType(init->exp->destType);
14763 init->exp->destType = type;
14769 ProcessExpressionType(init->exp);
14770 init->isConstant = init->exp->isConstant;
14776 struct Expression * exp = init->exp;
14777 struct Instantiation * inst = exp->instance;
14778 struct MembersInit * members;
14781 init->list = MkList();
14784 for(members = (*inst->members).first; members; members = members->next)
14786 if(members->type == 0)
14788 struct MemberInit * member;
14790 for(member = (*members->dataMembers).first; member; member = member->next)
14792 ListAdd(init->list, member->initializer);
14793 member->initializer = (((void *)0));
14798 FreeExpression(exp);
14802 struct Initializer * i;
14803 struct Type * initializerType = (((void *)0));
14804 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14805 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14806 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14807 int subMemberStackPos = 0;
14809 if(type && type->kind == 12)
14810 initializerType = Dereference(type);
14811 else if(type && (type->kind == 9 || type->kind == 10))
14812 initializerType = type->members.first;
14813 for(i = (*init->list).first; i; i = i->next)
14815 if(type && type->kind == 8 && type->_class && type->_class->registered)
14817 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14820 if(!curMember->dataType)
14821 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14822 initializerType = curMember->dataType;
14825 ProcessInitializer(i, initializerType);
14826 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14827 initializerType = initializerType->next;
14829 init->isConstant = 0x0;
14831 if(type && type->kind == 12)
14832 FreeType(initializerType);
14833 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14835 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14842 extern struct Symbol * FindType(struct Context * ctx, char * name);
14844 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14846 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14852 if(spec->specifier == THISCLASS)
14857 spec->name = ReplaceThisClass(thisClass);
14858 spec->symbol = FindClass(spec->name);
14859 ProcessSpecifier(spec, declareStruct);
14866 struct Symbol * symbol = FindType(curContext, spec->name);
14869 DeclareType(symbol->type, 0x1, 0x1);
14870 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14871 DeclareStruct(spec->name, 0x0);
14876 struct Enumerator * e;
14880 for(e = (*spec->list).first; e; e = e->next)
14883 ProcessExpressionType(e->exp);
14891 if(spec->definitions)
14893 struct ClassDef * def;
14894 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14896 ProcessClass(spec->definitions, symbol);
14903 static void ProcessDeclarator(struct Declarator * decl)
14908 if(decl->identifier->classSym)
14910 FreeSpecifier(decl->identifier->_class);
14911 decl->identifier->_class = (((void *)0));
14915 if(decl->array.exp)
14916 ProcessExpressionType(decl->array.exp);
14923 if(decl->declarator)
14924 ProcessDeclarator(decl->declarator);
14925 if(decl->type == 4)
14927 struct Identifier * id = GetDeclId(decl);
14929 if(id && id->_class)
14931 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14933 if(!decl->function.parameters)
14934 decl->function.parameters = MkList();
14935 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14936 id->_class = (((void *)0));
14938 if(decl->function.parameters)
14940 struct TypeName * param;
14942 for(param = (*decl->function.parameters).first; param; param = param->next)
14944 if(param->qualifiers && (*param->qualifiers).first)
14946 struct Specifier * spec = (*param->qualifiers).first;
14948 if(spec && spec->specifier == TYPED_OBJECT)
14950 struct Declarator * d = param->declarator;
14951 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);
14953 FreeList(param->qualifiers, FreeSpecifier);
14954 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14955 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14959 else if(spec && spec->specifier == ANY_OBJECT)
14961 struct Declarator * d = param->declarator;
14963 FreeList(param->qualifiers, FreeSpecifier);
14964 param->qualifiers = MkListOne(MkSpecifier(VOID));
14965 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14967 else if(spec->specifier == THISCLASS)
14972 spec->name = ReplaceThisClass(thisClass);
14973 spec->symbol = FindClass(spec->name);
14974 ProcessSpecifier(spec, 0x0);
14978 if(param->declarator)
14979 ProcessDeclarator(param->declarator);
14987 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14989 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14991 static void ProcessDeclaration(struct Declaration * decl)
14993 yylloc = decl->loc;
14998 unsigned int declareStruct = 0x0;
15000 if(decl->declarators)
15002 struct InitDeclarator * d;
15004 for(d = (*decl->declarators).first; d; d = d->next)
15006 struct Type * type, * subType;
15008 ProcessDeclarator(d->declarator);
15009 type = ProcessType(decl->specifiers, d->declarator);
15012 ProcessInitializer(d->initializer, type);
15013 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15015 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15017 struct Instantiation * inst = d->initializer->exp->instance;
15019 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15020 d->initializer->exp->instance = (((void *)0));
15021 if(decl->specifiers)
15022 FreeList(decl->specifiers, FreeSpecifier);
15023 FreeList(decl->declarators, FreeInitDeclarator);
15030 for(subType = type; subType; )
15032 if(subType->kind == 8)
15034 declareStruct = 0x1;
15037 else if(subType->kind == 13)
15039 else if(subType->kind == 12)
15040 subType = subType->arrayType;
15049 if(decl->specifiers)
15051 struct Specifier * s;
15053 for(s = (*decl->specifiers).first; s; s = s->next)
15055 ProcessSpecifier(s, declareStruct);
15062 ProcessInstantiationType(decl->inst);
15067 struct Specifier * spec;
15068 struct Declarator * d;
15069 unsigned int declareStruct = 0x0;
15071 if(decl->declarators)
15073 for(d = (*decl->declarators).first; d; d = d->next)
15075 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15076 struct Type * subType;
15078 ProcessDeclarator(d);
15079 for(subType = type; subType; )
15081 if(subType->kind == 8)
15083 declareStruct = 0x1;
15086 else if(subType->kind == 13)
15088 else if(subType->kind == 12)
15089 subType = subType->arrayType;
15096 if(decl->specifiers)
15098 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15099 ProcessSpecifier(spec, declareStruct);
15106 static struct FunctionDefinition * curFunction;
15108 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15110 char propName[1024], propNameM[1024];
15111 char getName[1024], setName[1024];
15112 struct __ecereNameSpace__ecere__sys__OldList * args;
15114 DeclareProperty(prop, setName, getName);
15115 strcpy(propName, "__ecereProp_");
15116 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15117 strcat(propName, "_");
15118 FullClassNameCat(propName, prop->name, 0x1);
15119 MangleClassName(propName);
15120 strcpy(propNameM, "__ecerePropM_");
15121 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15122 strcat(propNameM, "_");
15123 FullClassNameCat(propNameM, prop->name, 0x1);
15124 MangleClassName(propNameM);
15125 if(prop->isWatchable)
15128 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15129 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15130 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15132 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15133 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15134 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15138 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15139 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15140 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15142 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15143 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15144 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15146 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15147 curFunction->propSet->fireWatchersDone = 0x1;
15150 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15152 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15154 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15156 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15158 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15160 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15162 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15164 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15166 static void ProcessStatement(struct Statement * stmt)
15168 yylloc = stmt->loc;
15172 ProcessStatement(stmt->labeled.stmt);
15175 if(stmt->caseStmt.exp)
15177 FreeType(stmt->caseStmt.exp->destType);
15178 stmt->caseStmt.exp->destType = curSwitchType;
15180 curSwitchType->refCount++;
15181 ProcessExpressionType(stmt->caseStmt.exp);
15182 ComputeExpression(stmt->caseStmt.exp);
15184 if(stmt->caseStmt.stmt)
15185 ProcessStatement(stmt->caseStmt.stmt);
15189 if(stmt->compound.context)
15191 struct Declaration * decl;
15192 struct Statement * s;
15193 struct Statement * prevCompound = curCompound;
15194 struct Context * prevContext = curContext;
15196 if(!stmt->compound.isSwitch)
15198 curCompound = stmt;
15199 curContext = stmt->compound.context;
15201 if(stmt->compound.declarations)
15203 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15204 ProcessDeclaration(decl);
15206 if(stmt->compound.statements)
15208 for(s = (*stmt->compound.statements).first; s; s = s->next)
15209 ProcessStatement(s);
15211 curContext = prevContext;
15212 curCompound = prevCompound;
15218 struct Expression * exp;
15220 if(stmt->expressions)
15222 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15223 ProcessExpressionType(exp);
15229 struct Expression * exp;
15231 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15232 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15233 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15234 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15236 ProcessExpressionType(exp);
15238 if(stmt->ifStmt.stmt)
15239 ProcessStatement(stmt->ifStmt.stmt);
15240 if(stmt->ifStmt.elseStmt)
15241 ProcessStatement(stmt->ifStmt.elseStmt);
15246 struct Type * oldSwitchType = curSwitchType;
15248 if(stmt->switchStmt.exp)
15250 struct Expression * exp;
15252 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15256 ProcessExpressionType(exp);
15259 curSwitchType = exp->expType;
15262 ProcessStatement(stmt->switchStmt.stmt);
15263 curSwitchType = oldSwitchType;
15268 if(stmt->whileStmt.exp)
15270 struct Expression * exp;
15272 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15273 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15274 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15275 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15277 ProcessExpressionType(exp);
15280 if(stmt->whileStmt.stmt)
15281 ProcessStatement(stmt->whileStmt.stmt);
15286 if(stmt->doWhile.exp)
15288 struct Expression * exp;
15290 if((*stmt->doWhile.exp).last)
15292 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15293 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15294 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15296 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15298 ProcessExpressionType(exp);
15301 if(stmt->doWhile.stmt)
15302 ProcessStatement(stmt->doWhile.stmt);
15307 struct Expression * exp;
15309 if(stmt->forStmt.init)
15310 ProcessStatement(stmt->forStmt.init);
15311 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15313 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15314 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15315 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15317 if(stmt->forStmt.check)
15318 ProcessStatement(stmt->forStmt.check);
15319 if(stmt->forStmt.increment)
15321 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15322 ProcessExpressionType(exp);
15324 if(stmt->forStmt.stmt)
15325 ProcessStatement(stmt->forStmt.stmt);
15330 struct Identifier * id = stmt->forEachStmt.id;
15331 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15332 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15333 struct Statement * block = stmt->forEachStmt.stmt;
15334 char iteratorType[1024];
15335 struct Type * source;
15336 struct Expression * e;
15337 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));
15338 struct Expression * arrayExp;
15339 char * typeString = (((void *)0));
15340 int builtinCount = 0;
15342 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15346 FreeType(e->destType);
15347 e->destType = ProcessTypeString("Container", 0x0);
15349 if(!isBuiltin || e->next)
15350 ProcessExpressionType(e);
15352 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15353 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15355 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15356 struct Symbol * symbol;
15357 struct Expression * expIt = (((void *)0));
15358 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15359 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15360 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15361 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15364 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15365 stmt->compound.context->parent = curContext;
15366 curContext = stmt->compound.context;
15367 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15369 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15370 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15372 isCustomAVLTree = 0x1;
15373 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15375 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15378 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15380 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15382 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15385 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15389 struct Declarator * decl;
15390 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15392 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15393 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15394 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15398 struct Type * type = (((void *)0));
15399 char typeStringBuf[1024];
15401 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15402 if(((struct Expression *)(*exp).last)->type == 11)
15404 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15407 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15409 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)
15411 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15413 typeString = templateClass->templateArgs[2].dataTypeString;
15415 else if(arrayExp->list)
15417 struct Expression * e;
15419 for(e = (*arrayExp->list).first; e; e = e->next)
15421 ProcessExpressionType(e);
15431 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15435 e->expType = (((void *)0));
15436 e = (*arrayExp->list).first;
15437 ProcessExpressionType(e);
15440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15442 FreeType(e->expType);
15443 e->expType = (((void *)0));
15445 type = (((void *)0));
15453 FreeType(e->expType);
15454 e->expType = (((void *)0));
15460 typeStringBuf[0] = '\0';
15461 PrintType(type, typeStringBuf, 0x0, 0x1);
15462 typeString = typeStringBuf;
15468 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15469 struct Declarator * decl;
15470 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15474 struct Expression * e;
15476 builtinCount = (*arrayExp->list).count;
15477 type = ProcessTypeString(typeString, 0x0);
15478 while(e = (*arrayExp->list).first)
15480 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15481 e->destType = type;
15483 ProcessExpressionType(e);
15484 ListAdd(initializers, MkInitializerAssignment(e));
15487 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15489 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15490 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15491 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15492 FreeList(exp, FreeExpression);
15496 arrayExp->expType = ProcessTypeString("Container", 0x0);
15497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15500 else if(isLinkList && !isList)
15502 struct Declarator * decl;
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15505 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15506 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15507 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15509 else if(_class->templateArgs)
15512 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15514 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15515 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15517 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15518 if(block && block->type == 2 && block->compound.context)
15520 block->compound.context->parent = stmt->compound.context;
15524 block = MkIfStmt(filter, block, (((void *)0)));
15528 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));
15529 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15530 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15531 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15537 sprintf(count, "%d", builtinCount);
15538 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));
15539 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15540 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15541 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15543 else if(isLinkList && !isList)
15545 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15546 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15548 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15550 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));
15554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15555 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15557 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));
15559 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15560 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15561 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15565 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15567 ProcessExpressionType(expIt);
15568 if((*stmt->compound.declarations).first)
15569 ProcessDeclaration((*stmt->compound.declarations).first);
15571 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15572 ProcessStatement(stmt);
15573 curContext = stmt->compound.context->parent;
15578 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15590 struct Expression * exp;
15592 if(stmt->expressions)
15594 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15598 if(curFunction && !curFunction->type)
15599 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15600 FreeType(exp->destType);
15601 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15603 exp->destType->refCount++;
15605 ProcessExpressionType(exp);
15612 ProcessDeclaration(stmt->decl);
15617 struct AsmField * field;
15619 if(stmt->asmStmt.inputFields)
15621 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15622 if(field->expression)
15623 ProcessExpressionType(field->expression);
15625 if(stmt->asmStmt.outputFields)
15627 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15628 if(field->expression)
15629 ProcessExpressionType(field->expression);
15631 if(stmt->asmStmt.clobberedFields)
15633 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15635 if(field->expression)
15636 ProcessExpressionType(field->expression);
15643 struct PropertyWatch * propWatch;
15644 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15645 struct Expression * object = stmt->_watch.object;
15646 struct Expression * watcher = stmt->_watch.watcher;
15649 ProcessExpressionType(watcher);
15651 ProcessExpressionType(object);
15654 if(watcher || thisClass)
15656 struct External * external = curExternal;
15657 struct Context * context = curContext;
15660 stmt->expressions = MkList();
15661 curExternal = external->prev;
15662 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15664 struct ClassFunction * func;
15665 char watcherName[1024];
15666 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15667 struct External * createdExternal;
15668 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15671 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15672 if(propWatch->deleteWatch)
15673 strcat(watcherName, "_delete");
15676 struct Identifier * propID;
15678 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15680 strcat(watcherName, "_");
15681 strcat(watcherName, propID->string);
15684 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15686 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15687 ProcessClassFunctionBody(func, propWatch->compound);
15688 propWatch->compound = (((void *)0));
15689 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15690 createdExternal->symbol->idCode = external->symbol->idCode;
15691 curExternal = createdExternal;
15692 ProcessFunction(createdExternal->function);
15694 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15696 externalDecl->declaration = decl;
15697 if(decl->symbol && !decl->symbol->pointerExternal)
15698 decl->symbol->pointerExternal = externalDecl;
15700 if(propWatch->deleteWatch)
15702 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15704 ListAdd(args, CopyExpression(object));
15705 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15706 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15707 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15711 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15712 struct Identifier * propID;
15714 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15716 char propName[1024];
15717 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15721 char getName[1024], setName[1024];
15722 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15724 DeclareProperty(prop, setName, getName);
15725 strcpy(propName, "__ecereProp_");
15726 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15727 strcat(propName, "_");
15728 FullClassNameCat(propName, prop->name, 0x1);
15729 ListAdd(args, CopyExpression(object));
15730 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15731 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15732 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15733 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15736 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15741 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15743 curExternal = external;
15744 curContext = context;
15746 FreeExpression(watcher);
15748 FreeExpression(object);
15749 FreeList(watches, FreePropertyWatch);
15752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15756 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15758 ProcessStatement(propWatch->compound);
15765 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15766 struct Expression * object = stmt->_watch.object;
15767 struct __ecereNameSpace__ecere__com__Class * _class;
15770 ProcessExpressionType(object);
15773 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15776 struct Identifier * propID;
15779 stmt->expressions = MkList();
15780 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15782 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15789 for(propID = (*watches).first; propID; propID = propID->next)
15791 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15795 CreateFireWatcher(prop, object, stmt);
15798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15803 struct __ecereNameSpace__ecere__com__Property * prop;
15804 struct __ecereNameSpace__ecere__com__Class * base;
15806 for(base = _class; base; base = base->base)
15808 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15810 if(prop->isProperty && prop->isWatchable)
15812 CreateFireWatcher(prop, object, stmt);
15818 FreeExpression(object);
15819 FreeList(watches, FreeIdentifier);
15822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15828 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15829 struct Expression * object = stmt->_watch.object;
15830 struct Expression * watcher = stmt->_watch.watcher;
15831 struct __ecereNameSpace__ecere__com__Class * _class;
15834 ProcessExpressionType(object);
15836 ProcessExpressionType(watcher);
15839 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15840 if(watcher || thisClass)
15844 struct Identifier * propID;
15847 stmt->expressions = MkList();
15850 struct __ecereNameSpace__ecere__sys__OldList * args;
15853 ListAdd(args, CopyExpression(object));
15854 ListAdd(args, MkExpConstant("0"));
15855 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15856 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15860 for(propID = (*watches).first; propID; propID = propID->next)
15862 char propName[1024];
15863 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15867 char getName[1024], setName[1024];
15868 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15870 DeclareProperty(prop, setName, getName);
15871 strcpy(propName, "__ecereProp_");
15872 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15873 strcat(propName, "_");
15874 FullClassNameCat(propName, prop->name, 0x1);
15875 MangleClassName(propName);
15876 ListAdd(args, CopyExpression(object));
15877 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15878 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15879 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15882 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15886 FreeExpression(object);
15888 FreeExpression(watcher);
15889 FreeList(watches, FreeIdentifier);
15892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15902 extern struct Expression * QBrackets(struct Expression * exp);
15904 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15906 extern struct Declarator * QMkPtrDecl(char * id);
15908 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15910 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15912 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15914 static void ProcessFunction(struct FunctionDefinition * function)
15916 void * __ecereTemp2;
15917 void * __ecereTemp1;
15918 struct Identifier * id = GetDeclId(function->declarator);
15919 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15920 struct Type * type = symbol ? symbol->type : (((void *)0));
15921 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15922 struct Context * oldTopContext = topContext;
15924 yylloc = function->loc;
15925 if(type && type->thisClass)
15927 struct Symbol * classSym = type->thisClass;
15928 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15929 char className[1024];
15930 char structName[1024];
15931 struct Declarator * funcDecl;
15932 struct Symbol * thisSymbol;
15933 unsigned int typedObject = 0x0;
15935 if(_class && !_class->base)
15937 _class = currentClass;
15938 if(_class && !_class->symbol)
15939 _class->symbol = FindClass(_class->fullName);
15940 classSym = _class ? _class->symbol : (((void *)0));
15943 thisClass = _class;
15944 if(inCompiler && _class)
15946 if(type->kind == 11)
15948 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15950 struct Type * param = symbol->type->params.first;
15952 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15955 if(type->classObjectType != 1)
15957 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15958 symbol->type->staticMethod = 0x1;
15959 symbol->type->thisClass = (((void *)0));
15960 symbol->type->extraParam = 0x0;
15963 strcpy(className, "__ecereClass_");
15964 FullClassNameCat(className, _class->fullName, 0x1);
15965 MangleClassName(className);
15966 structName[0] = (char)0;
15967 FullClassNameCat(structName, _class->fullName, 0x0);
15968 funcDecl = GetFuncDecl(function->declarator);
15971 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15973 struct TypeName * param = (*funcDecl->function.parameters).first;
15975 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15977 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15978 FreeTypeName(param);
15981 if(!function->propertyNoThis)
15983 struct TypeName * thisParam;
15985 if(type->classObjectType != 1)
15987 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15988 if(!funcDecl->function.parameters)
15989 funcDecl->function.parameters = MkList();
15990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15994 if(type->classObjectType != 1)
15996 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15997 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15999 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));
16000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16004 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16006 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16008 funcDecl = GetFuncDecl(initDecl->declarator);
16011 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16013 struct TypeName * param = (*funcDecl->function.parameters).first;
16015 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16018 FreeTypeName(param);
16021 if(type->classObjectType != 1)
16023 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16025 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16027 if(!funcDecl->function.parameters)
16028 funcDecl->function.parameters = MkList();
16029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16037 if(type->classObjectType != 1)
16039 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));
16040 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16041 if(typedObject && thisSymbol->type)
16043 thisSymbol->type->classObjectType = 2;
16044 thisSymbol->type->byReference = type->byReference;
16048 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16050 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16053 struct __ecereNameSpace__ecere__com__Class * base;
16055 for(base = _class; base && base->type != 1000; base = base->next)
16057 for(member = base->membersAndProperties.first; member; member = member->next)
16058 if(!member->isProperty)
16064 for(member = _class->membersAndProperties.first; member; member = member->next)
16065 if(!member->isProperty)
16069 char pointerName[1024];
16070 struct Declaration * decl;
16071 struct Initializer * initializer;
16072 struct Expression * exp, * bytePtr;
16074 strcpy(pointerName, "__ecerePointer_");
16075 FullClassNameCat(pointerName, _class->fullName, 0x0);
16077 char className[1024];
16079 strcpy(className, "__ecereClass_");
16080 FullClassNameCat(className, classSym->string, 0x1);
16081 MangleClassName(className);
16082 DeclareClass(classSym, className);
16084 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16089 sprintf(string, "%d", _class->offset);
16090 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16094 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16096 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16097 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));
16100 yylloc = function->body->loc;
16101 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16103 struct Context * prevContext = curContext;
16105 curContext = function->body->compound.context;
16106 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16107 curContext = prevContext;
16109 decl->symbol = (((void *)0));
16110 if(!function->body->compound.declarations)
16111 function->body->compound.declarations = MkList();
16112 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16118 thisClass = (((void *)0));
16121 FreeSpecifier(id->_class);
16122 id->_class = (((void *)0));
16123 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16125 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16127 id = GetDeclId(initDecl->declarator);
16128 FreeSpecifier(id->_class);
16129 id->_class = (((void *)0));
16133 topContext = function->body->compound.context;
16135 struct FunctionDefinition * oldFunction = curFunction;
16137 curFunction = function;
16139 ProcessStatement(function->body);
16140 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16142 struct Statement * prevCompound = curCompound;
16143 struct Context * prevContext = curContext;
16144 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16146 if(!function->body->compound.statements)
16147 function->body->compound.statements = MkList();
16148 ListAdd(function->body->compound.statements, fireWatchers);
16149 curCompound = function->body;
16150 curContext = function->body->compound.context;
16151 ProcessStatement(fireWatchers);
16152 curContext = prevContext;
16153 curCompound = prevCompound;
16155 curFunction = oldFunction;
16157 if(function->declarator)
16159 ProcessDeclarator(function->declarator);
16161 topContext = oldTopContext;
16162 thisClass = oldThisClass;
16165 extern void FreeSymbol(struct Symbol * symbol);
16167 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16169 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16171 struct ClassDef * def;
16172 struct External * external = curExternal;
16173 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16175 for(def = definitions->first; def; def = def->next)
16179 if(def->function->declarator)
16180 curExternal = def->function->declarator->symbol->pointerExternal;
16182 curExternal = external;
16183 ProcessFunction((struct FunctionDefinition *)def->function);
16185 else if(def->type == 2)
16187 if(def->decl->type == 2)
16189 thisClass = regClass;
16190 ProcessInstantiationType(def->decl->inst);
16191 thisClass = (((void *)0));
16195 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16198 thisClass = regClass;
16199 ProcessDeclaration(def->decl);
16200 thisClass = backThisClass;
16203 else if(def->type == 1 && def->defProperties)
16205 struct MemberInit * defProperty;
16206 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);
16208 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16209 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16211 thisClass = regClass;
16212 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16213 thisClass = (((void *)0));
16215 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16216 FreeSymbol(thisSymbol);
16218 else if(def->type == 3 && def->propertyDef)
16220 struct PropertyDef * prop = def->propertyDef;
16222 thisClass = regClass;
16227 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16229 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16231 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16232 ProcessStatement(prop->setStmt);
16238 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16240 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16242 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16243 ProcessStatement(prop->getStmt);
16245 if(prop->issetStmt)
16249 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16251 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16253 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16254 ProcessStatement(prop->issetStmt);
16256 thisClass = (((void *)0));
16258 else if(def->type == 4 && def->propertyWatch)
16260 struct PropertyWatch * propertyWatch = def->propertyWatch;
16262 thisClass = regClass;
16263 if(propertyWatch->compound)
16265 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);
16267 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16268 curExternal = (((void *)0));
16269 ProcessStatement(propertyWatch->compound);
16271 thisClass = (((void *)0));
16276 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16278 void ComputeDataTypes()
16280 void * __ecereTemp1;
16281 struct External * external;
16282 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16284 currentClass = (((void *)0));
16285 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16286 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16288 curExternal = temp;
16289 DeclareStruct("ecere::com::Class", 0x0);
16290 DeclareStruct("ecere::com::Instance", 0x0);
16291 DeclareStruct("ecere::com::Property", 0x0);
16292 DeclareStruct("ecere::com::DataMember", 0x0);
16293 DeclareStruct("ecere::com::Method", 0x0);
16294 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16295 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16297 for(external = (*ast).first; external; external = external->next)
16299 afterExternal = curExternal = external;
16300 if(external->type == 0)
16302 currentClass = external->function->_class;
16303 ProcessFunction(external->function);
16305 else if(external->type == 1)
16307 currentClass = (((void *)0));
16308 ProcessDeclaration(external->declaration);
16310 else if(external->type == 2)
16312 struct ClassDefinition * _class = external->_class;
16314 currentClass = external->symbol->registered;
16315 if(_class->definitions)
16317 ProcessClass(_class->definitions, _class->symbol);
16321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16322 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16325 else if(external->type == 4)
16327 thisNameSpace = external->id->string;
16330 currentClass = (((void *)0));
16331 thisNameSpace = (((void *)0));
16332 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16333 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16336 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);
16338 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);
16340 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16342 struct __ecereNameSpace__ecere__com__Class * class;
16344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16379 __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);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16383 __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);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16396 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16397 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16398 __ecereClass_Conversion = class;
16399 __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);
16400 __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);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16402 __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);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16421 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)