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 int targetBits;
2507 extern unsigned int inCompiler;
2509 extern void Compiler_Error(char * format, ...);
2511 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2513 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2515 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2517 int ComputeTypeSize(struct Type * type)
2519 unsigned int size = type ? type->size : 0;
2521 if(!size && type && !type->computing)
2523 type->computing = 0x1;
2527 type->alignment = size = sizeof(char);
2530 type->alignment = size = sizeof(int);
2533 type->alignment = size = sizeof(long long);
2536 type->alignment = size = targetBits / 8;
2539 type->alignment = size = sizeof(long);
2542 type->alignment = size = sizeof(short);
2545 type->alignment = size = sizeof(float);
2548 type->alignment = size = sizeof(double);
2552 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2554 if(_class && _class->type == 1)
2556 ComputeClassMembers(_class, 0x0);
2557 type->alignment = _class->structAlignment;
2558 size = _class->structSize;
2559 if(type->alignment && size % type->alignment)
2560 size += type->alignment - (size % type->alignment);
2562 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2564 if(!_class->dataType)
2565 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2566 size = type->alignment = ComputeTypeSize(_class->dataType);
2569 size = type->alignment = targetBits / 8;
2574 size = type->alignment = targetBits / 8;
2577 if(type->arraySizeExp)
2579 ProcessExpressionType(type->arraySizeExp);
2580 ComputeExpression(type->arraySizeExp);
2581 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)))
2583 struct Location oldLoc = yylloc;
2584 char expression[10240];
2586 expression[0] = '\0';
2587 type->arraySizeExp->expType = (((void *)0));
2588 yylloc = type->arraySizeExp->loc;
2590 PrintExpression(type->arraySizeExp, expression);
2591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2594 GetInt(type->arraySizeExp, &type->arraySize);
2596 else if(type->enumClass)
2598 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2600 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2603 type->arraySize = 0;
2607 type->arraySize = 0;
2609 size = ComputeTypeSize(type->type) * type->arraySize;
2610 type->alignment = type->type->alignment;
2614 struct Type * member;
2616 for(member = type->members.first; member; member = member->next)
2618 int __simpleStruct0, __simpleStruct1;
2619 unsigned int addSize = ComputeTypeSize(member);
2621 member->offset = size;
2622 if(member->alignment && size % member->alignment)
2623 member->offset += member->alignment - (size % member->alignment);
2624 size = member->offset;
2625 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2628 if(type->alignment && size % type->alignment)
2629 size += type->alignment - (size % type->alignment);
2634 struct Type * member;
2636 for(member = type->members.first; member; member = member->next)
2638 int __simpleStruct0, __simpleStruct1;
2639 unsigned int addSize = ComputeTypeSize(member);
2641 member->offset = size;
2642 if(member->alignment && size % member->alignment)
2643 member->offset += member->alignment - (size % member->alignment);
2644 size = member->offset;
2645 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2646 size = ((size > addSize) ? size : addSize);
2648 if(type->alignment && size % type->alignment)
2649 size += type->alignment - (size % type->alignment);
2654 struct TemplateParameter * param = type->templateParameter;
2655 struct Type * baseType = ProcessTemplateParameterType(param);
2658 size = ComputeTypeSize(baseType);
2660 size = sizeof(uint64);
2673 size = targetBits / 8;
2678 type->computing = 0x0;
2683 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2685 extern struct Identifier * MkIdentifier(char * string);
2687 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2689 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2691 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2693 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2695 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2697 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2699 extern void FreeType(struct Type * type);
2701 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2703 extern struct Specifier * MkSpecifier(int specifier);
2705 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2707 extern struct Expression * MkExpConstant(char * string);
2709 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)
2711 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2712 unsigned int totalSize = 0;
2713 unsigned int maxSize = 0;
2714 int alignment, size;
2715 struct __ecereNameSpace__ecere__com__DataMember * member;
2716 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2718 if(!isMember && _class->base)
2720 maxSize = _class->structSize;
2722 if(_class->type == 1 || _class->type == 5)
2723 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2725 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2728 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2730 if(!member->isProperty)
2732 switch(member->type)
2736 if(member->dataTypeString)
2738 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2739 struct Declarator * decl;
2741 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2742 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2743 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2744 if(!member->dataType)
2745 member->dataType = ProcessType(specs, decl);
2746 ReplaceThisClassSpecifiers(specs, topClass);
2748 struct Type * type = ProcessType(specs, decl);
2750 DeclareType(member->dataType, 0x0, 0x0);
2753 ComputeTypeSize(member->dataType);
2754 size = member->dataType->size;
2755 alignment = member->dataType->alignment;
2758 if(totalSize % alignment)
2759 totalSize += alignment - (totalSize % alignment);
2768 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2771 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2772 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2773 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2774 alignment = member->structAlignment;
2777 if(totalSize % alignment)
2778 totalSize += alignment - (totalSize % alignment);
2788 unsigned int __simpleStruct0;
2790 if(topMember && topMember->type == 1)
2791 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2793 *retSize += totalSize;
2795 else if(totalSize < maxSize && _class->type != 1000)
2797 char sizeString[50];
2799 sprintf(sizeString, "%d", maxSize - totalSize);
2800 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2803 FinishTemplatesContext(context);
2804 return topMember ? topMember->memberID : _class->memberID;
2807 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2809 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2810 unsigned int totalSize = 0;
2811 struct __ecereNameSpace__ecere__com__DataMember * member;
2812 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2814 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2815 DeclareMembers(_class->base, 0x0);
2816 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2818 if(!member->isProperty)
2820 switch(member->type)
2824 if(!member->dataType && member->dataTypeString)
2825 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2826 if(member->dataType)
2827 DeclareType(member->dataType, 0x0, 0x0);
2833 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2840 FinishTemplatesContext(context);
2841 return topMember ? topMember->memberID : _class->memberID;
2844 extern struct Symbol * FindClass(char * name);
2846 extern char * strchr(char * , int);
2848 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2850 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2852 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2854 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2856 extern char * strcpy(char * , const char * );
2858 extern void MangleClassName(char * className);
2860 extern void DeclareClass(struct Symbol * classSym, char * className);
2862 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2864 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2866 void DeclareStruct(char * name, unsigned int skipNoHead)
2868 struct External * external = (((void *)0));
2869 struct Symbol * classSym = FindClass(name);
2871 if(!inCompiler || !classSym)
2872 return (((void *)0));
2873 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2874 return (((void *)0));
2875 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2877 struct Declaration * decl;
2878 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2879 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2880 char structName[1024];
2882 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2883 classSym->declaring++;
2884 if(strchr(classSym->string, '<'))
2886 if(classSym->registered->templateClass)
2888 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2889 classSym->declaring--;
2891 return (((void *)0));
2893 DeclareMembers(classSym->registered, 0x0);
2894 structName[0] = (char)0;
2895 FullClassNameCat(structName, name, 0x0);
2898 classSym->declaredStructSym = 0x1;
2899 declarations = MkList();
2900 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2901 if(!(*declarations).count)
2903 FreeList(declarations, (((void *)0)));
2904 declarations = (((void *)0));
2907 if(skipNoHead || declarations)
2909 if(external && external->declaration)
2911 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2912 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2914 if(classSym->structExternal)
2915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2917 classSym->id = curExternal->symbol->idCode;
2918 classSym->idCode = curExternal->symbol->idCode;
2924 external = MkExternalDeclaration((((void *)0)));
2925 specifiers = MkList();
2926 declarators = MkList();
2927 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2928 external->declaration = decl = MkDeclaration(specifiers, declarators);
2929 if(decl->symbol && !decl->symbol->pointerExternal)
2930 decl->symbol->pointerExternal = external;
2931 if(classSym->registered && classSym->registered->type == 1)
2933 char className[1024];
2935 strcpy(className, "__ecereClass_");
2936 FullClassNameCat(className, classSym->string, 0x1);
2937 MangleClassName(className);
2938 DeclareClass(classSym, className);
2939 external->symbol = classSym;
2940 classSym->pointerExternal = external;
2941 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2942 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2946 char className[1024];
2948 strcpy(className, "__ecereClass_");
2949 FullClassNameCat(className, classSym->string, 0x1);
2950 MangleClassName(className);
2951 classSym->structExternal = external;
2952 DeclareClass(classSym, className);
2953 external->symbol = classSym;
2955 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2958 classSym->declaring--;
2960 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2962 classSym->declaring++;
2964 if(classSym->registered)
2965 DeclareMembers(classSym->registered, 0x0);
2967 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2969 if(classSym->structExternal)
2970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2971 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2972 classSym->id = curExternal->symbol->idCode;
2973 classSym->idCode = curExternal->symbol->idCode;
2975 classSym->declaring--;
2979 extern char * strcat(char * , const char * );
2981 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2983 extern struct ModuleImport * mainModule;
2985 extern struct Specifier * MkSpecifierName(char * name);
2987 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2989 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2991 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2993 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2995 extern void FreeDeclarator(struct Declarator * decl);
2997 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2999 struct PropertyImport
3001 struct PropertyImport * prev;
3002 struct PropertyImport * next;
3004 unsigned int isVirtual;
3005 unsigned int hasSet;
3006 unsigned int hasGet;
3007 } __attribute__ ((gcc_struct));
3009 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3011 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3013 void * __ecereTemp1;
3014 struct Symbol * symbol = prop->symbol;
3015 char propName[1024];
3017 strcpy(setName, "__ecereProp_");
3018 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3019 strcat(setName, "_Set_");
3020 FullClassNameCat(setName, prop->name, 0x1);
3021 strcpy(getName, "__ecereProp_");
3022 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3023 strcat(getName, "_Get_");
3024 FullClassNameCat(getName, prop->name, 0x1);
3025 strcpy(propName, "__ecereProp_");
3026 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3027 strcat(propName, "_");
3028 FullClassNameCat(propName, prop->name, 0x1);
3029 MangleClassName(getName);
3030 MangleClassName(setName);
3031 MangleClassName(propName);
3032 if(prop->_class->type == 1)
3033 DeclareStruct(prop->_class->fullName, 0x0);
3034 if(!symbol || curExternal->symbol->idCode < symbol->id)
3036 unsigned int imported = 0x0;
3037 unsigned int dllImport = 0x0;
3039 if(!symbol || symbol->_import)
3043 struct Symbol * classSym;
3045 if(!prop->_class->symbol)
3046 prop->_class->symbol = FindClass(prop->_class->fullName);
3047 classSym = prop->_class->symbol;
3048 if(classSym && !classSym->_import)
3050 struct ModuleImport * module;
3052 if(prop->_class->module)
3053 module = FindModule(prop->_class->module);
3055 module = mainModule;
3056 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));
3057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3059 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3060 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));
3062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3065 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3070 struct Context * context = SetupTemplatesContext(prop->_class);
3072 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3073 FinishTemplatesContext(context);
3077 if(!symbol->externalGet || symbol->externalGet->type == 0)
3079 struct Declaration * decl;
3080 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3081 struct Declarator * d;
3082 struct __ecereNameSpace__ecere__sys__OldList * params;
3083 struct Specifier * spec;
3084 struct External * external;
3085 struct Declarator * typeDecl;
3086 unsigned int simple = 0x0;
3088 specifiers = MkList();
3089 declarators = MkList();
3091 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3092 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3094 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3096 struct Context * context = SetupTemplatesContext(prop->_class);
3098 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3099 FinishTemplatesContext(context);
3101 for(spec = (*specifiers).first; spec; spec = spec->next)
3105 if((!typeDecl || typeDecl->type == 1))
3107 struct Symbol * classSym = spec->symbol;
3109 symbol->_class = classSym->registered;
3110 if(classSym->registered && classSym->registered->type == 1)
3112 DeclareStruct(spec->name, 0x0);
3119 d = PlugDeclarator(typeDecl, d);
3122 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3123 specifiers = MkList();
3125 d = MkDeclaratorFunction(d, params);
3127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3128 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3131 ListAdd(specifiers, MkSpecifier(VOID));
3132 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3133 decl = MkDeclaration(specifiers, declarators);
3134 external = MkExternalDeclaration(decl);
3135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3136 external->symbol = symbol;
3137 symbol->externalGet = external;
3138 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3140 FreeDeclarator(typeDecl);
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3149 if(!symbol->externalSet || symbol->externalSet->type == 0)
3151 struct Declaration * decl;
3152 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3153 struct Declarator * d;
3154 struct __ecereNameSpace__ecere__sys__OldList * params;
3155 struct Specifier * spec;
3156 struct External * external;
3157 struct Declarator * typeDecl;
3159 declarators = MkList();
3161 if(!prop->conversion || prop->_class->type == 1)
3163 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3165 specifiers = MkList();
3167 struct Context * context = SetupTemplatesContext(prop->_class);
3169 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3170 FinishTemplatesContext(context);
3172 ListAdd(params, MkTypeName(specifiers, d));
3173 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3175 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3176 d = MkDeclaratorFunction(d, params);
3177 for(spec = (*specifiers).first; spec; spec = spec->next)
3181 if((!typeDecl || typeDecl->type == 1))
3183 struct Symbol * classSym = spec->symbol;
3185 symbol->_class = classSym->registered;
3186 if(classSym->registered && classSym->registered->type == 1)
3187 DeclareStruct(spec->name, 0x0);
3191 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3192 specifiers = MkList();
3194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3195 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3197 if(!prop->conversion || prop->_class->type == 1)
3198 ListAdd(specifiers, MkSpecifier(VOID));
3200 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3201 decl = MkDeclaration(specifiers, declarators);
3202 external = MkExternalDeclaration(decl);
3203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3204 external->symbol = symbol;
3205 symbol->externalSet = external;
3206 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3213 if(!symbol->externalPtr)
3215 struct Declaration * decl;
3216 struct External * external;
3217 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3223 ListAdd(specifiers, MkSpecifierName("Property"));
3225 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3227 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3230 strcpy(propName, "__ecerePropM_");
3231 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3232 strcat(propName, "_");
3233 FullClassNameCat(propName, prop->name, 0x1);
3234 MangleClassName(propName);
3235 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3237 decl = MkDeclaration(specifiers, list);
3239 external = MkExternalDeclaration(decl);
3240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3241 external->symbol = symbol;
3242 symbol->externalPtr = external;
3246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3248 symbol->id = curExternal->symbol->idCode;
3252 struct Type * Dereference(struct Type * source)
3254 void * __ecereTemp1;
3255 struct Type * type = (((void *)0));
3259 if(source->kind == 13 || source->kind == 12)
3261 type = source->type;
3262 source->type->refCount++;
3264 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3266 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3268 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3274 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3279 static struct Type * Reference(struct Type * source)
3281 void * __ecereTemp1;
3282 struct Type * type = (((void *)0));
3286 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));
3292 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);
3294 extern void * memcpy(void * , const void * , unsigned int size);
3296 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3298 extern void FreeExpression(struct Expression * exp);
3300 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3302 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);
3304 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3306 extern struct Type * MkClassType(char * name);
3308 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);
3310 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)
3312 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3313 unsigned int found = 0x0;
3314 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3315 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3316 unsigned int freeType = 0x0;
3318 yylloc = member->loc;
3323 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3327 dataMember = *curMember;
3333 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3334 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3335 int _subMemberStackPos = 0;
3338 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3341 dataMember = thisMember;
3342 if(curMember && thisMember->memberAccess == 1)
3344 *curMember = thisMember;
3345 *curClass = thisMember->_class;
3346 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3347 *subMemberStackPos = _subMemberStackPos;
3353 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3354 if(method && method->type == 1)
3357 method = (((void *)0));
3362 struct Type * type = (((void *)0));
3366 if(!dataMember->dataType && dataMember->dataTypeString)
3368 struct Context * context = SetupTemplatesContext(_class);
3370 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3371 FinishTemplatesContext(context);
3373 type = dataMember->dataType;
3377 if(!method->dataType)
3378 ProcessMethodType(method);
3379 type = method->dataType;
3381 if(ident && ident->next)
3383 for(ident = ident->next; ident && type; ident = ident->next)
3387 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3389 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3391 type = dataMember->dataType;
3393 else if(type->kind == 9 || type->kind == 10)
3395 struct Type * memberType;
3397 for(memberType = type->members.first; memberType; memberType = memberType->next)
3399 if(!strcmp(memberType->name, ident->string))
3408 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3411 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3412 struct __ecereNameSpace__ecere__com__Class * sClass;
3414 for(sClass = _class; sClass; sClass = sClass->base)
3417 if(sClass->templateClass)
3418 sClass = sClass->templateClass;
3419 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3421 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3423 for(sClass = sClass->base; sClass; sClass = sClass->base)
3425 if(sClass->templateClass)
3426 sClass = sClass->templateClass;
3427 id += sClass->templateParams.count;
3438 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3440 if(arg.dataTypeString)
3442 type = ProcessTypeString(arg.dataTypeString, 0x0);
3444 if(type && _class->templateClass)
3445 type->passAsTemplate = 0x1;
3452 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3454 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3455 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3459 char templateString[1024];
3460 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3462 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3463 for(cClass = expClass; cClass; cClass = cClass->base)
3467 if(cClass->templateClass)
3468 cClass = cClass->templateClass;
3469 for(param = cClass->templateParams.first; param; param = param->next)
3472 struct __ecereNameSpace__ecere__com__Class * sClass;
3473 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3475 for(sClass = cClass->base; sClass; sClass = sClass->base)
3477 if(sClass->templateClass)
3478 sClass = sClass->templateClass;
3479 id += sClass->templateParams.count;
3481 arg = expClass->templateArgs[id];
3482 for(sClass = _class; sClass; sClass = sClass->base)
3484 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3486 struct __ecereNameSpace__ecere__com__Class * nextClass;
3488 if(sClass->templateClass)
3489 sClass = sClass->templateClass;
3490 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3492 if(nextClass->templateClass)
3493 nextClass = nextClass->templateClass;
3494 p += nextClass->templateParams.count;
3496 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3498 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3500 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3502 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3503 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3517 char expString[1024];
3518 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3519 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3520 struct Expression * exp;
3521 char * string = PrintHexUInt64(arg.expression.ui64);
3523 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3524 ProcessExpressionType(exp);
3525 ComputeExpression(exp);
3526 expString[0] = '\0';
3527 PrintExpression(exp, expString);
3528 strcat(argument, expString);
3529 FreeExpression(exp);
3534 strcat(argument, arg.member->name);
3539 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3540 strcat(argument, arg.dataTypeString);
3547 strcat(templateString, ", ");
3548 if(lastParam != p - 1)
3550 strcat(templateString, param->name);
3551 strcat(templateString, " = ");
3553 strcat(templateString, argument);
3562 int len = strlen(templateString);
3564 if(templateString[len - 1] == '<')
3568 if(templateString[len - 1] == '>')
3569 templateString[len++] = ' ';
3570 templateString[len++] = '>';
3572 templateString[len++] = '\0';
3575 struct Context * context = SetupTemplatesContext(_class);
3579 type = ProcessTypeString(templateString, 0x0);
3581 FinishTemplatesContext(context);
3584 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3586 ProcessExpressionType(member->initializer->exp);
3587 if(!member->initializer->exp->expType)
3591 char expString[10240];
3593 expString[0] = '\0';
3594 PrintExpression(member->initializer->exp, expString);
3595 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3599 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3604 else if(member->initializer)
3606 ProcessInitializer(member->initializer, type);
3613 if(_class && _class->type == 3)
3615 if(member->initializer)
3617 struct Type * type = MkClassType(_class->fullName);
3619 ProcessInitializer(member->initializer, type);
3625 if(member->initializer)
3627 ProcessInitializer(member->initializer, (((void *)0)));
3633 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3637 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3639 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3648 extern struct Identifier * GetDeclId(struct Declarator * decl);
3650 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);
3652 extern void FreeSpecifier(struct Specifier * spec);
3654 static void ProcessFunction(struct FunctionDefinition * function);
3656 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3658 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3660 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3662 extern void FreeClassFunction(struct ClassFunction * func);
3664 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3666 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3668 void ProcessInstantiationType(struct Instantiation * inst)
3673 struct MembersInit * members;
3674 struct Symbol * classSym;
3675 struct __ecereNameSpace__ecere__com__Class * _class;
3677 classSym = inst->_class->symbol;
3678 _class = classSym ? classSym->registered : (((void *)0));
3679 if(!_class || _class->type != 5)
3680 DeclareStruct(inst->_class->name, 0x0);
3681 afterExternal = afterExternal ? afterExternal : curExternal;
3683 ProcessExpressionType(inst->exp);
3684 inst->isConstant = 0x1;
3687 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3688 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3689 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3690 int subMemberStackPos = 0;
3692 for(members = (*inst->members).first; members; members = members->next)
3694 switch(members->type)
3699 static unsigned int instMethodID = 0;
3700 struct External * external = curExternal;
3701 struct Context * context = curContext;
3702 struct Declarator * declarator = members->function->declarator;
3703 struct Identifier * nameID = GetDeclId(declarator);
3704 char * unmangled = nameID ? nameID->string : (((void *)0));
3705 struct Expression * exp;
3706 struct External * createdExternal = (((void *)0));
3712 strcpy(name, "__ecereInstMeth_");
3713 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3715 strcat(name, nameID->string);
3717 sprintf(number, "_%08d", instMethodID++);
3718 strcat(name, number);
3719 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3723 struct Symbol * symbol = declarator->symbol;
3724 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3726 if(method && method->type == 1)
3728 symbol->method = method;
3729 ProcessMethodType(method);
3730 if(!symbol->type->thisClass)
3732 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3734 if(!currentClass->symbol)
3735 currentClass->symbol = FindClass(currentClass->fullName);
3736 symbol->type->thisClass = currentClass->symbol;
3741 _class->symbol = FindClass(_class->fullName);
3742 symbol->type->thisClass = _class->symbol;
3745 DeclareType(symbol->type, 0x1, 0x1);
3749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3752 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3755 FreeSpecifier(nameID->_class);
3756 nameID->_class = (((void *)0));
3760 struct Type * type = declarator->symbol->type;
3761 struct External * oldExternal = curExternal;
3763 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3765 struct External * externalDecl;
3767 externalDecl = MkExternalDeclaration((((void *)0)));
3768 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3769 if(createdExternal->function)
3771 ProcessFunction(createdExternal->function);
3773 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3775 externalDecl->declaration = decl;
3776 if(decl->symbol && !decl->symbol->pointerExternal)
3777 decl->symbol->pointerExternal = externalDecl;
3778 declarator->symbol->pointerExternal = externalDecl;
3785 curExternal = declarator->symbol->pointerExternal;
3786 ProcessFunction((struct FunctionDefinition *)members->function);
3788 curExternal = external;
3789 curContext = context;
3792 FreeClassFunction(members->function);
3793 exp = QMkExpId(name);
3795 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3796 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3802 if(members->dataMembers && classSym)
3804 struct MemberInit * member;
3805 struct Location oldyyloc = yylloc;
3807 for(member = (*members->dataMembers).first; member; member = member->next)
3809 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3810 if(member->initializer && !member->initializer->isConstant)
3811 inst->isConstant = 0x0;
3823 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3827 if(type->kind == 11)
3829 struct Type * param;
3833 for(param = type->params.first; param; param = param->next)
3834 DeclareType(param, declarePointers, 0x1);
3836 DeclareType(type->returnType, declarePointers, 0x1);
3838 else if(type->kind == 13 && declarePointers)
3839 DeclareType(type->type, declarePointers, 0x0);
3840 else if(type->kind == 8)
3842 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3843 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3845 else if(type->kind == 9 || type->kind == 10)
3847 struct Type * member;
3849 for(member = type->members.first; member; member = member->next)
3850 DeclareType(member, 0x0, 0x0);
3852 else if(type->kind == 12)
3853 DeclareType(type->arrayType, declarePointers, 0x0);
3857 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3863 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3864 struct __ecereNameSpace__ecere__com__Class * sClass;
3866 for(sClass = _class; sClass; sClass = sClass->base)
3869 if(sClass->templateClass)
3870 sClass = sClass->templateClass;
3871 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3873 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3875 for(sClass = sClass->base; sClass; sClass = sClass->base)
3877 if(sClass->templateClass)
3878 sClass = sClass->templateClass;
3879 id += sClass->templateParams.count;
3890 arg = &_class->templateArgs[id];
3891 if(arg && param->type == 0)
3892 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3897 extern struct Context * PushContext(void);
3899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3901 struct TemplatedType
3904 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3905 struct __ecereNameSpace__ecere__sys__BTNode * left;
3906 struct __ecereNameSpace__ecere__sys__BTNode * right;
3908 struct TemplateParameter * param;
3909 } __attribute__ ((gcc_struct));
3911 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3913 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3915 void * __ecereTemp1;
3916 struct Context * context = PushContext();
3918 context->templateTypesOnly = 0x1;
3919 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3921 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3923 for(; param; param = param->next)
3925 if(param->type == 0 && param->identifier)
3927 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3929 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3935 struct __ecereNameSpace__ecere__com__Class * sClass;
3937 for(sClass = _class; sClass; sClass = sClass->base)
3939 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3941 for(p = sClass->templateParams.first; p; p = p->next)
3945 struct TemplateParameter * param = p->param;
3946 struct TemplatedType * type;
3950 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));
3952 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));
3953 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3961 extern void PopContext(struct Context * ctx);
3963 extern void FreeContext(struct Context * context);
3965 void FinishTemplatesContext(struct Context * context)
3967 PopContext(context);
3968 FreeContext(context);
3969 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3972 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3974 if(!method->dataType)
3976 struct Context * context = SetupTemplatesContext(method->_class);
3978 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3979 FinishTemplatesContext(context);
3980 if(method->type != 1 && method->dataType)
3982 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3984 if(!method->_class->symbol)
3985 method->_class->symbol = FindClass(method->_class->fullName);
3986 method->dataType->thisClass = method->_class->symbol;
3992 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3996 struct Context * context = SetupTemplatesContext(prop->_class);
3998 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3999 FinishTemplatesContext(context);
4003 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4005 extern void FreeTypeName(struct TypeName * typeName);
4007 static void ProcessDeclarator(struct Declarator * decl);
4009 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4015 struct MethodImport * prev;
4016 struct MethodImport * next;
4018 unsigned int isVirtual;
4019 } __attribute__ ((gcc_struct));
4021 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4023 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4025 void * __ecereTemp1;
4026 struct Symbol * symbol = method->symbol;
4028 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4030 unsigned int imported = 0x0;
4031 unsigned int dllImport = 0x0;
4033 if(!method->dataType)
4034 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4035 if(!symbol || symbol->_import || method->type == 1)
4037 if(!symbol || method->type == 1)
4039 struct Symbol * classSym;
4041 if(!method->_class->symbol)
4042 method->_class->symbol = FindClass(method->_class->fullName);
4043 classSym = method->_class->symbol;
4044 if(!classSym->_import)
4046 struct ModuleImport * module;
4048 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4049 module = FindModule(method->_class->module);
4051 module = mainModule;
4052 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));
4053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4057 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4059 if(!symbol->_import)
4061 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));
4062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4066 symbol->type = method->dataType;
4068 symbol->type->refCount++;
4071 if(!method->dataType->dllExport)
4074 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4078 if(method->type != 1 && method->dataType)
4079 DeclareType(method->dataType, 0x1, 0x1);
4080 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4082 struct Declaration * decl;
4083 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4084 struct Declarator * d;
4085 struct Declarator * funcDecl;
4086 struct External * external;
4088 specifiers = MkList();
4089 declarators = MkList();
4091 ListAdd(specifiers, MkSpecifier(EXTERN));
4092 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4093 ListAdd(specifiers, MkSpecifier(STATIC));
4094 if(method->type == 1)
4096 ListAdd(specifiers, MkSpecifier(INT));
4097 d = MkDeclaratorIdentifier(MkIdentifier(name));
4101 d = MkDeclaratorIdentifier(MkIdentifier(name));
4103 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4105 struct Context * context = SetupTemplatesContext(method->_class);
4107 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4108 FinishTemplatesContext(context);
4110 funcDecl = GetFuncDecl(d);
4113 struct Specifier * spec, * next;
4115 for(spec = (*specifiers).first; spec; spec = next)
4120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4121 FreeSpecifier(spec);
4125 if(method->dataType && !method->dataType->staticMethod)
4127 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4129 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4130 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")));
4131 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4132 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4134 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4136 struct TypeName * param = (*funcDecl->function.parameters).first;
4138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4139 FreeTypeName(param);
4141 if(!funcDecl->function.parameters)
4142 funcDecl->function.parameters = MkList();
4143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4147 ProcessDeclarator(d);
4148 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4149 decl = MkDeclaration(specifiers, declarators);
4150 ReplaceThisClassSpecifiers(specifiers, method->_class);
4151 if(symbol->pointerExternal)
4153 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4156 *functionSymbol = *symbol;
4157 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4158 if(functionSymbol->type)
4159 functionSymbol->type->refCount++;
4161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4162 symbol->pointerExternal->symbol = functionSymbol;
4164 external = MkExternalDeclaration(decl);
4166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4167 external->symbol = symbol;
4168 symbol->pointerExternal = external;
4172 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4174 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4178 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4180 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4182 unsigned int first = 0x1;
4184 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4186 char className[1024];
4188 strcpy(className, _class->fullName);
4189 for(param = _class->templateParams.first; param; param = param->next)
4193 strcat(className, "<");
4195 strcat(className, ", ");
4196 if(lastParam + 1 != p)
4198 strcat(className, param->name);
4199 strcat(className, " = ");
4201 strcat(className, param->name);
4209 int len = strlen(className);
4211 if(className[len - 1] == '>')
4212 className[len++] = ' ';
4213 className[len++] = '>';
4214 className[len++] = '\0';
4216 return __ecereNameSpace__ecere__sys__CopyString(className);
4219 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4222 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4224 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4226 unsigned int first = 0x1;
4228 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4230 char className[1024];
4232 strcpy(className, _class->fullName);
4233 for(param = _class->templateParams.first; param; param = param->next)
4237 strcat(className, "<");
4239 strcat(className, ", ");
4240 if(lastParam + 1 != p)
4242 strcat(className, param->name);
4243 strcat(className, " = ");
4245 strcat(className, param->name);
4253 int len = strlen(className);
4255 if(className[len - 1] == '>')
4256 className[len++] = ' ';
4257 className[len++] = '>';
4258 className[len++] = '\0';
4260 return MkClassType(className);
4264 return MkClassType(_class->fullName);
4268 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4270 if(specs != (((void *)0)) && _class)
4272 struct Specifier * spec;
4274 for(spec = specs->first; spec; spec = spec->next)
4276 if(spec->type == 0 && spec->specifier == THISCLASS)
4279 spec->name = ReplaceThisClass(_class);
4280 spec->symbol = FindClass(spec->name);
4286 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4288 struct __ecereNameSpace__ecere__com__GlobalFunction
4290 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4291 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4294 struct __ecereNameSpace__ecere__com__Instance * module;
4295 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4296 char * dataTypeString;
4297 struct Type * dataType;
4299 } __attribute__ ((gcc_struct));
4301 extern struct Context * globalContext;
4303 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4305 struct FunctionImport
4307 struct FunctionImport * prev;
4308 struct FunctionImport * next;
4310 } __attribute__ ((gcc_struct));
4312 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4314 void * __ecereTemp1;
4315 struct Symbol * symbol = function->symbol;
4317 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4319 unsigned int imported = 0x0;
4320 unsigned int dllImport = 0x0;
4322 if(!function->dataType)
4324 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4325 if(!function->dataType->thisClass)
4326 function->dataType->staticMethod = 0x1;
4332 struct ModuleImport * module = FindModule(function->module);
4334 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4337 if(!function->dataType->dllExport)
4339 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));
4340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4344 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4345 if(!symbol->type->thisClass)
4346 symbol->type->staticMethod = 0x1;
4349 imported = symbol->_import ? 0x1 : 0x0;
4350 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4353 DeclareType(function->dataType, 0x1, 0x1);
4356 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4358 struct Declaration * decl;
4359 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4360 struct Declarator * d;
4361 struct Declarator * funcDecl;
4362 struct External * external;
4364 specifiers = MkList();
4365 declarators = MkList();
4366 ListAdd(specifiers, MkSpecifier(EXTERN));
4367 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4369 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4370 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4371 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4373 struct Specifier * spec;
4375 for(spec = (*specifiers).first; spec; spec = spec->next)
4376 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4379 FreeSpecifier(spec);
4383 funcDecl = GetFuncDecl(d);
4384 if(funcDecl && !funcDecl->function.parameters)
4386 funcDecl->function.parameters = MkList();
4387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4389 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4391 struct Context * oldCtx = curContext;
4393 curContext = globalContext;
4394 decl = MkDeclaration(specifiers, declarators);
4395 curContext = oldCtx;
4397 if(symbol->pointerExternal)
4399 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4402 *functionSymbol = *symbol;
4403 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4404 if(functionSymbol->type)
4405 functionSymbol->type->refCount++;
4407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4408 symbol->pointerExternal->symbol = functionSymbol;
4410 external = MkExternalDeclaration(decl);
4412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4413 external->symbol = symbol;
4414 symbol->pointerExternal = external;
4418 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4421 symbol->id = curExternal->symbol->idCode;
4424 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4427 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4432 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4433 struct __ecereNameSpace__ecere__sys__BTNode * left;
4434 struct __ecereNameSpace__ecere__sys__BTNode * right;
4436 struct __ecereNameSpace__ecere__com__Instance * module;
4437 char * dataTypeString;
4438 struct Type * dataType;
4441 } __attribute__ ((gcc_struct));
4443 void DeclareGlobalData(struct GlobalData * data)
4445 struct Symbol * symbol = data->symbol;
4447 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4452 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4455 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4456 DeclareType(data->dataType, 0x1, 0x1);
4459 if(!symbol->pointerExternal)
4461 struct Declaration * decl;
4462 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4463 struct Declarator * d;
4464 struct External * external;
4466 specifiers = MkList();
4467 declarators = MkList();
4468 ListAdd(specifiers, MkSpecifier(EXTERN));
4469 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4470 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4471 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4472 decl = MkDeclaration(specifiers, declarators);
4473 external = MkExternalDeclaration(decl);
4475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4476 external->symbol = symbol;
4477 symbol->pointerExternal = external;
4481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4484 symbol->id = curExternal->symbol->idCode;
4491 struct Conversion * prev, * next;
4492 struct __ecereNameSpace__ecere__com__Property * convert;
4494 struct Type * resultType;
4495 } __attribute__ ((gcc_struct));
4497 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4499 extern void Compiler_Warning(char * format, ...);
4501 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4503 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)
4507 if(source->kind == 20 && dest->kind != 20)
4509 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4514 if(dest->kind == 20 && source->kind != 20)
4516 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4521 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4525 if(source->classObjectType == 3 && dest->classObjectType != 2)
4529 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4531 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4534 if(dest->kind == 14 && source->kind != 0)
4536 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))
4538 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))
4540 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4542 if(source->_class->registered && source->_class->registered->type == 3)
4544 if(conversions != (((void *)0)))
4546 if(source->_class->registered == dest->_class->registered)
4551 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4553 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4555 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4557 if(sourceBase == destBase)
4561 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))
4565 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4567 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4574 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4578 if(source->kind == 8)
4580 struct __ecereNameSpace__ecere__com__Class * _class;
4582 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4584 struct __ecereNameSpace__ecere__com__Property * convert;
4586 for(convert = _class->conversions.first; convert; convert = convert->next)
4588 if(convert->memberAccess == 1 || _class->module == privateModule)
4590 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4592 if(!convert->dataType)
4593 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4594 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4596 if(!conversions && !convert->Get)
4598 else if(conversions != (((void *)0)))
4600 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))
4604 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4606 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4617 struct __ecereNameSpace__ecere__com__Class * _class;
4619 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4621 struct __ecereNameSpace__ecere__com__Property * convert;
4623 for(convert = _class->conversions.first; convert; convert = convert->next)
4625 if(convert->memberAccess == 1 || _class->module == privateModule)
4627 if(!convert->dataType)
4628 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4629 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4631 if(!conversions && !convert->Set)
4633 else if(conversions != (((void *)0)))
4635 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))
4639 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4649 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4651 if(!dest->_class->registered->dataType)
4652 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4653 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4655 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4662 if(source->kind == 8)
4664 struct __ecereNameSpace__ecere__com__Class * _class;
4666 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4668 struct __ecereNameSpace__ecere__com__Property * convert;
4670 for(convert = _class->conversions.first; convert; convert = convert->next)
4672 if(convert->memberAccess == 1 || _class->module == privateModule)
4674 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4676 if(!convert->dataType)
4677 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4678 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4680 if(!conversions && !convert->Get)
4682 else if(conversions != (((void *)0)))
4684 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))
4688 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4698 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4700 if(!source->_class->registered->dataType)
4701 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4702 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4709 if(source->kind == 8 || source->kind == 19)
4711 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4713 else if(dest->kind == 7 && source->kind == 6)
4715 else if(dest->kind == 2 && source->kind == 1)
4717 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4719 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4721 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4723 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4725 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4727 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)))
4729 struct Type * paramSource, * paramDest;
4731 if(dest->kind == 16)
4732 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4733 if(source->kind == 16)
4734 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4735 if(dest->kind == 13 && dest->type->kind == 11)
4737 if(source->kind == 13 && source->type->kind == 11)
4738 source = source->type;
4739 if(dest->kind == 16)
4740 dest = dest->method->dataType;
4741 if(source->kind == 16)
4742 source = source->method->dataType;
4743 paramSource = source->params.first;
4744 if(paramSource && paramSource->kind == 0)
4745 paramSource = (((void *)0));
4746 paramDest = dest->params.first;
4747 if(paramDest && paramDest->kind == 0)
4748 paramDest = (((void *)0));
4749 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4751 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))))
4753 if(paramDest && paramDest->kind == 8)
4754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4759 paramDest = paramDest->next;
4761 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4763 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4767 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4775 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4780 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4784 paramSource = paramSource->next;
4790 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4792 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4798 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4806 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4808 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4811 for(; paramDest; paramDest = paramDest->next)
4815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4819 struct Type * paramDestType = paramDest;
4820 struct Type * paramSourceType = paramSource;
4821 struct Type * type = paramDestType;
4823 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4826 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4827 struct __ecereNameSpace__ecere__com__Class * sClass;
4829 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4832 if(sClass->templateClass)
4833 sClass = sClass->templateClass;
4834 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4836 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4838 for(sClass = sClass->base; sClass; sClass = sClass->base)
4840 if(sClass->templateClass)
4841 sClass = sClass->templateClass;
4842 id += sClass->templateParams.count;
4853 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4855 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4858 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)))
4863 PrintType(paramDest, type, 0x0, 0x1);
4864 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4865 if(paramDestType != paramDest)
4866 FreeType(paramDestType);
4869 if(paramDestType != paramDest)
4870 FreeType(paramDestType);
4872 paramSource = paramSource->next;
4876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4881 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4885 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4887 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4894 static void FreeConvert(struct Conversion * convert)
4896 if(convert->resultType)
4897 FreeType(convert->resultType);
4900 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4902 struct __ecereNameSpace__ecere__com__BTNamedLink
4905 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4906 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4907 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4910 } __attribute__ ((gcc_struct));
4912 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4914 struct __ecereNameSpace__ecere__com__EnumClassData
4916 struct __ecereNameSpace__ecere__sys__OldList values;
4918 } __attribute__ ((gcc_struct));
4920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4922 struct __ecereNameSpace__ecere__sys__NamedLink
4924 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4925 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4928 } __attribute__ ((gcc_struct));
4930 extern void FreeExpContents(struct Expression * exp);
4932 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4934 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4936 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4938 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4940 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4942 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4944 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4946 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)))
4948 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4950 if(_class->type == 4)
4952 struct __ecereNameSpace__ecere__sys__OldList converts =
4956 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4960 _class->symbol = FindClass(_class->fullName);
4961 type->_class = _class->symbol;
4962 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4964 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4965 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4969 struct __ecereNameSpace__ecere__com__Class * baseClass;
4971 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4973 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4975 for(value = e->values.first; value; value = value->next)
4977 if(!strcmp(value->name, string))
4982 FreeExpContents(sourceExp);
4983 FreeType(sourceExp->expType);
4984 sourceExp->isConstant = 0x1;
4985 sourceExp->expType = MkClassType(baseClass->fullName);
4989 sourceExp->type = 2;
4990 if(!strcmp(baseClass->dataTypeString, "int"))
4991 sprintf(constant, "%d", value->data);
4993 sprintf(constant, "0x%X", value->data);
4994 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4996 while(converts.first)
4998 struct Conversion * convert = converts.first;
5000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5003 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5011 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5014 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)))
5015 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5022 struct __ecereNameSpace__ecere__com__SubModule
5024 struct __ecereNameSpace__ecere__com__SubModule * prev;
5025 struct __ecereNameSpace__ecere__com__SubModule * next;
5026 struct __ecereNameSpace__ecere__com__Instance * module;
5028 } __attribute__ ((gcc_struct));
5030 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5032 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5034 if(searchFor == searchIn)
5036 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5038 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5040 if(ModuleVisibility(subModule->module, searchFor))
5047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5049 struct __ecereNameSpace__ecere__com__Application
5054 unsigned int isGUIApp;
5055 struct __ecereNameSpace__ecere__sys__OldList allModules;
5056 char * parsedCommand;
5057 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5058 } __attribute__ ((gcc_struct));
5060 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5062 struct __ecereNameSpace__ecere__com__Instance * module;
5064 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5066 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5068 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5070 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)
5072 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5078 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5080 void ReadString(char * output, char * string);
5082 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5084 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5086 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5088 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5090 void * __ecereTemp1;
5091 struct Type * source = sourceExp->expType;
5092 struct Type * realDest = dest;
5094 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5096 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5098 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5100 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5102 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5104 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5106 if(sourceBase == destBase)
5112 struct __ecereNameSpace__ecere__sys__OldList * specs;
5113 unsigned int flag = 0x0;
5114 long long value = (((int)0x7fffffff));
5118 if(sourceExp->type == 2)
5120 if(source->isSigned)
5121 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5123 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5125 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5127 if(source->isSigned)
5128 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5130 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5132 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5135 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));
5139 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5141 if(_class && _class->type == 3)
5143 if(source->kind != 8)
5145 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5146 struct Type * tempDest, * tempSource;
5148 for(; _class->base->type != 1000; _class = _class->base)
5151 tempDest = tempType;
5154 _class->symbol = FindClass(_class->fullName);
5155 tempType->_class = _class->symbol;
5156 tempType->truth = dest->truth;
5157 if(tempType->_class)
5158 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5159 FreeType(sourceExp->expType);
5160 sourceExp->expType = dest;
5163 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5166 if(_class && _class->type == 2 && source->kind != 8)
5168 if(!dest->_class->registered->dataType)
5169 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5170 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5173 FreeType(sourceExp->expType);
5174 source = sourceExp->expType = MkClassType(dest->_class->string);
5178 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5180 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5181 struct Declarator * decl;
5184 ReadString(string, sourceExp->string);
5185 decl = SpecDeclFromString(string, specs, (((void *)0)));
5186 FreeExpContents(sourceExp);
5187 FreeType(sourceExp->expType);
5188 sourceExp->type = 26;
5189 sourceExp->_classExp.specifiers = specs;
5190 sourceExp->_classExp.decl = decl;
5191 sourceExp->expType = dest;
5198 else if(source->kind == 8)
5200 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5202 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5206 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5207 struct Type * tempDest, * tempSource;
5209 if(!source->_class->registered->dataType)
5210 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5211 for(; _class->base->type != 1000; _class = _class->base)
5214 tempSource = tempType;
5216 tempType->_class = FindClass(_class->fullName);
5217 tempType->truth = source->truth;
5218 tempType->classObjectType = source->classObjectType;
5219 if(tempType->_class)
5220 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5221 if(conversions->last)
5223 ((struct Conversion *)conversions->last)->resultType = dest;
5226 FreeType(sourceExp->expType);
5227 sourceExp->expType = MkClassType(_class->fullName);
5228 sourceExp->expType->truth = source->truth;
5229 sourceExp->expType->classObjectType = source->classObjectType;
5230 if(!sourceExp->destType)
5232 FreeType(sourceExp->destType);
5233 sourceExp->destType = sourceExp->expType;
5234 if(sourceExp->expType)
5235 sourceExp->expType->refCount++;
5237 if(!_class->dataType)
5238 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5240 dest = MkClassType(source->_class->string);
5241 dest->truth = source->truth;
5242 dest->classObjectType = source->classObjectType;
5244 source = _class->dataType;
5246 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5252 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5261 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5263 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5265 if(_class->type == 0 || _class->type == 5)
5267 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5269 *newExp = *sourceExp;
5270 if(sourceExp->destType)
5271 sourceExp->destType->refCount++;
5272 if(sourceExp->expType)
5273 sourceExp->expType->refCount++;
5274 sourceExp->type = 11;
5275 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5276 sourceExp->cast.exp = newExp;
5277 FreeType(sourceExp->expType);
5278 sourceExp->expType = (((void *)0));
5279 ProcessExpressionType(sourceExp);
5282 FreeType(sourceExp->expType);
5283 sourceExp->expType = dest;
5290 if(!_class->dataType)
5291 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5293 dest = _class->dataType;
5296 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5298 specs = MkListOne(MkSpecifier(DOUBLE));
5300 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5302 specs = MkListOne(MkSpecifier(FLOAT));
5304 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5308 ListAdd(specs, MkSpecifier(UNSIGNED));
5309 ListAdd(specs, MkSpecifier(INT64));
5311 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5315 ListAdd(specs, MkSpecifier(UNSIGNED));
5316 ListAdd(specs, MkSpecifier(INT));
5318 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5322 ListAdd(specs, MkSpecifier(UNSIGNED));
5323 ListAdd(specs, MkSpecifier(SHORT));
5325 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5329 ListAdd(specs, MkSpecifier(UNSIGNED));
5330 ListAdd(specs, MkSpecifier(CHAR));
5339 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))
5341 specs = MkListOne(MkSpecifier(DOUBLE));
5343 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5345 specs = MkListOne(MkSpecifier(FLOAT));
5347 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)))
5351 ListAdd(specs, MkSpecifier(UNSIGNED));
5352 ListAdd(specs, MkSpecifier(CHAR));
5354 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)))))
5358 ListAdd(specs, MkSpecifier(UNSIGNED));
5359 ListAdd(specs, MkSpecifier(SHORT));
5361 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5365 ListAdd(specs, MkSpecifier(UNSIGNED));
5366 ListAdd(specs, MkSpecifier(INT));
5368 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5372 ListAdd(specs, MkSpecifier(UNSIGNED));
5373 ListAdd(specs, MkSpecifier(INT64));
5375 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5377 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5387 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5389 *newExp = *sourceExp;
5390 newExp->prev = (((void *)0));
5391 newExp->next = (((void *)0));
5392 if(sourceExp->destType)
5393 sourceExp->destType->refCount++;
5394 if(sourceExp->expType)
5395 sourceExp->expType->refCount++;
5396 sourceExp->type = 11;
5397 if(realDest->kind == 8)
5399 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5400 FreeList(specs, FreeSpecifier);
5403 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5404 if(newExp->type == 4)
5406 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5409 sourceExp->cast.exp = newExp;
5410 FreeType(sourceExp->expType);
5411 sourceExp->expType = (((void *)0));
5412 ProcessExpressionType(sourceExp);
5415 FreeList(specs, FreeSpecifier);
5422 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5423 sourceExp = (*sourceExp->list).last;
5424 if(sourceExp->type == 0)
5426 struct Identifier * id = sourceExp->identifier;
5430 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5432 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5433 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5437 for(; _class && _class->type == 4; _class = _class->base)
5439 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5440 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5442 for(value = e->values.first; value; value = value->next)
5444 if(!strcmp(value->name, id->string))
5449 FreeExpContents(sourceExp);
5450 FreeType(sourceExp->expType);
5451 sourceExp->isConstant = 0x1;
5452 sourceExp->expType = MkClassType(_class->fullName);
5456 sourceExp->type = 2;
5457 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5458 sprintf(constant, "%d", value->data);
5460 sprintf(constant, "0x%X", value->data);
5461 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5469 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5476 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5478 int value2 = op2->i;
5481 exp->string = PrintInt(op1->i + value2);
5484 exp->expType = op1->type;
5486 op1->type->refCount++;
5491 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5493 unsigned int value2 = op2->ui;
5496 exp->string = PrintUInt(op1->ui + value2);
5499 exp->expType = op1->type;
5501 op1->type->refCount++;
5506 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5508 short value2 = op2->s;
5511 exp->string = PrintShort(op1->s + value2);
5514 exp->expType = op1->type;
5516 op1->type->refCount++;
5521 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5523 unsigned short value2 = op2->us;
5526 exp->string = PrintUShort(op1->us + value2);
5529 exp->expType = op1->type;
5531 op1->type->refCount++;
5536 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5538 char value2 = op2->c;
5541 exp->string = PrintChar(op1->c + value2);
5544 exp->expType = op1->type;
5546 op1->type->refCount++;
5551 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5553 unsigned char value2 = op2->uc;
5556 exp->string = PrintUChar(op1->uc + value2);
5559 exp->expType = op1->type;
5561 op1->type->refCount++;
5566 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5568 float value2 = op2->f;
5571 exp->string = PrintFloat(op1->f + value2);
5574 exp->expType = op1->type;
5576 op1->type->refCount++;
5581 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5583 double value2 = op2->d;
5586 exp->string = PrintDouble(op1->d + value2);
5589 exp->expType = op1->type;
5591 op1->type->refCount++;
5596 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5598 int value2 = op2->i;
5601 exp->string = PrintInt(op1->i - value2);
5604 exp->expType = op1->type;
5606 op1->type->refCount++;
5611 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5613 unsigned int value2 = op2->ui;
5616 exp->string = PrintUInt(op1->ui - value2);
5619 exp->expType = op1->type;
5621 op1->type->refCount++;
5626 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5628 short value2 = op2->s;
5631 exp->string = PrintShort(op1->s - value2);
5634 exp->expType = op1->type;
5636 op1->type->refCount++;
5641 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5643 unsigned short value2 = op2->us;
5646 exp->string = PrintUShort(op1->us - value2);
5649 exp->expType = op1->type;
5651 op1->type->refCount++;
5656 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5658 char value2 = op2->c;
5661 exp->string = PrintChar(op1->c - value2);
5664 exp->expType = op1->type;
5666 op1->type->refCount++;
5671 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5673 unsigned char value2 = op2->uc;
5676 exp->string = PrintUChar(op1->uc - value2);
5679 exp->expType = op1->type;
5681 op1->type->refCount++;
5686 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5688 float value2 = op2->f;
5691 exp->string = PrintFloat(op1->f - value2);
5694 exp->expType = op1->type;
5696 op1->type->refCount++;
5701 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5703 double value2 = op2->d;
5706 exp->string = PrintDouble(op1->d - value2);
5709 exp->expType = op1->type;
5711 op1->type->refCount++;
5716 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5718 int value2 = op2->i;
5721 exp->string = PrintInt(op1->i * value2);
5724 exp->expType = op1->type;
5726 op1->type->refCount++;
5731 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5733 unsigned int value2 = op2->ui;
5736 exp->string = PrintUInt(op1->ui * value2);
5739 exp->expType = op1->type;
5741 op1->type->refCount++;
5746 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5748 short value2 = op2->s;
5751 exp->string = PrintShort(op1->s * value2);
5754 exp->expType = op1->type;
5756 op1->type->refCount++;
5761 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5763 unsigned short value2 = op2->us;
5766 exp->string = PrintUShort(op1->us * value2);
5769 exp->expType = op1->type;
5771 op1->type->refCount++;
5776 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5778 char value2 = op2->c;
5781 exp->string = PrintChar(op1->c * value2);
5784 exp->expType = op1->type;
5786 op1->type->refCount++;
5791 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5793 unsigned char value2 = op2->uc;
5796 exp->string = PrintUChar(op1->uc * value2);
5799 exp->expType = op1->type;
5801 op1->type->refCount++;
5806 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5808 float value2 = op2->f;
5811 exp->string = PrintFloat(op1->f * value2);
5814 exp->expType = op1->type;
5816 op1->type->refCount++;
5821 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5823 double value2 = op2->d;
5826 exp->string = PrintDouble(op1->d * value2);
5829 exp->expType = op1->type;
5831 op1->type->refCount++;
5836 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5838 int value2 = op2->i;
5841 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5844 exp->expType = op1->type;
5846 op1->type->refCount++;
5851 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5853 unsigned int value2 = op2->ui;
5856 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5859 exp->expType = op1->type;
5861 op1->type->refCount++;
5866 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5868 short value2 = op2->s;
5871 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5874 exp->expType = op1->type;
5876 op1->type->refCount++;
5881 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5883 unsigned short value2 = op2->us;
5886 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5889 exp->expType = op1->type;
5891 op1->type->refCount++;
5896 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5898 char value2 = op2->c;
5901 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5904 exp->expType = op1->type;
5906 op1->type->refCount++;
5911 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5913 unsigned char value2 = op2->uc;
5916 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5919 exp->expType = op1->type;
5921 op1->type->refCount++;
5926 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5928 float value2 = op2->f;
5931 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5934 exp->expType = op1->type;
5936 op1->type->refCount++;
5941 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5943 double value2 = op2->d;
5946 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5949 exp->expType = op1->type;
5951 op1->type->refCount++;
5956 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5958 int value2 = op2->i;
5961 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5964 exp->expType = op1->type;
5966 op1->type->refCount++;
5971 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5973 unsigned int value2 = op2->ui;
5976 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5979 exp->expType = op1->type;
5981 op1->type->refCount++;
5986 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5988 short value2 = op2->s;
5991 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5994 exp->expType = op1->type;
5996 op1->type->refCount++;
6001 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6003 unsigned short value2 = op2->us;
6006 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6009 exp->expType = op1->type;
6011 op1->type->refCount++;
6016 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6018 char value2 = op2->c;
6021 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6024 exp->expType = op1->type;
6026 op1->type->refCount++;
6031 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6033 unsigned char value2 = op2->uc;
6036 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6039 exp->expType = op1->type;
6041 op1->type->refCount++;
6046 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6049 exp->string = PrintInt(-op1->i);
6052 exp->expType = op1->type;
6054 op1->type->refCount++;
6059 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6062 exp->string = PrintUInt(-op1->ui);
6065 exp->expType = op1->type;
6067 op1->type->refCount++;
6072 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6075 exp->string = PrintShort(-op1->s);
6078 exp->expType = op1->type;
6080 op1->type->refCount++;
6085 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6088 exp->string = PrintUShort(-op1->us);
6091 exp->expType = op1->type;
6093 op1->type->refCount++;
6098 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6101 exp->string = PrintChar(-op1->c);
6104 exp->expType = op1->type;
6106 op1->type->refCount++;
6111 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6114 exp->string = PrintUChar(-op1->uc);
6117 exp->expType = op1->type;
6119 op1->type->refCount++;
6124 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6127 exp->string = PrintFloat(-op1->f);
6130 exp->expType = op1->type;
6132 op1->type->refCount++;
6137 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6140 exp->string = PrintDouble(-op1->d);
6143 exp->expType = op1->type;
6145 op1->type->refCount++;
6150 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6153 exp->string = PrintInt(++op1->i);
6156 exp->expType = op1->type;
6158 op1->type->refCount++;
6163 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6166 exp->string = PrintUInt(++op1->ui);
6169 exp->expType = op1->type;
6171 op1->type->refCount++;
6176 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6179 exp->string = PrintShort(++op1->s);
6182 exp->expType = op1->type;
6184 op1->type->refCount++;
6189 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6192 exp->string = PrintUShort(++op1->us);
6195 exp->expType = op1->type;
6197 op1->type->refCount++;
6202 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6205 exp->string = PrintChar(++op1->c);
6208 exp->expType = op1->type;
6210 op1->type->refCount++;
6215 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6218 exp->string = PrintUChar(++op1->uc);
6221 exp->expType = op1->type;
6223 op1->type->refCount++;
6228 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6231 exp->string = PrintFloat(++op1->f);
6234 exp->expType = op1->type;
6236 op1->type->refCount++;
6241 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6244 exp->string = PrintDouble(++op1->d);
6247 exp->expType = op1->type;
6249 op1->type->refCount++;
6254 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6257 exp->string = PrintInt(--op1->i);
6260 exp->expType = op1->type;
6262 op1->type->refCount++;
6267 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6270 exp->string = PrintUInt(--op1->ui);
6273 exp->expType = op1->type;
6275 op1->type->refCount++;
6280 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6283 exp->string = PrintShort(--op1->s);
6286 exp->expType = op1->type;
6288 op1->type->refCount++;
6293 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6296 exp->string = PrintUShort(--op1->us);
6299 exp->expType = op1->type;
6301 op1->type->refCount++;
6306 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6309 exp->string = PrintChar(--op1->c);
6312 exp->expType = op1->type;
6314 op1->type->refCount++;
6319 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6322 exp->string = PrintUChar(--op1->uc);
6325 exp->expType = op1->type;
6327 op1->type->refCount++;
6332 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6335 exp->string = PrintFloat(--op1->f);
6338 exp->expType = op1->type;
6340 op1->type->refCount++;
6345 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6348 exp->string = PrintDouble(--op1->d);
6351 exp->expType = op1->type;
6353 op1->type->refCount++;
6358 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6360 int value2 = op2->i;
6363 exp->string = PrintInt(op1->i = value2);
6366 exp->expType = op1->type;
6368 op1->type->refCount++;
6373 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6375 unsigned int value2 = op2->ui;
6378 exp->string = PrintUInt(op1->ui = value2);
6381 exp->expType = op1->type;
6383 op1->type->refCount++;
6388 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6390 short value2 = op2->s;
6393 exp->string = PrintShort(op1->s = value2);
6396 exp->expType = op1->type;
6398 op1->type->refCount++;
6403 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6405 unsigned short value2 = op2->us;
6408 exp->string = PrintUShort(op1->us = value2);
6411 exp->expType = op1->type;
6413 op1->type->refCount++;
6418 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6420 char value2 = op2->c;
6423 exp->string = PrintChar(op1->c = value2);
6426 exp->expType = op1->type;
6428 op1->type->refCount++;
6433 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6435 unsigned char value2 = op2->uc;
6438 exp->string = PrintUChar(op1->uc = value2);
6441 exp->expType = op1->type;
6443 op1->type->refCount++;
6448 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6450 float value2 = op2->f;
6453 exp->string = PrintFloat(op1->f = value2);
6456 exp->expType = op1->type;
6458 op1->type->refCount++;
6463 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6465 double value2 = op2->d;
6468 exp->string = PrintDouble(op1->d = value2);
6471 exp->expType = op1->type;
6473 op1->type->refCount++;
6478 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6480 int value2 = op2->i;
6483 exp->string = PrintInt(op1->i += value2);
6486 exp->expType = op1->type;
6488 op1->type->refCount++;
6493 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6495 unsigned int value2 = op2->ui;
6498 exp->string = PrintUInt(op1->ui += value2);
6501 exp->expType = op1->type;
6503 op1->type->refCount++;
6508 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6510 short value2 = op2->s;
6513 exp->string = PrintShort(op1->s += value2);
6516 exp->expType = op1->type;
6518 op1->type->refCount++;
6523 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6525 unsigned short value2 = op2->us;
6528 exp->string = PrintUShort(op1->us += value2);
6531 exp->expType = op1->type;
6533 op1->type->refCount++;
6538 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6540 char value2 = op2->c;
6543 exp->string = PrintChar(op1->c += value2);
6546 exp->expType = op1->type;
6548 op1->type->refCount++;
6553 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6555 unsigned char value2 = op2->uc;
6558 exp->string = PrintUChar(op1->uc += value2);
6561 exp->expType = op1->type;
6563 op1->type->refCount++;
6568 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6570 float value2 = op2->f;
6573 exp->string = PrintFloat(op1->f += value2);
6576 exp->expType = op1->type;
6578 op1->type->refCount++;
6583 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6585 double value2 = op2->d;
6588 exp->string = PrintDouble(op1->d += value2);
6591 exp->expType = op1->type;
6593 op1->type->refCount++;
6598 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6600 int value2 = op2->i;
6603 exp->string = PrintInt(op1->i -= value2);
6606 exp->expType = op1->type;
6608 op1->type->refCount++;
6613 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6615 unsigned int value2 = op2->ui;
6618 exp->string = PrintUInt(op1->ui -= value2);
6621 exp->expType = op1->type;
6623 op1->type->refCount++;
6628 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6630 short value2 = op2->s;
6633 exp->string = PrintShort(op1->s -= value2);
6636 exp->expType = op1->type;
6638 op1->type->refCount++;
6643 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6645 unsigned short value2 = op2->us;
6648 exp->string = PrintUShort(op1->us -= value2);
6651 exp->expType = op1->type;
6653 op1->type->refCount++;
6658 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6660 char value2 = op2->c;
6663 exp->string = PrintChar(op1->c -= value2);
6666 exp->expType = op1->type;
6668 op1->type->refCount++;
6673 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6675 unsigned char value2 = op2->uc;
6678 exp->string = PrintUChar(op1->uc -= value2);
6681 exp->expType = op1->type;
6683 op1->type->refCount++;
6688 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6690 float value2 = op2->f;
6693 exp->string = PrintFloat(op1->f -= value2);
6696 exp->expType = op1->type;
6698 op1->type->refCount++;
6703 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6705 double value2 = op2->d;
6708 exp->string = PrintDouble(op1->d -= value2);
6711 exp->expType = op1->type;
6713 op1->type->refCount++;
6718 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6720 int value2 = op2->i;
6723 exp->string = PrintInt(op1->i *= value2);
6726 exp->expType = op1->type;
6728 op1->type->refCount++;
6733 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6735 unsigned int value2 = op2->ui;
6738 exp->string = PrintUInt(op1->ui *= value2);
6741 exp->expType = op1->type;
6743 op1->type->refCount++;
6748 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6750 short value2 = op2->s;
6753 exp->string = PrintShort(op1->s *= value2);
6756 exp->expType = op1->type;
6758 op1->type->refCount++;
6763 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6765 unsigned short value2 = op2->us;
6768 exp->string = PrintUShort(op1->us *= value2);
6771 exp->expType = op1->type;
6773 op1->type->refCount++;
6778 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6780 char value2 = op2->c;
6783 exp->string = PrintChar(op1->c *= value2);
6786 exp->expType = op1->type;
6788 op1->type->refCount++;
6793 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6795 unsigned char value2 = op2->uc;
6798 exp->string = PrintUChar(op1->uc *= value2);
6801 exp->expType = op1->type;
6803 op1->type->refCount++;
6808 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6810 float value2 = op2->f;
6813 exp->string = PrintFloat(op1->f *= value2);
6816 exp->expType = op1->type;
6818 op1->type->refCount++;
6823 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6825 double value2 = op2->d;
6828 exp->string = PrintDouble(op1->d *= value2);
6831 exp->expType = op1->type;
6833 op1->type->refCount++;
6838 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6840 int value2 = op2->i;
6843 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6846 exp->expType = op1->type;
6848 op1->type->refCount++;
6853 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6855 unsigned int value2 = op2->ui;
6858 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6861 exp->expType = op1->type;
6863 op1->type->refCount++;
6868 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6870 short value2 = op2->s;
6873 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6876 exp->expType = op1->type;
6878 op1->type->refCount++;
6883 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6885 unsigned short value2 = op2->us;
6888 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6891 exp->expType = op1->type;
6893 op1->type->refCount++;
6898 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6900 char value2 = op2->c;
6903 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6906 exp->expType = op1->type;
6908 op1->type->refCount++;
6913 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6915 unsigned char value2 = op2->uc;
6918 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6921 exp->expType = op1->type;
6923 op1->type->refCount++;
6928 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6930 float value2 = op2->f;
6933 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6936 exp->expType = op1->type;
6938 op1->type->refCount++;
6943 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6945 double value2 = op2->d;
6948 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6951 exp->expType = op1->type;
6953 op1->type->refCount++;
6958 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6960 int value2 = op2->i;
6963 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6966 exp->expType = op1->type;
6968 op1->type->refCount++;
6973 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6975 unsigned int value2 = op2->ui;
6978 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6981 exp->expType = op1->type;
6983 op1->type->refCount++;
6988 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6990 short value2 = op2->s;
6993 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6996 exp->expType = op1->type;
6998 op1->type->refCount++;
7003 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7005 unsigned short value2 = op2->us;
7008 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7011 exp->expType = op1->type;
7013 op1->type->refCount++;
7018 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7020 char value2 = op2->c;
7023 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7026 exp->expType = op1->type;
7028 op1->type->refCount++;
7033 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7035 unsigned char value2 = op2->uc;
7038 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7041 exp->expType = op1->type;
7043 op1->type->refCount++;
7048 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7050 int value2 = op2->i;
7053 exp->string = PrintInt(op1->i & value2);
7056 exp->expType = op1->type;
7058 op1->type->refCount++;
7063 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7065 unsigned int value2 = op2->ui;
7068 exp->string = PrintUInt(op1->ui & value2);
7071 exp->expType = op1->type;
7073 op1->type->refCount++;
7078 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7080 short value2 = op2->s;
7083 exp->string = PrintShort(op1->s & value2);
7086 exp->expType = op1->type;
7088 op1->type->refCount++;
7093 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7095 unsigned short value2 = op2->us;
7098 exp->string = PrintUShort(op1->us & value2);
7101 exp->expType = op1->type;
7103 op1->type->refCount++;
7108 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7110 char value2 = op2->c;
7113 exp->string = PrintChar(op1->c & value2);
7116 exp->expType = op1->type;
7118 op1->type->refCount++;
7123 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7125 unsigned char value2 = op2->uc;
7128 exp->string = PrintUChar(op1->uc & value2);
7131 exp->expType = op1->type;
7133 op1->type->refCount++;
7138 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7140 int value2 = op2->i;
7143 exp->string = PrintInt(op1->i | value2);
7146 exp->expType = op1->type;
7148 op1->type->refCount++;
7153 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7155 unsigned int value2 = op2->ui;
7158 exp->string = PrintUInt(op1->ui | value2);
7161 exp->expType = op1->type;
7163 op1->type->refCount++;
7168 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7170 short value2 = op2->s;
7173 exp->string = PrintShort(op1->s | value2);
7176 exp->expType = op1->type;
7178 op1->type->refCount++;
7183 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7185 unsigned short value2 = op2->us;
7188 exp->string = PrintUShort(op1->us | value2);
7191 exp->expType = op1->type;
7193 op1->type->refCount++;
7198 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7200 char value2 = op2->c;
7203 exp->string = PrintChar(op1->c | value2);
7206 exp->expType = op1->type;
7208 op1->type->refCount++;
7213 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7215 unsigned char value2 = op2->uc;
7218 exp->string = PrintUChar(op1->uc | value2);
7221 exp->expType = op1->type;
7223 op1->type->refCount++;
7228 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7230 int value2 = op2->i;
7233 exp->string = PrintInt(op1->i ^ value2);
7236 exp->expType = op1->type;
7238 op1->type->refCount++;
7243 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7245 unsigned int value2 = op2->ui;
7248 exp->string = PrintUInt(op1->ui ^ value2);
7251 exp->expType = op1->type;
7253 op1->type->refCount++;
7258 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7260 short value2 = op2->s;
7263 exp->string = PrintShort(op1->s ^ value2);
7266 exp->expType = op1->type;
7268 op1->type->refCount++;
7273 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7275 unsigned short value2 = op2->us;
7278 exp->string = PrintUShort(op1->us ^ value2);
7281 exp->expType = op1->type;
7283 op1->type->refCount++;
7288 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7290 char value2 = op2->c;
7293 exp->string = PrintChar(op1->c ^ value2);
7296 exp->expType = op1->type;
7298 op1->type->refCount++;
7303 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7305 unsigned char value2 = op2->uc;
7308 exp->string = PrintUChar(op1->uc ^ value2);
7311 exp->expType = op1->type;
7313 op1->type->refCount++;
7318 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7320 int value2 = op2->i;
7323 exp->string = PrintInt(op1->i << value2);
7326 exp->expType = op1->type;
7328 op1->type->refCount++;
7333 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7335 unsigned int value2 = op2->ui;
7338 exp->string = PrintUInt(op1->ui << value2);
7341 exp->expType = op1->type;
7343 op1->type->refCount++;
7348 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7350 short value2 = op2->s;
7353 exp->string = PrintShort(op1->s << value2);
7356 exp->expType = op1->type;
7358 op1->type->refCount++;
7363 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7365 unsigned short value2 = op2->us;
7368 exp->string = PrintUShort(op1->us << value2);
7371 exp->expType = op1->type;
7373 op1->type->refCount++;
7378 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7380 char value2 = op2->c;
7383 exp->string = PrintChar(op1->c << value2);
7386 exp->expType = op1->type;
7388 op1->type->refCount++;
7393 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7395 unsigned char value2 = op2->uc;
7398 exp->string = PrintUChar(op1->uc << value2);
7401 exp->expType = op1->type;
7403 op1->type->refCount++;
7408 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7410 int value2 = op2->i;
7413 exp->string = PrintInt(op1->i >> value2);
7416 exp->expType = op1->type;
7418 op1->type->refCount++;
7423 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7425 unsigned int value2 = op2->ui;
7428 exp->string = PrintUInt(op1->ui >> value2);
7431 exp->expType = op1->type;
7433 op1->type->refCount++;
7438 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7440 short value2 = op2->s;
7443 exp->string = PrintShort(op1->s >> value2);
7446 exp->expType = op1->type;
7448 op1->type->refCount++;
7453 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7455 unsigned short value2 = op2->us;
7458 exp->string = PrintUShort(op1->us >> value2);
7461 exp->expType = op1->type;
7463 op1->type->refCount++;
7468 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7470 char value2 = op2->c;
7473 exp->string = PrintChar(op1->c >> value2);
7476 exp->expType = op1->type;
7478 op1->type->refCount++;
7483 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7485 unsigned char value2 = op2->uc;
7488 exp->string = PrintUChar(op1->uc >> value2);
7491 exp->expType = op1->type;
7493 op1->type->refCount++;
7498 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7501 exp->string = PrintInt(~op1->i);
7504 exp->expType = op1->type;
7506 op1->type->refCount++;
7511 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7514 exp->string = PrintUInt(~op1->ui);
7517 exp->expType = op1->type;
7519 op1->type->refCount++;
7524 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7527 exp->string = PrintShort(~op1->s);
7530 exp->expType = op1->type;
7532 op1->type->refCount++;
7537 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7540 exp->string = PrintUShort(~op1->us);
7543 exp->expType = op1->type;
7545 op1->type->refCount++;
7550 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7553 exp->string = PrintChar(~op1->c);
7556 exp->expType = op1->type;
7558 op1->type->refCount++;
7563 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7566 exp->string = PrintUChar(~op1->uc);
7569 exp->expType = op1->type;
7571 op1->type->refCount++;
7576 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7578 int value2 = op2->i;
7581 exp->string = PrintInt(op1->i &= value2);
7584 exp->expType = op1->type;
7586 op1->type->refCount++;
7591 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7593 unsigned int value2 = op2->ui;
7596 exp->string = PrintUInt(op1->ui &= value2);
7599 exp->expType = op1->type;
7601 op1->type->refCount++;
7606 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7608 short value2 = op2->s;
7611 exp->string = PrintShort(op1->s &= value2);
7614 exp->expType = op1->type;
7616 op1->type->refCount++;
7621 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7623 unsigned short value2 = op2->us;
7626 exp->string = PrintUShort(op1->us &= value2);
7629 exp->expType = op1->type;
7631 op1->type->refCount++;
7636 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7638 char value2 = op2->c;
7641 exp->string = PrintChar(op1->c &= value2);
7644 exp->expType = op1->type;
7646 op1->type->refCount++;
7651 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7653 unsigned char value2 = op2->uc;
7656 exp->string = PrintUChar(op1->uc &= value2);
7659 exp->expType = op1->type;
7661 op1->type->refCount++;
7666 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7668 int value2 = op2->i;
7671 exp->string = PrintInt(op1->i |= value2);
7674 exp->expType = op1->type;
7676 op1->type->refCount++;
7681 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7683 unsigned int value2 = op2->ui;
7686 exp->string = PrintUInt(op1->ui |= value2);
7689 exp->expType = op1->type;
7691 op1->type->refCount++;
7696 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7698 short value2 = op2->s;
7701 exp->string = PrintShort(op1->s |= value2);
7704 exp->expType = op1->type;
7706 op1->type->refCount++;
7711 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7713 unsigned short value2 = op2->us;
7716 exp->string = PrintUShort(op1->us |= value2);
7719 exp->expType = op1->type;
7721 op1->type->refCount++;
7726 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7728 char value2 = op2->c;
7731 exp->string = PrintChar(op1->c |= value2);
7734 exp->expType = op1->type;
7736 op1->type->refCount++;
7741 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7743 unsigned char value2 = op2->uc;
7746 exp->string = PrintUChar(op1->uc |= value2);
7749 exp->expType = op1->type;
7751 op1->type->refCount++;
7756 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7758 int value2 = op2->i;
7761 exp->string = PrintInt(op1->i ^= value2);
7764 exp->expType = op1->type;
7766 op1->type->refCount++;
7771 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7773 unsigned int value2 = op2->ui;
7776 exp->string = PrintUInt(op1->ui ^= value2);
7779 exp->expType = op1->type;
7781 op1->type->refCount++;
7786 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7788 short value2 = op2->s;
7791 exp->string = PrintShort(op1->s ^= value2);
7794 exp->expType = op1->type;
7796 op1->type->refCount++;
7801 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7803 unsigned short value2 = op2->us;
7806 exp->string = PrintUShort(op1->us ^= value2);
7809 exp->expType = op1->type;
7811 op1->type->refCount++;
7816 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7818 char value2 = op2->c;
7821 exp->string = PrintChar(op1->c ^= value2);
7824 exp->expType = op1->type;
7826 op1->type->refCount++;
7831 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7833 unsigned char value2 = op2->uc;
7836 exp->string = PrintUChar(op1->uc ^= value2);
7839 exp->expType = op1->type;
7841 op1->type->refCount++;
7846 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7848 int value2 = op2->i;
7851 exp->string = PrintInt(op1->i <<= value2);
7854 exp->expType = op1->type;
7856 op1->type->refCount++;
7861 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7863 unsigned int value2 = op2->ui;
7866 exp->string = PrintUInt(op1->ui <<= value2);
7869 exp->expType = op1->type;
7871 op1->type->refCount++;
7876 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7878 short value2 = op2->s;
7881 exp->string = PrintShort(op1->s <<= value2);
7884 exp->expType = op1->type;
7886 op1->type->refCount++;
7891 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7893 unsigned short value2 = op2->us;
7896 exp->string = PrintUShort(op1->us <<= value2);
7899 exp->expType = op1->type;
7901 op1->type->refCount++;
7906 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7908 char value2 = op2->c;
7911 exp->string = PrintChar(op1->c <<= value2);
7914 exp->expType = op1->type;
7916 op1->type->refCount++;
7921 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7923 unsigned char value2 = op2->uc;
7926 exp->string = PrintUChar(op1->uc <<= value2);
7929 exp->expType = op1->type;
7931 op1->type->refCount++;
7936 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7938 int value2 = op2->i;
7941 exp->string = PrintInt(op1->i >>= value2);
7944 exp->expType = op1->type;
7946 op1->type->refCount++;
7951 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7953 unsigned int value2 = op2->ui;
7956 exp->string = PrintUInt(op1->ui >>= value2);
7959 exp->expType = op1->type;
7961 op1->type->refCount++;
7966 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7968 short value2 = op2->s;
7971 exp->string = PrintShort(op1->s >>= value2);
7974 exp->expType = op1->type;
7976 op1->type->refCount++;
7981 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7983 unsigned short value2 = op2->us;
7986 exp->string = PrintUShort(op1->us >>= value2);
7989 exp->expType = op1->type;
7991 op1->type->refCount++;
7996 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7998 char value2 = op2->c;
8001 exp->string = PrintChar(op1->c >>= value2);
8004 exp->expType = op1->type;
8006 op1->type->refCount++;
8011 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8013 unsigned char value2 = op2->uc;
8016 exp->string = PrintUChar(op1->uc >>= value2);
8019 exp->expType = op1->type;
8021 op1->type->refCount++;
8026 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8029 exp->string = PrintInt(!op1->i);
8032 exp->expType = op1->type;
8034 op1->type->refCount++;
8039 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8042 exp->string = PrintUInt(!op1->ui);
8045 exp->expType = op1->type;
8047 op1->type->refCount++;
8052 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8055 exp->string = PrintShort(!op1->s);
8058 exp->expType = op1->type;
8060 op1->type->refCount++;
8065 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8068 exp->string = PrintUShort(!op1->us);
8071 exp->expType = op1->type;
8073 op1->type->refCount++;
8078 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8081 exp->string = PrintChar(!op1->c);
8084 exp->expType = op1->type;
8086 op1->type->refCount++;
8091 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8094 exp->string = PrintUChar(!op1->uc);
8097 exp->expType = op1->type;
8099 op1->type->refCount++;
8104 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8106 int value2 = op2->i;
8109 exp->string = PrintInt(op1->i == value2);
8112 exp->expType = op1->type;
8114 op1->type->refCount++;
8119 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8121 unsigned int value2 = op2->ui;
8124 exp->string = PrintUInt(op1->ui == value2);
8127 exp->expType = op1->type;
8129 op1->type->refCount++;
8134 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8136 short value2 = op2->s;
8139 exp->string = PrintShort(op1->s == value2);
8142 exp->expType = op1->type;
8144 op1->type->refCount++;
8149 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8151 unsigned short value2 = op2->us;
8154 exp->string = PrintUShort(op1->us == value2);
8157 exp->expType = op1->type;
8159 op1->type->refCount++;
8164 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8166 char value2 = op2->c;
8169 exp->string = PrintChar(op1->c == value2);
8172 exp->expType = op1->type;
8174 op1->type->refCount++;
8179 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8181 unsigned char value2 = op2->uc;
8184 exp->string = PrintUChar(op1->uc == value2);
8187 exp->expType = op1->type;
8189 op1->type->refCount++;
8194 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8196 float value2 = op2->f;
8199 exp->string = PrintFloat(op1->f == value2);
8202 exp->expType = op1->type;
8204 op1->type->refCount++;
8209 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8211 double value2 = op2->d;
8214 exp->string = PrintDouble(op1->d == value2);
8217 exp->expType = op1->type;
8219 op1->type->refCount++;
8224 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8226 int value2 = op2->i;
8229 exp->string = PrintInt(op1->i != value2);
8232 exp->expType = op1->type;
8234 op1->type->refCount++;
8239 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8241 unsigned int value2 = op2->ui;
8244 exp->string = PrintUInt(op1->ui != value2);
8247 exp->expType = op1->type;
8249 op1->type->refCount++;
8254 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8256 short value2 = op2->s;
8259 exp->string = PrintShort(op1->s != value2);
8262 exp->expType = op1->type;
8264 op1->type->refCount++;
8269 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8271 unsigned short value2 = op2->us;
8274 exp->string = PrintUShort(op1->us != value2);
8277 exp->expType = op1->type;
8279 op1->type->refCount++;
8284 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8286 char value2 = op2->c;
8289 exp->string = PrintChar(op1->c != value2);
8292 exp->expType = op1->type;
8294 op1->type->refCount++;
8299 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8301 unsigned char value2 = op2->uc;
8304 exp->string = PrintUChar(op1->uc != value2);
8307 exp->expType = op1->type;
8309 op1->type->refCount++;
8314 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8316 float value2 = op2->f;
8319 exp->string = PrintFloat(op1->f != value2);
8322 exp->expType = op1->type;
8324 op1->type->refCount++;
8329 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8331 double value2 = op2->d;
8334 exp->string = PrintDouble(op1->d != value2);
8337 exp->expType = op1->type;
8339 op1->type->refCount++;
8344 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8346 int value2 = op2->i;
8349 exp->string = PrintInt(op1->i && value2);
8352 exp->expType = op1->type;
8354 op1->type->refCount++;
8359 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8361 unsigned int value2 = op2->ui;
8364 exp->string = PrintUInt(op1->ui && value2);
8367 exp->expType = op1->type;
8369 op1->type->refCount++;
8374 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8376 short value2 = op2->s;
8379 exp->string = PrintShort(op1->s && value2);
8382 exp->expType = op1->type;
8384 op1->type->refCount++;
8389 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8391 unsigned short value2 = op2->us;
8394 exp->string = PrintUShort(op1->us && value2);
8397 exp->expType = op1->type;
8399 op1->type->refCount++;
8404 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8406 char value2 = op2->c;
8409 exp->string = PrintChar(op1->c && value2);
8412 exp->expType = op1->type;
8414 op1->type->refCount++;
8419 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8421 unsigned char value2 = op2->uc;
8424 exp->string = PrintUChar(op1->uc && value2);
8427 exp->expType = op1->type;
8429 op1->type->refCount++;
8434 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8436 float value2 = op2->f;
8439 exp->string = PrintFloat(op1->f && value2);
8442 exp->expType = op1->type;
8444 op1->type->refCount++;
8449 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8451 double value2 = op2->d;
8454 exp->string = PrintDouble(op1->d && value2);
8457 exp->expType = op1->type;
8459 op1->type->refCount++;
8464 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8466 int value2 = op2->i;
8469 exp->string = PrintInt(op1->i || value2);
8472 exp->expType = op1->type;
8474 op1->type->refCount++;
8479 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8481 unsigned int value2 = op2->ui;
8484 exp->string = PrintUInt(op1->ui || value2);
8487 exp->expType = op1->type;
8489 op1->type->refCount++;
8494 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8496 short value2 = op2->s;
8499 exp->string = PrintShort(op1->s || value2);
8502 exp->expType = op1->type;
8504 op1->type->refCount++;
8509 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8511 unsigned short value2 = op2->us;
8514 exp->string = PrintUShort(op1->us || value2);
8517 exp->expType = op1->type;
8519 op1->type->refCount++;
8524 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8526 char value2 = op2->c;
8529 exp->string = PrintChar(op1->c || value2);
8532 exp->expType = op1->type;
8534 op1->type->refCount++;
8539 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8541 unsigned char value2 = op2->uc;
8544 exp->string = PrintUChar(op1->uc || value2);
8547 exp->expType = op1->type;
8549 op1->type->refCount++;
8554 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8556 float value2 = op2->f;
8559 exp->string = PrintFloat(op1->f || value2);
8562 exp->expType = op1->type;
8564 op1->type->refCount++;
8569 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8571 double value2 = op2->d;
8574 exp->string = PrintDouble(op1->d || value2);
8577 exp->expType = op1->type;
8579 op1->type->refCount++;
8584 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8586 int value2 = op2->i;
8589 exp->string = PrintInt(op1->i > value2);
8592 exp->expType = op1->type;
8594 op1->type->refCount++;
8599 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8601 unsigned int value2 = op2->ui;
8604 exp->string = PrintUInt(op1->ui > value2);
8607 exp->expType = op1->type;
8609 op1->type->refCount++;
8614 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8616 short value2 = op2->s;
8619 exp->string = PrintShort(op1->s > value2);
8622 exp->expType = op1->type;
8624 op1->type->refCount++;
8629 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8631 unsigned short value2 = op2->us;
8634 exp->string = PrintUShort(op1->us > value2);
8637 exp->expType = op1->type;
8639 op1->type->refCount++;
8644 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8646 char value2 = op2->c;
8649 exp->string = PrintChar(op1->c > value2);
8652 exp->expType = op1->type;
8654 op1->type->refCount++;
8659 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8661 unsigned char value2 = op2->uc;
8664 exp->string = PrintUChar(op1->uc > value2);
8667 exp->expType = op1->type;
8669 op1->type->refCount++;
8674 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8676 float value2 = op2->f;
8679 exp->string = PrintFloat(op1->f > value2);
8682 exp->expType = op1->type;
8684 op1->type->refCount++;
8689 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8691 double value2 = op2->d;
8694 exp->string = PrintDouble(op1->d > value2);
8697 exp->expType = op1->type;
8699 op1->type->refCount++;
8704 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8706 int value2 = op2->i;
8709 exp->string = PrintInt(op1->i < value2);
8712 exp->expType = op1->type;
8714 op1->type->refCount++;
8719 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8721 unsigned int value2 = op2->ui;
8724 exp->string = PrintUInt(op1->ui < value2);
8727 exp->expType = op1->type;
8729 op1->type->refCount++;
8734 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8736 short value2 = op2->s;
8739 exp->string = PrintShort(op1->s < value2);
8742 exp->expType = op1->type;
8744 op1->type->refCount++;
8749 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8751 unsigned short value2 = op2->us;
8754 exp->string = PrintUShort(op1->us < value2);
8757 exp->expType = op1->type;
8759 op1->type->refCount++;
8764 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8766 char value2 = op2->c;
8769 exp->string = PrintChar(op1->c < value2);
8772 exp->expType = op1->type;
8774 op1->type->refCount++;
8779 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8781 unsigned char value2 = op2->uc;
8784 exp->string = PrintUChar(op1->uc < value2);
8787 exp->expType = op1->type;
8789 op1->type->refCount++;
8794 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8796 float value2 = op2->f;
8799 exp->string = PrintFloat(op1->f < value2);
8802 exp->expType = op1->type;
8804 op1->type->refCount++;
8809 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8811 double value2 = op2->d;
8814 exp->string = PrintDouble(op1->d < value2);
8817 exp->expType = op1->type;
8819 op1->type->refCount++;
8824 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8826 int value2 = op2->i;
8829 exp->string = PrintInt(op1->i >= value2);
8832 exp->expType = op1->type;
8834 op1->type->refCount++;
8839 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8841 unsigned int value2 = op2->ui;
8844 exp->string = PrintUInt(op1->ui >= value2);
8847 exp->expType = op1->type;
8849 op1->type->refCount++;
8854 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8856 short value2 = op2->s;
8859 exp->string = PrintShort(op1->s >= value2);
8862 exp->expType = op1->type;
8864 op1->type->refCount++;
8869 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8871 unsigned short value2 = op2->us;
8874 exp->string = PrintUShort(op1->us >= value2);
8877 exp->expType = op1->type;
8879 op1->type->refCount++;
8884 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8886 char value2 = op2->c;
8889 exp->string = PrintChar(op1->c >= value2);
8892 exp->expType = op1->type;
8894 op1->type->refCount++;
8899 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8901 unsigned char value2 = op2->uc;
8904 exp->string = PrintUChar(op1->uc >= value2);
8907 exp->expType = op1->type;
8909 op1->type->refCount++;
8914 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8916 float value2 = op2->f;
8919 exp->string = PrintFloat(op1->f >= value2);
8922 exp->expType = op1->type;
8924 op1->type->refCount++;
8929 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8931 double value2 = op2->d;
8934 exp->string = PrintDouble(op1->d >= value2);
8937 exp->expType = op1->type;
8939 op1->type->refCount++;
8944 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8946 int value2 = op2->i;
8949 exp->string = PrintInt(op1->i <= value2);
8952 exp->expType = op1->type;
8954 op1->type->refCount++;
8959 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8961 unsigned int value2 = op2->ui;
8964 exp->string = PrintUInt(op1->ui <= value2);
8967 exp->expType = op1->type;
8969 op1->type->refCount++;
8974 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8976 short value2 = op2->s;
8979 exp->string = PrintShort(op1->s <= value2);
8982 exp->expType = op1->type;
8984 op1->type->refCount++;
8989 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8991 unsigned short value2 = op2->us;
8994 exp->string = PrintUShort(op1->us <= value2);
8997 exp->expType = op1->type;
8999 op1->type->refCount++;
9004 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9006 char value2 = op2->c;
9009 exp->string = PrintChar(op1->c <= value2);
9012 exp->expType = op1->type;
9014 op1->type->refCount++;
9019 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9021 unsigned char value2 = op2->uc;
9024 exp->string = PrintUChar(op1->uc <= value2);
9027 exp->expType = op1->type;
9029 op1->type->refCount++;
9034 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9036 float value2 = op2->f;
9039 exp->string = PrintFloat(op1->f <= value2);
9042 exp->expType = op1->type;
9044 op1->type->refCount++;
9049 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9051 double value2 = op2->d;
9054 exp->string = PrintDouble(op1->d <= value2);
9057 exp->expType = op1->type;
9059 op1->type->refCount++;
9064 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9067 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9070 exp->expType = op1->type;
9072 op1->type->refCount++;
9077 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9080 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9083 exp->expType = op1->type;
9085 op1->type->refCount++;
9090 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9093 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9096 exp->expType = op1->type;
9098 op1->type->refCount++;
9103 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9106 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9109 exp->expType = op1->type;
9111 op1->type->refCount++;
9116 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9119 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9122 exp->expType = op1->type;
9124 op1->type->refCount++;
9129 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9132 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9135 exp->expType = op1->type;
9137 op1->type->refCount++;
9142 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9145 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9148 exp->expType = op1->type;
9150 op1->type->refCount++;
9155 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9158 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9161 exp->expType = op1->type;
9163 op1->type->refCount++;
9168 struct OpTable intOps =
9170 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
9173 struct OpTable uintOps =
9175 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
9178 struct OpTable shortOps =
9180 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
9183 struct OpTable ushortOps =
9185 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
9188 struct OpTable floatOps =
9190 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
9193 struct OpTable doubleOps =
9195 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
9198 struct OpTable charOps =
9200 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
9203 struct OpTable ucharOps =
9205 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
9208 void ReadString(char * output, char * string)
9210 int len = strlen(string);
9212 unsigned int quoted = 0x0, escaped = 0x0;
9214 for(c = 0; c < len; c++)
9216 char ch = string[c];
9272 extern double strtod(char * , char * * );
9274 struct Operand GetOperand(struct Expression * exp)
9280 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9283 struct Type * type = exp->expType;
9287 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9289 if(!type->_class->registered->dataType)
9290 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9291 type = type->_class->registered->dataType;
9293 op.kind = type->kind;
9294 op.type = exp->expType;
9295 if(exp->isConstant && exp->type == 2)
9301 if(exp->constant[0] == '\'')
9302 op.c = exp->constant[1];
9303 else if(type->isSigned)
9305 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9310 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9318 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9323 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9331 op.i = strtol(exp->constant, (((void *)0)), 0);
9336 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9344 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9349 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9357 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9362 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9368 op.f = (float)strtod(exp->constant, (((void *)0)));
9372 op.d = (double)strtod(exp->constant, (((void *)0)));
9378 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9388 int __ecereVMethodID_class_OnGetString;
9390 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9392 static void UnusedFunction()
9396 ((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);
9399 extern int __ecereVMethodID_class_OnGetString;
9401 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9403 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9405 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9407 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9408 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9411 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9412 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9414 void * ptr = inst->data + dataMember->offset + offset;
9415 char * result = (((void *)0));
9417 exp->loc = member->loc = inst->loc;
9418 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9419 if(!dataMember->dataType)
9420 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9421 type = dataMember->dataType;
9424 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9426 if(_class->type == 4)
9428 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9432 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9433 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9435 for(item = e->values.first; item; item = item->next)
9437 if((int)item->data == *(int *)ptr)
9439 result = item->name;
9445 exp->identifier = MkIdentifier(result);
9447 exp->destType = MkClassType(_class->fullName);
9448 ProcessExpressionType(exp);
9452 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9454 if(!_class->dataType)
9455 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9456 type = _class->dataType;
9465 FreeExpContents(exp);
9466 exp->constant = PrintFloat(*(float *)ptr);
9472 FreeExpContents(exp);
9473 exp->constant = PrintDouble(*(double *)ptr);
9479 FreeExpContents(exp);
9480 exp->constant = PrintInt(*(int *)ptr);
9486 FreeExpContents(exp);
9487 exp->constant = PrintInt64(*(long long *)ptr);
9493 FreeExpContents(exp);
9494 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9502 ListAdd(memberList, member);
9504 if(parentDataMember->type == 1)
9509 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9511 void PopulateInstance(struct Instantiation * inst)
9513 struct Symbol * classSym = inst->_class->symbol;
9514 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9515 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9516 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9518 inst->members = MkListOne(MkMembersInitList(memberList));
9519 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9521 if(!dataMember->isProperty)
9523 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9524 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9527 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9528 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9530 void * ptr = inst->data + dataMember->offset;
9531 char * result = (((void *)0));
9533 exp->loc = member->loc = inst->loc;
9534 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9535 if(!dataMember->dataType)
9536 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9537 type = dataMember->dataType;
9540 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9542 if(_class->type == 4)
9544 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9548 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9549 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9551 for(item = e->values.first; item; item = item->next)
9553 if((int)item->data == *(int *)ptr)
9555 result = item->name;
9562 exp->identifier = MkIdentifier(result);
9564 exp->destType = MkClassType(_class->fullName);
9565 ProcessExpressionType(exp);
9568 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9570 if(!_class->dataType)
9571 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9572 type = _class->dataType;
9581 exp->constant = PrintFloat(*(float *)ptr);
9587 exp->constant = PrintDouble(*(double *)ptr);
9593 exp->constant = PrintInt(*(int *)ptr);
9599 exp->constant = PrintInt64(*(long long *)ptr);
9605 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9613 ListAdd(memberList, member);
9619 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);
9621 extern void FreeInstance(struct Instantiation * inst);
9623 void ComputeInstantiation(struct Expression * exp)
9625 struct Instantiation * inst = exp->instance;
9626 struct MembersInit * members;
9627 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9628 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9629 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9630 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9631 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9632 int subMemberStackPos = 0;
9635 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9639 if(_class->type == 0 || _class->type == 5)
9640 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9642 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9646 for(members = (*inst->members).first; members; members = members->next)
9648 switch(members->type)
9652 if(members->dataMembers)
9654 struct MemberInit * member;
9656 for(member = (*members->dataMembers).first; member; member = member->next)
9658 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9659 unsigned int found = 0x0;
9660 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9661 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9662 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9663 unsigned int dataMemberOffset;
9667 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9670 if(curMember->isProperty)
9671 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9674 dataMember = curMember;
9675 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9682 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9686 if(prop->memberAccess == 1)
9688 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9689 curClass = prop->_class;
9694 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9695 int _subMemberStackPos = 0;
9697 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9701 if(dataMember->memberAccess == 1)
9703 curMember = dataMember;
9704 curClass = dataMember->_class;
9705 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9706 subMemberStackPos = _subMemberStackPos;
9711 if(found && member->initializer && member->initializer->type == 0)
9713 struct Expression * value = member->initializer->exp;
9714 struct Type * type = (((void *)0));
9718 type = prop->dataType;
9722 if(!dataMember->dataType)
9723 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9724 type = dataMember->dataType;
9726 if(ident && ident->next)
9728 for(ident = ident->next; ident && type; ident = ident->next)
9732 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9734 type = prop->dataType;
9737 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9739 type = dataMember->dataType;
9742 else if(type->kind == 9 || type->kind == 10)
9744 struct Type * memberType;
9746 for(memberType = type->members.first; memberType; memberType = memberType->next)
9748 if(!strcmp(memberType->name, ident->string))
9759 FreeType(value->destType);
9760 value->destType = type;
9763 ComputeExpression(value);
9765 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9769 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9771 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9773 if(!_class->dataType)
9774 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9775 type = _class->dataType;
9780 void * ptr = inst->data + dataMemberOffset;
9782 if(value->type == 2)
9788 GetInt(value, (int *)ptr);
9793 GetInt64(value, (long long *)ptr);
9798 GetIntPtr(value, (intptr_t *)ptr);
9803 GetFloat(value, (float *)ptr);
9808 GetDouble(value, (double *)ptr);
9813 else if(value->type == 1)
9817 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9819 if(_class->type == 1)
9821 ComputeTypeSize(type);
9822 if(value->instance->data)
9823 memcpy(ptr, value->instance->data, type->size);
9830 if(value->type == 1 && value->instance->data)
9832 void (* Set)(void *, void *) = (void *)prop->Set;
9834 Set(inst->data, value->instance->data);
9835 PopulateInstance(inst);
9837 else if(value->type == 2)
9843 void (* Set)(void *, double) = (void *)prop->Set;
9845 Set(inst->data, strtod(value->constant, (((void *)0))));
9850 void (* Set)(void *, float) = (void *)prop->Set;
9852 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9857 void (* Set)(void *, int) = (void *)prop->Set;
9859 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9864 void (* Set)(void *, long long) = (void *)prop->Set;
9866 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9871 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9873 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9878 else if(value->type == 3)
9882 ReadString(temp, value->string);
9883 prop->Set(inst->data, temp);
9887 else if(_class->type == 3)
9891 if(value->type == 2)
9895 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9897 if(_class->type == 3)
9899 if(!_class->dataType)
9900 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9901 type = _class->dataType;
9909 float (* Set)(float) = (void *)prop->Set;
9911 GetFloat(member->initializer->exp, &fValue);
9912 exp->constant = PrintFloat(Set(fValue));
9919 double (* Set)(double) = (void *)prop->Set;
9921 GetDouble(member->initializer->exp, &dValue);
9922 exp->constant = PrintDouble(Set(dValue));
9930 else if(_class->type == 2)
9934 if(value->type == 1 && value->instance->data)
9936 unsigned int (* Set)(void *) = (void *)prop->Set;
9938 bits = Set(value->instance->data);
9940 else if(value->type == 2)
9946 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9950 GetInt(value, &part);
9951 bits = (bits & ~bitMember->mask);
9952 if(!bitMember->dataType)
9953 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9954 type = bitMember->dataType;
9955 if(type->kind == 8 && type->_class && type->_class->registered)
9957 if(!type->_class->registered->dataType)
9958 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9959 type = type->_class->registered->dataType;
9965 bits |= ((char)part << bitMember->pos);
9967 bits |= ((unsigned char)part << bitMember->pos);
9971 bits |= ((short)part << bitMember->pos);
9973 bits |= ((unsigned short)part << bitMember->pos);
9978 bits |= (part << bitMember->pos);
9980 bits |= ((unsigned int)part << bitMember->pos);
9984 bits |= ((long long)part << bitMember->pos);
9986 bits |= ((uint64)part << bitMember->pos);
9990 bits |= ((intptr_t)part << bitMember->pos);
9992 bits |= ((uintptr_t)part << bitMember->pos);
10000 if(_class && _class->type == 3)
10002 ComputeExpression(member->initializer->exp);
10003 exp->constant = member->initializer->exp->constant;
10005 member->initializer->exp->constant = (((void *)0));
10015 if(_class && _class->type == 2)
10017 exp->constant = PrintHexUInt(bits);
10022 FreeInstance(inst);
10026 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10028 if(exp->op.op == SIZEOF)
10030 FreeExpContents(exp);
10032 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10042 struct Expression * exp2 = exp->op.exp2;
10044 exp->op.exp2 = (((void *)0));
10045 FreeExpContents(exp);
10046 FreeType(exp->expType);
10047 FreeType(exp->destType);
10049 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10055 FreeExpContents(exp);
10056 op1->ops.Neg(exp, op1);
10060 if(op1->ops.BitNot)
10062 FreeExpContents(exp);
10063 op1->ops.BitNot(exp, op1);
10069 FreeExpContents(exp);
10070 op1->ops.Not(exp, op1);
10082 FreeExpContents(exp);
10083 op1->ops.Add(exp, op1, op2);
10089 FreeExpContents(exp);
10090 op1->ops.Sub(exp, op1, op2);
10096 FreeExpContents(exp);
10097 op1->ops.Mul(exp, op1, op2);
10103 FreeExpContents(exp);
10104 op1->ops.Div(exp, op1, op2);
10110 FreeExpContents(exp);
10111 op1->ops.Mod(exp, op1, op2);
10117 if(op1->ops.BitAnd)
10119 FreeExpContents(exp);
10120 op1->ops.BitAnd(exp, op1, op2);
10127 FreeExpContents(exp);
10128 op1->ops.BitOr(exp, op1, op2);
10132 if(op1->ops.BitXor)
10134 FreeExpContents(exp);
10135 op1->ops.BitXor(exp, op1, op2);
10139 if(op1->ops.LShift)
10141 FreeExpContents(exp);
10142 op1->ops.LShift(exp, op1, op2);
10146 if(op1->ops.RShift)
10148 FreeExpContents(exp);
10149 op1->ops.RShift(exp, op1, op2);
10155 FreeExpContents(exp);
10156 op1->ops.Equ(exp, op1, op2);
10162 FreeExpContents(exp);
10163 op1->ops.Nqu(exp, op1, op2);
10169 FreeExpContents(exp);
10170 op1->ops.And(exp, op1, op2);
10176 FreeExpContents(exp);
10177 op1->ops.Or(exp, op1, op2);
10183 FreeExpContents(exp);
10184 op1->ops.Grt(exp, op1, op2);
10190 FreeExpContents(exp);
10191 op1->ops.Sma(exp, op1, op2);
10195 if(op1->ops.GrtEqu)
10197 FreeExpContents(exp);
10198 op1->ops.GrtEqu(exp, op1, op2);
10202 if(op1->ops.SmaEqu)
10204 FreeExpContents(exp);
10205 op1->ops.SmaEqu(exp, op1, op2);
10213 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10215 void ComputeExpression(struct Expression * exp)
10217 char expString[10240];
10219 expString[0] = '\0';
10224 ComputeInstantiation(exp);
10229 struct Expression * exp1, * exp2 = (((void *)0));
10230 struct Operand op1 =
10234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10237 struct Operand op2 =
10241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10246 ComputeExpression(exp->op.exp2);
10249 ComputeExpression(exp->op.exp1);
10250 exp1 = exp->op.exp1;
10251 exp2 = exp->op.exp2;
10252 op1 = GetOperand(exp1);
10254 op1.type->refCount++;
10257 op2 = GetOperand(exp2);
10259 op2.type->refCount++;
10264 exp1 = exp->op.exp2;
10265 op1 = GetOperand(exp1);
10267 op1.type->refCount++;
10269 CallOperator(exp, exp1, exp2, &op1, &op2);
10271 FreeType(op1.type);
10273 FreeType(op2.type);
10279 struct Expression * e, * n;
10281 for(e = (*exp->list).first; e; e = n)
10286 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10288 ComputeExpression(e);
10289 FreeType(exp->expType);
10290 FreeType(exp->destType);
10292 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10293 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10304 struct Expression * memberExp = exp->member.exp;
10305 struct Identifier * memberID = exp->member.member;
10306 struct Type * type;
10308 ComputeExpression(exp->member.exp);
10309 type = exp->member.exp->expType;
10312 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)));
10313 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10314 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10315 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10317 if(type->kind == 19 && exp->member.exp->type == 26)
10318 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10322 struct Symbol * classSym;
10325 PrintType(type, string, 0x0, 0x1);
10326 classSym = FindClass(string);
10327 _class = classSym ? classSym->registered : (((void *)0));
10329 if(exp->member.member)
10331 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10333 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10335 if(!prop && !member && _class && exp->member.member)
10337 struct Symbol * classSym = FindClass(exp->member.member->string);
10339 convertTo = _class;
10340 _class = classSym ? classSym->registered : (((void *)0));
10341 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10347 struct Type * type = prop->dataType;
10349 if(_class->type == 3)
10351 if(type->kind == 8)
10353 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10355 if(_class->type == 3)
10357 if(!_class->dataType)
10358 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10359 type = _class->dataType;
10367 float (* Get)(float) = (void *)prop->Get;
10369 GetFloat(exp->member.exp, &value);
10370 exp->constant = PrintFloat(Get ? Get(value) : value);
10377 double (* Get)(double);
10379 GetDouble(exp->member.exp, &value);
10381 Get = (void *)prop->Set;
10383 Get = (void *)prop->Get;
10384 exp->constant = PrintDouble(Get ? Get(value) : value);
10394 struct Expression * value = exp->member.exp;
10395 struct Type * type;
10397 if(!prop->dataType)
10398 ProcessPropertyType(prop);
10399 type = prop->dataType;
10403 else if(_class->type == 1)
10409 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10411 if(propertyClass->type == 1 && value->type == 1)
10413 void (* Set)(void *, void *) = (void *)prop->Set;
10415 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10416 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10417 exp->instance->_class = MkSpecifierName(_class->fullName);
10418 exp->instance->loc = exp->loc;
10420 Set(exp->instance->data, value->instance->data);
10421 PopulateInstance(exp->instance);
10428 void (* Set)(void *, int) = (void *)prop->Set;
10430 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10431 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10432 exp->instance->_class = MkSpecifierName(_class->fullName);
10433 exp->instance->loc = exp->loc;
10435 GetInt(value, &intValue);
10436 Set(exp->instance->data, intValue);
10437 PopulateInstance(exp->instance);
10442 long long intValue;
10443 void (* Set)(void *, long long) = (void *)prop->Set;
10445 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10446 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10447 exp->instance->_class = MkSpecifierName(_class->fullName);
10448 exp->instance->loc = exp->loc;
10450 GetInt64(value, &intValue);
10451 Set(exp->instance->data, intValue);
10452 PopulateInstance(exp->instance);
10458 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10460 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10461 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10462 exp->instance->_class = MkSpecifierName(_class->fullName);
10463 exp->instance->loc = exp->loc;
10465 GetIntPtr(value, &intValue);
10466 Set(exp->instance->data, intValue);
10467 PopulateInstance(exp->instance);
10472 double doubleValue;
10473 void (* Set)(void *, double) = (void *)prop->Set;
10475 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10476 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10477 exp->instance->_class = MkSpecifierName(_class->fullName);
10478 exp->instance->loc = exp->loc;
10480 GetDouble(value, &doubleValue);
10481 Set(exp->instance->data, doubleValue);
10482 PopulateInstance(exp->instance);
10487 else if(_class->type == 2)
10493 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10495 if(propertyClass->type == 1 && value->instance->data)
10497 unsigned int (* Set)(void *) = (void *)prop->Set;
10498 unsigned int bits = Set(value->instance->data);
10500 exp->constant = PrintHexUInt(bits);
10504 else if(_class->type == 2)
10506 unsigned int value;
10507 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10510 GetUInt(exp->member.exp, &value);
10512 exp->constant = PrintHexUInt(bits);
10521 if(_class->type == 2)
10523 unsigned int value;
10525 GetUInt(exp->member.exp, &value);
10530 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10532 if(_class->type == 1)
10534 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10536 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10537 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10538 exp->instance->_class = MkSpecifierName(_class->fullName);
10539 exp->instance->loc = exp->loc;
10541 Get(value, exp->instance->data);
10542 PopulateInstance(exp->instance);
10544 else if(_class->type == 2)
10546 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10547 uint64 bits = Get(value);
10549 exp->constant = PrintHexUInt64(bits);
10556 else if(_class->type == 1)
10558 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10564 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10566 if(_class->type == 1 && value)
10568 void (* Get)(void *, void *) = (void *)prop->Get;
10570 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10571 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10572 exp->instance->_class = MkSpecifierName(_class->fullName);
10573 exp->instance->loc = exp->loc;
10575 Get(value, exp->instance->data);
10576 PopulateInstance(exp->instance);
10587 exp->isConstant = 0x0;
10596 FreeExpression(memberExp);
10597 FreeIdentifier(memberID);
10603 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10605 FreeExpContents(exp);
10606 exp->constant = PrintUInt(ComputeTypeSize(type));
10613 struct Symbol * classSym = exp->_class->symbol;
10615 if(classSym && classSym->registered)
10617 if(classSym->registered->fixed)
10619 FreeSpecifier(exp->_class);
10620 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10625 char className[1024];
10627 strcpy(className, "__ecereClass_");
10628 FullClassNameCat(className, classSym->string, 0x1);
10629 MangleClassName(className);
10630 FreeExpContents(exp);
10632 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10633 exp->member.member = MkIdentifier("structSize");
10640 struct Type * type;
10641 struct Expression * e = exp;
10643 if(exp->type == 11)
10646 ComputeExpression(exp->cast.exp);
10649 if(e && exp->expType)
10651 type = exp->expType;
10652 if(type->kind == 8)
10654 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10656 if(_class && (_class->type == 3 || _class->type == 2))
10658 if(!_class->dataType)
10659 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10660 type = _class->dataType;
10670 GetChar(e, &value);
10671 FreeExpContents(exp);
10672 exp->constant = PrintChar(value);
10677 unsigned char value;
10679 GetUChar(e, &value);
10680 FreeExpContents(exp);
10681 exp->constant = PrintUChar(value);
10690 GetShort(e, &value);
10691 FreeExpContents(exp);
10692 exp->constant = PrintShort(value);
10697 unsigned short value;
10699 GetUShort(e, &value);
10700 FreeExpContents(exp);
10701 exp->constant = PrintUShort(value);
10711 FreeExpContents(exp);
10712 exp->constant = PrintInt(value);
10717 unsigned int value;
10719 GetUInt(e, &value);
10720 FreeExpContents(exp);
10721 exp->constant = PrintUInt(value);
10730 GetInt64(e, &value);
10731 FreeExpContents(exp);
10732 exp->constant = PrintInt64(value);
10739 GetUInt64(e, &value);
10740 FreeExpContents(exp);
10741 exp->constant = PrintUInt64(value);
10750 GetIntPtr(e, &value);
10751 FreeExpContents(exp);
10752 exp->constant = PrintInt64((long long)value);
10759 GetUIntPtr(e, &value);
10760 FreeExpContents(exp);
10761 exp->constant = PrintUInt64((uint64)value);
10769 GetFloat(e, &value);
10770 FreeExpContents(exp);
10771 exp->constant = PrintFloat(value);
10779 GetDouble(e, &value);
10780 FreeExpContents(exp);
10781 exp->constant = PrintDouble(value);
10791 struct Operand op1 =
10795 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10798 struct Operand op2 =
10802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10805 struct Operand op3 =
10809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10814 ComputeExpression((*exp->cond.exp).last);
10815 if(exp->cond.elseExp)
10816 ComputeExpression(exp->cond.elseExp);
10818 ComputeExpression(exp->cond.cond);
10819 op1 = GetOperand(exp->cond.cond);
10821 op1.type->refCount++;
10822 op2 = GetOperand((*exp->cond.exp).last);
10824 op2.type->refCount++;
10825 op3 = GetOperand(exp->cond.elseExp);
10827 op3.type->refCount++;
10830 FreeExpContents(exp);
10831 op1.ops.Cond(exp, &op1, &op2, &op3);
10834 FreeType(op1.type);
10836 FreeType(op2.type);
10838 FreeType(op3.type);
10844 void ApplyAnyObjectLogic(struct Expression * e);
10846 extern void CopyTypeInto(struct Type * type, struct Type * src);
10848 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10850 unsigned int result = 0x1;
10854 struct __ecereNameSpace__ecere__sys__OldList converts =
10858 struct Conversion * convert;
10860 if(destType->kind == 0)
10862 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10866 for(convert = converts.first; convert; convert = convert->next)
10868 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10873 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10876 newExp->destType = (((void *)0));
10880 exp->addedThis = 0x1;
10881 exp->member.exp = newExp;
10882 FreeType(exp->member.exp->expType);
10883 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10884 exp->member.exp->expType->classObjectType = objectType;
10885 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10886 exp->member.memberType = 1;
10887 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10888 exp->needCast = 0x1;
10890 exp->expType->refCount++;
10891 ApplyAnyObjectLogic(exp->member.exp);
10897 exp->addedThis = 0x1;
10898 exp->member.exp = newExp;
10899 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10901 newExp->byReference = 0x1;
10903 FreeType(exp->member.exp->expType);
10904 exp->member.exp->expType = (((void *)0));
10905 if(convert->convert->dataType)
10907 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10908 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10909 exp->member.exp->expType->refCount = 1;
10910 exp->member.exp->expType->classObjectType = objectType;
10911 ApplyAnyObjectLogic(exp->member.exp);
10913 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10914 exp->member.memberType = 4;
10915 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10916 exp->needCast = 0x1;
10917 if(convert->resultType)
10918 convert->resultType->refCount++;
10924 FreeType(exp->expType);
10927 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10928 exp->needCast = 0x1;
10930 exp->expType->refCount++;
10934 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10935 exp->needCast = 0x1;
10936 if(convert->resultType)
10937 convert->resultType->refCount++;
10941 if(exp->isConstant && inCompiler)
10942 ComputeExpression(exp);
10943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10945 if(!result && exp->expType && converts.count)
10947 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10949 if(!result && exp->expType && exp->destType)
10951 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))
10958 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10960 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10962 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10964 void CheckTemplateTypes(struct Expression * exp)
10966 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10968 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10969 struct Statement * compound;
10970 struct Context * context;
10974 exp->destType->refCount++;
10976 exp->expType->refCount++;
10977 newExp->prev = (((void *)0));
10978 newExp->next = (((void *)0));
10979 switch(exp->expType->kind)
10982 if(exp->destType->classObjectType)
10985 exp->destType->refCount--;
10987 exp->expType->refCount--;
10988 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10992 struct __ecereNameSpace__ecere__sys__OldList * specs;
10993 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10994 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10996 context = PushContext();
10997 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10998 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10999 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11001 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11002 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11003 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11004 exp->compound->compound.context = context;
11005 PopContext(context);
11010 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11011 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11015 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11017 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11018 struct Statement * compound;
11019 struct Context * context;
11023 exp->destType->refCount++;
11025 exp->expType->refCount++;
11026 newExp->prev = (((void *)0));
11027 newExp->next = (((void *)0));
11028 switch(exp->expType->kind)
11031 if(exp->destType->classObjectType)
11034 exp->destType->refCount--;
11036 exp->expType->refCount--;
11037 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11041 struct __ecereNameSpace__ecere__sys__OldList * specs;
11042 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11043 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11045 context = PushContext();
11046 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11047 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11048 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11050 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11051 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11052 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11053 exp->compound->compound.context = context;
11054 PopContext(context);
11059 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11062 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11063 ProcessExpressionType((*exp->list).first);
11069 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11070 newExp->needCast = 0x1;
11071 ProcessExpressionType((*exp->list).first);
11077 if(exp->expType->kind == 20)
11079 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11083 FreeType(exp->destType);
11084 FreeType(exp->expType);
11085 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11089 if(newExp->type == 8 && newExp->member.memberType == 3)
11093 exp->op.exp1 = (((void *)0));
11094 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11098 char typeString[1024];
11099 struct Declarator * decl;
11100 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11102 typeString[0] = '\0';
11103 PrintType(exp->expType, typeString, 0x0, 0x0);
11104 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11106 exp->cast.typeName = MkTypeName(specs, decl);
11107 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11108 exp->cast.exp->needCast = 0x1;
11116 extern int strncmp(const char * , const char * , int n);
11118 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11120 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11122 int nsLen = strlen(nameSpace);
11123 struct Symbol * symbol;
11125 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)))
11127 char * s = symbol->string;
11129 if(!strncmp(s, nameSpace, nsLen))
11134 for(c = strlen(s) - 1; c >= 0; c--)
11137 namePart = s + c + 1;
11138 if(!strcmp(namePart, name))
11146 return (((void *)0));
11149 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11152 char nameSpace[1024];
11154 unsigned int gotColon = 0x0;
11156 nameSpace[0] = '\0';
11157 for(c = strlen(name) - 1; c >= 0; c--)
11163 namePart = name + c + 1;
11164 while(c >= 0 && name[c] == ':')
11168 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11172 memcpy(nameSpace, name, c + 1);
11173 nameSpace[c + 1] = (char)0;
11174 return ScanWithNameSpace(tree, nameSpace, namePart);
11178 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11184 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11188 return ScanWithNameSpace(tree, "", namePart);
11190 return (((void *)0));
11193 static void ProcessDeclaration(struct Declaration * decl);
11195 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11197 struct Context * ctx;
11198 struct Symbol * symbol = (((void *)0));
11200 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11202 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11204 symbol = (((void *)0));
11207 char curName[1024];
11209 strcpy(curName, thisNameSpace);
11210 strcat(curName, "::");
11211 strcat(curName, name);
11212 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11215 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11218 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11219 if(symbol || ctx == endContext)
11222 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11224 if(symbol->pointerExternal->type == 0)
11226 struct FunctionDefinition * function = symbol->pointerExternal->function;
11227 struct Context * tmpContext = curContext;
11229 curContext = (((void *)0));
11230 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11231 curContext = tmpContext;
11232 symbol->pointerExternal->symbol = symbol;
11233 DeclareType(symbol->type, 0x1, 0x1);
11234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11235 symbol->id = curExternal->symbol->idCode;
11237 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11240 symbol->id = curExternal->symbol->idCode;
11246 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11248 if(!type->isSigned && type->kind != 22)
11249 ListAdd(specs, MkSpecifier(UNSIGNED));
11254 if(type->_class->registered)
11256 if(!type->_class->registered->dataType)
11257 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11258 GetTypeSpecs(type->_class->registered->dataType, specs);
11263 ListAdd(specs, MkSpecifier(DOUBLE));
11266 ListAdd(specs, MkSpecifier(FLOAT));
11269 ListAdd(specs, MkSpecifier(CHAR));
11272 ListAdd(specs, MkSpecifier(SHORT));
11275 ListAdd(specs, MkSpecifier(INT64));
11278 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11282 ListAdd(specs, MkSpecifier(INT));
11287 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11289 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11296 if(type->_class && type->_class->string)
11298 if(type->classObjectType == 2)
11299 strcat(string, "typed_object");
11301 strcat(string, type->_class->string);
11304 if(type->_class->registered)
11305 strcat(string, type->_class->registered->name);
11307 strcat(string, type->_class->string);
11314 _PrintType(type->type, string, 0x0, printFunction, fullName);
11315 strcat(string, " *");
11320 strcat(string, "void");
11323 strcat(string, type->isSigned ? "int" : "uint");
11326 strcat(string, type->isSigned ? "int64" : "uint64");
11329 strcat(string, type->isSigned ? "intptr" : "uintptr");
11332 strcat(string, type->isSigned ? "char" : "byte");
11335 strcat(string, type->isSigned ? "short" : "uint16");
11338 strcat(string, "float");
11341 strcat(string, "double");
11346 strcat(string, "struct ");
11347 strcat(string, type->enumName);
11349 else if(type->typeName)
11351 strcat(string, type->typeName);
11355 struct Type * member;
11357 strcat(string, "struct {");
11358 for(member = type->members.first; member; member = member->next)
11360 PrintType(member, string, 0x1, fullName);
11361 strcat(string, "; ");
11363 strcat(string, "}");
11369 strcat(string, "union ");
11370 strcat(string, type->enumName);
11372 else if(type->typeName)
11374 strcat(string, type->typeName);
11378 strcat(string, "union ");
11379 strcat(string, "(unnamed)");
11385 strcat(string, "enum ");
11386 strcat(string, type->enumName);
11388 else if(type->typeName)
11390 strcat(string, type->typeName);
11393 strcat(string, "enum");
11399 if(type->dllExport)
11400 strcat(string, "dllexport ");
11401 PrintType(type->returnType, string, 0x0, fullName);
11402 strcat(string, " ");
11409 strcat(string, type->name);
11412 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11418 strcat(string, name);
11424 struct Type * param;
11426 strcat(string, "(");
11427 for(param = type->params.first; param; param = param->next)
11429 PrintType(param, string, 0x1, fullName);
11431 strcat(string, ", ");
11433 strcat(string, ")");
11440 char baseType[1024], size[256];
11441 struct Type * arrayType = type;
11443 baseType[0] = '\0';
11445 while(arrayType->kind == 12)
11448 if(arrayType->enumClass)
11449 strcat(size, arrayType->enumClass->string);
11450 else if(arrayType->arraySizeExp)
11451 PrintExpression(arrayType->arraySizeExp, size);
11453 arrayType = arrayType->arrayType;
11455 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11456 strcat(string, baseType);
11457 strcat(string, size);
11463 strcat(string, "...");
11466 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11469 strcat(string, "subclass(");
11470 strcat(string, type->_class ? type->_class->string : "int");
11471 strcat(string, ")");
11474 strcat(string, type->templateParameter->identifier->string);
11477 strcat(string, "thisclass");
11480 strcat(string, "__builtin_va_list");
11483 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11485 strcat(string, " ");
11486 strcat(string, type->name);
11491 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11493 struct Type * funcType;
11495 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11497 if(funcType && funcType->kind == 11 && type != funcType)
11499 char typeString[1024];
11500 struct Type * param;
11502 PrintType(funcType->returnType, string, 0x0, fullName);
11503 strcat(string, "(");
11504 _PrintType(type, string, printName, 0x0, fullName);
11505 strcat(string, ")");
11506 strcat(string, "(");
11507 for(param = funcType->params.first; param; param = param->next)
11509 PrintType(param, string, 0x1, fullName);
11511 strcat(string, ", ");
11513 strcat(string, ")");
11516 _PrintType(type, string, printName, 0x1, fullName);
11517 if(type->bitFieldCount)
11521 sprintf(count, ":%d", type->bitFieldCount);
11522 strcat(string, count);
11526 static struct Type * FindMember(struct Type * type, char * string)
11528 struct Type * memberType;
11530 for(memberType = type->members.first; memberType; memberType = memberType->next)
11532 if(!memberType->name)
11534 struct Type * subType = FindMember(memberType, string);
11539 else if(!strcmp(memberType->name, string))
11542 return (((void *)0));
11545 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11547 struct Type * memberType;
11549 for(memberType = type->members.first; memberType; memberType = memberType->next)
11551 if(!memberType->name)
11553 struct Type * subType = FindMember(memberType, string);
11557 *offset += memberType->offset;
11561 else if(!strcmp(memberType->name, string))
11563 *offset += memberType->offset;
11567 return (((void *)0));
11570 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11572 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11574 struct Expression * ParseExpressionString(char * expression)
11576 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11577 ((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));
11578 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11580 parsedExpression = (((void *)0));
11582 expression_yyparse();
11583 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11584 return parsedExpression;
11587 extern char * QMkString(char * source);
11589 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11591 void * __ecereTemp1;
11592 struct Identifier * id = exp->identifier;
11593 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11594 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11595 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11596 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11598 if(_class && _class->type == 4)
11600 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11601 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11605 struct __ecereNameSpace__ecere__com__Class * baseClass;
11607 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11609 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11611 for(value = e->values.first; value; value = value->next)
11613 if(!strcmp(value->name, id->string))
11618 char constant[256];
11620 FreeExpContents(exp);
11622 exp->isConstant = 0x1;
11623 if(!strcmp(baseClass->dataTypeString, "int"))
11624 sprintf(constant, "%d", value->data);
11626 sprintf(constant, "0x%X", value->data);
11627 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11628 exp->expType = MkClassType(baseClass->fullName);
11636 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11638 ProcessMethodType(method);
11639 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));
11642 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11644 if(!prop->dataType)
11645 ProcessPropertyType(prop);
11646 exp->expType = prop->dataType;
11648 prop->dataType->refCount++;
11651 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11653 if(!member->dataType)
11654 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11655 exp->expType = member->dataType;
11656 if(member->dataType)
11657 member->dataType->refCount++;
11660 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11662 if(!classProp->dataType)
11663 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11664 if(classProp->constant)
11666 FreeExpContents(exp);
11667 exp->isConstant = 0x1;
11668 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11671 exp->constant = QMkString((char *)classProp->Get(_class));
11675 char constant[256];
11678 sprintf(constant, "%d", classProp->Get(_class));
11679 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11685 exp->expType = classProp->dataType;
11686 if(classProp->dataType)
11687 classProp->dataType->refCount++;
11693 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11695 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11696 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11697 struct __ecereNameSpace__ecere__com__NameSpace * child;
11701 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)))
11703 data = ScanGlobalData(child, name);
11711 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11713 extern char * strncpy(char * , const char * , int n);
11715 static struct GlobalData * FindGlobalData(char * name)
11718 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11720 nameSpace = globalData;
11721 for(c = 0; name[c]; c++)
11723 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11725 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11726 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11728 strncpy(spaceName, name + start, c - start);
11729 spaceName[c - start] = '\0';
11730 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11731 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11733 return (((void *)0));
11734 nameSpace = newSpace;
11742 return ScanGlobalData(nameSpace, name + start);
11744 return (((void *)0));
11747 static int definedExpStackPos;
11749 static void * definedExpStack[512];
11751 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11753 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11755 FreeExpContents(checkedExp);
11756 FreeType(checkedExp->expType);
11757 FreeType(checkedExp->destType);
11758 *checkedExp = *newExp;
11759 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11760 checkedExp->prev = prev;
11761 checkedExp->next = next;
11764 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11766 extern int printf(char * , ...);
11768 void __ecereMethod_Expression_Clear();
11770 void ApplyAnyObjectLogic(struct Expression * e)
11772 struct Type * destType = e->destType;
11774 if(destType && (destType->classObjectType == 3))
11776 if(e && e->expType)
11778 struct Type * type = e->expType;
11779 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11781 if(type->kind == 8 && type->_class && type->_class->registered)
11783 _class = type->_class->registered;
11785 else if(type->kind == 19)
11787 _class = FindClass("ecere::com::Class")->registered;
11791 char string[1024] = "";
11792 struct Symbol * classSym;
11794 PrintType(type, string, 0x0, 0x1);
11795 classSym = FindClass(string);
11797 _class = classSym->registered;
11799 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)))
11801 if(!_class || strcmp(_class->fullName, "char *"))
11803 struct Expression * checkedExp = e, * newExp;
11805 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11807 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11809 if(checkedExp->type == 25)
11811 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11814 checkedExp = (*checkedExp->list).last;
11816 else if(checkedExp->type == 11)
11817 checkedExp = checkedExp->cast.exp;
11819 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11821 newExp = checkedExp->op.exp2;
11822 checkedExp->op.exp2 = (((void *)0));
11823 FreeExpContents(checkedExp);
11824 if(e->expType && e->expType->passAsTemplate)
11828 ComputeTypeSize(e->expType);
11829 sprintf(size, "%d", e->expType->size);
11830 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))))));
11832 ReplaceExpContents(checkedExp, newExp);
11833 e->byReference = 0x1;
11835 else if(!e->byReference || (_class && _class->type == 5))
11837 struct Expression * checkedExp, * newExp;
11840 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;
11842 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11844 struct Context * context = PushContext();
11845 struct Declarator * decl;
11846 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11847 char typeString[1024];
11848 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11850 typeString[0] = '\0';
11852 newExp->prev = (((void *)0));
11853 newExp->next = (((void *)0));
11854 newExp->expType = (((void *)0));
11855 PrintType(e->expType, typeString, 0x0, 0x1);
11856 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11857 newExp->destType = ProcessType(specs, decl);
11858 curContext = context;
11863 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11865 sprintf(name, "__internalValue%03X", internalValueCounter++);
11866 if(!curCompound->compound.declarations)
11867 curCompound->compound.declarations = MkList();
11868 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11869 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11870 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11871 e->compound = MkCompoundStmt((((void *)0)), stmts);
11874 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11876 struct Type * type = e->destType;
11878 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11879 CopyTypeInto(e->destType, type);
11880 e->destType->refCount = 1;
11881 e->destType->classObjectType = 0;
11884 e->compound->compound.context = context;
11885 PopContext(context);
11886 curContext = context->parent;
11890 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11892 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11894 if(checkedExp->type == 25)
11896 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11899 checkedExp = (*checkedExp->list).last;
11901 else if(checkedExp->type == 11)
11902 checkedExp = checkedExp->cast.exp;
11905 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11907 *operand = *checkedExp;
11908 checkedExp->destType = (((void *)0));
11909 checkedExp->expType = (((void *)0));
11910 __ecereMethod_Expression_Clear(checkedExp);
11911 checkedExp->type = 4;
11912 checkedExp->op.op = '&';
11913 checkedExp->op.exp1 = (((void *)0));
11914 checkedExp->op.exp2 = operand;
11923 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))))
11925 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11931 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11934 thisExp->prev = (((void *)0));
11935 thisExp->next = (((void *)0));
11936 __ecereMethod_Expression_Clear(e);
11938 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11939 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11940 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11942 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11943 CopyTypeInto(e->expType, thisExp->expType);
11944 e->expType->byReference = 0x0;
11945 e->expType->refCount = 1;
11946 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))
11948 e->expType->classObjectType = 0;
11953 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11955 if(destType->kind == 14)
11957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11959 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11961 unsigned int byReference = e->expType->byReference;
11962 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11963 struct Declarator * decl;
11964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11965 char typeString[1024];
11966 struct Type * type;
11967 int backupClassObjectType;
11969 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11973 backupClassObjectType = type->classObjectType;
11974 type->classObjectType = 0;
11975 typeString[0] = '\0';
11976 PrintType(type, typeString, 0x0, 0x1);
11977 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11978 type->classObjectType = backupClassObjectType;
11980 thisExp->prev = (((void *)0));
11981 thisExp->next = (((void *)0));
11982 __ecereMethod_Expression_Clear(e);
11983 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)))
11987 e->op.exp1 = (((void *)0));
11988 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11993 e->cast.typeName = MkTypeName(specs, decl);
11994 e->cast.exp = thisExp;
11995 e->byReference = 0x1;
11998 e->destType = destType;
12000 destType->refCount++;
12005 extern char * strstr(char * , const char * );
12007 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12009 struct __ecereNameSpace__ecere__com__DefinedExpression
12011 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12012 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12015 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12016 } __attribute__ ((gcc_struct));
12018 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12020 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12022 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12024 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12026 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12028 extern struct Expression * CopyExpression(struct Expression * exp);
12030 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12032 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12034 static void ProcessStatement(struct Statement * stmt);
12036 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12038 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12040 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12042 extern char * sourceFile;
12044 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12046 void ProcessExpressionType(struct Expression * exp)
12048 void * __ecereTemp2;
12049 void * __ecereTemp1;
12050 unsigned int unresolved = 0x0;
12051 struct Location oldyylloc = yylloc;
12052 unsigned int notByReference = 0x0;
12054 if(!exp || exp->expType)
12061 struct Identifier * id = exp->identifier;
12065 if(id->_class && id->_class->name)
12067 id->classSym = id->_class->symbol;
12069 if(strstr(id->string, "__ecereClass") == id->string)
12071 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12074 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12076 ReplaceClassMembers(exp, thisClass);
12079 ProcessExpressionType(exp);
12082 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12087 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12091 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12097 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12100 ProcessExpressionType(exp);
12104 else if(currentClass && !id->_class)
12106 if(ResolveIdWithClass(exp, currentClass, 0x1))
12109 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12114 struct Type * type = symbol->type;
12115 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12117 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12119 struct Context * context = SetupTemplatesContext(_class);
12121 type = ReplaceThisClassType(_class);
12122 FinishTemplatesContext(context);
12124 type->refCount = 0;
12126 FreeSpecifier(id->_class);
12127 id->_class = (((void *)0));
12128 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12129 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12130 id->classSym = (((void *)0));
12131 exp->expType = type;
12134 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12135 exp->isConstant = 0x1;
12136 if(symbol->isParam || !strcmp(id->string, "this"))
12138 if(_class && _class->type == 1)
12139 exp->byReference = 0x1;
12141 if(symbol->isIterator)
12143 if(symbol->isIterator == 3)
12146 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12147 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12148 exp->expType = (((void *)0));
12149 ProcessExpressionType(exp);
12151 else if(symbol->isIterator != 4)
12154 exp->member.exp = MkExpIdentifier(exp->identifier);
12155 exp->member.exp->expType = exp->expType;
12156 exp->member.member = MkIdentifier("data");
12157 exp->expType = (((void *)0));
12158 ProcessExpressionType(exp);
12165 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12167 if(thisNameSpace && !(id->_class && !id->_class->name))
12171 strcpy(name, thisNameSpace);
12172 strcat(name, "::");
12173 strcat(name, id->string);
12174 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12177 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12182 for(c = 0; c < definedExpStackPos; c++)
12183 if(definedExpStack[c] == definedExp)
12185 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12187 struct Location backupYylloc = yylloc;
12189 definedExpStack[definedExpStackPos++] = definedExp;
12190 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12191 ((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));
12192 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12194 parsedExpression = (((void *)0));
12196 expression_yyparse();
12197 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12198 yylloc = backupYylloc;
12199 if(parsedExpression)
12201 FreeIdentifier(id);
12203 exp->list = MkListOne(parsedExpression);
12204 parsedExpression->loc = yylloc;
12205 ProcessExpressionType(exp);
12206 definedExpStackPos--;
12209 definedExpStackPos--;
12215 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12221 struct GlobalData * data = (((void *)0));
12223 if(thisNameSpace && !(id->_class && !id->_class->name))
12227 strcpy(name, thisNameSpace);
12228 strcat(name, "::");
12229 strcat(name, id->string);
12230 data = FindGlobalData(name);
12233 data = FindGlobalData(id->string);
12236 DeclareGlobalData(data);
12237 exp->expType = data->dataType;
12239 data->dataType->refCount++;
12240 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12241 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12242 FreeSpecifier(id->_class);
12243 id->_class = (((void *)0));
12248 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12250 if(thisNameSpace && !(id->_class && !id->_class->name))
12254 strcpy(name, thisNameSpace);
12255 strcat(name, "::");
12256 strcat(name, id->string);
12257 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12260 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12265 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12266 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12268 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12269 strcpy(name, "__ecereFunction_");
12270 FullClassNameCat(name, id->string, 0x0);
12271 if(DeclareFunction(function, name))
12273 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12274 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12276 exp->expType = function->dataType;
12277 if(function->dataType)
12278 function->dataType->refCount++;
12279 FreeSpecifier(id->_class);
12280 id->_class = (((void *)0));
12292 struct __ecereNameSpace__ecere__com__Class * _class;
12294 if(!exp->instance->_class)
12296 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12298 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12301 ProcessInstantiationType(exp->instance);
12302 exp->isConstant = exp->instance->isConstant;
12303 if(exp->instance->_class)
12305 exp->expType = MkClassType(exp->instance->_class->name);
12313 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12315 exp->expType = type;
12316 if(exp->constant[0] == '\'')
12318 if((int)((unsigned char *)exp->constant)[1] > 127)
12321 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12324 ch = exp->constant[1];
12325 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12326 exp->constant = PrintUInt(ch);
12328 type->_class = FindClass("unichar");
12329 type->isSigned = 0x0;
12334 type->isSigned = 0x1;
12337 else if(strchr(exp->constant, '.'))
12339 char ch = exp->constant[strlen(exp->constant) - 1];
12345 type->isSigned = 0x1;
12349 if(exp->constant[0] == '0' && exp->constant[1])
12350 type->isSigned = 0x0;
12351 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12352 type->isSigned = 0x0;
12353 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12354 type->isSigned = 0x0;
12356 type->isSigned = 0x1;
12359 exp->isConstant = 0x1;
12365 exp->isConstant = 0x1;
12366 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));
12371 ProcessExpressionType(exp->_new.size);
12372 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));
12373 DeclareType(exp->expType->type, 0x0, 0x0);
12377 ProcessExpressionType(exp->_renew.size);
12378 ProcessExpressionType(exp->_renew.exp);
12379 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));
12380 DeclareType(exp->expType->type, 0x0, 0x0);
12384 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12385 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12386 unsigned int useDestType = 0x0, useSideType = 0x0;
12387 struct Location oldyylloc = yylloc;
12388 unsigned int useSideUnit = 0x0;
12389 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12431 if(exp->op.op != '*' || exp->op.exp1)
12438 if(exp->op.op == '&')
12440 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12442 struct Identifier * id = exp->op.exp2->identifier;
12443 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12445 if(symbol && symbol->isIterator == 2)
12448 exp->member.exp = exp->op.exp2;
12449 exp->member.member = MkIdentifier("key");
12450 exp->expType = (((void *)0));
12451 exp->op.exp2->expType = symbol->type;
12452 symbol->type->refCount++;
12453 ProcessExpressionType(exp);
12461 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))
12463 if(exp->op.exp1->destType)
12464 FreeType(exp->op.exp1->destType);
12465 exp->op.exp1->destType = exp->destType;
12467 exp->destType->refCount++;
12471 if(exp->op.exp1->destType)
12472 FreeType(exp->op.exp1->destType);
12473 exp->op.exp1->destType = dummy;
12476 if(exp->op.exp1->destType && exp->op.op != '=')
12477 exp->op.exp1->destType->count++;
12478 ProcessExpressionType(exp->op.exp1);
12479 if(exp->op.exp1->destType && exp->op.op != '=')
12480 exp->op.exp1->destType->count--;
12481 if(exp->op.exp1->destType == dummy)
12484 exp->op.exp1->destType = (((void *)0));
12486 type1 = exp->op.exp1->expType;
12490 char expString[10240];
12492 expString[0] = '\0';
12493 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12497 exp->op.exp2->destType = exp->op.exp1->expType;
12498 if(exp->op.exp1->expType)
12499 exp->op.exp1->expType->refCount++;
12503 exp->op.exp2->destType = exp->destType;
12505 exp->destType->refCount++;
12509 exp->expType = type1;
12514 PrintExpression(exp->op.exp2, expString);
12515 if(type1 && type1->kind == 13)
12517 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)
12518 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12519 else if(exp->op.op == '=')
12521 if(exp->op.exp2->destType)
12522 FreeType(exp->op.exp2->destType);
12523 exp->op.exp2->destType = type1;
12530 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)
12534 if(exp->op.exp2->destType)
12535 FreeType(exp->op.exp2->destType);
12536 exp->op.exp2->destType = type1;
12543 exp->expType = type1;
12545 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)))
12547 if(exp->op.exp2->destType)
12548 FreeType(exp->op.exp2->destType);
12549 exp->op.exp2->destType = exp->destType;
12551 exp->destType->refCount++;
12555 if(exp->op.exp2->destType)
12556 FreeType(exp->op.exp2->destType);
12557 exp->op.exp2->destType = dummy;
12560 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12562 FreeType(exp->op.exp2->destType);
12563 exp->op.exp2->destType = type1;
12566 if(exp->op.exp2->destType && exp->op.op != '=')
12567 exp->op.exp2->destType->count++;
12568 ProcessExpressionType(exp->op.exp2);
12569 if(exp->op.exp2->destType && exp->op.op != '=')
12570 exp->op.exp2->destType->count--;
12571 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12573 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)
12575 if(exp->op.op != '=' && type1->type->kind == 0)
12576 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12578 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)))
12580 if(exp->op.op == ADD_ASSIGN)
12581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12583 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))
12585 if(exp->op.op == ADD_ASSIGN)
12586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12588 else if(inCompiler)
12590 char type1String[1024];
12591 char type2String[1024];
12593 type1String[0] = '\0';
12594 type2String[0] = '\0';
12595 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12596 PrintType(type1, type2String, 0x0, 0x1);
12597 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12598 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12601 if(exp->op.exp2->destType == dummy)
12604 exp->op.exp2->destType = (((void *)0));
12606 type2 = exp->op.exp2->expType;
12609 if(exp->op.op == SIZEOF)
12611 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12612 exp->isConstant = 0x1;
12614 else if(exp->op.op == '*' && !exp->op.exp1)
12616 exp->expType = Dereference(type2);
12617 if(type2 && type2->kind == 8)
12618 notByReference = 0x1;
12620 else if(exp->op.op == '&' && !exp->op.exp1)
12621 exp->expType = Reference(type2);
12628 if(exp->op.exp1->destType)
12629 FreeType(exp->op.exp1->destType);
12630 exp->op.exp1->destType = MkClassType("bool");
12631 exp->op.exp1->destType->truth = 0x1;
12632 if(!exp->op.exp1->expType)
12633 ProcessExpressionType(exp->op.exp1);
12635 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12636 FreeType(exp->op.exp1->expType);
12637 exp->op.exp1->expType = MkClassType("bool");
12638 exp->op.exp1->expType->truth = 0x1;
12642 if(exp->op.exp2->destType)
12643 FreeType(exp->op.exp2->destType);
12644 exp->op.exp2->destType = MkClassType("bool");
12645 exp->op.exp2->destType->truth = 0x1;
12646 if(!exp->op.exp2->expType)
12647 ProcessExpressionType(exp->op.exp2);
12649 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12650 FreeType(exp->op.exp2->expType);
12651 exp->op.exp2->expType = MkClassType("bool");
12652 exp->op.exp2->expType->truth = 0x1;
12655 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")))))
12657 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12659 if(exp->op.exp2->destType)
12660 FreeType(exp->op.exp2->destType);
12661 exp->op.exp2->destType = type1;
12663 if(exp->op.exp1->destType)
12664 FreeType(exp->op.exp1->destType);
12665 exp->op.exp1->destType = type2;
12667 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)
12668 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);
12669 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12671 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12675 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12677 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12678 ProcessExpressionType(exp->op.exp1);
12679 if(type2->kind != 13)
12681 ProcessExpressionType(classExp);
12682 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"))))))));
12683 if(!exp->op.exp2->expType)
12684 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12685 ProcessExpressionType(exp->op.exp2);
12689 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)))
12691 if(type1->kind != 8 && type1->type->kind == 0)
12692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12693 exp->expType = type1;
12697 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)))
12699 if(type2->kind != 8 && type2->type->kind == 0)
12700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12701 exp->expType = type2;
12705 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))
12707 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12711 unsigned int success = 0x0;
12713 if(type1->kind == 13 && type2->kind == 13)
12715 if(exp->op.op == '+')
12716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12717 else if(exp->op.op == '-')
12719 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12721 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12723 if(type1->type->kind == 20)
12725 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12729 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12731 ProcessExpressionType(classExp);
12733 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")))))));
12734 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12742 if(!success && exp->op.exp1->type == 2)
12744 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12747 FreeType(exp->expType);
12748 exp->expType = exp->op.exp1->destType;
12749 if(exp->op.exp1->destType)
12750 exp->op.exp1->destType->refCount++;
12753 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12756 FreeType(exp->expType);
12757 exp->expType = exp->op.exp2->destType;
12758 if(exp->op.exp2->destType)
12759 exp->op.exp2->destType->refCount++;
12765 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12768 FreeType(exp->expType);
12769 exp->expType = exp->op.exp2->destType;
12770 if(exp->op.exp2->destType)
12771 exp->op.exp2->destType->refCount++;
12774 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12777 FreeType(exp->expType);
12778 exp->expType = exp->op.exp1->destType;
12779 if(exp->op.exp1->destType)
12780 exp->op.exp1->destType->refCount++;
12786 char expString1[10240];
12787 char expString2[10240];
12791 expString1[0] = '\0';
12792 expString2[0] = '\0';
12797 PrintExpression(exp->op.exp1, expString1);
12798 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12799 PrintExpression(exp->op.exp2, expString2);
12800 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12801 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12802 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12804 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12808 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12810 if(exp->op.exp1->destType)
12811 FreeType(exp->op.exp1->destType);
12812 exp->op.exp1->destType = type2->_class->registered->dataType;
12813 if(type2->_class->registered->dataType)
12814 type2->_class->registered->dataType->refCount++;
12815 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12816 exp->expType = type2;
12820 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12822 if(exp->op.exp2->destType)
12823 FreeType(exp->op.exp2->destType);
12824 exp->op.exp2->destType = type1->_class->registered->dataType;
12825 if(type1->_class->registered->dataType)
12826 type1->_class->registered->dataType->refCount++;
12827 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12828 exp->expType = type1;
12834 unsigned int valid = 0x0;
12836 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12838 if(exp->op.exp2->destType)
12839 FreeType(exp->op.exp2->destType);
12840 if(!type1->_class->registered->dataType)
12841 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12842 exp->op.exp2->destType = type1->_class->registered->dataType;
12843 exp->op.exp2->destType->refCount++;
12844 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12845 type2 = exp->op.exp2->destType;
12846 exp->expType = type2;
12849 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12851 if(exp->op.exp1->destType)
12852 FreeType(exp->op.exp1->destType);
12853 if(!type2->_class->registered->dataType)
12854 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12855 exp->op.exp1->destType = type2->_class->registered->dataType;
12856 exp->op.exp1->destType->refCount++;
12857 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12858 type1 = exp->op.exp1->destType;
12859 exp->expType = type1;
12862 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12864 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12866 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12869 FreeType(exp->expType);
12870 exp->expType = exp->op.exp1->expType;
12871 if(exp->op.exp2->expType)
12872 exp->op.exp1->expType->refCount++;
12876 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12878 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12881 FreeType(exp->expType);
12882 exp->expType = exp->op.exp2->expType;
12883 if(exp->op.exp2->expType)
12884 exp->op.exp2->expType->refCount++;
12891 if(exp->op.exp2->destType)
12892 FreeType(exp->op.exp2->destType);
12893 exp->op.exp2->destType = type1;
12895 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12898 FreeType(exp->expType);
12899 exp->expType = exp->op.exp2->destType;
12900 if(exp->op.exp2->destType)
12901 exp->op.exp2->destType->refCount++;
12903 else if(type1 && type2)
12905 char expString1[10240];
12906 char expString2[10240];
12907 char type1String[1024];
12908 char type2String[1024];
12910 expString1[0] = '\0';
12911 expString2[0] = '\0';
12912 type1String[0] = '\0';
12913 type2String[0] = '\0';
12916 PrintExpression(exp->op.exp1, expString1);
12917 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12918 PrintExpression(exp->op.exp2, expString2);
12919 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12920 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12921 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12923 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12924 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12926 exp->expType = exp->op.exp1->expType;
12927 if(exp->op.exp1->expType)
12928 exp->op.exp1->expType->refCount++;
12930 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12932 exp->expType = exp->op.exp2->expType;
12933 if(exp->op.exp2->expType)
12934 exp->op.exp2->expType->refCount++;
12941 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12943 struct Type * oldType = exp->op.exp1->expType;
12945 exp->op.exp1->expType = (((void *)0));
12946 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12949 exp->op.exp1->expType = oldType;
12951 if(exp->op.exp1->destType)
12952 FreeType(exp->op.exp1->destType);
12953 exp->op.exp1->destType = type2;
12955 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12958 FreeType(exp->expType);
12959 exp->expType = exp->op.exp1->destType;
12960 if(exp->op.exp1->destType)
12961 exp->op.exp1->destType->refCount++;
12965 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12967 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12969 if(exp->op.exp1->destType)
12970 FreeType(exp->op.exp1->destType);
12971 exp->op.exp1->destType = type2->_class->registered->dataType;
12972 if(type2->_class->registered->dataType)
12973 type2->_class->registered->dataType->refCount++;
12974 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12976 if(exp->op.op == '!')
12978 exp->expType = MkClassType("bool");
12979 exp->expType->truth = 0x1;
12983 exp->expType = type2;
12988 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12990 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12992 if(exp->op.exp2->destType)
12993 FreeType(exp->op.exp2->destType);
12994 exp->op.exp2->destType = type1->_class->registered->dataType;
12995 if(type1->_class->registered->dataType)
12996 type1->_class->registered->dataType->refCount++;
12997 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12999 exp->expType = type1;
13005 if(exp->op.exp1 && !exp->op.exp1->expType)
13007 char expString[10000];
13009 expString[0] = '\0';
13012 PrintExpression(exp->op.exp1, expString);
13013 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13016 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13018 if(exp->op.exp2 && !exp->op.exp2->expType)
13020 char expString[10240];
13022 expString[0] = '\0';
13025 PrintExpression(exp->op.exp2, expString);
13026 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13029 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13033 FreeType(exp->expType);
13034 exp->expType = MkClassType("bool");
13035 exp->expType->truth = 0x1;
13037 if(exp->op.op != SIZEOF)
13038 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13039 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13041 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13043 yylloc = oldyylloc;
13050 struct Expression * e;
13052 exp->isConstant = 0x1;
13053 for(e = (*exp->list).first; e; e = e->next)
13055 unsigned int inced = 0x0;
13059 FreeType(e->destType);
13060 e->destType = exp->destType;
13063 exp->destType->refCount++;
13064 e->destType->count++;
13068 ProcessExpressionType(e);
13070 exp->destType->count--;
13071 if(!exp->expType && !e->next)
13073 exp->expType = e->expType;
13075 e->expType->refCount++;
13078 exp->isConstant = 0x0;
13080 e = (*exp->list).first;
13081 if(!e->next && e->type == 8)
13083 struct Expression * next = exp->next, * prev = exp->prev;
13085 FreeType(exp->expType);
13086 FreeType(exp->destType);
13087 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13091 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13092 ProcessExpressionType(exp);
13098 struct Expression * e;
13100 exp->isConstant = 0x1;
13101 ProcessExpressionType(exp->index.exp);
13102 if(!exp->index.exp->isConstant)
13103 exp->isConstant = 0x0;
13104 if(exp->index.exp->expType)
13106 struct Type * source = exp->index.exp->expType;
13108 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)
13110 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13112 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13113 if(exp->index.index && (*exp->index.index).last)
13115 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13119 for(e = (*exp->index.index).first; e; e = e->next)
13121 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13124 FreeType(e->destType);
13125 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13127 ProcessExpressionType(e);
13132 exp->isConstant = 0x0;
13135 exp->expType = Dereference(exp->index.exp->expType);
13137 DeclareType(exp->expType, 0x0, 0x0);
13142 struct Expression * e;
13143 struct Type * functionType;
13144 struct Type * methodType = (((void *)0));
13150 PrintExpression(exp->call.exp, name);
13151 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13153 PrintExpression(exp->call.exp, name);
13156 if(exp->call.exp->type == 0)
13158 struct Expression * idExp = exp->call.exp;
13159 struct Identifier * id = idExp->identifier;
13161 if(!strcmp(id->string, "__ENDIAN_PAD"))
13163 exp->expType = ProcessTypeString("int", 0x1);
13164 if(exp->call.arguments && (*exp->call.arguments).first)
13165 ProcessExpressionType((*exp->call.arguments).first);
13168 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13170 struct Expression * a = (((void *)0));
13171 struct Expression * b = (((void *)0));
13172 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13174 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13176 a = (*exp->call.arguments).first;
13177 b = (*exp->call.arguments).last;
13181 else if((*exp->call.arguments).count == 1)
13183 a = (*exp->call.arguments).first;
13188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13189 idExp->identifier = (((void *)0));
13190 FreeExpContents(exp);
13191 ProcessExpressionType(a);
13193 ProcessExpressionType(b);
13195 exp->list = MkList();
13196 if(a->expType && (!b || b->expType))
13198 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13202 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13203 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13204 struct Declaration * decl;
13205 char temp1[1024], temp2[1024];
13207 GetTypeSpecs(a->expType, specs);
13208 if(a && !a->isConstant && a->type != 0)
13210 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13211 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13212 tempExp1 = QMkExpId(temp1);
13213 tempExp1->expType = a->expType;
13215 a->expType->refCount++;
13216 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13218 if(b && !b->isConstant && b->type != 0)
13220 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13221 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13222 tempExp2 = QMkExpId(temp2);
13223 tempExp2->expType = b->expType;
13225 b->expType->refCount++;
13226 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13228 decl = MkDeclaration(specs, decls);
13229 if(!curCompound->compound.declarations)
13230 curCompound->compound.declarations = MkList();
13231 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13235 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13237 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13239 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13240 exp->expType = a->expType;
13242 a->expType->refCount++;
13244 else if(!strcmp(id->string, "Abs"))
13246 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13247 exp->expType = a->expType;
13249 a->expType->refCount++;
13251 else if(!strcmp(id->string, "Sgn"))
13253 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"))))));
13254 exp->expType = ProcessTypeString("int", 0x0);
13256 FreeExpression(tempExp1);
13258 FreeExpression(tempExp2);
13259 FreeIdentifier(id);
13265 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13267 if(!exp->call.exp->destType)
13269 exp->call.exp->destType = dummy;
13272 ProcessExpressionType(exp->call.exp);
13273 if(exp->call.exp->destType == dummy)
13276 exp->call.exp->destType = (((void *)0));
13280 functionType = exp->call.exp->expType;
13281 if(functionType && functionType->kind == 16)
13283 methodType = functionType;
13284 functionType = methodType->method->dataType;
13285 if(exp->call.exp->expType->usedClass)
13287 char typeString[1024];
13289 typeString[0] = '\0';
13290 PrintType(functionType, typeString, 0x1, 0x1);
13291 if(strstr(typeString, "thisclass"))
13293 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13294 struct Declarator * decl;
13297 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13299 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13300 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13301 thisClassParams = 0x0;
13302 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13304 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13306 thisClass = exp->call.exp->expType->usedClass;
13307 ProcessDeclarator(decl);
13308 thisClass = backupThisClass;
13310 thisClassParams = 0x1;
13311 functionType = ProcessType(specs, decl);
13312 functionType->refCount = 0;
13313 FinishTemplatesContext(context);
13315 FreeList(specs, FreeSpecifier);
13316 FreeDeclarator(decl);
13320 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13322 struct Type * type = functionType->type;
13324 if(!functionType->refCount)
13326 functionType->type = (((void *)0));
13327 FreeType(functionType);
13329 functionType = type;
13331 if(functionType && functionType->kind != 11)
13333 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13335 else if(functionType)
13337 unsigned int emptyParams = 0x0, noParams = 0x0;
13338 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13339 struct Type * type = functionType->params.first;
13340 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13342 struct Location oldyylloc = yylloc;
13346 if(functionType->extraParam && e)
13348 e->destType = MkClassType(functionType->thisClass->string);
13351 if(!functionType->staticMethod)
13353 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13355 type = MkClassType(memberExp->member.exp->expType->_class->string);
13358 e->destType = type;
13360 type = functionType->params.first;
13363 type->refCount = 0;
13365 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13367 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13370 e->destType = type;
13372 type = functionType->params.first;
13375 type->refCount = 0;
13378 if(type && type->kind == 0)
13381 if(!type->refCount)
13383 type = (((void *)0));
13385 for(; e; e = e->next)
13387 if(!type && !emptyParams)
13390 if(methodType && methodType->methodClass)
13391 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);
13393 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);
13396 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13398 struct Type * templatedType = (((void *)0));
13399 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13400 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13403 if(_class && _class->templateArgs)
13405 struct __ecereNameSpace__ecere__com__Class * sClass;
13407 for(sClass = _class; sClass; sClass = sClass->base)
13409 if(sClass->templateClass)
13410 sClass = sClass->templateClass;
13412 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13414 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13416 struct __ecereNameSpace__ecere__com__Class * nextClass;
13418 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13420 if(nextClass->templateClass)
13421 nextClass = nextClass->templateClass;
13422 id += nextClass->templateParams.count;
13432 if(curParam && _class->templateArgs[id].dataTypeString)
13434 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13437 struct Context * context = SetupTemplatesContext(_class);
13439 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13440 FinishTemplatesContext(context);
13442 e->destType = templatedType;
13445 templatedType->passAsTemplate = 0x1;
13450 e->destType = type;
13457 e->destType = type;
13461 if(type && type->kind != 14)
13463 struct Type * next = type->next;
13465 if(!type->refCount)
13470 if(type && type->kind != 14)
13472 if(methodType && methodType->methodClass)
13473 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);
13475 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);
13477 yylloc = oldyylloc;
13478 if(type && !type->refCount)
13483 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13484 if(exp->call.exp->type == 0)
13486 char * string = exp->call.exp->identifier->string;
13490 struct Symbol * symbol;
13491 struct Location oldyylloc = yylloc;
13493 yylloc = exp->call.exp->identifier->loc;
13494 if(strstr(string, "__builtin_") == string)
13497 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13498 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));
13499 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13500 if(strstr(symbol->string, "::"))
13501 globalContext->hasNameSpace = 0x1;
13502 yylloc = oldyylloc;
13505 else if(exp->call.exp->type == 8)
13509 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13510 if(!functionType->returnType)
13512 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13515 if(functionType && functionType->kind == 11)
13517 exp->expType = functionType->returnType;
13518 if(functionType->returnType)
13519 functionType->returnType->refCount++;
13520 if(!functionType->refCount)
13521 FreeType(functionType);
13523 if(exp->call.arguments)
13525 for(e = (*exp->call.arguments).first; e; e = e->next)
13527 struct Type * destType = e->destType;
13529 ProcessExpressionType(e);
13536 struct Type * type;
13537 struct Location oldyylloc = yylloc;
13538 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13540 exp->thisPtr = thisPtr;
13541 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13543 exp->member.member->classSym = exp->member.member->_class->symbol;
13545 ProcessExpressionType(exp->member.exp);
13546 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)
13548 exp->isConstant = 0x0;
13551 exp->isConstant = exp->member.exp->isConstant;
13552 type = exp->member.exp->expType;
13554 if(type && (type->kind == 20))
13556 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13561 for(param = _class->templateParams.first; param; param = param->next)
13563 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13567 if(param && param->defaultArg.member)
13569 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13573 struct Expression * expMember = exp->member.exp;
13574 struct Declarator * decl;
13575 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13576 char thisClassTypeString[1024];
13578 FreeIdentifier(exp->member.member);
13579 ProcessExpressionType(argExp);
13581 char * colon = strstr(param->defaultArg.memberString, "::");
13585 char className[1024];
13586 struct __ecereNameSpace__ecere__com__Class * sClass;
13588 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13589 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13592 strcpy(thisClassTypeString, _class->fullName);
13594 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13595 exp->expType = ProcessType(specs, decl);
13596 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13598 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13599 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13601 int paramCount = 0;
13602 int lastParam = -1;
13603 char templateString[1024];
13604 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13606 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13607 for(cClass = expClass; cClass; cClass = cClass->base)
13611 for(param = cClass->templateParams.first; param; param = param->next)
13614 struct __ecereNameSpace__ecere__com__Class * sClass;
13615 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13617 for(sClass = cClass->base; sClass; sClass = sClass->base)
13618 id += sClass->templateParams.count;
13619 arg = expClass->templateArgs[id];
13620 for(sClass = _class; sClass; sClass = sClass->base)
13622 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13624 struct __ecereNameSpace__ecere__com__Class * nextClass;
13626 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13627 p += nextClass->templateParams.count;
13628 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13630 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13632 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13634 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13635 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13642 char argument[256];
13644 argument[0] = '\0';
13645 switch(param->type)
13649 char expString[1024];
13650 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13651 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13652 struct Expression * exp;
13653 char * string = PrintHexUInt64(arg.expression.ui64);
13655 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13656 ProcessExpressionType(exp);
13657 ComputeExpression(exp);
13658 expString[0] = '\0';
13659 PrintExpression(exp, expString);
13660 strcat(argument, expString);
13661 FreeExpression(exp);
13666 strcat(argument, arg.member->name);
13671 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13673 if(!strcmp(arg.dataTypeString, "thisclass"))
13674 strcat(argument, thisClassTypeString);
13676 strcat(argument, arg.dataTypeString);
13684 strcat(templateString, ", ");
13685 if(lastParam != p - 1)
13687 strcat(templateString, param->name);
13688 strcat(templateString, " = ");
13690 strcat(templateString, argument);
13699 int len = strlen(templateString);
13701 if(templateString[len - 1] == '>')
13702 templateString[len++] = ' ';
13703 templateString[len++] = '>';
13704 templateString[len++] = '\0';
13707 struct Context * context = SetupTemplatesContext(_class);
13709 FreeType(exp->expType);
13710 exp->expType = ProcessTypeString(templateString, 0x0);
13711 FinishTemplatesContext(context);
13715 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")))))))));
13718 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13720 type = ProcessTemplateParameterType(type->templateParameter);
13723 if(type && (type->kind == 20))
13725 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13727 struct Identifier * id = exp->member.member;
13728 int typeKind = type->kind;
13729 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));
13731 if(typeKind == 19 && exp->member.exp->type == 26)
13733 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13736 if(id && (typeKind == 3 || typeKind == 15))
13737 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13740 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13741 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13742 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13743 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13744 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13746 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13747 exp->member.memberType = 1;
13748 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13752 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13754 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13755 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13757 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13759 member = (((void *)0));
13761 if(!member && !prop)
13762 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13763 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13764 exp->member.thisPtr = 0x1;
13770 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13771 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13772 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13774 if(!prop && !member)
13776 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13779 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13780 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13781 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13786 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13787 prop = (((void *)0));
13789 member = (((void *)0));
13793 if(!prop && !member)
13794 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13795 if(!prop && !member && !method)
13799 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13802 exp->member.memberType = 5;
13803 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13807 char structName[1024];
13808 struct Identifier * id = exp->member.member;
13809 struct Expression * classExp = exp->member.exp;
13812 FreeType(classExp->expType);
13813 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13814 strcpy(structName, "__ecereClassData_");
13815 FullClassNameCat(structName, type->_class->string, 0x0);
13817 exp->member.member = id;
13818 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"))))))));
13820 ProcessExpressionType(exp);
13826 struct Symbol * classSym = FindClass(id->string);
13830 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13833 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13839 exp->member.memberType = 1;
13840 if(!prop->dataType)
13841 ProcessPropertyType(prop);
13842 exp->expType = prop->dataType;
13844 prop->dataType->refCount++;
13848 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13850 FreeExpContents(exp);
13852 exp->identifier = MkIdentifier("class");
13853 ProcessExpressionType(exp);
13856 exp->member.memberType = 3;
13857 DeclareStruct(_class->fullName, 0x0);
13858 if(!member->dataType)
13860 struct Context * context = SetupTemplatesContext(_class);
13862 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13863 FinishTemplatesContext(context);
13865 exp->expType = member->dataType;
13866 if(member->dataType)
13867 member->dataType->refCount++;
13869 else if(revConvert)
13871 exp->member.memberType = 4;
13872 exp->expType = MkClassType(revConvert->_class->fullName);
13878 exp->member.memberType = 2;
13880 if(!method->dataType)
13881 ProcessMethodType(method);
13882 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));
13883 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13884 exp->expType->usedClass = _class;
13886 else if(!classProp)
13888 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13890 FreeExpContents(exp);
13892 exp->identifier = MkIdentifier("class");
13893 ProcessExpressionType(exp);
13896 yylloc = exp->member.member->loc;
13897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13899 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13901 if(_class && exp->expType)
13903 struct __ecereNameSpace__ecere__com__Class * tClass;
13906 while(tClass && !tClass->templateClass)
13907 tClass = tClass->base;
13908 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13911 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13912 struct __ecereNameSpace__ecere__com__Class * sClass;
13914 for(sClass = tClass; sClass; sClass = sClass->base)
13917 if(sClass->templateClass)
13918 sClass = sClass->templateClass;
13919 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13921 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13923 for(sClass = sClass->base; sClass; sClass = sClass->base)
13924 id += sClass->templateParams.count;
13932 if(curParam && tClass->templateArgs[id].dataTypeString)
13934 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13935 struct Context * context = SetupTemplatesContext(tClass);
13937 FreeType(exp->expType);
13938 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13941 if(exp->expType->kind == 21)
13943 FreeType(exp->expType);
13944 exp->expType = ReplaceThisClassType(_class);
13946 if(tClass->templateClass)
13947 exp->expType->passAsTemplate = 0x1;
13950 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13951 if(exp->destType->kind == 21)
13953 FreeType(exp->destType);
13954 exp->destType = ReplaceThisClassType(_class);
13958 FinishTemplatesContext(context);
13961 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13964 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13965 struct __ecereNameSpace__ecere__com__Class * sClass;
13967 for(sClass = tClass; sClass; sClass = sClass->base)
13970 if(sClass->templateClass)
13971 sClass = sClass->templateClass;
13972 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13974 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13976 for(sClass = sClass->base; sClass; sClass = sClass->base)
13977 id += sClass->templateParams.count;
13987 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13988 struct Context * context = SetupTemplatesContext(tClass);
13989 struct Type * basicType;
13991 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13994 if(basicType->kind == 21)
13996 FreeType(basicType);
13997 basicType = ReplaceThisClassType(_class);
13999 FreeType(exp->expType);
14000 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));
14003 exp->destType = exp->expType;
14004 exp->destType->refCount++;
14007 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14008 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14009 struct Declarator * decl;
14011 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14014 exp->destType->refCount++;
14016 exp->expType->refCount++;
14018 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14019 exp->cast.exp = newExp;
14022 FinishTemplatesContext(context);
14025 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14027 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14031 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14034 int paramCount = 0;
14035 int lastParam = -1;
14036 char templateString[1024];
14037 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14039 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14040 while(cClass != expClass)
14042 struct __ecereNameSpace__ecere__com__Class * sClass;
14044 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14047 for(param = cClass->templateParams.first; param; param = param->next)
14049 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14052 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14053 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14055 while(cClassCur != tClass && !paramCur)
14057 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14059 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14061 cClassCur = sClassCur;
14062 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14064 if(!strcmp(paramCur->name, param->name))
14071 if(paramCur && paramCur->type == 0)
14072 arg = tClass->templateArgs[cp];
14074 arg = expClass->templateArgs[p];
14076 char argument[256];
14078 argument[0] = '\0';
14079 switch(param->type)
14083 char expString[1024];
14084 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14085 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14086 struct Expression * exp;
14087 char * string = PrintHexUInt64(arg.expression.ui64);
14089 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14090 ProcessExpressionType(exp);
14091 ComputeExpression(exp);
14092 expString[0] = '\0';
14093 PrintExpression(exp, expString);
14094 strcat(argument, expString);
14095 FreeExpression(exp);
14100 strcat(argument, arg.member->name);
14105 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14106 strcat(argument, arg.dataTypeString);
14113 strcat(templateString, ", ");
14114 if(lastParam != p - 1)
14116 strcat(templateString, param->name);
14117 strcat(templateString, " = ");
14119 strcat(templateString, argument);
14128 int len = strlen(templateString);
14130 if(templateString[len - 1] == '>')
14131 templateString[len++] = ' ';
14132 templateString[len++] = '>';
14133 templateString[len++] = '\0';
14135 FreeType(exp->expType);
14137 struct Context * context = SetupTemplatesContext(tClass);
14139 exp->expType = ProcessTypeString(templateString, 0x0);
14140 FinishTemplatesContext(context);
14147 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)");
14149 else if(type && (type->kind == 9 || type->kind == 10))
14151 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14155 exp->expType = memberType;
14157 memberType->refCount++;
14162 char expString[10240];
14164 expString[0] = '\0';
14167 PrintExpression(exp, expString);
14168 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14172 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14174 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14176 struct Identifier * id = exp->member.member;
14177 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));
14181 FreeType(exp->expType);
14182 exp->expType = ReplaceThisClassType(_class);
14186 yylloc = oldyylloc;
14191 struct Type * destType = exp->destType;
14193 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14195 exp->member.member->classSym = exp->member.member->_class->symbol;
14197 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14201 ProcessExpressionType(exp);
14208 struct Symbol * classSym = exp->_class->symbol;
14210 if(classSym && classSym->registered)
14212 if(classSym->registered->type == 5)
14217 DeclareStruct(classSym->string, 0x0);
14218 FreeSpecifier(exp->_class);
14220 FullClassNameCat(name, classSym->string, 0x0);
14221 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14225 if(classSym->registered->fixed)
14227 FreeSpecifier(exp->_class);
14228 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14233 char className[1024];
14235 strcpy(className, "__ecereClass_");
14236 FullClassNameCat(className, classSym->string, 0x1);
14237 MangleClassName(className);
14238 DeclareClass(classSym, className);
14239 FreeExpContents(exp);
14241 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14242 exp->member.member = MkIdentifier("structSize");
14246 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14251 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14253 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14254 exp->isConstant = 0x1;
14255 DeclareType(type, 0x0, 0x0);
14261 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14263 type->count = (unsigned int)1;
14264 FreeType(exp->cast.exp->destType);
14265 exp->cast.exp->destType = type;
14267 ProcessExpressionType(exp->cast.exp);
14268 type->count = (unsigned int)0;
14269 exp->expType = type;
14270 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14272 void * prev = exp->prev, * next = exp->next;
14273 struct Type * expType = exp->cast.exp->destType;
14274 struct Expression * castExp = exp->cast.exp;
14275 struct Type * destType = exp->destType;
14278 expType->refCount++;
14279 FreeType(exp->expType);
14280 FreeTypeName(exp->cast.typeName);
14282 FreeType(exp->expType);
14283 FreeType(exp->destType);
14284 exp->expType = expType;
14285 exp->destType = destType;
14286 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14292 exp->isConstant = exp->cast.exp->isConstant;
14298 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14301 exp->expType = type;
14306 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14308 ProcessExpressionType(exp->vaArg.exp);
14310 exp->expType = type;
14315 struct Expression * e;
14317 exp->isConstant = 0x1;
14318 FreeType(exp->cond.cond->destType);
14319 exp->cond.cond->destType = MkClassType("bool");
14320 exp->cond.cond->destType->truth = 0x1;
14321 ProcessExpressionType(exp->cond.cond);
14322 if(!exp->cond.cond->isConstant)
14323 exp->isConstant = 0x0;
14324 for(e = (*exp->cond.exp).first; e; e = e->next)
14328 FreeType(e->destType);
14329 e->destType = exp->destType;
14331 e->destType->refCount++;
14333 ProcessExpressionType(e);
14336 exp->expType = e->expType;
14338 e->expType->refCount++;
14341 exp->isConstant = 0x0;
14343 FreeType(exp->cond.elseExp->destType);
14344 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14345 if(exp->cond.elseExp->destType)
14346 exp->cond.elseExp->destType->refCount++;
14347 ProcessExpressionType(exp->cond.elseExp);
14348 if(!exp->cond.elseExp->isConstant)
14349 exp->isConstant = 0x0;
14354 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14356 struct Statement * last = (*exp->compound->compound.statements).last;
14358 if(last->type == 3 && last->expressions && (*last->expressions).last)
14360 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14362 exp->destType->refCount++;
14364 ProcessStatement(exp->compound);
14365 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14366 if(((struct Expression *)(*last->expressions).last)->expType)
14367 exp->expType->refCount++;
14373 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14375 if(spec && spec->type == 1)
14377 exp->expType = MkClassType(spec->name);
14378 exp->expType->kind = 19;
14379 exp->byReference = 0x1;
14383 exp->expType = MkClassType("ecere::com::Class");
14384 exp->byReference = 0x1;
14390 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14394 struct Identifier * id = exp->classData.id;
14395 char structName[1024];
14396 struct Expression * classExp;
14398 strcpy(structName, "__ecereClassData_");
14399 FullClassNameCat(structName, _class->fullName, 0x0);
14401 exp->member.member = id;
14402 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14403 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14405 classExp = MkExpIdentifier(MkIdentifier("class"));
14406 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"))))))));
14407 ProcessExpressionType(exp);
14414 struct Type * type = (((void *)0));
14415 char * typeString = (((void *)0));
14416 char typeStringBuf[1024];
14418 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))
14420 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14422 typeString = templateClass->templateArgs[2].dataTypeString;
14426 struct Expression * e;
14428 for(e = (*exp->list).first; e; e = e->next)
14430 ProcessExpressionType(e);
14440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14444 e->expType = (((void *)0));
14445 e = (*exp->list).first;
14446 ProcessExpressionType(e);
14449 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14451 FreeType(e->expType);
14452 e->expType = (((void *)0));
14454 type = (((void *)0));
14462 FreeType(e->expType);
14463 e->expType = (((void *)0));
14469 typeStringBuf[0] = '\0';
14470 PrintType(type, typeStringBuf, 0x0, 0x1);
14471 typeString = typeStringBuf;
14473 type = (((void *)0));
14478 char templateString[1024];
14479 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14480 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14482 struct Expression * expExt;
14483 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14485 sprintf(templateString, "Container<%s>", typeString);
14488 struct Expression * e;
14490 type = ProcessTypeString(typeString, 0x0);
14491 while(e = (*exp->list).first)
14493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14494 e->destType = type;
14496 ProcessExpressionType(e);
14497 ListAdd(initializers, MkInitializerAssignment(e));
14500 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14502 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14503 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14505 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14507 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14509 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14511 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))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 exp->expType = ProcessTypeString(templateString, 0x0);
14517 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14518 ProcessExpressionType(expExt);
14522 exp->expType = ProcessTypeString("Container", 0x0);
14523 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14528 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14530 FreeType(exp->expType);
14531 exp->expType = ReplaceThisClassType(thisClass);
14533 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14535 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14539 if(exp->expType->kind != 15)
14541 struct Type * member;
14542 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14544 FreeType(exp->expType);
14545 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14546 exp->expType->kind = symbol->type->kind;
14547 exp->expType->refCount++;
14548 exp->expType->enumName = enumName;
14549 exp->expType->members = symbol->type->members;
14550 for(member = symbol->type->members.first; member; member = member->next)
14551 member->refCount++;
14555 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14557 for(member = symbol->type->members.first; member; member = member->next)
14559 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14561 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14567 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14569 else if(exp->destType && !exp->destType->keepCast)
14571 if(!CheckExpressionType(exp, exp->destType, 0x0))
14573 if(!exp->destType->count || unresolved)
14578 if(exp->destType->kind != 14)
14585 char expString[10240];
14587 expString[0] = '\0';
14588 PrintType(exp->destType, type2, 0x0, 0x1);
14591 PrintExpression(exp, expString);
14592 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14596 else if(exp->type != 16)
14597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14602 char expString[10240];
14604 expString[0] = '\0';
14607 PrintExpression(exp, expString);
14608 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14612 else if(exp->type != 16)
14613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14625 PrintType(exp->expType, type1, 0x0, 0x1);
14626 PrintType(exp->destType, type2, 0x0, 0x1);
14628 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)))
14632 char expString[10240];
14634 expString[0] = '\0';
14637 PrintExpression(exp, expString);
14638 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14640 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14641 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14642 FreeType(exp->expType);
14643 exp->destType->refCount++;
14644 exp->expType = exp->destType;
14649 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14651 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14652 char typeString[1024];
14653 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14654 struct Declarator * decl;
14656 typeString[0] = '\0';
14659 exp->expType->refCount++;
14661 exp->expType->refCount++;
14663 newExp->destType = exp->expType;
14664 PrintType(exp->expType, typeString, 0x0, 0x0);
14665 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14666 exp->cast.typeName = MkTypeName(specs, decl);
14667 exp->cast.exp = newExp;
14670 else if(unresolved)
14672 if(exp->identifier->_class && exp->identifier->_class->name)
14673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14674 else if(exp->identifier->string && exp->identifier->string[0])
14675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14677 else if(!exp->expType && exp->type != 16)
14679 char expString[10240];
14681 expString[0] = '\0';
14684 PrintExpression(exp, expString);
14685 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14687 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14689 ApplyAnyObjectLogic(exp);
14690 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14692 exp->byReference = 0x1;
14694 yylloc = oldyylloc;
14697 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)
14701 *curMember = (*curMember)->next;
14702 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14704 *curMember = subMemberStack[--(*subMemberStackPos)];
14705 *curMember = (*curMember)->next;
14707 while((*curMember) && (*curMember)->isProperty)
14708 *curMember = (*curMember)->next;
14709 if(subMemberStackPos)
14711 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14713 subMemberStack[(*subMemberStackPos)++] = *curMember;
14714 *curMember = (*curMember)->members.first;
14715 while(*curMember && (*curMember)->isProperty)
14716 *curMember = (*curMember)->next;
14724 if(subMemberStackPos && *subMemberStackPos)
14726 *curMember = subMemberStack[--(*subMemberStackPos)];
14727 *curMember = (*curMember)->next;
14731 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14733 if(*curClass == _class)
14735 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14737 *curMember = (*curClass)->membersAndProperties.first;
14739 while((*curMember) && (*curMember)->isProperty)
14740 *curMember = (*curMember)->next;
14741 if(subMemberStackPos)
14743 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14745 subMemberStack[(*subMemberStackPos)++] = *curMember;
14746 *curMember = (*curMember)->members.first;
14747 while(*curMember && (*curMember)->isProperty)
14748 *curMember = (*curMember)->next;
14755 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14760 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14762 if(init->exp && !init->exp->destType)
14764 FreeType(init->exp->destType);
14765 init->exp->destType = type;
14771 ProcessExpressionType(init->exp);
14772 init->isConstant = init->exp->isConstant;
14778 struct Expression * exp = init->exp;
14779 struct Instantiation * inst = exp->instance;
14780 struct MembersInit * members;
14783 init->list = MkList();
14786 for(members = (*inst->members).first; members; members = members->next)
14788 if(members->type == 0)
14790 struct MemberInit * member;
14792 for(member = (*members->dataMembers).first; member; member = member->next)
14794 ListAdd(init->list, member->initializer);
14795 member->initializer = (((void *)0));
14800 FreeExpression(exp);
14804 struct Initializer * i;
14805 struct Type * initializerType = (((void *)0));
14806 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14807 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14808 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14809 int subMemberStackPos = 0;
14811 if(type && type->kind == 12)
14812 initializerType = Dereference(type);
14813 else if(type && (type->kind == 9 || type->kind == 10))
14814 initializerType = type->members.first;
14815 for(i = (*init->list).first; i; i = i->next)
14817 if(type && type->kind == 8 && type->_class && type->_class->registered)
14819 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14822 if(!curMember->dataType)
14823 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14824 initializerType = curMember->dataType;
14827 ProcessInitializer(i, initializerType);
14828 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14829 initializerType = initializerType->next;
14831 init->isConstant = 0x0;
14833 if(type && type->kind == 12)
14834 FreeType(initializerType);
14835 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14837 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14844 extern struct Symbol * FindType(struct Context * ctx, char * name);
14846 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14848 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14854 if(spec->specifier == THISCLASS)
14859 spec->name = ReplaceThisClass(thisClass);
14860 spec->symbol = FindClass(spec->name);
14861 ProcessSpecifier(spec, declareStruct);
14868 struct Symbol * symbol = FindType(curContext, spec->name);
14871 DeclareType(symbol->type, 0x1, 0x1);
14872 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14873 DeclareStruct(spec->name, 0x0);
14878 struct Enumerator * e;
14882 for(e = (*spec->list).first; e; e = e->next)
14885 ProcessExpressionType(e->exp);
14893 if(spec->definitions)
14895 struct ClassDef * def;
14896 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14898 ProcessClass(spec->definitions, symbol);
14905 static void ProcessDeclarator(struct Declarator * decl)
14910 if(decl->identifier->classSym)
14912 FreeSpecifier(decl->identifier->_class);
14913 decl->identifier->_class = (((void *)0));
14917 if(decl->array.exp)
14918 ProcessExpressionType(decl->array.exp);
14925 if(decl->declarator)
14926 ProcessDeclarator(decl->declarator);
14927 if(decl->type == 4)
14929 struct Identifier * id = GetDeclId(decl);
14931 if(id && id->_class)
14933 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14935 if(!decl->function.parameters)
14936 decl->function.parameters = MkList();
14937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14938 id->_class = (((void *)0));
14940 if(decl->function.parameters)
14942 struct TypeName * param;
14944 for(param = (*decl->function.parameters).first; param; param = param->next)
14946 if(param->qualifiers && (*param->qualifiers).first)
14948 struct Specifier * spec = (*param->qualifiers).first;
14950 if(spec && spec->specifier == TYPED_OBJECT)
14952 struct Declarator * d = param->declarator;
14953 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);
14955 FreeList(param->qualifiers, FreeSpecifier);
14956 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14957 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14958 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14961 else if(spec && spec->specifier == ANY_OBJECT)
14963 struct Declarator * d = param->declarator;
14965 FreeList(param->qualifiers, FreeSpecifier);
14966 param->qualifiers = MkListOne(MkSpecifier(VOID));
14967 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14969 else if(spec->specifier == THISCLASS)
14974 spec->name = ReplaceThisClass(thisClass);
14975 spec->symbol = FindClass(spec->name);
14976 ProcessSpecifier(spec, 0x0);
14980 if(param->declarator)
14981 ProcessDeclarator(param->declarator);
14989 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14991 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14993 static void ProcessDeclaration(struct Declaration * decl)
14995 yylloc = decl->loc;
15000 unsigned int declareStruct = 0x0;
15002 if(decl->declarators)
15004 struct InitDeclarator * d;
15006 for(d = (*decl->declarators).first; d; d = d->next)
15008 struct Type * type, * subType;
15010 ProcessDeclarator(d->declarator);
15011 type = ProcessType(decl->specifiers, d->declarator);
15014 ProcessInitializer(d->initializer, type);
15015 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15017 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15019 struct Instantiation * inst = d->initializer->exp->instance;
15021 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15022 d->initializer->exp->instance = (((void *)0));
15023 if(decl->specifiers)
15024 FreeList(decl->specifiers, FreeSpecifier);
15025 FreeList(decl->declarators, FreeInitDeclarator);
15032 for(subType = type; subType; )
15034 if(subType->kind == 8)
15036 declareStruct = 0x1;
15039 else if(subType->kind == 13)
15041 else if(subType->kind == 12)
15042 subType = subType->arrayType;
15051 if(decl->specifiers)
15053 struct Specifier * s;
15055 for(s = (*decl->specifiers).first; s; s = s->next)
15057 ProcessSpecifier(s, declareStruct);
15064 ProcessInstantiationType(decl->inst);
15069 struct Specifier * spec;
15070 struct Declarator * d;
15071 unsigned int declareStruct = 0x0;
15073 if(decl->declarators)
15075 for(d = (*decl->declarators).first; d; d = d->next)
15077 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15078 struct Type * subType;
15080 ProcessDeclarator(d);
15081 for(subType = type; subType; )
15083 if(subType->kind == 8)
15085 declareStruct = 0x1;
15088 else if(subType->kind == 13)
15090 else if(subType->kind == 12)
15091 subType = subType->arrayType;
15098 if(decl->specifiers)
15100 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15101 ProcessSpecifier(spec, declareStruct);
15108 static struct FunctionDefinition * curFunction;
15110 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15112 char propName[1024], propNameM[1024];
15113 char getName[1024], setName[1024];
15114 struct __ecereNameSpace__ecere__sys__OldList * args;
15116 DeclareProperty(prop, setName, getName);
15117 strcpy(propName, "__ecereProp_");
15118 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15119 strcat(propName, "_");
15120 FullClassNameCat(propName, prop->name, 0x1);
15121 MangleClassName(propName);
15122 strcpy(propNameM, "__ecerePropM_");
15123 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15124 strcat(propNameM, "_");
15125 FullClassNameCat(propNameM, prop->name, 0x1);
15126 MangleClassName(propNameM);
15127 if(prop->isWatchable)
15130 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15131 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15132 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15134 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15135 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15136 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15140 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15141 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15142 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15144 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15145 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15146 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15148 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15149 curFunction->propSet->fireWatchersDone = 0x1;
15152 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15154 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15156 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15158 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15160 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15162 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15164 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15166 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15168 static void ProcessStatement(struct Statement * stmt)
15170 yylloc = stmt->loc;
15174 ProcessStatement(stmt->labeled.stmt);
15177 if(stmt->caseStmt.exp)
15179 FreeType(stmt->caseStmt.exp->destType);
15180 stmt->caseStmt.exp->destType = curSwitchType;
15182 curSwitchType->refCount++;
15183 ProcessExpressionType(stmt->caseStmt.exp);
15184 ComputeExpression(stmt->caseStmt.exp);
15186 if(stmt->caseStmt.stmt)
15187 ProcessStatement(stmt->caseStmt.stmt);
15191 if(stmt->compound.context)
15193 struct Declaration * decl;
15194 struct Statement * s;
15195 struct Statement * prevCompound = curCompound;
15196 struct Context * prevContext = curContext;
15198 if(!stmt->compound.isSwitch)
15200 curCompound = stmt;
15201 curContext = stmt->compound.context;
15203 if(stmt->compound.declarations)
15205 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15206 ProcessDeclaration(decl);
15208 if(stmt->compound.statements)
15210 for(s = (*stmt->compound.statements).first; s; s = s->next)
15211 ProcessStatement(s);
15213 curContext = prevContext;
15214 curCompound = prevCompound;
15220 struct Expression * exp;
15222 if(stmt->expressions)
15224 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15225 ProcessExpressionType(exp);
15231 struct Expression * exp;
15233 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15234 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15235 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15236 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15238 ProcessExpressionType(exp);
15240 if(stmt->ifStmt.stmt)
15241 ProcessStatement(stmt->ifStmt.stmt);
15242 if(stmt->ifStmt.elseStmt)
15243 ProcessStatement(stmt->ifStmt.elseStmt);
15248 struct Type * oldSwitchType = curSwitchType;
15250 if(stmt->switchStmt.exp)
15252 struct Expression * exp;
15254 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15258 ProcessExpressionType(exp);
15261 curSwitchType = exp->expType;
15264 ProcessStatement(stmt->switchStmt.stmt);
15265 curSwitchType = oldSwitchType;
15270 if(stmt->whileStmt.exp)
15272 struct Expression * exp;
15274 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15275 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15276 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15277 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15279 ProcessExpressionType(exp);
15282 if(stmt->whileStmt.stmt)
15283 ProcessStatement(stmt->whileStmt.stmt);
15288 if(stmt->doWhile.exp)
15290 struct Expression * exp;
15292 if((*stmt->doWhile.exp).last)
15294 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15295 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15296 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15298 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15300 ProcessExpressionType(exp);
15303 if(stmt->doWhile.stmt)
15304 ProcessStatement(stmt->doWhile.stmt);
15309 struct Expression * exp;
15311 if(stmt->forStmt.init)
15312 ProcessStatement(stmt->forStmt.init);
15313 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15315 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15316 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15317 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15319 if(stmt->forStmt.check)
15320 ProcessStatement(stmt->forStmt.check);
15321 if(stmt->forStmt.increment)
15323 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15324 ProcessExpressionType(exp);
15326 if(stmt->forStmt.stmt)
15327 ProcessStatement(stmt->forStmt.stmt);
15332 struct Identifier * id = stmt->forEachStmt.id;
15333 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15334 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15335 struct Statement * block = stmt->forEachStmt.stmt;
15336 char iteratorType[1024];
15337 struct Type * source;
15338 struct Expression * e;
15339 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));
15340 struct Expression * arrayExp;
15341 char * typeString = (((void *)0));
15342 int builtinCount = 0;
15344 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15348 FreeType(e->destType);
15349 e->destType = ProcessTypeString("Container", 0x0);
15351 if(!isBuiltin || e->next)
15352 ProcessExpressionType(e);
15354 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15355 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15357 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15358 struct Symbol * symbol;
15359 struct Expression * expIt = (((void *)0));
15360 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15361 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15362 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15363 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15366 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15367 stmt->compound.context->parent = curContext;
15368 curContext = stmt->compound.context;
15369 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15371 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15372 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15374 isCustomAVLTree = 0x1;
15375 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15377 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15380 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15382 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15384 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15387 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15391 struct Declarator * decl;
15392 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15394 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15395 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15396 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15400 struct Type * type = (((void *)0));
15401 char typeStringBuf[1024];
15403 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15404 if(((struct Expression *)(*exp).last)->type == 11)
15406 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15409 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15411 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)
15413 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15415 typeString = templateClass->templateArgs[2].dataTypeString;
15417 else if(arrayExp->list)
15419 struct Expression * e;
15421 for(e = (*arrayExp->list).first; e; e = e->next)
15423 ProcessExpressionType(e);
15433 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15437 e->expType = (((void *)0));
15438 e = (*arrayExp->list).first;
15439 ProcessExpressionType(e);
15442 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15444 FreeType(e->expType);
15445 e->expType = (((void *)0));
15447 type = (((void *)0));
15455 FreeType(e->expType);
15456 e->expType = (((void *)0));
15462 typeStringBuf[0] = '\0';
15463 PrintType(type, typeStringBuf, 0x0, 0x1);
15464 typeString = typeStringBuf;
15470 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15471 struct Declarator * decl;
15472 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15476 struct Expression * e;
15478 builtinCount = (*arrayExp->list).count;
15479 type = ProcessTypeString(typeString, 0x0);
15480 while(e = (*arrayExp->list).first)
15482 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15483 e->destType = type;
15485 ProcessExpressionType(e);
15486 ListAdd(initializers, MkInitializerAssignment(e));
15489 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15491 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15492 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15493 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15494 FreeList(exp, FreeExpression);
15498 arrayExp->expType = ProcessTypeString("Container", 0x0);
15499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15502 else if(isLinkList && !isList)
15504 struct Declarator * decl;
15505 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15507 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15508 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15509 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15511 else if(_class->templateArgs)
15514 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15516 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15517 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15519 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15520 if(block && block->type == 2 && block->compound.context)
15522 block->compound.context->parent = stmt->compound.context;
15526 block = MkIfStmt(filter, block, (((void *)0)));
15530 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));
15531 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15532 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15533 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15539 sprintf(count, "%d", builtinCount);
15540 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));
15541 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15542 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15543 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15545 else if(isLinkList && !isList)
15547 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15548 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15550 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15552 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));
15556 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15557 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15559 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));
15561 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15562 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15563 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15567 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15569 ProcessExpressionType(expIt);
15570 if((*stmt->compound.declarations).first)
15571 ProcessDeclaration((*stmt->compound.declarations).first);
15573 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15574 ProcessStatement(stmt);
15575 curContext = stmt->compound.context->parent;
15580 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15592 struct Expression * exp;
15594 if(stmt->expressions)
15596 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15600 if(curFunction && !curFunction->type)
15601 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15602 FreeType(exp->destType);
15603 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15605 exp->destType->refCount++;
15607 ProcessExpressionType(exp);
15614 ProcessDeclaration(stmt->decl);
15619 struct AsmField * field;
15621 if(stmt->asmStmt.inputFields)
15623 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15624 if(field->expression)
15625 ProcessExpressionType(field->expression);
15627 if(stmt->asmStmt.outputFields)
15629 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15630 if(field->expression)
15631 ProcessExpressionType(field->expression);
15633 if(stmt->asmStmt.clobberedFields)
15635 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15637 if(field->expression)
15638 ProcessExpressionType(field->expression);
15645 struct PropertyWatch * propWatch;
15646 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15647 struct Expression * object = stmt->_watch.object;
15648 struct Expression * watcher = stmt->_watch.watcher;
15651 ProcessExpressionType(watcher);
15653 ProcessExpressionType(object);
15656 if(watcher || thisClass)
15658 struct External * external = curExternal;
15659 struct Context * context = curContext;
15662 stmt->expressions = MkList();
15663 curExternal = external->prev;
15664 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15666 struct ClassFunction * func;
15667 char watcherName[1024];
15668 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15669 struct External * createdExternal;
15670 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15673 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15674 if(propWatch->deleteWatch)
15675 strcat(watcherName, "_delete");
15678 struct Identifier * propID;
15680 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15682 strcat(watcherName, "_");
15683 strcat(watcherName, propID->string);
15686 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15688 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15689 ProcessClassFunctionBody(func, propWatch->compound);
15690 propWatch->compound = (((void *)0));
15691 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15692 createdExternal->symbol->idCode = external->symbol->idCode;
15693 curExternal = createdExternal;
15694 ProcessFunction(createdExternal->function);
15696 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15698 externalDecl->declaration = decl;
15699 if(decl->symbol && !decl->symbol->pointerExternal)
15700 decl->symbol->pointerExternal = externalDecl;
15702 if(propWatch->deleteWatch)
15704 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15706 ListAdd(args, CopyExpression(object));
15707 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15708 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15709 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15713 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15714 struct Identifier * propID;
15716 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15718 char propName[1024];
15719 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15723 char getName[1024], setName[1024];
15724 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15726 DeclareProperty(prop, setName, getName);
15727 strcpy(propName, "__ecereProp_");
15728 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15729 strcat(propName, "_");
15730 FullClassNameCat(propName, prop->name, 0x1);
15731 ListAdd(args, CopyExpression(object));
15732 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15733 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15734 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15735 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15745 curExternal = external;
15746 curContext = context;
15748 FreeExpression(watcher);
15750 FreeExpression(object);
15751 FreeList(watches, FreePropertyWatch);
15754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15758 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15760 ProcessStatement(propWatch->compound);
15767 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15768 struct Expression * object = stmt->_watch.object;
15769 struct __ecereNameSpace__ecere__com__Class * _class;
15772 ProcessExpressionType(object);
15775 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15778 struct Identifier * propID;
15781 stmt->expressions = MkList();
15782 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15784 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15791 for(propID = (*watches).first; propID; propID = propID->next)
15793 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15797 CreateFireWatcher(prop, object, stmt);
15800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15805 struct __ecereNameSpace__ecere__com__Property * prop;
15806 struct __ecereNameSpace__ecere__com__Class * base;
15808 for(base = _class; base; base = base->base)
15810 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15812 if(prop->isProperty && prop->isWatchable)
15814 CreateFireWatcher(prop, object, stmt);
15820 FreeExpression(object);
15821 FreeList(watches, FreeIdentifier);
15824 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15830 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15831 struct Expression * object = stmt->_watch.object;
15832 struct Expression * watcher = stmt->_watch.watcher;
15833 struct __ecereNameSpace__ecere__com__Class * _class;
15836 ProcessExpressionType(object);
15838 ProcessExpressionType(watcher);
15841 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15842 if(watcher || thisClass)
15846 struct Identifier * propID;
15849 stmt->expressions = MkList();
15852 struct __ecereNameSpace__ecere__sys__OldList * args;
15855 ListAdd(args, CopyExpression(object));
15856 ListAdd(args, MkExpConstant("0"));
15857 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15858 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15862 for(propID = (*watches).first; propID; propID = propID->next)
15864 char propName[1024];
15865 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15869 char getName[1024], setName[1024];
15870 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15872 DeclareProperty(prop, setName, getName);
15873 strcpy(propName, "__ecereProp_");
15874 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15875 strcat(propName, "_");
15876 FullClassNameCat(propName, prop->name, 0x1);
15877 MangleClassName(propName);
15878 ListAdd(args, CopyExpression(object));
15879 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15880 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15881 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15888 FreeExpression(object);
15890 FreeExpression(watcher);
15891 FreeList(watches, FreeIdentifier);
15894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15904 extern struct Expression * QBrackets(struct Expression * exp);
15906 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15908 extern struct Declarator * QMkPtrDecl(char * id);
15910 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15912 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15914 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15916 static void ProcessFunction(struct FunctionDefinition * function)
15918 void * __ecereTemp2;
15919 void * __ecereTemp1;
15920 struct Identifier * id = GetDeclId(function->declarator);
15921 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15922 struct Type * type = symbol ? symbol->type : (((void *)0));
15923 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15924 struct Context * oldTopContext = topContext;
15926 yylloc = function->loc;
15927 if(type && type->thisClass)
15929 struct Symbol * classSym = type->thisClass;
15930 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15931 char className[1024];
15932 char structName[1024];
15933 struct Declarator * funcDecl;
15934 struct Symbol * thisSymbol;
15935 unsigned int typedObject = 0x0;
15937 if(_class && !_class->base)
15939 _class = currentClass;
15940 if(_class && !_class->symbol)
15941 _class->symbol = FindClass(_class->fullName);
15942 classSym = _class ? _class->symbol : (((void *)0));
15945 thisClass = _class;
15946 if(inCompiler && _class)
15948 if(type->kind == 11)
15950 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15952 struct Type * param = symbol->type->params.first;
15954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15957 if(type->classObjectType != 1)
15959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15960 symbol->type->staticMethod = 0x1;
15961 symbol->type->thisClass = (((void *)0));
15962 symbol->type->extraParam = 0x0;
15965 strcpy(className, "__ecereClass_");
15966 FullClassNameCat(className, _class->fullName, 0x1);
15967 MangleClassName(className);
15968 structName[0] = (char)0;
15969 FullClassNameCat(structName, _class->fullName, 0x0);
15970 funcDecl = GetFuncDecl(function->declarator);
15973 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15975 struct TypeName * param = (*funcDecl->function.parameters).first;
15977 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15980 FreeTypeName(param);
15983 if(!function->propertyNoThis)
15985 struct TypeName * thisParam;
15987 if(type->classObjectType != 1)
15989 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15990 if(!funcDecl->function.parameters)
15991 funcDecl->function.parameters = MkList();
15992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15996 if(type->classObjectType != 1)
15998 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15999 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16001 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));
16002 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16006 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16008 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16010 funcDecl = GetFuncDecl(initDecl->declarator);
16013 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16015 struct TypeName * param = (*funcDecl->function.parameters).first;
16017 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16020 FreeTypeName(param);
16023 if(type->classObjectType != 1)
16025 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16027 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16029 if(!funcDecl->function.parameters)
16030 funcDecl->function.parameters = MkList();
16031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16039 if(type->classObjectType != 1)
16041 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));
16042 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16043 if(typedObject && thisSymbol->type)
16045 thisSymbol->type->classObjectType = 2;
16046 thisSymbol->type->byReference = type->byReference;
16050 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16052 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16055 struct __ecereNameSpace__ecere__com__Class * base;
16057 for(base = _class; base && base->type != 1000; base = base->next)
16059 for(member = base->membersAndProperties.first; member; member = member->next)
16060 if(!member->isProperty)
16066 for(member = _class->membersAndProperties.first; member; member = member->next)
16067 if(!member->isProperty)
16071 char pointerName[1024];
16072 struct Declaration * decl;
16073 struct Initializer * initializer;
16074 struct Expression * exp, * bytePtr;
16076 strcpy(pointerName, "__ecerePointer_");
16077 FullClassNameCat(pointerName, _class->fullName, 0x0);
16079 char className[1024];
16081 strcpy(className, "__ecereClass_");
16082 FullClassNameCat(className, classSym->string, 0x1);
16083 MangleClassName(className);
16084 DeclareClass(classSym, className);
16086 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16091 sprintf(string, "%d", _class->offset);
16092 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16096 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16098 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16099 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));
16102 yylloc = function->body->loc;
16103 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16105 struct Context * prevContext = curContext;
16107 curContext = function->body->compound.context;
16108 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16109 curContext = prevContext;
16111 decl->symbol = (((void *)0));
16112 if(!function->body->compound.declarations)
16113 function->body->compound.declarations = MkList();
16114 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16120 thisClass = (((void *)0));
16123 FreeSpecifier(id->_class);
16124 id->_class = (((void *)0));
16125 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16127 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16129 id = GetDeclId(initDecl->declarator);
16130 FreeSpecifier(id->_class);
16131 id->_class = (((void *)0));
16135 topContext = function->body->compound.context;
16137 struct FunctionDefinition * oldFunction = curFunction;
16139 curFunction = function;
16141 ProcessStatement(function->body);
16142 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16144 struct Statement * prevCompound = curCompound;
16145 struct Context * prevContext = curContext;
16146 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16148 if(!function->body->compound.statements)
16149 function->body->compound.statements = MkList();
16150 ListAdd(function->body->compound.statements, fireWatchers);
16151 curCompound = function->body;
16152 curContext = function->body->compound.context;
16153 ProcessStatement(fireWatchers);
16154 curContext = prevContext;
16155 curCompound = prevCompound;
16157 curFunction = oldFunction;
16159 if(function->declarator)
16161 ProcessDeclarator(function->declarator);
16163 topContext = oldTopContext;
16164 thisClass = oldThisClass;
16167 extern void FreeSymbol(struct Symbol * symbol);
16169 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16171 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16173 struct ClassDef * def;
16174 struct External * external = curExternal;
16175 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16177 for(def = definitions->first; def; def = def->next)
16181 if(def->function->declarator)
16182 curExternal = def->function->declarator->symbol->pointerExternal;
16184 curExternal = external;
16185 ProcessFunction((struct FunctionDefinition *)def->function);
16187 else if(def->type == 2)
16189 if(def->decl->type == 2)
16191 thisClass = regClass;
16192 ProcessInstantiationType(def->decl->inst);
16193 thisClass = (((void *)0));
16197 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16200 thisClass = regClass;
16201 ProcessDeclaration(def->decl);
16202 thisClass = backThisClass;
16205 else if(def->type == 1 && def->defProperties)
16207 struct MemberInit * defProperty;
16208 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);
16210 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16211 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16213 thisClass = regClass;
16214 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16215 thisClass = (((void *)0));
16217 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16218 FreeSymbol(thisSymbol);
16220 else if(def->type == 3 && def->propertyDef)
16222 struct PropertyDef * prop = def->propertyDef;
16224 thisClass = regClass;
16229 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16231 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16233 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16234 ProcessStatement(prop->setStmt);
16240 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16242 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16244 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16245 ProcessStatement(prop->getStmt);
16247 if(prop->issetStmt)
16251 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16253 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16255 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16256 ProcessStatement(prop->issetStmt);
16258 thisClass = (((void *)0));
16260 else if(def->type == 4 && def->propertyWatch)
16262 struct PropertyWatch * propertyWatch = def->propertyWatch;
16264 thisClass = regClass;
16265 if(propertyWatch->compound)
16267 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);
16269 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16270 curExternal = (((void *)0));
16271 ProcessStatement(propertyWatch->compound);
16273 thisClass = (((void *)0));
16278 void DeclareFunctionUtil(char * s)
16280 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16287 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16288 strcpy(name, "__ecereFunction_");
16289 FullClassNameCat(name, s, 0x0);
16290 DeclareFunction(function, name);
16294 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16296 void ComputeDataTypes()
16298 void * __ecereTemp1;
16299 struct External * external;
16300 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16302 currentClass = (((void *)0));
16303 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16304 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16306 curExternal = temp;
16307 DeclareFunctionUtil("eSystem_New");
16308 DeclareFunctionUtil("eSystem_New0");
16309 DeclareFunctionUtil("eSystem_Renew");
16310 DeclareFunctionUtil("eSystem_Renew0");
16311 DeclareStruct("ecere::com::Class", 0x0);
16312 DeclareStruct("ecere::com::Instance", 0x0);
16313 DeclareStruct("ecere::com::Property", 0x0);
16314 DeclareStruct("ecere::com::DataMember", 0x0);
16315 DeclareStruct("ecere::com::Method", 0x0);
16316 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16317 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16319 for(external = (*ast).first; external; external = external->next)
16321 afterExternal = curExternal = external;
16322 if(external->type == 0)
16324 currentClass = external->function->_class;
16325 ProcessFunction(external->function);
16327 else if(external->type == 1)
16329 currentClass = (((void *)0));
16330 ProcessDeclaration(external->declaration);
16332 else if(external->type == 2)
16334 struct ClassDefinition * _class = external->_class;
16336 currentClass = external->symbol->registered;
16337 if(_class->definitions)
16339 ProcessClass(_class->definitions, _class->symbol);
16343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16344 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16347 else if(external->type == 4)
16349 thisNameSpace = external->id->string;
16352 currentClass = (((void *)0));
16353 thisNameSpace = (((void *)0));
16354 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16355 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16358 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);
16360 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);
16362 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16364 struct __ecereNameSpace__ecere__com__Class * class;
16366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16401 __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);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16405 __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);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16418 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16419 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16420 __ecereClass_Conversion = class;
16421 __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);
16422 __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);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16424 __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);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16444 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)