compiler/ecere: completed intptr/uintptr support
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #endif
14 typedef long long int64;
15 typedef unsigned long long uint64;
16 #else
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
19 #endif
20 #ifdef __BIG_ENDIAN__
21 #define __ENDIAN_PAD(x) (8 - (x))
22 #else
23 #define __ENDIAN_PAD(x) 0
24 #endif
25 #include <stdint.h>
26 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
27
28 struct __ecereNameSpace__ecere__sys__BTNode;
29
30 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
31
32 struct __ecereNameSpace__ecere__sys__BinaryTree
33 {
34 struct __ecereNameSpace__ecere__sys__BTNode * root;
35 int count;
36 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
37 void (*  FreeKey)(void *  key);
38 } __attribute__ ((gcc_struct));
39
40 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
41
42 struct __ecereNameSpace__ecere__sys__OldList
43 {
44 void *  first;
45 void *  last;
46 int count;
47 unsigned int offset;
48 unsigned int circ;
49 } __attribute__ ((gcc_struct));
50
51 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
52
53 struct __ecereNameSpace__ecere__com__Method
54 {
55 char *  name;
56 struct __ecereNameSpace__ecere__com__Method * parent;
57 struct __ecereNameSpace__ecere__com__Method * left;
58 struct __ecereNameSpace__ecere__com__Method * right;
59 int depth;
60 int (*  function)();
61 int vid;
62 int type;
63 struct __ecereNameSpace__ecere__com__Class * _class;
64 void *  symbol;
65 char *  dataTypeString;
66 struct Type * dataType;
67 int memberAccess;
68 } __attribute__ ((gcc_struct));
69
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
71
72 struct __ecereNameSpace__ecere__com__Property
73 {
74 struct __ecereNameSpace__ecere__com__Property * prev;
75 struct __ecereNameSpace__ecere__com__Property * next;
76 char *  name;
77 unsigned int isProperty;
78 int memberAccess;
79 int id;
80 struct __ecereNameSpace__ecere__com__Class * _class;
81 char *  dataTypeString;
82 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
83 struct Type * dataType;
84 void (*  Set)();
85 int (*  Get)();
86 unsigned int (*  IsSet)();
87 void *  data;
88 void *  symbol;
89 int vid;
90 unsigned int conversion;
91 unsigned int watcherOffset;
92 char *  category;
93 unsigned int compiled;
94 unsigned int selfWatchable;
95 unsigned int isWatchable;
96 } __attribute__ ((gcc_struct));
97
98 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
99
100 struct CodePosition
101 {
102 int line;
103 int charPos;
104 int pos;
105 unsigned int included;
106 } __attribute__ ((gcc_struct));
107
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
109
110 struct Location
111 {
112 struct CodePosition start;
113 struct CodePosition end;
114 } __attribute__ ((gcc_struct));
115
116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
117
118 struct Attrib;
119
120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
121
122 struct ExtDecl
123 {
124 struct Location loc;
125 int type;
126 union
127 {
128 char * s;
129 struct Attrib * attr;
130 } __attribute__ ((gcc_struct));
131 } __attribute__ ((gcc_struct));
132
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
134
135 struct ClassDefinition
136 {
137 struct ClassDefinition * prev;
138 struct ClassDefinition * next;
139 struct Location loc;
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;
146 int endid;
147 int declMode;
148 unsigned int deleteWatchable;
149 } __attribute__ ((gcc_struct));
150
151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
152
153 struct Context
154 {
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;
160 int nextID;
161 int simpleID;
162 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
163 struct ClassDefinition * classDef;
164 unsigned int templateTypesOnly;
165 unsigned int hasNameSpace;
166 } __attribute__ ((gcc_struct));
167
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
169
170 struct Instantiation
171 {
172 struct Instantiation * prev;
173 struct Instantiation * next;
174 struct Location loc;
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;
184 unsigned int built;
185 } __attribute__ ((gcc_struct));
186
187 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
188
189 struct Declaration
190 {
191 struct Declaration * prev;
192 struct Declaration * next;
193 struct Location loc;
194 int type;
195 union
196 {
197 struct
198 {
199 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
200 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
201 } __attribute__ ((gcc_struct));
202 struct Instantiation * inst;
203 struct
204 {
205 struct Identifier * id;
206 struct Expression * exp;
207 } __attribute__ ((gcc_struct));
208 } __attribute__ ((gcc_struct));
209 struct Specifier * extStorage;
210 struct Symbol * symbol;
211 int declMode;
212 } __attribute__ ((gcc_struct));
213
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
215
216 struct Statement
217 {
218 struct Statement * prev;
219 struct Statement * next;
220 struct Location loc;
221 int type;
222 union
223 {
224 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
225 struct
226 {
227 struct Identifier * id;
228 struct Statement * stmt;
229 } __attribute__ ((gcc_struct)) labeled;
230 struct
231 {
232 struct Expression * exp;
233 struct Statement * stmt;
234 } __attribute__ ((gcc_struct)) caseStmt;
235 struct
236 {
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;
242 struct
243 {
244 struct __ecereNameSpace__ecere__sys__OldList * exp;
245 struct Statement * stmt;
246 struct Statement * elseStmt;
247 } __attribute__ ((gcc_struct)) ifStmt;
248 struct
249 {
250 struct __ecereNameSpace__ecere__sys__OldList * exp;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) switchStmt;
253 struct
254 {
255 struct __ecereNameSpace__ecere__sys__OldList * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) whileStmt;
258 struct
259 {
260 struct __ecereNameSpace__ecere__sys__OldList * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) doWhile;
263 struct
264 {
265 struct Statement * init;
266 struct Statement * check;
267 struct __ecereNameSpace__ecere__sys__OldList * increment;
268 struct Statement * stmt;
269 } __attribute__ ((gcc_struct)) forStmt;
270 struct
271 {
272 struct Identifier * id;
273 } __attribute__ ((gcc_struct)) gotoStmt;
274 struct
275 {
276 struct Specifier * spec;
277 char * statements;
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;
282 struct
283 {
284 struct Expression * watcher;
285 struct Expression * object;
286 struct __ecereNameSpace__ecere__sys__OldList * watches;
287 } __attribute__ ((gcc_struct)) _watch;
288 struct
289 {
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));
298
299 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
300
301 struct TypeName
302 {
303 struct TypeName * prev;
304 struct TypeName * next;
305 struct Location loc;
306 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
307 struct Declarator * declarator;
308 int classObjectType;
309 struct Expression * bitCount;
310 } __attribute__ ((gcc_struct));
311
312 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
313
314 struct Initializer
315 {
316 struct Initializer * prev;
317 struct Initializer * next;
318 struct Location loc;
319 int type;
320 union
321 {
322 struct Expression * exp;
323 struct __ecereNameSpace__ecere__sys__OldList *  list;
324 } __attribute__ ((gcc_struct));
325 unsigned int isConstant;
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
329
330 struct __ecereNameSpace__ecere__com__DataValue
331 {
332 union
333 {
334 char c;
335 unsigned char uc;
336 short s;
337 unsigned short us;
338 int i;
339 unsigned int ui;
340 void *  p;
341 float f;
342 double d;
343 long long i64;
344 uint64 ui64;
345 } __attribute__ ((gcc_struct));
346 } __attribute__ ((gcc_struct));
347
348 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
349
350 struct Expression
351 {
352 struct Expression * prev;
353 struct Expression * next;
354 struct Location loc;
355 int type;
356 union
357 {
358 struct
359 {
360 char *  constant;
361 struct Identifier * identifier;
362 } __attribute__ ((gcc_struct));
363 struct Statement * compound;
364 struct Instantiation * instance;
365 char *  string;
366 struct __ecereNameSpace__ecere__sys__OldList *  list;
367 struct
368 {
369 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
370 struct Declarator * decl;
371 } __attribute__ ((gcc_struct)) _classExp;
372 struct
373 {
374 struct Identifier * id;
375 } __attribute__ ((gcc_struct)) classData;
376 struct
377 {
378 struct Expression * exp;
379 struct __ecereNameSpace__ecere__sys__OldList * arguments;
380 struct Location argLoc;
381 } __attribute__ ((gcc_struct)) call;
382 struct
383 {
384 struct Expression * exp;
385 struct __ecereNameSpace__ecere__sys__OldList * index;
386 } __attribute__ ((gcc_struct)) index;
387 struct
388 {
389 struct Expression * exp;
390 struct Identifier * member;
391 int memberType;
392 unsigned int thisPtr;
393 } __attribute__ ((gcc_struct)) member;
394 struct
395 {
396 int op;
397 struct Expression * exp1;
398 struct Expression * exp2;
399 } __attribute__ ((gcc_struct)) op;
400 struct TypeName * typeName;
401 struct Specifier * _class;
402 struct
403 {
404 struct TypeName * typeName;
405 struct Expression * exp;
406 } __attribute__ ((gcc_struct)) cast;
407 struct
408 {
409 struct Expression * cond;
410 struct __ecereNameSpace__ecere__sys__OldList * exp;
411 struct Expression * elseExp;
412 } __attribute__ ((gcc_struct)) cond;
413 struct
414 {
415 struct TypeName * typeName;
416 struct Expression * size;
417 } __attribute__ ((gcc_struct)) _new;
418 struct
419 {
420 struct TypeName * typeName;
421 struct Expression * size;
422 struct Expression * exp;
423 } __attribute__ ((gcc_struct)) _renew;
424 struct
425 {
426 char * table;
427 struct Identifier * id;
428 } __attribute__ ((gcc_struct)) db;
429 struct
430 {
431 struct Expression * ds;
432 struct Expression * name;
433 } __attribute__ ((gcc_struct)) dbopen;
434 struct
435 {
436 struct TypeName * typeName;
437 struct Initializer * initializer;
438 } __attribute__ ((gcc_struct)) initializer;
439 struct
440 {
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;
451 unsigned int usage;
452 int tempCount;
453 unsigned int byReference;
454 unsigned int isConstant;
455 unsigned int addedThis;
456 unsigned int needCast;
457 unsigned int thisPtr;
458 } __attribute__ ((gcc_struct));
459
460 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
461
462 struct TemplateDatatype
463 {
464 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
465 struct Declarator * decl;
466 } __attribute__ ((gcc_struct));
467
468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
469
470 struct TemplateArgument;
471
472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
473
474 struct TemplateParameter
475 {
476 struct TemplateParameter * prev;
477 struct TemplateParameter * next;
478 struct Location loc;
479 int type;
480 struct Identifier * identifier;
481 union
482 {
483 struct TemplateDatatype * dataType;
484 int memberType;
485 } __attribute__ ((gcc_struct));
486 struct TemplateArgument * defaultArgument;
487 char *  dataTypeString;
488 struct Type * baseType;
489 } __attribute__ ((gcc_struct));
490
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
492
493 struct Specifier
494 {
495 struct Specifier * prev;
496 struct Specifier * next;
497 struct Location loc;
498 int type;
499 union
500 {
501 int specifier;
502 struct
503 {
504 struct ExtDecl * extDecl;
505 char *  name;
506 struct Symbol * symbol;
507 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
508 } __attribute__ ((gcc_struct));
509 struct
510 {
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));
523
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
525
526 struct Identifier
527 {
528 struct Identifier * prev;
529 struct Identifier * next;
530 struct Location loc;
531 struct Symbol * classSym;
532 struct Specifier * _class;
533 char *  string;
534 struct Identifier * badID;
535 } __attribute__ ((gcc_struct));
536
537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
538
539 struct Pointer;
540
541 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
542
543 struct Declarator
544 {
545 struct Declarator * prev;
546 struct Declarator * next;
547 struct Location loc;
548 int type;
549 struct Symbol * symbol;
550 struct Declarator * declarator;
551 union
552 {
553 struct Identifier * identifier;
554 struct
555 {
556 struct Expression * exp;
557 struct Expression * posExp;
558 struct Attrib * attrib;
559 } __attribute__ ((gcc_struct)) structDecl;
560 struct
561 {
562 struct Expression * exp;
563 struct Specifier * enumClass;
564 } __attribute__ ((gcc_struct)) array;
565 struct
566 {
567 struct __ecereNameSpace__ecere__sys__OldList * parameters;
568 } __attribute__ ((gcc_struct)) function;
569 struct
570 {
571 struct Pointer * pointer;
572 } __attribute__ ((gcc_struct)) pointer;
573 struct
574 {
575 struct ExtDecl * extended;
576 } __attribute__ ((gcc_struct)) extended;
577 } __attribute__ ((gcc_struct));
578 } __attribute__ ((gcc_struct));
579
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
581
582 struct FunctionDefinition
583 {
584 struct FunctionDefinition * prev;
585 struct FunctionDefinition * next;
586 struct Location loc;
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;
593 int declMode;
594 struct Type * type;
595 struct Symbol * propSet;
596 int tempCount;
597 unsigned int propertyNoThis;
598 } __attribute__ ((gcc_struct));
599
600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
601
602 struct DBTableDef;
603
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
605
606 struct External
607 {
608 struct External * prev;
609 struct External * next;
610 struct Location loc;
611 int type;
612 struct Symbol * symbol;
613 union
614 {
615 struct FunctionDefinition * function;
616 struct ClassDefinition * _class;
617 struct Declaration * declaration;
618 char *  importString;
619 struct Identifier * id;
620 struct DBTableDef * table;
621 } __attribute__ ((gcc_struct));
622 int importType;
623 } __attribute__ ((gcc_struct));
624
625 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
626
627 struct ModuleImport
628 {
629 struct ModuleImport * prev;
630 struct ModuleImport * next;
631 char *  name;
632 struct __ecereNameSpace__ecere__sys__OldList classes;
633 struct __ecereNameSpace__ecere__sys__OldList functions;
634 int importType;
635 int importAccess;
636 } __attribute__ ((gcc_struct));
637
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
639
640 struct ClassImport
641 {
642 struct ClassImport * prev;
643 struct ClassImport * next;
644 char *  name;
645 struct __ecereNameSpace__ecere__sys__OldList methods;
646 struct __ecereNameSpace__ecere__sys__OldList properties;
647 unsigned int itself;
648 unsigned int isRemote;
649 } __attribute__ ((gcc_struct));
650
651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
652
653 struct Symbol
654 {
655 char *  string;
656 struct Symbol * parent;
657 struct Symbol * left;
658 struct Symbol * right;
659 int depth;
660 struct Type * type;
661 union
662 {
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));
667 int id;
668 int idCode;
669 union
670 {
671 struct
672 {
673 struct External * pointerExternal;
674 struct External * structExternal;
675 } __attribute__ ((gcc_struct));
676 struct
677 {
678 struct External * externalGet;
679 struct External * externalSet;
680 struct External * externalPtr;
681 struct External * externalIsSet;
682 } __attribute__ ((gcc_struct));
683 struct
684 {
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;
696 char *  structName;
697 char *  className;
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;
706 int declaring;
707 unsigned int classData;
708 unsigned int isStatic;
709 char *  shortName;
710 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
711 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
712 struct Context * ctx;
713 int isIterator;
714 struct Expression * propCategory;
715 } __attribute__ ((gcc_struct));
716
717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
718
719 struct Type
720 {
721 struct Type * prev;
722 struct Type * next;
723 int refCount;
724 union
725 {
726 struct Symbol * _class;
727 struct
728 {
729 struct __ecereNameSpace__ecere__sys__OldList members;
730 char *  enumName;
731 } __attribute__ ((gcc_struct));
732 struct
733 {
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));
740 struct
741 {
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));
746 struct
747 {
748 struct Type * arrayType;
749 int arraySize;
750 struct Expression * arraySizeExp;
751 unsigned int freeExp;
752 struct Symbol * enumClass;
753 } __attribute__ ((gcc_struct));
754 struct Type * type;
755 struct TemplateParameter * templateParameter;
756 } __attribute__ ((gcc_struct));
757 unsigned int isSigned;
758 int kind;
759 unsigned int constant;
760 unsigned int size;
761 char *  name;
762 char *  typeName;
763 unsigned int count;
764 unsigned int truth;
765 int classObjectType;
766 unsigned int byReference;
767 unsigned int extraParam;
768 int alignment;
769 unsigned int directClassAccess;
770 unsigned int computing;
771 unsigned int dllExport;
772 unsigned int offset;
773 unsigned int keepCast;
774 unsigned int passAsTemplate;
775 int bitFieldCount;
776 } __attribute__ ((gcc_struct));
777
778 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
779
780 struct __ecereNameSpace__ecere__com__Class
781 {
782 struct __ecereNameSpace__ecere__com__Class * prev;
783 struct __ecereNameSpace__ecere__com__Class * next;
784 char *  name;
785 int offset;
786 int structSize;
787 int (* *  _vTbl)();
788 int vTblSize;
789 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
790 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
791 int offsetClass;
792 int sizeClass;
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;
800 int memberID;
801 int startMemberID;
802 int type;
803 struct __ecereNameSpace__ecere__com__Instance * module;
804 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
805 char *  dataTypeString;
806 struct Type * dataType;
807 int typeSize;
808 int defaultAlignment;
809 void (*  Initialize)();
810 int memberOffset;
811 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
812 char *  designerClass;
813 unsigned int noExpansion;
814 char *  defaultProperty;
815 unsigned int comRedefinition;
816 int count;
817 unsigned int isRemote;
818 unsigned int internalDecl;
819 void *  data;
820 unsigned int computeSize;
821 int structAlignment;
822 int destructionWatchOffset;
823 unsigned int fixed;
824 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
825 int inheritanceAccess;
826 char *  fullName;
827 void *  symbol;
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;
833 int numParams;
834 } __attribute__ ((gcc_struct));
835
836 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
837
838 struct __ecereNameSpace__ecere__com__Instance
839 {
840 int (* *  _vTbl)();
841 struct __ecereNameSpace__ecere__com__Class * _class;
842 int _refCount;
843 } __attribute__ ((gcc_struct));
844
845 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
846
847 struct __ecereNameSpace__ecere__com__DataMember
848 {
849 struct __ecereNameSpace__ecere__com__DataMember * prev;
850 struct __ecereNameSpace__ecere__com__DataMember * next;
851 char *  name;
852 unsigned int isProperty;
853 int memberAccess;
854 int id;
855 struct __ecereNameSpace__ecere__com__Class * _class;
856 char *  dataTypeString;
857 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
858 struct Type * dataType;
859 int type;
860 int offset;
861 int memberID;
862 struct __ecereNameSpace__ecere__sys__OldList members;
863 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
864 int memberOffset;
865 int structAlignment;
866 } __attribute__ ((gcc_struct));
867
868 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
869
870 struct __ecereNameSpace__ecere__com__SerialBuffer
871 {
872 unsigned char *  _buffer;
873 unsigned int count;
874 unsigned int _size;
875 unsigned int pos;
876 } __attribute__ ((gcc_struct));
877
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
879
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
881 {
882 union
883 {
884 struct
885 {
886 char *  dataTypeString;
887 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
888 } __attribute__ ((gcc_struct));
889 struct __ecereNameSpace__ecere__com__DataValue expression;
890 struct
891 {
892 char *  memberString;
893 union
894 {
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));
902
903 typedef unsigned int size_t;
904
905 void exit(int status);
906
907 void * calloc(size_t nmemb, size_t size);
908
909 void free(void * ptr);
910
911 void * malloc(size_t size);
912
913 void * realloc(void * ptr, size_t size);
914
915 long int strtol(const char * nptr, char ** endptr, int base);
916
917 long long int strtoll(const char * nptr, char ** endptr, int base);
918
919 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
920
921 enum yytokentype
922 {
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
924 };
925
926 typedef union YYSTYPE
927 {
928 int specifierType;
929 int i;
930 int declMode;
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;
957 char * string;
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;
967
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
969
970 struct Enumerator
971 {
972 struct Enumerator * prev;
973 struct Enumerator * next;
974 struct Location loc;
975 struct Identifier * id;
976 struct Expression * exp;
977 } __attribute__ ((gcc_struct));
978
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
980
981 struct InitDeclarator
982 {
983 struct InitDeclarator * prev;
984 struct InitDeclarator * next;
985 struct Location loc;
986 struct Declarator * declarator;
987 struct Initializer * initializer;
988 } __attribute__ ((gcc_struct));
989
990 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
991
992 struct AsmField
993 {
994 struct AsmField * prev;
995 struct AsmField * next;
996 struct Location loc;
997 char *  command;
998 struct Expression * expression;
999 } __attribute__ ((gcc_struct));
1000
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1002
1003 struct Attribute;
1004
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1006
1007 struct ClassFunction
1008 {
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;
1018 int declMode;
1019 struct Type * type;
1020 struct Symbol * propSet;
1021 unsigned int isVirtual;
1022 unsigned int isConstructor;
1023 unsigned int isDestructor;
1024 unsigned int dontMangle;
1025 int id;
1026 int idCode;
1027 } __attribute__ ((gcc_struct));
1028
1029 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1030
1031 struct MembersInit
1032 {
1033 struct MembersInit * prev;
1034 struct MembersInit * next;
1035 struct Location loc;
1036 int type;
1037 union
1038 {
1039 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1040 struct ClassFunction * function;
1041 } __attribute__ ((gcc_struct));
1042 } __attribute__ ((gcc_struct));
1043
1044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1045
1046 struct MemberInit
1047 {
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;
1054 unsigned int used;
1055 unsigned int variable;
1056 unsigned int takeOutExp;
1057 } __attribute__ ((gcc_struct));
1058
1059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1060
1061 struct PropertyDef
1062 {
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));
1077
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1079
1080 struct PropertyWatch
1081 {
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));
1089
1090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1091
1092 struct ClassDef
1093 {
1094 struct ClassDef * prev;
1095 struct ClassDef * next;
1096 struct Location loc;
1097 int type;
1098 union
1099 {
1100 struct Declaration * decl;
1101 struct ClassFunction * function;
1102 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1103 struct PropertyDef * propertyDef;
1104 struct PropertyWatch * propertyWatch;
1105 char *  designer;
1106 struct Identifier * defaultProperty;
1107 struct
1108 {
1109 struct Identifier * id;
1110 struct Initializer * initializer;
1111 } __attribute__ ((gcc_struct));
1112 } __attribute__ ((gcc_struct));
1113 int memberAccess;
1114 void *  object;
1115 } __attribute__ ((gcc_struct));
1116
1117 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1118
1119 struct DBTableEntry;
1120
1121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1122
1123 struct DBIndexItem;
1124
1125 extern YYSTYPE yylval;
1126
1127 extern struct Location yylloc;
1128
1129 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1130
1131 extern int returnCode;
1132
1133 extern struct Expression * parsedExpression;
1134
1135 extern unsigned int yydebug;
1136
1137 void SetYydebug(unsigned int b)
1138 {
1139 yydebug = b;
1140 }
1141
1142 extern unsigned int echoOn;
1143
1144 void resetScanner();
1145
1146 int propWatcherID;
1147
1148 int expression_yyparse();
1149
1150 static struct Statement * curCompound;
1151
1152 struct External * curExternal, * afterExternal;
1153
1154 static struct Type * curSwitchType;
1155
1156 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1157
1158 struct __ecereNameSpace__ecere__com__Class * thisClass;
1159
1160 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1161 {
1162 thisClass = c;
1163 }
1164
1165 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1166 {
1167 return thisClass;
1168 }
1169
1170 static char * thisNameSpace;
1171
1172 struct __ecereNameSpace__ecere__com__Class * containerClass;
1173
1174 unsigned int thisClassParams = 0x1;
1175
1176 unsigned int internalValueCounter;
1177
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1179
1180 struct __ecereNameSpace__ecere__sys__TempFile
1181 {
1182 char __ecere_padding[24];
1183 } __attribute__ ((gcc_struct));
1184
1185 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1186
1187 extern int strlen(const char * );
1188
1189 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1190
1191 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1192
1193 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1194
1195 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1196
1197 void PrintExpression(struct Expression * exp, char * string)
1198 {
1199 {
1200 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1201 int count;
1202
1203 if(exp)
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);
1210 }
1211 }
1212
1213 extern int isspace(int c);
1214
1215 long long _strtoi64(char * string, char ** endString, int base)
1216 {
1217 long long value = 0;
1218 int sign = 1;
1219 int c;
1220 char ch;
1221
1222 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1223 ;
1224 if(ch == '+')
1225 c++;
1226 else if(ch == '-')
1227 {
1228 sign = -1;
1229 c++;
1230 }
1231 ;
1232 if(!base)
1233 {
1234 if(ch == (char)0 && string[c + 1] == 'x')
1235 {
1236 base = 16;
1237 c += 2;
1238 }
1239 else if(ch == '0')
1240 {
1241 base = 8;
1242 c++;
1243 }
1244 else
1245 base = 10;
1246 }
1247 for(; (ch = string[c]); c++)
1248 {
1249 if(ch == '0')
1250 ch = (char)0;
1251 else if(ch >= '1' && ch <= '9')
1252 ch -= '1';
1253 else if(ch >= 'a' && ch <= 'z')
1254 ch -= 'a';
1255 else if(ch >= 'A' && ch <= 'Z')
1256 ch -= 'A';
1257 else
1258 {
1259 if(endString)
1260 *endString = string + c;
1261 break;
1262 }
1263 if(ch < base)
1264 {
1265 value *= base;
1266 value += ch;
1267 }
1268 else
1269 {
1270 if(endString)
1271 *endString = string + c;
1272 break;
1273 }
1274 }
1275 return sign * value;
1276 }
1277
1278 uint64 _strtoui64(char * string, char ** endString, int base)
1279 {
1280 uint64 value = 0;
1281 int sign = 1;
1282 int c;
1283 char ch;
1284
1285 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1286 ;
1287 if(ch == '+')
1288 c++;
1289 else if(ch == '-')
1290 {
1291 sign = -1;
1292 c++;
1293 }
1294 ;
1295 if(!base)
1296 {
1297 if(ch == (char)0 && string[c + 1] == 'x')
1298 {
1299 base = 16;
1300 c += 2;
1301 }
1302 else if(ch == '0')
1303 {
1304 base = 8;
1305 c++;
1306 }
1307 else
1308 base = 10;
1309 }
1310 for(; (ch = string[c]); c++)
1311 {
1312 if(ch == '0')
1313 ch = (char)0;
1314 else if(ch >= '1' && ch <= '9')
1315 ch -= '1';
1316 else if(ch >= 'a' && ch <= 'z')
1317 ch -= 'a';
1318 else if(ch >= 'A' && ch <= 'Z')
1319 ch -= 'A';
1320 else
1321 {
1322 if(endString)
1323 *endString = string + c;
1324 break;
1325 }
1326 if(ch < base)
1327 {
1328 value *= base;
1329 value += ch;
1330 }
1331 else
1332 {
1333 if(endString)
1334 *endString = string + c;
1335 break;
1336 }
1337 }
1338 return sign * value;
1339 }
1340
1341 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1342
1343 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1344
1345 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1346 {
1347 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1348 {
1349 if(!param->baseType)
1350 {
1351 if(param->dataTypeString)
1352 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1353 else
1354 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1355 }
1356 return param->baseType;
1357 }
1358 return (((void *)0));
1359 }
1360
1361 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1362 {
1363 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1364 return 0x1;
1365 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1366 {
1367 return 0x0;
1368 }
1369 if(type1->kind == type2->kind)
1370 {
1371 switch(type1->kind)
1372 {
1373 case 1:
1374 case 2:
1375 case 3:
1376 case 4:
1377 case 22:
1378 if(type1->passAsTemplate && !type2->passAsTemplate)
1379 return 0x1;
1380 return type1->isSigned != type2->isSigned;
1381 case 8:
1382 return type1->_class != type2->_class;
1383 case 13:
1384 return NeedCast(type1->type, type2->type);
1385 default:
1386 return 0x1;
1387 }
1388 }
1389 return 0x1;
1390 }
1391
1392 extern int strcmp(const char * , const char * );
1393
1394 extern struct Context * curContext;
1395
1396 extern struct Context * topContext;
1397
1398 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1399
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);
1401
1402 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1403
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);
1405
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);
1407
1408 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1409
1410 struct __ecereNameSpace__ecere__com__ClassProperty
1411 {
1412 char *  name;
1413 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1414 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1415 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1416 int depth;
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));
1423
1424 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1425
1426 extern struct Expression * QMkExpId(char *  id);
1427
1428 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1429
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1431 {
1432 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1433 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1434 char *  name;
1435 int type;
1436 union
1437 {
1438 char *  dataTypeString;
1439 int memberType;
1440 } __attribute__ ((gcc_struct));
1441 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1442 void *  param;
1443 char __ecere_padding[4];
1444 } __attribute__ ((gcc_struct));
1445
1446 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1447
1448 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1449
1450 extern void FreeIdentifier(struct Identifier * id);
1451
1452 void ProcessExpressionType(struct Expression * exp);
1453
1454 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1455
1456 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1457
1458 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1459
1460 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1461
1462 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1463
1464 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1465
1466 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1467
1468 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1469
1470 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1471 {
1472 if(exp->type == 0 && exp->identifier)
1473 {
1474 struct Identifier * id = exp->identifier;
1475 struct Context * ctx;
1476 struct Symbol * symbol = (((void *)0));
1477
1478 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1479 {
1480 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1481 {
1482 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1483 if(symbol)
1484 break;
1485 }
1486 }
1487 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1488 {
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));
1493
1494 if(!prop)
1495 {
1496 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1497 }
1498 if(!prop && !method)
1499 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1500 if(!prop && !method && !member)
1501 {
1502 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1503 }
1504 if(prop || method || member || classProp)
1505 {
1506 exp->type = 8;
1507 exp->member.member = id;
1508 exp->member.memberType = 0;
1509 exp->member.exp = QMkExpId("this");
1510 exp->addedThis = 0x1;
1511 }
1512 else if(_class && _class->templateParams.first)
1513 {
1514 struct __ecereNameSpace__ecere__com__Class * sClass;
1515
1516 for(sClass = _class; sClass; sClass = sClass->base)
1517 {
1518 if(sClass->templateParams.first)
1519 {
1520 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1521
1522 for(param = sClass->templateParams.first; param; param = param->next)
1523 {
1524 if(param->type == 2 && !strcmp(param->name, id->string))
1525 {
1526 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1527
1528 if(argExp)
1529 {
1530 struct Declarator * decl;
1531 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1532
1533 FreeIdentifier(exp->member.member);
1534 ProcessExpressionType(argExp);
1535 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1536 exp->expType = ProcessType(specs, decl);
1537 exp->type = 5;
1538 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1539 }
1540 }
1541 }
1542 }
1543 }
1544 }
1545 }
1546 }
1547 }
1548
1549 extern int sprintf(char * , char * , ...);
1550
1551 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1552
1553 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1554
1555 char * PrintInt(long long result)
1556 {
1557 char temp[100];
1558
1559 if(result > (((long long)0x7fffffffffffffffLL)))
1560 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1561 else
1562 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1563 return __ecereNameSpace__ecere__sys__CopyString(temp);
1564 }
1565
1566 char * PrintUInt(uint64 result)
1567 {
1568 char temp[100];
1569
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);
1574 else
1575 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1577 }
1578
1579 char * PrintInt64(long long result)
1580 {
1581 char temp[100];
1582
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 }
1586
1587 char * PrintUInt64(uint64 result)
1588 {
1589 char temp[100];
1590
1591 if(result > (((long long)0x7fffffffffffffffLL)))
1592 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1593 else
1594 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1595 return __ecereNameSpace__ecere__sys__CopyString(temp);
1596 }
1597
1598 char * PrintHexUInt(uint64 result)
1599 {
1600 char temp[100];
1601
1602 if(result > (0xffffffff))
1603 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1604 else
1605 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1606 return __ecereNameSpace__ecere__sys__CopyString(temp);
1607 }
1608
1609 char * PrintHexUInt64(uint64 result)
1610 {
1611 char temp[100];
1612
1613 if(result > (0xffffffff))
1614 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1615 else
1616 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1617 return __ecereNameSpace__ecere__sys__CopyString(temp);
1618 }
1619
1620 char * PrintShort(short result)
1621 {
1622 char temp[100];
1623
1624 sprintf(temp, "%d", (unsigned short)result);
1625 return __ecereNameSpace__ecere__sys__CopyString(temp);
1626 }
1627
1628 char * PrintUShort(unsigned short result)
1629 {
1630 char temp[100];
1631
1632 if(result > (unsigned short)32767)
1633 sprintf(temp, "0x%X", (int)result);
1634 else
1635 sprintf(temp, "%d", result);
1636 return __ecereNameSpace__ecere__sys__CopyString(temp);
1637 }
1638
1639 extern int isprint(int c);
1640
1641 char * PrintChar(char result)
1642 {
1643 char temp[100];
1644
1645 if(result > (char)0 && isprint(result))
1646 sprintf(temp, "'%c'", result);
1647 else if(result < (char)0)
1648 sprintf(temp, "%d", result);
1649 else
1650 sprintf(temp, "0x%X", (unsigned char)result);
1651 return __ecereNameSpace__ecere__sys__CopyString(temp);
1652 }
1653
1654 char * PrintUChar(unsigned char result)
1655 {
1656 char temp[100];
1657
1658 sprintf(temp, "0x%X", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 }
1661
1662 char * PrintFloat(float result)
1663 {
1664 char temp[350];
1665
1666 sprintf(temp, "%.16ff", result);
1667 return __ecereNameSpace__ecere__sys__CopyString(temp);
1668 }
1669
1670 char * PrintDouble(double result)
1671 {
1672 char temp[350];
1673
1674 sprintf(temp, "%.16f", result);
1675 return __ecereNameSpace__ecere__sys__CopyString(temp);
1676 }
1677
1678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1679
1680 struct OpTable
1681 {
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));
1718
1719 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1720
1721 struct Operand
1722 {
1723 int kind;
1724 struct Type * type;
1725 unsigned int ptrSize;
1726 union
1727 {
1728 char c;
1729 unsigned char uc;
1730 short s;
1731 unsigned short us;
1732 int i;
1733 unsigned int ui;
1734 float f;
1735 double d;
1736 unsigned char *  p;
1737 long long i64;
1738 uint64 ui64;
1739 intptr_t iptr;
1740 uintptr_t uiptr;
1741 } __attribute__ ((gcc_struct));
1742 struct OpTable ops;
1743 } __attribute__ ((gcc_struct));
1744
1745 struct Operand GetOperand(struct Expression * exp);
1746
1747 unsigned int GetInt(struct Expression * exp, int * value2)
1748 {
1749 struct Operand op2 = GetOperand(exp);
1750
1751 if(op2.kind == 3 && op2.type->isSigned)
1752 *value2 = op2.i;
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;
1777 else
1778 return 0x0;
1779 return 0x1;
1780 }
1781
1782 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1783 {
1784 struct Operand op2 = GetOperand(exp);
1785
1786 if(op2.kind == 3 && op2.type->isSigned)
1787 *value2 = (unsigned int)op2.i;
1788 else if(op2.kind == 3)
1789 *value2 = op2.ui;
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)
1811 *value2 = op2.ui;
1812 else
1813 return 0x0;
1814 return 0x1;
1815 }
1816
1817 unsigned int GetInt64(struct Expression * exp, long long * value2)
1818 {
1819 struct Operand op2 = GetOperand(exp);
1820
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)
1826 *value2 = op2.i64;
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;
1847 else
1848 return 0x0;
1849 return 0x1;
1850 }
1851
1852 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1853 {
1854 struct Operand op2 = GetOperand(exp);
1855
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)
1863 *value2 = op2.ui64;
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;
1882 else
1883 return 0x0;
1884 return 0x1;
1885 }
1886
1887 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1888 {
1889 struct Operand op2 = GetOperand(exp);
1890
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)
1900 *value2 = op2.iptr;
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;
1917 else
1918 return 0x0;
1919 return 0x1;
1920 }
1921
1922 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1923 {
1924 struct Operand op2 = GetOperand(exp);
1925
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;
1952 else
1953 return 0x0;
1954 return 0x1;
1955 }
1956
1957 unsigned int GetShort(struct Expression * exp, short * value2)
1958 {
1959 struct Operand op2 = GetOperand(exp);
1960
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)
1974 *value2 = op2.s;
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;
1987 else
1988 return 0x0;
1989 return 0x1;
1990 }
1991
1992 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1993 {
1994 struct Operand op2 = GetOperand(exp);
1995
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)
2011 *value2 = op2.us;
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;
2022 else
2023 return 0x0;
2024 return 0x1;
2025 }
2026
2027 unsigned int GetChar(struct Expression * exp, char * value2)
2028 {
2029 struct Operand op2 = GetOperand(exp);
2030
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)
2048 *value2 = op2.c;
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;
2057 else
2058 return 0x0;
2059 return 0x1;
2060 }
2061
2062 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2063 {
2064 struct Operand op2 = GetOperand(exp);
2065
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)
2085 *value2 = op2.uc;
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;
2092 else
2093 return 0x0;
2094 return 0x1;
2095 }
2096
2097 unsigned int GetFloat(struct Expression * exp, float * value2)
2098 {
2099 struct Operand op2 = GetOperand(exp);
2100
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;
2127 else
2128 return 0x0;
2129 return 0x1;
2130 }
2131
2132 unsigned int GetDouble(struct Expression * exp, double * value2)
2133 {
2134 struct Operand op2 = GetOperand(exp);
2135
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;
2162 else
2163 return 0x0;
2164 return 0x1;
2165 }
2166
2167 void ComputeExpression(struct Expression * exp);
2168
2169 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2170
2171 int ComputeTypeSize(struct Type * type);
2172
2173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2174
2175 struct __ecereNameSpace__ecere__com__BitMember
2176 {
2177 struct __ecereNameSpace__ecere__com__BitMember * prev;
2178 struct __ecereNameSpace__ecere__com__BitMember * next;
2179 char *  name;
2180 unsigned int isProperty;
2181 int memberAccess;
2182 int id;
2183 struct __ecereNameSpace__ecere__com__Class * _class;
2184 char *  dataTypeString;
2185 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2186 struct Type * dataType;
2187 int type;
2188 int size;
2189 int pos;
2190 uint64 mask;
2191 } __attribute__ ((gcc_struct));
2192
2193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2194
2195 struct __ecereNameSpace__ecere__sys__OldLink
2196 {
2197 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2198 struct __ecereNameSpace__ecere__sys__OldLink * next;
2199 void *  data;
2200 } __attribute__ ((gcc_struct));
2201
2202 void FinishTemplatesContext(struct Context * context);
2203
2204 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2205 {
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);
2208
2209 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2210 {
2211 int c;
2212 int unionMemberOffset = 0;
2213 int bitFields = 0;
2214
2215 if(!member && _class->destructionWatchOffset)
2216 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2217 {
2218 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2219
2220 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2221 {
2222 if(!dataMember->isProperty)
2223 {
2224 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2225 {
2226 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2227 }
2228 }
2229 }
2230 }
2231 {
2232 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2233
2234 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2235 {
2236 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2237 {
2238 if(!isMember && _class->type == 2 && dataMember->dataType)
2239 {
2240 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2241 uint64 mask = 0;
2242 int d;
2243
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++)
2251 {
2252 if(d)
2253 mask <<= 1;
2254 mask |= 1;
2255 }
2256 bitMember->mask = mask << bitMember->pos;
2257 }
2258 else if(dataMember->type == 0 && dataMember->dataType)
2259 {
2260 int size;
2261 int alignment = 0;
2262
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)
2266 {
2267 bitFields += dataMember->dataType->bitFieldCount;
2268 size = 0;
2269 }
2270 else
2271 {
2272 if(bitFields)
2273 {
2274 int size = (bitFields + 7) / 8;
2275
2276 if(isMember)
2277 {
2278 int __simpleStruct0;
2279
2280 if(alignment)
2281 {
2282 int __simpleStruct0;
2283
2284 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2285 if(member->memberOffset % alignment)
2286 member->memberOffset += alignment - (member->memberOffset % alignment);
2287 }
2288 dataMember->offset = member->memberOffset;
2289 if(member->type == 1)
2290 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2291 else
2292 {
2293 member->memberOffset += size;
2294 }
2295 }
2296 else
2297 {
2298 if(alignment)
2299 {
2300 int __simpleStruct0;
2301
2302 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2303 if(_class->memberOffset % alignment)
2304 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2305 }
2306 dataMember->offset = _class->memberOffset;
2307 _class->memberOffset += size;
2308 }
2309 bitFields = 0;
2310 }
2311 size = dataMember->dataType->size;
2312 alignment = dataMember->dataType->alignment;
2313 }
2314 if(isMember)
2315 {
2316 int __simpleStruct0;
2317
2318 if(alignment)
2319 {
2320 int __simpleStruct0;
2321
2322 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2323 if(member->memberOffset % alignment)
2324 member->memberOffset += alignment - (member->memberOffset % alignment);
2325 }
2326 dataMember->offset = member->memberOffset;
2327 if(member->type == 1)
2328 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2329 else
2330 {
2331 member->memberOffset += size;
2332 }
2333 }
2334 else
2335 {
2336 if(alignment)
2337 {
2338 int __simpleStruct0;
2339
2340 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2341 if(_class->memberOffset % alignment)
2342 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2343 }
2344 dataMember->offset = _class->memberOffset;
2345 _class->memberOffset += size;
2346 }
2347 }
2348 else
2349 {
2350 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2351 if(isMember)
2352 {
2353 int __simpleStruct2;
2354 int __simpleStruct0, __simpleStruct1;
2355
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);
2360 else
2361 member->memberOffset += dataMember->memberOffset;
2362 }
2363 else
2364 {
2365 int __simpleStruct0, __simpleStruct1;
2366
2367 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2368 dataMember->offset = _class->memberOffset;
2369 _class->memberOffset += dataMember->memberOffset;
2370 }
2371 }
2372 }
2373 }
2374 if(bitFields)
2375 {
2376 int alignment = 0;
2377 int size = (bitFields + 7) / 8;
2378
2379 if(isMember)
2380 {
2381 int __simpleStruct0;
2382
2383 if(alignment)
2384 {
2385 int __simpleStruct0;
2386
2387 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2388 if(member->memberOffset % alignment)
2389 member->memberOffset += alignment - (member->memberOffset % alignment);
2390 }
2391 if(member->type == 1)
2392 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2393 else
2394 {
2395 member->memberOffset += size;
2396 }
2397 }
2398 else
2399 {
2400 if(alignment)
2401 {
2402 int __simpleStruct0;
2403
2404 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2405 if(_class->memberOffset % alignment)
2406 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2407 }
2408 _class->memberOffset += size;
2409 }
2410 bitFields = 0;
2411 }
2412 }
2413 if(member && member->type == 1)
2414 {
2415 member->memberOffset = unionMemberOffset;
2416 }
2417 if(!isMember)
2418 {
2419 if(_class->type != 2)
2420 {
2421 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2422 if(!member)
2423 {
2424 struct __ecereNameSpace__ecere__com__Property * prop;
2425
2426 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2427 {
2428 if(prop->isProperty && prop->isWatchable)
2429 {
2430 prop->watcherOffset = _class->structSize;
2431 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2432 }
2433 }
2434 }
2435 {
2436 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2437
2438 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2439 {
2440 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2441
2442 if(deriv->computeSize)
2443 {
2444 deriv->offset = _class->structSize;
2445 deriv->memberOffset = 0;
2446 deriv->structSize = deriv->offset;
2447 ComputeClassMembers(deriv, 0x0);
2448 }
2449 }
2450 }
2451 }
2452 }
2453 }
2454 if(context)
2455 FinishTemplatesContext(context);
2456 }
2457
2458 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2459
2460 struct __ecereNameSpace__ecere__com__NameSpace
2461 {
2462 char *  name;
2463 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2464 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2465 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2466 int depth;
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));
2473
2474 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2475
2476 struct __ecereNameSpace__ecere__com__Module
2477 {
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;
2485 char *  name;
2486 void *  library;
2487 void *  Unload;
2488 int importType;
2489 int origImportType;
2490 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2491 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2492 } __attribute__ ((gcc_struct));
2493
2494 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2495 {
2496 struct __ecereNameSpace__ecere__com__Class * _class;
2497 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2498
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);
2503 }
2504
2505 extern unsigned int inCompiler;
2506
2507 extern void Compiler_Error(char *  format, ...);
2508
2509 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2510
2511 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2512
2513 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2514
2515 int ComputeTypeSize(struct Type * type)
2516 {
2517 unsigned int size = type ? type->size : 0;
2518
2519 if(!size && type && !type->computing)
2520 {
2521 type->computing = 0x1;
2522 switch(type->kind)
2523 {
2524 case 1:
2525 type->alignment = size = sizeof(char);
2526 break;
2527 case 3:
2528 type->alignment = size = sizeof(int);
2529 break;
2530 case 4:
2531 type->alignment = size = sizeof(long long);
2532 break;
2533 case 22:
2534 type->alignment = size = sizeof(intptr_t);
2535 break;
2536 case 5:
2537 type->alignment = size = sizeof(long);
2538 break;
2539 case 2:
2540 type->alignment = size = sizeof(short);
2541 break;
2542 case 6:
2543 type->alignment = size = sizeof(float);
2544 break;
2545 case 7:
2546 type->alignment = size = sizeof(double);
2547 break;
2548 case 8:
2549 {
2550 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2551
2552 if(_class && _class->type == 1)
2553 {
2554 ComputeClassMembers(_class, 0x0);
2555 type->alignment = _class->structAlignment;
2556 size = _class->structSize;
2557 if(type->alignment && size % type->alignment)
2558 size += type->alignment - (size % type->alignment);
2559 }
2560 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2561 {
2562 if(!_class->dataType)
2563 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2564 size = type->alignment = ComputeTypeSize(_class->dataType);
2565 }
2566 else
2567 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2568 break;
2569 }
2570 case 13:
2571 case 19:
2572 size = type->alignment = sizeof(void *);
2573 break;
2574 case 12:
2575 if(type->arraySizeExp)
2576 {
2577 ProcessExpressionType(type->arraySizeExp);
2578 ComputeExpression(type->arraySizeExp);
2579 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2580 {
2581 struct Location oldLoc = yylloc;
2582 char expression[10240];
2583
2584 expression[0] = '\0';
2585 type->arraySizeExp->expType = (((void *)0));
2586 yylloc = type->arraySizeExp->loc;
2587 if(inCompiler)
2588 PrintExpression(type->arraySizeExp, expression);
2589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2590 yylloc = oldLoc;
2591 }
2592 GetInt(type->arraySizeExp, &type->arraySize);
2593 }
2594 else if(type->enumClass)
2595 {
2596 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2597 {
2598 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2599 }
2600 else
2601 type->arraySize = 0;
2602 }
2603 else
2604 {
2605 type->arraySize = 0;
2606 }
2607 size = ComputeTypeSize(type->type) * type->arraySize;
2608 type->alignment = type->type->alignment;
2609 break;
2610 case 9:
2611 {
2612 struct Type * member;
2613
2614 for(member = type->members.first; member; member = member->next)
2615 {
2616 int __simpleStruct0, __simpleStruct1;
2617 unsigned int addSize = ComputeTypeSize(member);
2618
2619 member->offset = size;
2620 if(member->alignment && size % member->alignment)
2621 member->offset += member->alignment - (size % member->alignment);
2622 size = member->offset;
2623 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2624 size += addSize;
2625 }
2626 if(type->alignment && size % type->alignment)
2627 size += type->alignment - (size % type->alignment);
2628 break;
2629 }
2630 case 10:
2631 {
2632 struct Type * member;
2633
2634 for(member = type->members.first; member; member = member->next)
2635 {
2636 int __simpleStruct0, __simpleStruct1;
2637 unsigned int addSize = ComputeTypeSize(member);
2638
2639 member->offset = size;
2640 if(member->alignment && size % member->alignment)
2641 member->offset += member->alignment - (size % member->alignment);
2642 size = member->offset;
2643 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2644 size = ((size > addSize) ? size : addSize);
2645 }
2646 if(type->alignment && size % type->alignment)
2647 size += type->alignment - (size % type->alignment);
2648 break;
2649 }
2650 case 20:
2651 {
2652 struct TemplateParameter * param = type->templateParameter;
2653 struct Type * baseType = ProcessTemplateParameterType(param);
2654
2655 if(baseType)
2656 size = ComputeTypeSize(baseType);
2657 else
2658 size = sizeof(uint64);
2659 break;
2660 }
2661 case 15:
2662 {
2663 size = sizeof(enum
2664 {
2665 test
2666 });
2667 break;
2668 }
2669 case 21:
2670 {
2671 size = sizeof(void *);
2672 break;
2673 }
2674 }
2675 type->size = size;
2676 type->computing = 0x0;
2677 }
2678 return size;
2679 }
2680
2681 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2682
2683 extern struct Identifier * MkIdentifier(char *  string);
2684
2685 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2686
2687 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2688
2689 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2690
2691 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2692
2693 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2694
2695 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2696
2697 extern void FreeType(struct Type * type);
2698
2699 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2700
2701 extern struct Specifier * MkSpecifier(int specifier);
2702
2703 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2704
2705 extern struct Expression * MkExpConstant(char *  string);
2706
2707 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass)
2708 {
2709 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2710 unsigned int totalSize = 0;
2711 unsigned int maxSize = 0;
2712 int alignment, size;
2713 struct __ecereNameSpace__ecere__com__DataMember * member;
2714 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2715
2716 if(!isMember && _class->base)
2717 {
2718 maxSize = _class->structSize;
2719 {
2720 if(_class->type == 1 || _class->type == 5)
2721 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2722 else
2723 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2724 }
2725 }
2726 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2727 {
2728 if(!member->isProperty)
2729 {
2730 switch(member->type)
2731 {
2732 case 0:
2733 {
2734 if(member->dataTypeString)
2735 {
2736 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2737 struct Declarator * decl;
2738
2739 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2740 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2741 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2742 if(!member->dataType)
2743 member->dataType = ProcessType(specs, decl);
2744 ReplaceThisClassSpecifiers(specs, topClass);
2745 {
2746 struct Type * type = ProcessType(specs, decl);
2747
2748 DeclareType(member->dataType, 0x0, 0x0);
2749 FreeType(type);
2750 }
2751 ComputeTypeSize(member->dataType);
2752 size = member->dataType->size;
2753 alignment = member->dataType->alignment;
2754 if(alignment)
2755 {
2756 if(totalSize % alignment)
2757 totalSize += alignment - (totalSize % alignment);
2758 }
2759 totalSize += size;
2760 }
2761 break;
2762 }
2763 case 1:
2764 case 2:
2765 {
2766 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2767
2768 size = 0;
2769 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2770 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2771 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2772 alignment = member->structAlignment;
2773 if(alignment)
2774 {
2775 if(totalSize % alignment)
2776 totalSize += alignment - (totalSize % alignment);
2777 }
2778 totalSize += size;
2779 break;
2780 }
2781 }
2782 }
2783 }
2784 if(retSize)
2785 {
2786 unsigned int __simpleStruct0;
2787
2788 if(topMember && topMember->type == 1)
2789 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2790 else
2791 *retSize += totalSize;
2792 }
2793 else if(totalSize < maxSize && _class->type != 1000)
2794 {
2795 char sizeString[50];
2796
2797 sprintf(sizeString, "%d", maxSize - totalSize);
2798 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2799 }
2800 if(context)
2801 FinishTemplatesContext(context);
2802 return topMember ? topMember->memberID : _class->memberID;
2803 }
2804
2805 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2806 {
2807 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2808 unsigned int totalSize = 0;
2809 struct __ecereNameSpace__ecere__com__DataMember * member;
2810 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2811
2812 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2813 DeclareMembers(_class->base, 0x0);
2814 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2815 {
2816 if(!member->isProperty)
2817 {
2818 switch(member->type)
2819 {
2820 case 0:
2821 {
2822 if(!member->dataType && member->dataTypeString)
2823 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2824 if(member->dataType)
2825 DeclareType(member->dataType, 0x0, 0x0);
2826 break;
2827 }
2828 case 1:
2829 case 2:
2830 {
2831 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2832 break;
2833 }
2834 }
2835 }
2836 }
2837 if(context)
2838 FinishTemplatesContext(context);
2839 return topMember ? topMember->memberID : _class->memberID;
2840 }
2841
2842 extern struct Symbol * FindClass(char *  name);
2843
2844 extern char *  strchr(char * , int);
2845
2846 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2847
2848 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2849
2850 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2851
2852 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2853
2854 extern char *  strcpy(char * , const char * );
2855
2856 extern void MangleClassName(char *  className);
2857
2858 extern void DeclareClass(struct Symbol * classSym, char *  className);
2859
2860 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2861
2862 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2863
2864 void DeclareStruct(char * name, unsigned int skipNoHead)
2865 {
2866 struct External * external = (((void *)0));
2867 struct Symbol * classSym = FindClass(name);
2868
2869 if(!inCompiler || !classSym)
2870 return (((void *)0));
2871 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2872 return (((void *)0));
2873 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2874 {
2875 struct Declaration * decl;
2876 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2877 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2878 char structName[1024];
2879
2880 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2881 classSym->declaring++;
2882 if(strchr(classSym->string, '<'))
2883 {
2884 if(classSym->registered->templateClass)
2885 {
2886 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2887 classSym->declaring--;
2888 }
2889 return (((void *)0));
2890 }
2891 DeclareMembers(classSym->registered, 0x0);
2892 structName[0] = (char)0;
2893 FullClassNameCat(structName, name, 0x0);
2894 if(!skipNoHead)
2895 {
2896 classSym->declaredStructSym = 0x1;
2897 declarations = MkList();
2898 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2899 if(!(*declarations).count)
2900 {
2901 FreeList(declarations, (((void *)0)));
2902 declarations = (((void *)0));
2903 }
2904 }
2905 if(skipNoHead || declarations)
2906 {
2907 if(external && external->declaration)
2908 {
2909 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2910 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2911 {
2912 if(classSym->structExternal)
2913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2915 classSym->id = curExternal->symbol->idCode;
2916 classSym->idCode = curExternal->symbol->idCode;
2917 }
2918 }
2919 else
2920 {
2921 if(!external)
2922 external = MkExternalDeclaration((((void *)0)));
2923 specifiers = MkList();
2924 declarators = MkList();
2925 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2926 external->declaration = decl = MkDeclaration(specifiers, declarators);
2927 if(decl->symbol && !decl->symbol->pointerExternal)
2928 decl->symbol->pointerExternal = external;
2929 if(classSym->registered && classSym->registered->type == 1)
2930 {
2931 char className[1024];
2932
2933 strcpy(className, "__ecereClass_");
2934 FullClassNameCat(className, classSym->string, 0x1);
2935 MangleClassName(className);
2936 DeclareClass(classSym, className);
2937 external->symbol = classSym;
2938 classSym->pointerExternal = external;
2939 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2940 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2941 }
2942 else
2943 {
2944 char className[1024];
2945
2946 strcpy(className, "__ecereClass_");
2947 FullClassNameCat(className, classSym->string, 0x1);
2948 MangleClassName(className);
2949 classSym->structExternal = external;
2950 DeclareClass(classSym, className);
2951 external->symbol = classSym;
2952 }
2953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2954 }
2955 }
2956 classSym->declaring--;
2957 }
2958 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2959 {
2960 classSym->declaring++;
2961 {
2962 if(classSym->registered)
2963 DeclareMembers(classSym->registered, 0x0);
2964 }
2965 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2966 {
2967 if(classSym->structExternal)
2968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2970 classSym->id = curExternal->symbol->idCode;
2971 classSym->idCode = curExternal->symbol->idCode;
2972 }
2973 classSym->declaring--;
2974 }
2975 }
2976
2977 extern char *  strcat(char * , const char * );
2978
2979 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2980
2981 extern struct ModuleImport * mainModule;
2982
2983 extern struct Specifier * MkSpecifierName(char *  name);
2984
2985 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2986
2987 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2988
2989 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2990
2991 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2992
2993 extern void FreeDeclarator(struct Declarator * decl);
2994
2995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2996
2997 struct PropertyImport
2998 {
2999 struct PropertyImport * prev;
3000 struct PropertyImport * next;
3001 char *  name;
3002 unsigned int isVirtual;
3003 unsigned int hasSet;
3004 unsigned int hasGet;
3005 } __attribute__ ((gcc_struct));
3006
3007 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3008
3009 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3010 {
3011 void * __ecereTemp1;
3012 struct Symbol * symbol = prop->symbol;
3013 char propName[1024];
3014
3015 strcpy(setName, "__ecereProp_");
3016 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3017 strcat(setName, "_Set_");
3018 FullClassNameCat(setName, prop->name, 0x1);
3019 strcpy(getName, "__ecereProp_");
3020 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3021 strcat(getName, "_Get_");
3022 FullClassNameCat(getName, prop->name, 0x1);
3023 strcpy(propName, "__ecereProp_");
3024 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3025 strcat(propName, "_");
3026 FullClassNameCat(propName, prop->name, 0x1);
3027 MangleClassName(getName);
3028 MangleClassName(setName);
3029 MangleClassName(propName);
3030 if(prop->_class->type == 1)
3031 DeclareStruct(prop->_class->fullName, 0x0);
3032 if(!symbol || curExternal->symbol->idCode < symbol->id)
3033 {
3034 unsigned int imported = 0x0;
3035 unsigned int dllImport = 0x0;
3036
3037 if(!symbol || symbol->_import)
3038 {
3039 if(!symbol)
3040 {
3041 struct Symbol * classSym;
3042
3043 if(!prop->_class->symbol)
3044 prop->_class->symbol = FindClass(prop->_class->fullName);
3045 classSym = prop->_class->symbol;
3046 if(classSym && !classSym->_import)
3047 {
3048 struct ModuleImport * module;
3049
3050 if(prop->_class->module)
3051 module = FindModule(prop->_class->module);
3052 else
3053 module = mainModule;
3054 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3056 }
3057 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3058 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
3059 if(classSym)
3060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3061 }
3062 imported = 0x1;
3063 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3064 dllImport = 0x1;
3065 }
3066 if(!symbol->type)
3067 {
3068 struct Context * context = SetupTemplatesContext(prop->_class);
3069
3070 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3071 FinishTemplatesContext(context);
3072 }
3073 if(prop->Get)
3074 {
3075 if(!symbol->externalGet || symbol->externalGet->type == 0)
3076 {
3077 struct Declaration * decl;
3078 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3079 struct Declarator * d;
3080 struct __ecereNameSpace__ecere__sys__OldList * params;
3081 struct Specifier * spec;
3082 struct External * external;
3083 struct Declarator * typeDecl;
3084 unsigned int simple = 0x0;
3085
3086 specifiers = MkList();
3087 declarators = MkList();
3088 params = MkList();
3089 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3090 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3091 if(dllImport)
3092 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3093 {
3094 struct Context * context = SetupTemplatesContext(prop->_class);
3095
3096 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3097 FinishTemplatesContext(context);
3098 }
3099 for(spec = (*specifiers).first; spec; spec = spec->next)
3100 {
3101 if(spec->type == 1)
3102 {
3103 if((!typeDecl || typeDecl->type == 1))
3104 {
3105 struct Symbol * classSym = spec->symbol;
3106
3107 symbol->_class = classSym->registered;
3108 if(classSym->registered && classSym->registered->type == 1)
3109 {
3110 DeclareStruct(spec->name, 0x0);
3111 simple = 0x1;
3112 }
3113 }
3114 }
3115 }
3116 if(!simple)
3117 d = PlugDeclarator(typeDecl, d);
3118 else
3119 {
3120 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3121 specifiers = MkList();
3122 }
3123 d = MkDeclaratorFunction(d, params);
3124 if(dllImport)
3125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3126 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3128 if(simple)
3129 ListAdd(specifiers, MkSpecifier(VOID));
3130 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3131 decl = MkDeclaration(specifiers, declarators);
3132 external = MkExternalDeclaration(decl);
3133 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3134 external->symbol = symbol;
3135 symbol->externalGet = external;
3136 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3137 if(typeDecl)
3138 FreeDeclarator(typeDecl);
3139 }
3140 else
3141 {
3142 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3143 }
3144 }
3145 if(prop->Set)
3146 {
3147 if(!symbol->externalSet || symbol->externalSet->type == 0)
3148 {
3149 struct Declaration * decl;
3150 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3151 struct Declarator * d;
3152 struct __ecereNameSpace__ecere__sys__OldList * params;
3153 struct Specifier * spec;
3154 struct External * external;
3155 struct Declarator * typeDecl;
3156
3157 declarators = MkList();
3158 params = MkList();
3159 if(!prop->conversion || prop->_class->type == 1)
3160 {
3161 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3162 }
3163 specifiers = MkList();
3164 {
3165 struct Context * context = SetupTemplatesContext(prop->_class);
3166
3167 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3168 FinishTemplatesContext(context);
3169 }
3170 ListAdd(params, MkTypeName(specifiers, d));
3171 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3172 if(dllImport)
3173 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3174 d = MkDeclaratorFunction(d, params);
3175 for(spec = (*specifiers).first; spec; spec = spec->next)
3176 {
3177 if(spec->type == 1)
3178 {
3179 if((!typeDecl || typeDecl->type == 1))
3180 {
3181 struct Symbol * classSym = spec->symbol;
3182
3183 symbol->_class = classSym->registered;
3184 if(classSym->registered && classSym->registered->type == 1)
3185 DeclareStruct(spec->name, 0x0);
3186 }
3187 }
3188 }
3189 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3190 specifiers = MkList();
3191 if(dllImport)
3192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3193 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3195 if(!prop->conversion || prop->_class->type == 1)
3196 ListAdd(specifiers, MkSpecifier(VOID));
3197 else
3198 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3199 decl = MkDeclaration(specifiers, declarators);
3200 external = MkExternalDeclaration(decl);
3201 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3202 external->symbol = symbol;
3203 symbol->externalSet = external;
3204 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3205 }
3206 else
3207 {
3208 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3209 }
3210 }
3211 if(!symbol->externalPtr)
3212 {
3213 struct Declaration * decl;
3214 struct External * external;
3215 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3216
3217 if(imported)
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3219 else
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3221 ListAdd(specifiers, MkSpecifierName("Property"));
3222 {
3223 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3224
3225 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3226 if(!imported)
3227 {
3228 strcpy(propName, "__ecerePropM_");
3229 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3230 strcat(propName, "_");
3231 FullClassNameCat(propName, prop->name, 0x1);
3232 MangleClassName(propName);
3233 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3234 }
3235 decl = MkDeclaration(specifiers, list);
3236 }
3237 external = MkExternalDeclaration(decl);
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3239 external->symbol = symbol;
3240 symbol->externalPtr = external;
3241 }
3242 else
3243 {
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3245 }
3246 symbol->id = curExternal->symbol->idCode;
3247 }
3248 }
3249
3250 struct Type * Dereference(struct Type * source)
3251 {
3252 void * __ecereTemp1;
3253 struct Type * type = (((void *)0));
3254
3255 if(source)
3256 {
3257 if(source->kind == 13 || source->kind == 12)
3258 {
3259 type = source->type;
3260 source->type->refCount++;
3261 }
3262 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3263 {
3264 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3265 }
3266 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3267 {
3268 type = source;
3269 source->refCount++;
3270 }
3271 else
3272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3273 }
3274 return type;
3275 }
3276
3277 static struct Type * Reference(struct Type * source)
3278 {
3279 void * __ecereTemp1;
3280 struct Type * type = (((void *)0));
3281
3282 if(source)
3283 {
3284 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3285 source->refCount++;
3286 }
3287 return type;
3288 }
3289
3290 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
3291
3292 extern void *  memcpy(void * , const void * , unsigned int size);
3293
3294 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3295
3296 extern void FreeExpression(struct Expression * exp);
3297
3298 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3299
3300 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration);
3301
3302 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3303
3304 extern struct Type * MkClassType(char *  name);
3305
3306 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, unsigned int size, unsigned int alignment, int declMode);
3307
3308 void ProcessMemberInitData(struct MemberInit * member, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
3309 {
3310 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3311 unsigned int found = 0x0;
3312 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3313 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3314 unsigned int freeType = 0x0;
3315
3316 yylloc = member->loc;
3317 if(!ident)
3318 {
3319 if(curMember)
3320 {
3321 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3322 if(*curMember)
3323 {
3324 found = 0x1;
3325 dataMember = *curMember;
3326 }
3327 }
3328 }
3329 else
3330 {
3331 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3332 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3333 int _subMemberStackPos = 0;
3334
3335 if(!thisMember)
3336 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3337 if(thisMember)
3338 {
3339 dataMember = thisMember;
3340 if(curMember && thisMember->memberAccess == 1)
3341 {
3342 *curMember = thisMember;
3343 *curClass = thisMember->_class;
3344 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3345 *subMemberStackPos = _subMemberStackPos;
3346 }
3347 found = 0x1;
3348 }
3349 else
3350 {
3351 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3352 if(method && method->type == 1)
3353 found = 0x1;
3354 else
3355 method = (((void *)0));
3356 }
3357 }
3358 if(found)
3359 {
3360 struct Type * type = (((void *)0));
3361
3362 if(dataMember)
3363 {
3364 if(!dataMember->dataType && dataMember->dataTypeString)
3365 {
3366 struct Context * context = SetupTemplatesContext(_class);
3367
3368 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3369 FinishTemplatesContext(context);
3370 }
3371 type = dataMember->dataType;
3372 }
3373 else if(method)
3374 {
3375 if(!method->dataType)
3376 ProcessMethodType(method);
3377 type = method->dataType;
3378 }
3379 if(ident && ident->next)
3380 {
3381 for(ident = ident->next; ident && type; ident = ident->next)
3382 {
3383 if(type->kind == 8)
3384 {
3385 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3386 if(!dataMember)
3387 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3388 if(dataMember)
3389 type = dataMember->dataType;
3390 }
3391 else if(type->kind == 9 || type->kind == 10)
3392 {
3393 struct Type * memberType;
3394
3395 for(memberType = type->members.first; memberType; memberType = memberType->next)
3396 {
3397 if(!strcmp(memberType->name, ident->string))
3398 {
3399 type = memberType;
3400 break;
3401 }
3402 }
3403 }
3404 }
3405 }
3406 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3407 {
3408 int id = 0;
3409 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3410 struct __ecereNameSpace__ecere__com__Class * sClass;
3411
3412 for(sClass = _class; sClass; sClass = sClass->base)
3413 {
3414 id = 0;
3415 if(sClass->templateClass)
3416 sClass = sClass->templateClass;
3417 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3418 {
3419 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3420 {
3421 for(sClass = sClass->base; sClass; sClass = sClass->base)
3422 {
3423 if(sClass->templateClass)
3424 sClass = sClass->templateClass;
3425 id += sClass->templateParams.count;
3426 }
3427 break;
3428 }
3429 id++;
3430 }
3431 if(curParam)
3432 break;
3433 }
3434 if(curParam)
3435 {
3436 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3437
3438 if(arg.dataTypeString)
3439 {
3440 type = ProcessTypeString(arg.dataTypeString, 0x0);
3441 freeType = 0x1;
3442 if(type && _class->templateClass)
3443 type->passAsTemplate = 0x1;
3444 if(type)
3445 {
3446 }
3447 }
3448 }
3449 }
3450 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3451 {
3452 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3453 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3454 int c;
3455 int paramCount = 0;
3456 int lastParam = -1;
3457 char templateString[1024];
3458 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3459
3460 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3461 for(cClass = expClass; cClass; cClass = cClass->base)
3462 {
3463 int p = 0;
3464
3465 if(cClass->templateClass)
3466 cClass = cClass->templateClass;
3467 for(param = cClass->templateParams.first; param; param = param->next)
3468 {
3469 int id = p;
3470 struct __ecereNameSpace__ecere__com__Class * sClass;
3471 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3472
3473 for(sClass = cClass->base; sClass; sClass = sClass->base)
3474 {
3475 if(sClass->templateClass)
3476 sClass = sClass->templateClass;
3477 id += sClass->templateParams.count;
3478 }
3479 arg = expClass->templateArgs[id];
3480 for(sClass = _class; sClass; sClass = sClass->base)
3481 {
3482 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3483 int p = 0;
3484 struct __ecereNameSpace__ecere__com__Class * nextClass;
3485
3486 if(sClass->templateClass)
3487 sClass = sClass->templateClass;
3488 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3489 {
3490 if(nextClass->templateClass)
3491 nextClass = nextClass->templateClass;
3492 p += nextClass->templateParams.count;
3493 }
3494 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3495 {
3496 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3497 {
3498 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3499 {
3500 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3501 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3502 break;
3503 }
3504 }
3505 }
3506 }
3507 {
3508 char argument[256];
3509
3510 argument[0] = '\0';
3511 switch(param->type)
3512 {
3513 case 2:
3514 {
3515 char expString[1024];
3516 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3517 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3518 struct Expression * exp;
3519 char * string = PrintHexUInt64(arg.expression.ui64);
3520
3521 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3522 ProcessExpressionType(exp);
3523 ComputeExpression(exp);
3524 expString[0] = '\0';
3525 PrintExpression(exp, expString);
3526 strcat(argument, expString);
3527 FreeExpression(exp);
3528 break;
3529 }
3530 case 1:
3531 {
3532 strcat(argument, arg.member->name);
3533 break;
3534 }
3535 case 0:
3536 {
3537 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3538 strcat(argument, arg.dataTypeString);
3539 break;
3540 }
3541 }
3542 if(argument[0])
3543 {
3544 if(paramCount)
3545 strcat(templateString, ", ");
3546 if(lastParam != p - 1)
3547 {
3548 strcat(templateString, param->name);
3549 strcat(templateString, " = ");
3550 }
3551 strcat(templateString, argument);
3552 paramCount++;
3553 lastParam = p;
3554 }
3555 p++;
3556 }
3557 }
3558 }
3559 {
3560 int len = strlen(templateString);
3561
3562 if(templateString[len - 1] == '<')
3563 len--;
3564 else
3565 {
3566 if(templateString[len - 1] == '>')
3567 templateString[len++] = ' ';
3568 templateString[len++] = '>';
3569 }
3570 templateString[len++] = '\0';
3571 }
3572 {
3573 struct Context * context = SetupTemplatesContext(_class);
3574
3575 if(freeType)
3576 FreeType(type);
3577 type = ProcessTypeString(templateString, 0x0);
3578 freeType = 0x1;
3579 FinishTemplatesContext(context);
3580 }
3581 }
3582 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3583 {
3584 ProcessExpressionType(member->initializer->exp);
3585 if(!member->initializer->exp->expType)
3586 {
3587 if(inCompiler)
3588 {
3589 char expString[10240];
3590
3591 expString[0] = '\0';
3592 PrintExpression(member->initializer->exp, expString);
3593 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3595 }
3596 }
3597 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3598 {
3599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3600 }
3601 }
3602 else if(member->initializer)
3603 {
3604 ProcessInitializer(member->initializer, type);
3605 }
3606 if(freeType)
3607 FreeType(type);
3608 }
3609 else
3610 {
3611 if(_class && _class->type == 3)
3612 {
3613 if(member->initializer)
3614 {
3615 struct Type * type = MkClassType(_class->fullName);
3616
3617 ProcessInitializer(member->initializer, type);
3618 FreeType(type);
3619 }
3620 }
3621 else
3622 {
3623 if(member->initializer)
3624 {
3625 ProcessInitializer(member->initializer, (((void *)0)));
3626 }
3627 if(ident)
3628 {
3629 if(method)
3630 {
3631 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3632 }
3633 else if(_class)
3634 {
3635 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3636 if(inCompiler)
3637 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3638 }
3639 }
3640 else if(_class)
3641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3642 }
3643 }
3644 }
3645
3646 extern struct Identifier * GetDeclId(struct Declarator * decl);
3647
3648 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
3649
3650 extern void FreeSpecifier(struct Specifier * spec);
3651
3652 static void ProcessFunction(struct FunctionDefinition * function);
3653
3654 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3655
3656 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3657
3658 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3659
3660 extern void FreeClassFunction(struct ClassFunction * func);
3661
3662 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3663
3664 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3665
3666 void ProcessInstantiationType(struct Instantiation * inst)
3667 {
3668 yylloc = inst->loc;
3669 if(inst->_class)
3670 {
3671 struct MembersInit * members;
3672 struct Symbol * classSym;
3673 struct __ecereNameSpace__ecere__com__Class * _class;
3674
3675 classSym = inst->_class->symbol;
3676 _class = classSym ? classSym->registered : (((void *)0));
3677 if(!_class || _class->type != 5)
3678 DeclareStruct(inst->_class->name, 0x0);
3679 afterExternal = afterExternal ? afterExternal : curExternal;
3680 if(inst->exp)
3681 ProcessExpressionType(inst->exp);
3682 inst->isConstant = 0x1;
3683 if(inst->members)
3684 {
3685 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3686 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3687 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3688 int subMemberStackPos = 0;
3689
3690 for(members = (*inst->members).first; members; members = members->next)
3691 {
3692 switch(members->type)
3693 {
3694 case 1:
3695 {
3696 char name[1024];
3697 static unsigned int instMethodID = 0;
3698 struct External * external = curExternal;
3699 struct Context * context = curContext;
3700 struct Declarator * declarator = members->function->declarator;
3701 struct Identifier * nameID = GetDeclId(declarator);
3702 char * unmangled = nameID ? nameID->string : (((void *)0));
3703 struct Expression * exp;
3704 struct External * createdExternal = (((void *)0));
3705
3706 if(inCompiler)
3707 {
3708 char number[16];
3709
3710 strcpy(name, "__ecereInstMeth_");
3711 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3712 strcat(name, "_");
3713 strcat(name, nameID->string);
3714 strcat(name, "_");
3715 sprintf(number, "_%08d", instMethodID++);
3716 strcat(name, number);
3717 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3718 }
3719 if(declarator)
3720 {
3721 struct Symbol * symbol = declarator->symbol;
3722 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3723
3724 if(method && method->type == 1)
3725 {
3726 symbol->method = method;
3727 ProcessMethodType(method);
3728 if(!symbol->type->thisClass)
3729 {
3730 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3731 {
3732 if(!currentClass->symbol)
3733 currentClass->symbol = FindClass(currentClass->fullName);
3734 symbol->type->thisClass = currentClass->symbol;
3735 }
3736 else
3737 {
3738 if(!_class->symbol)
3739 _class->symbol = FindClass(_class->fullName);
3740 symbol->type->thisClass = _class->symbol;
3741 }
3742 }
3743 DeclareType(symbol->type, 0x1, 0x1);
3744 }
3745 else if(classSym)
3746 {
3747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3748 }
3749 }
3750 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3751 if(nameID)
3752 {
3753 FreeSpecifier(nameID->_class);
3754 nameID->_class = (((void *)0));
3755 }
3756 if(inCompiler)
3757 {
3758 struct Type * type = declarator->symbol->type;
3759 struct External * oldExternal = curExternal;
3760
3761 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3762 {
3763 struct External * externalDecl;
3764
3765 externalDecl = MkExternalDeclaration((((void *)0)));
3766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3767 if(createdExternal->function)
3768 {
3769 ProcessFunction(createdExternal->function);
3770 {
3771 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3772
3773 externalDecl->declaration = decl;
3774 if(decl->symbol && !decl->symbol->pointerExternal)
3775 decl->symbol->pointerExternal = externalDecl;
3776 declarator->symbol->pointerExternal = externalDecl;
3777 }
3778 }
3779 }
3780 }
3781 else if(declarator)
3782 {
3783 curExternal = declarator->symbol->pointerExternal;
3784 ProcessFunction((struct FunctionDefinition *)members->function);
3785 }
3786 curExternal = external;
3787 curContext = context;
3788 if(inCompiler)
3789 {
3790 FreeClassFunction(members->function);
3791 exp = QMkExpId(name);
3792 members->type = 0;
3793 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3794 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3795 }
3796 break;
3797 }
3798 case 0:
3799 {
3800 if(members->dataMembers && classSym)
3801 {
3802 struct MemberInit * member;
3803 struct Location oldyyloc = yylloc;
3804
3805 for(member = (*members->dataMembers).first; member; member = member->next)
3806 {
3807 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3808 if(member->initializer && !member->initializer->isConstant)
3809 inst->isConstant = 0x0;
3810 }
3811 yylloc = oldyyloc;
3812 }
3813 break;
3814 }
3815 }
3816 }
3817 }
3818 }
3819 }
3820
3821 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3822 {
3823 if(inCompiler)
3824 {
3825 if(type->kind == 11)
3826 {
3827 struct Type * param;
3828
3829 if(declareParams)
3830 {
3831 for(param = type->params.first; param; param = param->next)
3832 DeclareType(param, declarePointers, 0x1);
3833 }
3834 DeclareType(type->returnType, declarePointers, 0x1);
3835 }
3836 else if(type->kind == 13 && declarePointers)
3837 DeclareType(type->type, declarePointers, 0x0);
3838 else if(type->kind == 8)
3839 {
3840 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3841 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3842 }
3843 else if(type->kind == 9 || type->kind == 10)
3844 {
3845 struct Type * member;
3846
3847 for(member = type->members.first; member; member = member->next)
3848 DeclareType(member, 0x0, 0x0);
3849 }
3850 else if(type->kind == 12)
3851 DeclareType(type->arrayType, declarePointers, 0x0);
3852 }
3853 }
3854
3855 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3856
3857 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3858 {
3859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3860 int id = 0;
3861 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3862 struct __ecereNameSpace__ecere__com__Class * sClass;
3863
3864 for(sClass = _class; sClass; sClass = sClass->base)
3865 {
3866 id = 0;
3867 if(sClass->templateClass)
3868 sClass = sClass->templateClass;
3869 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3870 {
3871 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3872 {
3873 for(sClass = sClass->base; sClass; sClass = sClass->base)
3874 {
3875 if(sClass->templateClass)
3876 sClass = sClass->templateClass;
3877 id += sClass->templateParams.count;
3878 }
3879 break;
3880 }
3881 id++;
3882 }
3883 if(curParam)
3884 break;
3885 }
3886 if(curParam)
3887 {
3888 arg = &_class->templateArgs[id];
3889 if(arg && param->type == 0)
3890 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3891 }
3892 return arg;
3893 }
3894
3895 extern struct Context * PushContext(void);
3896
3897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3898
3899 struct TemplatedType
3900 {
3901 uintptr_t key;
3902 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3903 struct __ecereNameSpace__ecere__sys__BTNode * left;
3904 struct __ecereNameSpace__ecere__sys__BTNode * right;
3905 int depth;
3906 struct TemplateParameter * param;
3907 } __attribute__ ((gcc_struct));
3908
3909 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3910
3911 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3912 {
3913 void * __ecereTemp1;
3914 struct Context * context = PushContext();
3915
3916 context->templateTypesOnly = 0x1;
3917 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3918 {
3919 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3920
3921 for(; param; param = param->next)
3922 {
3923 if(param->type == 0 && param->identifier)
3924 {
3925 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3926
3927 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3928 }
3929 }
3930 }
3931 else if(_class)
3932 {
3933 struct __ecereNameSpace__ecere__com__Class * sClass;
3934
3935 for(sClass = _class; sClass; sClass = sClass->base)
3936 {
3937 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3938
3939 for(p = sClass->templateParams.first; p; p = p->next)
3940 {
3941 if(p->type == 0)
3942 {
3943 struct TemplateParameter * param = p->param;
3944 struct TemplatedType * type;
3945
3946 if(!param)
3947 {
3948 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
3949 }
3950 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3951 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3952 }
3953 }
3954 }
3955 }
3956 return context;
3957 }
3958
3959 extern void PopContext(struct Context * ctx);
3960
3961 extern void FreeContext(struct Context * context);
3962
3963 void FinishTemplatesContext(struct Context * context)
3964 {
3965 PopContext(context);
3966 FreeContext(context);
3967 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3968 }
3969
3970 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3971 {
3972 if(!method->dataType)
3973 {
3974 struct Context * context = SetupTemplatesContext(method->_class);
3975
3976 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3977 FinishTemplatesContext(context);
3978 if(method->type != 1 && method->dataType)
3979 {
3980 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3981 {
3982 if(!method->_class->symbol)
3983 method->_class->symbol = FindClass(method->_class->fullName);
3984 method->dataType->thisClass = method->_class->symbol;
3985 }
3986 }
3987 }
3988 }
3989
3990 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3991 {
3992 if(!prop->dataType)
3993 {
3994 struct Context * context = SetupTemplatesContext(prop->_class);
3995
3996 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3997 FinishTemplatesContext(context);
3998 }
3999 }
4000
4001 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4002
4003 extern void FreeTypeName(struct TypeName * typeName);
4004
4005 static void ProcessDeclarator(struct Declarator * decl);
4006
4007 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4008
4009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4010
4011 struct MethodImport
4012 {
4013 struct MethodImport * prev;
4014 struct MethodImport * next;
4015 char *  name;
4016 unsigned int isVirtual;
4017 } __attribute__ ((gcc_struct));
4018
4019 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4020
4021 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4022 {
4023 void * __ecereTemp1;
4024 struct Symbol * symbol = method->symbol;
4025
4026 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4027 {
4028 unsigned int imported = 0x0;
4029 unsigned int dllImport = 0x0;
4030
4031 if(!method->dataType)
4032 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4033 if(!symbol || symbol->_import || method->type == 1)
4034 {
4035 if(!symbol || method->type == 1)
4036 {
4037 struct Symbol * classSym;
4038
4039 if(!method->_class->symbol)
4040 method->_class->symbol = FindClass(method->_class->fullName);
4041 classSym = method->_class->symbol;
4042 if(!classSym->_import)
4043 {
4044 struct ModuleImport * module;
4045
4046 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4047 module = FindModule(method->_class->module);
4048 else
4049 module = mainModule;
4050 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
4051 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4052 }
4053 if(!symbol)
4054 {
4055 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4056 }
4057 if(!symbol->_import)
4058 {
4059 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
4060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4061 }
4062 if(!symbol)
4063 {
4064 symbol->type = method->dataType;
4065 if(symbol->type)
4066 symbol->type->refCount++;
4067 }
4068 }
4069 if(!method->dataType->dllExport)
4070 {
4071 imported = 0x1;
4072 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4073 dllImport = 0x1;
4074 }
4075 }
4076 if(method->type != 1 && method->dataType)
4077 DeclareType(method->dataType, 0x1, 0x1);
4078 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4079 {
4080 struct Declaration * decl;
4081 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4082 struct Declarator * d;
4083 struct Declarator * funcDecl;
4084 struct External * external;
4085
4086 specifiers = MkList();
4087 declarators = MkList();
4088 if(dllImport)
4089 ListAdd(specifiers, MkSpecifier(EXTERN));
4090 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4091 ListAdd(specifiers, MkSpecifier(STATIC));
4092 if(method->type == 1)
4093 {
4094 ListAdd(specifiers, MkSpecifier(INT));
4095 d = MkDeclaratorIdentifier(MkIdentifier(name));
4096 }
4097 else
4098 {
4099 d = MkDeclaratorIdentifier(MkIdentifier(name));
4100 if(dllImport)
4101 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4102 {
4103 struct Context * context = SetupTemplatesContext(method->_class);
4104
4105 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4106 FinishTemplatesContext(context);
4107 }
4108 funcDecl = GetFuncDecl(d);
4109 if(dllImport)
4110 {
4111 struct Specifier * spec, * next;
4112
4113 for(spec = (*specifiers).first; spec; spec = next)
4114 {
4115 next = spec->next;
4116 if(spec->type == 5)
4117 {
4118 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4119 FreeSpecifier(spec);
4120 }
4121 }
4122 }
4123 if(method->dataType && !method->dataType->staticMethod)
4124 {
4125 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4126 {
4127 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4128 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->thisClass ? method->dataType->thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4129 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4130 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4131
4132 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4133 {
4134 struct TypeName * param = (*funcDecl->function.parameters).first;
4135
4136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4137 FreeTypeName(param);
4138 }
4139 if(!funcDecl->function.parameters)
4140 funcDecl->function.parameters = MkList();
4141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4142 }
4143 }
4144 }
4145 ProcessDeclarator(d);
4146 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4147 decl = MkDeclaration(specifiers, declarators);
4148 ReplaceThisClassSpecifiers(specifiers, method->_class);
4149 if(symbol->pointerExternal)
4150 {
4151 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4152
4153 {
4154 *functionSymbol = *symbol;
4155 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4156 if(functionSymbol->type)
4157 functionSymbol->type->refCount++;
4158 }
4159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4160 symbol->pointerExternal->symbol = functionSymbol;
4161 }
4162 external = MkExternalDeclaration(decl);
4163 if(curExternal)
4164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4165 external->symbol = symbol;
4166 symbol->pointerExternal = external;
4167 }
4168 else if(ast)
4169 {
4170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4171 }
4172 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4173 }
4174 }
4175
4176 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4177 {
4178 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4179 {
4180 unsigned int first = 0x1;
4181 int p = 0;
4182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4183 int lastParam = -1;
4184 char className[1024];
4185
4186 strcpy(className, _class->fullName);
4187 for(param = _class->templateParams.first; param; param = param->next)
4188 {
4189 {
4190 if(first)
4191 strcat(className, "<");
4192 if(!first)
4193 strcat(className, ", ");
4194 if(lastParam + 1 != p)
4195 {
4196 strcat(className, param->name);
4197 strcat(className, " = ");
4198 }
4199 strcat(className, param->name);
4200 first = 0x0;
4201 lastParam = p;
4202 }
4203 p++;
4204 }
4205 if(!first)
4206 {
4207 int len = strlen(className);
4208
4209 if(className[len - 1] == '>')
4210 className[len++] = ' ';
4211 className[len++] = '>';
4212 className[len++] = '\0';
4213 }
4214 return __ecereNameSpace__ecere__sys__CopyString(className);
4215 }
4216 else
4217 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4218 }
4219
4220 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4221 {
4222 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4223 {
4224 unsigned int first = 0x1;
4225 int p = 0;
4226 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4227 int lastParam = -1;
4228 char className[1024];
4229
4230 strcpy(className, _class->fullName);
4231 for(param = _class->templateParams.first; param; param = param->next)
4232 {
4233 {
4234 if(first)
4235 strcat(className, "<");
4236 if(!first)
4237 strcat(className, ", ");
4238 if(lastParam + 1 != p)
4239 {
4240 strcat(className, param->name);
4241 strcat(className, " = ");
4242 }
4243 strcat(className, param->name);
4244 first = 0x0;
4245 lastParam = p;
4246 }
4247 p++;
4248 }
4249 if(!first)
4250 {
4251 int len = strlen(className);
4252
4253 if(className[len - 1] == '>')
4254 className[len++] = ' ';
4255 className[len++] = '>';
4256 className[len++] = '\0';
4257 }
4258 return MkClassType(className);
4259 }
4260 else
4261 {
4262 return MkClassType(_class->fullName);
4263 }
4264 }
4265
4266 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4267 {
4268 if(specs != (((void *)0)) && _class)
4269 {
4270 struct Specifier * spec;
4271
4272 for(spec = specs->first; spec; spec = spec->next)
4273 {
4274 if(spec->type == 0 && spec->specifier == THISCLASS)
4275 {
4276 spec->type = 1;
4277 spec->name = ReplaceThisClass(_class);
4278 spec->symbol = FindClass(spec->name);
4279 }
4280 }
4281 }
4282 }
4283
4284 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4285
4286 struct __ecereNameSpace__ecere__com__GlobalFunction
4287 {
4288 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4289 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4290 char *  name;
4291 int (*  function)();
4292 struct __ecereNameSpace__ecere__com__Instance * module;
4293 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4294 char *  dataTypeString;
4295 struct Type * dataType;
4296 void *  symbol;
4297 } __attribute__ ((gcc_struct));
4298
4299 extern struct Context * globalContext;
4300
4301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4302
4303 struct FunctionImport
4304 {
4305 struct FunctionImport * prev;
4306 struct FunctionImport * next;
4307 char *  name;
4308 } __attribute__ ((gcc_struct));
4309
4310 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4311 {
4312 void * __ecereTemp1;
4313 struct Symbol * symbol = function->symbol;
4314
4315 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4316 {
4317 unsigned int imported = 0x0;
4318 unsigned int dllImport = 0x0;
4319
4320 if(!function->dataType)
4321 {
4322 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4323 if(!function->dataType->thisClass)
4324 function->dataType->staticMethod = 0x1;
4325 }
4326 if(inCompiler)
4327 {
4328 if(!symbol)
4329 {
4330 struct ModuleImport * module = FindModule(function->module);
4331
4332 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4333 if(module->name)
4334 {
4335 if(!function->dataType->dllExport)
4336 {
4337 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4339 }
4340 }
4341 {
4342 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4343 if(!symbol->type->thisClass)
4344 symbol->type->staticMethod = 0x1;
4345 }
4346 }
4347 imported = symbol->_import ? 0x1 : 0x0;
4348 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4349 dllImport = 0x1;
4350 }
4351 DeclareType(function->dataType, 0x1, 0x1);
4352 if(inCompiler)
4353 {
4354 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4355 {
4356 struct Declaration * decl;
4357 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4358 struct Declarator * d;
4359 struct Declarator * funcDecl;
4360 struct External * external;
4361
4362 specifiers = MkList();
4363 declarators = MkList();
4364 ListAdd(specifiers, MkSpecifier(EXTERN));
4365 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4366 if(dllImport)
4367 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4368 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4369 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4370 {
4371 struct Specifier * spec;
4372
4373 for(spec = (*specifiers).first; spec; spec = spec->next)
4374 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4375 {
4376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4377 FreeSpecifier(spec);
4378 break;
4379 }
4380 }
4381 funcDecl = GetFuncDecl(d);
4382 if(funcDecl && !funcDecl->function.parameters)
4383 {
4384 funcDecl->function.parameters = MkList();
4385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4386 }
4387 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4388 {
4389 struct Context * oldCtx = curContext;
4390
4391 curContext = globalContext;
4392 decl = MkDeclaration(specifiers, declarators);
4393 curContext = oldCtx;
4394 }
4395 if(symbol->pointerExternal)
4396 {
4397 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4398
4399 {
4400 *functionSymbol = *symbol;
4401 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4402 if(functionSymbol->type)
4403 functionSymbol->type->refCount++;
4404 }
4405 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4406 symbol->pointerExternal->symbol = functionSymbol;
4407 }
4408 external = MkExternalDeclaration(decl);
4409 if(curExternal)
4410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4411 external->symbol = symbol;
4412 symbol->pointerExternal = external;
4413 }
4414 else
4415 {
4416 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4417 }
4418 if(curExternal)
4419 symbol->id = curExternal->symbol->idCode;
4420 }
4421 }
4422 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4423 }
4424
4425 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4426
4427 struct GlobalData
4428 {
4429 uintptr_t key;
4430 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4431 struct __ecereNameSpace__ecere__sys__BTNode * left;
4432 struct __ecereNameSpace__ecere__sys__BTNode * right;
4433 int depth;
4434 struct __ecereNameSpace__ecere__com__Instance * module;
4435 char *  dataTypeString;
4436 struct Type * dataType;
4437 void *  symbol;
4438 char *  fullName;
4439 } __attribute__ ((gcc_struct));
4440
4441 void DeclareGlobalData(struct GlobalData * data)
4442 {
4443 struct Symbol * symbol = data->symbol;
4444
4445 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4446 {
4447 if(inCompiler)
4448 {
4449 if(!symbol)
4450 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4451 }
4452 if(!data->dataType)
4453 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4454 DeclareType(data->dataType, 0x1, 0x1);
4455 if(inCompiler)
4456 {
4457 if(!symbol->pointerExternal)
4458 {
4459 struct Declaration * decl;
4460 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4461 struct Declarator * d;
4462 struct External * external;
4463
4464 specifiers = MkList();
4465 declarators = MkList();
4466 ListAdd(specifiers, MkSpecifier(EXTERN));
4467 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4468 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4469 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4470 decl = MkDeclaration(specifiers, declarators);
4471 external = MkExternalDeclaration(decl);
4472 if(curExternal)
4473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4474 external->symbol = symbol;
4475 symbol->pointerExternal = external;
4476 }
4477 else
4478 {
4479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4480 }
4481 if(curExternal)
4482 symbol->id = curExternal->symbol->idCode;
4483 }
4484 }
4485 }
4486
4487 struct Conversion
4488 {
4489 struct Conversion * prev, * next;
4490 struct __ecereNameSpace__ecere__com__Property * convert;
4491 unsigned int isGet;
4492 struct Type * resultType;
4493 } __attribute__ ((gcc_struct));
4494
4495 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4496
4497 extern void Compiler_Warning(char *  format, ...);
4498
4499 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4500
4501 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration)
4502 {
4503 if(source && dest)
4504 {
4505 if(source->kind == 20 && dest->kind != 20)
4506 {
4507 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4508
4509 if(type)
4510 source = type;
4511 }
4512 if(dest->kind == 20 && source->kind != 20)
4513 {
4514 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4515
4516 if(type)
4517 dest = type;
4518 }
4519 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4520 {
4521 return 0x1;
4522 }
4523 if(source->classObjectType == 3 && dest->classObjectType != 2)
4524 {
4525 return 0x1;
4526 }
4527 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4528 {
4529 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4530 return 0x1;
4531 }
4532 if(dest->kind == 14 && source->kind != 0)
4533 return 0x1;
4534 if(dest->kind == 13 && dest->type->kind == 0 && ((source->kind == 8 && (!source->_class || !source->_class->registered || source->_class->registered->type == 1 || source->_class->registered->type == 0 || source->_class->registered->type == 5 || source->_class->registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4535 return 0x1;
4536 if(!isConversionExploration && source->kind == 13 && source->type->kind == 0 && ((dest->kind == 8 && (!dest->_class || !dest->_class->registered || dest->_class->registered->type == 1 || dest->_class->registered->type == 0 || dest->_class->registered->type == 5 || dest->_class->registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4537 return 0x1;
4538 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4539 {
4540 if(source->_class->registered && source->_class->registered->type == 3)
4541 {
4542 if(conversions != (((void *)0)))
4543 {
4544 if(source->_class->registered == dest->_class->registered)
4545 return 0x1;
4546 }
4547 else
4548 {
4549 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4550
4551 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4552 ;
4553 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4554 ;
4555 if(sourceBase == destBase)
4556 return 0x1;
4557 }
4558 }
4559 else if(source->_class && dest->_class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->_class->registered || source->_class->registered->type != 4) || (!dest->_class->registered || dest->_class->registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, dest->_class->registered))
4560 return 0x1;
4561 else
4562 {
4563 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4564 {
4565 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4566 {
4567 return 0x1;
4568 }
4569 }
4570 }
4571 }
4572 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4573 return 0x1;
4574 if(doConversion)
4575 {
4576 if(source->kind == 8)
4577 {
4578 struct __ecereNameSpace__ecere__com__Class * _class;
4579
4580 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4581 {
4582 struct __ecereNameSpace__ecere__com__Property * convert;
4583
4584 for(convert = _class->conversions.first; convert; convert = convert->next)
4585 {
4586 if(convert->memberAccess == 1 || _class->module == privateModule)
4587 {
4588 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4589
4590 if(!convert->dataType)
4591 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4592 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4593 {
4594 if(!conversions && !convert->Get)
4595 return 0x1;
4596 else if(conversions != (((void *)0)))
4597 {
4598 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4599 return 0x1;
4600 else
4601 {
4602 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4603
4604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4605 return 0x1;
4606 }
4607 }
4608 }
4609 }
4610 }
4611 }
4612 }
4613 if(dest->kind == 8)
4614 {
4615 struct __ecereNameSpace__ecere__com__Class * _class;
4616
4617 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4618 {
4619 struct __ecereNameSpace__ecere__com__Property * convert;
4620
4621 for(convert = _class->conversions.first; convert; convert = convert->next)
4622 {
4623 if(convert->memberAccess == 1 || _class->module == privateModule)
4624 {
4625 if(!convert->dataType)
4626 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4627 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4628 {
4629 if(!conversions && !convert->Set)
4630 return 0x1;
4631 else if(conversions != (((void *)0)))
4632 {
4633 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (source->kind != 8 || source->_class->registered != _class->base))
4634 return 0x1;
4635 else
4636 {
4637 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4638
4639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4640 return 0x1;
4641 }
4642 }
4643 }
4644 }
4645 }
4646 }
4647 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4648 {
4649 if(!dest->_class->registered->dataType)
4650 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4651 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4652 {
4653 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4654 {
4655 return 0x1;
4656 }
4657 }
4658 }
4659 }
4660 if(source->kind == 8)
4661 {
4662 struct __ecereNameSpace__ecere__com__Class * _class;
4663
4664 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4665 {
4666 struct __ecereNameSpace__ecere__com__Property * convert;
4667
4668 for(convert = _class->conversions.first; convert; convert = convert->next)
4669 {
4670 if(convert->memberAccess == 1 || _class->module == privateModule)
4671 {
4672 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4673
4674 if(!convert->dataType)
4675 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4676 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4677 {
4678 if(!conversions && !convert->Get)
4679 return 0x1;
4680 else if(conversions != (((void *)0)))
4681 {
4682 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4683 return 0x1;
4684 else
4685 {
4686 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4687
4688 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4689 return 0x1;
4690 }
4691 }
4692 }
4693 }
4694 }
4695 }
4696 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4697 {
4698 if(!source->_class->registered->dataType)
4699 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4700 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4701 {
4702 return 0x1;
4703 }
4704 }
4705 }
4706 }
4707 if(source->kind == 8 || source->kind == 19)
4708 ;
4709 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4710 return 0x1;
4711 else if(dest->kind == 7 && source->kind == 6)
4712 return 0x1;
4713 else if(dest->kind == 2 && source->kind == 1)
4714 return 0x1;
4715 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4716 return 0x1;
4717 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4718 return 0x1;
4719 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4720 return 0x1;
4721 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4722 return 0x1;
4723 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4724 return 0x1;
4725 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
4726 {
4727 struct Type * paramSource, * paramDest;
4728
4729 if(dest->kind == 16)
4730 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4731 if(source->kind == 16)
4732 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4733 if(dest->kind == 13 && dest->type->kind == 11)
4734 dest = dest->type;
4735 if(source->kind == 13 && source->type->kind == 11)
4736 source = source->type;
4737 if(dest->kind == 16)
4738 dest = dest->method->dataType;
4739 if(source->kind == 16)
4740 source = source->method->dataType;
4741 paramSource = source->params.first;
4742 if(paramSource && paramSource->kind == 0)
4743 paramSource = (((void *)0));
4744 paramDest = dest->params.first;
4745 if(paramDest && paramDest->kind == 0)
4746 paramDest = (((void *)0));
4747 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4748 {
4749 if(!paramDest || (!(paramDest->kind == 13 && paramDest->type && paramDest->type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, paramDest->_class->registered))))
4750 {
4751 if(paramDest && paramDest->kind == 8)
4752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4753 else
4754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4755 return 0x0;
4756 }
4757 paramDest = paramDest->next;
4758 }
4759 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4760 {
4761 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4762 {
4763 if(dest->thisClass)
4764 {
4765 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4766 {
4767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4768 return 0x0;
4769 }
4770 }
4771 else
4772 {
4773 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4774 {
4775 if(owningClassDest)
4776 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4777 else
4778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4779 return 0x0;
4780 }
4781 }
4782 paramSource = paramSource->next;
4783 }
4784 else
4785 {
4786 if(dest->thisClass)
4787 {
4788 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4789 {
4790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4791 return 0x0;
4792 }
4793 }
4794 else
4795 {
4796 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4797 {
4798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4799 return 0x0;
4800 }
4801 }
4802 }
4803 }
4804 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4805 {
4806 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4807 return 0x0;
4808 }
4809 for(; paramDest; paramDest = paramDest->next)
4810 {
4811 if(!paramSource)
4812 {
4813 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4814 return 0x0;
4815 }
4816 {
4817 struct Type * paramDestType = paramDest;
4818 struct Type * paramSourceType = paramSource;
4819 struct Type * type = paramDestType;
4820
4821 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4822 {
4823 int id = 0;
4824 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4825 struct __ecereNameSpace__ecere__com__Class * sClass;
4826
4827 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4828 {
4829 id = 0;
4830 if(sClass->templateClass)
4831 sClass = sClass->templateClass;
4832 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4833 {
4834 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4835 {
4836 for(sClass = sClass->base; sClass; sClass = sClass->base)
4837 {
4838 if(sClass->templateClass)
4839 sClass = sClass->templateClass;
4840 id += sClass->templateParams.count;
4841 }
4842 break;
4843 }
4844 id++;
4845 }
4846 if(curParam)
4847 break;
4848 }
4849 if(curParam)
4850 {
4851 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4852
4853 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4854 }
4855 }
4856 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
4857 {
4858 char type[1024];
4859
4860 type[0] = (char)0;
4861 PrintType(paramDest, type, 0x0, 0x1);
4862 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4863 if(paramDestType != paramDest)
4864 FreeType(paramDestType);
4865 return 0x0;
4866 }
4867 if(paramDestType != paramDest)
4868 FreeType(paramDestType);
4869 }
4870 paramSource = paramSource->next;
4871 }
4872 if(paramSource)
4873 {
4874 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4875 return 0x0;
4876 }
4877 return 0x1;
4878 }
4879 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4880 {
4881 return 0x1;
4882 }
4883 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4884 {
4885 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4886 return 0x1;
4887 }
4888 }
4889 return 0x0;
4890 }
4891
4892 static void FreeConvert(struct Conversion * convert)
4893 {
4894 if(convert->resultType)
4895 FreeType(convert->resultType);
4896 }
4897
4898 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4899
4900 struct __ecereNameSpace__ecere__com__BTNamedLink
4901 {
4902 char *  name;
4903 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4904 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4905 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4906 int depth;
4907 void *  data;
4908 } __attribute__ ((gcc_struct));
4909
4910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4911
4912 struct __ecereNameSpace__ecere__com__EnumClassData
4913 {
4914 struct __ecereNameSpace__ecere__sys__OldList values;
4915 int largest;
4916 } __attribute__ ((gcc_struct));
4917
4918 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4919
4920 struct __ecereNameSpace__ecere__sys__NamedLink
4921 {
4922 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4923 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4924 char *  name;
4925 void *  data;
4926 } __attribute__ ((gcc_struct));
4927
4928 extern void FreeExpContents(struct Expression * exp);
4929
4930 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4931
4932 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4933
4934 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4935
4936 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4937
4938 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4939
4940 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4941 {
4942 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4943
4944 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
4945 {
4946 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4947
4948 if(_class->type == 4)
4949 {
4950 struct __ecereNameSpace__ecere__sys__OldList converts = 
4951 {
4952 0, 0, 0, 0, 0
4953 };
4954 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4955
4956 type->kind = 8;
4957 if(!_class->symbol)
4958 _class->symbol = FindClass(_class->fullName);
4959 type->_class = _class->symbol;
4960 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4961 {
4962 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4963 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4964
4965 if(enumClass)
4966 {
4967 struct __ecereNameSpace__ecere__com__Class * baseClass;
4968
4969 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4970 {
4971 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4972
4973 for(value = e->values.first; value; value = value->next)
4974 {
4975 if(!strcmp(value->name, string))
4976 break;
4977 }
4978 if(value)
4979 {
4980 FreeExpContents(sourceExp);
4981 FreeType(sourceExp->expType);
4982 sourceExp->isConstant = 0x1;
4983 sourceExp->expType = MkClassType(baseClass->fullName);
4984 {
4985 char constant[256];
4986
4987 sourceExp->type = 2;
4988 if(!strcmp(baseClass->dataTypeString, "int"))
4989 sprintf(constant, "%d", value->data);
4990 else
4991 sprintf(constant, "0x%X", value->data);
4992 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4993 }
4994 while(converts.first)
4995 {
4996 struct Conversion * convert = converts.first;
4997
4998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5000 }
5001 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5002 return 0x1;
5003 }
5004 }
5005 }
5006 }
5007 if(converts.first)
5008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5009 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5010 }
5011 }
5012 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); nameSpace != (((void *)0)); nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
5013 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5014 return 0x1;
5015 return 0x0;
5016 }
5017
5018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5019
5020 struct __ecereNameSpace__ecere__com__SubModule
5021 {
5022 struct __ecereNameSpace__ecere__com__SubModule * prev;
5023 struct __ecereNameSpace__ecere__com__SubModule * next;
5024 struct __ecereNameSpace__ecere__com__Instance * module;
5025 int importMode;
5026 } __attribute__ ((gcc_struct));
5027
5028 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5029 {
5030 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5031
5032 if(searchFor == searchIn)
5033 return 0x1;
5034 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5035 {
5036 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5037 {
5038 if(ModuleVisibility(subModule->module, searchFor))
5039 return 0x1;
5040 }
5041 }
5042 return 0x0;
5043 }
5044
5045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5046
5047 struct __ecereNameSpace__ecere__com__Application
5048 {
5049 int argc;
5050 char * *  argv;
5051 int exitCode;
5052 unsigned int isGUIApp;
5053 struct __ecereNameSpace__ecere__sys__OldList allModules;
5054 char *  parsedCommand;
5055 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5056 } __attribute__ ((gcc_struct));
5057
5058 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5059 {
5060 struct __ecereNameSpace__ecere__com__Instance * module;
5061
5062 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5063 return 0x1;
5064 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5065 return 0x1;
5066 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5067 return 0x1;
5068 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
5069 {
5070 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5071 return 0x1;
5072 }
5073 return 0x0;
5074 }
5075
5076 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5077
5078 void ReadString(char *  output, char *  string);
5079
5080 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5081
5082 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5083
5084 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5085
5086 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5087 {
5088 void * __ecereTemp1;
5089 struct Type * source = sourceExp->expType;
5090 struct Type * realDest = dest;
5091
5092 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5093 return 0x1;
5094 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5095 {
5096 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5097 {
5098 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5099
5100 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5101 ;
5102 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5103 ;
5104 if(sourceBase == destBase)
5105 return 0x1;
5106 }
5107 }
5108 if(source)
5109 {
5110 struct __ecereNameSpace__ecere__sys__OldList * specs;
5111 unsigned int flag = 0x0;
5112 long long value = (((int)0x7fffffff));
5113
5114 source->refCount++;
5115 dest->refCount++;
5116 if(sourceExp->type == 2)
5117 {
5118 if(source->isSigned)
5119 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5120 else
5121 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5122 }
5123 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5124 {
5125 if(source->isSigned)
5126 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5127 else
5128 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5129 }
5130 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5131 {
5132 FreeType(source);
5133 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5134 }
5135 if(dest->kind == 8)
5136 {
5137 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5138
5139 if(_class && _class->type == 3)
5140 {
5141 if(source->kind != 8)
5142 {
5143 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5144 struct Type * tempDest, * tempSource;
5145
5146 for(; _class->base->type != 1000; _class = _class->base)
5147 ;
5148 tempSource = dest;
5149 tempDest = tempType;
5150 tempType->kind = 8;
5151 if(!_class->symbol)
5152 _class->symbol = FindClass(_class->fullName);
5153 tempType->_class = _class->symbol;
5154 tempType->truth = dest->truth;
5155 if(tempType->_class)
5156 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5157 FreeType(sourceExp->expType);
5158 sourceExp->expType = dest;
5159 dest->refCount++;
5160 flag = 0x1;
5161 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5162 }
5163 }
5164 if(_class && _class->type == 2 && source->kind != 8)
5165 {
5166 if(!dest->_class->registered->dataType)
5167 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5168 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5169 {
5170 FreeType(source);
5171 FreeType(sourceExp->expType);
5172 source = sourceExp->expType = MkClassType(dest->_class->string);
5173 source->refCount++;
5174 }
5175 }
5176 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5177 {
5178 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5179 struct Declarator * decl;
5180 char string[1024];
5181
5182 ReadString(string, sourceExp->string);
5183 decl = SpecDeclFromString(string, specs, (((void *)0)));
5184 FreeExpContents(sourceExp);
5185 FreeType(sourceExp->expType);
5186 sourceExp->type = 26;
5187 sourceExp->_classExp.specifiers = specs;
5188 sourceExp->_classExp.decl = decl;
5189 sourceExp->expType = dest;
5190 dest->refCount++;
5191 FreeType(source);
5192 FreeType(dest);
5193 return 0x1;
5194 }
5195 }
5196 else if(source->kind == 8)
5197 {
5198 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5199
5200 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5201 {
5202 if(dest->kind != 8)
5203 {
5204 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5205 struct Type * tempDest, * tempSource;
5206
5207 if(!source->_class->registered->dataType)
5208 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5209 for(; _class->base->type != 1000; _class = _class->base)
5210 ;
5211 tempDest = source;
5212 tempSource = tempType;
5213 tempType->kind = 8;
5214 tempType->_class = FindClass(_class->fullName);
5215 tempType->truth = source->truth;
5216 tempType->classObjectType = source->classObjectType;
5217 if(tempType->_class)
5218 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5219 if(conversions->last)
5220 {
5221 ((struct Conversion *)conversions->last)->resultType = dest;
5222 dest->refCount++;
5223 }
5224 FreeType(sourceExp->expType);
5225 sourceExp->expType = MkClassType(_class->fullName);
5226 sourceExp->expType->truth = source->truth;
5227 sourceExp->expType->classObjectType = source->classObjectType;
5228 if(!sourceExp->destType)
5229 {
5230 FreeType(sourceExp->destType);
5231 sourceExp->destType = sourceExp->expType;
5232 if(sourceExp->expType)
5233 sourceExp->expType->refCount++;
5234 }
5235 if(!_class->dataType)
5236 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5237 FreeType(dest);
5238 dest = MkClassType(source->_class->string);
5239 dest->truth = source->truth;
5240 dest->classObjectType = source->classObjectType;
5241 FreeType(source);
5242 source = _class->dataType;
5243 source->refCount++;
5244 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5245 }
5246 }
5247 }
5248 if(!flag)
5249 {
5250 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5251 {
5252 FreeType(source);
5253 FreeType(dest);
5254 return 0x1;
5255 }
5256 }
5257 if(dest->kind == 8)
5258 {
5259 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5260
5261 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5262 {
5263 if(_class->type == 0 || _class->type == 5)
5264 {
5265 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5266
5267 *newExp = *sourceExp;
5268 if(sourceExp->destType)
5269 sourceExp->destType->refCount++;
5270 if(sourceExp->expType)
5271 sourceExp->expType->refCount++;
5272 sourceExp->type = 11;
5273 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5274 sourceExp->cast.exp = newExp;
5275 FreeType(sourceExp->expType);
5276 sourceExp->expType = (((void *)0));
5277 ProcessExpressionType(sourceExp);
5278 if(!inCompiler)
5279 {
5280 FreeType(sourceExp->expType);
5281 sourceExp->expType = dest;
5282 }
5283 FreeType(source);
5284 if(inCompiler)
5285 FreeType(dest);
5286 return 0x1;
5287 }
5288 if(!_class->dataType)
5289 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5290 FreeType(dest);
5291 dest = _class->dataType;
5292 dest->refCount++;
5293 }
5294 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5295 {
5296 specs = MkListOne(MkSpecifier(DOUBLE));
5297 }
5298 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5299 {
5300 specs = MkListOne(MkSpecifier(FLOAT));
5301 }
5302 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5303 {
5304 specs = MkList();
5305 if(!dest->isSigned)
5306 ListAdd(specs, MkSpecifier(UNSIGNED));
5307 ListAdd(specs, MkSpecifier(INT64));
5308 }
5309 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5310 {
5311 specs = MkList();
5312 if(!dest->isSigned)
5313 ListAdd(specs, MkSpecifier(UNSIGNED));
5314 ListAdd(specs, MkSpecifier(INT));
5315 }
5316 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5317 {
5318 specs = MkList();
5319 if(!dest->isSigned)
5320 ListAdd(specs, MkSpecifier(UNSIGNED));
5321 ListAdd(specs, MkSpecifier(SHORT));
5322 }
5323 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5324 {
5325 specs = MkList();
5326 if(!dest->isSigned)
5327 ListAdd(specs, MkSpecifier(UNSIGNED));
5328 ListAdd(specs, MkSpecifier(CHAR));
5329 }
5330 else
5331 {
5332 FreeType(source);
5333 FreeType(dest);
5334 return 0x0;
5335 }
5336 }
5337 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 1))
5338 {
5339 specs = MkListOne(MkSpecifier(DOUBLE));
5340 }
5341 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5342 {
5343 specs = MkListOne(MkSpecifier(FLOAT));
5344 }
5345 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5346 {
5347 specs = MkList();
5348 if(!dest->isSigned)
5349 ListAdd(specs, MkSpecifier(UNSIGNED));
5350 ListAdd(specs, MkSpecifier(CHAR));
5351 }
5352 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5353 {
5354 specs = MkList();
5355 if(!dest->isSigned)
5356 ListAdd(specs, MkSpecifier(UNSIGNED));
5357 ListAdd(specs, MkSpecifier(SHORT));
5358 }
5359 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5360 {
5361 specs = MkList();
5362 if(!dest->isSigned)
5363 ListAdd(specs, MkSpecifier(UNSIGNED));
5364 ListAdd(specs, MkSpecifier(INT));
5365 }
5366 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5367 {
5368 specs = MkList();
5369 if(!dest->isSigned)
5370 ListAdd(specs, MkSpecifier(UNSIGNED));
5371 ListAdd(specs, MkSpecifier(INT64));
5372 }
5373 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5374 {
5375 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5376 }
5377 else
5378 {
5379 FreeType(source);
5380 FreeType(dest);
5381 return 0x0;
5382 }
5383 if(!flag)
5384 {
5385 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5386
5387 *newExp = *sourceExp;
5388 newExp->prev = (((void *)0));
5389 newExp->next = (((void *)0));
5390 if(sourceExp->destType)
5391 sourceExp->destType->refCount++;
5392 if(sourceExp->expType)
5393 sourceExp->expType->refCount++;
5394 sourceExp->type = 11;
5395 if(realDest->kind == 8)
5396 {
5397 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5398 FreeList(specs, FreeSpecifier);
5399 }
5400 else
5401 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5402 if(newExp->type == 4)
5403 {
5404 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5405 }
5406 else
5407 sourceExp->cast.exp = newExp;
5408 FreeType(sourceExp->expType);
5409 sourceExp->expType = (((void *)0));
5410 ProcessExpressionType(sourceExp);
5411 }
5412 else
5413 FreeList(specs, FreeSpecifier);
5414 FreeType(dest);
5415 FreeType(source);
5416 return 0x1;
5417 }
5418 else
5419 {
5420 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5421 sourceExp = (*sourceExp->list).last;
5422 if(sourceExp->type == 0)
5423 {
5424 struct Identifier * id = sourceExp->identifier;
5425
5426 if(dest->kind == 8)
5427 {
5428 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5429 {
5430 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5431 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5432
5433 if(enumClass)
5434 {
5435 for(; _class && _class->type == 4; _class = _class->base)
5436 {
5437 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5438 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5439
5440 for(value = e->values.first; value; value = value->next)
5441 {
5442 if(!strcmp(value->name, id->string))
5443 break;
5444 }
5445 if(value)
5446 {
5447 FreeExpContents(sourceExp);
5448 FreeType(sourceExp->expType);
5449 sourceExp->isConstant = 0x1;
5450 sourceExp->expType = MkClassType(_class->fullName);
5451 {
5452 char constant[256];
5453
5454 sourceExp->type = 2;
5455 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5456 sprintf(constant, "%d", value->data);
5457 else
5458 sprintf(constant, "0x%X", value->data);
5459 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5460 }
5461 return 0x1;
5462 }
5463 }
5464 }
5465 }
5466 }
5467 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5468 return 0x1;
5469 }
5470 }
5471 return 0x0;
5472 }
5473
5474 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5475 {
5476 int value2 = op2->i;
5477
5478 exp->type = 2;
5479 exp->string = PrintInt(op1->i + value2);
5480 if(!exp->expType)
5481 {
5482 exp->expType = op1->type;
5483 if(op1->type)
5484 op1->type->refCount++;
5485 }
5486 return 0x1;
5487 }
5488
5489 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5490 {
5491 unsigned int value2 = op2->ui;
5492
5493 exp->type = 2;
5494 exp->string = PrintUInt(op1->ui + value2);
5495 if(!exp->expType)
5496 {
5497 exp->expType = op1->type;
5498 if(op1->type)
5499 op1->type->refCount++;
5500 }
5501 return 0x1;
5502 }
5503
5504 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5505 {
5506 short value2 = op2->s;
5507
5508 exp->type = 2;
5509 exp->string = PrintShort(op1->s + value2);
5510 if(!exp->expType)
5511 {
5512 exp->expType = op1->type;
5513 if(op1->type)
5514 op1->type->refCount++;
5515 }
5516 return 0x1;
5517 }
5518
5519 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5520 {
5521 unsigned short value2 = op2->us;
5522
5523 exp->type = 2;
5524 exp->string = PrintUShort(op1->us + value2);
5525 if(!exp->expType)
5526 {
5527 exp->expType = op1->type;
5528 if(op1->type)
5529 op1->type->refCount++;
5530 }
5531 return 0x1;
5532 }
5533
5534 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5535 {
5536 char value2 = op2->c;
5537
5538 exp->type = 2;
5539 exp->string = PrintChar(op1->c + value2);
5540 if(!exp->expType)
5541 {
5542 exp->expType = op1->type;
5543 if(op1->type)
5544 op1->type->refCount++;
5545 }
5546 return 0x1;
5547 }
5548
5549 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5550 {
5551 unsigned char value2 = op2->uc;
5552
5553 exp->type = 2;
5554 exp->string = PrintUChar(op1->uc + value2);
5555 if(!exp->expType)
5556 {
5557 exp->expType = op1->type;
5558 if(op1->type)
5559 op1->type->refCount++;
5560 }
5561 return 0x1;
5562 }
5563
5564 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5565 {
5566 float value2 = op2->f;
5567
5568 exp->type = 2;
5569 exp->string = PrintFloat(op1->f + value2);
5570 if(!exp->expType)
5571 {
5572 exp->expType = op1->type;
5573 if(op1->type)
5574 op1->type->refCount++;
5575 }
5576 return 0x1;
5577 }
5578
5579 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5580 {
5581 double value2 = op2->d;
5582
5583 exp->type = 2;
5584 exp->string = PrintDouble(op1->d + value2);
5585 if(!exp->expType)
5586 {
5587 exp->expType = op1->type;
5588 if(op1->type)
5589 op1->type->refCount++;
5590 }
5591 return 0x1;
5592 }
5593
5594 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5595 {
5596 int value2 = op2->i;
5597
5598 exp->type = 2;
5599 exp->string = PrintInt(op1->i - value2);
5600 if(!exp->expType)
5601 {
5602 exp->expType = op1->type;
5603 if(op1->type)
5604 op1->type->refCount++;
5605 }
5606 return 0x1;
5607 }
5608
5609 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5610 {
5611 unsigned int value2 = op2->ui;
5612
5613 exp->type = 2;
5614 exp->string = PrintUInt(op1->ui - value2);
5615 if(!exp->expType)
5616 {
5617 exp->expType = op1->type;
5618 if(op1->type)
5619 op1->type->refCount++;
5620 }
5621 return 0x1;
5622 }
5623
5624 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5625 {
5626 short value2 = op2->s;
5627
5628 exp->type = 2;
5629 exp->string = PrintShort(op1->s - value2);
5630 if(!exp->expType)
5631 {
5632 exp->expType = op1->type;
5633 if(op1->type)
5634 op1->type->refCount++;
5635 }
5636 return 0x1;
5637 }
5638
5639 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5640 {
5641 unsigned short value2 = op2->us;
5642
5643 exp->type = 2;
5644 exp->string = PrintUShort(op1->us - value2);
5645 if(!exp->expType)
5646 {
5647 exp->expType = op1->type;
5648 if(op1->type)
5649 op1->type->refCount++;
5650 }
5651 return 0x1;
5652 }
5653
5654 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5655 {
5656 char value2 = op2->c;
5657
5658 exp->type = 2;
5659 exp->string = PrintChar(op1->c - value2);
5660 if(!exp->expType)
5661 {
5662 exp->expType = op1->type;
5663 if(op1->type)
5664 op1->type->refCount++;
5665 }
5666 return 0x1;
5667 }
5668
5669 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5670 {
5671 unsigned char value2 = op2->uc;
5672
5673 exp->type = 2;
5674 exp->string = PrintUChar(op1->uc - value2);
5675 if(!exp->expType)
5676 {
5677 exp->expType = op1->type;
5678 if(op1->type)
5679 op1->type->refCount++;
5680 }
5681 return 0x1;
5682 }
5683
5684 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5685 {
5686 float value2 = op2->f;
5687
5688 exp->type = 2;
5689 exp->string = PrintFloat(op1->f - value2);
5690 if(!exp->expType)
5691 {
5692 exp->expType = op1->type;
5693 if(op1->type)
5694 op1->type->refCount++;
5695 }
5696 return 0x1;
5697 }
5698
5699 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5700 {
5701 double value2 = op2->d;
5702
5703 exp->type = 2;
5704 exp->string = PrintDouble(op1->d - value2);
5705 if(!exp->expType)
5706 {
5707 exp->expType = op1->type;
5708 if(op1->type)
5709 op1->type->refCount++;
5710 }
5711 return 0x1;
5712 }
5713
5714 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5715 {
5716 int value2 = op2->i;
5717
5718 exp->type = 2;
5719 exp->string = PrintInt(op1->i * value2);
5720 if(!exp->expType)
5721 {
5722 exp->expType = op1->type;
5723 if(op1->type)
5724 op1->type->refCount++;
5725 }
5726 return 0x1;
5727 }
5728
5729 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5730 {
5731 unsigned int value2 = op2->ui;
5732
5733 exp->type = 2;
5734 exp->string = PrintUInt(op1->ui * value2);
5735 if(!exp->expType)
5736 {
5737 exp->expType = op1->type;
5738 if(op1->type)
5739 op1->type->refCount++;
5740 }
5741 return 0x1;
5742 }
5743
5744 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5745 {
5746 short value2 = op2->s;
5747
5748 exp->type = 2;
5749 exp->string = PrintShort(op1->s * value2);
5750 if(!exp->expType)
5751 {
5752 exp->expType = op1->type;
5753 if(op1->type)
5754 op1->type->refCount++;
5755 }
5756 return 0x1;
5757 }
5758
5759 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5760 {
5761 unsigned short value2 = op2->us;
5762
5763 exp->type = 2;
5764 exp->string = PrintUShort(op1->us * value2);
5765 if(!exp->expType)
5766 {
5767 exp->expType = op1->type;
5768 if(op1->type)
5769 op1->type->refCount++;
5770 }
5771 return 0x1;
5772 }
5773
5774 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5775 {
5776 char value2 = op2->c;
5777
5778 exp->type = 2;
5779 exp->string = PrintChar(op1->c * value2);
5780 if(!exp->expType)
5781 {
5782 exp->expType = op1->type;
5783 if(op1->type)
5784 op1->type->refCount++;
5785 }
5786 return 0x1;
5787 }
5788
5789 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5790 {
5791 unsigned char value2 = op2->uc;
5792
5793 exp->type = 2;
5794 exp->string = PrintUChar(op1->uc * value2);
5795 if(!exp->expType)
5796 {
5797 exp->expType = op1->type;
5798 if(op1->type)
5799 op1->type->refCount++;
5800 }
5801 return 0x1;
5802 }
5803
5804 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5805 {
5806 float value2 = op2->f;
5807
5808 exp->type = 2;
5809 exp->string = PrintFloat(op1->f * value2);
5810 if(!exp->expType)
5811 {
5812 exp->expType = op1->type;
5813 if(op1->type)
5814 op1->type->refCount++;
5815 }
5816 return 0x1;
5817 }
5818
5819 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5820 {
5821 double value2 = op2->d;
5822
5823 exp->type = 2;
5824 exp->string = PrintDouble(op1->d * value2);
5825 if(!exp->expType)
5826 {
5827 exp->expType = op1->type;
5828 if(op1->type)
5829 op1->type->refCount++;
5830 }
5831 return 0x1;
5832 }
5833
5834 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5835 {
5836 int value2 = op2->i;
5837
5838 exp->type = 2;
5839 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5840 if(!exp->expType)
5841 {
5842 exp->expType = op1->type;
5843 if(op1->type)
5844 op1->type->refCount++;
5845 }
5846 return 0x1;
5847 }
5848
5849 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5850 {
5851 unsigned int value2 = op2->ui;
5852
5853 exp->type = 2;
5854 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5855 if(!exp->expType)
5856 {
5857 exp->expType = op1->type;
5858 if(op1->type)
5859 op1->type->refCount++;
5860 }
5861 return 0x1;
5862 }
5863
5864 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5865 {
5866 short value2 = op2->s;
5867
5868 exp->type = 2;
5869 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5870 if(!exp->expType)
5871 {
5872 exp->expType = op1->type;
5873 if(op1->type)
5874 op1->type->refCount++;
5875 }
5876 return 0x1;
5877 }
5878
5879 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5880 {
5881 unsigned short value2 = op2->us;
5882
5883 exp->type = 2;
5884 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5885 if(!exp->expType)
5886 {
5887 exp->expType = op1->type;
5888 if(op1->type)
5889 op1->type->refCount++;
5890 }
5891 return 0x1;
5892 }
5893
5894 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5895 {
5896 char value2 = op2->c;
5897
5898 exp->type = 2;
5899 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5900 if(!exp->expType)
5901 {
5902 exp->expType = op1->type;
5903 if(op1->type)
5904 op1->type->refCount++;
5905 }
5906 return 0x1;
5907 }
5908
5909 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5910 {
5911 unsigned char value2 = op2->uc;
5912
5913 exp->type = 2;
5914 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5915 if(!exp->expType)
5916 {
5917 exp->expType = op1->type;
5918 if(op1->type)
5919 op1->type->refCount++;
5920 }
5921 return 0x1;
5922 }
5923
5924 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5925 {
5926 float value2 = op2->f;
5927
5928 exp->type = 2;
5929 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5930 if(!exp->expType)
5931 {
5932 exp->expType = op1->type;
5933 if(op1->type)
5934 op1->type->refCount++;
5935 }
5936 return 0x1;
5937 }
5938
5939 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5940 {
5941 double value2 = op2->d;
5942
5943 exp->type = 2;
5944 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5945 if(!exp->expType)
5946 {
5947 exp->expType = op1->type;
5948 if(op1->type)
5949 op1->type->refCount++;
5950 }
5951 return 0x1;
5952 }
5953
5954 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5955 {
5956 int value2 = op2->i;
5957
5958 exp->type = 2;
5959 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5960 if(!exp->expType)
5961 {
5962 exp->expType = op1->type;
5963 if(op1->type)
5964 op1->type->refCount++;
5965 }
5966 return 0x1;
5967 }
5968
5969 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5970 {
5971 unsigned int value2 = op2->ui;
5972
5973 exp->type = 2;
5974 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5975 if(!exp->expType)
5976 {
5977 exp->expType = op1->type;
5978 if(op1->type)
5979 op1->type->refCount++;
5980 }
5981 return 0x1;
5982 }
5983
5984 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5985 {
5986 short value2 = op2->s;
5987
5988 exp->type = 2;
5989 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5990 if(!exp->expType)
5991 {
5992 exp->expType = op1->type;
5993 if(op1->type)
5994 op1->type->refCount++;
5995 }
5996 return 0x1;
5997 }
5998
5999 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 {
6001 unsigned short value2 = op2->us;
6002
6003 exp->type = 2;
6004 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6005 if(!exp->expType)
6006 {
6007 exp->expType = op1->type;
6008 if(op1->type)
6009 op1->type->refCount++;
6010 }
6011 return 0x1;
6012 }
6013
6014 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 {
6016 char value2 = op2->c;
6017
6018 exp->type = 2;
6019 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6020 if(!exp->expType)
6021 {
6022 exp->expType = op1->type;
6023 if(op1->type)
6024 op1->type->refCount++;
6025 }
6026 return 0x1;
6027 }
6028
6029 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 {
6031 unsigned char value2 = op2->uc;
6032
6033 exp->type = 2;
6034 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6035 if(!exp->expType)
6036 {
6037 exp->expType = op1->type;
6038 if(op1->type)
6039 op1->type->refCount++;
6040 }
6041 return 0x1;
6042 }
6043
6044 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6045 {
6046 exp->type = 2;
6047 exp->string = PrintInt(-op1->i);
6048 if(!exp->expType)
6049 {
6050 exp->expType = op1->type;
6051 if(op1->type)
6052 op1->type->refCount++;
6053 }
6054 return 0x1;
6055 }
6056
6057 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6058 {
6059 exp->type = 2;
6060 exp->string = PrintUInt(-op1->ui);
6061 if(!exp->expType)
6062 {
6063 exp->expType = op1->type;
6064 if(op1->type)
6065 op1->type->refCount++;
6066 }
6067 return 0x1;
6068 }
6069
6070 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6071 {
6072 exp->type = 2;
6073 exp->string = PrintShort(-op1->s);
6074 if(!exp->expType)
6075 {
6076 exp->expType = op1->type;
6077 if(op1->type)
6078 op1->type->refCount++;
6079 }
6080 return 0x1;
6081 }
6082
6083 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6084 {
6085 exp->type = 2;
6086 exp->string = PrintUShort(-op1->us);
6087 if(!exp->expType)
6088 {
6089 exp->expType = op1->type;
6090 if(op1->type)
6091 op1->type->refCount++;
6092 }
6093 return 0x1;
6094 }
6095
6096 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6097 {
6098 exp->type = 2;
6099 exp->string = PrintChar(-op1->c);
6100 if(!exp->expType)
6101 {
6102 exp->expType = op1->type;
6103 if(op1->type)
6104 op1->type->refCount++;
6105 }
6106 return 0x1;
6107 }
6108
6109 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6110 {
6111 exp->type = 2;
6112 exp->string = PrintUChar(-op1->uc);
6113 if(!exp->expType)
6114 {
6115 exp->expType = op1->type;
6116 if(op1->type)
6117 op1->type->refCount++;
6118 }
6119 return 0x1;
6120 }
6121
6122 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6123 {
6124 exp->type = 2;
6125 exp->string = PrintFloat(-op1->f);
6126 if(!exp->expType)
6127 {
6128 exp->expType = op1->type;
6129 if(op1->type)
6130 op1->type->refCount++;
6131 }
6132 return 0x1;
6133 }
6134
6135 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6136 {
6137 exp->type = 2;
6138 exp->string = PrintDouble(-op1->d);
6139 if(!exp->expType)
6140 {
6141 exp->expType = op1->type;
6142 if(op1->type)
6143 op1->type->refCount++;
6144 }
6145 return 0x1;
6146 }
6147
6148 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6149 {
6150 exp->type = 2;
6151 exp->string = PrintInt(++op1->i);
6152 if(!exp->expType)
6153 {
6154 exp->expType = op1->type;
6155 if(op1->type)
6156 op1->type->refCount++;
6157 }
6158 return 0x1;
6159 }
6160
6161 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6162 {
6163 exp->type = 2;
6164 exp->string = PrintUInt(++op1->ui);
6165 if(!exp->expType)
6166 {
6167 exp->expType = op1->type;
6168 if(op1->type)
6169 op1->type->refCount++;
6170 }
6171 return 0x1;
6172 }
6173
6174 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6175 {
6176 exp->type = 2;
6177 exp->string = PrintShort(++op1->s);
6178 if(!exp->expType)
6179 {
6180 exp->expType = op1->type;
6181 if(op1->type)
6182 op1->type->refCount++;
6183 }
6184 return 0x1;
6185 }
6186
6187 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6188 {
6189 exp->type = 2;
6190 exp->string = PrintUShort(++op1->us);
6191 if(!exp->expType)
6192 {
6193 exp->expType = op1->type;
6194 if(op1->type)
6195 op1->type->refCount++;
6196 }
6197 return 0x1;
6198 }
6199
6200 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6201 {
6202 exp->type = 2;
6203 exp->string = PrintChar(++op1->c);
6204 if(!exp->expType)
6205 {
6206 exp->expType = op1->type;
6207 if(op1->type)
6208 op1->type->refCount++;
6209 }
6210 return 0x1;
6211 }
6212
6213 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6214 {
6215 exp->type = 2;
6216 exp->string = PrintUChar(++op1->uc);
6217 if(!exp->expType)
6218 {
6219 exp->expType = op1->type;
6220 if(op1->type)
6221 op1->type->refCount++;
6222 }
6223 return 0x1;
6224 }
6225
6226 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6227 {
6228 exp->type = 2;
6229 exp->string = PrintFloat(++op1->f);
6230 if(!exp->expType)
6231 {
6232 exp->expType = op1->type;
6233 if(op1->type)
6234 op1->type->refCount++;
6235 }
6236 return 0x1;
6237 }
6238
6239 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6240 {
6241 exp->type = 2;
6242 exp->string = PrintDouble(++op1->d);
6243 if(!exp->expType)
6244 {
6245 exp->expType = op1->type;
6246 if(op1->type)
6247 op1->type->refCount++;
6248 }
6249 return 0x1;
6250 }
6251
6252 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6253 {
6254 exp->type = 2;
6255 exp->string = PrintInt(--op1->i);
6256 if(!exp->expType)
6257 {
6258 exp->expType = op1->type;
6259 if(op1->type)
6260 op1->type->refCount++;
6261 }
6262 return 0x1;
6263 }
6264
6265 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6266 {
6267 exp->type = 2;
6268 exp->string = PrintUInt(--op1->ui);
6269 if(!exp->expType)
6270 {
6271 exp->expType = op1->type;
6272 if(op1->type)
6273 op1->type->refCount++;
6274 }
6275 return 0x1;
6276 }
6277
6278 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6279 {
6280 exp->type = 2;
6281 exp->string = PrintShort(--op1->s);
6282 if(!exp->expType)
6283 {
6284 exp->expType = op1->type;
6285 if(op1->type)
6286 op1->type->refCount++;
6287 }
6288 return 0x1;
6289 }
6290
6291 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6292 {
6293 exp->type = 2;
6294 exp->string = PrintUShort(--op1->us);
6295 if(!exp->expType)
6296 {
6297 exp->expType = op1->type;
6298 if(op1->type)
6299 op1->type->refCount++;
6300 }
6301 return 0x1;
6302 }
6303
6304 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6305 {
6306 exp->type = 2;
6307 exp->string = PrintChar(--op1->c);
6308 if(!exp->expType)
6309 {
6310 exp->expType = op1->type;
6311 if(op1->type)
6312 op1->type->refCount++;
6313 }
6314 return 0x1;
6315 }
6316
6317 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6318 {
6319 exp->type = 2;
6320 exp->string = PrintUChar(--op1->uc);
6321 if(!exp->expType)
6322 {
6323 exp->expType = op1->type;
6324 if(op1->type)
6325 op1->type->refCount++;
6326 }
6327 return 0x1;
6328 }
6329
6330 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6331 {
6332 exp->type = 2;
6333 exp->string = PrintFloat(--op1->f);
6334 if(!exp->expType)
6335 {
6336 exp->expType = op1->type;
6337 if(op1->type)
6338 op1->type->refCount++;
6339 }
6340 return 0x1;
6341 }
6342
6343 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6344 {
6345 exp->type = 2;
6346 exp->string = PrintDouble(--op1->d);
6347 if(!exp->expType)
6348 {
6349 exp->expType = op1->type;
6350 if(op1->type)
6351 op1->type->refCount++;
6352 }
6353 return 0x1;
6354 }
6355
6356 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6357 {
6358 int value2 = op2->i;
6359
6360 exp->type = 2;
6361 exp->string = PrintInt(op1->i = value2);
6362 if(!exp->expType)
6363 {
6364 exp->expType = op1->type;
6365 if(op1->type)
6366 op1->type->refCount++;
6367 }
6368 return 0x1;
6369 }
6370
6371 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6372 {
6373 unsigned int value2 = op2->ui;
6374
6375 exp->type = 2;
6376 exp->string = PrintUInt(op1->ui = value2);
6377 if(!exp->expType)
6378 {
6379 exp->expType = op1->type;
6380 if(op1->type)
6381 op1->type->refCount++;
6382 }
6383 return 0x1;
6384 }
6385
6386 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6387 {
6388 short value2 = op2->s;
6389
6390 exp->type = 2;
6391 exp->string = PrintShort(op1->s = value2);
6392 if(!exp->expType)
6393 {
6394 exp->expType = op1->type;
6395 if(op1->type)
6396 op1->type->refCount++;
6397 }
6398 return 0x1;
6399 }
6400
6401 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6402 {
6403 unsigned short value2 = op2->us;
6404
6405 exp->type = 2;
6406 exp->string = PrintUShort(op1->us = value2);
6407 if(!exp->expType)
6408 {
6409 exp->expType = op1->type;
6410 if(op1->type)
6411 op1->type->refCount++;
6412 }
6413 return 0x1;
6414 }
6415
6416 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6417 {
6418 char value2 = op2->c;
6419
6420 exp->type = 2;
6421 exp->string = PrintChar(op1->c = value2);
6422 if(!exp->expType)
6423 {
6424 exp->expType = op1->type;
6425 if(op1->type)
6426 op1->type->refCount++;
6427 }
6428 return 0x1;
6429 }
6430
6431 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6432 {
6433 unsigned char value2 = op2->uc;
6434
6435 exp->type = 2;
6436 exp->string = PrintUChar(op1->uc = value2);
6437 if(!exp->expType)
6438 {
6439 exp->expType = op1->type;
6440 if(op1->type)
6441 op1->type->refCount++;
6442 }
6443 return 0x1;
6444 }
6445
6446 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6447 {
6448 float value2 = op2->f;
6449
6450 exp->type = 2;
6451 exp->string = PrintFloat(op1->f = value2);
6452 if(!exp->expType)
6453 {
6454 exp->expType = op1->type;
6455 if(op1->type)
6456 op1->type->refCount++;
6457 }
6458 return 0x1;
6459 }
6460
6461 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6462 {
6463 double value2 = op2->d;
6464
6465 exp->type = 2;
6466 exp->string = PrintDouble(op1->d = value2);
6467 if(!exp->expType)
6468 {
6469 exp->expType = op1->type;
6470 if(op1->type)
6471 op1->type->refCount++;
6472 }
6473 return 0x1;
6474 }
6475
6476 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6477 {
6478 int value2 = op2->i;
6479
6480 exp->type = 2;
6481 exp->string = PrintInt(op1->i += value2);
6482 if(!exp->expType)
6483 {
6484 exp->expType = op1->type;
6485 if(op1->type)
6486 op1->type->refCount++;
6487 }
6488 return 0x1;
6489 }
6490
6491 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6492 {
6493 unsigned int value2 = op2->ui;
6494
6495 exp->type = 2;
6496 exp->string = PrintUInt(op1->ui += value2);
6497 if(!exp->expType)
6498 {
6499 exp->expType = op1->type;
6500 if(op1->type)
6501 op1->type->refCount++;
6502 }
6503 return 0x1;
6504 }
6505
6506 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6507 {
6508 short value2 = op2->s;
6509
6510 exp->type = 2;
6511 exp->string = PrintShort(op1->s += value2);
6512 if(!exp->expType)
6513 {
6514 exp->expType = op1->type;
6515 if(op1->type)
6516 op1->type->refCount++;
6517 }
6518 return 0x1;
6519 }
6520
6521 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6522 {
6523 unsigned short value2 = op2->us;
6524
6525 exp->type = 2;
6526 exp->string = PrintUShort(op1->us += value2);
6527 if(!exp->expType)
6528 {
6529 exp->expType = op1->type;
6530 if(op1->type)
6531 op1->type->refCount++;
6532 }
6533 return 0x1;
6534 }
6535
6536 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6537 {
6538 char value2 = op2->c;
6539
6540 exp->type = 2;
6541 exp->string = PrintChar(op1->c += value2);
6542 if(!exp->expType)
6543 {
6544 exp->expType = op1->type;
6545 if(op1->type)
6546 op1->type->refCount++;
6547 }
6548 return 0x1;
6549 }
6550
6551 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6552 {
6553 unsigned char value2 = op2->uc;
6554
6555 exp->type = 2;
6556 exp->string = PrintUChar(op1->uc += value2);
6557 if(!exp->expType)
6558 {
6559 exp->expType = op1->type;
6560 if(op1->type)
6561 op1->type->refCount++;
6562 }
6563 return 0x1;
6564 }
6565
6566 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6567 {
6568 float value2 = op2->f;
6569
6570 exp->type = 2;
6571 exp->string = PrintFloat(op1->f += value2);
6572 if(!exp->expType)
6573 {
6574 exp->expType = op1->type;
6575 if(op1->type)
6576 op1->type->refCount++;
6577 }
6578 return 0x1;
6579 }
6580
6581 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6582 {
6583 double value2 = op2->d;
6584
6585 exp->type = 2;
6586 exp->string = PrintDouble(op1->d += value2);
6587 if(!exp->expType)
6588 {
6589 exp->expType = op1->type;
6590 if(op1->type)
6591 op1->type->refCount++;
6592 }
6593 return 0x1;
6594 }
6595
6596 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6597 {
6598 int value2 = op2->i;
6599
6600 exp->type = 2;
6601 exp->string = PrintInt(op1->i -= value2);
6602 if(!exp->expType)
6603 {
6604 exp->expType = op1->type;
6605 if(op1->type)
6606 op1->type->refCount++;
6607 }
6608 return 0x1;
6609 }
6610
6611 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6612 {
6613 unsigned int value2 = op2->ui;
6614
6615 exp->type = 2;
6616 exp->string = PrintUInt(op1->ui -= value2);
6617 if(!exp->expType)
6618 {
6619 exp->expType = op1->type;
6620 if(op1->type)
6621 op1->type->refCount++;
6622 }
6623 return 0x1;
6624 }
6625
6626 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6627 {
6628 short value2 = op2->s;
6629
6630 exp->type = 2;
6631 exp->string = PrintShort(op1->s -= value2);
6632 if(!exp->expType)
6633 {
6634 exp->expType = op1->type;
6635 if(op1->type)
6636 op1->type->refCount++;
6637 }
6638 return 0x1;
6639 }
6640
6641 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6642 {
6643 unsigned short value2 = op2->us;
6644
6645 exp->type = 2;
6646 exp->string = PrintUShort(op1->us -= value2);
6647 if(!exp->expType)
6648 {
6649 exp->expType = op1->type;
6650 if(op1->type)
6651 op1->type->refCount++;
6652 }
6653 return 0x1;
6654 }
6655
6656 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6657 {
6658 char value2 = op2->c;
6659
6660 exp->type = 2;
6661 exp->string = PrintChar(op1->c -= value2);
6662 if(!exp->expType)
6663 {
6664 exp->expType = op1->type;
6665 if(op1->type)
6666 op1->type->refCount++;
6667 }
6668 return 0x1;
6669 }
6670
6671 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6672 {
6673 unsigned char value2 = op2->uc;
6674
6675 exp->type = 2;
6676 exp->string = PrintUChar(op1->uc -= value2);
6677 if(!exp->expType)
6678 {
6679 exp->expType = op1->type;
6680 if(op1->type)
6681 op1->type->refCount++;
6682 }
6683 return 0x1;
6684 }
6685
6686 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6687 {
6688 float value2 = op2->f;
6689
6690 exp->type = 2;
6691 exp->string = PrintFloat(op1->f -= value2);
6692 if(!exp->expType)
6693 {
6694 exp->expType = op1->type;
6695 if(op1->type)
6696 op1->type->refCount++;
6697 }
6698 return 0x1;
6699 }
6700
6701 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6702 {
6703 double value2 = op2->d;
6704
6705 exp->type = 2;
6706 exp->string = PrintDouble(op1->d -= value2);
6707 if(!exp->expType)
6708 {
6709 exp->expType = op1->type;
6710 if(op1->type)
6711 op1->type->refCount++;
6712 }
6713 return 0x1;
6714 }
6715
6716 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6717 {
6718 int value2 = op2->i;
6719
6720 exp->type = 2;
6721 exp->string = PrintInt(op1->i *= value2);
6722 if(!exp->expType)
6723 {
6724 exp->expType = op1->type;
6725 if(op1->type)
6726 op1->type->refCount++;
6727 }
6728 return 0x1;
6729 }
6730
6731 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6732 {
6733 unsigned int value2 = op2->ui;
6734
6735 exp->type = 2;
6736 exp->string = PrintUInt(op1->ui *= value2);
6737 if(!exp->expType)
6738 {
6739 exp->expType = op1->type;
6740 if(op1->type)
6741 op1->type->refCount++;
6742 }
6743 return 0x1;
6744 }
6745
6746 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6747 {
6748 short value2 = op2->s;
6749
6750 exp->type = 2;
6751 exp->string = PrintShort(op1->s *= value2);
6752 if(!exp->expType)
6753 {
6754 exp->expType = op1->type;
6755 if(op1->type)
6756 op1->type->refCount++;
6757 }
6758 return 0x1;
6759 }
6760
6761 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6762 {
6763 unsigned short value2 = op2->us;
6764
6765 exp->type = 2;
6766 exp->string = PrintUShort(op1->us *= value2);
6767 if(!exp->expType)
6768 {
6769 exp->expType = op1->type;
6770 if(op1->type)
6771 op1->type->refCount++;
6772 }
6773 return 0x1;
6774 }
6775
6776 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6777 {
6778 char value2 = op2->c;
6779
6780 exp->type = 2;
6781 exp->string = PrintChar(op1->c *= value2);
6782 if(!exp->expType)
6783 {
6784 exp->expType = op1->type;
6785 if(op1->type)
6786 op1->type->refCount++;
6787 }
6788 return 0x1;
6789 }
6790
6791 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6792 {
6793 unsigned char value2 = op2->uc;
6794
6795 exp->type = 2;
6796 exp->string = PrintUChar(op1->uc *= value2);
6797 if(!exp->expType)
6798 {
6799 exp->expType = op1->type;
6800 if(op1->type)
6801 op1->type->refCount++;
6802 }
6803 return 0x1;
6804 }
6805
6806 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6807 {
6808 float value2 = op2->f;
6809
6810 exp->type = 2;
6811 exp->string = PrintFloat(op1->f *= value2);
6812 if(!exp->expType)
6813 {
6814 exp->expType = op1->type;
6815 if(op1->type)
6816 op1->type->refCount++;
6817 }
6818 return 0x1;
6819 }
6820
6821 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6822 {
6823 double value2 = op2->d;
6824
6825 exp->type = 2;
6826 exp->string = PrintDouble(op1->d *= value2);
6827 if(!exp->expType)
6828 {
6829 exp->expType = op1->type;
6830 if(op1->type)
6831 op1->type->refCount++;
6832 }
6833 return 0x1;
6834 }
6835
6836 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6837 {
6838 int value2 = op2->i;
6839
6840 exp->type = 2;
6841 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6842 if(!exp->expType)
6843 {
6844 exp->expType = op1->type;
6845 if(op1->type)
6846 op1->type->refCount++;
6847 }
6848 return 0x1;
6849 }
6850
6851 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6852 {
6853 unsigned int value2 = op2->ui;
6854
6855 exp->type = 2;
6856 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6857 if(!exp->expType)
6858 {
6859 exp->expType = op1->type;
6860 if(op1->type)
6861 op1->type->refCount++;
6862 }
6863 return 0x1;
6864 }
6865
6866 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6867 {
6868 short value2 = op2->s;
6869
6870 exp->type = 2;
6871 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6872 if(!exp->expType)
6873 {
6874 exp->expType = op1->type;
6875 if(op1->type)
6876 op1->type->refCount++;
6877 }
6878 return 0x1;
6879 }
6880
6881 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6882 {
6883 unsigned short value2 = op2->us;
6884
6885 exp->type = 2;
6886 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6887 if(!exp->expType)
6888 {
6889 exp->expType = op1->type;
6890 if(op1->type)
6891 op1->type->refCount++;
6892 }
6893 return 0x1;
6894 }
6895
6896 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6897 {
6898 char value2 = op2->c;
6899
6900 exp->type = 2;
6901 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 0x1;
6909 }
6910
6911 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6912 {
6913 unsigned char value2 = op2->uc;
6914
6915 exp->type = 2;
6916 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6917 if(!exp->expType)
6918 {
6919 exp->expType = op1->type;
6920 if(op1->type)
6921 op1->type->refCount++;
6922 }
6923 return 0x1;
6924 }
6925
6926 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6927 {
6928 float value2 = op2->f;
6929
6930 exp->type = 2;
6931 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6932 if(!exp->expType)
6933 {
6934 exp->expType = op1->type;
6935 if(op1->type)
6936 op1->type->refCount++;
6937 }
6938 return 0x1;
6939 }
6940
6941 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6942 {
6943 double value2 = op2->d;
6944
6945 exp->type = 2;
6946 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6947 if(!exp->expType)
6948 {
6949 exp->expType = op1->type;
6950 if(op1->type)
6951 op1->type->refCount++;
6952 }
6953 return 0x1;
6954 }
6955
6956 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6957 {
6958 int value2 = op2->i;
6959
6960 exp->type = 2;
6961 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6962 if(!exp->expType)
6963 {
6964 exp->expType = op1->type;
6965 if(op1->type)
6966 op1->type->refCount++;
6967 }
6968 return 0x1;
6969 }
6970
6971 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6972 {
6973 unsigned int value2 = op2->ui;
6974
6975 exp->type = 2;
6976 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6977 if(!exp->expType)
6978 {
6979 exp->expType = op1->type;
6980 if(op1->type)
6981 op1->type->refCount++;
6982 }
6983 return 0x1;
6984 }
6985
6986 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6987 {
6988 short value2 = op2->s;
6989
6990 exp->type = 2;
6991 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6992 if(!exp->expType)
6993 {
6994 exp->expType = op1->type;
6995 if(op1->type)
6996 op1->type->refCount++;
6997 }
6998 return 0x1;
6999 }
7000
7001 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7002 {
7003 unsigned short value2 = op2->us;
7004
7005 exp->type = 2;
7006 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7007 if(!exp->expType)
7008 {
7009 exp->expType = op1->type;
7010 if(op1->type)
7011 op1->type->refCount++;
7012 }
7013 return 0x1;
7014 }
7015
7016 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7017 {
7018 char value2 = op2->c;
7019
7020 exp->type = 2;
7021 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7022 if(!exp->expType)
7023 {
7024 exp->expType = op1->type;
7025 if(op1->type)
7026 op1->type->refCount++;
7027 }
7028 return 0x1;
7029 }
7030
7031 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7032 {
7033 unsigned char value2 = op2->uc;
7034
7035 exp->type = 2;
7036 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7037 if(!exp->expType)
7038 {
7039 exp->expType = op1->type;
7040 if(op1->type)
7041 op1->type->refCount++;
7042 }
7043 return 0x1;
7044 }
7045
7046 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7047 {
7048 int value2 = op2->i;
7049
7050 exp->type = 2;
7051 exp->string = PrintInt(op1->i & value2);
7052 if(!exp->expType)
7053 {
7054 exp->expType = op1->type;
7055 if(op1->type)
7056 op1->type->refCount++;
7057 }
7058 return 0x1;
7059 }
7060
7061 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7062 {
7063 unsigned int value2 = op2->ui;
7064
7065 exp->type = 2;
7066 exp->string = PrintUInt(op1->ui & value2);
7067 if(!exp->expType)
7068 {
7069 exp->expType = op1->type;
7070 if(op1->type)
7071 op1->type->refCount++;
7072 }
7073 return 0x1;
7074 }
7075
7076 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7077 {
7078 short value2 = op2->s;
7079
7080 exp->type = 2;
7081 exp->string = PrintShort(op1->s & value2);
7082 if(!exp->expType)
7083 {
7084 exp->expType = op1->type;
7085 if(op1->type)
7086 op1->type->refCount++;
7087 }
7088 return 0x1;
7089 }
7090
7091 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7092 {
7093 unsigned short value2 = op2->us;
7094
7095 exp->type = 2;
7096 exp->string = PrintUShort(op1->us & value2);
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 0x1;
7104 }
7105
7106 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7107 {
7108 char value2 = op2->c;
7109
7110 exp->type = 2;
7111 exp->string = PrintChar(op1->c & value2);
7112 if(!exp->expType)
7113 {
7114 exp->expType = op1->type;
7115 if(op1->type)
7116 op1->type->refCount++;
7117 }
7118 return 0x1;
7119 }
7120
7121 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7122 {
7123 unsigned char value2 = op2->uc;
7124
7125 exp->type = 2;
7126 exp->string = PrintUChar(op1->uc & value2);
7127 if(!exp->expType)
7128 {
7129 exp->expType = op1->type;
7130 if(op1->type)
7131 op1->type->refCount++;
7132 }
7133 return 0x1;
7134 }
7135
7136 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7137 {
7138 int value2 = op2->i;
7139
7140 exp->type = 2;
7141 exp->string = PrintInt(op1->i | value2);
7142 if(!exp->expType)
7143 {
7144 exp->expType = op1->type;
7145 if(op1->type)
7146 op1->type->refCount++;
7147 }
7148 return 0x1;
7149 }
7150
7151 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7152 {
7153 unsigned int value2 = op2->ui;
7154
7155 exp->type = 2;
7156 exp->string = PrintUInt(op1->ui | value2);
7157 if(!exp->expType)
7158 {
7159 exp->expType = op1->type;
7160 if(op1->type)
7161 op1->type->refCount++;
7162 }
7163 return 0x1;
7164 }
7165
7166 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7167 {
7168 short value2 = op2->s;
7169
7170 exp->type = 2;
7171 exp->string = PrintShort(op1->s | value2);
7172 if(!exp->expType)
7173 {
7174 exp->expType = op1->type;
7175 if(op1->type)
7176 op1->type->refCount++;
7177 }
7178 return 0x1;
7179 }
7180
7181 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7182 {
7183 unsigned short value2 = op2->us;
7184
7185 exp->type = 2;
7186 exp->string = PrintUShort(op1->us | value2);
7187 if(!exp->expType)
7188 {
7189 exp->expType = op1->type;
7190 if(op1->type)
7191 op1->type->refCount++;
7192 }
7193 return 0x1;
7194 }
7195
7196 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7197 {
7198 char value2 = op2->c;
7199
7200 exp->type = 2;
7201 exp->string = PrintChar(op1->c | value2);
7202 if(!exp->expType)
7203 {
7204 exp->expType = op1->type;
7205 if(op1->type)
7206 op1->type->refCount++;
7207 }
7208 return 0x1;
7209 }
7210
7211 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7212 {
7213 unsigned char value2 = op2->uc;
7214
7215 exp->type = 2;
7216 exp->string = PrintUChar(op1->uc | value2);
7217 if(!exp->expType)
7218 {
7219 exp->expType = op1->type;
7220 if(op1->type)
7221 op1->type->refCount++;
7222 }
7223 return 0x1;
7224 }
7225
7226 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7227 {
7228 int value2 = op2->i;
7229
7230 exp->type = 2;
7231 exp->string = PrintInt(op1->i ^ value2);
7232 if(!exp->expType)
7233 {
7234 exp->expType = op1->type;
7235 if(op1->type)
7236 op1->type->refCount++;
7237 }
7238 return 0x1;
7239 }
7240
7241 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7242 {
7243 unsigned int value2 = op2->ui;
7244
7245 exp->type = 2;
7246 exp->string = PrintUInt(op1->ui ^ value2);
7247 if(!exp->expType)
7248 {
7249 exp->expType = op1->type;
7250 if(op1->type)
7251 op1->type->refCount++;
7252 }
7253 return 0x1;
7254 }
7255
7256 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7257 {
7258 short value2 = op2->s;
7259
7260 exp->type = 2;
7261 exp->string = PrintShort(op1->s ^ value2);
7262 if(!exp->expType)
7263 {
7264 exp->expType = op1->type;
7265 if(op1->type)
7266 op1->type->refCount++;
7267 }
7268 return 0x1;
7269 }
7270
7271 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7272 {
7273 unsigned short value2 = op2->us;
7274
7275 exp->type = 2;
7276 exp->string = PrintUShort(op1->us ^ value2);
7277 if(!exp->expType)
7278 {
7279 exp->expType = op1->type;
7280 if(op1->type)
7281 op1->type->refCount++;
7282 }
7283 return 0x1;
7284 }
7285
7286 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7287 {
7288 char value2 = op2->c;
7289
7290 exp->type = 2;
7291 exp->string = PrintChar(op1->c ^ value2);
7292 if(!exp->expType)
7293 {
7294 exp->expType = op1->type;
7295 if(op1->type)
7296 op1->type->refCount++;
7297 }
7298 return 0x1;
7299 }
7300
7301 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7302 {
7303 unsigned char value2 = op2->uc;
7304
7305 exp->type = 2;
7306 exp->string = PrintUChar(op1->uc ^ value2);
7307 if(!exp->expType)
7308 {
7309 exp->expType = op1->type;
7310 if(op1->type)
7311 op1->type->refCount++;
7312 }
7313 return 0x1;
7314 }
7315
7316 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7317 {
7318 int value2 = op2->i;
7319
7320 exp->type = 2;
7321 exp->string = PrintInt(op1->i << value2);
7322 if(!exp->expType)
7323 {
7324 exp->expType = op1->type;
7325 if(op1->type)
7326 op1->type->refCount++;
7327 }
7328 return 0x1;
7329 }
7330
7331 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7332 {
7333 unsigned int value2 = op2->ui;
7334
7335 exp->type = 2;
7336 exp->string = PrintUInt(op1->ui << value2);
7337 if(!exp->expType)
7338 {
7339 exp->expType = op1->type;
7340 if(op1->type)
7341 op1->type->refCount++;
7342 }
7343 return 0x1;
7344 }
7345
7346 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7347 {
7348 short value2 = op2->s;
7349
7350 exp->type = 2;
7351 exp->string = PrintShort(op1->s << value2);
7352 if(!exp->expType)
7353 {
7354 exp->expType = op1->type;
7355 if(op1->type)
7356 op1->type->refCount++;
7357 }
7358 return 0x1;
7359 }
7360
7361 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7362 {
7363 unsigned short value2 = op2->us;
7364
7365 exp->type = 2;
7366 exp->string = PrintUShort(op1->us << value2);
7367 if(!exp->expType)
7368 {
7369 exp->expType = op1->type;
7370 if(op1->type)
7371 op1->type->refCount++;
7372 }
7373 return 0x1;
7374 }
7375
7376 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7377 {
7378 char value2 = op2->c;
7379
7380 exp->type = 2;
7381 exp->string = PrintChar(op1->c << value2);
7382 if(!exp->expType)
7383 {
7384 exp->expType = op1->type;
7385 if(op1->type)
7386 op1->type->refCount++;
7387 }
7388 return 0x1;
7389 }
7390
7391 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7392 {
7393 unsigned char value2 = op2->uc;
7394
7395 exp->type = 2;
7396 exp->string = PrintUChar(op1->uc << value2);
7397 if(!exp->expType)
7398 {
7399 exp->expType = op1->type;
7400 if(op1->type)
7401 op1->type->refCount++;
7402 }
7403 return 0x1;
7404 }
7405
7406 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7407 {
7408 int value2 = op2->i;
7409
7410 exp->type = 2;
7411 exp->string = PrintInt(op1->i >> value2);
7412 if(!exp->expType)
7413 {
7414 exp->expType = op1->type;
7415 if(op1->type)
7416 op1->type->refCount++;
7417 }
7418 return 0x1;
7419 }
7420
7421 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7422 {
7423 unsigned int value2 = op2->ui;
7424
7425 exp->type = 2;
7426 exp->string = PrintUInt(op1->ui >> value2);
7427 if(!exp->expType)
7428 {
7429 exp->expType = op1->type;
7430 if(op1->type)
7431 op1->type->refCount++;
7432 }
7433 return 0x1;
7434 }
7435
7436 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7437 {
7438 short value2 = op2->s;
7439
7440 exp->type = 2;
7441 exp->string = PrintShort(op1->s >> value2);
7442 if(!exp->expType)
7443 {
7444 exp->expType = op1->type;
7445 if(op1->type)
7446 op1->type->refCount++;
7447 }
7448 return 0x1;
7449 }
7450
7451 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7452 {
7453 unsigned short value2 = op2->us;
7454
7455 exp->type = 2;
7456 exp->string = PrintUShort(op1->us >> value2);
7457 if(!exp->expType)
7458 {
7459 exp->expType = op1->type;
7460 if(op1->type)
7461 op1->type->refCount++;
7462 }
7463 return 0x1;
7464 }
7465
7466 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7467 {
7468 char value2 = op2->c;
7469
7470 exp->type = 2;
7471 exp->string = PrintChar(op1->c >> value2);
7472 if(!exp->expType)
7473 {
7474 exp->expType = op1->type;
7475 if(op1->type)
7476 op1->type->refCount++;
7477 }
7478 return 0x1;
7479 }
7480
7481 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7482 {
7483 unsigned char value2 = op2->uc;
7484
7485 exp->type = 2;
7486 exp->string = PrintUChar(op1->uc >> value2);
7487 if(!exp->expType)
7488 {
7489 exp->expType = op1->type;
7490 if(op1->type)
7491 op1->type->refCount++;
7492 }
7493 return 0x1;
7494 }
7495
7496 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7497 {
7498 exp->type = 2;
7499 exp->string = PrintInt(~op1->i);
7500 if(!exp->expType)
7501 {
7502 exp->expType = op1->type;
7503 if(op1->type)
7504 op1->type->refCount++;
7505 }
7506 return 0x1;
7507 }
7508
7509 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7510 {
7511 exp->type = 2;
7512 exp->string = PrintUInt(~op1->ui);
7513 if(!exp->expType)
7514 {
7515 exp->expType = op1->type;
7516 if(op1->type)
7517 op1->type->refCount++;
7518 }
7519 return 0x1;
7520 }
7521
7522 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7523 {
7524 exp->type = 2;
7525 exp->string = PrintShort(~op1->s);
7526 if(!exp->expType)
7527 {
7528 exp->expType = op1->type;
7529 if(op1->type)
7530 op1->type->refCount++;
7531 }
7532 return 0x1;
7533 }
7534
7535 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7536 {
7537 exp->type = 2;
7538 exp->string = PrintUShort(~op1->us);
7539 if(!exp->expType)
7540 {
7541 exp->expType = op1->type;
7542 if(op1->type)
7543 op1->type->refCount++;
7544 }
7545 return 0x1;
7546 }
7547
7548 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7549 {
7550 exp->type = 2;
7551 exp->string = PrintChar(~op1->c);
7552 if(!exp->expType)
7553 {
7554 exp->expType = op1->type;
7555 if(op1->type)
7556 op1->type->refCount++;
7557 }
7558 return 0x1;
7559 }
7560
7561 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7562 {
7563 exp->type = 2;
7564 exp->string = PrintUChar(~op1->uc);
7565 if(!exp->expType)
7566 {
7567 exp->expType = op1->type;
7568 if(op1->type)
7569 op1->type->refCount++;
7570 }
7571 return 0x1;
7572 }
7573
7574 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7575 {
7576 int value2 = op2->i;
7577
7578 exp->type = 2;
7579 exp->string = PrintInt(op1->i &= value2);
7580 if(!exp->expType)
7581 {
7582 exp->expType = op1->type;
7583 if(op1->type)
7584 op1->type->refCount++;
7585 }
7586 return 0x1;
7587 }
7588
7589 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7590 {
7591 unsigned int value2 = op2->ui;
7592
7593 exp->type = 2;
7594 exp->string = PrintUInt(op1->ui &= value2);
7595 if(!exp->expType)
7596 {
7597 exp->expType = op1->type;
7598 if(op1->type)
7599 op1->type->refCount++;
7600 }
7601 return 0x1;
7602 }
7603
7604 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7605 {
7606 short value2 = op2->s;
7607
7608 exp->type = 2;
7609 exp->string = PrintShort(op1->s &= value2);
7610 if(!exp->expType)
7611 {
7612 exp->expType = op1->type;
7613 if(op1->type)
7614 op1->type->refCount++;
7615 }
7616 return 0x1;
7617 }
7618
7619 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7620 {
7621 unsigned short value2 = op2->us;
7622
7623 exp->type = 2;
7624 exp->string = PrintUShort(op1->us &= value2);
7625 if(!exp->expType)
7626 {
7627 exp->expType = op1->type;
7628 if(op1->type)
7629 op1->type->refCount++;
7630 }
7631 return 0x1;
7632 }
7633
7634 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7635 {
7636 char value2 = op2->c;
7637
7638 exp->type = 2;
7639 exp->string = PrintChar(op1->c &= value2);
7640 if(!exp->expType)
7641 {
7642 exp->expType = op1->type;
7643 if(op1->type)
7644 op1->type->refCount++;
7645 }
7646 return 0x1;
7647 }
7648
7649 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7650 {
7651 unsigned char value2 = op2->uc;
7652
7653 exp->type = 2;
7654 exp->string = PrintUChar(op1->uc &= value2);
7655 if(!exp->expType)
7656 {
7657 exp->expType = op1->type;
7658 if(op1->type)
7659 op1->type->refCount++;
7660 }
7661 return 0x1;
7662 }
7663
7664 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7665 {
7666 int value2 = op2->i;
7667
7668 exp->type = 2;
7669 exp->string = PrintInt(op1->i |= value2);
7670 if(!exp->expType)
7671 {
7672 exp->expType = op1->type;
7673 if(op1->type)
7674 op1->type->refCount++;
7675 }
7676 return 0x1;
7677 }
7678
7679 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7680 {
7681 unsigned int value2 = op2->ui;
7682
7683 exp->type = 2;
7684 exp->string = PrintUInt(op1->ui |= value2);
7685 if(!exp->expType)
7686 {
7687 exp->expType = op1->type;
7688 if(op1->type)
7689 op1->type->refCount++;
7690 }
7691 return 0x1;
7692 }
7693
7694 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7695 {
7696 short value2 = op2->s;
7697
7698 exp->type = 2;
7699 exp->string = PrintShort(op1->s |= value2);
7700 if(!exp->expType)
7701 {
7702 exp->expType = op1->type;
7703 if(op1->type)
7704 op1->type->refCount++;
7705 }
7706 return 0x1;
7707 }
7708
7709 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7710 {
7711 unsigned short value2 = op2->us;
7712
7713 exp->type = 2;
7714 exp->string = PrintUShort(op1->us |= value2);
7715 if(!exp->expType)
7716 {
7717 exp->expType = op1->type;
7718 if(op1->type)
7719 op1->type->refCount++;
7720 }
7721 return 0x1;
7722 }
7723
7724 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7725 {
7726 char value2 = op2->c;
7727
7728 exp->type = 2;
7729 exp->string = PrintChar(op1->c |= value2);
7730 if(!exp->expType)
7731 {
7732 exp->expType = op1->type;
7733 if(op1->type)
7734 op1->type->refCount++;
7735 }
7736 return 0x1;
7737 }
7738
7739 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7740 {
7741 unsigned char value2 = op2->uc;
7742
7743 exp->type = 2;
7744 exp->string = PrintUChar(op1->uc |= value2);
7745 if(!exp->expType)
7746 {
7747 exp->expType = op1->type;
7748 if(op1->type)
7749 op1->type->refCount++;
7750 }
7751 return 0x1;
7752 }
7753
7754 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7755 {
7756 int value2 = op2->i;
7757
7758 exp->type = 2;
7759 exp->string = PrintInt(op1->i ^= value2);
7760 if(!exp->expType)
7761 {
7762 exp->expType = op1->type;
7763 if(op1->type)
7764 op1->type->refCount++;
7765 }
7766 return 0x1;
7767 }
7768
7769 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7770 {
7771 unsigned int value2 = op2->ui;
7772
7773 exp->type = 2;
7774 exp->string = PrintUInt(op1->ui ^= value2);
7775 if(!exp->expType)
7776 {
7777 exp->expType = op1->type;
7778 if(op1->type)
7779 op1->type->refCount++;
7780 }
7781 return 0x1;
7782 }
7783
7784 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7785 {
7786 short value2 = op2->s;
7787
7788 exp->type = 2;
7789 exp->string = PrintShort(op1->s ^= value2);
7790 if(!exp->expType)
7791 {
7792 exp->expType = op1->type;
7793 if(op1->type)
7794 op1->type->refCount++;
7795 }
7796 return 0x1;
7797 }
7798
7799 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7800 {
7801 unsigned short value2 = op2->us;
7802
7803 exp->type = 2;
7804 exp->string = PrintUShort(op1->us ^= value2);
7805 if(!exp->expType)
7806 {
7807 exp->expType = op1->type;
7808 if(op1->type)
7809 op1->type->refCount++;
7810 }
7811 return 0x1;
7812 }
7813
7814 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7815 {
7816 char value2 = op2->c;
7817
7818 exp->type = 2;
7819 exp->string = PrintChar(op1->c ^= value2);
7820 if(!exp->expType)
7821 {
7822 exp->expType = op1->type;
7823 if(op1->type)
7824 op1->type->refCount++;
7825 }
7826 return 0x1;
7827 }
7828
7829 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7830 {
7831 unsigned char value2 = op2->uc;
7832
7833 exp->type = 2;
7834 exp->string = PrintUChar(op1->uc ^= value2);
7835 if(!exp->expType)
7836 {
7837 exp->expType = op1->type;
7838 if(op1->type)
7839 op1->type->refCount++;
7840 }
7841 return 0x1;
7842 }
7843
7844 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7845 {
7846 int value2 = op2->i;
7847
7848 exp->type = 2;
7849 exp->string = PrintInt(op1->i <<= value2);
7850 if(!exp->expType)
7851 {
7852 exp->expType = op1->type;
7853 if(op1->type)
7854 op1->type->refCount++;
7855 }
7856 return 0x1;
7857 }
7858
7859 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7860 {
7861 unsigned int value2 = op2->ui;
7862
7863 exp->type = 2;
7864 exp->string = PrintUInt(op1->ui <<= value2);
7865 if(!exp->expType)
7866 {
7867 exp->expType = op1->type;
7868 if(op1->type)
7869 op1->type->refCount++;
7870 }
7871 return 0x1;
7872 }
7873
7874 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7875 {
7876 short value2 = op2->s;
7877
7878 exp->type = 2;
7879 exp->string = PrintShort(op1->s <<= value2);
7880 if(!exp->expType)
7881 {
7882 exp->expType = op1->type;
7883 if(op1->type)
7884 op1->type->refCount++;
7885 }
7886 return 0x1;
7887 }
7888
7889 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7890 {
7891 unsigned short value2 = op2->us;
7892
7893 exp->type = 2;
7894 exp->string = PrintUShort(op1->us <<= value2);
7895 if(!exp->expType)
7896 {
7897 exp->expType = op1->type;
7898 if(op1->type)
7899 op1->type->refCount++;
7900 }
7901 return 0x1;
7902 }
7903
7904 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7905 {
7906 char value2 = op2->c;
7907
7908 exp->type = 2;
7909 exp->string = PrintChar(op1->c <<= value2);
7910 if(!exp->expType)
7911 {
7912 exp->expType = op1->type;
7913 if(op1->type)
7914 op1->type->refCount++;
7915 }
7916 return 0x1;
7917 }
7918
7919 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7920 {
7921 unsigned char value2 = op2->uc;
7922
7923 exp->type = 2;
7924 exp->string = PrintUChar(op1->uc <<= value2);
7925 if(!exp->expType)
7926 {
7927 exp->expType = op1->type;
7928 if(op1->type)
7929 op1->type->refCount++;
7930 }
7931 return 0x1;
7932 }
7933
7934 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7935 {
7936 int value2 = op2->i;
7937
7938 exp->type = 2;
7939 exp->string = PrintInt(op1->i >>= value2);
7940 if(!exp->expType)
7941 {
7942 exp->expType = op1->type;
7943 if(op1->type)
7944 op1->type->refCount++;
7945 }
7946 return 0x1;
7947 }
7948
7949 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7950 {
7951 unsigned int value2 = op2->ui;
7952
7953 exp->type = 2;
7954 exp->string = PrintUInt(op1->ui >>= value2);
7955 if(!exp->expType)
7956 {
7957 exp->expType = op1->type;
7958 if(op1->type)
7959 op1->type->refCount++;
7960 }
7961 return 0x1;
7962 }
7963
7964 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7965 {
7966 short value2 = op2->s;
7967
7968 exp->type = 2;
7969 exp->string = PrintShort(op1->s >>= value2);
7970 if(!exp->expType)
7971 {
7972 exp->expType = op1->type;
7973 if(op1->type)
7974 op1->type->refCount++;
7975 }
7976 return 0x1;
7977 }
7978
7979 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7980 {
7981 unsigned short value2 = op2->us;
7982
7983 exp->type = 2;
7984 exp->string = PrintUShort(op1->us >>= value2);
7985 if(!exp->expType)
7986 {
7987 exp->expType = op1->type;
7988 if(op1->type)
7989 op1->type->refCount++;
7990 }
7991 return 0x1;
7992 }
7993
7994 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7995 {
7996 char value2 = op2->c;
7997
7998 exp->type = 2;
7999 exp->string = PrintChar(op1->c >>= value2);
8000 if(!exp->expType)
8001 {
8002 exp->expType = op1->type;
8003 if(op1->type)
8004 op1->type->refCount++;
8005 }
8006 return 0x1;
8007 }
8008
8009 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8010 {
8011 unsigned char value2 = op2->uc;
8012
8013 exp->type = 2;
8014 exp->string = PrintUChar(op1->uc >>= value2);
8015 if(!exp->expType)
8016 {
8017 exp->expType = op1->type;
8018 if(op1->type)
8019 op1->type->refCount++;
8020 }
8021 return 0x1;
8022 }
8023
8024 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8025 {
8026 exp->type = 2;
8027 exp->string = PrintInt(!op1->i);
8028 if(!exp->expType)
8029 {
8030 exp->expType = op1->type;
8031 if(op1->type)
8032 op1->type->refCount++;
8033 }
8034 return 0x1;
8035 }
8036
8037 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8038 {
8039 exp->type = 2;
8040 exp->string = PrintUInt(!op1->ui);
8041 if(!exp->expType)
8042 {
8043 exp->expType = op1->type;
8044 if(op1->type)
8045 op1->type->refCount++;
8046 }
8047 return 0x1;
8048 }
8049
8050 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8051 {
8052 exp->type = 2;
8053 exp->string = PrintShort(!op1->s);
8054 if(!exp->expType)
8055 {
8056 exp->expType = op1->type;
8057 if(op1->type)
8058 op1->type->refCount++;
8059 }
8060 return 0x1;
8061 }
8062
8063 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8064 {
8065 exp->type = 2;
8066 exp->string = PrintUShort(!op1->us);
8067 if(!exp->expType)
8068 {
8069 exp->expType = op1->type;
8070 if(op1->type)
8071 op1->type->refCount++;
8072 }
8073 return 0x1;
8074 }
8075
8076 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8077 {
8078 exp->type = 2;
8079 exp->string = PrintChar(!op1->c);
8080 if(!exp->expType)
8081 {
8082 exp->expType = op1->type;
8083 if(op1->type)
8084 op1->type->refCount++;
8085 }
8086 return 0x1;
8087 }
8088
8089 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8090 {
8091 exp->type = 2;
8092 exp->string = PrintUChar(!op1->uc);
8093 if(!exp->expType)
8094 {
8095 exp->expType = op1->type;
8096 if(op1->type)
8097 op1->type->refCount++;
8098 }
8099 return 0x1;
8100 }
8101
8102 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8103 {
8104 int value2 = op2->i;
8105
8106 exp->type = 2;
8107 exp->string = PrintInt(op1->i == value2);
8108 if(!exp->expType)
8109 {
8110 exp->expType = op1->type;
8111 if(op1->type)
8112 op1->type->refCount++;
8113 }
8114 return 0x1;
8115 }
8116
8117 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8118 {
8119 unsigned int value2 = op2->ui;
8120
8121 exp->type = 2;
8122 exp->string = PrintUInt(op1->ui == value2);
8123 if(!exp->expType)
8124 {
8125 exp->expType = op1->type;
8126 if(op1->type)
8127 op1->type->refCount++;
8128 }
8129 return 0x1;
8130 }
8131
8132 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8133 {
8134 short value2 = op2->s;
8135
8136 exp->type = 2;
8137 exp->string = PrintShort(op1->s == value2);
8138 if(!exp->expType)
8139 {
8140 exp->expType = op1->type;
8141 if(op1->type)
8142 op1->type->refCount++;
8143 }
8144 return 0x1;
8145 }
8146
8147 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8148 {
8149 unsigned short value2 = op2->us;
8150
8151 exp->type = 2;
8152 exp->string = PrintUShort(op1->us == value2);
8153 if(!exp->expType)
8154 {
8155 exp->expType = op1->type;
8156 if(op1->type)
8157 op1->type->refCount++;
8158 }
8159 return 0x1;
8160 }
8161
8162 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8163 {
8164 char value2 = op2->c;
8165
8166 exp->type = 2;
8167 exp->string = PrintChar(op1->c == value2);
8168 if(!exp->expType)
8169 {
8170 exp->expType = op1->type;
8171 if(op1->type)
8172 op1->type->refCount++;
8173 }
8174 return 0x1;
8175 }
8176
8177 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8178 {
8179 unsigned char value2 = op2->uc;
8180
8181 exp->type = 2;
8182 exp->string = PrintUChar(op1->uc == value2);
8183 if(!exp->expType)
8184 {
8185 exp->expType = op1->type;
8186 if(op1->type)
8187 op1->type->refCount++;
8188 }
8189 return 0x1;
8190 }
8191
8192 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8193 {
8194 float value2 = op2->f;
8195
8196 exp->type = 2;
8197 exp->string = PrintFloat(op1->f == value2);
8198 if(!exp->expType)
8199 {
8200 exp->expType = op1->type;
8201 if(op1->type)
8202 op1->type->refCount++;
8203 }
8204 return 0x1;
8205 }
8206
8207 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8208 {
8209 double value2 = op2->d;
8210
8211 exp->type = 2;
8212 exp->string = PrintDouble(op1->d == value2);
8213 if(!exp->expType)
8214 {
8215 exp->expType = op1->type;
8216 if(op1->type)
8217 op1->type->refCount++;
8218 }
8219 return 0x1;
8220 }
8221
8222 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8223 {
8224 int value2 = op2->i;
8225
8226 exp->type = 2;
8227 exp->string = PrintInt(op1->i != value2);
8228 if(!exp->expType)
8229 {
8230 exp->expType = op1->type;
8231 if(op1->type)
8232 op1->type->refCount++;
8233 }
8234 return 0x1;
8235 }
8236
8237 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8238 {
8239 unsigned int value2 = op2->ui;
8240
8241 exp->type = 2;
8242 exp->string = PrintUInt(op1->ui != value2);
8243 if(!exp->expType)
8244 {
8245 exp->expType = op1->type;
8246 if(op1->type)
8247 op1->type->refCount++;
8248 }
8249 return 0x1;
8250 }
8251
8252 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8253 {
8254 short value2 = op2->s;
8255
8256 exp->type = 2;
8257 exp->string = PrintShort(op1->s != value2);
8258 if(!exp->expType)
8259 {
8260 exp->expType = op1->type;
8261 if(op1->type)
8262 op1->type->refCount++;
8263 }
8264 return 0x1;
8265 }
8266
8267 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8268 {
8269 unsigned short value2 = op2->us;
8270
8271 exp->type = 2;
8272 exp->string = PrintUShort(op1->us != value2);
8273 if(!exp->expType)
8274 {
8275 exp->expType = op1->type;
8276 if(op1->type)
8277 op1->type->refCount++;
8278 }
8279 return 0x1;
8280 }
8281
8282 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8283 {
8284 char value2 = op2->c;
8285
8286 exp->type = 2;
8287 exp->string = PrintChar(op1->c != value2);
8288 if(!exp->expType)
8289 {
8290 exp->expType = op1->type;
8291 if(op1->type)
8292 op1->type->refCount++;
8293 }
8294 return 0x1;
8295 }
8296
8297 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8298 {
8299 unsigned char value2 = op2->uc;
8300
8301 exp->type = 2;
8302 exp->string = PrintUChar(op1->uc != value2);
8303 if(!exp->expType)
8304 {
8305 exp->expType = op1->type;
8306 if(op1->type)
8307 op1->type->refCount++;
8308 }
8309 return 0x1;
8310 }
8311
8312 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8313 {
8314 float value2 = op2->f;
8315
8316 exp->type = 2;
8317 exp->string = PrintFloat(op1->f != value2);
8318 if(!exp->expType)
8319 {
8320 exp->expType = op1->type;
8321 if(op1->type)
8322 op1->type->refCount++;
8323 }
8324 return 0x1;
8325 }
8326
8327 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8328 {
8329 double value2 = op2->d;
8330
8331 exp->type = 2;
8332 exp->string = PrintDouble(op1->d != value2);
8333 if(!exp->expType)
8334 {
8335 exp->expType = op1->type;
8336 if(op1->type)
8337 op1->type->refCount++;
8338 }
8339 return 0x1;
8340 }
8341
8342 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8343 {
8344 int value2 = op2->i;
8345
8346 exp->type = 2;
8347 exp->string = PrintInt(op1->i && value2);
8348 if(!exp->expType)
8349 {
8350 exp->expType = op1->type;
8351 if(op1->type)
8352 op1->type->refCount++;
8353 }
8354 return 0x1;
8355 }
8356
8357 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8358 {
8359 unsigned int value2 = op2->ui;
8360
8361 exp->type = 2;
8362 exp->string = PrintUInt(op1->ui && value2);
8363 if(!exp->expType)
8364 {
8365 exp->expType = op1->type;
8366 if(op1->type)
8367 op1->type->refCount++;
8368 }
8369 return 0x1;
8370 }
8371
8372 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8373 {
8374 short value2 = op2->s;
8375
8376 exp->type = 2;
8377 exp->string = PrintShort(op1->s && value2);
8378 if(!exp->expType)
8379 {
8380 exp->expType = op1->type;
8381 if(op1->type)
8382 op1->type->refCount++;
8383 }
8384 return 0x1;
8385 }
8386
8387 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8388 {
8389 unsigned short value2 = op2->us;
8390
8391 exp->type = 2;
8392 exp->string = PrintUShort(op1->us && value2);
8393 if(!exp->expType)
8394 {
8395 exp->expType = op1->type;
8396 if(op1->type)
8397 op1->type->refCount++;
8398 }
8399 return 0x1;
8400 }
8401
8402 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8403 {
8404 char value2 = op2->c;
8405
8406 exp->type = 2;
8407 exp->string = PrintChar(op1->c && value2);
8408 if(!exp->expType)
8409 {
8410 exp->expType = op1->type;
8411 if(op1->type)
8412 op1->type->refCount++;
8413 }
8414 return 0x1;
8415 }
8416
8417 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8418 {
8419 unsigned char value2 = op2->uc;
8420
8421 exp->type = 2;
8422 exp->string = PrintUChar(op1->uc && value2);
8423 if(!exp->expType)
8424 {
8425 exp->expType = op1->type;
8426 if(op1->type)
8427 op1->type->refCount++;
8428 }
8429 return 0x1;
8430 }
8431
8432 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8433 {
8434 float value2 = op2->f;
8435
8436 exp->type = 2;
8437 exp->string = PrintFloat(op1->f && value2);
8438 if(!exp->expType)
8439 {
8440 exp->expType = op1->type;
8441 if(op1->type)
8442 op1->type->refCount++;
8443 }
8444 return 0x1;
8445 }
8446
8447 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8448 {
8449 double value2 = op2->d;
8450
8451 exp->type = 2;
8452 exp->string = PrintDouble(op1->d && value2);
8453 if(!exp->expType)
8454 {
8455 exp->expType = op1->type;
8456 if(op1->type)
8457 op1->type->refCount++;
8458 }
8459 return 0x1;
8460 }
8461
8462 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8463 {
8464 int value2 = op2->i;
8465
8466 exp->type = 2;
8467 exp->string = PrintInt(op1->i || value2);
8468 if(!exp->expType)
8469 {
8470 exp->expType = op1->type;
8471 if(op1->type)
8472 op1->type->refCount++;
8473 }
8474 return 0x1;
8475 }
8476
8477 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8478 {
8479 unsigned int value2 = op2->ui;
8480
8481 exp->type = 2;
8482 exp->string = PrintUInt(op1->ui || value2);
8483 if(!exp->expType)
8484 {
8485 exp->expType = op1->type;
8486 if(op1->type)
8487 op1->type->refCount++;
8488 }
8489 return 0x1;
8490 }
8491
8492 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8493 {
8494 short value2 = op2->s;
8495
8496 exp->type = 2;
8497 exp->string = PrintShort(op1->s || value2);
8498 if(!exp->expType)
8499 {
8500 exp->expType = op1->type;
8501 if(op1->type)
8502 op1->type->refCount++;
8503 }
8504 return 0x1;
8505 }
8506
8507 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8508 {
8509 unsigned short value2 = op2->us;
8510
8511 exp->type = 2;
8512 exp->string = PrintUShort(op1->us || value2);
8513 if(!exp->expType)
8514 {
8515 exp->expType = op1->type;
8516 if(op1->type)
8517 op1->type->refCount++;
8518 }
8519 return 0x1;
8520 }
8521
8522 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8523 {
8524 char value2 = op2->c;
8525
8526 exp->type = 2;
8527 exp->string = PrintChar(op1->c || value2);
8528 if(!exp->expType)
8529 {
8530 exp->expType = op1->type;
8531 if(op1->type)
8532 op1->type->refCount++;
8533 }
8534 return 0x1;
8535 }
8536
8537 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8538 {
8539 unsigned char value2 = op2->uc;
8540
8541 exp->type = 2;
8542 exp->string = PrintUChar(op1->uc || value2);
8543 if(!exp->expType)
8544 {
8545 exp->expType = op1->type;
8546 if(op1->type)
8547 op1->type->refCount++;
8548 }
8549 return 0x1;
8550 }
8551
8552 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8553 {
8554 float value2 = op2->f;
8555
8556 exp->type = 2;
8557 exp->string = PrintFloat(op1->f || value2);
8558 if(!exp->expType)
8559 {
8560 exp->expType = op1->type;
8561 if(op1->type)
8562 op1->type->refCount++;
8563 }
8564 return 0x1;
8565 }
8566
8567 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8568 {
8569 double value2 = op2->d;
8570
8571 exp->type = 2;
8572 exp->string = PrintDouble(op1->d || value2);
8573 if(!exp->expType)
8574 {
8575 exp->expType = op1->type;
8576 if(op1->type)
8577 op1->type->refCount++;
8578 }
8579 return 0x1;
8580 }
8581
8582 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8583 {
8584 int value2 = op2->i;
8585
8586 exp->type = 2;
8587 exp->string = PrintInt(op1->i > value2);
8588 if(!exp->expType)
8589 {
8590 exp->expType = op1->type;
8591 if(op1->type)
8592 op1->type->refCount++;
8593 }
8594 return 0x1;
8595 }
8596
8597 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8598 {
8599 unsigned int value2 = op2->ui;
8600
8601 exp->type = 2;
8602 exp->string = PrintUInt(op1->ui > value2);
8603 if(!exp->expType)
8604 {
8605 exp->expType = op1->type;
8606 if(op1->type)
8607 op1->type->refCount++;
8608 }
8609 return 0x1;
8610 }
8611
8612 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8613 {
8614 short value2 = op2->s;
8615
8616 exp->type = 2;
8617 exp->string = PrintShort(op1->s > value2);
8618 if(!exp->expType)
8619 {
8620 exp->expType = op1->type;
8621 if(op1->type)
8622 op1->type->refCount++;
8623 }
8624 return 0x1;
8625 }
8626
8627 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8628 {
8629 unsigned short value2 = op2->us;
8630
8631 exp->type = 2;
8632 exp->string = PrintUShort(op1->us > value2);
8633 if(!exp->expType)
8634 {
8635 exp->expType = op1->type;
8636 if(op1->type)
8637 op1->type->refCount++;
8638 }
8639 return 0x1;
8640 }
8641
8642 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8643 {
8644 char value2 = op2->c;
8645
8646 exp->type = 2;
8647 exp->string = PrintChar(op1->c > value2);
8648 if(!exp->expType)
8649 {
8650 exp->expType = op1->type;
8651 if(op1->type)
8652 op1->type->refCount++;
8653 }
8654 return 0x1;
8655 }
8656
8657 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8658 {
8659 unsigned char value2 = op2->uc;
8660
8661 exp->type = 2;
8662 exp->string = PrintUChar(op1->uc > value2);
8663 if(!exp->expType)
8664 {
8665 exp->expType = op1->type;
8666 if(op1->type)
8667 op1->type->refCount++;
8668 }
8669 return 0x1;
8670 }
8671
8672 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8673 {
8674 float value2 = op2->f;
8675
8676 exp->type = 2;
8677 exp->string = PrintFloat(op1->f > value2);
8678 if(!exp->expType)
8679 {
8680 exp->expType = op1->type;
8681 if(op1->type)
8682 op1->type->refCount++;
8683 }
8684 return 0x1;
8685 }
8686
8687 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8688 {
8689 double value2 = op2->d;
8690
8691 exp->type = 2;
8692 exp->string = PrintDouble(op1->d > value2);
8693 if(!exp->expType)
8694 {
8695 exp->expType = op1->type;
8696 if(op1->type)
8697 op1->type->refCount++;
8698 }
8699 return 0x1;
8700 }
8701
8702 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8703 {
8704 int value2 = op2->i;
8705
8706 exp->type = 2;
8707 exp->string = PrintInt(op1->i < value2);
8708 if(!exp->expType)
8709 {
8710 exp->expType = op1->type;
8711 if(op1->type)
8712 op1->type->refCount++;
8713 }
8714 return 0x1;
8715 }
8716
8717 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8718 {
8719 unsigned int value2 = op2->ui;
8720
8721 exp->type = 2;
8722 exp->string = PrintUInt(op1->ui < value2);
8723 if(!exp->expType)
8724 {
8725 exp->expType = op1->type;
8726 if(op1->type)
8727 op1->type->refCount++;
8728 }
8729 return 0x1;
8730 }
8731
8732 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8733 {
8734 short value2 = op2->s;
8735
8736 exp->type = 2;
8737 exp->string = PrintShort(op1->s < value2);
8738 if(!exp->expType)
8739 {
8740 exp->expType = op1->type;
8741 if(op1->type)
8742 op1->type->refCount++;
8743 }
8744 return 0x1;
8745 }
8746
8747 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8748 {
8749 unsigned short value2 = op2->us;
8750
8751 exp->type = 2;
8752 exp->string = PrintUShort(op1->us < value2);
8753 if(!exp->expType)
8754 {
8755 exp->expType = op1->type;
8756 if(op1->type)
8757 op1->type->refCount++;
8758 }
8759 return 0x1;
8760 }
8761
8762 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8763 {
8764 char value2 = op2->c;
8765
8766 exp->type = 2;
8767 exp->string = PrintChar(op1->c < value2);
8768 if(!exp->expType)
8769 {
8770 exp->expType = op1->type;
8771 if(op1->type)
8772 op1->type->refCount++;
8773 }
8774 return 0x1;
8775 }
8776
8777 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8778 {
8779 unsigned char value2 = op2->uc;
8780
8781 exp->type = 2;
8782 exp->string = PrintUChar(op1->uc < value2);
8783 if(!exp->expType)
8784 {
8785 exp->expType = op1->type;
8786 if(op1->type)
8787 op1->type->refCount++;
8788 }
8789 return 0x1;
8790 }
8791
8792 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8793 {
8794 float value2 = op2->f;
8795
8796 exp->type = 2;
8797 exp->string = PrintFloat(op1->f < value2);
8798 if(!exp->expType)
8799 {
8800 exp->expType = op1->type;
8801 if(op1->type)
8802 op1->type->refCount++;
8803 }
8804 return 0x1;
8805 }
8806
8807 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8808 {
8809 double value2 = op2->d;
8810
8811 exp->type = 2;
8812 exp->string = PrintDouble(op1->d < value2);
8813 if(!exp->expType)
8814 {
8815 exp->expType = op1->type;
8816 if(op1->type)
8817 op1->type->refCount++;
8818 }
8819 return 0x1;
8820 }
8821
8822 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8823 {
8824 int value2 = op2->i;
8825
8826 exp->type = 2;
8827 exp->string = PrintInt(op1->i >= value2);
8828 if(!exp->expType)
8829 {
8830 exp->expType = op1->type;
8831 if(op1->type)
8832 op1->type->refCount++;
8833 }
8834 return 0x1;
8835 }
8836
8837 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8838 {
8839 unsigned int value2 = op2->ui;
8840
8841 exp->type = 2;
8842 exp->string = PrintUInt(op1->ui >= value2);
8843 if(!exp->expType)
8844 {
8845 exp->expType = op1->type;
8846 if(op1->type)
8847 op1->type->refCount++;
8848 }
8849 return 0x1;
8850 }
8851
8852 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8853 {
8854 short value2 = op2->s;
8855
8856 exp->type = 2;
8857 exp->string = PrintShort(op1->s >= value2);
8858 if(!exp->expType)
8859 {
8860 exp->expType = op1->type;
8861 if(op1->type)
8862 op1->type->refCount++;
8863 }
8864 return 0x1;
8865 }
8866
8867 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8868 {
8869 unsigned short value2 = op2->us;
8870
8871 exp->type = 2;
8872 exp->string = PrintUShort(op1->us >= value2);
8873 if(!exp->expType)
8874 {
8875 exp->expType = op1->type;
8876 if(op1->type)
8877 op1->type->refCount++;
8878 }
8879 return 0x1;
8880 }
8881
8882 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8883 {
8884 char value2 = op2->c;
8885
8886 exp->type = 2;
8887 exp->string = PrintChar(op1->c >= value2);
8888 if(!exp->expType)
8889 {
8890 exp->expType = op1->type;
8891 if(op1->type)
8892 op1->type->refCount++;
8893 }
8894 return 0x1;
8895 }
8896
8897 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8898 {
8899 unsigned char value2 = op2->uc;
8900
8901 exp->type = 2;
8902 exp->string = PrintUChar(op1->uc >= value2);
8903 if(!exp->expType)
8904 {
8905 exp->expType = op1->type;
8906 if(op1->type)
8907 op1->type->refCount++;
8908 }
8909 return 0x1;
8910 }
8911
8912 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8913 {
8914 float value2 = op2->f;
8915
8916 exp->type = 2;
8917 exp->string = PrintFloat(op1->f >= value2);
8918 if(!exp->expType)
8919 {
8920 exp->expType = op1->type;
8921 if(op1->type)
8922 op1->type->refCount++;
8923 }
8924 return 0x1;
8925 }
8926
8927 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8928 {
8929 double value2 = op2->d;
8930
8931 exp->type = 2;
8932 exp->string = PrintDouble(op1->d >= value2);
8933 if(!exp->expType)
8934 {
8935 exp->expType = op1->type;
8936 if(op1->type)
8937 op1->type->refCount++;
8938 }
8939 return 0x1;
8940 }
8941
8942 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8943 {
8944 int value2 = op2->i;
8945
8946 exp->type = 2;
8947 exp->string = PrintInt(op1->i <= value2);
8948 if(!exp->expType)
8949 {
8950 exp->expType = op1->type;
8951 if(op1->type)
8952 op1->type->refCount++;
8953 }
8954 return 0x1;
8955 }
8956
8957 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8958 {
8959 unsigned int value2 = op2->ui;
8960
8961 exp->type = 2;
8962 exp->string = PrintUInt(op1->ui <= value2);
8963 if(!exp->expType)
8964 {
8965 exp->expType = op1->type;
8966 if(op1->type)
8967 op1->type->refCount++;
8968 }
8969 return 0x1;
8970 }
8971
8972 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8973 {
8974 short value2 = op2->s;
8975
8976 exp->type = 2;
8977 exp->string = PrintShort(op1->s <= value2);
8978 if(!exp->expType)
8979 {
8980 exp->expType = op1->type;
8981 if(op1->type)
8982 op1->type->refCount++;
8983 }
8984 return 0x1;
8985 }
8986
8987 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8988 {
8989 unsigned short value2 = op2->us;
8990
8991 exp->type = 2;
8992 exp->string = PrintUShort(op1->us <= value2);
8993 if(!exp->expType)
8994 {
8995 exp->expType = op1->type;
8996 if(op1->type)
8997 op1->type->refCount++;
8998 }
8999 return 0x1;
9000 }
9001
9002 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9003 {
9004 char value2 = op2->c;
9005
9006 exp->type = 2;
9007 exp->string = PrintChar(op1->c <= value2);
9008 if(!exp->expType)
9009 {
9010 exp->expType = op1->type;
9011 if(op1->type)
9012 op1->type->refCount++;
9013 }
9014 return 0x1;
9015 }
9016
9017 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9018 {
9019 unsigned char value2 = op2->uc;
9020
9021 exp->type = 2;
9022 exp->string = PrintUChar(op1->uc <= value2);
9023 if(!exp->expType)
9024 {
9025 exp->expType = op1->type;
9026 if(op1->type)
9027 op1->type->refCount++;
9028 }
9029 return 0x1;
9030 }
9031
9032 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9033 {
9034 float value2 = op2->f;
9035
9036 exp->type = 2;
9037 exp->string = PrintFloat(op1->f <= value2);
9038 if(!exp->expType)
9039 {
9040 exp->expType = op1->type;
9041 if(op1->type)
9042 op1->type->refCount++;
9043 }
9044 return 0x1;
9045 }
9046
9047 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9048 {
9049 double value2 = op2->d;
9050
9051 exp->type = 2;
9052 exp->string = PrintDouble(op1->d <= value2);
9053 if(!exp->expType)
9054 {
9055 exp->expType = op1->type;
9056 if(op1->type)
9057 op1->type->refCount++;
9058 }
9059 return 0x1;
9060 }
9061
9062 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9063 {
9064 exp->type = 2;
9065 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9066 if(!exp->expType)
9067 {
9068 exp->expType = op1->type;
9069 if(op1->type)
9070 op1->type->refCount++;
9071 }
9072 return 0x1;
9073 }
9074
9075 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9076 {
9077 exp->type = 2;
9078 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9079 if(!exp->expType)
9080 {
9081 exp->expType = op1->type;
9082 if(op1->type)
9083 op1->type->refCount++;
9084 }
9085 return 0x1;
9086 }
9087
9088 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9089 {
9090 exp->type = 2;
9091 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9092 if(!exp->expType)
9093 {
9094 exp->expType = op1->type;
9095 if(op1->type)
9096 op1->type->refCount++;
9097 }
9098 return 0x1;
9099 }
9100
9101 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9102 {
9103 exp->type = 2;
9104 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9105 if(!exp->expType)
9106 {
9107 exp->expType = op1->type;
9108 if(op1->type)
9109 op1->type->refCount++;
9110 }
9111 return 0x1;
9112 }
9113
9114 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9115 {
9116 exp->type = 2;
9117 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9118 if(!exp->expType)
9119 {
9120 exp->expType = op1->type;
9121 if(op1->type)
9122 op1->type->refCount++;
9123 }
9124 return 0x1;
9125 }
9126
9127 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9128 {
9129 exp->type = 2;
9130 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9131 if(!exp->expType)
9132 {
9133 exp->expType = op1->type;
9134 if(op1->type)
9135 op1->type->refCount++;
9136 }
9137 return 0x1;
9138 }
9139
9140 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9141 {
9142 exp->type = 2;
9143 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9144 if(!exp->expType)
9145 {
9146 exp->expType = op1->type;
9147 if(op1->type)
9148 op1->type->refCount++;
9149 }
9150 return 0x1;
9151 }
9152
9153 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9154 {
9155 exp->type = 2;
9156 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9157 if(!exp->expType)
9158 {
9159 exp->expType = op1->type;
9160 if(op1->type)
9161 op1->type->refCount++;
9162 }
9163 return 0x1;
9164 }
9165
9166 struct OpTable intOps = 
9167 {
9168 IntAdd, IntSub, IntMul, IntDiv, IntMod, IntNeg, IntInc, IntDec, IntAsign, IntAddAsign, IntSubAsign, IntMulAsign, IntDivAsign, IntModAsign, IntBitAnd, IntBitOr, IntBitXor, IntLShift, IntRShift, IntBitNot, IntAndAsign, IntOrAsign, IntXorAsign, IntLShiftAsign, IntRShiftAsign, IntNot, IntEqu, IntNqu, IntAnd, IntOr, IntGrt, IntSma, IntGrtEqu, IntSmaEqu, IntCond
9169 };
9170
9171 struct OpTable uintOps = 
9172 {
9173 UIntAdd, UIntSub, UIntMul, UIntDiv, UIntMod, UIntNeg, UIntInc, UIntDec, UIntAsign, UIntAddAsign, UIntSubAsign, UIntMulAsign, UIntDivAsign, UIntModAsign, UIntBitAnd, UIntBitOr, UIntBitXor, UIntLShift, UIntRShift, UIntBitNot, UIntAndAsign, UIntOrAsign, UIntXorAsign, UIntLShiftAsign, UIntRShiftAsign, UIntNot, UIntEqu, UIntNqu, UIntAnd, UIntOr, UIntGrt, UIntSma, UIntGrtEqu, UIntSmaEqu, UIntCond
9174 };
9175
9176 struct OpTable shortOps = 
9177 {
9178 ShortAdd, ShortSub, ShortMul, ShortDiv, ShortMod, ShortNeg, ShortInc, ShortDec, ShortAsign, ShortAddAsign, ShortSubAsign, ShortMulAsign, ShortDivAsign, ShortModAsign, ShortBitAnd, ShortBitOr, ShortBitXor, ShortLShift, ShortRShift, ShortBitNot, ShortAndAsign, ShortOrAsign, ShortXorAsign, ShortLShiftAsign, ShortRShiftAsign, ShortNot, ShortEqu, ShortNqu, ShortAnd, ShortOr, ShortGrt, ShortSma, ShortGrtEqu, ShortSmaEqu, ShortCond
9179 };
9180
9181 struct OpTable ushortOps = 
9182 {
9183 UShortAdd, UShortSub, UShortMul, UShortDiv, UShortMod, UShortNeg, UShortInc, UShortDec, UShortAsign, UShortAddAsign, UShortSubAsign, UShortMulAsign, UShortDivAsign, UShortModAsign, UShortBitAnd, UShortBitOr, UShortBitXor, UShortLShift, UShortRShift, UShortBitNot, UShortAndAsign, UShortOrAsign, UShortXorAsign, UShortLShiftAsign, UShortRShiftAsign, UShortNot, UShortEqu, UShortNqu, UShortAnd, UShortOr, UShortGrt, UShortSma, UShortGrtEqu, UShortSmaEqu, UShortCond
9184 };
9185
9186 struct OpTable floatOps = 
9187 {
9188 FloatAdd, FloatSub, FloatMul, FloatDiv, (((void *)0)), FloatNeg, FloatInc, FloatDec, FloatAsign, FloatAddAsign, FloatSubAsign, FloatMulAsign, FloatDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), FloatEqu, FloatNqu, FloatAnd, FloatOr, FloatGrt, FloatSma, FloatGrtEqu, FloatSmaEqu
9189 };
9190
9191 struct OpTable doubleOps = 
9192 {
9193 DoubleAdd, DoubleSub, DoubleMul, DoubleDiv, (((void *)0)), DoubleNeg, DoubleInc, DoubleDec, DoubleAsign, DoubleAddAsign, DoubleSubAsign, DoubleMulAsign, DoubleDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), DoubleEqu, DoubleNqu, DoubleAnd, DoubleOr, DoubleGrt, DoubleSma, DoubleGrtEqu, DoubleSmaEqu
9194 };
9195
9196 struct OpTable charOps = 
9197 {
9198 CharAdd, CharSub, CharMul, CharDiv, CharMod, CharNeg, CharInc, CharDec, CharAsign, CharAddAsign, CharSubAsign, CharMulAsign, CharDivAsign, CharModAsign, CharBitAnd, CharBitOr, CharBitXor, CharLShift, CharRShift, CharBitNot, CharAndAsign, CharOrAsign, CharXorAsign, CharLShiftAsign, CharRShiftAsign, CharNot, CharEqu, CharNqu, CharAnd, CharOr, CharGrt, CharSma, CharGrtEqu, CharSmaEqu, CharCond
9199 };
9200
9201 struct OpTable ucharOps = 
9202 {
9203 UCharAdd, UCharSub, UCharMul, UCharDiv, UCharMod, UCharNeg, UCharInc, UCharDec, UCharAsign, UCharAddAsign, UCharSubAsign, UCharMulAsign, UCharDivAsign, UCharModAsign, UCharBitAnd, UCharBitOr, UCharBitXor, UCharLShift, UCharRShift, UCharBitNot, UCharAndAsign, UCharOrAsign, UCharXorAsign, UCharLShiftAsign, UCharRShiftAsign, UCharNot, UCharEqu, UCharNqu, UCharAnd, UCharOr, UCharGrt, UCharSma, UCharGrtEqu, UCharSmaEqu, UCharCond
9204 };
9205
9206 void ReadString(char * output, char * string)
9207 {
9208 int len = strlen(string);
9209 int c, d = 0;
9210 unsigned int quoted = 0x0, escaped = 0x0;
9211
9212 for(c = 0; c < len; c++)
9213 {
9214 char ch = string[c];
9215
9216 if(escaped)
9217 {
9218 switch(ch)
9219 {
9220 case 'n':
9221 output[d] = '\n';
9222 break;
9223 case 't':
9224 output[d] = '\t';
9225 break;
9226 case 'a':
9227 output[d] = '\a';
9228 break;
9229 case 'b':
9230 output[d] = '\b';
9231 break;
9232 case 'f':
9233 output[d] = '\f';
9234 break;
9235 case 'r':
9236 output[d] = '\r';
9237 break;
9238 case 'v':
9239 output[d] = '\v';
9240 break;
9241 case '\\':
9242 output[d] = '\\';
9243 break;
9244 case '\"':
9245 output[d] = '\"';
9246 break;
9247 default:
9248 output[d++] = '\\';
9249 output[d] = ch;
9250 }
9251 d++;
9252 escaped = 0x0;
9253 }
9254 else
9255 {
9256 if(ch == '\"')
9257 quoted ^= 0x1;
9258 else if(quoted)
9259 {
9260 if(ch == '\\')
9261 escaped = 0x1;
9262 else
9263 output[d++] = ch;
9264 }
9265 }
9266 }
9267 output[d] = '\0';
9268 }
9269
9270 extern double strtod(char * , char * * );
9271
9272 struct Operand GetOperand(struct Expression * exp)
9273 {
9274 struct Operand op = 
9275 {
9276 0, 0, 0, 0, 
9277 {
9278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9279 }
9280 };
9281 struct Type * type = exp->expType;
9282
9283 if(type)
9284 {
9285 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9286 {
9287 if(!type->_class->registered->dataType)
9288 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9289 type = type->_class->registered->dataType;
9290 }
9291 op.kind = type->kind;
9292 op.type = exp->expType;
9293 if(exp->isConstant && exp->type == 2)
9294 {
9295 switch(op.kind)
9296 {
9297 case 1:
9298 {
9299 if(exp->constant[0] == '\'')
9300 op.c = exp->constant[1];
9301 else if(type->isSigned)
9302 {
9303 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9304 op.ops = charOps;
9305 }
9306 else
9307 {
9308 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9309 op.ops = ucharOps;
9310 }
9311 break;
9312 }
9313 case 2:
9314 if(type->isSigned)
9315 {
9316 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9317 op.ops = shortOps;
9318 }
9319 else
9320 {
9321 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9322 op.ops = ushortOps;
9323 }
9324 break;
9325 case 3:
9326 case 5:
9327 if(type->isSigned)
9328 {
9329 op.i = strtol(exp->constant, (((void *)0)), 0);
9330 op.ops = intOps;
9331 }
9332 else
9333 {
9334 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9335 op.ops = uintOps;
9336 }
9337 op.kind = 3;
9338 break;
9339 case 4:
9340 if(type->isSigned)
9341 {
9342 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9343 op.ops = intOps;
9344 }
9345 else
9346 {
9347 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9348 op.ops = uintOps;
9349 }
9350 op.kind = 3;
9351 break;
9352 case 22:
9353 if(type->isSigned)
9354 {
9355 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9356 op.ops = intOps;
9357 }
9358 else
9359 {
9360 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9361 op.ops = uintOps;
9362 }
9363 op.kind = 3;
9364 break;
9365 case 6:
9366 op.f = (float)strtod(exp->constant, (((void *)0)));
9367 op.ops = floatOps;
9368 break;
9369 case 7:
9370 op.d = (double)strtod(exp->constant, (((void *)0)));
9371 op.ops = doubleOps;
9372 break;
9373 case 12:
9374 case 13:
9375 case 8:
9376 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9377 op.kind = 13;
9378 op.ops = uintOps;
9379 break;
9380 }
9381 }
9382 }
9383 return op;
9384 }
9385
9386 int __ecereVMethodID_class_OnGetString;
9387
9388 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9389
9390 static void UnusedFunction()
9391 {
9392 int a;
9393
9394 ((char *  (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
9395 }
9396
9397 extern int __ecereVMethodID_class_OnGetString;
9398
9399 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9400 {
9401 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9402
9403 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9404 {
9405 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9406 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9407 else
9408 {
9409 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9410 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9411 struct Type * type;
9412 void * ptr = inst->data + dataMember->offset + offset;
9413 char * result = (((void *)0));
9414
9415 exp->loc = member->loc = inst->loc;
9416 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9417 if(!dataMember->dataType)
9418 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9419 type = dataMember->dataType;
9420 if(type->kind == 8)
9421 {
9422 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9423
9424 if(_class->type == 4)
9425 {
9426 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9427
9428 if(enumClass)
9429 {
9430 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9431 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9432
9433 for(item = e->values.first; item; item = item->next)
9434 {
9435 if((int)item->data == *(int *)ptr)
9436 {
9437 result = item->name;
9438 break;
9439 }
9440 }
9441 if(result)
9442 {
9443 exp->identifier = MkIdentifier(result);
9444 exp->type = 0;
9445 exp->destType = MkClassType(_class->fullName);
9446 ProcessExpressionType(exp);
9447 }
9448 }
9449 }
9450 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9451 {
9452 if(!_class->dataType)
9453 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9454 type = _class->dataType;
9455 }
9456 }
9457 if(!result)
9458 {
9459 switch(type->kind)
9460 {
9461 case 6:
9462 {
9463 FreeExpContents(exp);
9464 exp->constant = PrintFloat(*(float *)ptr);
9465 exp->type = 2;
9466 break;
9467 }
9468 case 7:
9469 {
9470 FreeExpContents(exp);
9471 exp->constant = PrintDouble(*(double *)ptr);
9472 exp->type = 2;
9473 break;
9474 }
9475 case 3:
9476 {
9477 FreeExpContents(exp);
9478 exp->constant = PrintInt(*(int *)ptr);
9479 exp->type = 2;
9480 break;
9481 }
9482 case 4:
9483 {
9484 FreeExpContents(exp);
9485 exp->constant = PrintInt64(*(long long *)ptr);
9486 exp->type = 2;
9487 break;
9488 }
9489 case 22:
9490 {
9491 FreeExpContents(exp);
9492 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9493 exp->type = 2;
9494 break;
9495 }
9496 default:
9497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9498 }
9499 }
9500 ListAdd(memberList, member);
9501 }
9502 if(parentDataMember->type == 1)
9503 break;
9504 }
9505 }
9506
9507 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9508
9509 void PopulateInstance(struct Instantiation * inst)
9510 {
9511 struct Symbol * classSym = inst->_class->symbol;
9512 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9513 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9514 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9515
9516 inst->members = MkListOne(MkMembersInitList(memberList));
9517 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9518 {
9519 if(!dataMember->isProperty)
9520 {
9521 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9522 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9523 else
9524 {
9525 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9526 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9527 struct Type * type;
9528 void * ptr = inst->data + dataMember->offset;
9529 char * result = (((void *)0));
9530
9531 exp->loc = member->loc = inst->loc;
9532 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9533 if(!dataMember->dataType)
9534 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9535 type = dataMember->dataType;
9536 if(type->kind == 8)
9537 {
9538 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9539
9540 if(_class->type == 4)
9541 {
9542 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9543
9544 if(enumClass)
9545 {
9546 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9547 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9548
9549 for(item = e->values.first; item; item = item->next)
9550 {
9551 if((int)item->data == *(int *)ptr)
9552 {
9553 result = item->name;
9554 break;
9555 }
9556 }
9557 }
9558 if(result)
9559 {
9560 exp->identifier = MkIdentifier(result);
9561 exp->type = 0;
9562 exp->destType = MkClassType(_class->fullName);
9563 ProcessExpressionType(exp);
9564 }
9565 }
9566 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9567 {
9568 if(!_class->dataType)
9569 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9570 type = _class->dataType;
9571 }
9572 }
9573 if(!result)
9574 {
9575 switch(type->kind)
9576 {
9577 case 6:
9578 {
9579 exp->constant = PrintFloat(*(float *)ptr);
9580 exp->type = 2;
9581 break;
9582 }
9583 case 7:
9584 {
9585 exp->constant = PrintDouble(*(double *)ptr);
9586 exp->type = 2;
9587 break;
9588 }
9589 case 3:
9590 {
9591 exp->constant = PrintInt(*(int *)ptr);
9592 exp->type = 2;
9593 break;
9594 }
9595 case 4:
9596 {
9597 exp->constant = PrintInt64(*(long long *)ptr);
9598 exp->type = 2;
9599 break;
9600 }
9601 case 22:
9602 {
9603 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9604 exp->type = 2;
9605 break;
9606 }
9607 default:
9608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9609 }
9610 }
9611 ListAdd(memberList, member);
9612 }
9613 }
9614 }
9615 }
9616
9617 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, unsigned int *  offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
9618
9619 extern void FreeInstance(struct Instantiation * inst);
9620
9621 void ComputeInstantiation(struct Expression * exp)
9622 {
9623 struct Instantiation * inst = exp->instance;
9624 struct MembersInit * members;
9625 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9626 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9627 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9628 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9629 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9630 int subMemberStackPos = 0;
9631 uint64 bits = 0;
9632
9633 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9634 {
9635 if(inst->data)
9636 return ;
9637 if(_class->type == 0 || _class->type == 5)
9638 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9639 else
9640 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9641 }
9642 if(inst->members)
9643 {
9644 for(members = (*inst->members).first; members; members = members->next)
9645 {
9646 switch(members->type)
9647 {
9648 case 0:
9649 {
9650 if(members->dataMembers)
9651 {
9652 struct MemberInit * member;
9653
9654 for(member = (*members->dataMembers).first; member; member = member->next)
9655 {
9656 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9657 unsigned int found = 0x0;
9658 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9659 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9660 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9661 unsigned int dataMemberOffset;
9662
9663 if(!ident)
9664 {
9665 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9666 if(curMember)
9667 {
9668 if(curMember->isProperty)
9669 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9670 else
9671 {
9672 dataMember = curMember;
9673 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9674 }
9675 found = 0x1;
9676 }
9677 }
9678 else
9679 {
9680 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9681 if(prop)
9682 {
9683 found = 0x1;
9684 if(prop->memberAccess == 1)
9685 {
9686 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9687 curClass = prop->_class;
9688 }
9689 }
9690 else
9691 {
9692 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9693 int _subMemberStackPos = 0;
9694
9695 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9696 if(dataMember)
9697 {
9698 found = 0x1;
9699 if(dataMember->memberAccess == 1)
9700 {
9701 curMember = dataMember;
9702 curClass = dataMember->_class;
9703 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9704 subMemberStackPos = _subMemberStackPos;
9705 }
9706 }
9707 }
9708 }
9709 if(found && member->initializer && member->initializer->type == 0)
9710 {
9711 struct Expression * value = member->initializer->exp;
9712 struct Type * type = (((void *)0));
9713
9714 if(prop)
9715 {
9716 type = prop->dataType;
9717 }
9718 else if(dataMember)
9719 {
9720 if(!dataMember->dataType)
9721 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9722 type = dataMember->dataType;
9723 }
9724 if(ident && ident->next)
9725 {
9726 for(ident = ident->next; ident && type; ident = ident->next)
9727 {
9728 if(type->kind == 8)
9729 {
9730 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9731 if(prop)
9732 type = prop->dataType;
9733 else
9734 {
9735 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9736 if(dataMember)
9737 type = dataMember->dataType;
9738 }
9739 }
9740 else if(type->kind == 9 || type->kind == 10)
9741 {
9742 struct Type * memberType;
9743
9744 for(memberType = type->members.first; memberType; memberType = memberType->next)
9745 {
9746 if(!strcmp(memberType->name, ident->string))
9747 {
9748 type = memberType;
9749 break;
9750 }
9751 }
9752 }
9753 }
9754 }
9755 if(value)
9756 {
9757 FreeType(value->destType);
9758 value->destType = type;
9759 if(type)
9760 type->refCount++;
9761 ComputeExpression(value);
9762 }
9763 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9764 {
9765 if(type->kind == 8)
9766 {
9767 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9768
9769 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9770 {
9771 if(!_class->dataType)
9772 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9773 type = _class->dataType;
9774 }
9775 }
9776 if(dataMember)
9777 {
9778 void * ptr = inst->data + dataMemberOffset;
9779
9780 if(value->type == 2)
9781 {
9782 switch(type->kind)
9783 {
9784 case 3:
9785 {
9786 GetInt(value, (int *)ptr);
9787 break;
9788 }
9789 case 4:
9790 {
9791 GetInt64(value, (long long *)ptr);
9792 break;
9793 }
9794 case 22:
9795 {
9796 GetIntPtr(value, (intptr_t *)ptr);
9797 break;
9798 }
9799 case 6:
9800 {
9801 GetFloat(value, (float *)ptr);
9802 break;
9803 }
9804 case 7:
9805 {
9806 GetDouble(value, (double *)ptr);
9807 break;
9808 }
9809 }
9810 }
9811 else if(value->type == 1)
9812 {
9813 if(type->kind == 8)
9814 {
9815 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9816
9817 if(_class->type == 1)
9818 {
9819 ComputeTypeSize(type);
9820 if(value->instance->data)
9821 memcpy(ptr, value->instance->data, type->size);
9822 }
9823 }
9824 }
9825 }
9826 else if(prop)
9827 {
9828 if(value->type == 1 && value->instance->data)
9829 {
9830 void (* Set)(void *, void *) = (void *)prop->Set;
9831
9832 Set(inst->data, value->instance->data);
9833 PopulateInstance(inst);
9834 }
9835 else if(value->type == 2)
9836 {
9837 switch(type->kind)
9838 {
9839 case 7:
9840 {
9841 void (* Set)(void *, double) = (void *)prop->Set;
9842
9843 Set(inst->data, strtod(value->constant, (((void *)0))));
9844 break;
9845 }
9846 case 6:
9847 {
9848 void (* Set)(void *, float) = (void *)prop->Set;
9849
9850 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9851 break;
9852 }
9853 case 3:
9854 {
9855 void (* Set)(void *, int) = (void *)prop->Set;
9856
9857 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9858 break;
9859 }
9860 case 4:
9861 {
9862 void (* Set)(void *, long long) = (void *)prop->Set;
9863
9864 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9865 break;
9866 }
9867 case 22:
9868 {
9869 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9870
9871 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9872 break;
9873 }
9874 }
9875 }
9876 else if(value->type == 3)
9877 {
9878 char temp[1024];
9879
9880 ReadString(temp, value->string);
9881 prop->Set(inst->data, temp);
9882 }
9883 }
9884 }
9885 else if(_class->type == 3)
9886 {
9887 if(prop)
9888 {
9889 if(value->type == 2)
9890 {
9891 if(type->kind == 8)
9892 {
9893 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9894
9895 if(_class->type == 3)
9896 {
9897 if(!_class->dataType)
9898 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9899 type = _class->dataType;
9900 }
9901 }
9902 switch(type->kind)
9903 {
9904 case 6:
9905 {
9906 float fValue;
9907 float (* Set)(float) = (void *)prop->Set;
9908
9909 GetFloat(member->initializer->exp, &fValue);
9910 exp->constant = PrintFloat(Set(fValue));
9911 exp->type = 2;
9912 break;
9913 }
9914 case 7:
9915 {
9916 double dValue;
9917 double (* Set)(double) = (void *)prop->Set;
9918
9919 GetDouble(member->initializer->exp, &dValue);
9920 exp->constant = PrintDouble(Set(dValue));
9921 exp->type = 2;
9922 break;
9923 }
9924 }
9925 }
9926 }
9927 }
9928 else if(_class->type == 2)
9929 {
9930 if(prop)
9931 {
9932 if(value->type == 1 && value->instance->data)
9933 {
9934 unsigned int (* Set)(void *) = (void *)prop->Set;
9935
9936 bits = Set(value->instance->data);
9937 }
9938 else if(value->type == 2)
9939 {
9940 }
9941 }
9942 else if(dataMember)
9943 {
9944 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9945 struct Type * type;
9946 int part = 0;
9947
9948 GetInt(value, &part);
9949 bits = (bits & ~bitMember->mask);
9950 if(!bitMember->dataType)
9951 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9952 type = bitMember->dataType;
9953 if(type->kind == 8 && type->_class && type->_class->registered)
9954 {
9955 if(!type->_class->registered->dataType)
9956 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9957 type = type->_class->registered->dataType;
9958 }
9959 switch(type->kind)
9960 {
9961 case 1:
9962 if(type->isSigned)
9963 bits |= ((char)part << bitMember->pos);
9964 else
9965 bits |= ((unsigned char)part << bitMember->pos);
9966 break;
9967 case 2:
9968 if(type->isSigned)
9969 bits |= ((short)part << bitMember->pos);
9970 else
9971 bits |= ((unsigned short)part << bitMember->pos);
9972 break;
9973 case 3:
9974 case 5:
9975 if(type->isSigned)
9976 bits |= (part << bitMember->pos);
9977 else
9978 bits |= ((unsigned int)part << bitMember->pos);
9979 break;
9980 case 4:
9981 if(type->isSigned)
9982 bits |= ((long long)part << bitMember->pos);
9983 else
9984 bits |= ((uint64)part << bitMember->pos);
9985 break;
9986 case 22:
9987 if(type->isSigned)
9988 bits |= ((intptr_t)part << bitMember->pos);
9989 else
9990 bits |= ((uintptr_t)part << bitMember->pos);
9991 break;
9992 }
9993 }
9994 }
9995 }
9996 else
9997 {
9998 if(_class && _class->type == 3)
9999 {
10000 ComputeExpression(member->initializer->exp);
10001 exp->constant = member->initializer->exp->constant;
10002 exp->type = 2;
10003 member->initializer->exp->constant = (((void *)0));
10004 }
10005 }
10006 }
10007 }
10008 break;
10009 }
10010 }
10011 }
10012 }
10013 if(_class && _class->type == 2)
10014 {
10015 exp->constant = PrintHexUInt(bits);
10016 exp->type = 2;
10017 }
10018 if(exp->type != 1)
10019 {
10020 FreeInstance(inst);
10021 }
10022 }
10023
10024 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10025 {
10026 if(exp->op.op == SIZEOF)
10027 {
10028 FreeExpContents(exp);
10029 exp->type = 2;
10030 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10031 }
10032 else
10033 {
10034 if(!exp->op.exp1)
10035 {
10036 switch(exp->op.op)
10037 {
10038 case '+':
10039 {
10040 struct Expression * exp2 = exp->op.exp2;
10041
10042 exp->op.exp2 = (((void *)0));
10043 FreeExpContents(exp);
10044 FreeType(exp->expType);
10045 FreeType(exp->destType);
10046 *exp = *exp2;
10047 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10048 break;
10049 }
10050 case '-':
10051 if(op1->ops.Neg)
10052 {
10053 FreeExpContents(exp);
10054 op1->ops.Neg(exp, op1);
10055 }
10056 break;
10057 case '~':
10058 if(op1->ops.BitNot)
10059 {
10060 FreeExpContents(exp);
10061 op1->ops.BitNot(exp, op1);
10062 }
10063 break;
10064 case '!':
10065 if(op1->ops.Not)
10066 {
10067 FreeExpContents(exp);
10068 op1->ops.Not(exp, op1);
10069 }
10070 break;
10071 }
10072 }
10073 else
10074 {
10075 switch(exp->op.op)
10076 {
10077 case '+':
10078 if(op1->ops.Add)
10079 {
10080 FreeExpContents(exp);
10081 op1->ops.Add(exp, op1, op2);
10082 }
10083 break;
10084 case '-':
10085 if(op1->ops.Sub)
10086 {
10087 FreeExpContents(exp);
10088 op1->ops.Sub(exp, op1, op2);
10089 }
10090 break;
10091 case '*':
10092 if(op1->ops.Mul)
10093 {
10094 FreeExpContents(exp);
10095 op1->ops.Mul(exp, op1, op2);
10096 }
10097 break;
10098 case '/':
10099 if(op1->ops.Div)
10100 {
10101 FreeExpContents(exp);
10102 op1->ops.Div(exp, op1, op2);
10103 }
10104 break;
10105 case '%':
10106 if(op1->ops.Mod)
10107 {
10108 FreeExpContents(exp);
10109 op1->ops.Mod(exp, op1, op2);
10110 }
10111 break;
10112 case '&':
10113 if(exp->op.exp2)
10114 {
10115 if(op1->ops.BitAnd)
10116 {
10117 FreeExpContents(exp);
10118 op1->ops.BitAnd(exp, op1, op2);
10119 }
10120 }
10121 break;
10122 case '|':
10123 if(op1->ops.BitOr)
10124 {
10125 FreeExpContents(exp);
10126 op1->ops.BitOr(exp, op1, op2);
10127 }
10128 break;
10129 case '^':
10130 if(op1->ops.BitXor)
10131 {
10132 FreeExpContents(exp);
10133 op1->ops.BitXor(exp, op1, op2);
10134 }
10135 break;
10136 case LEFT_OP:
10137 if(op1->ops.LShift)
10138 {
10139 FreeExpContents(exp);
10140 op1->ops.LShift(exp, op1, op2);
10141 }
10142 break;
10143 case RIGHT_OP:
10144 if(op1->ops.RShift)
10145 {
10146 FreeExpContents(exp);
10147 op1->ops.RShift(exp, op1, op2);
10148 }
10149 break;
10150 case EQ_OP:
10151 if(op1->ops.Equ)
10152 {
10153 FreeExpContents(exp);
10154 op1->ops.Equ(exp, op1, op2);
10155 }
10156 break;
10157 case NE_OP:
10158 if(op1->ops.Nqu)
10159 {
10160 FreeExpContents(exp);
10161 op1->ops.Nqu(exp, op1, op2);
10162 }
10163 break;
10164 case AND_OP:
10165 if(op1->ops.And)
10166 {
10167 FreeExpContents(exp);
10168 op1->ops.And(exp, op1, op2);
10169 }
10170 break;
10171 case OR_OP:
10172 if(op1->ops.Or)
10173 {
10174 FreeExpContents(exp);
10175 op1->ops.Or(exp, op1, op2);
10176 }
10177 break;
10178 case '>':
10179 if(op1->ops.Grt)
10180 {
10181 FreeExpContents(exp);
10182 op1->ops.Grt(exp, op1, op2);
10183 }
10184 break;
10185 case '<':
10186 if(op1->ops.Sma)
10187 {
10188 FreeExpContents(exp);
10189 op1->ops.Sma(exp, op1, op2);
10190 }
10191 break;
10192 case GE_OP:
10193 if(op1->ops.GrtEqu)
10194 {
10195 FreeExpContents(exp);
10196 op1->ops.GrtEqu(exp, op1, op2);
10197 }
10198 break;
10199 case LE_OP:
10200 if(op1->ops.SmaEqu)
10201 {
10202 FreeExpContents(exp);
10203 op1->ops.SmaEqu(exp, op1, op2);
10204 }
10205 break;
10206 }
10207 }
10208 }
10209 }
10210
10211 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10212
10213 void ComputeExpression(struct Expression * exp)
10214 {
10215 char expString[10240];
10216
10217 expString[0] = '\0';
10218 switch(exp->type)
10219 {
10220 case 1:
10221 {
10222 ComputeInstantiation(exp);
10223 break;
10224 }
10225 case 4:
10226 {
10227 struct Expression * exp1, * exp2 = (((void *)0));
10228 struct Operand op1 = 
10229 {
10230 0, 0, 0, 0, 
10231 {
10232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10233 }
10234 };
10235 struct Operand op2 = 
10236 {
10237 0, 0, 0, 0, 
10238 {
10239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10240 }
10241 };
10242
10243 if(exp->op.exp2)
10244 ComputeExpression(exp->op.exp2);
10245 if(exp->op.exp1)
10246 {
10247 ComputeExpression(exp->op.exp1);
10248 exp1 = exp->op.exp1;
10249 exp2 = exp->op.exp2;
10250 op1 = GetOperand(exp1);
10251 if(op1.type)
10252 op1.type->refCount++;
10253 if(exp2)
10254 {
10255 op2 = GetOperand(exp2);
10256 if(op2.type)
10257 op2.type->refCount++;
10258 }
10259 }
10260 else
10261 {
10262 exp1 = exp->op.exp2;
10263 op1 = GetOperand(exp1);
10264 if(op1.type)
10265 op1.type->refCount++;
10266 }
10267 CallOperator(exp, exp1, exp2, &op1, &op2);
10268 if(op1.type)
10269 FreeType(op1.type);
10270 if(op2.type)
10271 FreeType(op2.type);
10272 break;
10273 }
10274 case 5:
10275 case 34:
10276 {
10277 struct Expression * e, * n;
10278
10279 for(e = (*exp->list).first; e; e = n)
10280 {
10281 n = e->next;
10282 if(!n)
10283 {
10284 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10285
10286 ComputeExpression(e);
10287 FreeType(exp->expType);
10288 FreeType(exp->destType);
10289 *exp = *e;
10290 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10291 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10292 }
10293 else
10294 {
10295 FreeExpression(e);
10296 }
10297 }
10298 break;
10299 }
10300 case 8:
10301 {
10302 struct Expression * memberExp = exp->member.exp;
10303 struct Identifier * memberID = exp->member.member;
10304 struct Type * type;
10305
10306 ComputeExpression(exp->member.exp);
10307 type = exp->member.exp->expType;
10308 if(type)
10309 {
10310 struct __ecereNameSpace__ecere__com__Class * _class = (exp->member.member && exp->member.member->classSym) ? exp->member.member->classSym->registered : (((type->kind == 8 || type->kind == 19) && type->_class) ? type->_class->registered : (((void *)0)));
10311 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10312 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10313 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10314
10315 if(type->kind == 19 && exp->member.exp->type == 26)
10316 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10317 if(!_class)
10318 {
10319 char string[256];
10320 struct Symbol * classSym;
10321
10322 string[0] = '\0';
10323 PrintType(type, string, 0x0, 0x1);
10324 classSym = FindClass(string);
10325 _class = classSym ? classSym->registered : (((void *)0));
10326 }
10327 if(exp->member.member)
10328 {
10329 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10330 if(!prop)
10331 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10332 }
10333 if(!prop && !member && _class && exp->member.member)
10334 {
10335 struct Symbol * classSym = FindClass(exp->member.member->string);
10336
10337 convertTo = _class;
10338 _class = classSym ? classSym->registered : (((void *)0));
10339 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10340 }
10341 if(prop)
10342 {
10343 if(prop->compiled)
10344 {
10345 struct Type * type = prop->dataType;
10346
10347 if(_class->type == 3)
10348 {
10349 if(type->kind == 8)
10350 {
10351 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10352
10353 if(_class->type == 3)
10354 {
10355 if(!_class->dataType)
10356 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10357 type = _class->dataType;
10358 }
10359 }
10360 switch(type->kind)
10361 {
10362 case 6:
10363 {
10364 float value;
10365 float (* Get)(float) = (void *)prop->Get;
10366
10367 GetFloat(exp->member.exp, &value);
10368 exp->constant = PrintFloat(Get ? Get(value) : value);
10369 exp->type = 2;
10370 break;
10371 }
10372 case 7:
10373 {
10374 double value;
10375 double (* Get)(double);
10376
10377 GetDouble(exp->member.exp, &value);
10378 if(convertTo)
10379 Get = (void *)prop->Set;
10380 else
10381 Get = (void *)prop->Get;
10382 exp->constant = PrintDouble(Get ? Get(value) : value);
10383 exp->type = 2;
10384 break;
10385 }
10386 }
10387 }
10388 else
10389 {
10390 if(convertTo)
10391 {
10392 struct Expression * value = exp->member.exp;
10393 struct Type * type;
10394
10395 if(!prop->dataType)
10396 ProcessPropertyType(prop);
10397 type = prop->dataType;
10398 if(!type)
10399 {
10400 }
10401 else if(_class->type == 1)
10402 {
10403 switch(type->kind)
10404 {
10405 case 8:
10406 {
10407 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10408
10409 if(propertyClass->type == 1 && value->type == 1)
10410 {
10411 void (* Set)(void *, void *) = (void *)prop->Set;
10412
10413 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10414 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10415 exp->instance->_class = MkSpecifierName(_class->fullName);
10416 exp->instance->loc = exp->loc;
10417 exp->type = 1;
10418 Set(exp->instance->data, value->instance->data);
10419 PopulateInstance(exp->instance);
10420 }
10421 break;
10422 }
10423 case 3:
10424 {
10425 int intValue;
10426 void (* Set)(void *, int) = (void *)prop->Set;
10427
10428 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10429 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10430 exp->instance->_class = MkSpecifierName(_class->fullName);
10431 exp->instance->loc = exp->loc;
10432 exp->type = 1;
10433 GetInt(value, &intValue);
10434 Set(exp->instance->data, intValue);
10435 PopulateInstance(exp->instance);
10436 break;
10437 }
10438 case 4:
10439 {
10440 long long intValue;
10441 void (* Set)(void *, long long) = (void *)prop->Set;
10442
10443 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10444 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10445 exp->instance->_class = MkSpecifierName(_class->fullName);
10446 exp->instance->loc = exp->loc;
10447 exp->type = 1;
10448 GetInt64(value, &intValue);
10449 Set(exp->instance->data, intValue);
10450 PopulateInstance(exp->instance);
10451 break;
10452 }
10453 case 22:
10454 {
10455 intptr_t intValue;
10456 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10457
10458 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10459 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10460 exp->instance->_class = MkSpecifierName(_class->fullName);
10461 exp->instance->loc = exp->loc;
10462 exp->type = 1;
10463 GetIntPtr(value, &intValue);
10464 Set(exp->instance->data, intValue);
10465 PopulateInstance(exp->instance);
10466 break;
10467 }
10468 case 7:
10469 {
10470 double doubleValue;
10471 void (* Set)(void *, double) = (void *)prop->Set;
10472
10473 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10474 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10475 exp->instance->_class = MkSpecifierName(_class->fullName);
10476 exp->instance->loc = exp->loc;
10477 exp->type = 1;
10478 GetDouble(value, &doubleValue);
10479 Set(exp->instance->data, doubleValue);
10480 PopulateInstance(exp->instance);
10481 break;
10482 }
10483 }
10484 }
10485 else if(_class->type == 2)
10486 {
10487 switch(type->kind)
10488 {
10489 case 8:
10490 {
10491 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10492
10493 if(propertyClass->type == 1 && value->instance->data)
10494 {
10495 unsigned int (* Set)(void *) = (void *)prop->Set;
10496 unsigned int bits = Set(value->instance->data);
10497
10498 exp->constant = PrintHexUInt(bits);
10499 exp->type = 2;
10500 break;
10501 }
10502 else if(_class->type == 2)
10503 {
10504 unsigned int value;
10505 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10506 unsigned int bits;
10507
10508 GetUInt(exp->member.exp, &value);
10509 bits = Set(value);
10510 exp->constant = PrintHexUInt(bits);
10511 exp->type = 2;
10512 }
10513 }
10514 }
10515 }
10516 }
10517 else
10518 {
10519 if(_class->type == 2)
10520 {
10521 unsigned int value;
10522
10523 GetUInt(exp->member.exp, &value);
10524 switch(type->kind)
10525 {
10526 case 8:
10527 {
10528 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10529
10530 if(_class->type == 1)
10531 {
10532 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10533
10534 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10535 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10536 exp->instance->_class = MkSpecifierName(_class->fullName);
10537 exp->instance->loc = exp->loc;
10538 exp->type = 1;
10539 Get(value, exp->instance->data);
10540 PopulateInstance(exp->instance);
10541 }
10542 else if(_class->type == 2)
10543 {
10544 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10545 uint64 bits = Get(value);
10546
10547 exp->constant = PrintHexUInt64(bits);
10548 exp->type = 2;
10549 }
10550 break;
10551 }
10552 }
10553 }
10554 else if(_class->type == 1)
10555 {
10556 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10557
10558 switch(type->kind)
10559 {
10560 case 8:
10561 {
10562 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10563
10564 if(_class->type == 1 && value)
10565 {
10566 void (* Get)(void *, void *) = (void *)prop->Get;
10567
10568 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10569 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10570 exp->instance->_class = MkSpecifierName(_class->fullName);
10571 exp->instance->loc = exp->loc;
10572 exp->type = 1;
10573 Get(value, exp->instance->data);
10574 PopulateInstance(exp->instance);
10575 }
10576 break;
10577 }
10578 }
10579 }
10580 }
10581 }
10582 }
10583 else
10584 {
10585 exp->isConstant = 0x0;
10586 }
10587 }
10588 else if(member)
10589 {
10590 }
10591 }
10592 if(exp->type != 8)
10593 {
10594 FreeExpression(memberExp);
10595 FreeIdentifier(memberID);
10596 }
10597 break;
10598 }
10599 case 10:
10600 {
10601 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10602
10603 FreeExpContents(exp);
10604 exp->constant = PrintUInt(ComputeTypeSize(type));
10605 exp->type = 2;
10606 FreeType(type);
10607 break;
10608 }
10609 case 15:
10610 {
10611 struct Symbol * classSym = exp->_class->symbol;
10612
10613 if(classSym && classSym->registered)
10614 {
10615 if(classSym->registered->fixed)
10616 {
10617 FreeSpecifier(exp->_class);
10618 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10619 exp->type = 2;
10620 }
10621 else
10622 {
10623 char className[1024];
10624
10625 strcpy(className, "__ecereClass_");
10626 FullClassNameCat(className, classSym->string, 0x1);
10627 MangleClassName(className);
10628 FreeExpContents(exp);
10629 exp->type = 9;
10630 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10631 exp->member.member = MkIdentifier("structSize");
10632 }
10633 }
10634 break;
10635 }
10636 case 11:
10637 {
10638 struct Type * type;
10639 struct Expression * e = exp;
10640
10641 if(exp->type == 11)
10642 {
10643 if(exp->cast.exp)
10644 ComputeExpression(exp->cast.exp);
10645 e = exp->cast.exp;
10646 }
10647 if(e && exp->expType)
10648 {
10649 type = exp->expType;
10650 if(type->kind == 8)
10651 {
10652 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10653
10654 if(_class && (_class->type == 3 || _class->type == 2))
10655 {
10656 if(!_class->dataType)
10657 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10658 type = _class->dataType;
10659 }
10660 }
10661 switch(type->kind)
10662 {
10663 case 1:
10664 if(type->isSigned)
10665 {
10666 char value;
10667
10668 GetChar(e, &value);
10669 FreeExpContents(exp);
10670 exp->constant = PrintChar(value);
10671 exp->type = 2;
10672 }
10673 else
10674 {
10675 unsigned char value;
10676
10677 GetUChar(e, &value);
10678 FreeExpContents(exp);
10679 exp->constant = PrintUChar(value);
10680 exp->type = 2;
10681 }
10682 break;
10683 case 2:
10684 if(type->isSigned)
10685 {
10686 short value;
10687
10688 GetShort(e, &value);
10689 FreeExpContents(exp);
10690 exp->constant = PrintShort(value);
10691 exp->type = 2;
10692 }
10693 else
10694 {
10695 unsigned short value;
10696
10697 GetUShort(e, &value);
10698 FreeExpContents(exp);
10699 exp->constant = PrintUShort(value);
10700 exp->type = 2;
10701 }
10702 break;
10703 case 3:
10704 if(type->isSigned)
10705 {
10706 int value;
10707
10708 GetInt(e, &value);
10709 FreeExpContents(exp);
10710 exp->constant = PrintInt(value);
10711 exp->type = 2;
10712 }
10713 else
10714 {
10715 unsigned int value;
10716
10717 GetUInt(e, &value);
10718 FreeExpContents(exp);
10719 exp->constant = PrintUInt(value);
10720 exp->type = 2;
10721 }
10722 break;
10723 case 4:
10724 if(type->isSigned)
10725 {
10726 long long value;
10727
10728 GetInt64(e, &value);
10729 FreeExpContents(exp);
10730 exp->constant = PrintInt64(value);
10731 exp->type = 2;
10732 }
10733 else
10734 {
10735 uint64 value;
10736
10737 GetUInt64(e, &value);
10738 FreeExpContents(exp);
10739 exp->constant = PrintUInt64(value);
10740 exp->type = 2;
10741 }
10742 break;
10743 case 22:
10744 if(type->isSigned)
10745 {
10746 intptr_t value;
10747
10748 GetIntPtr(e, &value);
10749 FreeExpContents(exp);
10750 exp->constant = PrintInt64((long long)value);
10751 exp->type = 2;
10752 }
10753 else
10754 {
10755 uintptr_t value;
10756
10757 GetUIntPtr(e, &value);
10758 FreeExpContents(exp);
10759 exp->constant = PrintUInt64((uint64)value);
10760 exp->type = 2;
10761 }
10762 break;
10763 case 6:
10764 {
10765 float value;
10766
10767 GetFloat(e, &value);
10768 FreeExpContents(exp);
10769 exp->constant = PrintFloat(value);
10770 exp->type = 2;
10771 break;
10772 }
10773 case 7:
10774 {
10775 double value;
10776
10777 GetDouble(e, &value);
10778 FreeExpContents(exp);
10779 exp->constant = PrintDouble(value);
10780 exp->type = 2;
10781 break;
10782 }
10783 }
10784 }
10785 break;
10786 }
10787 case 12:
10788 {
10789 struct Operand op1 = 
10790 {
10791 0, 0, 0, 0, 
10792 {
10793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10794 }
10795 };
10796 struct Operand op2 = 
10797 {
10798 0, 0, 0, 0, 
10799 {
10800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10801 }
10802 };
10803 struct Operand op3 = 
10804 {
10805 0, 0, 0, 0, 
10806 {
10807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10808 }
10809 };
10810
10811 if(exp->cond.exp)
10812 ComputeExpression((*exp->cond.exp).last);
10813 if(exp->cond.elseExp)
10814 ComputeExpression(exp->cond.elseExp);
10815 if(exp->cond.cond)
10816 ComputeExpression(exp->cond.cond);
10817 op1 = GetOperand(exp->cond.cond);
10818 if(op1.type)
10819 op1.type->refCount++;
10820 op2 = GetOperand((*exp->cond.exp).last);
10821 if(op2.type)
10822 op2.type->refCount++;
10823 op3 = GetOperand(exp->cond.elseExp);
10824 if(op3.type)
10825 op3.type->refCount++;
10826 if(op1.ops.Cond)
10827 {
10828 FreeExpContents(exp);
10829 op1.ops.Cond(exp, &op1, &op2, &op3);
10830 }
10831 if(op1.type)
10832 FreeType(op1.type);
10833 if(op2.type)
10834 FreeType(op2.type);
10835 if(op3.type)
10836 FreeType(op3.type);
10837 break;
10838 }
10839 }
10840 }
10841
10842 void ApplyAnyObjectLogic(struct Expression * e);
10843
10844 extern void CopyTypeInto(struct Type * type, struct Type * src);
10845
10846 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10847 {
10848 unsigned int result = 0x1;
10849
10850 if(destType)
10851 {
10852 struct __ecereNameSpace__ecere__sys__OldList converts = 
10853 {
10854 0, 0, 0, 0, 0
10855 };
10856 struct Conversion * convert;
10857
10858 if(destType->kind == 0)
10859 return 0x0;
10860 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10861 result = 0x0;
10862 if(converts.count)
10863 {
10864 for(convert = converts.first; convert; convert = convert->next)
10865 {
10866 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10867
10868 if(!empty)
10869 {
10870 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10871 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10872
10873 *newExp = *exp;
10874 newExp->destType = (((void *)0));
10875 if(convert->isGet)
10876 {
10877 exp->type = 8;
10878 exp->addedThis = 0x1;
10879 exp->member.exp = newExp;
10880 FreeType(exp->member.exp->expType);
10881 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10882 exp->member.exp->expType->classObjectType = objectType;
10883 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10884 exp->member.memberType = 1;
10885 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10886 exp->needCast = 0x1;
10887 if(exp->expType)
10888 exp->expType->refCount++;
10889 ApplyAnyObjectLogic(exp->member.exp);
10890 }
10891 else
10892 {
10893 {
10894 exp->type = 8;
10895 exp->addedThis = 0x1;
10896 exp->member.exp = newExp;
10897 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10898 {
10899 newExp->byReference = 0x1;
10900 }
10901 FreeType(exp->member.exp->expType);
10902 exp->member.exp->expType = (((void *)0));
10903 if(convert->convert->dataType)
10904 {
10905 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10906 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10907 exp->member.exp->expType->refCount = 1;
10908 exp->member.exp->expType->classObjectType = objectType;
10909 ApplyAnyObjectLogic(exp->member.exp);
10910 }
10911 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10912 exp->member.memberType = 4;
10913 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10914 exp->needCast = 0x1;
10915 if(convert->resultType)
10916 convert->resultType->refCount++;
10917 }
10918 }
10919 }
10920 else
10921 {
10922 FreeType(exp->expType);
10923 if(convert->isGet)
10924 {
10925 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10926 exp->needCast = 0x1;
10927 if(exp->expType)
10928 exp->expType->refCount++;
10929 }
10930 else
10931 {
10932 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10933 exp->needCast = 0x1;
10934 if(convert->resultType)
10935 convert->resultType->refCount++;
10936 }
10937 }
10938 }
10939 if(exp->isConstant && inCompiler)
10940 ComputeExpression(exp);
10941 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10942 }
10943 if(!result && exp->expType && converts.count)
10944 {
10945 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10946 }
10947 if(!result && exp->expType && exp->destType)
10948 {
10949 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->type->kind == 8 && exp->expType->type->_class == exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->type->kind == 8 && exp->destType->type->_class == exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1))
10950 result = 0x1;
10951 }
10952 }
10953 return result;
10954 }
10955
10956 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10957
10958 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10959
10960 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10961
10962 void CheckTemplateTypes(struct Expression * exp)
10963 {
10964 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10965 {
10966 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10967 struct Statement * compound;
10968 struct Context * context;
10969
10970 *newExp = *exp;
10971 if(exp->destType)
10972 exp->destType->refCount++;
10973 if(exp->expType)
10974 exp->expType->refCount++;
10975 newExp->prev = (((void *)0));
10976 newExp->next = (((void *)0));
10977 switch(exp->expType->kind)
10978 {
10979 case 7:
10980 if(exp->destType->classObjectType)
10981 {
10982 if(exp->destType)
10983 exp->destType->refCount--;
10984 if(exp->expType)
10985 exp->expType->refCount--;
10986 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10987 }
10988 else
10989 {
10990 struct __ecereNameSpace__ecere__sys__OldList * specs;
10991 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10992 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10993
10994 context = PushContext();
10995 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10996 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10997 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10998 exp->type = 25;
10999 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11000 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11001 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11002 exp->compound->compound.context = context;
11003 PopContext(context);
11004 }
11005 break;
11006 default:
11007 exp->type = 11;
11008 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11009 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11010 break;
11011 }
11012 }
11013 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11014 {
11015 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11016 struct Statement * compound;
11017 struct Context * context;
11018
11019 *newExp = *exp;
11020 if(exp->destType)
11021 exp->destType->refCount++;
11022 if(exp->expType)
11023 exp->expType->refCount++;
11024 newExp->prev = (((void *)0));
11025 newExp->next = (((void *)0));
11026 switch(exp->expType->kind)
11027 {
11028 case 7:
11029 if(exp->destType->classObjectType)
11030 {
11031 if(exp->destType)
11032 exp->destType->refCount--;
11033 if(exp->expType)
11034 exp->expType->refCount--;
11035 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11036 }
11037 else
11038 {
11039 struct __ecereNameSpace__ecere__sys__OldList * specs;
11040 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11041 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11042
11043 context = PushContext();
11044 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11045 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11046 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11047 exp->type = 25;
11048 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11049 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11050 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11051 exp->compound->compound.context = context;
11052 PopContext(context);
11053 }
11054 break;
11055 case 8:
11056 {
11057 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11058 {
11059 exp->type = 5;
11060 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11061 ProcessExpressionType((*exp->list).first);
11062 break;
11063 }
11064 else
11065 {
11066 exp->type = 5;
11067 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11068 newExp->needCast = 0x1;
11069 ProcessExpressionType((*exp->list).first);
11070 break;
11071 }
11072 }
11073 default:
11074 {
11075 if(exp->expType->kind == 20)
11076 {
11077 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11078
11079 if(type)
11080 {
11081 FreeType(exp->destType);
11082 FreeType(exp->expType);
11083 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11084 break;
11085 }
11086 }
11087 if(newExp->type == 8 && newExp->member.memberType == 3)
11088 {
11089 exp->type = 4;
11090 exp->op.op = '*';
11091 exp->op.exp1 = (((void *)0));
11092 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11093 }
11094 else
11095 {
11096 char typeString[1024];
11097 struct Declarator * decl;
11098 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11099
11100 typeString[0] = '\0';
11101 PrintType(exp->expType, typeString, 0x0, 0x0);
11102 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11103 exp->type = 11;
11104 exp->cast.typeName = MkTypeName(specs, decl);
11105 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11106 exp->cast.exp->needCast = 0x1;
11107 }
11108 break;
11109 }
11110 }
11111 }
11112 }
11113
11114 extern int strncmp(const char * , const char * , int n);
11115
11116 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
11117
11118 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11119 {
11120 int nsLen = strlen(nameSpace);
11121 struct Symbol * symbol;
11122
11123 for(symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(tree, nameSpace); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
11124 {
11125 char * s = symbol->string;
11126
11127 if(!strncmp(s, nameSpace, nsLen))
11128 {
11129 int c;
11130 char * namePart;
11131
11132 for(c = strlen(s) - 1; c >= 0; c--)
11133 if(s[c] == ':')
11134 break;
11135 namePart = s + c + 1;
11136 if(!strcmp(namePart, name))
11137 {
11138 return symbol;
11139 }
11140 }
11141 else
11142 break;
11143 }
11144 return (((void *)0));
11145 }
11146
11147 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11148 {
11149 int c;
11150 char nameSpace[1024];
11151 char * namePart;
11152 unsigned int gotColon = 0x0;
11153
11154 nameSpace[0] = '\0';
11155 for(c = strlen(name) - 1; c >= 0; c--)
11156 if(name[c] == ':')
11157 {
11158 gotColon = 0x1;
11159 break;
11160 }
11161 namePart = name + c + 1;
11162 while(c >= 0 && name[c] == ':')
11163 c--;
11164 if(c >= 0)
11165 {
11166 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11167
11168 if(symbol)
11169 return symbol;
11170 memcpy(nameSpace, name, c + 1);
11171 nameSpace[c + 1] = (char)0;
11172 return ScanWithNameSpace(tree, nameSpace, namePart);
11173 }
11174 else if(gotColon)
11175 {
11176 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11177
11178 return symbol;
11179 }
11180 else
11181 {
11182 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11183
11184 if(symbol)
11185 return symbol;
11186 return ScanWithNameSpace(tree, "", namePart);
11187 }
11188 return (((void *)0));
11189 }
11190
11191 static void ProcessDeclaration(struct Declaration * decl);
11192
11193 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11194 {
11195 struct Context * ctx;
11196 struct Symbol * symbol = (((void *)0));
11197
11198 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11199 {
11200 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11201 {
11202 symbol = (((void *)0));
11203 if(thisNameSpace)
11204 {
11205 char curName[1024];
11206
11207 strcpy(curName, thisNameSpace);
11208 strcat(curName, "::");
11209 strcat(curName, name);
11210 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11211 }
11212 if(!symbol)
11213 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11214 }
11215 else
11216 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11217 if(symbol || ctx == endContext)
11218 break;
11219 }
11220 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11221 {
11222 if(symbol->pointerExternal->type == 0)
11223 {
11224 struct FunctionDefinition * function = symbol->pointerExternal->function;
11225 struct Context * tmpContext = curContext;
11226
11227 curContext = (((void *)0));
11228 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11229 curContext = tmpContext;
11230 symbol->pointerExternal->symbol = symbol;
11231 DeclareType(symbol->type, 0x1, 0x1);
11232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11233 symbol->id = curExternal->symbol->idCode;
11234 }
11235 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11236 {
11237 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11238 symbol->id = curExternal->symbol->idCode;
11239 }
11240 }
11241 return symbol;
11242 }
11243
11244 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11245 {
11246 if(!type->isSigned && type->kind != 22)
11247 ListAdd(specs, MkSpecifier(UNSIGNED));
11248 switch(type->kind)
11249 {
11250 case 8:
11251 {
11252 if(type->_class->registered)
11253 {
11254 if(!type->_class->registered->dataType)
11255 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11256 GetTypeSpecs(type->_class->registered->dataType, specs);
11257 }
11258 break;
11259 }
11260 case 7:
11261 ListAdd(specs, MkSpecifier(DOUBLE));
11262 break;
11263 case 6:
11264 ListAdd(specs, MkSpecifier(FLOAT));
11265 break;
11266 case 1:
11267 ListAdd(specs, MkSpecifier(CHAR));
11268 break;
11269 case 2:
11270 ListAdd(specs, MkSpecifier(SHORT));
11271 break;
11272 case 4:
11273 ListAdd(specs, MkSpecifier(INT64));
11274 break;
11275 case 22:
11276 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11277 break;
11278 case 3:
11279 default:
11280 ListAdd(specs, MkSpecifier(INT));
11281 break;
11282 }
11283 }
11284
11285 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11286
11287 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11288 {
11289 if(type)
11290 {
11291 switch(type->kind)
11292 {
11293 case 8:
11294 if(type->_class && type->_class->string)
11295 {
11296 if(type->classObjectType == 2)
11297 strcat(string, "typed_object");
11298 else if(fullName)
11299 strcat(string, type->_class->string);
11300 else
11301 {
11302 if(type->_class->registered)
11303 strcat(string, type->_class->registered->name);
11304 else
11305 strcat(string, type->_class->string);
11306 }
11307 }
11308 break;
11309 case 13:
11310 {
11311 {
11312 _PrintType(type->type, string, 0x0, printFunction, fullName);
11313 strcat(string, " *");
11314 }
11315 break;
11316 }
11317 case 0:
11318 strcat(string, "void");
11319 break;
11320 case 3:
11321 strcat(string, type->isSigned ? "int" : "uint");
11322 break;
11323 case 4:
11324 strcat(string, type->isSigned ? "int64" : "uint64");
11325 break;
11326 case 22:
11327 strcat(string, type->isSigned ? "intptr" : "uintptr");
11328 break;
11329 case 1:
11330 strcat(string, type->isSigned ? "char" : "byte");
11331 break;
11332 case 2:
11333 strcat(string, type->isSigned ? "short" : "uint16");
11334 break;
11335 case 6:
11336 strcat(string, "float");
11337 break;
11338 case 7:
11339 strcat(string, "double");
11340 break;
11341 case 9:
11342 if(type->enumName)
11343 {
11344 strcat(string, "struct ");
11345 strcat(string, type->enumName);
11346 }
11347 else if(type->typeName)
11348 {
11349 strcat(string, type->typeName);
11350 }
11351 else
11352 {
11353 struct Type * member;
11354
11355 strcat(string, "struct {");
11356 for(member = type->members.first; member; member = member->next)
11357 {
11358 PrintType(member, string, 0x1, fullName);
11359 strcat(string, "; ");
11360 }
11361 strcat(string, "}");
11362 }
11363 break;
11364 case 10:
11365 if(type->enumName)
11366 {
11367 strcat(string, "union ");
11368 strcat(string, type->enumName);
11369 }
11370 else if(type->typeName)
11371 {
11372 strcat(string, type->typeName);
11373 }
11374 else
11375 {
11376 strcat(string, "union ");
11377 strcat(string, "(unnamed)");
11378 }
11379 break;
11380 case 15:
11381 if(type->enumName)
11382 {
11383 strcat(string, "enum ");
11384 strcat(string, type->enumName);
11385 }
11386 else if(type->typeName)
11387 {
11388 strcat(string, type->typeName);
11389 }
11390 else
11391 strcat(string, "enum");
11392 break;
11393 case 11:
11394 {
11395 if(printFunction)
11396 {
11397 if(type->dllExport)
11398 strcat(string, "dllexport ");
11399 PrintType(type->returnType, string, 0x0, fullName);
11400 strcat(string, " ");
11401 }
11402 if(printName)
11403 {
11404 if(type->name)
11405 {
11406 if(fullName)
11407 strcat(string, type->name);
11408 else
11409 {
11410 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11411
11412 if(name)
11413 name += 2;
11414 else
11415 name = type->name;
11416 strcat(string, name);
11417 }
11418 }
11419 }
11420 if(printFunction)
11421 {
11422 struct Type * param;
11423
11424 strcat(string, "(");
11425 for(param = type->params.first; param; param = param->next)
11426 {
11427 PrintType(param, string, 0x1, fullName);
11428 if(param->next)
11429 strcat(string, ", ");
11430 }
11431 strcat(string, ")");
11432 }
11433 break;
11434 }
11435 case 12:
11436 {
11437 {
11438 char baseType[1024], size[256];
11439 struct Type * arrayType = type;
11440
11441 baseType[0] = '\0';
11442 size[0] = '\0';
11443 while(arrayType->kind == 12)
11444 {
11445 strcat(size, "[");
11446 if(arrayType->enumClass)
11447 strcat(size, arrayType->enumClass->string);
11448 else if(arrayType->arraySizeExp)
11449 PrintExpression(arrayType->arraySizeExp, size);
11450 strcat(size, "]");
11451 arrayType = arrayType->arrayType;
11452 }
11453 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11454 strcat(string, baseType);
11455 strcat(string, size);
11456 }
11457 printName = 0x0;
11458 break;
11459 }
11460 case 14:
11461 strcat(string, "...");
11462 break;
11463 case 16:
11464 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11465 break;
11466 case 19:
11467 strcat(string, "subclass(");
11468 strcat(string, type->_class ? type->_class->string : "int");
11469 strcat(string, ")");
11470 break;
11471 case 20:
11472 strcat(string, type->templateParameter->identifier->string);
11473 break;
11474 case 21:
11475 strcat(string, "thisclass");
11476 break;
11477 case 17:
11478 strcat(string, "__builtin_va_list");
11479 break;
11480 }
11481 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11482 {
11483 strcat(string, " ");
11484 strcat(string, type->name);
11485 }
11486 }
11487 }
11488
11489 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11490 {
11491 struct Type * funcType;
11492
11493 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11494 ;
11495 if(funcType && funcType->kind == 11 && type != funcType)
11496 {
11497 char typeString[1024];
11498 struct Type * param;
11499
11500 PrintType(funcType->returnType, string, 0x0, fullName);
11501 strcat(string, "(");
11502 _PrintType(type, string, printName, 0x0, fullName);
11503 strcat(string, ")");
11504 strcat(string, "(");
11505 for(param = funcType->params.first; param; param = param->next)
11506 {
11507 PrintType(param, string, 0x1, fullName);
11508 if(param->next)
11509 strcat(string, ", ");
11510 }
11511 strcat(string, ")");
11512 }
11513 else
11514 _PrintType(type, string, printName, 0x1, fullName);
11515 if(type->bitFieldCount)
11516 {
11517 char count[100];
11518
11519 sprintf(count, ":%d", type->bitFieldCount);
11520 strcat(string, count);
11521 }
11522 }
11523
11524 static struct Type * FindMember(struct Type * type, char * string)
11525 {
11526 struct Type * memberType;
11527
11528 for(memberType = type->members.first; memberType; memberType = memberType->next)
11529 {
11530 if(!memberType->name)
11531 {
11532 struct Type * subType = FindMember(memberType, string);
11533
11534 if(subType)
11535 return subType;
11536 }
11537 else if(!strcmp(memberType->name, string))
11538 return memberType;
11539 }
11540 return (((void *)0));
11541 }
11542
11543 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11544 {
11545 struct Type * memberType;
11546
11547 for(memberType = type->members.first; memberType; memberType = memberType->next)
11548 {
11549 if(!memberType->name)
11550 {
11551 struct Type * subType = FindMember(memberType, string);
11552
11553 if(subType)
11554 {
11555 *offset += memberType->offset;
11556 return subType;
11557 }
11558 }
11559 else if(!strcmp(memberType->name, string))
11560 {
11561 *offset += memberType->offset;
11562 return memberType;
11563 }
11564 }
11565 return (((void *)0));
11566 }
11567
11568 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11569
11570 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11571
11572 struct Expression * ParseExpressionString(char * expression)
11573 {
11574 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11575 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11576 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11577 echoOn = 0x0;
11578 parsedExpression = (((void *)0));
11579 resetScanner();
11580 expression_yyparse();
11581 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11582 return parsedExpression;
11583 }
11584
11585 extern char *  QMkString(char *  source);
11586
11587 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11588 {
11589 void * __ecereTemp1;
11590 struct Identifier * id = exp->identifier;
11591 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11592 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11593 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11594 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11595
11596 if(_class && _class->type == 4)
11597 {
11598 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11599 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11600
11601 if(enumClass)
11602 {
11603 struct __ecereNameSpace__ecere__com__Class * baseClass;
11604
11605 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11606 {
11607 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11608
11609 for(value = e->values.first; value; value = value->next)
11610 {
11611 if(!strcmp(value->name, id->string))
11612 break;
11613 }
11614 if(value)
11615 {
11616 char constant[256];
11617
11618 FreeExpContents(exp);
11619 exp->type = 2;
11620 exp->isConstant = 0x1;
11621 if(!strcmp(baseClass->dataTypeString, "int"))
11622 sprintf(constant, "%d", value->data);
11623 else
11624 sprintf(constant, "0x%X", value->data);
11625 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11626 exp->expType = MkClassType(baseClass->fullName);
11627 break;
11628 }
11629 }
11630 }
11631 if(value)
11632 return 0x1;
11633 }
11634 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11635 {
11636 ProcessMethodType(method);
11637 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11638 return 0x1;
11639 }
11640 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11641 {
11642 if(!prop->dataType)
11643 ProcessPropertyType(prop);
11644 exp->expType = prop->dataType;
11645 if(prop->dataType)
11646 prop->dataType->refCount++;
11647 return 0x1;
11648 }
11649 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11650 {
11651 if(!member->dataType)
11652 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11653 exp->expType = member->dataType;
11654 if(member->dataType)
11655 member->dataType->refCount++;
11656 return 0x1;
11657 }
11658 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11659 {
11660 if(!classProp->dataType)
11661 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11662 if(classProp->constant)
11663 {
11664 FreeExpContents(exp);
11665 exp->isConstant = 0x1;
11666 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11667 {
11668 exp->type = 3;
11669 exp->constant = QMkString((char *)classProp->Get(_class));
11670 }
11671 else
11672 {
11673 char constant[256];
11674
11675 exp->type = 2;
11676 sprintf(constant, "%d", classProp->Get(_class));
11677 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11678 }
11679 }
11680 else
11681 {
11682 }
11683 exp->expType = classProp->dataType;
11684 if(classProp->dataType)
11685 classProp->dataType->refCount++;
11686 return 0x1;
11687 }
11688 return 0x0;
11689 }
11690
11691 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11692 {
11693 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11694 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11695 struct __ecereNameSpace__ecere__com__NameSpace * child;
11696
11697 if(!data)
11698 {
11699 for(child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); child; child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)child)))
11700 {
11701 data = ScanGlobalData(child, name);
11702 if(data)
11703 break;
11704 }
11705 }
11706 return data;
11707 }
11708
11709 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11710
11711 extern char *  strncpy(char * , const char * , int n);
11712
11713 static struct GlobalData * FindGlobalData(char * name)
11714 {
11715 int start = 0, c;
11716 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11717
11718 nameSpace = globalData;
11719 for(c = 0; name[c]; c++)
11720 {
11721 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11722 {
11723 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11724 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11725
11726 strncpy(spaceName, name + start, c - start);
11727 spaceName[c - start] = '\0';
11728 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11729 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11730 if(!newSpace)
11731 return (((void *)0));
11732 nameSpace = newSpace;
11733 if(name[c] == ':')
11734 c++;
11735 start = c + 1;
11736 }
11737 }
11738 if(c - start)
11739 {
11740 return ScanGlobalData(nameSpace, name + start);
11741 }
11742 return (((void *)0));
11743 }
11744
11745 static int definedExpStackPos;
11746
11747 static void * definedExpStack[512];
11748
11749 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11750 {
11751 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11752
11753 FreeExpContents(checkedExp);
11754 FreeType(checkedExp->expType);
11755 FreeType(checkedExp->destType);
11756 *checkedExp = *newExp;
11757 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11758 checkedExp->prev = prev;
11759 checkedExp->next = next;
11760 }
11761
11762 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11763
11764 extern int printf(char * , ...);
11765
11766 void __ecereMethod_Expression_Clear();
11767
11768 void ApplyAnyObjectLogic(struct Expression * e)
11769 {
11770 struct Type * destType = e->destType;
11771
11772 if(destType && (destType->classObjectType == 3))
11773 {
11774 if(e && e->expType)
11775 {
11776 struct Type * type = e->expType;
11777 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11778
11779 if(type->kind == 8 && type->_class && type->_class->registered)
11780 {
11781 _class = type->_class->registered;
11782 }
11783 else if(type->kind == 19)
11784 {
11785 _class = FindClass("ecere::com::Class")->registered;
11786 }
11787 else
11788 {
11789 char string[1024] = "";
11790 struct Symbol * classSym;
11791
11792 PrintType(type, string, 0x0, 0x1);
11793 classSym = FindClass(string);
11794 if(classSym)
11795 _class = classSym->registered;
11796 }
11797 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11798 {
11799 if(!_class || strcmp(_class->fullName, "char *"))
11800 {
11801 struct Expression * checkedExp = e, * newExp;
11802
11803 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11804 {
11805 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11806 {
11807 if(checkedExp->type == 25)
11808 {
11809 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11810 }
11811 else
11812 checkedExp = (*checkedExp->list).last;
11813 }
11814 else if(checkedExp->type == 11)
11815 checkedExp = checkedExp->cast.exp;
11816 }
11817 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11818 {
11819 newExp = checkedExp->op.exp2;
11820 checkedExp->op.exp2 = (((void *)0));
11821 FreeExpContents(checkedExp);
11822 if(e->expType && e->expType->passAsTemplate)
11823 {
11824 char size[100];
11825
11826 ComputeTypeSize(e->expType);
11827 sprintf(size, "%d", e->expType->size);
11828 newExp = MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp), '+', MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), MkListOne(MkExpConstant(size))))));
11829 }
11830 ReplaceExpContents(checkedExp, newExp);
11831 e->byReference = 0x1;
11832 }
11833 else if(!e->byReference || (_class && _class->type == 5))
11834 {
11835 struct Expression * checkedExp, * newExp;
11836
11837 {
11838 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->member.memberType == 3) || (e->type == 9 && e->member.memberType == 3) || (e->type == 4 && !e->op.exp1 && e->op.op == '*') || e->type == 6;
11839
11840 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11841 {
11842 struct Context * context = PushContext();
11843 struct Declarator * decl;
11844 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11845 char typeString[1024];
11846 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11847
11848 typeString[0] = '\0';
11849 *newExp = *e;
11850 newExp->prev = (((void *)0));
11851 newExp->next = (((void *)0));
11852 newExp->expType = (((void *)0));
11853 PrintType(e->expType, typeString, 0x0, 0x1);
11854 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11855 newExp->destType = ProcessType(specs, decl);
11856 curContext = context;
11857 e->type = 25;
11858 if(curCompound)
11859 {
11860 char name[100];
11861 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11862
11863 sprintf(name, "__internalValue%03X", internalValueCounter++);
11864 if(!curCompound->compound.declarations)
11865 curCompound->compound.declarations = MkList();
11866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11867 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11868 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11869 e->compound = MkCompoundStmt((((void *)0)), stmts);
11870 }
11871 else
11872 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11873 {
11874 struct Type * type = e->destType;
11875
11876 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11877 CopyTypeInto(e->destType, type);
11878 e->destType->refCount = 1;
11879 e->destType->classObjectType = 0;
11880 FreeType(type);
11881 }
11882 e->compound->compound.context = context;
11883 PopContext(context);
11884 curContext = context->parent;
11885 }
11886 }
11887 checkedExp = e;
11888 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11889 {
11890 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11891 {
11892 if(checkedExp->type == 25)
11893 {
11894 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11895 }
11896 else
11897 checkedExp = (*checkedExp->list).last;
11898 }
11899 else if(checkedExp->type == 11)
11900 checkedExp = checkedExp->cast.exp;
11901 }
11902 {
11903 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11904
11905 *operand = *checkedExp;
11906 checkedExp->destType = (((void *)0));
11907 checkedExp->expType = (((void *)0));
11908 __ecereMethod_Expression_Clear(checkedExp);
11909 checkedExp->type = 4;
11910 checkedExp->op.op = '&';
11911 checkedExp->op.exp1 = (((void *)0));
11912 checkedExp->op.exp2 = operand;
11913 }
11914 }
11915 }
11916 }
11917 }
11918 }
11919 {
11920 }
11921 if((!destType || destType->kind == 14 || destType->kind == 0) && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && (e->expType->byReference || (e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))))
11922 {
11923 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11924 {
11925 return ;
11926 }
11927 else
11928 {
11929 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11930
11931 *thisExp = *e;
11932 thisExp->prev = (((void *)0));
11933 thisExp->next = (((void *)0));
11934 __ecereMethod_Expression_Clear(e);
11935 e->type = 5;
11936 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11937 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11938 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11939 {
11940 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11941 CopyTypeInto(e->expType, thisExp->expType);
11942 e->expType->byReference = 0x0;
11943 e->expType->refCount = 1;
11944 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))
11945 {
11946 e->expType->classObjectType = 0;
11947 }
11948 }
11949 }
11950 }
11951 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11952 {
11953 if(destType->kind == 14)
11954 {
11955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11956 }
11957 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11958 {
11959 unsigned int byReference = e->expType->byReference;
11960 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11961 struct Declarator * decl;
11962 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11963 char typeString[1024];
11964 struct Type * type;
11965 int backupClassObjectType;
11966
11967 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11968 type = e->expType;
11969 else
11970 type = destType;
11971 backupClassObjectType = type->classObjectType;
11972 type->classObjectType = 0;
11973 typeString[0] = '\0';
11974 PrintType(type, typeString, 0x0, 0x1);
11975 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11976 type->classObjectType = backupClassObjectType;
11977 *thisExp = *e;
11978 thisExp->prev = (((void *)0));
11979 thisExp->next = (((void *)0));
11980 __ecereMethod_Expression_Clear(e);
11981 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
11982 {
11983 e->type = 4;
11984 e->op.op = '*';
11985 e->op.exp1 = (((void *)0));
11986 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11987 }
11988 else
11989 {
11990 e->type = 11;
11991 e->cast.typeName = MkTypeName(specs, decl);
11992 e->cast.exp = thisExp;
11993 e->byReference = 0x1;
11994 }
11995 e->expType = type;
11996 e->destType = destType;
11997 type->refCount++;
11998 destType->refCount++;
11999 }
12000 }
12001 }
12002
12003 extern char *  strstr(char * , const char * );
12004
12005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12006
12007 struct __ecereNameSpace__ecere__com__DefinedExpression
12008 {
12009 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12010 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12011 char *  name;
12012 char *  value;
12013 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
12014 } __attribute__ ((gcc_struct));
12015
12016 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12017
12018 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12019
12020 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
12021
12022 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12023
12024 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12025
12026 extern struct Expression * CopyExpression(struct Expression * exp);
12027
12028 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12029
12030 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
12031
12032 static void ProcessStatement(struct Statement * stmt);
12033
12034 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12035
12036 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12037
12038 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12039
12040 extern char *  sourceFile;
12041
12042 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12043
12044 void ProcessExpressionType(struct Expression * exp)
12045 {
12046 void * __ecereTemp2;
12047 void * __ecereTemp1;
12048 unsigned int unresolved = 0x0;
12049 struct Location oldyylloc = yylloc;
12050 unsigned int notByReference = 0x0;
12051
12052 if(!exp || exp->expType)
12053 return ;
12054 yylloc = exp->loc;
12055 switch(exp->type)
12056 {
12057 case 0:
12058 {
12059 struct Identifier * id = exp->identifier;
12060
12061 if(!id)
12062 return ;
12063 if(id->_class && id->_class->name)
12064 {
12065 id->classSym = id->_class->symbol;
12066 }
12067 if(strstr(id->string, "__ecereClass") == id->string)
12068 {
12069 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12070 break;
12071 }
12072 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12073 {
12074 ReplaceClassMembers(exp, thisClass);
12075 if(exp->type != 0)
12076 {
12077 ProcessExpressionType(exp);
12078 break;
12079 }
12080 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12081 break;
12082 }
12083 else
12084 {
12085 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12086
12087 if(!symbol)
12088 {
12089 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12090 break;
12091 else
12092 {
12093 if(thisClass)
12094 {
12095 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12096 if(exp->type != 0)
12097 {
12098 ProcessExpressionType(exp);
12099 break;
12100 }
12101 }
12102 else if(currentClass && !id->_class)
12103 {
12104 if(ResolveIdWithClass(exp, currentClass, 0x1))
12105 break;
12106 }
12107 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12108 }
12109 }
12110 if(symbol)
12111 {
12112 struct Type * type = symbol->type;
12113 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12114
12115 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12116 {
12117 struct Context * context = SetupTemplatesContext(_class);
12118
12119 type = ReplaceThisClassType(_class);
12120 FinishTemplatesContext(context);
12121 if(type)
12122 type->refCount = 0;
12123 }
12124 FreeSpecifier(id->_class);
12125 id->_class = (((void *)0));
12126 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12127 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12128 id->classSym = (((void *)0));
12129 exp->expType = type;
12130 if(type)
12131 type->refCount++;
12132 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12133 exp->isConstant = 0x1;
12134 if(symbol->isParam || !strcmp(id->string, "this"))
12135 {
12136 if(_class && _class->type == 1)
12137 exp->byReference = 0x1;
12138 }
12139 if(symbol->isIterator)
12140 {
12141 if(symbol->isIterator == 3)
12142 {
12143 exp->type = 5;
12144 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12145 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12146 exp->expType = (((void *)0));
12147 ProcessExpressionType(exp);
12148 }
12149 else if(symbol->isIterator != 4)
12150 {
12151 exp->type = 8;
12152 exp->member.exp = MkExpIdentifier(exp->identifier);
12153 exp->member.exp->expType = exp->expType;
12154 exp->member.member = MkIdentifier("data");
12155 exp->expType = (((void *)0));
12156 ProcessExpressionType(exp);
12157 }
12158 }
12159 break;
12160 }
12161 else
12162 {
12163 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12164
12165 if(thisNameSpace && !(id->_class && !id->_class->name))
12166 {
12167 char name[1024];
12168
12169 strcpy(name, thisNameSpace);
12170 strcat(name, "::");
12171 strcat(name, id->string);
12172 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12173 }
12174 if(!definedExp)
12175 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12176 if(definedExp)
12177 {
12178 int c;
12179
12180 for(c = 0; c < definedExpStackPos; c++)
12181 if(definedExpStack[c] == definedExp)
12182 break;
12183 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12184 {
12185 struct Location backupYylloc = yylloc;
12186
12187 definedExpStack[definedExpStackPos++] = definedExp;
12188 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12189 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12190 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12191 echoOn = 0x0;
12192 parsedExpression = (((void *)0));
12193 resetScanner();
12194 expression_yyparse();
12195 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12196 yylloc = backupYylloc;
12197 if(parsedExpression)
12198 {
12199 FreeIdentifier(id);
12200 exp->type = 5;
12201 exp->list = MkListOne(parsedExpression);
12202 parsedExpression->loc = yylloc;
12203 ProcessExpressionType(exp);
12204 definedExpStackPos--;
12205 return ;
12206 }
12207 definedExpStackPos--;
12208 }
12209 else
12210 {
12211 if(inCompiler)
12212 {
12213 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12214 }
12215 }
12216 }
12217 else
12218 {
12219 struct GlobalData * data = (((void *)0));
12220
12221 if(thisNameSpace && !(id->_class && !id->_class->name))
12222 {
12223 char name[1024];
12224
12225 strcpy(name, thisNameSpace);
12226 strcat(name, "::");
12227 strcat(name, id->string);
12228 data = FindGlobalData(name);
12229 }
12230 if(!data)
12231 data = FindGlobalData(id->string);
12232 if(data)
12233 {
12234 DeclareGlobalData(data);
12235 exp->expType = data->dataType;
12236 if(data->dataType)
12237 data->dataType->refCount++;
12238 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12239 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12240 FreeSpecifier(id->_class);
12241 id->_class = (((void *)0));
12242 break;
12243 }
12244 else
12245 {
12246 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12247
12248 if(thisNameSpace && !(id->_class && !id->_class->name))
12249 {
12250 char name[1024];
12251
12252 strcpy(name, thisNameSpace);
12253 strcat(name, "::");
12254 strcat(name, id->string);
12255 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12256 }
12257 if(!function)
12258 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12259 if(function)
12260 {
12261 char name[1024];
12262
12263 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12264 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12265 name[0] = (char)0;
12266 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12267 strcpy(name, "__ecereFunction_");
12268 FullClassNameCat(name, id->string, 0x0);
12269 if(DeclareFunction(function, name))
12270 {
12271 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12272 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12273 }
12274 exp->expType = function->dataType;
12275 if(function->dataType)
12276 function->dataType->refCount++;
12277 FreeSpecifier(id->_class);
12278 id->_class = (((void *)0));
12279 break;
12280 }
12281 }
12282 }
12283 }
12284 }
12285 unresolved = 0x1;
12286 break;
12287 }
12288 case 1:
12289 {
12290 struct __ecereNameSpace__ecere__com__Class * _class;
12291
12292 if(!exp->instance->_class)
12293 {
12294 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12295 {
12296 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12297 }
12298 }
12299 ProcessInstantiationType(exp->instance);
12300 exp->isConstant = exp->instance->isConstant;
12301 if(exp->instance->_class)
12302 {
12303 exp->expType = MkClassType(exp->instance->_class->name);
12304 }
12305 break;
12306 }
12307 case 2:
12308 {
12309 if(!exp->expType)
12310 {
12311 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12312
12313 exp->expType = type;
12314 if(exp->constant[0] == '\'')
12315 {
12316 if((int)((unsigned char *)exp->constant)[1] > 127)
12317 {
12318 int nb;
12319 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12320
12321 if(nb < 2)
12322 ch = exp->constant[1];
12323 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12324 exp->constant = PrintUInt(ch);
12325 type->kind = 8;
12326 type->_class = FindClass("unichar");
12327 type->isSigned = 0x0;
12328 }
12329 else
12330 {
12331 type->kind = 1;
12332 type->isSigned = 0x1;
12333 }
12334 }
12335 else if(strchr(exp->constant, '.'))
12336 {
12337 char ch = exp->constant[strlen(exp->constant) - 1];
12338
12339 if(ch == 'f')
12340 type->kind = 6;
12341 else
12342 type->kind = 7;
12343 type->isSigned = 0x1;
12344 }
12345 else
12346 {
12347 if(exp->constant[0] == '0' && exp->constant[1])
12348 type->isSigned = 0x0;
12349 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12350 type->isSigned = 0x0;
12351 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12352 type->isSigned = 0x0;
12353 else
12354 type->isSigned = 0x1;
12355 type->kind = 3;
12356 }
12357 exp->isConstant = 0x1;
12358 }
12359 break;
12360 }
12361 case 3:
12362 {
12363 exp->isConstant = 0x1;
12364 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12365 break;
12366 }
12367 case 13:
12368 case 28:
12369 ProcessExpressionType(exp->_new.size);
12370 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12371 DeclareType(exp->expType->type, 0x0, 0x0);
12372 break;
12373 case 14:
12374 case 29:
12375 ProcessExpressionType(exp->_renew.size);
12376 ProcessExpressionType(exp->_renew.exp);
12377 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12378 DeclareType(exp->expType->type, 0x0, 0x0);
12379 break;
12380 case 4:
12381 {
12382 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12383 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12384 unsigned int useDestType = 0x0, useSideType = 0x0;
12385 struct Location oldyylloc = yylloc;
12386 unsigned int useSideUnit = 0x0;
12387 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12388
12389 switch(exp->op.op)
12390 {
12391 case '=':
12392 case MUL_ASSIGN:
12393 case DIV_ASSIGN:
12394 case MOD_ASSIGN:
12395 case ADD_ASSIGN:
12396 case SUB_ASSIGN:
12397 case LEFT_ASSIGN:
12398 case RIGHT_ASSIGN:
12399 case AND_ASSIGN:
12400 case XOR_ASSIGN:
12401 case OR_ASSIGN:
12402 assign = 0x1;
12403 break;
12404 case '!':
12405 break;
12406 case AND_OP:
12407 case OR_OP:
12408 boolOps = 0x1;
12409 boolResult = 0x1;
12410 break;
12411 case EQ_OP:
12412 case '<':
12413 case '>':
12414 case LE_OP:
12415 case GE_OP:
12416 case NE_OP:
12417 boolResult = 0x1;
12418 useSideType = 0x1;
12419 break;
12420 case '+':
12421 case '-':
12422 useSideUnit = 0x1;
12423 case '|':
12424 case '&':
12425 case '^':
12426 case '/':
12427 case '%':
12428 case '*':
12429 if(exp->op.op != '*' || exp->op.exp1)
12430 {
12431 useSideType = 0x1;
12432 useDestType = 0x1;
12433 }
12434 break;
12435 }
12436 if(exp->op.op == '&')
12437 {
12438 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12439 {
12440 struct Identifier * id = exp->op.exp2->identifier;
12441 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12442
12443 if(symbol && symbol->isIterator == 2)
12444 {
12445 exp->type = 8;
12446 exp->member.exp = exp->op.exp2;
12447 exp->member.member = MkIdentifier("key");
12448 exp->expType = (((void *)0));
12449 exp->op.exp2->expType = symbol->type;
12450 symbol->type->refCount++;
12451 ProcessExpressionType(exp);
12452 FreeType(dummy);
12453 break;
12454 }
12455 }
12456 }
12457 if(exp->op.exp1)
12458 {
12459 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
12460 {
12461 if(exp->op.exp1->destType)
12462 FreeType(exp->op.exp1->destType);
12463 exp->op.exp1->destType = exp->destType;
12464 if(exp->destType)
12465 exp->destType->refCount++;
12466 }
12467 else if(!assign)
12468 {
12469 if(exp->op.exp1->destType)
12470 FreeType(exp->op.exp1->destType);
12471 exp->op.exp1->destType = dummy;
12472 dummy->refCount++;
12473 }
12474 if(exp->op.exp1->destType && exp->op.op != '=')
12475 exp->op.exp1->destType->count++;
12476 ProcessExpressionType(exp->op.exp1);
12477 if(exp->op.exp1->destType && exp->op.op != '=')
12478 exp->op.exp1->destType->count--;
12479 if(exp->op.exp1->destType == dummy)
12480 {
12481 FreeType(dummy);
12482 exp->op.exp1->destType = (((void *)0));
12483 }
12484 type1 = exp->op.exp1->expType;
12485 }
12486 if(exp->op.exp2)
12487 {
12488 char expString[10240];
12489
12490 expString[0] = '\0';
12491 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12492 {
12493 if(exp->op.exp1)
12494 {
12495 exp->op.exp2->destType = exp->op.exp1->expType;
12496 if(exp->op.exp1->expType)
12497 exp->op.exp1->expType->refCount++;
12498 }
12499 else
12500 {
12501 exp->op.exp2->destType = exp->destType;
12502 if(exp->destType)
12503 exp->destType->refCount++;
12504 }
12505 if(type1)
12506 type1->refCount++;
12507 exp->expType = type1;
12508 }
12509 else if(assign)
12510 {
12511 if(inCompiler)
12512 PrintExpression(exp->op.exp2, expString);
12513 if(type1 && type1->kind == 13)
12514 {
12515 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN || exp->op.op == AND_ASSIGN || exp->op.op == OR_ASSIGN)
12516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12517 else if(exp->op.op == '=')
12518 {
12519 if(exp->op.exp2->destType)
12520 FreeType(exp->op.exp2->destType);
12521 exp->op.exp2->destType = type1;
12522 if(type1)
12523 type1->refCount++;
12524 }
12525 }
12526 else
12527 {
12528 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN)
12529 ;
12530 else
12531 {
12532 if(exp->op.exp2->destType)
12533 FreeType(exp->op.exp2->destType);
12534 exp->op.exp2->destType = type1;
12535 if(type1)
12536 type1->refCount++;
12537 }
12538 }
12539 if(type1)
12540 type1->refCount++;
12541 exp->expType = type1;
12542 }
12543 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
12544 {
12545 if(exp->op.exp2->destType)
12546 FreeType(exp->op.exp2->destType);
12547 exp->op.exp2->destType = exp->destType;
12548 if(exp->destType)
12549 exp->destType->refCount++;
12550 }
12551 else
12552 {
12553 if(exp->op.exp2->destType)
12554 FreeType(exp->op.exp2->destType);
12555 exp->op.exp2->destType = dummy;
12556 dummy->refCount++;
12557 }
12558 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12559 {
12560 FreeType(exp->op.exp2->destType);
12561 exp->op.exp2->destType = type1;
12562 type1->refCount++;
12563 }
12564 if(exp->op.exp2->destType && exp->op.op != '=')
12565 exp->op.exp2->destType->count++;
12566 ProcessExpressionType(exp->op.exp2);
12567 if(exp->op.exp2->destType && exp->op.op != '=')
12568 exp->op.exp2->destType->count--;
12569 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12570 {
12571 if(exp->op.exp2->expType->kind == 22 || exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12572 {
12573 if(exp->op.op != '=' && type1->type->kind == 0)
12574 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12575 }
12576 else if(exp->op.exp2->expType->kind == 13 || exp->op.exp2->expType->kind == 12 || exp->op.exp2->expType->kind == 11 || exp->op.exp2->expType->kind == 16 || (type1->type->kind == 0 && exp->op.exp2->expType->kind == 8 && exp->op.exp2->expType->_class->registered && (exp->op.exp2->expType->_class->registered->type == 0 || exp->op.exp2->expType->_class->registered->type == 1 || exp->op.exp2->expType->_class->registered->type == 5)))
12577 {
12578 if(exp->op.op == ADD_ASSIGN)
12579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12580 }
12581 else if((exp->op.exp2->expType->kind == 8 && type1->kind == 13 && type1->type->kind == 8 && type1->type->_class == exp->op.exp2->expType->_class && exp->op.exp2->expType->_class->registered && exp->op.exp2->expType->_class->registered->type == 1))
12582 {
12583 if(exp->op.op == ADD_ASSIGN)
12584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12585 }
12586 else if(inCompiler)
12587 {
12588 char type1String[1024];
12589 char type2String[1024];
12590
12591 type1String[0] = '\0';
12592 type2String[0] = '\0';
12593 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12594 PrintType(type1, type2String, 0x0, 0x1);
12595 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12596 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12597 }
12598 }
12599 if(exp->op.exp2->destType == dummy)
12600 {
12601 FreeType(dummy);
12602 exp->op.exp2->destType = (((void *)0));
12603 }
12604 type2 = exp->op.exp2->expType;
12605 }
12606 dummy->kind = 0;
12607 if(exp->op.op == SIZEOF)
12608 {
12609 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12610 exp->isConstant = 0x1;
12611 }
12612 else if(exp->op.op == '*' && !exp->op.exp1)
12613 {
12614 exp->expType = Dereference(type2);
12615 if(type2 && type2->kind == 8)
12616 notByReference = 0x1;
12617 }
12618 else if(exp->op.op == '&' && !exp->op.exp1)
12619 exp->expType = Reference(type2);
12620 else if(!assign)
12621 {
12622 if(boolOps)
12623 {
12624 if(exp->op.exp1)
12625 {
12626 if(exp->op.exp1->destType)
12627 FreeType(exp->op.exp1->destType);
12628 exp->op.exp1->destType = MkClassType("bool");
12629 exp->op.exp1->destType->truth = 0x1;
12630 if(!exp->op.exp1->expType)
12631 ProcessExpressionType(exp->op.exp1);
12632 else
12633 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12634 FreeType(exp->op.exp1->expType);
12635 exp->op.exp1->expType = MkClassType("bool");
12636 exp->op.exp1->expType->truth = 0x1;
12637 }
12638 if(exp->op.exp2)
12639 {
12640 if(exp->op.exp2->destType)
12641 FreeType(exp->op.exp2->destType);
12642 exp->op.exp2->destType = MkClassType("bool");
12643 exp->op.exp2->destType->truth = 0x1;
12644 if(!exp->op.exp2->expType)
12645 ProcessExpressionType(exp->op.exp2);
12646 else
12647 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12648 FreeType(exp->op.exp2->expType);
12649 exp->op.exp2->expType = MkClassType("bool");
12650 exp->op.exp2->expType->truth = 0x1;
12651 }
12652 }
12653 else if(exp->op.exp1 && exp->op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->_class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->_class->string, "String")))))
12654 {
12655 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12656 {
12657 if(exp->op.exp2->destType)
12658 FreeType(exp->op.exp2->destType);
12659 exp->op.exp2->destType = type1;
12660 type1->refCount++;
12661 if(exp->op.exp1->destType)
12662 FreeType(exp->op.exp1->destType);
12663 exp->op.exp1->destType = type2;
12664 type2->refCount++;
12665 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->_class->registered && type1->_class->registered->type == 3 && type2->_class->registered && type2->_class->registered->type == 3 && type1->_class->registered != type2->_class->registered)
12666 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
12667 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12668 {
12669 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12670
12671 if(argExp)
12672 {
12673 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12674
12675 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12676 ProcessExpressionType(exp->op.exp1);
12677 if(type2->kind != 13)
12678 {
12679 ProcessExpressionType(classExp);
12680 exp->op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
12681 if(!exp->op.exp2->expType)
12682 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12683 ProcessExpressionType(exp->op.exp2);
12684 }
12685 }
12686 }
12687 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12688 {
12689 if(type1->kind != 8 && type1->type->kind == 0)
12690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12691 exp->expType = type1;
12692 if(type1)
12693 type1->refCount++;
12694 }
12695 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12696 {
12697 if(type2->kind != 8 && type2->type->kind == 0)
12698 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12699 exp->expType = type2;
12700 if(type2)
12701 type2->refCount++;
12702 }
12703 else if((type1->kind == 13 && type2->kind != 13 && type2->kind != 12 && type2->kind != 11 && type2->kind != 16 && type2->kind != 8 && type2->kind != 19) || (type2->kind == 13 && type1->kind != 13 && type1->kind != 12 && type1->kind != 11 && type1->kind != 16 && type1->kind != 8 && type1->kind != 19))
12704 {
12705 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12706 }
12707 else
12708 {
12709 unsigned int success = 0x0;
12710
12711 if(type1->kind == 13 && type2->kind == 13)
12712 {
12713 if(exp->op.op == '+')
12714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12715 else if(exp->op.op == '-')
12716 {
12717 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12718 {
12719 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12720 success = 0x1;
12721 if(type1->type->kind == 20)
12722 {
12723 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12724
12725 if(argExp)
12726 {
12727 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12728
12729 ProcessExpressionType(classExp);
12730 exp->type = 5;
12731 exp->list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp1))), exp->op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp2)))))), '/', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
12732 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12733 FreeType(dummy);
12734 return ;
12735 }
12736 }
12737 }
12738 }
12739 }
12740 if(!success && exp->op.exp1->type == 2)
12741 {
12742 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12743 {
12744 if(exp->expType)
12745 FreeType(exp->expType);
12746 exp->expType = exp->op.exp1->destType;
12747 if(exp->op.exp1->destType)
12748 exp->op.exp1->destType->refCount++;
12749 success = 0x1;
12750 }
12751 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12752 {
12753 if(exp->expType)
12754 FreeType(exp->expType);
12755 exp->expType = exp->op.exp2->destType;
12756 if(exp->op.exp2->destType)
12757 exp->op.exp2->destType->refCount++;
12758 success = 0x1;
12759 }
12760 }
12761 else if(!success)
12762 {
12763 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12764 {
12765 if(exp->expType)
12766 FreeType(exp->expType);
12767 exp->expType = exp->op.exp2->destType;
12768 if(exp->op.exp2->destType)
12769 exp->op.exp2->destType->refCount++;
12770 success = 0x1;
12771 }
12772 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12773 {
12774 if(exp->expType)
12775 FreeType(exp->expType);
12776 exp->expType = exp->op.exp1->destType;
12777 if(exp->op.exp1->destType)
12778 exp->op.exp1->destType->refCount++;
12779 success = 0x1;
12780 }
12781 }
12782 if(!success)
12783 {
12784 char expString1[10240];
12785 char expString2[10240];
12786 char type1[1024];
12787 char type2[1024];
12788
12789 expString1[0] = '\0';
12790 expString2[0] = '\0';
12791 type1[0] = '\0';
12792 type2[0] = '\0';
12793 if(inCompiler)
12794 {
12795 PrintExpression(exp->op.exp1, expString1);
12796 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12797 PrintExpression(exp->op.exp2, expString2);
12798 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12799 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12800 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12801 }
12802 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12803 }
12804 }
12805 }
12806 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12807 {
12808 if(exp->op.exp1->destType)
12809 FreeType(exp->op.exp1->destType);
12810 exp->op.exp1->destType = type2->_class->registered->dataType;
12811 if(type2->_class->registered->dataType)
12812 type2->_class->registered->dataType->refCount++;
12813 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12814 exp->expType = type2;
12815 if(type2)
12816 type2->refCount++;
12817 }
12818 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12819 {
12820 if(exp->op.exp2->destType)
12821 FreeType(exp->op.exp2->destType);
12822 exp->op.exp2->destType = type1->_class->registered->dataType;
12823 if(type1->_class->registered->dataType)
12824 type1->_class->registered->dataType->refCount++;
12825 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12826 exp->expType = type1;
12827 if(type1)
12828 type1->refCount++;
12829 }
12830 else if(type1)
12831 {
12832 unsigned int valid = 0x0;
12833
12834 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12835 {
12836 if(exp->op.exp2->destType)
12837 FreeType(exp->op.exp2->destType);
12838 if(!type1->_class->registered->dataType)
12839 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12840 exp->op.exp2->destType = type1->_class->registered->dataType;
12841 exp->op.exp2->destType->refCount++;
12842 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12843 type2 = exp->op.exp2->destType;
12844 exp->expType = type2;
12845 type2->refCount++;
12846 }
12847 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12848 {
12849 if(exp->op.exp1->destType)
12850 FreeType(exp->op.exp1->destType);
12851 if(!type2->_class->registered->dataType)
12852 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12853 exp->op.exp1->destType = type2->_class->registered->dataType;
12854 exp->op.exp1->destType->refCount++;
12855 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12856 type1 = exp->op.exp1->destType;
12857 exp->expType = type1;
12858 type1->refCount++;
12859 }
12860 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12861 {
12862 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12863 {
12864 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12865 {
12866 if(exp->expType)
12867 FreeType(exp->expType);
12868 exp->expType = exp->op.exp1->expType;
12869 if(exp->op.exp2->expType)
12870 exp->op.exp1->expType->refCount++;
12871 valid = 0x1;
12872 }
12873 }
12874 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12875 {
12876 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12877 {
12878 if(exp->expType)
12879 FreeType(exp->expType);
12880 exp->expType = exp->op.exp2->expType;
12881 if(exp->op.exp2->expType)
12882 exp->op.exp2->expType->refCount++;
12883 valid = 0x1;
12884 }
12885 }
12886 }
12887 if(!valid)
12888 {
12889 if(exp->op.exp2->destType)
12890 FreeType(exp->op.exp2->destType);
12891 exp->op.exp2->destType = type1;
12892 type1->refCount++;
12893 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12894 {
12895 if(exp->expType)
12896 FreeType(exp->expType);
12897 exp->expType = exp->op.exp2->destType;
12898 if(exp->op.exp2->destType)
12899 exp->op.exp2->destType->refCount++;
12900 }
12901 else if(type1 && type2)
12902 {
12903 char expString1[10240];
12904 char expString2[10240];
12905 char type1String[1024];
12906 char type2String[1024];
12907
12908 expString1[0] = '\0';
12909 expString2[0] = '\0';
12910 type1String[0] = '\0';
12911 type2String[0] = '\0';
12912 if(inCompiler)
12913 {
12914 PrintExpression(exp->op.exp1, expString1);
12915 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12916 PrintExpression(exp->op.exp2, expString2);
12917 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12918 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12919 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12920 }
12921 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12922 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12923 {
12924 exp->expType = exp->op.exp1->expType;
12925 if(exp->op.exp1->expType)
12926 exp->op.exp1->expType->refCount++;
12927 }
12928 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12929 {
12930 exp->expType = exp->op.exp2->expType;
12931 if(exp->op.exp2->expType)
12932 exp->op.exp2->expType->refCount++;
12933 }
12934 }
12935 }
12936 }
12937 else if(type2)
12938 {
12939 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12940 {
12941 struct Type * oldType = exp->op.exp1->expType;
12942
12943 exp->op.exp1->expType = (((void *)0));
12944 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12945 FreeType(oldType);
12946 else
12947 exp->op.exp1->expType = oldType;
12948 }
12949 if(exp->op.exp1->destType)
12950 FreeType(exp->op.exp1->destType);
12951 exp->op.exp1->destType = type2;
12952 type2->refCount++;
12953 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12954 {
12955 if(exp->expType)
12956 FreeType(exp->expType);
12957 exp->expType = exp->op.exp1->destType;
12958 if(exp->op.exp1->destType)
12959 exp->op.exp1->destType->refCount++;
12960 }
12961 }
12962 }
12963 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12964 {
12965 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12966 {
12967 if(exp->op.exp1->destType)
12968 FreeType(exp->op.exp1->destType);
12969 exp->op.exp1->destType = type2->_class->registered->dataType;
12970 if(type2->_class->registered->dataType)
12971 type2->_class->registered->dataType->refCount++;
12972 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12973 }
12974 if(exp->op.op == '!')
12975 {
12976 exp->expType = MkClassType("bool");
12977 exp->expType->truth = 0x1;
12978 }
12979 else
12980 {
12981 exp->expType = type2;
12982 if(type2)
12983 type2->refCount++;
12984 }
12985 }
12986 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12987 {
12988 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12989 {
12990 if(exp->op.exp2->destType)
12991 FreeType(exp->op.exp2->destType);
12992 exp->op.exp2->destType = type1->_class->registered->dataType;
12993 if(type1->_class->registered->dataType)
12994 type1->_class->registered->dataType->refCount++;
12995 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12996 }
12997 exp->expType = type1;
12998 if(type1)
12999 type1->refCount++;
13000 }
13001 }
13002 yylloc = exp->loc;
13003 if(exp->op.exp1 && !exp->op.exp1->expType)
13004 {
13005 char expString[10000];
13006
13007 expString[0] = '\0';
13008 if(inCompiler)
13009 {
13010 PrintExpression(exp->op.exp1, expString);
13011 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13012 }
13013 if(expString[0])
13014 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13015 }
13016 if(exp->op.exp2 && !exp->op.exp2->expType)
13017 {
13018 char expString[10240];
13019
13020 expString[0] = '\0';
13021 if(inCompiler)
13022 {
13023 PrintExpression(exp->op.exp2, expString);
13024 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13025 }
13026 if(expString[0])
13027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13028 }
13029 if(boolResult)
13030 {
13031 FreeType(exp->expType);
13032 exp->expType = MkClassType("bool");
13033 exp->expType->truth = 0x1;
13034 }
13035 if(exp->op.op != SIZEOF)
13036 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13037 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13038 {
13039 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13040 }
13041 yylloc = oldyylloc;
13042 FreeType(dummy);
13043 break;
13044 }
13045 case 5:
13046 case 34:
13047 {
13048 struct Expression * e;
13049
13050 exp->isConstant = 0x1;
13051 for(e = (*exp->list).first; e; e = e->next)
13052 {
13053 unsigned int inced = 0x0;
13054
13055 if(!e->next)
13056 {
13057 FreeType(e->destType);
13058 e->destType = exp->destType;
13059 if(e->destType)
13060 {
13061 exp->destType->refCount++;
13062 e->destType->count++;
13063 inced = 0x1;
13064 }
13065 }
13066 ProcessExpressionType(e);
13067 if(inced)
13068 exp->destType->count--;
13069 if(!exp->expType && !e->next)
13070 {
13071 exp->expType = e->expType;
13072 if(e->expType)
13073 e->expType->refCount++;
13074 }
13075 if(!e->isConstant)
13076 exp->isConstant = 0x0;
13077 }
13078 e = (*exp->list).first;
13079 if(!e->next && e->type == 8)
13080 {
13081 struct Expression * next = exp->next, * prev = exp->prev;
13082
13083 FreeType(exp->expType);
13084 FreeType(exp->destType);
13085 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13086 *exp = *e;
13087 exp->prev = prev;
13088 exp->next = next;
13089 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13090 ProcessExpressionType(exp);
13091 }
13092 break;
13093 }
13094 case 6:
13095 {
13096 struct Expression * e;
13097
13098 exp->isConstant = 0x1;
13099 ProcessExpressionType(exp->index.exp);
13100 if(!exp->index.exp->isConstant)
13101 exp->isConstant = 0x0;
13102 if(exp->index.exp->expType)
13103 {
13104 struct Type * source = exp->index.exp->expType;
13105
13106 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13107 {
13108 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13109
13110 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13111 if(exp->index.index && (*exp->index.index).last)
13112 {
13113 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13114 }
13115 }
13116 }
13117 for(e = (*exp->index.index).first; e; e = e->next)
13118 {
13119 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13120 {
13121 if(e->destType)
13122 FreeType(e->destType);
13123 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13124 }
13125 ProcessExpressionType(e);
13126 if(!e->next)
13127 {
13128 }
13129 if(!e->isConstant)
13130 exp->isConstant = 0x0;
13131 }
13132 if(!exp->expType)
13133 exp->expType = Dereference(exp->index.exp->expType);
13134 if(exp->expType)
13135 DeclareType(exp->expType, 0x0, 0x0);
13136 break;
13137 }
13138 case 7:
13139 {
13140 struct Expression * e;
13141 struct Type * functionType;
13142 struct Type * methodType = (((void *)0));
13143 char name[1024];
13144
13145 name[0] = '\0';
13146 if(inCompiler)
13147 {
13148 PrintExpression(exp->call.exp, name);
13149 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13150 {
13151 PrintExpression(exp->call.exp, name);
13152 }
13153 }
13154 if(exp->call.exp->type == 0)
13155 {
13156 struct Expression * idExp = exp->call.exp;
13157 struct Identifier * id = idExp->identifier;
13158
13159 if(!strcmp(id->string, "__ENDIAN_PAD"))
13160 {
13161 exp->expType = ProcessTypeString("int", 0x1);
13162 if(exp->call.arguments && (*exp->call.arguments).first)
13163 ProcessExpressionType((*exp->call.arguments).first);
13164 break;
13165 }
13166 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13167 {
13168 struct Expression * a = (((void *)0));
13169 struct Expression * b = (((void *)0));
13170 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13171
13172 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13173 {
13174 a = (*exp->call.arguments).first;
13175 b = (*exp->call.arguments).last;
13176 tempExp1 = a;
13177 tempExp2 = b;
13178 }
13179 else if((*exp->call.arguments).count == 1)
13180 {
13181 a = (*exp->call.arguments).first;
13182 tempExp1 = a;
13183 }
13184 if(a)
13185 {
13186 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13187 idExp->identifier = (((void *)0));
13188 FreeExpContents(exp);
13189 ProcessExpressionType(a);
13190 if(b)
13191 ProcessExpressionType(b);
13192 exp->type = 5;
13193 exp->list = MkList();
13194 if(a->expType && (!b || b->expType))
13195 {
13196 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13197 {
13198 if(inCompiler)
13199 {
13200 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13201 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13202 struct Declaration * decl;
13203 char temp1[1024], temp2[1024];
13204
13205 GetTypeSpecs(a->expType, specs);
13206 if(a && !a->isConstant && a->type != 0)
13207 {
13208 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13209 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13210 tempExp1 = QMkExpId(temp1);
13211 tempExp1->expType = a->expType;
13212 if(a->expType)
13213 a->expType->refCount++;
13214 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13215 }
13216 if(b && !b->isConstant && b->type != 0)
13217 {
13218 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13219 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13220 tempExp2 = QMkExpId(temp2);
13221 tempExp2->expType = b->expType;
13222 if(b->expType)
13223 b->expType->refCount++;
13224 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13225 }
13226 decl = MkDeclaration(specs, decls);
13227 if(!curCompound->compound.declarations)
13228 curCompound->compound.declarations = MkList();
13229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13230 }
13231 }
13232 }
13233 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13234 {
13235 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13236
13237 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13238 exp->expType = a->expType;
13239 if(a->expType)
13240 a->expType->refCount++;
13241 }
13242 else if(!strcmp(id->string, "Abs"))
13243 {
13244 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13245 exp->expType = a->expType;
13246 if(a->expType)
13247 a->expType->refCount++;
13248 }
13249 else if(!strcmp(id->string, "Sgn"))
13250 {
13251 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '!', CopyExpression(tempExp1)))), MkListOne(MkExpConstant("0")), MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpConstant("-1")), MkExpConstant("1"))))));
13252 exp->expType = ProcessTypeString("int", 0x0);
13253 }
13254 FreeExpression(tempExp1);
13255 if(tempExp2)
13256 FreeExpression(tempExp2);
13257 FreeIdentifier(id);
13258 break;
13259 }
13260 }
13261 }
13262 {
13263 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13264
13265 if(!exp->call.exp->destType)
13266 {
13267 exp->call.exp->destType = dummy;
13268 dummy->refCount++;
13269 }
13270 ProcessExpressionType(exp->call.exp);
13271 if(exp->call.exp->destType == dummy)
13272 {
13273 FreeType(dummy);
13274 exp->call.exp->destType = (((void *)0));
13275 }
13276 FreeType(dummy);
13277 }
13278 functionType = exp->call.exp->expType;
13279 if(functionType && functionType->kind == 16)
13280 {
13281 methodType = functionType;
13282 functionType = methodType->method->dataType;
13283 if(exp->call.exp->expType->usedClass)
13284 {
13285 char typeString[1024];
13286
13287 typeString[0] = '\0';
13288 PrintType(functionType, typeString, 0x1, 0x1);
13289 if(strstr(typeString, "thisclass"))
13290 {
13291 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13292 struct Declarator * decl;
13293
13294 {
13295 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13296
13297 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13298 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13299 thisClassParams = 0x0;
13300 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13301 {
13302 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13303
13304 thisClass = exp->call.exp->expType->usedClass;
13305 ProcessDeclarator(decl);
13306 thisClass = backupThisClass;
13307 }
13308 thisClassParams = 0x1;
13309 functionType = ProcessType(specs, decl);
13310 functionType->refCount = 0;
13311 FinishTemplatesContext(context);
13312 }
13313 FreeList(specs, FreeSpecifier);
13314 FreeDeclarator(decl);
13315 }
13316 }
13317 }
13318 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13319 {
13320 struct Type * type = functionType->type;
13321
13322 if(!functionType->refCount)
13323 {
13324 functionType->type = (((void *)0));
13325 FreeType(functionType);
13326 }
13327 functionType = type;
13328 }
13329 if(functionType && functionType->kind != 11)
13330 {
13331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13332 }
13333 else if(functionType)
13334 {
13335 unsigned int emptyParams = 0x0, noParams = 0x0;
13336 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13337 struct Type * type = functionType->params.first;
13338 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13339 int extra = 0;
13340 struct Location oldyylloc = yylloc;
13341
13342 if(!type)
13343 emptyParams = 0x1;
13344 if(functionType->extraParam && e)
13345 {
13346 e->destType = MkClassType(functionType->thisClass->string);
13347 e = e->next;
13348 }
13349 if(!functionType->staticMethod)
13350 {
13351 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13352 {
13353 type = MkClassType(memberExp->member.exp->expType->_class->string);
13354 if(e)
13355 {
13356 e->destType = type;
13357 e = e->next;
13358 type = functionType->params.first;
13359 }
13360 else
13361 type->refCount = 0;
13362 }
13363 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13364 {
13365 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13366 if(e)
13367 {
13368 e->destType = type;
13369 e = e->next;
13370 type = functionType->params.first;
13371 }
13372 else
13373 type->refCount = 0;
13374 }
13375 }
13376 if(type && type->kind == 0)
13377 {
13378 noParams = 0x1;
13379 if(!type->refCount)
13380 FreeType(type);
13381 type = (((void *)0));
13382 }
13383 for(; e; e = e->next)
13384 {
13385 if(!type && !emptyParams)
13386 {
13387 yylloc = e->loc;
13388 if(methodType && methodType->methodClass)
13389 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13390 else
13391 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13392 break;
13393 }
13394 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13395 {
13396 struct Type * templatedType = (((void *)0));
13397 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13398 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13399 int id = 0;
13400
13401 if(_class && _class->templateArgs)
13402 {
13403 struct __ecereNameSpace__ecere__com__Class * sClass;
13404
13405 for(sClass = _class; sClass; sClass = sClass->base)
13406 {
13407 if(sClass->templateClass)
13408 sClass = sClass->templateClass;
13409 id = 0;
13410 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13411 {
13412 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13413 {
13414 struct __ecereNameSpace__ecere__com__Class * nextClass;
13415
13416 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13417 {
13418 if(nextClass->templateClass)
13419 nextClass = nextClass->templateClass;
13420 id += nextClass->templateParams.count;
13421 }
13422 break;
13423 }
13424 id++;
13425 }
13426 if(curParam)
13427 break;
13428 }
13429 }
13430 if(curParam && _class->templateArgs[id].dataTypeString)
13431 {
13432 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13433
13434 {
13435 struct Context * context = SetupTemplatesContext(_class);
13436
13437 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13438 FinishTemplatesContext(context);
13439 }
13440 e->destType = templatedType;
13441 if(templatedType)
13442 {
13443 templatedType->passAsTemplate = 0x1;
13444 }
13445 }
13446 else
13447 {
13448 e->destType = type;
13449 if(type)
13450 type->refCount++;
13451 }
13452 }
13453 else
13454 {
13455 e->destType = type;
13456 if(type)
13457 type->refCount++;
13458 }
13459 if(type && type->kind != 14)
13460 {
13461 struct Type * next = type->next;
13462
13463 if(!type->refCount)
13464 FreeType(type);
13465 type = next;
13466 }
13467 }
13468 if(type && type->kind != 14)
13469 {
13470 if(methodType && methodType->methodClass)
13471 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13472 else
13473 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13474 }
13475 yylloc = oldyylloc;
13476 if(type && !type->refCount)
13477 FreeType(type);
13478 }
13479 else
13480 {
13481 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13482 if(exp->call.exp->type == 0)
13483 {
13484 char * string = exp->call.exp->identifier->string;
13485
13486 if(inCompiler)
13487 {
13488 struct Symbol * symbol;
13489 struct Location oldyylloc = yylloc;
13490
13491 yylloc = exp->call.exp->identifier->loc;
13492 if(strstr(string, "__builtin_") == string)
13493 ;
13494 else
13495 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13496 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13497 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13498 if(strstr(symbol->string, "::"))
13499 globalContext->hasNameSpace = 0x1;
13500 yylloc = oldyylloc;
13501 }
13502 }
13503 else if(exp->call.exp->type == 8)
13504 {
13505 }
13506 else
13507 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13508 if(!functionType->returnType)
13509 {
13510 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13511 }
13512 }
13513 if(functionType && functionType->kind == 11)
13514 {
13515 exp->expType = functionType->returnType;
13516 if(functionType->returnType)
13517 functionType->returnType->refCount++;
13518 if(!functionType->refCount)
13519 FreeType(functionType);
13520 }
13521 if(exp->call.arguments)
13522 {
13523 for(e = (*exp->call.arguments).first; e; e = e->next)
13524 {
13525 struct Type * destType = e->destType;
13526
13527 ProcessExpressionType(e);
13528 }
13529 }
13530 break;
13531 }
13532 case 8:
13533 {
13534 struct Type * type;
13535 struct Location oldyylloc = yylloc;
13536 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13537
13538 exp->thisPtr = thisPtr;
13539 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13540 {
13541 exp->member.member->classSym = exp->member.member->_class->symbol;
13542 }
13543 ProcessExpressionType(exp->member.exp);
13544 if(exp->member.exp->expType && exp->member.exp->expType->kind == 8 && exp->member.exp->expType->_class && exp->member.exp->expType->_class->registered && exp->member.exp->expType->_class->registered->type == 0)
13545 {
13546 exp->isConstant = 0x0;
13547 }
13548 else
13549 exp->isConstant = exp->member.exp->isConstant;
13550 type = exp->member.exp->expType;
13551 yylloc = exp->loc;
13552 if(type && (type->kind == 20))
13553 {
13554 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13556
13557 if(_class)
13558 {
13559 for(param = _class->templateParams.first; param; param = param->next)
13560 {
13561 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13562 break;
13563 }
13564 }
13565 if(param && param->defaultArg.member)
13566 {
13567 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13568
13569 if(argExp)
13570 {
13571 struct Expression * expMember = exp->member.exp;
13572 struct Declarator * decl;
13573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13574 char thisClassTypeString[1024];
13575
13576 FreeIdentifier(exp->member.member);
13577 ProcessExpressionType(argExp);
13578 {
13579 char * colon = strstr(param->defaultArg.memberString, "::");
13580
13581 if(colon)
13582 {
13583 char className[1024];
13584 struct __ecereNameSpace__ecere__com__Class * sClass;
13585
13586 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13587 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13588 }
13589 else
13590 strcpy(thisClassTypeString, _class->fullName);
13591 }
13592 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13593 exp->expType = ProcessType(specs, decl);
13594 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13595 {
13596 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13597 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13598 int c;
13599 int paramCount = 0;
13600 int lastParam = -1;
13601 char templateString[1024];
13602 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13603
13604 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13605 for(cClass = expClass; cClass; cClass = cClass->base)
13606 {
13607 int p = 0;
13608
13609 for(param = cClass->templateParams.first; param; param = param->next)
13610 {
13611 int id = p;
13612 struct __ecereNameSpace__ecere__com__Class * sClass;
13613 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13614
13615 for(sClass = cClass->base; sClass; sClass = sClass->base)
13616 id += sClass->templateParams.count;
13617 arg = expClass->templateArgs[id];
13618 for(sClass = _class; sClass; sClass = sClass->base)
13619 {
13620 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13621 int p = 0;
13622 struct __ecereNameSpace__ecere__com__Class * nextClass;
13623
13624 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13625 p += nextClass->templateParams.count;
13626 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13627 {
13628 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13629 {
13630 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13631 {
13632 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13633 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13634 break;
13635 }
13636 }
13637 }
13638 }
13639 {
13640 char argument[256];
13641
13642 argument[0] = '\0';
13643 switch(param->type)
13644 {
13645 case 2:
13646 {
13647 char expString[1024];
13648 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13649 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13650 struct Expression * exp;
13651 char * string = PrintHexUInt64(arg.expression.ui64);
13652
13653 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13654 ProcessExpressionType(exp);
13655 ComputeExpression(exp);
13656 expString[0] = '\0';
13657 PrintExpression(exp, expString);
13658 strcat(argument, expString);
13659 FreeExpression(exp);
13660 break;
13661 }
13662 case 1:
13663 {
13664 strcat(argument, arg.member->name);
13665 break;
13666 }
13667 case 0:
13668 {
13669 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13670 {
13671 if(!strcmp(arg.dataTypeString, "thisclass"))
13672 strcat(argument, thisClassTypeString);
13673 else
13674 strcat(argument, arg.dataTypeString);
13675 }
13676 break;
13677 }
13678 }
13679 if(argument[0])
13680 {
13681 if(paramCount)
13682 strcat(templateString, ", ");
13683 if(lastParam != p - 1)
13684 {
13685 strcat(templateString, param->name);
13686 strcat(templateString, " = ");
13687 }
13688 strcat(templateString, argument);
13689 paramCount++;
13690 lastParam = p;
13691 }
13692 p++;
13693 }
13694 }
13695 }
13696 {
13697 int len = strlen(templateString);
13698
13699 if(templateString[len - 1] == '>')
13700 templateString[len++] = ' ';
13701 templateString[len++] = '>';
13702 templateString[len++] = '\0';
13703 }
13704 {
13705 struct Context * context = SetupTemplatesContext(_class);
13706
13707 FreeType(exp->expType);
13708 exp->expType = ProcessTypeString(templateString, 0x0);
13709 FinishTemplatesContext(context);
13710 }
13711 }
13712 exp->type = 5;
13713 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), expMember))), '+', MkExpOp(MkExpMember(MkExpMember(argExp, MkIdentifier("member")), MkIdentifier("offset")), '+', MkExpMember(MkExpMember(MkExpMember(CopyExpression(argExp), MkIdentifier("member")), MkIdentifier("_class")), MkIdentifier("offset")))))))));
13714 }
13715 }
13716 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13717 {
13718 type = ProcessTemplateParameterType(type->templateParameter);
13719 }
13720 }
13721 if(type && (type->kind == 20))
13722 ;
13723 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13724 {
13725 struct Identifier * id = exp->member.member;
13726 int typeKind = type->kind;
13727 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
13728
13729 if(typeKind == 19 && exp->member.exp->type == 26)
13730 {
13731 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13732 typeKind = 8;
13733 }
13734 if(id && (typeKind == 3 || typeKind == 15))
13735 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13736 if(_class && id)
13737 {
13738 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13739 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13740 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13741 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13742 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13743
13744 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13745 exp->member.memberType = 1;
13746 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13748 if(typeKind != 19)
13749 {
13750 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13751 {
13752 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13753 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13754 {
13755 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13756 if(prop)
13757 member = (((void *)0));
13758 }
13759 if(!member && !prop)
13760 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13761 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13762 exp->member.thisPtr = 0x1;
13763 }
13764 else
13765 {
13766 if(!id->classSym)
13767 {
13768 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13769 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13770 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13771 }
13772 if(!prop && !member)
13773 {
13774 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13775 if(!method)
13776 {
13777 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13778 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13779 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13780 }
13781 }
13782 if(member && prop)
13783 {
13784 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13785 prop = (((void *)0));
13786 else
13787 member = (((void *)0));
13788 }
13789 }
13790 }
13791 if(!prop && !member)
13792 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13793 if(!prop && !member && !method)
13794 {
13795 if(typeKind == 19)
13796 {
13797 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13798 if(classProp)
13799 {
13800 exp->member.memberType = 5;
13801 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13802 }
13803 else
13804 {
13805 char structName[1024];
13806 struct Identifier * id = exp->member.member;
13807 struct Expression * classExp = exp->member.exp;
13808
13809 type->refCount++;
13810 FreeType(classExp->expType);
13811 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13812 strcpy(structName, "__ecereClassData_");
13813 FullClassNameCat(structName, type->_class->string, 0x0);
13814 exp->type = 9;
13815 exp->member.member = id;
13816 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type->_class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
13817 FreeType(type);
13818 ProcessExpressionType(exp);
13819 return ;
13820 }
13821 }
13822 else
13823 {
13824 struct Symbol * classSym = FindClass(id->string);
13825
13826 if(classSym)
13827 {
13828 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13829
13830 if(convertClass)
13831 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13832 }
13833 }
13834 }
13835 if(prop)
13836 {
13837 exp->member.memberType = 1;
13838 if(!prop->dataType)
13839 ProcessPropertyType(prop);
13840 exp->expType = prop->dataType;
13841 if(prop->dataType)
13842 prop->dataType->refCount++;
13843 }
13844 else if(member)
13845 {
13846 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13847 {
13848 FreeExpContents(exp);
13849 exp->type = 0;
13850 exp->identifier = MkIdentifier("class");
13851 ProcessExpressionType(exp);
13852 return ;
13853 }
13854 exp->member.memberType = 3;
13855 DeclareStruct(_class->fullName, 0x0);
13856 if(!member->dataType)
13857 {
13858 struct Context * context = SetupTemplatesContext(_class);
13859
13860 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13861 FinishTemplatesContext(context);
13862 }
13863 exp->expType = member->dataType;
13864 if(member->dataType)
13865 member->dataType->refCount++;
13866 }
13867 else if(revConvert)
13868 {
13869 exp->member.memberType = 4;
13870 exp->expType = MkClassType(revConvert->_class->fullName);
13871 }
13872 else if(method)
13873 {
13874 if(inCompiler)
13875 {
13876 exp->member.memberType = 2;
13877 }
13878 if(!method->dataType)
13879 ProcessMethodType(method);
13880 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
13881 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13882 exp->expType->usedClass = _class;
13883 }
13884 else if(!classProp)
13885 {
13886 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13887 {
13888 FreeExpContents(exp);
13889 exp->type = 0;
13890 exp->identifier = MkIdentifier("class");
13891 ProcessExpressionType(exp);
13892 return ;
13893 }
13894 yylloc = exp->member.member->loc;
13895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13896 if(inCompiler)
13897 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13898 }
13899 if(_class && exp->expType)
13900 {
13901 struct __ecereNameSpace__ecere__com__Class * tClass;
13902
13903 tClass = _class;
13904 while(tClass && !tClass->templateClass)
13905 tClass = tClass->base;
13906 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13907 {
13908 int id = 0;
13909 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13910 struct __ecereNameSpace__ecere__com__Class * sClass;
13911
13912 for(sClass = tClass; sClass; sClass = sClass->base)
13913 {
13914 id = 0;
13915 if(sClass->templateClass)
13916 sClass = sClass->templateClass;
13917 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13918 {
13919 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13920 {
13921 for(sClass = sClass->base; sClass; sClass = sClass->base)
13922 id += sClass->templateParams.count;
13923 break;
13924 }
13925 id++;
13926 }
13927 if(curParam)
13928 break;
13929 }
13930 if(curParam && tClass->templateArgs[id].dataTypeString)
13931 {
13932 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13933 struct Context * context = SetupTemplatesContext(tClass);
13934
13935 FreeType(exp->expType);
13936 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13937 if(exp->expType)
13938 {
13939 if(exp->expType->kind == 21)
13940 {
13941 FreeType(exp->expType);
13942 exp->expType = ReplaceThisClassType(_class);
13943 }
13944 if(tClass->templateClass)
13945 exp->expType->passAsTemplate = 0x1;
13946 if(!exp->destType)
13947 {
13948 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13949 if(exp->destType->kind == 21)
13950 {
13951 FreeType(exp->destType);
13952 exp->destType = ReplaceThisClassType(_class);
13953 }
13954 }
13955 }
13956 FinishTemplatesContext(context);
13957 }
13958 }
13959 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13960 {
13961 int id = 0;
13962 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13963 struct __ecereNameSpace__ecere__com__Class * sClass;
13964
13965 for(sClass = tClass; sClass; sClass = sClass->base)
13966 {
13967 id = 0;
13968 if(sClass->templateClass)
13969 sClass = sClass->templateClass;
13970 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13971 {
13972 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13973 {
13974 for(sClass = sClass->base; sClass; sClass = sClass->base)
13975 id += sClass->templateParams.count;
13976 break;
13977 }
13978 id++;
13979 }
13980 if(curParam)
13981 break;
13982 }
13983 if(curParam)
13984 {
13985 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13986 struct Context * context = SetupTemplatesContext(tClass);
13987 struct Type * basicType;
13988
13989 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13990 if(basicType)
13991 {
13992 if(basicType->kind == 21)
13993 {
13994 FreeType(basicType);
13995 basicType = ReplaceThisClassType(_class);
13996 }
13997 FreeType(exp->expType);
13998 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
13999 if(!exp->destType)
14000 {
14001 exp->destType = exp->expType;
14002 exp->destType->refCount++;
14003 }
14004 {
14005 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14006 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14007 struct Declarator * decl;
14008
14009 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14010 *newExp = *exp;
14011 if(exp->destType)
14012 exp->destType->refCount++;
14013 if(exp->expType)
14014 exp->expType->refCount++;
14015 exp->type = 11;
14016 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14017 exp->cast.exp = newExp;
14018 }
14019 }
14020 FinishTemplatesContext(context);
14021 }
14022 }
14023 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14024 {
14025 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14026
14027 if(expClass)
14028 {
14029 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14030 int c;
14031 int p = 0;
14032 int paramCount = 0;
14033 int lastParam = -1;
14034 char templateString[1024];
14035 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14036
14037 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14038 while(cClass != expClass)
14039 {
14040 struct __ecereNameSpace__ecere__com__Class * sClass;
14041
14042 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14043 ;
14044 cClass = sClass;
14045 for(param = cClass->templateParams.first; param; param = param->next)
14046 {
14047 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14048 int c;
14049 int cp = 0;
14050 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14051 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14052
14053 while(cClassCur != tClass && !paramCur)
14054 {
14055 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14056
14057 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14058 ;
14059 cClassCur = sClassCur;
14060 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14061 {
14062 if(!strcmp(paramCur->name, param->name))
14063 {
14064 break;
14065 }
14066 cp++;
14067 }
14068 }
14069 if(paramCur && paramCur->type == 0)
14070 arg = tClass->templateArgs[cp];
14071 else
14072 arg = expClass->templateArgs[p];
14073 {
14074 char argument[256];
14075
14076 argument[0] = '\0';
14077 switch(param->type)
14078 {
14079 case 2:
14080 {
14081 char expString[1024];
14082 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14083 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14084 struct Expression * exp;
14085 char * string = PrintHexUInt64(arg.expression.ui64);
14086
14087 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14088 ProcessExpressionType(exp);
14089 ComputeExpression(exp);
14090 expString[0] = '\0';
14091 PrintExpression(exp, expString);
14092 strcat(argument, expString);
14093 FreeExpression(exp);
14094 break;
14095 }
14096 case 1:
14097 {
14098 strcat(argument, arg.member->name);
14099 break;
14100 }
14101 case 0:
14102 {
14103 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14104 strcat(argument, arg.dataTypeString);
14105 break;
14106 }
14107 }
14108 if(argument[0])
14109 {
14110 if(paramCount)
14111 strcat(templateString, ", ");
14112 if(lastParam != p - 1)
14113 {
14114 strcat(templateString, param->name);
14115 strcat(templateString, " = ");
14116 }
14117 strcat(templateString, argument);
14118 paramCount++;
14119 lastParam = p;
14120 }
14121 }
14122 p++;
14123 }
14124 }
14125 {
14126 int len = strlen(templateString);
14127
14128 if(templateString[len - 1] == '>')
14129 templateString[len++] = ' ';
14130 templateString[len++] = '>';
14131 templateString[len++] = '\0';
14132 }
14133 FreeType(exp->expType);
14134 {
14135 struct Context * context = SetupTemplatesContext(tClass);
14136
14137 exp->expType = ProcessTypeString(templateString, 0x0);
14138 FinishTemplatesContext(context);
14139 }
14140 }
14141 }
14142 }
14143 }
14144 else
14145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
14146 }
14147 else if(type && (type->kind == 9 || type->kind == 10))
14148 {
14149 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14150
14151 if(memberType)
14152 {
14153 exp->expType = memberType;
14154 if(memberType)
14155 memberType->refCount++;
14156 }
14157 }
14158 else
14159 {
14160 char expString[10240];
14161
14162 expString[0] = '\0';
14163 if(inCompiler)
14164 {
14165 PrintExpression(exp, expString);
14166 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14167 }
14168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14169 }
14170 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14171 {
14172 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14173 {
14174 struct Identifier * id = exp->member.member;
14175 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
14176
14177 if(_class)
14178 {
14179 FreeType(exp->expType);
14180 exp->expType = ReplaceThisClassType(_class);
14181 }
14182 }
14183 }
14184 yylloc = oldyylloc;
14185 break;
14186 }
14187 case 9:
14188 {
14189 struct Type * destType = exp->destType;
14190
14191 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14192 {
14193 exp->member.member->classSym = exp->member.member->_class->symbol;
14194 }
14195 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14196 exp->type = 8;
14197 if(destType)
14198 destType->count++;
14199 ProcessExpressionType(exp);
14200 if(destType)
14201 destType->count--;
14202 break;
14203 }
14204 case 15:
14205 {
14206 struct Symbol * classSym = exp->_class->symbol;
14207
14208 if(classSym && classSym->registered)
14209 {
14210 if(classSym->registered->type == 5)
14211 {
14212 char name[1024];
14213
14214 name[0] = '\0';
14215 DeclareStruct(classSym->string, 0x0);
14216 FreeSpecifier(exp->_class);
14217 exp->type = 10;
14218 FullClassNameCat(name, classSym->string, 0x0);
14219 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14220 }
14221 else
14222 {
14223 if(classSym->registered->fixed)
14224 {
14225 FreeSpecifier(exp->_class);
14226 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14227 exp->type = 2;
14228 }
14229 else
14230 {
14231 char className[1024];
14232
14233 strcpy(className, "__ecereClass_");
14234 FullClassNameCat(className, classSym->string, 0x1);
14235 MangleClassName(className);
14236 DeclareClass(classSym, className);
14237 FreeExpContents(exp);
14238 exp->type = 9;
14239 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14240 exp->member.member = MkIdentifier("structSize");
14241 }
14242 }
14243 }
14244 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14245 break;
14246 }
14247 case 10:
14248 {
14249 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14250
14251 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14252 exp->isConstant = 0x1;
14253 DeclareType(type, 0x0, 0x0);
14254 FreeType(type);
14255 break;
14256 }
14257 case 11:
14258 {
14259 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14260
14261 type->count = (unsigned int)1;
14262 FreeType(exp->cast.exp->destType);
14263 exp->cast.exp->destType = type;
14264 type->refCount++;
14265 ProcessExpressionType(exp->cast.exp);
14266 type->count = (unsigned int)0;
14267 exp->expType = type;
14268 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14269 {
14270 void * prev = exp->prev, * next = exp->next;
14271 struct Type * expType = exp->cast.exp->destType;
14272 struct Expression * castExp = exp->cast.exp;
14273 struct Type * destType = exp->destType;
14274
14275 if(expType)
14276 expType->refCount++;
14277 FreeType(exp->expType);
14278 FreeTypeName(exp->cast.typeName);
14279 *exp = *castExp;
14280 FreeType(exp->expType);
14281 FreeType(exp->destType);
14282 exp->expType = expType;
14283 exp->destType = destType;
14284 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14285 exp->prev = prev;
14286 exp->next = next;
14287 }
14288 else
14289 {
14290 exp->isConstant = exp->cast.exp->isConstant;
14291 }
14292 break;
14293 }
14294 case 35:
14295 {
14296 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14297
14298 type->refCount++;
14299 exp->expType = type;
14300 break;
14301 }
14302 case 36:
14303 {
14304 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14305
14306 ProcessExpressionType(exp->vaArg.exp);
14307 type->refCount++;
14308 exp->expType = type;
14309 break;
14310 }
14311 case 12:
14312 {
14313 struct Expression * e;
14314
14315 exp->isConstant = 0x1;
14316 FreeType(exp->cond.cond->destType);
14317 exp->cond.cond->destType = MkClassType("bool");
14318 exp->cond.cond->destType->truth = 0x1;
14319 ProcessExpressionType(exp->cond.cond);
14320 if(!exp->cond.cond->isConstant)
14321 exp->isConstant = 0x0;
14322 for(e = (*exp->cond.exp).first; e; e = e->next)
14323 {
14324 if(!e->next)
14325 {
14326 FreeType(e->destType);
14327 e->destType = exp->destType;
14328 if(e->destType)
14329 e->destType->refCount++;
14330 }
14331 ProcessExpressionType(e);
14332 if(!e->next)
14333 {
14334 exp->expType = e->expType;
14335 if(e->expType)
14336 e->expType->refCount++;
14337 }
14338 if(!e->isConstant)
14339 exp->isConstant = 0x0;
14340 }
14341 FreeType(exp->cond.elseExp->destType);
14342 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14343 if(exp->cond.elseExp->destType)
14344 exp->cond.elseExp->destType->refCount++;
14345 ProcessExpressionType(exp->cond.elseExp);
14346 if(!exp->cond.elseExp->isConstant)
14347 exp->isConstant = 0x0;
14348 break;
14349 }
14350 case 25:
14351 {
14352 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14353 {
14354 struct Statement * last = (*exp->compound->compound.statements).last;
14355
14356 if(last->type == 3 && last->expressions && (*last->expressions).last)
14357 {
14358 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14359 if(exp->destType)
14360 exp->destType->refCount++;
14361 }
14362 ProcessStatement(exp->compound);
14363 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14364 if(((struct Expression *)(*last->expressions).last)->expType)
14365 exp->expType->refCount++;
14366 }
14367 break;
14368 }
14369 case 26:
14370 {
14371 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14372
14373 if(spec && spec->type == 1)
14374 {
14375 exp->expType = MkClassType(spec->name);
14376 exp->expType->kind = 19;
14377 exp->byReference = 0x1;
14378 }
14379 else
14380 {
14381 exp->expType = MkClassType("ecere::com::Class");
14382 exp->byReference = 0x1;
14383 }
14384 break;
14385 }
14386 case 27:
14387 {
14388 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14389
14390 if(_class)
14391 {
14392 struct Identifier * id = exp->classData.id;
14393 char structName[1024];
14394 struct Expression * classExp;
14395
14396 strcpy(structName, "__ecereClassData_");
14397 FullClassNameCat(structName, _class->fullName, 0x0);
14398 exp->type = 9;
14399 exp->member.member = id;
14400 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14401 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14402 else
14403 classExp = MkExpIdentifier(MkIdentifier("class"));
14404 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class->fullName)), (((void *)0))), MkIdentifier("offsetClass"))))))));
14405 ProcessExpressionType(exp);
14406 return ;
14407 }
14408 break;
14409 }
14410 case 37:
14411 {
14412 struct Type * type = (((void *)0));
14413 char * typeString = (((void *)0));
14414 char typeStringBuf[1024];
14415
14416 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->_class->registered, containerClass))
14417 {
14418 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14419
14420 typeString = templateClass->templateArgs[2].dataTypeString;
14421 }
14422 else if(exp->list)
14423 {
14424 struct Expression * e;
14425
14426 for(e = (*exp->list).first; e; e = e->next)
14427 {
14428 ProcessExpressionType(e);
14429 if(e->expType)
14430 {
14431 if(!type)
14432 {
14433 type = e->expType;
14434 type->refCount++;
14435 }
14436 else
14437 {
14438 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14439 {
14440 FreeType(type);
14441 type = e->expType;
14442 e->expType = (((void *)0));
14443 e = (*exp->list).first;
14444 ProcessExpressionType(e);
14445 if(e->expType)
14446 {
14447 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14448 {
14449 FreeType(e->expType);
14450 e->expType = (((void *)0));
14451 FreeType(type);
14452 type = (((void *)0));
14453 break;
14454 }
14455 }
14456 }
14457 }
14458 if(e->expType)
14459 {
14460 FreeType(e->expType);
14461 e->expType = (((void *)0));
14462 }
14463 }
14464 }
14465 if(type)
14466 {
14467 typeStringBuf[0] = '\0';
14468 PrintType(type, typeStringBuf, 0x0, 0x1);
14469 typeString = typeStringBuf;
14470 FreeType(type);
14471 type = (((void *)0));
14472 }
14473 }
14474 if(typeString)
14475 {
14476 char templateString[1024];
14477 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14478 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14479 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14480 struct Expression * expExt;
14481 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14482
14483 sprintf(templateString, "Container<%s>", typeString);
14484 if(exp->list)
14485 {
14486 struct Expression * e;
14487
14488 type = ProcessTypeString(typeString, 0x0);
14489 while(e = (*exp->list).first)
14490 {
14491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14492 e->destType = type;
14493 type->refCount++;
14494 ProcessExpressionType(e);
14495 ListAdd(initializers, MkInitializerAssignment(e));
14496 }
14497 FreeType(type);
14498 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14499 }
14500 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14501 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14502 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14503 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14505 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14507 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14509 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, 0), ((struct Expression *)__ecereTemp1))));
14510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14511 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 exp->expType = ProcessTypeString(templateString, 0x0);
14514 exp->type = 5;
14515 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14516 ProcessExpressionType(expExt);
14517 }
14518 else
14519 {
14520 exp->expType = ProcessTypeString("Container", 0x0);
14521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14522 }
14523 break;
14524 }
14525 }
14526 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14527 {
14528 FreeType(exp->expType);
14529 exp->expType = ReplaceThisClassType(thisClass);
14530 }
14531 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14532 {
14533 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14534
14535 if(symbol)
14536 {
14537 if(exp->expType->kind != 15)
14538 {
14539 struct Type * member;
14540 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14541
14542 FreeType(exp->expType);
14543 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14544 exp->expType->kind = symbol->type->kind;
14545 exp->expType->refCount++;
14546 exp->expType->enumName = enumName;
14547 exp->expType->members = symbol->type->members;
14548 for(member = symbol->type->members.first; member; member = member->next)
14549 member->refCount++;
14550 }
14551 else
14552 {
14553 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14554
14555 for(member = symbol->type->members.first; member; member = member->next)
14556 {
14557 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14558
14559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14560 }
14561 }
14562 }
14563 }
14564 yylloc = exp->loc;
14565 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14566 ;
14567 else if(exp->destType && !exp->destType->keepCast)
14568 {
14569 if(!CheckExpressionType(exp, exp->destType, 0x0))
14570 {
14571 if(!exp->destType->count || unresolved)
14572 {
14573 if(!exp->expType)
14574 {
14575 yylloc = exp->loc;
14576 if(exp->destType->kind != 14)
14577 {
14578 char type2[1024];
14579
14580 type2[0] = '\0';
14581 if(inCompiler)
14582 {
14583 char expString[10240];
14584
14585 expString[0] = '\0';
14586 PrintType(exp->destType, type2, 0x0, 0x1);
14587 if(inCompiler)
14588 {
14589 PrintExpression(exp, expString);
14590 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14591 }
14592 if(unresolved)
14593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14594 else if(exp->type != 16)
14595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14596 }
14597 }
14598 else
14599 {
14600 char expString[10240];
14601
14602 expString[0] = '\0';
14603 if(inCompiler)
14604 {
14605 PrintExpression(exp, expString);
14606 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14607 }
14608 if(unresolved)
14609 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14610 else if(exp->type != 16)
14611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14612 }
14613 }
14614 else
14615 {
14616 char type1[1024];
14617 char type2[1024];
14618
14619 type1[0] = '\0';
14620 type2[0] = '\0';
14621 if(inCompiler)
14622 {
14623 PrintType(exp->expType, type1, 0x0, 0x1);
14624 PrintType(exp->destType, type2, 0x0, 0x1);
14625 }
14626 if(exp->destType->truth && exp->destType->_class && exp->destType->_class->registered && !strcmp(exp->destType->_class->registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type != 1)))
14627 ;
14628 else
14629 {
14630 char expString[10240];
14631
14632 expString[0] = '\0';
14633 if(inCompiler)
14634 {
14635 PrintExpression(exp, expString);
14636 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14637 }
14638 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14639 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14640 FreeType(exp->expType);
14641 exp->destType->refCount++;
14642 exp->expType = exp->destType;
14643 }
14644 }
14645 }
14646 }
14647 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14648 {
14649 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14650 char typeString[1024];
14651 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14652 struct Declarator * decl;
14653
14654 typeString[0] = '\0';
14655 *newExp = *exp;
14656 if(exp->expType)
14657 exp->expType->refCount++;
14658 if(exp->expType)
14659 exp->expType->refCount++;
14660 exp->type = 11;
14661 newExp->destType = exp->expType;
14662 PrintType(exp->expType, typeString, 0x0, 0x0);
14663 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14664 exp->cast.typeName = MkTypeName(specs, decl);
14665 exp->cast.exp = newExp;
14666 }
14667 }
14668 else if(unresolved)
14669 {
14670 if(exp->identifier->_class && exp->identifier->_class->name)
14671 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14672 else if(exp->identifier->string && exp->identifier->string[0])
14673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14674 }
14675 else if(!exp->expType && exp->type != 16)
14676 {
14677 char expString[10240];
14678
14679 expString[0] = '\0';
14680 if(inCompiler)
14681 {
14682 PrintExpression(exp, expString);
14683 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14684 }
14685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14686 }
14687 ApplyAnyObjectLogic(exp);
14688 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14689 {
14690 exp->byReference = 0x1;
14691 }
14692 yylloc = oldyylloc;
14693 }
14694
14695 static void FindNextDataMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
14696 {
14697 if(*curMember)
14698 {
14699 *curMember = (*curMember)->next;
14700 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14701 {
14702 *curMember = subMemberStack[--(*subMemberStackPos)];
14703 *curMember = (*curMember)->next;
14704 }
14705 while((*curMember) && (*curMember)->isProperty)
14706 *curMember = (*curMember)->next;
14707 if(subMemberStackPos)
14708 {
14709 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14710 {
14711 subMemberStack[(*subMemberStackPos)++] = *curMember;
14712 *curMember = (*curMember)->members.first;
14713 while(*curMember && (*curMember)->isProperty)
14714 *curMember = (*curMember)->next;
14715 }
14716 }
14717 }
14718 while(!*curMember)
14719 {
14720 if(!*curMember)
14721 {
14722 if(subMemberStackPos && *subMemberStackPos)
14723 {
14724 *curMember = subMemberStack[--(*subMemberStackPos)];
14725 *curMember = (*curMember)->next;
14726 }
14727 else
14728 {
14729 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14730
14731 if(*curClass == _class)
14732 break;
14733 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14734 ;
14735 *curMember = (*curClass)->membersAndProperties.first;
14736 }
14737 while((*curMember) && (*curMember)->isProperty)
14738 *curMember = (*curMember)->next;
14739 if(subMemberStackPos)
14740 {
14741 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14742 {
14743 subMemberStack[(*subMemberStackPos)++] = *curMember;
14744 *curMember = (*curMember)->members.first;
14745 while(*curMember && (*curMember)->isProperty)
14746 *curMember = (*curMember)->next;
14747 }
14748 }
14749 }
14750 }
14751 }
14752
14753 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14754 {
14755 switch(init->type)
14756 {
14757 case 0:
14758 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14759 {
14760 if(init->exp && !init->exp->destType)
14761 {
14762 FreeType(init->exp->destType);
14763 init->exp->destType = type;
14764 if(type)
14765 type->refCount++;
14766 }
14767 if(init->exp)
14768 {
14769 ProcessExpressionType(init->exp);
14770 init->isConstant = init->exp->isConstant;
14771 }
14772 break;
14773 }
14774 else
14775 {
14776 struct Expression * exp = init->exp;
14777 struct Instantiation * inst = exp->instance;
14778 struct MembersInit * members;
14779
14780 init->type = 1;
14781 init->list = MkList();
14782 if(inst->members)
14783 {
14784 for(members = (*inst->members).first; members; members = members->next)
14785 {
14786 if(members->type == 0)
14787 {
14788 struct MemberInit * member;
14789
14790 for(member = (*members->dataMembers).first; member; member = member->next)
14791 {
14792 ListAdd(init->list, member->initializer);
14793 member->initializer = (((void *)0));
14794 }
14795 }
14796 }
14797 }
14798 FreeExpression(exp);
14799 }
14800 case 1:
14801 {
14802 struct Initializer * i;
14803 struct Type * initializerType = (((void *)0));
14804 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14805 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14806 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14807 int subMemberStackPos = 0;
14808
14809 if(type && type->kind == 12)
14810 initializerType = Dereference(type);
14811 else if(type && (type->kind == 9 || type->kind == 10))
14812 initializerType = type->members.first;
14813 for(i = (*init->list).first; i; i = i->next)
14814 {
14815 if(type && type->kind == 8 && type->_class && type->_class->registered)
14816 {
14817 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14818 if(curMember)
14819 {
14820 if(!curMember->dataType)
14821 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14822 initializerType = curMember->dataType;
14823 }
14824 }
14825 ProcessInitializer(i, initializerType);
14826 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14827 initializerType = initializerType->next;
14828 if(!i->isConstant)
14829 init->isConstant = 0x0;
14830 }
14831 if(type && type->kind == 12)
14832 FreeType(initializerType);
14833 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14834 {
14835 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14836 }
14837 break;
14838 }
14839 }
14840 }
14841
14842 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14843
14844 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14845
14846 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14847 {
14848 switch(spec->type)
14849 {
14850 case 0:
14851 {
14852 if(spec->specifier == THISCLASS)
14853 {
14854 if(thisClass)
14855 {
14856 spec->type = 1;
14857 spec->name = ReplaceThisClass(thisClass);
14858 spec->symbol = FindClass(spec->name);
14859 ProcessSpecifier(spec, declareStruct);
14860 }
14861 }
14862 break;
14863 }
14864 case 1:
14865 {
14866 struct Symbol * symbol = FindType(curContext, spec->name);
14867
14868 if(symbol)
14869 DeclareType(symbol->type, 0x1, 0x1);
14870 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14871 DeclareStruct(spec->name, 0x0);
14872 break;
14873 }
14874 case 2:
14875 {
14876 struct Enumerator * e;
14877
14878 if(spec->list)
14879 {
14880 for(e = (*spec->list).first; e; e = e->next)
14881 {
14882 if(e->exp)
14883 ProcessExpressionType(e->exp);
14884 }
14885 }
14886 break;
14887 }
14888 case 3:
14889 case 4:
14890 {
14891 if(spec->definitions)
14892 {
14893 struct ClassDef * def;
14894 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14895
14896 ProcessClass(spec->definitions, symbol);
14897 }
14898 break;
14899 }
14900 }
14901 }
14902
14903 static void ProcessDeclarator(struct Declarator * decl)
14904 {
14905 switch(decl->type)
14906 {
14907 case 1:
14908 if(decl->identifier->classSym)
14909 {
14910 FreeSpecifier(decl->identifier->_class);
14911 decl->identifier->_class = (((void *)0));
14912 }
14913 break;
14914 case 3:
14915 if(decl->array.exp)
14916 ProcessExpressionType(decl->array.exp);
14917 case 0:
14918 case 2:
14919 case 4:
14920 case 5:
14921 case 6:
14922 case 7:
14923 if(decl->declarator)
14924 ProcessDeclarator(decl->declarator);
14925 if(decl->type == 4)
14926 {
14927 struct Identifier * id = GetDeclId(decl);
14928
14929 if(id && id->_class)
14930 {
14931 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14932
14933 if(!decl->function.parameters)
14934 decl->function.parameters = MkList();
14935 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14936 id->_class = (((void *)0));
14937 }
14938 if(decl->function.parameters)
14939 {
14940 struct TypeName * param;
14941
14942 for(param = (*decl->function.parameters).first; param; param = param->next)
14943 {
14944 if(param->qualifiers && (*param->qualifiers).first)
14945 {
14946 struct Specifier * spec = (*param->qualifiers).first;
14947
14948 if(spec && spec->specifier == TYPED_OBJECT)
14949 {
14950 struct Declarator * d = param->declarator;
14951 struct TypeName * newParam = (newParam = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), newParam->qualifiers = MkListOne(MkSpecifier(VOID)), newParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d), newParam);
14952
14953 FreeList(param->qualifiers, FreeSpecifier);
14954 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14955 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14957 param = newParam;
14958 }
14959 else if(spec && spec->specifier == ANY_OBJECT)
14960 {
14961 struct Declarator * d = param->declarator;
14962
14963 FreeList(param->qualifiers, FreeSpecifier);
14964 param->qualifiers = MkListOne(MkSpecifier(VOID));
14965 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14966 }
14967 else if(spec->specifier == THISCLASS)
14968 {
14969 if(thisClass)
14970 {
14971 spec->type = 1;
14972 spec->name = ReplaceThisClass(thisClass);
14973 spec->symbol = FindClass(spec->name);
14974 ProcessSpecifier(spec, 0x0);
14975 }
14976 }
14977 }
14978 if(param->declarator)
14979 ProcessDeclarator(param->declarator);
14980 }
14981 }
14982 }
14983 break;
14984 }
14985 }
14986
14987 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14988
14989 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14990
14991 static void ProcessDeclaration(struct Declaration * decl)
14992 {
14993 yylloc = decl->loc;
14994 switch(decl->type)
14995 {
14996 case 1:
14997 {
14998 unsigned int declareStruct = 0x0;
14999
15000 if(decl->declarators)
15001 {
15002 struct InitDeclarator * d;
15003
15004 for(d = (*decl->declarators).first; d; d = d->next)
15005 {
15006 struct Type * type, * subType;
15007
15008 ProcessDeclarator(d->declarator);
15009 type = ProcessType(decl->specifiers, d->declarator);
15010 if(d->initializer)
15011 {
15012 ProcessInitializer(d->initializer, type);
15013 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15014 {
15015 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15016 {
15017 struct Instantiation * inst = d->initializer->exp->instance;
15018
15019 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15020 d->initializer->exp->instance = (((void *)0));
15021 if(decl->specifiers)
15022 FreeList(decl->specifiers, FreeSpecifier);
15023 FreeList(decl->declarators, FreeInitDeclarator);
15024 d = (((void *)0));
15025 decl->type = 2;
15026 decl->inst = inst;
15027 }
15028 }
15029 }
15030 for(subType = type; subType; )
15031 {
15032 if(subType->kind == 8)
15033 {
15034 declareStruct = 0x1;
15035 break;
15036 }
15037 else if(subType->kind == 13)
15038 break;
15039 else if(subType->kind == 12)
15040 subType = subType->arrayType;
15041 else
15042 break;
15043 }
15044 FreeType(type);
15045 if(!d)
15046 break;
15047 }
15048 }
15049 if(decl->specifiers)
15050 {
15051 struct Specifier * s;
15052
15053 for(s = (*decl->specifiers).first; s; s = s->next)
15054 {
15055 ProcessSpecifier(s, declareStruct);
15056 }
15057 }
15058 break;
15059 }
15060 case 2:
15061 {
15062 ProcessInstantiationType(decl->inst);
15063 break;
15064 }
15065 case 0:
15066 {
15067 struct Specifier * spec;
15068 struct Declarator * d;
15069 unsigned int declareStruct = 0x0;
15070
15071 if(decl->declarators)
15072 {
15073 for(d = (*decl->declarators).first; d; d = d->next)
15074 {
15075 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15076 struct Type * subType;
15077
15078 ProcessDeclarator(d);
15079 for(subType = type; subType; )
15080 {
15081 if(subType->kind == 8)
15082 {
15083 declareStruct = 0x1;
15084 break;
15085 }
15086 else if(subType->kind == 13)
15087 break;
15088 else if(subType->kind == 12)
15089 subType = subType->arrayType;
15090 else
15091 break;
15092 }
15093 FreeType(type);
15094 }
15095 }
15096 if(decl->specifiers)
15097 {
15098 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15099 ProcessSpecifier(spec, declareStruct);
15100 }
15101 break;
15102 }
15103 }
15104 }
15105
15106 static struct FunctionDefinition * curFunction;
15107
15108 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15109 {
15110 char propName[1024], propNameM[1024];
15111 char getName[1024], setName[1024];
15112 struct __ecereNameSpace__ecere__sys__OldList * args;
15113
15114 DeclareProperty(prop, setName, getName);
15115 strcpy(propName, "__ecereProp_");
15116 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15117 strcat(propName, "_");
15118 FullClassNameCat(propName, prop->name, 0x1);
15119 MangleClassName(propName);
15120 strcpy(propNameM, "__ecerePropM_");
15121 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15122 strcat(propNameM, "_");
15123 FullClassNameCat(propNameM, prop->name, 0x1);
15124 MangleClassName(propNameM);
15125 if(prop->isWatchable)
15126 {
15127 args = MkList();
15128 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15129 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15130 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15131 args = MkList();
15132 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15133 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15134 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15135 }
15136 {
15137 args = MkList();
15138 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15139 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15140 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15141 args = MkList();
15142 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15143 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15144 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15145 }
15146 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15147 curFunction->propSet->fireWatchersDone = 0x1;
15148 }
15149
15150 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15151
15152 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15153
15154 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15155
15156 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15157
15158 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15159
15160 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15161
15162 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15163
15164 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15165
15166 static void ProcessStatement(struct Statement * stmt)
15167 {
15168 yylloc = stmt->loc;
15169 switch(stmt->type)
15170 {
15171 case 0:
15172 ProcessStatement(stmt->labeled.stmt);
15173 break;
15174 case 1:
15175 if(stmt->caseStmt.exp)
15176 {
15177 FreeType(stmt->caseStmt.exp->destType);
15178 stmt->caseStmt.exp->destType = curSwitchType;
15179 if(curSwitchType)
15180 curSwitchType->refCount++;
15181 ProcessExpressionType(stmt->caseStmt.exp);
15182 ComputeExpression(stmt->caseStmt.exp);
15183 }
15184 if(stmt->caseStmt.stmt)
15185 ProcessStatement(stmt->caseStmt.stmt);
15186 break;
15187 case 2:
15188 {
15189 if(stmt->compound.context)
15190 {
15191 struct Declaration * decl;
15192 struct Statement * s;
15193 struct Statement * prevCompound = curCompound;
15194 struct Context * prevContext = curContext;
15195
15196 if(!stmt->compound.isSwitch)
15197 {
15198 curCompound = stmt;
15199 curContext = stmt->compound.context;
15200 }
15201 if(stmt->compound.declarations)
15202 {
15203 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15204 ProcessDeclaration(decl);
15205 }
15206 if(stmt->compound.statements)
15207 {
15208 for(s = (*stmt->compound.statements).first; s; s = s->next)
15209 ProcessStatement(s);
15210 }
15211 curContext = prevContext;
15212 curCompound = prevCompound;
15213 }
15214 break;
15215 }
15216 case 3:
15217 {
15218 struct Expression * exp;
15219
15220 if(stmt->expressions)
15221 {
15222 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15223 ProcessExpressionType(exp);
15224 }
15225 break;
15226 }
15227 case 4:
15228 {
15229 struct Expression * exp;
15230
15231 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15232 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15233 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15234 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15235 {
15236 ProcessExpressionType(exp);
15237 }
15238 if(stmt->ifStmt.stmt)
15239 ProcessStatement(stmt->ifStmt.stmt);
15240 if(stmt->ifStmt.elseStmt)
15241 ProcessStatement(stmt->ifStmt.elseStmt);
15242 break;
15243 }
15244 case 5:
15245 {
15246 struct Type * oldSwitchType = curSwitchType;
15247
15248 if(stmt->switchStmt.exp)
15249 {
15250 struct Expression * exp;
15251
15252 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15253 {
15254 if(!exp->next)
15255 {
15256 ProcessExpressionType(exp);
15257 }
15258 if(!exp->next)
15259 curSwitchType = exp->expType;
15260 }
15261 }
15262 ProcessStatement(stmt->switchStmt.stmt);
15263 curSwitchType = oldSwitchType;
15264 break;
15265 }
15266 case 6:
15267 {
15268 if(stmt->whileStmt.exp)
15269 {
15270 struct Expression * exp;
15271
15272 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15273 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15274 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15275 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15276 {
15277 ProcessExpressionType(exp);
15278 }
15279 }
15280 if(stmt->whileStmt.stmt)
15281 ProcessStatement(stmt->whileStmt.stmt);
15282 break;
15283 }
15284 case 7:
15285 {
15286 if(stmt->doWhile.exp)
15287 {
15288 struct Expression * exp;
15289
15290 if((*stmt->doWhile.exp).last)
15291 {
15292 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15293 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15294 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15295 }
15296 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15297 {
15298 ProcessExpressionType(exp);
15299 }
15300 }
15301 if(stmt->doWhile.stmt)
15302 ProcessStatement(stmt->doWhile.stmt);
15303 break;
15304 }
15305 case 8:
15306 {
15307 struct Expression * exp;
15308
15309 if(stmt->forStmt.init)
15310 ProcessStatement(stmt->forStmt.init);
15311 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15312 {
15313 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15314 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15315 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15316 }
15317 if(stmt->forStmt.check)
15318 ProcessStatement(stmt->forStmt.check);
15319 if(stmt->forStmt.increment)
15320 {
15321 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15322 ProcessExpressionType(exp);
15323 }
15324 if(stmt->forStmt.stmt)
15325 ProcessStatement(stmt->forStmt.stmt);
15326 break;
15327 }
15328 case 18:
15329 {
15330 struct Identifier * id = stmt->forEachStmt.id;
15331 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15332 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15333 struct Statement * block = stmt->forEachStmt.stmt;
15334 char iteratorType[1024];
15335 struct Type * source;
15336 struct Expression * e;
15337 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
15338 struct Expression * arrayExp;
15339 char * typeString = (((void *)0));
15340 int builtinCount = 0;
15341
15342 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15343 {
15344 if(!e->next)
15345 {
15346 FreeType(e->destType);
15347 e->destType = ProcessTypeString("Container", 0x0);
15348 }
15349 if(!isBuiltin || e->next)
15350 ProcessExpressionType(e);
15351 }
15352 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15353 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15354 {
15355 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15356 struct Symbol * symbol;
15357 struct Expression * expIt = (((void *)0));
15358 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15359 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15360 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15361 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15362
15363 stmt->type = 2;
15364 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15365 stmt->compound.context->parent = curContext;
15366 curContext = stmt->compound.context;
15367 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15368 {
15369 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15370 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15371
15372 isCustomAVLTree = 0x1;
15373 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15374 isAVLTree = 0x1;
15375 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15376 isMap = 0x1;
15377 }
15378 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15379 isArray = 0x1;
15380 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15381 {
15382 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15383
15384 isLinkList = 0x1;
15385 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15386 }
15387 if(isArray)
15388 {
15389 struct Declarator * decl;
15390 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15391
15392 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15393 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15394 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15395 }
15396 else if(isBuiltin)
15397 {
15398 struct Type * type = (((void *)0));
15399 char typeStringBuf[1024];
15400
15401 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15402 if(((struct Expression *)(*exp).last)->type == 11)
15403 {
15404 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15405
15406 if(typeName)
15407 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15408 }
15409 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->_class && arrayExp->destType->_class->registered && arrayExp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->_class->registered, containerClass) && arrayExp->destType->_class->registered->templateArgs)
15410 {
15411 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15412
15413 typeString = templateClass->templateArgs[2].dataTypeString;
15414 }
15415 else if(arrayExp->list)
15416 {
15417 struct Expression * e;
15418
15419 for(e = (*arrayExp->list).first; e; e = e->next)
15420 {
15421 ProcessExpressionType(e);
15422 if(e->expType)
15423 {
15424 if(!type)
15425 {
15426 type = e->expType;
15427 type->refCount++;
15428 }
15429 else
15430 {
15431 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15432 {
15433 FreeType(type);
15434 type = e->expType;
15435 e->expType = (((void *)0));
15436 e = (*arrayExp->list).first;
15437 ProcessExpressionType(e);
15438 if(e->expType)
15439 {
15440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15441 {
15442 FreeType(e->expType);
15443 e->expType = (((void *)0));
15444 FreeType(type);
15445 type = (((void *)0));
15446 break;
15447 }
15448 }
15449 }
15450 }
15451 if(e->expType)
15452 {
15453 FreeType(e->expType);
15454 e->expType = (((void *)0));
15455 }
15456 }
15457 }
15458 if(type)
15459 {
15460 typeStringBuf[0] = '\0';
15461 PrintType(type, typeStringBuf, 0x0, 0x1);
15462 typeString = typeStringBuf;
15463 FreeType(type);
15464 }
15465 }
15466 if(typeString)
15467 {
15468 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15469 struct Declarator * decl;
15470 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15471
15472 if(arrayExp->list)
15473 {
15474 struct Expression * e;
15475
15476 builtinCount = (*arrayExp->list).count;
15477 type = ProcessTypeString(typeString, 0x0);
15478 while(e = (*arrayExp->list).first)
15479 {
15480 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15481 e->destType = type;
15482 type->refCount++;
15483 ProcessExpressionType(e);
15484 ListAdd(initializers, MkInitializerAssignment(e));
15485 }
15486 FreeType(type);
15487 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15488 }
15489 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15490 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15491 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15492 FreeList(exp, FreeExpression);
15493 }
15494 else
15495 {
15496 arrayExp->expType = ProcessTypeString("Container", 0x0);
15497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15498 }
15499 }
15500 else if(isLinkList && !isList)
15501 {
15502 struct Declarator * decl;
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504
15505 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15506 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15507 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15508 }
15509 else if(_class->templateArgs)
15510 {
15511 if(isMap)
15512 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15513 else
15514 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15515 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15516 }
15517 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15518 if(block && block->type == 2 && block->compound.context)
15519 {
15520 block->compound.context->parent = stmt->compound.context;
15521 }
15522 if(filter)
15523 {
15524 block = MkIfStmt(filter, block, (((void *)0)));
15525 }
15526 if(isArray)
15527 {
15528 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array")), '+', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15529 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15530 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15531 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15532 }
15533 else if(isBuiltin)
15534 {
15535 char count[128];
15536
15537 sprintf(count, "%d", builtinCount);
15538 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpIdentifier(MkIdentifier("__internalArray"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpIdentifier(MkIdentifier("__internalArray")), '+', MkExpConstant(count))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15539 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15540 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15541 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15542 }
15543 else if(isLinkList && !isList)
15544 {
15545 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15546 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15547
15548 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15549 {
15550 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("next")))), block));
15551 }
15552 else
15553 {
15554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15555 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15556
15557 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpCast(MkTypeName(specs, decl), MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("GetNext")), MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("IteratorPointer")), (((void *)0))), MkExpIdentifier(CopyIdentifier(id)))))))), block));
15558 }
15559 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15560 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15561 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15562 }
15563 else
15564 {
15565 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15566 }
15567 ProcessExpressionType(expIt);
15568 if((*stmt->compound.declarations).first)
15569 ProcessDeclaration((*stmt->compound.declarations).first);
15570 if(symbol)
15571 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15572 ProcessStatement(stmt);
15573 curContext = stmt->compound.context->parent;
15574 break;
15575 }
15576 else
15577 {
15578 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15579 }
15580 break;
15581 }
15582 case 9:
15583 break;
15584 case 10:
15585 break;
15586 case 11:
15587 break;
15588 case 12:
15589 {
15590 struct Expression * exp;
15591
15592 if(stmt->expressions)
15593 {
15594 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15595 {
15596 if(!exp->next)
15597 {
15598 if(curFunction && !curFunction->type)
15599 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15600 FreeType(exp->destType);
15601 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15602 if(exp->destType)
15603 exp->destType->refCount++;
15604 }
15605 ProcessExpressionType(exp);
15606 }
15607 }
15608 break;
15609 }
15610 case 14:
15611 {
15612 ProcessDeclaration(stmt->decl);
15613 break;
15614 }
15615 case 13:
15616 {
15617 struct AsmField * field;
15618
15619 if(stmt->asmStmt.inputFields)
15620 {
15621 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15622 if(field->expression)
15623 ProcessExpressionType(field->expression);
15624 }
15625 if(stmt->asmStmt.outputFields)
15626 {
15627 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15628 if(field->expression)
15629 ProcessExpressionType(field->expression);
15630 }
15631 if(stmt->asmStmt.clobberedFields)
15632 {
15633 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15634 {
15635 if(field->expression)
15636 ProcessExpressionType(field->expression);
15637 }
15638 }
15639 break;
15640 }
15641 case 17:
15642 {
15643 struct PropertyWatch * propWatch;
15644 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15645 struct Expression * object = stmt->_watch.object;
15646 struct Expression * watcher = stmt->_watch.watcher;
15647
15648 if(watcher)
15649 ProcessExpressionType(watcher);
15650 if(object)
15651 ProcessExpressionType(object);
15652 if(inCompiler)
15653 {
15654 if(watcher || thisClass)
15655 {
15656 struct External * external = curExternal;
15657 struct Context * context = curContext;
15658
15659 stmt->type = 3;
15660 stmt->expressions = MkList();
15661 curExternal = external->prev;
15662 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15663 {
15664 struct ClassFunction * func;
15665 char watcherName[1024];
15666 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15667 struct External * createdExternal;
15668 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15669
15670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15671 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15672 if(propWatch->deleteWatch)
15673 strcat(watcherName, "_delete");
15674 else
15675 {
15676 struct Identifier * propID;
15677
15678 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15679 {
15680 strcat(watcherName, "_");
15681 strcat(watcherName, propID->string);
15682 }
15683 }
15684 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15685 {
15686 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15687 ProcessClassFunctionBody(func, propWatch->compound);
15688 propWatch->compound = (((void *)0));
15689 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15690 createdExternal->symbol->idCode = external->symbol->idCode;
15691 curExternal = createdExternal;
15692 ProcessFunction(createdExternal->function);
15693 {
15694 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15695
15696 externalDecl->declaration = decl;
15697 if(decl->symbol && !decl->symbol->pointerExternal)
15698 decl->symbol->pointerExternal = externalDecl;
15699 }
15700 if(propWatch->deleteWatch)
15701 {
15702 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15703
15704 ListAdd(args, CopyExpression(object));
15705 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15706 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15707 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15708 }
15709 else
15710 {
15711 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15712 struct Identifier * propID;
15713
15714 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15715 {
15716 char propName[1024];
15717 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15718
15719 if(prop)
15720 {
15721 char getName[1024], setName[1024];
15722 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15723
15724 DeclareProperty(prop, setName, getName);
15725 strcpy(propName, "__ecereProp_");
15726 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15727 strcat(propName, "_");
15728 FullClassNameCat(propName, prop->name, 0x1);
15729 ListAdd(args, CopyExpression(object));
15730 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15731 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15732 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15733 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15734 }
15735 else
15736 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15737 }
15738 }
15739 }
15740 else
15741 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15742 }
15743 curExternal = external;
15744 curContext = context;
15745 if(watcher)
15746 FreeExpression(watcher);
15747 if(object)
15748 FreeExpression(object);
15749 FreeList(watches, FreePropertyWatch);
15750 }
15751 else
15752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15753 }
15754 else
15755 {
15756 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15757 {
15758 ProcessStatement(propWatch->compound);
15759 }
15760 }
15761 break;
15762 }
15763 case 15:
15764 {
15765 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15766 struct Expression * object = stmt->_watch.object;
15767 struct __ecereNameSpace__ecere__com__Class * _class;
15768
15769 if(object)
15770 ProcessExpressionType(object);
15771 if(inCompiler)
15772 {
15773 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15774 if(_class)
15775 {
15776 struct Identifier * propID;
15777
15778 stmt->type = 3;
15779 stmt->expressions = MkList();
15780 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15781 {
15782 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15783 }
15784 else if(!watches)
15785 {
15786 }
15787 if(watches)
15788 {
15789 for(propID = (*watches).first; propID; propID = propID->next)
15790 {
15791 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15792
15793 if(prop)
15794 {
15795 CreateFireWatcher(prop, object, stmt);
15796 }
15797 else
15798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15799 }
15800 }
15801 else
15802 {
15803 struct __ecereNameSpace__ecere__com__Property * prop;
15804 struct __ecereNameSpace__ecere__com__Class * base;
15805
15806 for(base = _class; base; base = base->base)
15807 {
15808 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15809 {
15810 if(prop->isProperty && prop->isWatchable)
15811 {
15812 CreateFireWatcher(prop, object, stmt);
15813 }
15814 }
15815 }
15816 }
15817 if(object)
15818 FreeExpression(object);
15819 FreeList(watches, FreeIdentifier);
15820 }
15821 else
15822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15823 }
15824 break;
15825 }
15826 case 16:
15827 {
15828 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15829 struct Expression * object = stmt->_watch.object;
15830 struct Expression * watcher = stmt->_watch.watcher;
15831 struct __ecereNameSpace__ecere__com__Class * _class;
15832
15833 if(object)
15834 ProcessExpressionType(object);
15835 if(watcher)
15836 ProcessExpressionType(watcher);
15837 if(inCompiler)
15838 {
15839 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15840 if(watcher || thisClass)
15841 {
15842 if(_class)
15843 {
15844 struct Identifier * propID;
15845
15846 stmt->type = 3;
15847 stmt->expressions = MkList();
15848 if(!watches)
15849 {
15850 struct __ecereNameSpace__ecere__sys__OldList * args;
15851
15852 args = MkList();
15853 ListAdd(args, CopyExpression(object));
15854 ListAdd(args, MkExpConstant("0"));
15855 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15856 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15857 }
15858 else
15859 {
15860 for(propID = (*watches).first; propID; propID = propID->next)
15861 {
15862 char propName[1024];
15863 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15864
15865 if(prop)
15866 {
15867 char getName[1024], setName[1024];
15868 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15869
15870 DeclareProperty(prop, setName, getName);
15871 strcpy(propName, "__ecereProp_");
15872 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15873 strcat(propName, "_");
15874 FullClassNameCat(propName, prop->name, 0x1);
15875 MangleClassName(propName);
15876 ListAdd(args, CopyExpression(object));
15877 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15878 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15879 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15880 }
15881 else
15882 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15883 }
15884 }
15885 if(object)
15886 FreeExpression(object);
15887 if(watcher)
15888 FreeExpression(watcher);
15889 FreeList(watches, FreeIdentifier);
15890 }
15891 else
15892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15893 }
15894 else
15895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15896 }
15897 break;
15898 }
15899 }
15900 }
15901
15902 extern struct Expression * QBrackets(struct Expression * exp);
15903
15904 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15905
15906 extern struct Declarator * QMkPtrDecl(char *  id);
15907
15908 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15909
15910 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15911
15912 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15913
15914 static void ProcessFunction(struct FunctionDefinition * function)
15915 {
15916 void * __ecereTemp2;
15917 void * __ecereTemp1;
15918 struct Identifier * id = GetDeclId(function->declarator);
15919 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15920 struct Type * type = symbol ? symbol->type : (((void *)0));
15921 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15922 struct Context * oldTopContext = topContext;
15923
15924 yylloc = function->loc;
15925 if(type && type->thisClass)
15926 {
15927 struct Symbol * classSym = type->thisClass;
15928 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15929 char className[1024];
15930 char structName[1024];
15931 struct Declarator * funcDecl;
15932 struct Symbol * thisSymbol;
15933 unsigned int typedObject = 0x0;
15934
15935 if(_class && !_class->base)
15936 {
15937 _class = currentClass;
15938 if(_class && !_class->symbol)
15939 _class->symbol = FindClass(_class->fullName);
15940 classSym = _class ? _class->symbol : (((void *)0));
15941 typedObject = 0x1;
15942 }
15943 thisClass = _class;
15944 if(inCompiler && _class)
15945 {
15946 if(type->kind == 11)
15947 {
15948 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15949 {
15950 struct Type * param = symbol->type->params.first;
15951
15952 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15953 FreeType(param);
15954 }
15955 if(type->classObjectType != 1)
15956 {
15957 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15958 symbol->type->staticMethod = 0x1;
15959 symbol->type->thisClass = (((void *)0));
15960 symbol->type->extraParam = 0x0;
15961 }
15962 }
15963 strcpy(className, "__ecereClass_");
15964 FullClassNameCat(className, _class->fullName, 0x1);
15965 MangleClassName(className);
15966 structName[0] = (char)0;
15967 FullClassNameCat(structName, _class->fullName, 0x0);
15968 funcDecl = GetFuncDecl(function->declarator);
15969 if(funcDecl)
15970 {
15971 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15972 {
15973 struct TypeName * param = (*funcDecl->function.parameters).first;
15974
15975 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15976 {
15977 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15978 FreeTypeName(param);
15979 }
15980 }
15981 if(!function->propertyNoThis)
15982 {
15983 struct TypeName * thisParam;
15984
15985 if(type->classObjectType != 1)
15986 {
15987 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15988 if(!funcDecl->function.parameters)
15989 funcDecl->function.parameters = MkList();
15990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15991 }
15992 if(typedObject)
15993 {
15994 if(type->classObjectType != 1)
15995 {
15996 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15997 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15998 }
15999 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
16000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16001 }
16002 }
16003 }
16004 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16005 {
16006 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16007
16008 funcDecl = GetFuncDecl(initDecl->declarator);
16009 if(funcDecl)
16010 {
16011 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16012 {
16013 struct TypeName * param = (*funcDecl->function.parameters).first;
16014
16015 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16016 {
16017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16018 FreeTypeName(param);
16019 }
16020 }
16021 if(type->classObjectType != 1)
16022 {
16023 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16024 {
16025 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16026
16027 if(!funcDecl->function.parameters)
16028 funcDecl->function.parameters = MkList();
16029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16030 }
16031 }
16032 }
16033 }
16034 }
16035 if(function->body)
16036 {
16037 if(type->classObjectType != 1)
16038 {
16039 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
16040 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16041 if(typedObject && thisSymbol->type)
16042 {
16043 thisSymbol->type->classObjectType = 2;
16044 thisSymbol->type->byReference = type->byReference;
16045 }
16046 }
16047 }
16048 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16049 {
16050 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16051
16052 {
16053 struct __ecereNameSpace__ecere__com__Class * base;
16054
16055 for(base = _class; base && base->type != 1000; base = base->next)
16056 {
16057 for(member = base->membersAndProperties.first; member; member = member->next)
16058 if(!member->isProperty)
16059 break;
16060 if(member)
16061 break;
16062 }
16063 }
16064 for(member = _class->membersAndProperties.first; member; member = member->next)
16065 if(!member->isProperty)
16066 break;
16067 if(member)
16068 {
16069 char pointerName[1024];
16070 struct Declaration * decl;
16071 struct Initializer * initializer;
16072 struct Expression * exp, * bytePtr;
16073
16074 strcpy(pointerName, "__ecerePointer_");
16075 FullClassNameCat(pointerName, _class->fullName, 0x0);
16076 {
16077 char className[1024];
16078
16079 strcpy(className, "__ecereClass_");
16080 FullClassNameCat(className, classSym->string, 0x1);
16081 MangleClassName(className);
16082 DeclareClass(classSym, className);
16083 }
16084 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16085 if(_class->fixed)
16086 {
16087 char string[256];
16088
16089 sprintf(string, "%d", _class->offset);
16090 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16091 }
16092 else
16093 {
16094 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16095 }
16096 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16097 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
16098 if(function->body)
16099 {
16100 yylloc = function->body->loc;
16101 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16102 {
16103 struct Context * prevContext = curContext;
16104
16105 curContext = function->body->compound.context;
16106 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16107 curContext = prevContext;
16108 }
16109 decl->symbol = (((void *)0));
16110 if(!function->body->compound.declarations)
16111 function->body->compound.declarations = MkList();
16112 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16113 }
16114 }
16115 }
16116 }
16117 else
16118 thisClass = (((void *)0));
16119 if(id)
16120 {
16121 FreeSpecifier(id->_class);
16122 id->_class = (((void *)0));
16123 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16124 {
16125 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16126
16127 id = GetDeclId(initDecl->declarator);
16128 FreeSpecifier(id->_class);
16129 id->_class = (((void *)0));
16130 }
16131 }
16132 if(function->body)
16133 topContext = function->body->compound.context;
16134 {
16135 struct FunctionDefinition * oldFunction = curFunction;
16136
16137 curFunction = function;
16138 if(function->body)
16139 ProcessStatement(function->body);
16140 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16141 {
16142 struct Statement * prevCompound = curCompound;
16143 struct Context * prevContext = curContext;
16144 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16145
16146 if(!function->body->compound.statements)
16147 function->body->compound.statements = MkList();
16148 ListAdd(function->body->compound.statements, fireWatchers);
16149 curCompound = function->body;
16150 curContext = function->body->compound.context;
16151 ProcessStatement(fireWatchers);
16152 curContext = prevContext;
16153 curCompound = prevCompound;
16154 }
16155 curFunction = oldFunction;
16156 }
16157 if(function->declarator)
16158 {
16159 ProcessDeclarator(function->declarator);
16160 }
16161 topContext = oldTopContext;
16162 thisClass = oldThisClass;
16163 }
16164
16165 extern void FreeSymbol(struct Symbol * symbol);
16166
16167 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16168
16169 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16170 {
16171 struct ClassDef * def;
16172 struct External * external = curExternal;
16173 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16174
16175 for(def = definitions->first; def; def = def->next)
16176 {
16177 if(def->type == 0)
16178 {
16179 if(def->function->declarator)
16180 curExternal = def->function->declarator->symbol->pointerExternal;
16181 else
16182 curExternal = external;
16183 ProcessFunction((struct FunctionDefinition *)def->function);
16184 }
16185 else if(def->type == 2)
16186 {
16187 if(def->decl->type == 2)
16188 {
16189 thisClass = regClass;
16190 ProcessInstantiationType(def->decl->inst);
16191 thisClass = (((void *)0));
16192 }
16193 else
16194 {
16195 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16196
16197 if(regClass)
16198 thisClass = regClass;
16199 ProcessDeclaration(def->decl);
16200 thisClass = backThisClass;
16201 }
16202 }
16203 else if(def->type == 1 && def->defProperties)
16204 {
16205 struct MemberInit * defProperty;
16206 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
16207
16208 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16209 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16210 {
16211 thisClass = regClass;
16212 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16213 thisClass = (((void *)0));
16214 }
16215 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16216 FreeSymbol(thisSymbol);
16217 }
16218 else if(def->type == 3 && def->propertyDef)
16219 {
16220 struct PropertyDef * prop = def->propertyDef;
16221
16222 thisClass = regClass;
16223 if(prop->setStmt)
16224 {
16225 if(regClass)
16226 {
16227 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16228
16229 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16230 }
16231 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16232 ProcessStatement(prop->setStmt);
16233 }
16234 if(prop->getStmt)
16235 {
16236 if(regClass)
16237 {
16238 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16239
16240 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16241 }
16242 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16243 ProcessStatement(prop->getStmt);
16244 }
16245 if(prop->issetStmt)
16246 {
16247 if(regClass)
16248 {
16249 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16250
16251 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16252 }
16253 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16254 ProcessStatement(prop->issetStmt);
16255 }
16256 thisClass = (((void *)0));
16257 }
16258 else if(def->type == 4 && def->propertyWatch)
16259 {
16260 struct PropertyWatch * propertyWatch = def->propertyWatch;
16261
16262 thisClass = regClass;
16263 if(propertyWatch->compound)
16264 {
16265 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
16266
16267 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16268 curExternal = (((void *)0));
16269 ProcessStatement(propertyWatch->compound);
16270 }
16271 thisClass = (((void *)0));
16272 }
16273 }
16274 }
16275
16276 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16277
16278 void ComputeDataTypes()
16279 {
16280 void * __ecereTemp1;
16281 struct External * external;
16282 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16283
16284 currentClass = (((void *)0));
16285 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16286 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16288 curExternal = temp;
16289 DeclareStruct("ecere::com::Class", 0x0);
16290 DeclareStruct("ecere::com::Instance", 0x0);
16291 DeclareStruct("ecere::com::Property", 0x0);
16292 DeclareStruct("ecere::com::DataMember", 0x0);
16293 DeclareStruct("ecere::com::Method", 0x0);
16294 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16295 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16297 for(external = (*ast).first; external; external = external->next)
16298 {
16299 afterExternal = curExternal = external;
16300 if(external->type == 0)
16301 {
16302 currentClass = external->function->_class;
16303 ProcessFunction(external->function);
16304 }
16305 else if(external->type == 1)
16306 {
16307 currentClass = (((void *)0));
16308 ProcessDeclaration(external->declaration);
16309 }
16310 else if(external->type == 2)
16311 {
16312 struct ClassDefinition * _class = external->_class;
16313
16314 currentClass = external->symbol->registered;
16315 if(_class->definitions)
16316 {
16317 ProcessClass(_class->definitions, _class->symbol);
16318 }
16319 if(inCompiler)
16320 {
16321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16322 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16323 }
16324 }
16325 else if(external->type == 4)
16326 {
16327 thisNameSpace = external->id->string;
16328 }
16329 }
16330 currentClass = (((void *)0));
16331 thisNameSpace = (((void *)0));
16332 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16333 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16334 }
16335
16336 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char *  name, char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
16337
16338 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16339
16340 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16341 {
16342 struct __ecereNameSpace__ecere__com__Class * class;
16343
16344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMemberInitData", "void ProcessMemberInitData(MemberInit member, ecere::com::Class _class, ecere::com::Class * curClass, ecere::com::DataMember * curMember, ecere::com::DataMember * subMemberStack, int * subMemberStackPos)", ProcessMemberInitData, module, 2);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16396 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16397 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16398 __ecereClass_Conversion = class;
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypes", "bool MatchTypes(Type source, Type dest, ecere::sys::OldList conversions, ecere::com::Class owningClassSource, ecere::com::Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams, bool isConversionExploration)", MatchTypes, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchWithEnums_NameSpace", "bool MatchWithEnums_NameSpace(ecere::com::NameSpace nameSpace, Expression sourceExp, Type dest, char * string, ecere::sys::OldList conversions)", MatchWithEnums_NameSpace, module, 2);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchWithEnums_Module", "bool MatchWithEnums_Module(ecere::com::Module mainModule, Expression sourceExp, Type dest, char * string, ecere::sys::OldList conversions)", MatchWithEnums_Module, module, 2);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16419 }
16420
16421 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16422 {
16423
16424 }
16425