i18n: (#858) Handling localization for libraries within static executables
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
52
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
54
55 struct __ecereNameSpace__ecere__sys__BTNode;
56
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
58
59 struct __ecereNameSpace__ecere__sys__BinaryTree
60 {
61 struct __ecereNameSpace__ecere__sys__BTNode * root;
62 int count;
63 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
64 void (*  FreeKey)(void *  key);
65 } __attribute__ ((gcc_struct));
66
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
68
69 struct __ecereNameSpace__ecere__sys__OldList
70 {
71 void *  first;
72 void *  last;
73 int count;
74 unsigned int offset;
75 unsigned int circ;
76 } __attribute__ ((gcc_struct));
77
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
79
80 struct __ecereNameSpace__ecere__com__Method
81 {
82 char *  name;
83 struct __ecereNameSpace__ecere__com__Method * parent;
84 struct __ecereNameSpace__ecere__com__Method * left;
85 struct __ecereNameSpace__ecere__com__Method * right;
86 int depth;
87 int (*  function)();
88 int vid;
89 int type;
90 struct __ecereNameSpace__ecere__com__Class * _class;
91 void *  symbol;
92 char *  dataTypeString;
93 struct Type * dataType;
94 int memberAccess;
95 } __attribute__ ((gcc_struct));
96
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
98
99 struct __ecereNameSpace__ecere__com__Property
100 {
101 struct __ecereNameSpace__ecere__com__Property * prev;
102 struct __ecereNameSpace__ecere__com__Property * next;
103 char *  name;
104 unsigned int isProperty;
105 int memberAccess;
106 int id;
107 struct __ecereNameSpace__ecere__com__Class * _class;
108 char *  dataTypeString;
109 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
110 struct Type * dataType;
111 void (*  Set)(void * , int);
112 int (*  Get)(void * );
113 unsigned int (*  IsSet)(void * );
114 void *  data;
115 void *  symbol;
116 int vid;
117 unsigned int conversion;
118 unsigned int watcherOffset;
119 char *  category;
120 unsigned int compiled;
121 unsigned int selfWatchable;
122 unsigned int isWatchable;
123 } __attribute__ ((gcc_struct));
124
125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
126
127 struct CodePosition
128 {
129 int line;
130 int charPos;
131 int pos;
132 int included;
133 } __attribute__ ((gcc_struct));
134
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
136
137 struct Location
138 {
139 struct CodePosition start;
140 struct CodePosition end;
141 } __attribute__ ((gcc_struct));
142
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
144
145 struct Attrib;
146
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
148
149 struct ExtDecl
150 {
151 struct Location loc;
152 int type;
153 union
154 {
155 char * s;
156 struct Attrib * attr;
157 } __attribute__ ((gcc_struct));
158 } __attribute__ ((gcc_struct));
159
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
161
162 struct ClassDefinition
163 {
164 struct ClassDefinition * prev;
165 struct ClassDefinition * next;
166 struct Location loc;
167 struct Specifier * _class;
168 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
169 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
170 struct Symbol * symbol;
171 struct Location blockStart;
172 struct Location nameLoc;
173 int endid;
174 int declMode;
175 unsigned int deleteWatchable;
176 } __attribute__ ((gcc_struct));
177
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
179
180 struct Context
181 {
182 struct Context * parent;
183 struct __ecereNameSpace__ecere__sys__BinaryTree types;
184 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
185 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
186 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
187 int nextID;
188 int simpleID;
189 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
190 struct ClassDefinition * classDef;
191 unsigned int templateTypesOnly;
192 unsigned int hasNameSpace;
193 } __attribute__ ((gcc_struct));
194
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
196
197 struct Instantiation
198 {
199 struct Instantiation * prev;
200 struct Instantiation * next;
201 struct Location loc;
202 struct Specifier * _class;
203 struct Expression * exp;
204 struct __ecereNameSpace__ecere__sys__OldList *  members;
205 struct Symbol * symbol;
206 unsigned int fullSet;
207 unsigned int isConstant;
208 unsigned char *  data;
209 struct Location nameLoc;
210 struct Location insideLoc;
211 unsigned int built;
212 } __attribute__ ((gcc_struct));
213
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
215
216 struct Declaration
217 {
218 struct Declaration * prev;
219 struct Declaration * next;
220 struct Location loc;
221 int type;
222 union
223 {
224 struct
225 {
226 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
227 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
228 } __attribute__ ((gcc_struct));
229 struct Instantiation * inst;
230 struct
231 {
232 struct Identifier * id;
233 struct Expression * exp;
234 } __attribute__ ((gcc_struct));
235 } __attribute__ ((gcc_struct));
236 struct Specifier * extStorage;
237 struct Symbol * symbol;
238 int declMode;
239 } __attribute__ ((gcc_struct));
240
241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
242
243 struct Statement
244 {
245 struct Statement * prev;
246 struct Statement * next;
247 struct Location loc;
248 int type;
249 union
250 {
251 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
252 struct
253 {
254 struct Identifier * id;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) labeled;
257 struct
258 {
259 struct Expression * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) caseStmt;
262 struct
263 {
264 struct __ecereNameSpace__ecere__sys__OldList * declarations;
265 struct __ecereNameSpace__ecere__sys__OldList * statements;
266 struct Context * context;
267 unsigned int isSwitch;
268 } __attribute__ ((gcc_struct)) compound;
269 struct
270 {
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 struct Statement * elseStmt;
274 } __attribute__ ((gcc_struct)) ifStmt;
275 struct
276 {
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) switchStmt;
280 struct
281 {
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 } __attribute__ ((gcc_struct)) whileStmt;
285 struct
286 {
287 struct __ecereNameSpace__ecere__sys__OldList * exp;
288 struct Statement * stmt;
289 } __attribute__ ((gcc_struct)) doWhile;
290 struct
291 {
292 struct Statement * init;
293 struct Statement * check;
294 struct __ecereNameSpace__ecere__sys__OldList * increment;
295 struct Statement * stmt;
296 } __attribute__ ((gcc_struct)) forStmt;
297 struct
298 {
299 struct Identifier * id;
300 } __attribute__ ((gcc_struct)) gotoStmt;
301 struct
302 {
303 struct Specifier * spec;
304 char * statements;
305 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
307 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
308 } __attribute__ ((gcc_struct)) asmStmt;
309 struct
310 {
311 struct Expression * watcher;
312 struct Expression * object;
313 struct __ecereNameSpace__ecere__sys__OldList * watches;
314 } __attribute__ ((gcc_struct)) _watch;
315 struct
316 {
317 struct Identifier * id;
318 struct __ecereNameSpace__ecere__sys__OldList * exp;
319 struct __ecereNameSpace__ecere__sys__OldList * filter;
320 struct Statement * stmt;
321 } __attribute__ ((gcc_struct)) forEachStmt;
322 struct Declaration * decl;
323 } __attribute__ ((gcc_struct));
324 } __attribute__ ((gcc_struct));
325
326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
327
328 struct TypeName
329 {
330 struct TypeName * prev;
331 struct TypeName * next;
332 struct Location loc;
333 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
334 struct Declarator * declarator;
335 int classObjectType;
336 struct Expression * bitCount;
337 } __attribute__ ((gcc_struct));
338
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
340
341 struct Initializer
342 {
343 struct Initializer * prev;
344 struct Initializer * next;
345 struct Location loc;
346 int type;
347 union
348 {
349 struct Expression * exp;
350 struct __ecereNameSpace__ecere__sys__OldList *  list;
351 } __attribute__ ((gcc_struct));
352 unsigned int isConstant;
353 } __attribute__ ((gcc_struct));
354
355 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
356
357 struct __ecereNameSpace__ecere__com__DataValue
358 {
359 union
360 {
361 char c;
362 unsigned char uc;
363 short s;
364 unsigned short us;
365 int i;
366 unsigned int ui;
367 void *  p;
368 float f;
369 double d;
370 long long i64;
371 uint64 ui64;
372 } __attribute__ ((gcc_struct));
373 } __attribute__ ((gcc_struct));
374
375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
376
377 struct Expression
378 {
379 struct Expression * prev;
380 struct Expression * next;
381 struct Location loc;
382 int type;
383 union
384 {
385 struct
386 {
387 char *  constant;
388 struct Identifier * identifier;
389 } __attribute__ ((gcc_struct));
390 struct Statement * compound;
391 struct Instantiation * instance;
392 char *  string;
393 struct __ecereNameSpace__ecere__sys__OldList *  list;
394 struct
395 {
396 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
397 struct Declarator * decl;
398 } __attribute__ ((gcc_struct)) _classExp;
399 struct
400 {
401 struct Identifier * id;
402 } __attribute__ ((gcc_struct)) classData;
403 struct
404 {
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * arguments;
407 struct Location argLoc;
408 } __attribute__ ((gcc_struct)) call;
409 struct
410 {
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * index;
413 } __attribute__ ((gcc_struct)) index;
414 struct
415 {
416 struct Expression * exp;
417 struct Identifier * member;
418 int memberType;
419 unsigned int thisPtr;
420 } __attribute__ ((gcc_struct)) member;
421 struct
422 {
423 int op;
424 struct Expression * exp1;
425 struct Expression * exp2;
426 } __attribute__ ((gcc_struct)) op;
427 struct TypeName * typeName;
428 struct Specifier * _class;
429 struct
430 {
431 struct TypeName * typeName;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) cast;
434 struct
435 {
436 struct Expression * cond;
437 struct __ecereNameSpace__ecere__sys__OldList * exp;
438 struct Expression * elseExp;
439 } __attribute__ ((gcc_struct)) cond;
440 struct
441 {
442 struct TypeName * typeName;
443 struct Expression * size;
444 } __attribute__ ((gcc_struct)) _new;
445 struct
446 {
447 struct TypeName * typeName;
448 struct Expression * size;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) _renew;
451 struct
452 {
453 char * table;
454 struct Identifier * id;
455 } __attribute__ ((gcc_struct)) db;
456 struct
457 {
458 struct Expression * ds;
459 struct Expression * name;
460 } __attribute__ ((gcc_struct)) dbopen;
461 struct
462 {
463 struct TypeName * typeName;
464 struct Initializer * initializer;
465 } __attribute__ ((gcc_struct)) initializer;
466 struct
467 {
468 struct Expression * exp;
469 struct TypeName * typeName;
470 } __attribute__ ((gcc_struct)) vaArg;
471 } __attribute__ ((gcc_struct));
472 unsigned int debugValue;
473 struct __ecereNameSpace__ecere__com__DataValue val;
474 uint64 address;
475 unsigned int hasAddress;
476 struct Type * expType;
477 struct Type * destType;
478 unsigned int usage;
479 int tempCount;
480 unsigned int byReference;
481 unsigned int isConstant;
482 unsigned int addedThis;
483 unsigned int needCast;
484 unsigned int thisPtr;
485 } __attribute__ ((gcc_struct));
486
487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
488
489 struct TemplateDatatype
490 {
491 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
492 struct Declarator * decl;
493 } __attribute__ ((gcc_struct));
494
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
496
497 struct TemplateArgument;
498
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
500
501 struct TemplateParameter
502 {
503 struct TemplateParameter * prev;
504 struct TemplateParameter * next;
505 struct Location loc;
506 int type;
507 struct Identifier * identifier;
508 union
509 {
510 struct TemplateDatatype * dataType;
511 int memberType;
512 } __attribute__ ((gcc_struct));
513 struct TemplateArgument * defaultArgument;
514 char *  dataTypeString;
515 struct Type * baseType;
516 } __attribute__ ((gcc_struct));
517
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
519
520 struct Specifier
521 {
522 struct Specifier * prev;
523 struct Specifier * next;
524 struct Location loc;
525 int type;
526 union
527 {
528 int specifier;
529 struct
530 {
531 struct ExtDecl * extDecl;
532 char *  name;
533 struct Symbol * symbol;
534 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
535 } __attribute__ ((gcc_struct));
536 struct
537 {
538 struct Identifier * id;
539 struct __ecereNameSpace__ecere__sys__OldList *  list;
540 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
541 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
542 unsigned int addNameSpace;
543 struct Context * ctx;
544 struct ExtDecl * extDeclStruct;
545 } __attribute__ ((gcc_struct));
546 struct Expression * expression;
547 struct Specifier * _class;
548 struct TemplateParameter * templateParameter;
549 } __attribute__ ((gcc_struct));
550 } __attribute__ ((gcc_struct));
551
552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
553
554 struct Identifier
555 {
556 struct Identifier * prev;
557 struct Identifier * next;
558 struct Location loc;
559 struct Symbol * classSym;
560 struct Specifier * _class;
561 char *  string;
562 struct Identifier * badID;
563 } __attribute__ ((gcc_struct));
564
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
566
567 struct Pointer;
568
569 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
570
571 struct Declarator
572 {
573 struct Declarator * prev;
574 struct Declarator * next;
575 struct Location loc;
576 int type;
577 struct Symbol * symbol;
578 struct Declarator * declarator;
579 union
580 {
581 struct Identifier * identifier;
582 struct
583 {
584 struct Expression * exp;
585 struct Expression * posExp;
586 struct Attrib * attrib;
587 } __attribute__ ((gcc_struct)) structDecl;
588 struct
589 {
590 struct Expression * exp;
591 struct Specifier * enumClass;
592 } __attribute__ ((gcc_struct)) array;
593 struct
594 {
595 struct __ecereNameSpace__ecere__sys__OldList * parameters;
596 } __attribute__ ((gcc_struct)) function;
597 struct
598 {
599 struct Pointer * pointer;
600 } __attribute__ ((gcc_struct)) pointer;
601 struct
602 {
603 struct ExtDecl * extended;
604 } __attribute__ ((gcc_struct)) extended;
605 } __attribute__ ((gcc_struct));
606 } __attribute__ ((gcc_struct));
607
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
609
610 struct FunctionDefinition
611 {
612 struct FunctionDefinition * prev;
613 struct FunctionDefinition * next;
614 struct Location loc;
615 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
616 struct Declarator * declarator;
617 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
618 struct Statement * body;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 struct __ecereNameSpace__ecere__sys__OldList attached;
621 int declMode;
622 struct Type * type;
623 struct Symbol * propSet;
624 int tempCount;
625 unsigned int propertyNoThis;
626 } __attribute__ ((gcc_struct));
627
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
629
630 struct DBTableDef;
631
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
633
634 struct External
635 {
636 struct External * prev;
637 struct External * next;
638 struct Location loc;
639 int type;
640 struct Symbol * symbol;
641 union
642 {
643 struct FunctionDefinition * function;
644 struct ClassDefinition * _class;
645 struct Declaration * declaration;
646 char *  importString;
647 struct Identifier * id;
648 struct DBTableDef * table;
649 } __attribute__ ((gcc_struct));
650 int importType;
651 } __attribute__ ((gcc_struct));
652
653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
654
655 struct ModuleImport
656 {
657 struct ModuleImport * prev;
658 struct ModuleImport * next;
659 char *  name;
660 struct __ecereNameSpace__ecere__sys__OldList classes;
661 struct __ecereNameSpace__ecere__sys__OldList functions;
662 int importType;
663 int importAccess;
664 } __attribute__ ((gcc_struct));
665
666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
667
668 struct ClassImport
669 {
670 struct ClassImport * prev;
671 struct ClassImport * next;
672 char *  name;
673 struct __ecereNameSpace__ecere__sys__OldList methods;
674 struct __ecereNameSpace__ecere__sys__OldList properties;
675 unsigned int itself;
676 unsigned int isRemote;
677 } __attribute__ ((gcc_struct));
678
679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
680
681 struct Symbol
682 {
683 char *  string;
684 struct Symbol * parent;
685 struct Symbol * left;
686 struct Symbol * right;
687 int depth;
688 struct Type * type;
689 union
690 {
691 struct __ecereNameSpace__ecere__com__Method * method;
692 struct __ecereNameSpace__ecere__com__Property * _property;
693 struct __ecereNameSpace__ecere__com__Class * registered;
694 } __attribute__ ((gcc_struct));
695 int id;
696 int idCode;
697 union
698 {
699 struct
700 {
701 struct External * pointerExternal;
702 struct External * structExternal;
703 } __attribute__ ((gcc_struct));
704 struct
705 {
706 struct External * externalGet;
707 struct External * externalSet;
708 struct External * externalPtr;
709 struct External * externalIsSet;
710 } __attribute__ ((gcc_struct));
711 struct
712 {
713 struct External * methodExternal;
714 struct External * methodCodeExternal;
715 } __attribute__ ((gcc_struct));
716 } __attribute__ ((gcc_struct));
717 unsigned int imported;
718 unsigned int declaredStructSym;
719 struct __ecereNameSpace__ecere__com__Class * _class;
720 unsigned int declaredStruct;
721 unsigned int needConstructor;
722 unsigned int needDestructor;
723 char *  constructorName;
724 char *  structName;
725 char *  className;
726 char *  destructorName;
727 struct ModuleImport * module;
728 struct ClassImport * _import;
729 struct Location nameLoc;
730 unsigned int isParam;
731 unsigned int isRemote;
732 unsigned int isStruct;
733 unsigned int fireWatchersDone;
734 int declaring;
735 unsigned int classData;
736 unsigned int isStatic;
737 char *  shortName;
738 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
739 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
740 struct Context * ctx;
741 int isIterator;
742 struct Expression * propCategory;
743 } __attribute__ ((gcc_struct));
744
745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
746
747 struct Type
748 {
749 struct Type * prev;
750 struct Type * next;
751 int refCount;
752 union
753 {
754 struct Symbol * _class;
755 struct
756 {
757 struct __ecereNameSpace__ecere__sys__OldList members;
758 char *  enumName;
759 } __attribute__ ((gcc_struct));
760 struct
761 {
762 struct Type * returnType;
763 struct __ecereNameSpace__ecere__sys__OldList params;
764 struct Symbol * thisClass;
765 unsigned int staticMethod;
766 struct TemplateParameter * thisClassTemplate;
767 } __attribute__ ((gcc_struct));
768 struct
769 {
770 struct __ecereNameSpace__ecere__com__Method * method;
771 struct __ecereNameSpace__ecere__com__Class * methodClass;
772 struct __ecereNameSpace__ecere__com__Class * usedClass;
773 } __attribute__ ((gcc_struct));
774 struct
775 {
776 struct Type * arrayType;
777 int arraySize;
778 struct Expression * arraySizeExp;
779 unsigned int freeExp;
780 struct Symbol * enumClass;
781 } __attribute__ ((gcc_struct));
782 struct Type * type;
783 struct TemplateParameter * templateParameter;
784 } __attribute__ ((gcc_struct));
785 int kind;
786 unsigned int size;
787 char *  name;
788 char *  typeName;
789 int classObjectType;
790 int alignment;
791 unsigned int offset;
792 int bitFieldCount;
793 int count;
794 unsigned int isSigned : 1;
795 unsigned int constant : 1;
796 unsigned int truth : 1;
797 unsigned int byReference : 1;
798 unsigned int extraParam : 1;
799 unsigned int directClassAccess : 1;
800 unsigned int computing : 1;
801 unsigned int keepCast : 1;
802 unsigned int passAsTemplate : 1;
803 unsigned int dllExport : 1;
804 unsigned int attrStdcall : 1;
805 unsigned int declaredWithStruct : 1;
806 unsigned int typedByReference : 1;
807 } __attribute__ ((gcc_struct));
808
809 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
810
811 struct __ecereNameSpace__ecere__com__Class
812 {
813 struct __ecereNameSpace__ecere__com__Class * prev;
814 struct __ecereNameSpace__ecere__com__Class * next;
815 char *  name;
816 int offset;
817 int structSize;
818 int (* *  _vTbl)();
819 int vTblSize;
820 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
822 int offsetClass;
823 int sizeClass;
824 struct __ecereNameSpace__ecere__com__Class * base;
825 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
826 struct __ecereNameSpace__ecere__sys__BinaryTree members;
827 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
828 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
829 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
830 struct __ecereNameSpace__ecere__sys__OldList derivatives;
831 int memberID;
832 int startMemberID;
833 int type;
834 struct __ecereNameSpace__ecere__com__Instance * module;
835 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
836 char *  dataTypeString;
837 struct Type * dataType;
838 int typeSize;
839 int defaultAlignment;
840 void (*  Initialize)();
841 int memberOffset;
842 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
843 char *  designerClass;
844 unsigned int noExpansion;
845 char *  defaultProperty;
846 unsigned int comRedefinition;
847 int count;
848 unsigned int isRemote;
849 unsigned int internalDecl;
850 void *  data;
851 unsigned int computeSize;
852 int structAlignment;
853 int destructionWatchOffset;
854 unsigned int fixed;
855 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
856 int inheritanceAccess;
857 char *  fullName;
858 void *  symbol;
859 struct __ecereNameSpace__ecere__sys__OldList conversions;
860 struct __ecereNameSpace__ecere__sys__OldList templateParams;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
862 struct __ecereNameSpace__ecere__com__Class * templateClass;
863 struct __ecereNameSpace__ecere__sys__OldList templatized;
864 int numParams;
865 unsigned int isInstanceClass;
866 unsigned int byValueSystemClass;
867 } __attribute__ ((gcc_struct));
868
869 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
870
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
872
873 struct __ecereNameSpace__ecere__com__Instance
874 {
875 int (* *  _vTbl)();
876 struct __ecereNameSpace__ecere__com__Class * _class;
877 int _refCount;
878 } __attribute__ ((gcc_struct));
879
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
881
882 struct __ecereNameSpace__ecere__com__DataMember
883 {
884 struct __ecereNameSpace__ecere__com__DataMember * prev;
885 struct __ecereNameSpace__ecere__com__DataMember * next;
886 char *  name;
887 unsigned int isProperty;
888 int memberAccess;
889 int id;
890 struct __ecereNameSpace__ecere__com__Class * _class;
891 char *  dataTypeString;
892 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
893 struct Type * dataType;
894 int type;
895 int offset;
896 int memberID;
897 struct __ecereNameSpace__ecere__sys__OldList members;
898 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
899 int memberOffset;
900 int structAlignment;
901 } __attribute__ ((gcc_struct));
902
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
904
905 struct __ecereNameSpace__ecere__com__SerialBuffer
906 {
907 unsigned char *  _buffer;
908 unsigned int count;
909 unsigned int _size;
910 unsigned int pos;
911 } __attribute__ ((gcc_struct));
912
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
914
915 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
916 {
917 union
918 {
919 struct
920 {
921 char *  dataTypeString;
922 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
923 } __attribute__ ((gcc_struct));
924 struct __ecereNameSpace__ecere__com__DataValue expression;
925 struct
926 {
927 char *  memberString;
928 union
929 {
930 struct __ecereNameSpace__ecere__com__DataMember * member;
931 struct __ecereNameSpace__ecere__com__Property * prop;
932 struct __ecereNameSpace__ecere__com__Method * method;
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
935 } __attribute__ ((gcc_struct));
936 } __attribute__ ((gcc_struct));
937
938 void exit(int status);
939
940 void * calloc(size_t nmemb, size_t size);
941
942 void free(void * ptr);
943
944 void * malloc(size_t size);
945
946 void * realloc(void * ptr, size_t size);
947
948 long int strtol(const char * nptr, char ** endptr, int base);
949
950 long long int strtoll(const char * nptr, char ** endptr, int base);
951
952 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
953
954 enum yytokentype
955 {
956 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
957 };
958
959 typedef union YYSTYPE
960 {
961 int specifierType;
962 int i;
963 int declMode;
964 struct Identifier * id;
965 struct Expression * exp;
966 struct Specifier * specifier;
967 struct __ecereNameSpace__ecere__sys__OldList * list;
968 struct Enumerator * enumerator;
969 struct Declarator * declarator;
970 struct Pointer * pointer;
971 struct Initializer * initializer;
972 struct InitDeclarator * initDeclarator;
973 struct TypeName * typeName;
974 struct Declaration * declaration;
975 struct Statement * stmt;
976 struct FunctionDefinition * function;
977 struct External * external;
978 struct Context * context;
979 struct AsmField * asmField;
980 struct Attrib * attrib;
981 struct ExtDecl * extDecl;
982 struct Attribute * attribute;
983 struct Instantiation * instance;
984 struct MembersInit * membersInit;
985 struct MemberInit * memberInit;
986 struct ClassFunction * classFunction;
987 struct ClassDefinition * _class;
988 struct ClassDef * classDef;
989 struct PropertyDef * prop;
990 char * string;
991 struct Symbol * symbol;
992 struct PropertyWatch * propertyWatch;
993 struct TemplateParameter * templateParameter;
994 struct TemplateArgument * templateArgument;
995 struct TemplateDatatype * templateDatatype;
996 struct DBTableEntry * dbtableEntry;
997 struct DBIndexItem * dbindexItem;
998 struct DBTableDef * dbtableDef;
999 } __attribute__ ((gcc_struct)) YYSTYPE;
1000
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1002
1003 struct Enumerator
1004 {
1005 struct Enumerator * prev;
1006 struct Enumerator * next;
1007 struct Location loc;
1008 struct Identifier * id;
1009 struct Expression * exp;
1010 } __attribute__ ((gcc_struct));
1011
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1013
1014 struct InitDeclarator
1015 {
1016 struct InitDeclarator * prev;
1017 struct InitDeclarator * next;
1018 struct Location loc;
1019 struct Declarator * declarator;
1020 struct Initializer * initializer;
1021 } __attribute__ ((gcc_struct));
1022
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1024
1025 struct AsmField
1026 {
1027 struct AsmField * prev;
1028 struct AsmField * next;
1029 struct Location loc;
1030 char *  command;
1031 struct Expression * expression;
1032 struct Identifier * symbolic;
1033 } __attribute__ ((gcc_struct));
1034
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1036
1037 struct Attribute;
1038
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1040
1041 struct ClassFunction
1042 {
1043 struct ClassFunction * prev;
1044 struct ClassFunction * next;
1045 struct Location loc;
1046 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1047 struct Declarator * declarator;
1048 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1049 struct Statement * body;
1050 struct __ecereNameSpace__ecere__com__Class * _class;
1051 struct __ecereNameSpace__ecere__sys__OldList attached;
1052 int declMode;
1053 struct Type * type;
1054 struct Symbol * propSet;
1055 unsigned int isVirtual;
1056 unsigned int isConstructor;
1057 unsigned int isDestructor;
1058 unsigned int dontMangle;
1059 int id;
1060 int idCode;
1061 } __attribute__ ((gcc_struct));
1062
1063 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1064
1065 struct MembersInit
1066 {
1067 struct MembersInit * prev;
1068 struct MembersInit * next;
1069 struct Location loc;
1070 int type;
1071 union
1072 {
1073 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1074 struct ClassFunction * function;
1075 } __attribute__ ((gcc_struct));
1076 } __attribute__ ((gcc_struct));
1077
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1079
1080 struct MemberInit
1081 {
1082 struct MemberInit * prev;
1083 struct MemberInit * next;
1084 struct Location loc;
1085 struct Location realLoc;
1086 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1087 struct Initializer * initializer;
1088 unsigned int used;
1089 unsigned int variable;
1090 unsigned int takeOutExp;
1091 } __attribute__ ((gcc_struct));
1092
1093 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1094
1095 struct PropertyDef
1096 {
1097 struct PropertyDef * prev;
1098 struct PropertyDef * next;
1099 struct Location loc;
1100 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1101 struct Declarator * declarator;
1102 struct Identifier * id;
1103 struct Statement * getStmt;
1104 struct Statement * setStmt;
1105 struct Statement * issetStmt;
1106 struct Symbol * symbol;
1107 unsigned int conversion;
1108 unsigned int isWatchable;
1109 struct Expression * category;
1110 } __attribute__ ((gcc_struct));
1111
1112 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1113
1114 struct PropertyWatch
1115 {
1116 struct PropertyWatch * prev;
1117 struct PropertyWatch * next;
1118 struct Location loc;
1119 struct Statement * compound;
1120 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1121 unsigned int deleteWatch;
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1125
1126 struct ClassDef
1127 {
1128 struct ClassDef * prev;
1129 struct ClassDef * next;
1130 struct Location loc;
1131 int type;
1132 union
1133 {
1134 struct Declaration * decl;
1135 struct ClassFunction * function;
1136 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1137 struct PropertyDef * propertyDef;
1138 struct PropertyWatch * propertyWatch;
1139 char *  designer;
1140 struct Identifier * defaultProperty;
1141 struct
1142 {
1143 struct Identifier * id;
1144 struct Initializer * initializer;
1145 } __attribute__ ((gcc_struct));
1146 } __attribute__ ((gcc_struct));
1147 int memberAccess;
1148 void *  object;
1149 } __attribute__ ((gcc_struct));
1150
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1152
1153 struct DBTableEntry;
1154
1155 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1156
1157 struct DBIndexItem;
1158
1159 extern YYSTYPE yylval;
1160
1161 extern struct Location yylloc;
1162
1163 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1164
1165 extern int returnCode;
1166
1167 extern struct Expression * parsedExpression;
1168
1169 extern unsigned int yydebug;
1170
1171 void SetYydebug(unsigned int b)
1172 {
1173 yydebug = b;
1174 }
1175
1176 extern unsigned int echoOn;
1177
1178 void resetScanner();
1179
1180 int propWatcherID;
1181
1182 int expression_yyparse();
1183
1184 static struct Statement * curCompound;
1185
1186 struct External * curExternal, * afterExternal;
1187
1188 static struct Type * curSwitchType;
1189
1190 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1191
1192 struct __ecereNameSpace__ecere__com__Class * thisClass;
1193
1194 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1195 {
1196 thisClass = c;
1197 }
1198
1199 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1200 {
1201 return thisClass;
1202 }
1203
1204 static char * thisNameSpace;
1205
1206 struct __ecereNameSpace__ecere__com__Class * containerClass;
1207
1208 unsigned int thisClassParams = 0x1;
1209
1210 unsigned int internalValueCounter;
1211
1212 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1213
1214 extern size_t strlen(const char * );
1215
1216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1217
1218 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1219
1220 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1221
1222 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1223
1224 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1225
1226 void PrintExpression(struct Expression * exp, char * string)
1227 {
1228 {
1229 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1230 int count;
1231
1232 if(exp)
1233 OutputExpression(exp, f);
1234 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1235 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1236
1237 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1238 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1239 count = strlen(string);
1240 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1241 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1242
1243 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1244 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1245 string[count] = '\0';
1246 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1247 }
1248 }
1249
1250 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1251
1252 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1253
1254 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1255 {
1256 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1257 {
1258 if(!param->baseType)
1259 {
1260 if(param->dataTypeString)
1261 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1262 else
1263 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1264 }
1265 return param->baseType;
1266 }
1267 return (((void *)0));
1268 }
1269
1270 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1271 {
1272 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1273 return 0x1;
1274 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1275 {
1276 return 0x0;
1277 }
1278 if(type1->kind == type2->kind)
1279 {
1280 switch(type1->kind)
1281 {
1282 case 24:
1283 case 1:
1284 case 2:
1285 case 3:
1286 case 4:
1287 case 22:
1288 case 23:
1289 if(type1->passAsTemplate && !type2->passAsTemplate)
1290 return 0x1;
1291 return type1->isSigned != type2->isSigned;
1292 case 8:
1293 return type1->_class != type2->_class;
1294 case 13:
1295 return NeedCast(type1->type, type2->type);
1296 default:
1297 return 0x1;
1298 }
1299 }
1300 return 0x1;
1301 }
1302
1303 extern int strcmp(const char * , const char * );
1304
1305 extern struct Context * curContext;
1306
1307 extern struct Context * topContext;
1308
1309 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1310
1311 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);
1312
1313 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1314
1315 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);
1316
1317 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);
1318
1319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1320
1321 struct __ecereNameSpace__ecere__com__ClassProperty
1322 {
1323 char *  name;
1324 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1325 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1326 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1327 int depth;
1328 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1329 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1330 char *  dataTypeString;
1331 struct Type * dataType;
1332 unsigned int constant;
1333 } __attribute__ ((gcc_struct));
1334
1335 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1336
1337 extern struct Expression * QMkExpId(char *  id);
1338
1339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1340
1341 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1342 {
1343 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1344 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1345 char *  name;
1346 int type;
1347 union
1348 {
1349 char *  dataTypeString;
1350 int memberType;
1351 } __attribute__ ((gcc_struct));
1352 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1353 void *  param;
1354 } __attribute__ ((gcc_struct));
1355
1356 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1357
1358 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1359
1360 extern void FreeIdentifier(struct Identifier * id);
1361
1362 void ProcessExpressionType(struct Expression * exp);
1363
1364 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1365
1366 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1367
1368 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1369
1370 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1371
1372 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1373
1374 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1375
1376 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1377
1378 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1379
1380 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1381 {
1382 if(exp->type == 0 && exp->identifier)
1383 {
1384 struct Identifier * id = exp->identifier;
1385 struct Context * ctx;
1386 struct Symbol * symbol = (((void *)0));
1387
1388 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1389 {
1390 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1391 {
1392 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1393 if(symbol)
1394 break;
1395 }
1396 }
1397 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1398 {
1399 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1400 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1401 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1402 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1403
1404 if(!prop)
1405 {
1406 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1407 }
1408 if(!prop && !method)
1409 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1410 if(!prop && !method && !member)
1411 {
1412 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1413 }
1414 if(prop || method || member || classProp)
1415 {
1416 exp->type = 8;
1417 exp->member.member = id;
1418 exp->member.memberType = 0;
1419 exp->member.exp = QMkExpId("this");
1420 exp->addedThis = 0x1;
1421 }
1422 else if(_class && _class->templateParams.first)
1423 {
1424 struct __ecereNameSpace__ecere__com__Class * sClass;
1425
1426 for(sClass = _class; sClass; sClass = sClass->base)
1427 {
1428 if(sClass->templateParams.first)
1429 {
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1431
1432 for(param = sClass->templateParams.first; param; param = param->next)
1433 {
1434 if(param->type == 2 && !strcmp(param->name, id->string))
1435 {
1436 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1437
1438 if(argExp)
1439 {
1440 struct Declarator * decl;
1441 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1442
1443 FreeIdentifier(exp->member.member);
1444 ProcessExpressionType(argExp);
1445 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1446 exp->expType = ProcessType(specs, decl);
1447 exp->type = 5;
1448 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1449 }
1450 }
1451 }
1452 }
1453 }
1454 }
1455 }
1456 }
1457 }
1458
1459 extern int sprintf(char * , char * , ...);
1460
1461 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1462
1463 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1464
1465 char * PrintInt(long long result)
1466 {
1467 char temp[100];
1468
1469 if(result > (((long long)0x7fffffffffffffffLL)))
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1471 else
1472 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1473 return __ecereNameSpace__ecere__sys__CopyString(temp);
1474 }
1475
1476 char * PrintUInt(uint64 result)
1477 {
1478 char temp[100];
1479
1480 if(result > (0xffffffff))
1481 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1482 else if(result > (((int)0x7fffffff)))
1483 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1484 else
1485 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1486 return __ecereNameSpace__ecere__sys__CopyString(temp);
1487 }
1488
1489 char * PrintInt64(long long result)
1490 {
1491 char temp[100];
1492
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1494 return __ecereNameSpace__ecere__sys__CopyString(temp);
1495 }
1496
1497 char * PrintUInt64(uint64 result)
1498 {
1499 char temp[100];
1500
1501 if(result > (((long long)0x7fffffffffffffffLL)))
1502 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1503 else
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1505 return __ecereNameSpace__ecere__sys__CopyString(temp);
1506 }
1507
1508 char * PrintHexUInt(uint64 result)
1509 {
1510 char temp[100];
1511
1512 if(result > (0xffffffff))
1513 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1514 else
1515 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1516 return __ecereNameSpace__ecere__sys__CopyString(temp);
1517 }
1518
1519 char * PrintHexUInt64(uint64 result)
1520 {
1521 char temp[100];
1522
1523 if(result > (0xffffffff))
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1525 else
1526 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1527 return __ecereNameSpace__ecere__sys__CopyString(temp);
1528 }
1529
1530 char * PrintShort(short result)
1531 {
1532 char temp[100];
1533
1534 sprintf(temp, "%d", (unsigned short)result);
1535 return __ecereNameSpace__ecere__sys__CopyString(temp);
1536 }
1537
1538 char * PrintUShort(unsigned short result)
1539 {
1540 char temp[100];
1541
1542 if(result > (unsigned short)32767)
1543 sprintf(temp, "0x%X", (int)result);
1544 else
1545 sprintf(temp, "%d", (int)result);
1546 return __ecereNameSpace__ecere__sys__CopyString(temp);
1547 }
1548
1549 extern int isprint(int c);
1550
1551 char * PrintChar(char result)
1552 {
1553 char temp[100];
1554
1555 if(result > (char)0 && isprint(result))
1556 sprintf(temp, "'%c'", result);
1557 else if(result < (char)0)
1558 sprintf(temp, "%d", (int)result);
1559 else
1560 sprintf(temp, "0x%X", (unsigned char)result);
1561 return __ecereNameSpace__ecere__sys__CopyString(temp);
1562 }
1563
1564 char * PrintUChar(unsigned char result)
1565 {
1566 char temp[100];
1567
1568 sprintf(temp, "0x%X", result);
1569 return __ecereNameSpace__ecere__sys__CopyString(temp);
1570 }
1571
1572 char * PrintFloat(float result)
1573 {
1574 char temp[350];
1575
1576 sprintf(temp, "%.16ff", result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 }
1579
1580 char * PrintDouble(double result)
1581 {
1582 char temp[350];
1583
1584 sprintf(temp, "%.16f", result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 }
1587
1588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1589
1590 struct OpTable
1591 {
1592 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1598 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1599 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1600 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1612 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (*  Not)(struct Expression *, struct Operand *);
1618 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1627 } __attribute__ ((gcc_struct));
1628
1629 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1630
1631 struct Operand
1632 {
1633 int kind;
1634 struct Type * type;
1635 unsigned int ptrSize;
1636 union
1637 {
1638 char c;
1639 unsigned char uc;
1640 short s;
1641 unsigned short us;
1642 int i;
1643 unsigned int ui;
1644 float f;
1645 double d;
1646 long long i64;
1647 uint64 ui64;
1648 } __attribute__ ((gcc_struct));
1649 struct OpTable ops;
1650 } __attribute__ ((gcc_struct));
1651
1652 struct Operand GetOperand(struct Expression * exp);
1653
1654 unsigned int GetInt(struct Expression * exp, int * value2)
1655 {
1656 struct Operand op2 = GetOperand(exp);
1657
1658 if(op2.kind == 3 && op2.type->isSigned)
1659 *value2 = op2.i;
1660 else if(op2.kind == 3)
1661 *value2 = (int)op2.ui;
1662 else if(op2.kind == 4 && op2.type->isSigned)
1663 *value2 = (int)op2.i64;
1664 else if(op2.kind == 4)
1665 *value2 = (int)op2.ui64;
1666 else if(op2.kind == 23 && op2.type->isSigned)
1667 *value2 = (int)op2.i64;
1668 else if(op2.kind == 23)
1669 *value2 = (int)op2.ui64;
1670 else if(op2.kind == 22 && op2.type->isSigned)
1671 *value2 = (int)op2.i64;
1672 else if(op2.kind == 22)
1673 *value2 = (int)op2.ui64;
1674 else if(op2.kind == 2 && op2.type->isSigned)
1675 *value2 = (int)op2.s;
1676 else if(op2.kind == 2)
1677 *value2 = (int)op2.us;
1678 else if(op2.kind == 1 && op2.type->isSigned)
1679 *value2 = (int)op2.c;
1680 else if(op2.kind == 24 || op2.kind == 1)
1681 *value2 = (int)op2.uc;
1682 else if(op2.kind == 6)
1683 *value2 = (int)op2.f;
1684 else if(op2.kind == 7)
1685 *value2 = (int)op2.d;
1686 else if(op2.kind == 13)
1687 *value2 = (int)op2.ui64;
1688 else
1689 return 0x0;
1690 return 0x1;
1691 }
1692
1693 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1694 {
1695 struct Operand op2 = GetOperand(exp);
1696
1697 if(op2.kind == 3 && op2.type->isSigned)
1698 *value2 = (unsigned int)op2.i;
1699 else if(op2.kind == 3)
1700 *value2 = op2.ui;
1701 else if(op2.kind == 4 && op2.type->isSigned)
1702 *value2 = (unsigned int)op2.i64;
1703 else if(op2.kind == 4)
1704 *value2 = (unsigned int)op2.ui64;
1705 else if(op2.kind == 23 && op2.type->isSigned)
1706 *value2 = (unsigned int)op2.i64;
1707 else if(op2.kind == 23)
1708 *value2 = (unsigned int)op2.ui64;
1709 else if(op2.kind == 22 && op2.type->isSigned)
1710 *value2 = (unsigned int)op2.i64;
1711 else if(op2.kind == 22)
1712 *value2 = (unsigned int)op2.ui64;
1713 else if(op2.kind == 2 && op2.type->isSigned)
1714 *value2 = (unsigned int)op2.s;
1715 else if(op2.kind == 2)
1716 *value2 = (unsigned int)op2.us;
1717 else if(op2.kind == 1 && op2.type->isSigned)
1718 *value2 = (unsigned int)op2.c;
1719 else if(op2.kind == 24 || op2.kind == 1)
1720 *value2 = (unsigned int)op2.uc;
1721 else if(op2.kind == 6)
1722 *value2 = (unsigned int)op2.f;
1723 else if(op2.kind == 7)
1724 *value2 = (unsigned int)op2.d;
1725 else if(op2.kind == 13)
1726 *value2 = (unsigned int)op2.ui64;
1727 else
1728 return 0x0;
1729 return 0x1;
1730 }
1731
1732 unsigned int GetInt64(struct Expression * exp, long long * value2)
1733 {
1734 struct Operand op2 = GetOperand(exp);
1735
1736 if(op2.kind == 3 && op2.type->isSigned)
1737 *value2 = (long long)op2.i;
1738 else if(op2.kind == 3)
1739 *value2 = (long long)op2.ui;
1740 else if(op2.kind == 4 && op2.type->isSigned)
1741 *value2 = op2.i64;
1742 else if(op2.kind == 4)
1743 *value2 = (long long)op2.ui64;
1744 else if(op2.kind == 23 && op2.type->isSigned)
1745 *value2 = op2.i64;
1746 else if(op2.kind == 23)
1747 *value2 = (long long)op2.ui64;
1748 else if(op2.kind == 22 && op2.type->isSigned)
1749 *value2 = op2.i64;
1750 else if(op2.kind == 22)
1751 *value2 = (long long)op2.ui64;
1752 else if(op2.kind == 2 && op2.type->isSigned)
1753 *value2 = (long long)op2.s;
1754 else if(op2.kind == 2)
1755 *value2 = (long long)op2.us;
1756 else if(op2.kind == 1 && op2.type->isSigned)
1757 *value2 = (long long)op2.c;
1758 else if(op2.kind == 24 || op2.kind == 1)
1759 *value2 = (long long)op2.uc;
1760 else if(op2.kind == 6)
1761 *value2 = (long long)op2.f;
1762 else if(op2.kind == 7)
1763 *value2 = (long long)op2.d;
1764 else if(op2.kind == 13)
1765 *value2 = (long long)op2.ui64;
1766 else
1767 return 0x0;
1768 return 0x1;
1769 }
1770
1771 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1772 {
1773 struct Operand op2 = GetOperand(exp);
1774
1775 if(op2.kind == 3 && op2.type->isSigned)
1776 *value2 = (uint64)op2.i;
1777 else if(op2.kind == 3)
1778 *value2 = (uint64)op2.ui;
1779 else if(op2.kind == 4 && op2.type->isSigned)
1780 *value2 = (uint64)op2.i64;
1781 else if(op2.kind == 4)
1782 *value2 = op2.ui64;
1783 else if(op2.kind == 23 && op2.type->isSigned)
1784 *value2 = (uint64)op2.i64;
1785 else if(op2.kind == 23)
1786 *value2 = op2.ui64;
1787 else if(op2.kind == 22 && op2.type->isSigned)
1788 *value2 = (uint64)op2.i64;
1789 else if(op2.kind == 22)
1790 *value2 = op2.ui64;
1791 else if(op2.kind == 2 && op2.type->isSigned)
1792 *value2 = (uint64)op2.s;
1793 else if(op2.kind == 2)
1794 *value2 = (uint64)op2.us;
1795 else if(op2.kind == 1 && op2.type->isSigned)
1796 *value2 = (uint64)op2.c;
1797 else if(op2.kind == 24 || op2.kind == 1)
1798 *value2 = (uint64)op2.uc;
1799 else if(op2.kind == 6)
1800 *value2 = (uint64)op2.f;
1801 else if(op2.kind == 7)
1802 *value2 = (uint64)op2.d;
1803 else if(op2.kind == 13)
1804 *value2 = op2.ui64;
1805 else
1806 return 0x0;
1807 return 0x1;
1808 }
1809
1810 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1811 {
1812 struct Operand op2 = GetOperand(exp);
1813
1814 if(op2.kind == 3 && op2.type->isSigned)
1815 *value2 = (intptr_t)op2.i;
1816 else if(op2.kind == 3)
1817 *value2 = (intptr_t)op2.ui;
1818 else if(op2.kind == 4 && op2.type->isSigned)
1819 *value2 = (intptr_t)op2.i64;
1820 else if(op2.kind == 4)
1821 *value2 = (intptr_t)op2.ui64;
1822 else if(op2.kind == 23 && op2.type->isSigned)
1823 *value2 = (intptr_t)op2.i64;
1824 else if(op2.kind == 23)
1825 *value2 = (intptr_t)op2.ui64;
1826 else if(op2.kind == 22 && op2.type->isSigned)
1827 *value2 = (intptr_t)op2.i64;
1828 else if(op2.kind == 22)
1829 *value2 = (intptr_t)op2.ui64;
1830 else if(op2.kind == 2 && op2.type->isSigned)
1831 *value2 = (intptr_t)op2.s;
1832 else if(op2.kind == 2)
1833 *value2 = (intptr_t)op2.us;
1834 else if(op2.kind == 1 && op2.type->isSigned)
1835 *value2 = (intptr_t)op2.c;
1836 else if(op2.kind == 24 || op2.kind == 1)
1837 *value2 = (intptr_t)op2.uc;
1838 else if(op2.kind == 6)
1839 *value2 = (intptr_t)op2.f;
1840 else if(op2.kind == 7)
1841 *value2 = (intptr_t)op2.d;
1842 else if(op2.kind == 13)
1843 *value2 = (intptr_t)op2.ui64;
1844 else
1845 return 0x0;
1846 return 0x1;
1847 }
1848
1849 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1850 {
1851 struct Operand op2 = GetOperand(exp);
1852
1853 if(op2.kind == 3 && op2.type->isSigned)
1854 *value2 = (uintptr_t)op2.i;
1855 else if(op2.kind == 3)
1856 *value2 = (uintptr_t)op2.ui;
1857 else if(op2.kind == 4 && op2.type->isSigned)
1858 *value2 = (uintptr_t)op2.i64;
1859 else if(op2.kind == 4)
1860 *value2 = (uintptr_t)op2.ui64;
1861 else if(op2.kind == 23 && op2.type->isSigned)
1862 *value2 = (uintptr_t)op2.i64;
1863 else if(op2.kind == 23)
1864 *value2 = (uintptr_t)op2.ui64;
1865 else if(op2.kind == 22 && op2.type->isSigned)
1866 *value2 = (uintptr_t)op2.i64;
1867 else if(op2.kind == 22)
1868 *value2 = (uintptr_t)op2.ui64;
1869 else if(op2.kind == 2 && op2.type->isSigned)
1870 *value2 = (uintptr_t)op2.s;
1871 else if(op2.kind == 2)
1872 *value2 = (uintptr_t)op2.us;
1873 else if(op2.kind == 1 && op2.type->isSigned)
1874 *value2 = (uintptr_t)op2.c;
1875 else if(op2.kind == 24 || op2.kind == 1)
1876 *value2 = (uintptr_t)op2.uc;
1877 else if(op2.kind == 6)
1878 *value2 = (uintptr_t)op2.f;
1879 else if(op2.kind == 7)
1880 *value2 = (uintptr_t)op2.d;
1881 else if(op2.kind == 13)
1882 *value2 = (uintptr_t)op2.ui64;
1883 else
1884 return 0x0;
1885 return 0x1;
1886 }
1887
1888 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1889 {
1890 struct Operand op2 = GetOperand(exp);
1891
1892 if(op2.kind == 3 && op2.type->isSigned)
1893 *value2 = (ssize_t)op2.i;
1894 else if(op2.kind == 3)
1895 *value2 = (ssize_t)op2.ui;
1896 else if(op2.kind == 4 && op2.type->isSigned)
1897 *value2 = (ssize_t)op2.i64;
1898 else if(op2.kind == 4)
1899 *value2 = (ssize_t)op2.ui64;
1900 else if(op2.kind == 23 && op2.type->isSigned)
1901 *value2 = (ssize_t)op2.i64;
1902 else if(op2.kind == 23)
1903 *value2 = (ssize_t)op2.ui64;
1904 else if(op2.kind == 22 && op2.type->isSigned)
1905 *value2 = (ssize_t)op2.i64;
1906 else if(op2.kind == 22)
1907 *value2 = (ssize_t)op2.ui64;
1908 else if(op2.kind == 2 && op2.type->isSigned)
1909 *value2 = (ssize_t)op2.s;
1910 else if(op2.kind == 2)
1911 *value2 = (ssize_t)op2.us;
1912 else if(op2.kind == 1 && op2.type->isSigned)
1913 *value2 = (ssize_t)op2.c;
1914 else if(op2.kind == 24 || op2.kind == 1)
1915 *value2 = (ssize_t)op2.uc;
1916 else if(op2.kind == 6)
1917 *value2 = (ssize_t)op2.f;
1918 else if(op2.kind == 7)
1919 *value2 = (ssize_t)op2.d;
1920 else if(op2.kind == 13)
1921 *value2 = (ssize_t)op2.ui64;
1922 else
1923 return 0x0;
1924 return 0x1;
1925 }
1926
1927 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1928 {
1929 struct Operand op2 = GetOperand(exp);
1930
1931 if(op2.kind == 3 && op2.type->isSigned)
1932 *value2 = (size_t)op2.i;
1933 else if(op2.kind == 3)
1934 *value2 = (size_t)op2.ui;
1935 else if(op2.kind == 4 && op2.type->isSigned)
1936 *value2 = (size_t)op2.i64;
1937 else if(op2.kind == 4)
1938 *value2 = (size_t)op2.ui64;
1939 else if(op2.kind == 23 && op2.type->isSigned)
1940 *value2 = (size_t)op2.i64;
1941 else if(op2.kind == 23)
1942 *value2 = (size_t)op2.ui64;
1943 else if(op2.kind == 22 && op2.type->isSigned)
1944 *value2 = (size_t)op2.i64;
1945 else if(op2.kind == 22)
1946 *value2 = (size_t)op2.ui64;
1947 else if(op2.kind == 2 && op2.type->isSigned)
1948 *value2 = (size_t)op2.s;
1949 else if(op2.kind == 2)
1950 *value2 = (size_t)op2.us;
1951 else if(op2.kind == 1 && op2.type->isSigned)
1952 *value2 = (size_t)op2.c;
1953 else if(op2.kind == 24 || op2.kind == 1)
1954 *value2 = (size_t)op2.uc;
1955 else if(op2.kind == 6)
1956 *value2 = (size_t)op2.f;
1957 else if(op2.kind == 7)
1958 *value2 = (size_t)op2.d;
1959 else if(op2.kind == 13)
1960 *value2 = (size_t)op2.ui64;
1961 else
1962 return 0x0;
1963 return 0x1;
1964 }
1965
1966 unsigned int GetShort(struct Expression * exp, short * value2)
1967 {
1968 struct Operand op2 = GetOperand(exp);
1969
1970 if(op2.kind == 3 && op2.type->isSigned)
1971 *value2 = (short)op2.i;
1972 else if(op2.kind == 3)
1973 *value2 = (short)op2.ui;
1974 else if(op2.kind == 4 && op2.type->isSigned)
1975 *value2 = (short)op2.i64;
1976 else if(op2.kind == 4)
1977 *value2 = (short)op2.ui64;
1978 else if(op2.kind == 23 && op2.type->isSigned)
1979 *value2 = (short)op2.i64;
1980 else if(op2.kind == 23)
1981 *value2 = (short)op2.ui64;
1982 else if(op2.kind == 22 && op2.type->isSigned)
1983 *value2 = (short)op2.i64;
1984 else if(op2.kind == 22)
1985 *value2 = (short)op2.ui64;
1986 else if(op2.kind == 2 && op2.type->isSigned)
1987 *value2 = op2.s;
1988 else if(op2.kind == 2)
1989 *value2 = (short)op2.us;
1990 else if(op2.kind == 1 && op2.type->isSigned)
1991 *value2 = (short)op2.c;
1992 else if(op2.kind == 24 || op2.kind == 1)
1993 *value2 = (short)op2.uc;
1994 else if(op2.kind == 6)
1995 *value2 = (short)op2.f;
1996 else if(op2.kind == 7)
1997 *value2 = (short)op2.d;
1998 else if(op2.kind == 13)
1999 *value2 = (short)op2.ui64;
2000 else
2001 return 0x0;
2002 return 0x1;
2003 }
2004
2005 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2006 {
2007 struct Operand op2 = GetOperand(exp);
2008
2009 if(op2.kind == 3 && op2.type->isSigned)
2010 *value2 = (unsigned short)op2.i;
2011 else if(op2.kind == 3)
2012 *value2 = (unsigned short)op2.ui;
2013 else if(op2.kind == 4 && op2.type->isSigned)
2014 *value2 = (unsigned short)op2.i64;
2015 else if(op2.kind == 4)
2016 *value2 = (unsigned short)op2.ui64;
2017 else if(op2.kind == 23 && op2.type->isSigned)
2018 *value2 = (unsigned short)op2.i64;
2019 else if(op2.kind == 23)
2020 *value2 = (unsigned short)op2.ui64;
2021 else if(op2.kind == 22 && op2.type->isSigned)
2022 *value2 = (unsigned short)op2.i64;
2023 else if(op2.kind == 22)
2024 *value2 = (unsigned short)op2.ui64;
2025 else if(op2.kind == 2 && op2.type->isSigned)
2026 *value2 = (unsigned short)op2.s;
2027 else if(op2.kind == 2)
2028 *value2 = op2.us;
2029 else if(op2.kind == 1 && op2.type->isSigned)
2030 *value2 = (unsigned short)op2.c;
2031 else if(op2.kind == 24 || op2.kind == 1)
2032 *value2 = (unsigned short)op2.uc;
2033 else if(op2.kind == 6)
2034 *value2 = (unsigned short)op2.f;
2035 else if(op2.kind == 7)
2036 *value2 = (unsigned short)op2.d;
2037 else if(op2.kind == 13)
2038 *value2 = (unsigned short)op2.ui64;
2039 else
2040 return 0x0;
2041 return 0x1;
2042 }
2043
2044 unsigned int GetChar(struct Expression * exp, char * value2)
2045 {
2046 struct Operand op2 = GetOperand(exp);
2047
2048 if(op2.kind == 3 && op2.type->isSigned)
2049 *value2 = (char)op2.i;
2050 else if(op2.kind == 3)
2051 *value2 = (char)op2.ui;
2052 else if(op2.kind == 4 && op2.type->isSigned)
2053 *value2 = (char)op2.i64;
2054 else if(op2.kind == 4)
2055 *value2 = (char)op2.ui64;
2056 else if(op2.kind == 23 && op2.type->isSigned)
2057 *value2 = (char)op2.i64;
2058 else if(op2.kind == 23)
2059 *value2 = (char)op2.ui64;
2060 else if(op2.kind == 22 && op2.type->isSigned)
2061 *value2 = (char)op2.i64;
2062 else if(op2.kind == 22)
2063 *value2 = (char)op2.ui64;
2064 else if(op2.kind == 2 && op2.type->isSigned)
2065 *value2 = (char)op2.s;
2066 else if(op2.kind == 2)
2067 *value2 = (char)op2.us;
2068 else if(op2.kind == 1 && op2.type->isSigned)
2069 *value2 = op2.c;
2070 else if(op2.kind == 24 || op2.kind == 1)
2071 *value2 = (char)op2.uc;
2072 else if(op2.kind == 6)
2073 *value2 = (char)op2.f;
2074 else if(op2.kind == 7)
2075 *value2 = (char)op2.d;
2076 else if(op2.kind == 13)
2077 *value2 = (char)op2.ui64;
2078 else
2079 return 0x0;
2080 return 0x1;
2081 }
2082
2083 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2084 {
2085 struct Operand op2 = GetOperand(exp);
2086
2087 if(op2.kind == 3 && op2.type->isSigned)
2088 *value2 = (unsigned char)op2.i;
2089 else if(op2.kind == 3)
2090 *value2 = (unsigned char)op2.ui;
2091 else if(op2.kind == 4 && op2.type->isSigned)
2092 *value2 = (unsigned char)op2.i64;
2093 else if(op2.kind == 4)
2094 *value2 = (unsigned char)op2.ui64;
2095 else if(op2.kind == 23 && op2.type->isSigned)
2096 *value2 = (unsigned char)op2.i64;
2097 else if(op2.kind == 23)
2098 *value2 = (unsigned char)op2.ui64;
2099 else if(op2.kind == 22 && op2.type->isSigned)
2100 *value2 = (unsigned char)op2.i64;
2101 else if(op2.kind == 22)
2102 *value2 = (unsigned char)op2.ui64;
2103 else if(op2.kind == 2 && op2.type->isSigned)
2104 *value2 = (unsigned char)op2.s;
2105 else if(op2.kind == 2)
2106 *value2 = (unsigned char)op2.us;
2107 else if(op2.kind == 1 && op2.type->isSigned)
2108 *value2 = (unsigned char)op2.c;
2109 else if(op2.kind == 24 || op2.kind == 1)
2110 *value2 = op2.uc;
2111 else if(op2.kind == 6)
2112 *value2 = (unsigned char)op2.f;
2113 else if(op2.kind == 7)
2114 *value2 = (unsigned char)op2.d;
2115 else if(op2.kind == 13)
2116 *value2 = (unsigned char)op2.ui64;
2117 else
2118 return 0x0;
2119 return 0x1;
2120 }
2121
2122 unsigned int GetFloat(struct Expression * exp, float * value2)
2123 {
2124 struct Operand op2 = GetOperand(exp);
2125
2126 if(op2.kind == 3 && op2.type->isSigned)
2127 *value2 = (float)(float)op2.i;
2128 else if(op2.kind == 3)
2129 *value2 = (float)(float)op2.ui;
2130 else if(op2.kind == 4 && op2.type->isSigned)
2131 *value2 = (float)(float)op2.i64;
2132 else if(op2.kind == 4)
2133 *value2 = (float)(float)op2.ui64;
2134 else if(op2.kind == 23 && op2.type->isSigned)
2135 *value2 = (float)(float)op2.i64;
2136 else if(op2.kind == 23)
2137 *value2 = (float)(float)op2.ui64;
2138 else if(op2.kind == 22 && op2.type->isSigned)
2139 *value2 = (float)(float)op2.i64;
2140 else if(op2.kind == 22)
2141 *value2 = (float)(float)op2.ui64;
2142 else if(op2.kind == 2 && op2.type->isSigned)
2143 *value2 = (float)(float)op2.s;
2144 else if(op2.kind == 2)
2145 *value2 = (float)(float)op2.us;
2146 else if(op2.kind == 1 && op2.type->isSigned)
2147 *value2 = (float)(float)op2.c;
2148 else if(op2.kind == 24 || op2.kind == 1)
2149 *value2 = (float)(float)op2.uc;
2150 else if(op2.kind == 6)
2151 *value2 = (float)op2.f;
2152 else if(op2.kind == 7)
2153 *value2 = (float)op2.d;
2154 else if(op2.kind == 13)
2155 *value2 = (float)(float)op2.ui64;
2156 else
2157 return 0x0;
2158 return 0x1;
2159 }
2160
2161 unsigned int GetDouble(struct Expression * exp, double * value2)
2162 {
2163 struct Operand op2 = GetOperand(exp);
2164
2165 if(op2.kind == 3 && op2.type->isSigned)
2166 *value2 = (double)(double)op2.i;
2167 else if(op2.kind == 3)
2168 *value2 = (double)(double)op2.ui;
2169 else if(op2.kind == 4 && op2.type->isSigned)
2170 *value2 = (double)(double)op2.i64;
2171 else if(op2.kind == 4)
2172 *value2 = (double)(double)op2.ui64;
2173 else if(op2.kind == 23 && op2.type->isSigned)
2174 *value2 = (double)(double)op2.i64;
2175 else if(op2.kind == 23)
2176 *value2 = (double)(double)op2.ui64;
2177 else if(op2.kind == 22 && op2.type->isSigned)
2178 *value2 = (double)(double)op2.i64;
2179 else if(op2.kind == 22)
2180 *value2 = (double)(double)op2.ui64;
2181 else if(op2.kind == 2 && op2.type->isSigned)
2182 *value2 = (double)(double)op2.s;
2183 else if(op2.kind == 2)
2184 *value2 = (double)(double)op2.us;
2185 else if(op2.kind == 1 && op2.type->isSigned)
2186 *value2 = (double)(double)op2.c;
2187 else if(op2.kind == 24 || op2.kind == 1)
2188 *value2 = (double)(double)op2.uc;
2189 else if(op2.kind == 6)
2190 *value2 = (double)op2.f;
2191 else if(op2.kind == 7)
2192 *value2 = (double)op2.d;
2193 else if(op2.kind == 13)
2194 *value2 = (double)(double)op2.ui64;
2195 else
2196 return 0x0;
2197 return 0x1;
2198 }
2199
2200 void ComputeExpression(struct Expression * exp);
2201
2202 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2203
2204 extern int targetBits;
2205
2206 int ComputeTypeSize(struct Type * type);
2207
2208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2209
2210 struct __ecereNameSpace__ecere__com__BitMember
2211 {
2212 struct __ecereNameSpace__ecere__com__BitMember * prev;
2213 struct __ecereNameSpace__ecere__com__BitMember * next;
2214 char *  name;
2215 unsigned int isProperty;
2216 int memberAccess;
2217 int id;
2218 struct __ecereNameSpace__ecere__com__Class * _class;
2219 char *  dataTypeString;
2220 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2221 struct Type * dataType;
2222 int type;
2223 int size;
2224 int pos;
2225 uint64 mask;
2226 } __attribute__ ((gcc_struct));
2227
2228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2229
2230 struct __ecereNameSpace__ecere__sys__OldLink
2231 {
2232 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2233 struct __ecereNameSpace__ecere__sys__OldLink * next;
2234 void *  data;
2235 } __attribute__ ((gcc_struct));
2236
2237 void FinishTemplatesContext(struct Context * context);
2238
2239 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2240 {
2241 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2242 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2243
2244 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2245 {
2246 int c;
2247 int unionMemberOffset = 0;
2248 int bitFields = 0;
2249
2250 if(member)
2251 {
2252 member->memberOffset = 0;
2253 if(targetBits < sizeof(void *) * 8)
2254 member->structAlignment = 0;
2255 }
2256 else if(targetBits < sizeof(void *) * 8)
2257 _class->structAlignment = 0;
2258 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2259 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2260 if(!member && _class->destructionWatchOffset)
2261 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2262 {
2263 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2264
2265 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2266 {
2267 if(!dataMember->isProperty)
2268 {
2269 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2270 {
2271 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2272 }
2273 }
2274 }
2275 }
2276 {
2277 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2278
2279 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2280 {
2281 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2282 {
2283 if(!isMember && _class->type == 2 && dataMember->dataType)
2284 {
2285 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2286 uint64 mask = 0;
2287 int d;
2288
2289 ComputeTypeSize(dataMember->dataType);
2290 if(bitMember->pos == -1)
2291 bitMember->pos = _class->memberOffset;
2292 if(!bitMember->size)
2293 bitMember->size = dataMember->dataType->size * 8;
2294 _class->memberOffset = bitMember->pos + bitMember->size;
2295 for(d = 0; d < bitMember->size; d++)
2296 {
2297 if(d)
2298 mask <<= 1;
2299 mask |= 1;
2300 }
2301 bitMember->mask = mask << bitMember->pos;
2302 }
2303 else if(dataMember->type == 0 && dataMember->dataType)
2304 {
2305 int size;
2306 int alignment = 0;
2307
2308 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2309 ComputeTypeSize(dataMember->dataType);
2310 if(dataMember->dataType->bitFieldCount)
2311 {
2312 bitFields += dataMember->dataType->bitFieldCount;
2313 size = 0;
2314 }
2315 else
2316 {
2317 if(bitFields)
2318 {
2319 int size = (bitFields + 7) / 8;
2320
2321 if(isMember)
2322 {
2323 int __simpleStruct0;
2324
2325 if(alignment)
2326 {
2327 int __simpleStruct0;
2328
2329 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2330 if(member->memberOffset % alignment)
2331 member->memberOffset += alignment - (member->memberOffset % alignment);
2332 }
2333 dataMember->offset = member->memberOffset;
2334 if(member->type == 1)
2335 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2336 else
2337 {
2338 member->memberOffset += size;
2339 }
2340 }
2341 else
2342 {
2343 if(alignment)
2344 {
2345 int __simpleStruct0;
2346
2347 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2348 if(_class->memberOffset % alignment)
2349 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2350 }
2351 dataMember->offset = _class->memberOffset;
2352 _class->memberOffset += size;
2353 }
2354 bitFields = 0;
2355 }
2356 size = dataMember->dataType->size;
2357 alignment = dataMember->dataType->alignment;
2358 }
2359 if(isMember)
2360 {
2361 int __simpleStruct0;
2362
2363 if(alignment)
2364 {
2365 int __simpleStruct0;
2366
2367 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2368 if(member->memberOffset % alignment)
2369 member->memberOffset += alignment - (member->memberOffset % alignment);
2370 }
2371 dataMember->offset = member->memberOffset;
2372 if(member->type == 1)
2373 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2374 else
2375 {
2376 member->memberOffset += size;
2377 }
2378 }
2379 else
2380 {
2381 if(alignment)
2382 {
2383 int __simpleStruct0;
2384
2385 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2386 if(_class->memberOffset % alignment)
2387 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2388 }
2389 dataMember->offset = _class->memberOffset;
2390 _class->memberOffset += size;
2391 }
2392 }
2393 else
2394 {
2395 int alignment;
2396
2397 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2398 alignment = dataMember->structAlignment;
2399 if(isMember)
2400 {
2401 int __simpleStruct0;
2402
2403 if(alignment)
2404 {
2405 int __simpleStruct0;
2406
2407 if(member->memberOffset % alignment)
2408 member->memberOffset += alignment - (member->memberOffset % alignment);
2409 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2410 }
2411 dataMember->offset = member->memberOffset;
2412 if(member->type == 1)
2413 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2414 else
2415 member->memberOffset += dataMember->memberOffset;
2416 }
2417 else
2418 {
2419 if(alignment)
2420 {
2421 int __simpleStruct0;
2422
2423 if(_class->memberOffset % alignment)
2424 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2425 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2426 }
2427 dataMember->offset = _class->memberOffset;
2428 _class->memberOffset += dataMember->memberOffset;
2429 }
2430 }
2431 }
2432 }
2433 if(bitFields)
2434 {
2435 int alignment = 0;
2436 int size = (bitFields + 7) / 8;
2437
2438 if(isMember)
2439 {
2440 int __simpleStruct0;
2441
2442 if(alignment)
2443 {
2444 int __simpleStruct0;
2445
2446 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2447 if(member->memberOffset % alignment)
2448 member->memberOffset += alignment - (member->memberOffset % alignment);
2449 }
2450 if(member->type == 1)
2451 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2452 else
2453 {
2454 member->memberOffset += size;
2455 }
2456 }
2457 else
2458 {
2459 if(alignment)
2460 {
2461 int __simpleStruct0;
2462
2463 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2464 if(_class->memberOffset % alignment)
2465 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2466 }
2467 _class->memberOffset += size;
2468 }
2469 bitFields = 0;
2470 }
2471 }
2472 if(member && member->type == 1)
2473 {
2474 member->memberOffset = unionMemberOffset;
2475 }
2476 if(!isMember)
2477 {
2478 if(_class->type != 2)
2479 {
2480 int extra = 0;
2481
2482 if(_class->structAlignment)
2483 {
2484 if(_class->memberOffset % _class->structAlignment)
2485 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2486 }
2487 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2488 if(!member)
2489 {
2490 struct __ecereNameSpace__ecere__com__Property * prop;
2491
2492 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2493 {
2494 if(prop->isProperty && prop->isWatchable)
2495 {
2496 prop->watcherOffset = _class->structSize;
2497 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2498 }
2499 }
2500 }
2501 {
2502 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2503
2504 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2505 {
2506 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2507
2508 if(deriv->computeSize)
2509 {
2510 deriv->offset = _class->structSize;
2511 deriv->memberOffset = 0;
2512 deriv->structSize = deriv->offset;
2513 ComputeClassMembers(deriv, 0x0);
2514 }
2515 }
2516 }
2517 }
2518 }
2519 }
2520 if(context)
2521 FinishTemplatesContext(context);
2522 }
2523
2524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2525
2526 struct __ecereNameSpace__ecere__com__NameSpace
2527 {
2528 char *  name;
2529 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2530 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2531 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2532 int depth;
2533 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2536 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2537 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2538 } __attribute__ ((gcc_struct));
2539
2540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2541
2542 struct __ecereNameSpace__ecere__com__Module
2543 {
2544 struct __ecereNameSpace__ecere__com__Instance * application;
2545 struct __ecereNameSpace__ecere__sys__OldList classes;
2546 struct __ecereNameSpace__ecere__sys__OldList defines;
2547 struct __ecereNameSpace__ecere__sys__OldList functions;
2548 struct __ecereNameSpace__ecere__sys__OldList modules;
2549 struct __ecereNameSpace__ecere__com__Instance * prev;
2550 struct __ecereNameSpace__ecere__com__Instance * next;
2551 char *  name;
2552 void *  library;
2553 void *  Unload;
2554 int importType;
2555 int origImportType;
2556 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2557 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2558 } __attribute__ ((gcc_struct));
2559
2560 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2561 {
2562 struct __ecereNameSpace__ecere__com__Class * _class;
2563 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2564
2565 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2566 ComputeModuleClasses(subModule->data);
2567 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2568 ComputeClassMembers(_class, 0x0);
2569 }
2570
2571 extern unsigned int inCompiler;
2572
2573 extern void Compiler_Error(char *  format, ...);
2574
2575 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2576
2577 int ComputeTypeSize(struct Type * type)
2578 {
2579 unsigned int size = type ? type->size : 0;
2580
2581 if(!size && type && !type->computing)
2582 {
2583 type->computing = 0x1;
2584 switch(type->kind)
2585 {
2586 case 24:
2587 type->alignment = size = sizeof(char);
2588 break;
2589 case 1:
2590 type->alignment = size = sizeof(char);
2591 break;
2592 case 3:
2593 type->alignment = size = sizeof(int);
2594 break;
2595 case 4:
2596 type->alignment = size = sizeof(long long);
2597 break;
2598 case 22:
2599 type->alignment = size = targetBits / 8;
2600 break;
2601 case 23:
2602 type->alignment = size = targetBits / 8;
2603 break;
2604 case 5:
2605 type->alignment = size = sizeof(long);
2606 break;
2607 case 2:
2608 type->alignment = size = sizeof(short);
2609 break;
2610 case 6:
2611 type->alignment = size = sizeof(float);
2612 break;
2613 case 7:
2614 type->alignment = size = sizeof(double);
2615 break;
2616 case 8:
2617 {
2618 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2619
2620 if(_class && _class->type == 1)
2621 {
2622 ComputeClassMembers(_class, 0x0);
2623 type->alignment = _class->structAlignment;
2624 size = _class->structSize;
2625 if(type->alignment && size % type->alignment)
2626 size += type->alignment - (size % type->alignment);
2627 }
2628 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2629 {
2630 if(!_class->dataType)
2631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2632 size = type->alignment = ComputeTypeSize(_class->dataType);
2633 }
2634 else
2635 size = type->alignment = targetBits / 8;
2636 break;
2637 }
2638 case 13:
2639 case 19:
2640 size = type->alignment = targetBits / 8;
2641 break;
2642 case 12:
2643 if(type->arraySizeExp)
2644 {
2645 ProcessExpressionType(type->arraySizeExp);
2646 ComputeExpression(type->arraySizeExp);
2647 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)))
2648 {
2649 struct Location oldLoc = yylloc;
2650 char expression[10240];
2651
2652 expression[0] = '\0';
2653 type->arraySizeExp->expType = (((void *)0));
2654 yylloc = type->arraySizeExp->loc;
2655 if(inCompiler)
2656 PrintExpression(type->arraySizeExp, expression);
2657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2658 yylloc = oldLoc;
2659 }
2660 GetInt(type->arraySizeExp, &type->arraySize);
2661 }
2662 else if(type->enumClass)
2663 {
2664 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2665 {
2666 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2667 }
2668 else
2669 type->arraySize = 0;
2670 }
2671 else
2672 {
2673 type->arraySize = 0;
2674 }
2675 size = ComputeTypeSize(type->type) * type->arraySize;
2676 if(type->type)
2677 type->alignment = type->type->alignment;
2678 break;
2679 case 9:
2680 {
2681 struct Type * member;
2682
2683 for(member = type->members.first; member; member = member->next)
2684 {
2685 int __simpleStruct0, __simpleStruct1;
2686 unsigned int addSize = ComputeTypeSize(member);
2687
2688 member->offset = size;
2689 if(member->alignment && size % member->alignment)
2690 member->offset += member->alignment - (size % member->alignment);
2691 size = member->offset;
2692 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2693 size += addSize;
2694 }
2695 if(type->alignment && size % type->alignment)
2696 size += type->alignment - (size % type->alignment);
2697 break;
2698 }
2699 case 10:
2700 {
2701 struct Type * member;
2702
2703 for(member = type->members.first; member; member = member->next)
2704 {
2705 int __simpleStruct0, __simpleStruct1;
2706 unsigned int addSize = ComputeTypeSize(member);
2707
2708 member->offset = size;
2709 if(member->alignment && size % member->alignment)
2710 member->offset += member->alignment - (size % member->alignment);
2711 size = member->offset;
2712 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2713 size = ((size > addSize) ? size : addSize);
2714 }
2715 if(type->alignment && size % type->alignment)
2716 size += type->alignment - (size % type->alignment);
2717 break;
2718 }
2719 case 20:
2720 {
2721 struct TemplateParameter * param = type->templateParameter;
2722 struct Type * baseType = ProcessTemplateParameterType(param);
2723
2724 if(baseType)
2725 {
2726 size = ComputeTypeSize(baseType);
2727 type->alignment = baseType->alignment;
2728 }
2729 else
2730 type->alignment = size = sizeof(uint64);
2731 break;
2732 }
2733 case 15:
2734 {
2735 type->alignment = size = sizeof(enum
2736 {
2737 test
2738 });
2739 break;
2740 }
2741 case 21:
2742 {
2743 type->alignment = size = targetBits / 8;
2744 break;
2745 }
2746 }
2747 type->size = size;
2748 type->computing = 0x0;
2749 }
2750 return size;
2751 }
2752
2753 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2754
2755 extern struct Identifier * MkIdentifier(char *  string);
2756
2757 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2758
2759 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2760
2761 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2762
2763 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2764
2765 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2766
2767 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2768
2769 extern void FreeType(struct Type * type);
2770
2771 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2772
2773 extern struct Specifier * MkSpecifier(int specifier);
2774
2775 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2776
2777 extern struct Expression * MkExpConstant(char *  string);
2778
2779 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding)
2780 {
2781 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2782 unsigned int totalSize = 0;
2783 unsigned int maxSize = 0;
2784 int alignment, size;
2785 struct __ecereNameSpace__ecere__com__DataMember * member;
2786 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2787
2788 if(addedPadding)
2789 *addedPadding = 0x0;
2790 if(!isMember && _class->base)
2791 {
2792 maxSize = _class->structSize;
2793 {
2794 if(_class->type == 1 || _class->type == 5)
2795 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2796 else
2797 {
2798 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2799
2800 if(maxSize > baseSize)
2801 maxSize -= baseSize;
2802 else
2803 maxSize = 0;
2804 }
2805 }
2806 }
2807 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2808 {
2809 if(!member->isProperty)
2810 {
2811 switch(member->type)
2812 {
2813 case 0:
2814 {
2815 if(member->dataTypeString)
2816 {
2817 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2818 struct Declarator * decl;
2819
2820 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2821 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2822 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2823 if(!member->dataType)
2824 member->dataType = ProcessType(specs, decl);
2825 ReplaceThisClassSpecifiers(specs, topClass);
2826 {
2827 struct Type * type = ProcessType(specs, decl);
2828
2829 DeclareType(member->dataType, 0x0, 0x0);
2830 FreeType(type);
2831 }
2832 ComputeTypeSize(member->dataType);
2833 size = member->dataType->size;
2834 alignment = member->dataType->alignment;
2835 if(alignment)
2836 {
2837 if(totalSize % alignment)
2838 totalSize += alignment - (totalSize % alignment);
2839 }
2840 totalSize += size;
2841 }
2842 break;
2843 }
2844 case 1:
2845 case 2:
2846 {
2847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2848
2849 size = 0;
2850 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2851 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2852 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2853 alignment = member->structAlignment;
2854 if(alignment)
2855 {
2856 if(totalSize % alignment)
2857 totalSize += alignment - (totalSize % alignment);
2858 }
2859 totalSize += size;
2860 break;
2861 }
2862 }
2863 }
2864 }
2865 if(retSize)
2866 {
2867 unsigned int __simpleStruct0;
2868
2869 if(topMember && topMember->type == 1)
2870 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2871 else
2872 *retSize += totalSize;
2873 }
2874 else if(totalSize < maxSize && _class->type != 1000)
2875 {
2876 int autoPadding = 0;
2877
2878 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2879 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2880 if(totalSize + autoPadding < maxSize)
2881 {
2882 char sizeString[50];
2883
2884 sprintf(sizeString, "%d", maxSize - totalSize);
2885 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2886 if(addedPadding)
2887 *addedPadding = 0x1;
2888 }
2889 }
2890 if(context)
2891 FinishTemplatesContext(context);
2892 return topMember ? topMember->memberID : _class->memberID;
2893 }
2894
2895 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2896 {
2897 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2898 unsigned int totalSize = 0;
2899 struct __ecereNameSpace__ecere__com__DataMember * member;
2900 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2901
2902 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2903 DeclareMembers(_class->base, 0x0);
2904 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2905 {
2906 if(!member->isProperty)
2907 {
2908 switch(member->type)
2909 {
2910 case 0:
2911 {
2912 if(!member->dataType && member->dataTypeString)
2913 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2914 if(member->dataType)
2915 DeclareType(member->dataType, 0x0, 0x0);
2916 break;
2917 }
2918 case 1:
2919 case 2:
2920 {
2921 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2922 break;
2923 }
2924 }
2925 }
2926 }
2927 if(context)
2928 FinishTemplatesContext(context);
2929 return topMember ? topMember->memberID : _class->memberID;
2930 }
2931
2932 extern struct Symbol * FindClass(char *  name);
2933
2934 extern char *  strchr(const char * , int);
2935
2936 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2937
2938 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
2939
2940 extern void FreeClassDef(struct ClassDef * def);
2941
2942 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2943
2944 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2945
2946 extern char *  strcpy(char * , const char * );
2947
2948 extern void MangleClassName(char *  className);
2949
2950 extern void DeclareClass(struct Symbol * classSym, char *  className);
2951
2952 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2953
2954 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2955
2956 void DeclareStruct(char * name, unsigned int skipNoHead)
2957 {
2958 struct External * external = (((void *)0));
2959 struct Symbol * classSym = FindClass(name);
2960
2961 if(!inCompiler || !classSym)
2962 return ;
2963 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2964 return ;
2965 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2966 {
2967 struct Declaration * decl;
2968 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2969 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2970 char structName[1024];
2971
2972 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2973 classSym->declaring++;
2974 if(strchr(classSym->string, '<'))
2975 {
2976 if(classSym->registered->templateClass)
2977 {
2978 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2979 classSym->declaring--;
2980 }
2981 return ;
2982 }
2983 DeclareMembers(classSym->registered, 0x0);
2984 structName[0] = (char)0;
2985 FullClassNameCat(structName, name, 0x0);
2986 if(!skipNoHead)
2987 {
2988 unsigned int addedPadding = 0x0;
2989
2990 classSym->declaredStructSym = 0x1;
2991 declarations = MkList();
2992 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2993 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2994 {
2995 FreeList(declarations, FreeClassDef);
2996 declarations = (((void *)0));
2997 }
2998 }
2999 if(skipNoHead || declarations)
3000 {
3001 if(external && external->declaration)
3002 {
3003 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3004 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3005 {
3006 if(classSym->structExternal)
3007 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3009 classSym->id = curExternal->symbol->idCode;
3010 classSym->idCode = curExternal->symbol->idCode;
3011 }
3012 }
3013 else
3014 {
3015 if(!external)
3016 external = MkExternalDeclaration((((void *)0)));
3017 specifiers = MkList();
3018 declarators = MkList();
3019 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3020 external->declaration = decl = MkDeclaration(specifiers, declarators);
3021 if(decl->symbol && !decl->symbol->pointerExternal)
3022 decl->symbol->pointerExternal = external;
3023 if(classSym->registered && classSym->registered->type == 1)
3024 {
3025 char className[1024];
3026
3027 strcpy(className, "__ecereClass_");
3028 FullClassNameCat(className, classSym->string, 0x1);
3029 MangleClassName(className);
3030 DeclareClass(classSym, className);
3031 external->symbol = classSym;
3032 classSym->pointerExternal = external;
3033 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3034 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3035 }
3036 else
3037 {
3038 char className[1024];
3039
3040 strcpy(className, "__ecereClass_");
3041 FullClassNameCat(className, classSym->string, 0x1);
3042 MangleClassName(className);
3043 classSym->structExternal = external;
3044 DeclareClass(classSym, className);
3045 external->symbol = classSym;
3046 }
3047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3048 }
3049 }
3050 classSym->declaring--;
3051 }
3052 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3053 {
3054 classSym->declaring++;
3055 {
3056 if(classSym->registered)
3057 DeclareMembers(classSym->registered, 0x0);
3058 }
3059 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3060 {
3061 if(classSym->structExternal)
3062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3064 classSym->id = curExternal->symbol->idCode;
3065 classSym->idCode = curExternal->symbol->idCode;
3066 }
3067 classSym->declaring--;
3068 }
3069 }
3070
3071 extern char *  strcat(char * , const char * );
3072
3073 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3074
3075 extern struct ModuleImport * mainModule;
3076
3077 extern struct Specifier * MkSpecifierName(char *  name);
3078
3079 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3080
3081 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3082
3083 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3084
3085 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3086
3087 extern void FreeDeclarator(struct Declarator * decl);
3088
3089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3090
3091 struct PropertyImport
3092 {
3093 struct PropertyImport * prev;
3094 struct PropertyImport * next;
3095 char *  name;
3096 unsigned int isVirtual;
3097 unsigned int hasSet;
3098 unsigned int hasGet;
3099 } __attribute__ ((gcc_struct));
3100
3101 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3102
3103 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3104 {
3105 struct Symbol * symbol = prop->symbol;
3106 char propName[1024];
3107
3108 strcpy(setName, "__ecereProp_");
3109 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3110 strcat(setName, "_Set_");
3111 FullClassNameCat(setName, prop->name, 0x1);
3112 strcpy(getName, "__ecereProp_");
3113 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3114 strcat(getName, "_Get_");
3115 FullClassNameCat(getName, prop->name, 0x1);
3116 strcpy(propName, "__ecereProp_");
3117 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3118 strcat(propName, "_");
3119 FullClassNameCat(propName, prop->name, 0x1);
3120 MangleClassName(getName);
3121 MangleClassName(setName);
3122 MangleClassName(propName);
3123 if(prop->_class->type == 1)
3124 DeclareStruct(prop->_class->fullName, 0x0);
3125 if(!symbol || curExternal->symbol->idCode < symbol->id)
3126 {
3127 unsigned int imported = 0x0;
3128 unsigned int dllImport = 0x0;
3129
3130 if(!symbol || symbol->_import)
3131 {
3132 if(!symbol)
3133 {
3134 struct Symbol * classSym;
3135
3136 if(!prop->_class->symbol)
3137 prop->_class->symbol = FindClass(prop->_class->fullName);
3138 classSym = prop->_class->symbol;
3139 if(classSym && !classSym->_import)
3140 {
3141 struct ModuleImport * module;
3142
3143 if(prop->_class->module)
3144 module = FindModule(prop->_class->module);
3145 else
3146 module = mainModule;
3147 classSym->_import = __extension__ ({
3148 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3149
3150 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3151 });
3152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3153 }
3154 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3155 symbol->_import = (struct ClassImport *)__extension__ ({
3156 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3157
3158 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3159 });
3160 if(classSym)
3161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3162 }
3163 imported = 0x1;
3164 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3165 dllImport = 0x1;
3166 }
3167 if(!symbol->type)
3168 {
3169 struct Context * context = SetupTemplatesContext(prop->_class);
3170
3171 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3172 FinishTemplatesContext(context);
3173 }
3174 if(prop->Get)
3175 {
3176 if(!symbol->externalGet || symbol->externalGet->type == 0)
3177 {
3178 struct Declaration * decl;
3179 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3180 struct Declarator * d;
3181 struct __ecereNameSpace__ecere__sys__OldList * params;
3182 struct Specifier * spec;
3183 struct External * external;
3184 struct Declarator * typeDecl;
3185 unsigned int simple = 0x0;
3186
3187 specifiers = MkList();
3188 declarators = MkList();
3189 params = MkList();
3190 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3191 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3192 if(dllImport)
3193 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3194 {
3195 struct Context * context = SetupTemplatesContext(prop->_class);
3196
3197 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3198 FinishTemplatesContext(context);
3199 }
3200 for(spec = (*specifiers).first; spec; spec = spec->next)
3201 {
3202 if(spec->type == 1)
3203 {
3204 if((!typeDecl || typeDecl->type == 1))
3205 {
3206 struct Symbol * classSym = spec->symbol;
3207
3208 symbol->_class = classSym->registered;
3209 if(classSym->registered && classSym->registered->type == 1)
3210 {
3211 DeclareStruct(spec->name, 0x0);
3212 simple = 0x1;
3213 }
3214 }
3215 }
3216 }
3217 if(!simple)
3218 d = PlugDeclarator(typeDecl, d);
3219 else
3220 {
3221 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3222 specifiers = MkList();
3223 }
3224 d = MkDeclaratorFunction(d, params);
3225 if(dllImport)
3226 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3227 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3229 if(simple)
3230 ListAdd(specifiers, MkSpecifier(VOID));
3231 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3232 decl = MkDeclaration(specifiers, declarators);
3233 external = MkExternalDeclaration(decl);
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3235 external->symbol = symbol;
3236 symbol->externalGet = external;
3237 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3238 if(typeDecl)
3239 FreeDeclarator(typeDecl);
3240 }
3241 else
3242 {
3243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3244 }
3245 }
3246 if(prop->Set)
3247 {
3248 if(!symbol->externalSet || symbol->externalSet->type == 0)
3249 {
3250 struct Declaration * decl;
3251 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3252 struct Declarator * d;
3253 struct __ecereNameSpace__ecere__sys__OldList * params;
3254 struct Specifier * spec;
3255 struct External * external;
3256 struct Declarator * typeDecl;
3257
3258 declarators = MkList();
3259 params = MkList();
3260 if(!prop->conversion || prop->_class->type == 1)
3261 {
3262 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3263 }
3264 specifiers = MkList();
3265 {
3266 struct Context * context = SetupTemplatesContext(prop->_class);
3267
3268 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3269 FinishTemplatesContext(context);
3270 }
3271 ListAdd(params, MkTypeName(specifiers, d));
3272 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3273 if(dllImport)
3274 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3275 d = MkDeclaratorFunction(d, params);
3276 for(spec = (*specifiers).first; spec; spec = spec->next)
3277 {
3278 if(spec->type == 1)
3279 {
3280 if((!typeDecl || typeDecl->type == 1))
3281 {
3282 struct Symbol * classSym = spec->symbol;
3283
3284 symbol->_class = classSym->registered;
3285 if(classSym->registered && classSym->registered->type == 1)
3286 DeclareStruct(spec->name, 0x0);
3287 }
3288 }
3289 }
3290 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3291 specifiers = MkList();
3292 if(dllImport)
3293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3294 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3296 if(!prop->conversion || prop->_class->type == 1)
3297 ListAdd(specifiers, MkSpecifier(VOID));
3298 else
3299 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3300 decl = MkDeclaration(specifiers, declarators);
3301 external = MkExternalDeclaration(decl);
3302 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3303 external->symbol = symbol;
3304 symbol->externalSet = external;
3305 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3306 }
3307 else
3308 {
3309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3310 }
3311 }
3312 if(!symbol->externalPtr)
3313 {
3314 struct Declaration * decl;
3315 struct External * external;
3316 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3317
3318 if(imported)
3319 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3320 else
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3322 ListAdd(specifiers, MkSpecifierName("Property"));
3323 {
3324 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3325
3326 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3327 if(!imported)
3328 {
3329 strcpy(propName, "__ecerePropM_");
3330 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3331 strcat(propName, "_");
3332 FullClassNameCat(propName, prop->name, 0x1);
3333 MangleClassName(propName);
3334 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3335 }
3336 decl = MkDeclaration(specifiers, list);
3337 }
3338 external = MkExternalDeclaration(decl);
3339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3340 external->symbol = symbol;
3341 symbol->externalPtr = external;
3342 }
3343 else
3344 {
3345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3346 }
3347 symbol->id = curExternal->symbol->idCode;
3348 }
3349 }
3350
3351 struct Type * Dereference(struct Type * source)
3352 {
3353 struct Type * type = (((void *)0));
3354
3355 if(source)
3356 {
3357 if(source->kind == 13 || source->kind == 12)
3358 {
3359 type = source->type;
3360 source->type->refCount++;
3361 }
3362 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3363 {
3364 type = __extension__ ({
3365 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3366
3367 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3368 });
3369 }
3370 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3371 {
3372 type = source;
3373 source->refCount++;
3374 }
3375 else
3376 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3377 }
3378 return type;
3379 }
3380
3381 static struct Type * Reference(struct Type * source)
3382 {
3383 struct Type * type = (((void *)0));
3384
3385 if(source)
3386 {
3387 type = __extension__ ({
3388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3389
3390 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3391 });
3392 source->refCount++;
3393 }
3394 return type;
3395 }
3396
3397 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);
3398
3399 extern void *  memcpy(void * , const void * , size_t size);
3400
3401 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3402
3403 extern void FreeExpression(struct Expression * exp);
3404
3405 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3406
3407 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);
3408
3409 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3410
3411 extern struct Type * MkClassType(char *  name);
3412
3413 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);
3414
3415 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)
3416 {
3417 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3418 unsigned int found = 0x0;
3419 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3420 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3421 unsigned int freeType = 0x0;
3422
3423 yylloc = member->loc;
3424 if(!ident)
3425 {
3426 if(curMember)
3427 {
3428 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3429 if(*curMember)
3430 {
3431 found = 0x1;
3432 dataMember = *curMember;
3433 }
3434 }
3435 }
3436 else
3437 {
3438 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3439 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3440 int _subMemberStackPos = 0;
3441
3442 if(!thisMember)
3443 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3444 if(thisMember)
3445 {
3446 dataMember = thisMember;
3447 if(curMember && thisMember->memberAccess == 1)
3448 {
3449 *curMember = thisMember;
3450 *curClass = thisMember->_class;
3451 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3452 *subMemberStackPos = _subMemberStackPos;
3453 }
3454 found = 0x1;
3455 }
3456 else
3457 {
3458 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3459 if(method && method->type == 1)
3460 found = 0x1;
3461 else
3462 method = (((void *)0));
3463 }
3464 }
3465 if(found)
3466 {
3467 struct Type * type = (((void *)0));
3468
3469 if(dataMember)
3470 {
3471 if(!dataMember->dataType && dataMember->dataTypeString)
3472 {
3473 struct Context * context = SetupTemplatesContext(_class);
3474
3475 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3476 FinishTemplatesContext(context);
3477 }
3478 type = dataMember->dataType;
3479 }
3480 else if(method)
3481 {
3482 if(!method->dataType)
3483 ProcessMethodType(method);
3484 type = method->dataType;
3485 }
3486 if(ident && ident->next)
3487 {
3488 for(ident = ident->next; ident && type; ident = ident->next)
3489 {
3490 if(type->kind == 8)
3491 {
3492 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3493 if(!dataMember)
3494 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3495 if(dataMember)
3496 type = dataMember->dataType;
3497 }
3498 else if(type->kind == 9 || type->kind == 10)
3499 {
3500 struct Type * memberType;
3501
3502 for(memberType = type->members.first; memberType; memberType = memberType->next)
3503 {
3504 if(!strcmp(memberType->name, ident->string))
3505 {
3506 type = memberType;
3507 break;
3508 }
3509 }
3510 }
3511 }
3512 }
3513 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3514 {
3515 int id = 0;
3516 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3517 struct __ecereNameSpace__ecere__com__Class * sClass;
3518
3519 for(sClass = _class; sClass; sClass = sClass->base)
3520 {
3521 id = 0;
3522 if(sClass->templateClass)
3523 sClass = sClass->templateClass;
3524 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3525 {
3526 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3527 {
3528 for(sClass = sClass->base; sClass; sClass = sClass->base)
3529 {
3530 if(sClass->templateClass)
3531 sClass = sClass->templateClass;
3532 id += sClass->templateParams.count;
3533 }
3534 break;
3535 }
3536 id++;
3537 }
3538 if(curParam)
3539 break;
3540 }
3541 if(curParam)
3542 {
3543 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3544
3545 if(arg.dataTypeString)
3546 {
3547 type = ProcessTypeString(arg.dataTypeString, 0x0);
3548 freeType = 0x1;
3549 if(type && _class->templateClass)
3550 type->passAsTemplate = 0x1;
3551 if(type)
3552 {
3553 }
3554 }
3555 }
3556 }
3557 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3558 {
3559 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3560 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3561 int c;
3562 int paramCount = 0;
3563 int lastParam = -1;
3564 char templateString[1024];
3565 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3566
3567 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3568 for(cClass = expClass; cClass; cClass = cClass->base)
3569 {
3570 int p = 0;
3571
3572 if(cClass->templateClass)
3573 cClass = cClass->templateClass;
3574 for(param = cClass->templateParams.first; param; param = param->next)
3575 {
3576 int id = p;
3577 struct __ecereNameSpace__ecere__com__Class * sClass;
3578 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3579
3580 for(sClass = cClass->base; sClass; sClass = sClass->base)
3581 {
3582 if(sClass->templateClass)
3583 sClass = sClass->templateClass;
3584 id += sClass->templateParams.count;
3585 }
3586 arg = expClass->templateArgs[id];
3587 for(sClass = _class; sClass; sClass = sClass->base)
3588 {
3589 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3590 int p = 0;
3591 struct __ecereNameSpace__ecere__com__Class * nextClass;
3592
3593 if(sClass->templateClass)
3594 sClass = sClass->templateClass;
3595 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3596 {
3597 if(nextClass->templateClass)
3598 nextClass = nextClass->templateClass;
3599 p += nextClass->templateParams.count;
3600 }
3601 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3602 {
3603 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3604 {
3605 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3606 {
3607 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3608 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3609 break;
3610 }
3611 }
3612 }
3613 }
3614 {
3615 char argument[256];
3616
3617 argument[0] = '\0';
3618 switch(param->type)
3619 {
3620 case 2:
3621 {
3622 char expString[1024];
3623 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3624 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3625 struct Expression * exp;
3626 char * string = PrintHexUInt64(arg.expression.ui64);
3627
3628 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3629 ProcessExpressionType(exp);
3630 ComputeExpression(exp);
3631 expString[0] = '\0';
3632 PrintExpression(exp, expString);
3633 strcat(argument, expString);
3634 FreeExpression(exp);
3635 break;
3636 }
3637 case 1:
3638 {
3639 strcat(argument, arg.member->name);
3640 break;
3641 }
3642 case 0:
3643 {
3644 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3645 strcat(argument, arg.dataTypeString);
3646 break;
3647 }
3648 }
3649 if(argument[0])
3650 {
3651 if(paramCount)
3652 strcat(templateString, ", ");
3653 if(lastParam != p - 1)
3654 {
3655 strcat(templateString, param->name);
3656 strcat(templateString, " = ");
3657 }
3658 strcat(templateString, argument);
3659 paramCount++;
3660 lastParam = p;
3661 }
3662 p++;
3663 }
3664 }
3665 }
3666 {
3667 int len = strlen(templateString);
3668
3669 if(templateString[len - 1] == '<')
3670 len--;
3671 else
3672 {
3673 if(templateString[len - 1] == '>')
3674 templateString[len++] = ' ';
3675 templateString[len++] = '>';
3676 }
3677 templateString[len++] = '\0';
3678 }
3679 {
3680 struct Context * context = SetupTemplatesContext(_class);
3681
3682 if(freeType)
3683 FreeType(type);
3684 type = ProcessTypeString(templateString, 0x0);
3685 freeType = 0x1;
3686 FinishTemplatesContext(context);
3687 }
3688 }
3689 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3690 {
3691 ProcessExpressionType(member->initializer->exp);
3692 if(!member->initializer->exp->expType)
3693 {
3694 if(inCompiler)
3695 {
3696 char expString[10240];
3697
3698 expString[0] = '\0';
3699 PrintExpression(member->initializer->exp, expString);
3700 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3702 }
3703 }
3704 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3705 {
3706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3707 }
3708 }
3709 else if(member->initializer)
3710 {
3711 ProcessInitializer(member->initializer, type);
3712 }
3713 if(freeType)
3714 FreeType(type);
3715 }
3716 else
3717 {
3718 if(_class && _class->type == 3)
3719 {
3720 if(member->initializer)
3721 {
3722 struct Type * type = MkClassType(_class->fullName);
3723
3724 ProcessInitializer(member->initializer, type);
3725 FreeType(type);
3726 }
3727 }
3728 else
3729 {
3730 if(member->initializer)
3731 {
3732 ProcessInitializer(member->initializer, (((void *)0)));
3733 }
3734 if(ident)
3735 {
3736 if(method)
3737 {
3738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3739 }
3740 else if(_class)
3741 {
3742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3743 if(inCompiler)
3744 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3745 }
3746 }
3747 else if(_class)
3748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3749 }
3750 }
3751 }
3752
3753 extern struct Identifier * GetDeclId(struct Declarator * decl);
3754
3755 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);
3756
3757 extern void FreeSpecifier(struct Specifier * spec);
3758
3759 static void ProcessFunction(struct FunctionDefinition * function);
3760
3761 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3762
3763 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3764
3765 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3766
3767 extern void FreeClassFunction(struct ClassFunction * func);
3768
3769 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3770
3771 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3772
3773 void ProcessInstantiationType(struct Instantiation * inst)
3774 {
3775 yylloc = inst->loc;
3776 if(inst->_class)
3777 {
3778 struct MembersInit * members;
3779 struct Symbol * classSym;
3780 struct __ecereNameSpace__ecere__com__Class * _class;
3781
3782 classSym = inst->_class->symbol;
3783 _class = classSym ? classSym->registered : (((void *)0));
3784 if(!_class || _class->type != 5)
3785 DeclareStruct(inst->_class->name, 0x0);
3786 afterExternal = afterExternal ? afterExternal : curExternal;
3787 if(inst->exp)
3788 ProcessExpressionType(inst->exp);
3789 inst->isConstant = 0x1;
3790 if(inst->members)
3791 {
3792 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3793 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3794 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3795 int subMemberStackPos = 0;
3796
3797 for(members = (*inst->members).first; members; members = members->next)
3798 {
3799 switch(members->type)
3800 {
3801 case 1:
3802 {
3803 char name[1024];
3804 static unsigned int instMethodID = 0;
3805 struct External * external = curExternal;
3806 struct Context * context = curContext;
3807 struct Declarator * declarator = members->function->declarator;
3808 struct Identifier * nameID = GetDeclId(declarator);
3809 char * unmangled = nameID ? nameID->string : (((void *)0));
3810 struct Expression * exp;
3811 struct External * createdExternal = (((void *)0));
3812
3813 if(inCompiler)
3814 {
3815 char number[16];
3816
3817 strcpy(name, "__ecereInstMeth_");
3818 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3819 strcat(name, "_");
3820 strcat(name, nameID->string);
3821 strcat(name, "_");
3822 sprintf(number, "_%08d", instMethodID++);
3823 strcat(name, number);
3824 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3825 }
3826 if(declarator)
3827 {
3828 struct Symbol * symbol = declarator->symbol;
3829 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3830
3831 if(method && method->type == 1)
3832 {
3833 symbol->method = method;
3834 ProcessMethodType(method);
3835 if(!symbol->type->thisClass)
3836 {
3837 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3838 {
3839 if(!currentClass->symbol)
3840 currentClass->symbol = FindClass(currentClass->fullName);
3841 symbol->type->thisClass = currentClass->symbol;
3842 }
3843 else
3844 {
3845 if(!_class->symbol)
3846 _class->symbol = FindClass(_class->fullName);
3847 symbol->type->thisClass = _class->symbol;
3848 }
3849 }
3850 DeclareType(symbol->type, 0x1, 0x1);
3851 }
3852 else if(classSym)
3853 {
3854 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3855 }
3856 }
3857 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3858 if(nameID)
3859 {
3860 FreeSpecifier(nameID->_class);
3861 nameID->_class = (((void *)0));
3862 }
3863 if(inCompiler)
3864 {
3865 struct Type * type = declarator->symbol->type;
3866 struct External * oldExternal = curExternal;
3867
3868 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3869 {
3870 struct External * externalDecl;
3871
3872 externalDecl = MkExternalDeclaration((((void *)0)));
3873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3874 if(createdExternal->function)
3875 {
3876 ProcessFunction(createdExternal->function);
3877 {
3878 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3879
3880 externalDecl->declaration = decl;
3881 if(decl->symbol && !decl->symbol->pointerExternal)
3882 decl->symbol->pointerExternal = externalDecl;
3883 declarator->symbol->pointerExternal = externalDecl;
3884 }
3885 }
3886 }
3887 }
3888 else if(declarator)
3889 {
3890 curExternal = declarator->symbol->pointerExternal;
3891 ProcessFunction((struct FunctionDefinition *)members->function);
3892 }
3893 curExternal = external;
3894 curContext = context;
3895 if(inCompiler)
3896 {
3897 FreeClassFunction(members->function);
3898 exp = QMkExpId(name);
3899 members->type = 0;
3900 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3901 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3902 }
3903 break;
3904 }
3905 case 0:
3906 {
3907 if(members->dataMembers && classSym)
3908 {
3909 struct MemberInit * member;
3910 struct Location oldyyloc = yylloc;
3911
3912 for(member = (*members->dataMembers).first; member; member = member->next)
3913 {
3914 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3915 if(member->initializer && !member->initializer->isConstant)
3916 inst->isConstant = 0x0;
3917 }
3918 yylloc = oldyyloc;
3919 }
3920 break;
3921 }
3922 }
3923 }
3924 }
3925 }
3926 }
3927
3928 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3929 {
3930 if(inCompiler)
3931 {
3932 if(type->kind == 11)
3933 {
3934 struct Type * param;
3935
3936 if(declareParams)
3937 {
3938 for(param = type->params.first; param; param = param->next)
3939 DeclareType(param, declarePointers, 0x1);
3940 }
3941 DeclareType(type->returnType, declarePointers, 0x1);
3942 }
3943 else if(type->kind == 13 && declarePointers)
3944 DeclareType(type->type, declarePointers, 0x0);
3945 else if(type->kind == 8)
3946 {
3947 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3948 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3949 }
3950 else if(type->kind == 9 || type->kind == 10)
3951 {
3952 struct Type * member;
3953
3954 for(member = type->members.first; member; member = member->next)
3955 DeclareType(member, 0x0, 0x0);
3956 }
3957 else if(type->kind == 12)
3958 DeclareType(type->arrayType, declarePointers, 0x0);
3959 }
3960 }
3961
3962 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3963
3964 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3965 {
3966 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3967 int id = 0;
3968 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3969 struct __ecereNameSpace__ecere__com__Class * sClass;
3970
3971 for(sClass = _class; sClass; sClass = sClass->base)
3972 {
3973 id = 0;
3974 if(sClass->templateClass)
3975 sClass = sClass->templateClass;
3976 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3977 {
3978 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3979 {
3980 for(sClass = sClass->base; sClass; sClass = sClass->base)
3981 {
3982 if(sClass->templateClass)
3983 sClass = sClass->templateClass;
3984 id += sClass->templateParams.count;
3985 }
3986 break;
3987 }
3988 id++;
3989 }
3990 if(curParam)
3991 break;
3992 }
3993 if(curParam)
3994 {
3995 arg = &_class->templateArgs[id];
3996 if(arg && param->type == 0)
3997 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3998 }
3999 return arg;
4000 }
4001
4002 extern struct Context * PushContext(void);
4003
4004 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4005
4006 struct TemplatedType
4007 {
4008 uintptr_t key;
4009 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4010 struct __ecereNameSpace__ecere__sys__BTNode * left;
4011 struct __ecereNameSpace__ecere__sys__BTNode * right;
4012 int depth;
4013 struct TemplateParameter * param;
4014 } __attribute__ ((gcc_struct));
4015
4016 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4017
4018 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4019 {
4020 struct Context * context = PushContext();
4021
4022 context->templateTypesOnly = 0x1;
4023 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4024 {
4025 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4026
4027 for(; param; param = param->next)
4028 {
4029 if(param->type == 0 && param->identifier)
4030 {
4031 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4032
4033 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4034 }
4035 }
4036 }
4037 else if(_class)
4038 {
4039 struct __ecereNameSpace__ecere__com__Class * sClass;
4040
4041 for(sClass = _class; sClass; sClass = sClass->base)
4042 {
4043 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4044
4045 for(p = sClass->templateParams.first; p; p = p->next)
4046 {
4047 if(p->type == 0)
4048 {
4049 struct TemplateParameter * param = p->param;
4050 struct TemplatedType * type;
4051
4052 if(!param)
4053 {
4054 p->param = param = __extension__ ({
4055 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4056
4057 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4058 });
4059 }
4060 type = __extension__ ({
4061 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4062
4063 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4064 });
4065 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4066 }
4067 }
4068 }
4069 }
4070 return context;
4071 }
4072
4073 extern void PopContext(struct Context * ctx);
4074
4075 extern void FreeContext(struct Context * context);
4076
4077 void FinishTemplatesContext(struct Context * context)
4078 {
4079 PopContext(context);
4080 FreeContext(context);
4081 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4082 }
4083
4084 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4085 {
4086 if(!method->dataType)
4087 {
4088 struct Context * context = SetupTemplatesContext(method->_class);
4089
4090 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4091 FinishTemplatesContext(context);
4092 if(method->type != 1 && method->dataType)
4093 {
4094 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4095 {
4096 if(!method->_class->symbol)
4097 method->_class->symbol = FindClass(method->_class->fullName);
4098 method->dataType->thisClass = method->_class->symbol;
4099 }
4100 }
4101 }
4102 }
4103
4104 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4105 {
4106 if(!prop->dataType)
4107 {
4108 struct Context * context = SetupTemplatesContext(prop->_class);
4109
4110 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4111 FinishTemplatesContext(context);
4112 }
4113 }
4114
4115 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4116
4117 extern void FreeTypeName(struct TypeName * typeName);
4118
4119 static void ProcessDeclarator(struct Declarator * decl);
4120
4121 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4122
4123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4124
4125 struct MethodImport
4126 {
4127 struct MethodImport * prev;
4128 struct MethodImport * next;
4129 char *  name;
4130 unsigned int isVirtual;
4131 } __attribute__ ((gcc_struct));
4132
4133 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4134
4135 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4136 {
4137 struct Symbol * symbol = method->symbol;
4138
4139 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4140 {
4141 unsigned int imported = 0x0;
4142 unsigned int dllImport = 0x0;
4143
4144 if(!method->dataType)
4145 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4146 if(!symbol || symbol->_import || method->type == 1)
4147 {
4148 if(!symbol || method->type == 1)
4149 {
4150 struct Symbol * classSym;
4151
4152 if(!method->_class->symbol)
4153 method->_class->symbol = FindClass(method->_class->fullName);
4154 classSym = method->_class->symbol;
4155 if(!classSym->_import)
4156 {
4157 struct ModuleImport * module;
4158
4159 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4160 module = FindModule(method->_class->module);
4161 else
4162 module = mainModule;
4163 classSym->_import = __extension__ ({
4164 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4165
4166 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4167 });
4168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4169 }
4170 if(!symbol)
4171 {
4172 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4173 }
4174 if(!symbol->_import)
4175 {
4176 symbol->_import = (struct ClassImport *)__extension__ ({
4177 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4178
4179 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4180 });
4181 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4182 }
4183 if(!symbol)
4184 {
4185 symbol->type = method->dataType;
4186 if(symbol->type)
4187 symbol->type->refCount++;
4188 }
4189 }
4190 if(!method->dataType->dllExport)
4191 {
4192 imported = 0x1;
4193 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4194 dllImport = 0x1;
4195 }
4196 }
4197 if(method->type != 1 && method->dataType)
4198 DeclareType(method->dataType, 0x1, 0x1);
4199 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4200 {
4201 struct Declaration * decl;
4202 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4203 struct Declarator * d;
4204 struct Declarator * funcDecl;
4205 struct External * external;
4206
4207 specifiers = MkList();
4208 declarators = MkList();
4209 if(dllImport)
4210 ListAdd(specifiers, MkSpecifier(EXTERN));
4211 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4212 ListAdd(specifiers, MkSpecifier(STATIC));
4213 if(method->type == 1)
4214 {
4215 ListAdd(specifiers, MkSpecifier(INT));
4216 d = MkDeclaratorIdentifier(MkIdentifier(name));
4217 }
4218 else
4219 {
4220 d = MkDeclaratorIdentifier(MkIdentifier(name));
4221 if(dllImport)
4222 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4223 {
4224 struct Context * context = SetupTemplatesContext(method->_class);
4225
4226 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4227 FinishTemplatesContext(context);
4228 }
4229 funcDecl = GetFuncDecl(d);
4230 if(dllImport)
4231 {
4232 struct Specifier * spec, * next;
4233
4234 for(spec = (*specifiers).first; spec; spec = next)
4235 {
4236 next = spec->next;
4237 if(spec->type == 5)
4238 {
4239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4240 FreeSpecifier(spec);
4241 }
4242 }
4243 }
4244 if(method->dataType && !method->dataType->staticMethod)
4245 {
4246 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4247 {
4248 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4249 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")));
4250 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4251 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4252
4253 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4254 {
4255 struct TypeName * param = (*funcDecl->function.parameters).first;
4256
4257 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4258 FreeTypeName(param);
4259 }
4260 if(!funcDecl->function.parameters)
4261 funcDecl->function.parameters = MkList();
4262 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4263 }
4264 }
4265 }
4266 ProcessDeclarator(d);
4267 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4268 decl = MkDeclaration(specifiers, declarators);
4269 ReplaceThisClassSpecifiers(specifiers, method->_class);
4270 if(symbol->pointerExternal)
4271 {
4272 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4273
4274 {
4275 *functionSymbol = *symbol;
4276 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4277 if(functionSymbol->type)
4278 functionSymbol->type->refCount++;
4279 }
4280 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4281 symbol->pointerExternal->symbol = functionSymbol;
4282 }
4283 external = MkExternalDeclaration(decl);
4284 if(curExternal)
4285 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4286 external->symbol = symbol;
4287 symbol->pointerExternal = external;
4288 }
4289 else if(ast)
4290 {
4291 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4292 }
4293 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4294 }
4295 }
4296
4297 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4298 {
4299 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4300 {
4301 unsigned int first = 0x1;
4302 int p = 0;
4303 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4304 int lastParam = -1;
4305 char className[1024];
4306
4307 strcpy(className, _class->fullName);
4308 for(param = _class->templateParams.first; param; param = param->next)
4309 {
4310 {
4311 if(first)
4312 strcat(className, "<");
4313 if(!first)
4314 strcat(className, ", ");
4315 if(lastParam + 1 != p)
4316 {
4317 strcat(className, param->name);
4318 strcat(className, " = ");
4319 }
4320 strcat(className, param->name);
4321 first = 0x0;
4322 lastParam = p;
4323 }
4324 p++;
4325 }
4326 if(!first)
4327 {
4328 int len = strlen(className);
4329
4330 if(className[len - 1] == '>')
4331 className[len++] = ' ';
4332 className[len++] = '>';
4333 className[len++] = '\0';
4334 }
4335 return __ecereNameSpace__ecere__sys__CopyString(className);
4336 }
4337 else
4338 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4339 }
4340
4341 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4342 {
4343 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4344 {
4345 unsigned int first = 0x1;
4346 int p = 0;
4347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4348 int lastParam = -1;
4349 char className[1024];
4350
4351 strcpy(className, _class->fullName);
4352 for(param = _class->templateParams.first; param; param = param->next)
4353 {
4354 {
4355 if(first)
4356 strcat(className, "<");
4357 if(!first)
4358 strcat(className, ", ");
4359 if(lastParam + 1 != p)
4360 {
4361 strcat(className, param->name);
4362 strcat(className, " = ");
4363 }
4364 strcat(className, param->name);
4365 first = 0x0;
4366 lastParam = p;
4367 }
4368 p++;
4369 }
4370 if(!first)
4371 {
4372 int len = strlen(className);
4373
4374 if(className[len - 1] == '>')
4375 className[len++] = ' ';
4376 className[len++] = '>';
4377 className[len++] = '\0';
4378 }
4379 return MkClassType(className);
4380 }
4381 else
4382 {
4383 return MkClassType(_class->fullName);
4384 }
4385 }
4386
4387 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4388 {
4389 if(specs != (((void *)0)) && _class)
4390 {
4391 struct Specifier * spec;
4392
4393 for(spec = specs->first; spec; spec = spec->next)
4394 {
4395 if(spec->type == 0 && spec->specifier == THISCLASS)
4396 {
4397 spec->type = 1;
4398 spec->name = ReplaceThisClass(_class);
4399 spec->symbol = FindClass(spec->name);
4400 }
4401 }
4402 }
4403 }
4404
4405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4406
4407 struct __ecereNameSpace__ecere__com__GlobalFunction
4408 {
4409 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4410 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4411 char *  name;
4412 int (*  function)();
4413 struct __ecereNameSpace__ecere__com__Instance * module;
4414 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4415 char *  dataTypeString;
4416 struct Type * dataType;
4417 void *  symbol;
4418 } __attribute__ ((gcc_struct));
4419
4420 extern struct Context * globalContext;
4421
4422 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4423
4424 struct FunctionImport
4425 {
4426 struct FunctionImport * prev;
4427 struct FunctionImport * next;
4428 char *  name;
4429 } __attribute__ ((gcc_struct));
4430
4431 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4432 {
4433 struct Symbol * symbol = function->symbol;
4434
4435 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4436 {
4437 unsigned int imported = 0x0;
4438 unsigned int dllImport = 0x0;
4439
4440 if(!function->dataType)
4441 {
4442 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4443 if(!function->dataType->thisClass)
4444 function->dataType->staticMethod = 0x1;
4445 }
4446 if(inCompiler)
4447 {
4448 if(!symbol)
4449 {
4450 struct ModuleImport * module = FindModule(function->module);
4451
4452 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4453 if(module->name)
4454 {
4455 if(!function->dataType->dllExport)
4456 {
4457 symbol->_import = (struct ClassImport *)__extension__ ({
4458 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4459
4460 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4461 });
4462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4463 }
4464 }
4465 {
4466 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4467 if(!symbol->type->thisClass)
4468 symbol->type->staticMethod = 0x1;
4469 }
4470 }
4471 imported = symbol->_import ? 0x1 : 0x0;
4472 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4473 dllImport = 0x1;
4474 }
4475 DeclareType(function->dataType, 0x1, 0x1);
4476 if(inCompiler)
4477 {
4478 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4479 {
4480 struct Declaration * decl;
4481 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4482 struct Declarator * d;
4483 struct Declarator * funcDecl;
4484 struct External * external;
4485
4486 specifiers = MkList();
4487 declarators = MkList();
4488 ListAdd(specifiers, MkSpecifier(EXTERN));
4489 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4490 if(dllImport)
4491 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4492 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4493 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4494 {
4495 struct Specifier * spec;
4496
4497 for(spec = (*specifiers).first; spec; spec = spec->next)
4498 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4499 {
4500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4501 FreeSpecifier(spec);
4502 break;
4503 }
4504 }
4505 funcDecl = GetFuncDecl(d);
4506 if(funcDecl && !funcDecl->function.parameters)
4507 {
4508 funcDecl->function.parameters = MkList();
4509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4510 }
4511 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4512 {
4513 struct Context * oldCtx = curContext;
4514
4515 curContext = globalContext;
4516 decl = MkDeclaration(specifiers, declarators);
4517 curContext = oldCtx;
4518 }
4519 if(symbol->pointerExternal)
4520 {
4521 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4522
4523 {
4524 *functionSymbol = *symbol;
4525 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4526 if(functionSymbol->type)
4527 functionSymbol->type->refCount++;
4528 }
4529 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4530 symbol->pointerExternal->symbol = functionSymbol;
4531 }
4532 external = MkExternalDeclaration(decl);
4533 if(curExternal)
4534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4535 external->symbol = symbol;
4536 symbol->pointerExternal = external;
4537 }
4538 else
4539 {
4540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4541 }
4542 if(curExternal)
4543 symbol->id = curExternal->symbol->idCode;
4544 }
4545 }
4546 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4547 }
4548
4549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4550
4551 struct GlobalData
4552 {
4553 uintptr_t key;
4554 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4555 struct __ecereNameSpace__ecere__sys__BTNode * left;
4556 struct __ecereNameSpace__ecere__sys__BTNode * right;
4557 int depth;
4558 struct __ecereNameSpace__ecere__com__Instance * module;
4559 char *  dataTypeString;
4560 struct Type * dataType;
4561 void *  symbol;
4562 char *  fullName;
4563 } __attribute__ ((gcc_struct));
4564
4565 void DeclareGlobalData(struct GlobalData * data)
4566 {
4567 struct Symbol * symbol = data->symbol;
4568
4569 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4570 {
4571 if(inCompiler)
4572 {
4573 if(!symbol)
4574 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4575 }
4576 if(!data->dataType)
4577 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4578 DeclareType(data->dataType, 0x1, 0x1);
4579 if(inCompiler)
4580 {
4581 if(!symbol->pointerExternal)
4582 {
4583 struct Declaration * decl;
4584 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4585 struct Declarator * d;
4586 struct External * external;
4587
4588 specifiers = MkList();
4589 declarators = MkList();
4590 ListAdd(specifiers, MkSpecifier(EXTERN));
4591 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4592 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4593 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4594 decl = MkDeclaration(specifiers, declarators);
4595 external = MkExternalDeclaration(decl);
4596 if(curExternal)
4597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4598 external->symbol = symbol;
4599 symbol->pointerExternal = external;
4600 }
4601 else
4602 {
4603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4604 }
4605 if(curExternal)
4606 symbol->id = curExternal->symbol->idCode;
4607 }
4608 }
4609 }
4610
4611 struct Conversion
4612 {
4613 struct Conversion * prev, * next;
4614 struct __ecereNameSpace__ecere__com__Property * convert;
4615 unsigned int isGet;
4616 struct Type * resultType;
4617 } __attribute__ ((gcc_struct));
4618
4619 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4620
4621 extern void Compiler_Warning(char *  format, ...);
4622
4623 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4624
4625 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)
4626 {
4627 if(source && dest)
4628 {
4629 if(source->kind == 20 && dest->kind != 20)
4630 {
4631 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4632
4633 if(type)
4634 source = type;
4635 }
4636 if(dest->kind == 20 && source->kind != 20)
4637 {
4638 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4639
4640 if(type)
4641 dest = type;
4642 }
4643 if(dest->classObjectType == 2)
4644 {
4645 if(source->classObjectType != 3)
4646 return 0x1;
4647 else
4648 {
4649 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4650 {
4651 return 0x1;
4652 }
4653 }
4654 }
4655 else
4656 {
4657 if(source->classObjectType == 3)
4658 return 0x1;
4659 if(dest->classObjectType == 3 && source->classObjectType != 2)
4660 return 0x1;
4661 }
4662 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4663 {
4664 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4665 return 0x1;
4666 }
4667 if(dest->kind == 14 && source->kind != 0)
4668 return 0x1;
4669 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))
4670 return 0x1;
4671 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))
4672 return 0x1;
4673 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4674 {
4675 if(source->_class->registered && source->_class->registered->type == 3)
4676 {
4677 if(conversions != (((void *)0)))
4678 {
4679 if(source->_class->registered == dest->_class->registered)
4680 return 0x1;
4681 }
4682 else
4683 {
4684 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4685
4686 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4687 ;
4688 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4689 ;
4690 if(sourceBase == destBase)
4691 return 0x1;
4692 }
4693 }
4694 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))
4695 return 0x1;
4696 else
4697 {
4698 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4699 {
4700 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4701 {
4702 return 0x1;
4703 }
4704 }
4705 }
4706 }
4707 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4708 return 0x1;
4709 if(doConversion)
4710 {
4711 if(source->kind == 8)
4712 {
4713 struct __ecereNameSpace__ecere__com__Class * _class;
4714
4715 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4716 {
4717 struct __ecereNameSpace__ecere__com__Property * convert;
4718
4719 for(convert = _class->conversions.first; convert; convert = convert->next)
4720 {
4721 if(convert->memberAccess == 1 || _class->module == privateModule)
4722 {
4723 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4724
4725 if(!convert->dataType)
4726 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4727 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4728 {
4729 if(!conversions && !convert->Get)
4730 return 0x1;
4731 else if(conversions != (((void *)0)))
4732 {
4733 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))
4734 return 0x1;
4735 else
4736 {
4737 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4738
4739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4740 return 0x1;
4741 }
4742 }
4743 }
4744 }
4745 }
4746 }
4747 }
4748 if(dest->kind == 8)
4749 {
4750 struct __ecereNameSpace__ecere__com__Class * _class;
4751
4752 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4753 {
4754 struct __ecereNameSpace__ecere__com__Property * convert;
4755
4756 for(convert = _class->conversions.first; convert; convert = convert->next)
4757 {
4758 if(convert->memberAccess == 1 || _class->module == privateModule)
4759 {
4760 if(!convert->dataType)
4761 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4762 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4763 {
4764 if(!conversions && !convert->Set)
4765 return 0x1;
4766 else if(conversions != (((void *)0)))
4767 {
4768 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))
4769 return 0x1;
4770 else
4771 {
4772 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4773
4774 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4775 return 0x1;
4776 }
4777 }
4778 }
4779 }
4780 }
4781 }
4782 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4783 {
4784 if(!dest->_class->registered->dataType)
4785 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4786 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4787 {
4788 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4789 {
4790 return 0x1;
4791 }
4792 }
4793 }
4794 }
4795 if(source->kind == 8)
4796 {
4797 struct __ecereNameSpace__ecere__com__Class * _class;
4798
4799 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4800 {
4801 struct __ecereNameSpace__ecere__com__Property * convert;
4802
4803 for(convert = _class->conversions.first; convert; convert = convert->next)
4804 {
4805 if(convert->memberAccess == 1 || _class->module == privateModule)
4806 {
4807 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4808
4809 if(!convert->dataType)
4810 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4811 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4812 {
4813 if(!conversions && !convert->Get)
4814 return 0x1;
4815 else if(conversions != (((void *)0)))
4816 {
4817 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))
4818 return 0x1;
4819 else
4820 {
4821 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4822
4823 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4824 return 0x1;
4825 }
4826 }
4827 }
4828 }
4829 }
4830 }
4831 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4832 {
4833 if(!source->_class->registered->dataType)
4834 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4835 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4836 {
4837 return 0x1;
4838 }
4839 }
4840 }
4841 }
4842 if(source->kind == 8 || source->kind == 19)
4843 ;
4844 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4845 return 0x1;
4846 else if(dest->kind == 7 && source->kind == 6)
4847 return 0x1;
4848 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4849 return 0x1;
4850 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4851 return 0x1;
4852 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4853 return 0x1;
4854 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4855 return 0x1;
4856 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4857 return 0x1;
4858 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
4859 return 0x1;
4860 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4861 return 0x1;
4862 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)))
4863 {
4864 struct Type * paramSource, * paramDest;
4865
4866 if(dest->kind == 16)
4867 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4868 if(source->kind == 16)
4869 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4870 if(dest->kind == 13 && dest->type->kind == 11)
4871 dest = dest->type;
4872 if(source->kind == 13 && source->type->kind == 11)
4873 source = source->type;
4874 if(dest->kind == 16)
4875 dest = dest->method->dataType;
4876 if(source->kind == 16)
4877 source = source->method->dataType;
4878 paramSource = source->params.first;
4879 if(paramSource && paramSource->kind == 0)
4880 paramSource = (((void *)0));
4881 paramDest = dest->params.first;
4882 if(paramDest && paramDest->kind == 0)
4883 paramDest = (((void *)0));
4884 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4885 {
4886 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))))
4887 {
4888 if(paramDest && paramDest->kind == 8)
4889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4890 else
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4892 return 0x0;
4893 }
4894 paramDest = paramDest->next;
4895 }
4896 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4897 {
4898 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4899 {
4900 if(dest->thisClass)
4901 {
4902 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4903 {
4904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4905 return 0x0;
4906 }
4907 }
4908 else
4909 {
4910 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4911 {
4912 if(owningClassDest)
4913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4914 else
4915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
4916 return 0x0;
4917 }
4918 }
4919 paramSource = paramSource->next;
4920 }
4921 else
4922 {
4923 if(dest->thisClass)
4924 {
4925 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4926 {
4927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4928 return 0x0;
4929 }
4930 }
4931 else
4932 {
4933 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4934 {
4935 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4936 return 0x0;
4937 }
4938 }
4939 }
4940 }
4941 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4942 {
4943 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
4944 return 0x0;
4945 }
4946 for(; paramDest; paramDest = paramDest->next)
4947 {
4948 if(!paramSource)
4949 {
4950 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
4951 return 0x0;
4952 }
4953 {
4954 struct Type * paramDestType = paramDest;
4955 struct Type * paramSourceType = paramSource;
4956 struct Type * type = paramDestType;
4957
4958 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4959 {
4960 int id = 0;
4961 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4962 struct __ecereNameSpace__ecere__com__Class * sClass;
4963
4964 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4965 {
4966 id = 0;
4967 if(sClass->templateClass)
4968 sClass = sClass->templateClass;
4969 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4970 {
4971 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4972 {
4973 for(sClass = sClass->base; sClass; sClass = sClass->base)
4974 {
4975 if(sClass->templateClass)
4976 sClass = sClass->templateClass;
4977 id += sClass->templateParams.count;
4978 }
4979 break;
4980 }
4981 id++;
4982 }
4983 if(curParam)
4984 break;
4985 }
4986 if(curParam)
4987 {
4988 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4989
4990 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4991 }
4992 }
4993 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)))
4994 {
4995 char type[1024];
4996
4997 type[0] = (char)0;
4998 PrintType(paramDest, type, 0x0, 0x1);
4999 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5000 if(paramDestType != paramDest)
5001 FreeType(paramDestType);
5002 return 0x0;
5003 }
5004 if(paramDestType != paramDest)
5005 FreeType(paramDestType);
5006 }
5007 paramSource = paramSource->next;
5008 }
5009 if(paramSource)
5010 {
5011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5012 return 0x0;
5013 }
5014 return 0x1;
5015 }
5016 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5017 {
5018 return 0x1;
5019 }
5020 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5021 {
5022 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5023 return 0x1;
5024 }
5025 }
5026 return 0x0;
5027 }
5028
5029 static void FreeConvert(struct Conversion * convert)
5030 {
5031 if(convert->resultType)
5032 FreeType(convert->resultType);
5033 }
5034
5035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5036
5037 struct __ecereNameSpace__ecere__com__BTNamedLink
5038 {
5039 char *  name;
5040 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5041 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5043 int depth;
5044 void *  data;
5045 } __attribute__ ((gcc_struct));
5046
5047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5048
5049 struct __ecereNameSpace__ecere__com__EnumClassData
5050 {
5051 struct __ecereNameSpace__ecere__sys__OldList values;
5052 int largest;
5053 } __attribute__ ((gcc_struct));
5054
5055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5056
5057 struct __ecereNameSpace__ecere__sys__NamedLink
5058 {
5059 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5060 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5061 char *  name;
5062 void *  data;
5063 } __attribute__ ((gcc_struct));
5064
5065 extern void FreeExpContents(struct Expression * exp);
5066
5067 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5068
5069 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5070
5071 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5072
5073 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5074
5075 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5076
5077 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5078 {
5079 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5080
5081 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)))
5082 {
5083 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5084
5085 if(_class->type == 4)
5086 {
5087 struct __ecereNameSpace__ecere__sys__OldList converts = 
5088 {
5089 0, 0, 0, 0, 0
5090 };
5091 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5092
5093 type->kind = 8;
5094 if(!_class->symbol)
5095 _class->symbol = FindClass(_class->fullName);
5096 type->_class = _class->symbol;
5097 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5098 {
5099 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5100 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5101
5102 if(enumClass)
5103 {
5104 struct __ecereNameSpace__ecere__com__Class * baseClass;
5105
5106 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5107 {
5108 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5109
5110 for(value = e->values.first; value; value = value->next)
5111 {
5112 if(!strcmp(value->name, string))
5113 break;
5114 }
5115 if(value)
5116 {
5117 FreeExpContents(sourceExp);
5118 FreeType(sourceExp->expType);
5119 sourceExp->isConstant = 0x1;
5120 sourceExp->expType = MkClassType(baseClass->fullName);
5121 {
5122 char constant[256];
5123
5124 sourceExp->type = 2;
5125 if(!strcmp(baseClass->dataTypeString, "int"))
5126 sprintf(constant, "%d", (int)value->data);
5127 else
5128 sprintf(constant, "0x%X", (int)value->data);
5129 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5130 }
5131 while(converts.first)
5132 {
5133 struct Conversion * convert = converts.first;
5134
5135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5137 }
5138 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5139 return 0x1;
5140 }
5141 }
5142 }
5143 }
5144 if(converts.first)
5145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5146 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5147 }
5148 }
5149 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)))
5150 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5151 return 0x1;
5152 return 0x0;
5153 }
5154
5155 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5156
5157 struct __ecereNameSpace__ecere__com__SubModule
5158 {
5159 struct __ecereNameSpace__ecere__com__SubModule * prev;
5160 struct __ecereNameSpace__ecere__com__SubModule * next;
5161 struct __ecereNameSpace__ecere__com__Instance * module;
5162 int importMode;
5163 } __attribute__ ((gcc_struct));
5164
5165 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5166 {
5167 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5168
5169 if(searchFor == searchIn)
5170 return 0x1;
5171 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5172 {
5173 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5174 {
5175 if(ModuleVisibility(subModule->module, searchFor))
5176 return 0x1;
5177 }
5178 }
5179 return 0x0;
5180 }
5181
5182 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5183
5184 struct __ecereNameSpace__ecere__com__Application
5185 {
5186 int argc;
5187 char * *  argv;
5188 int exitCode;
5189 unsigned int isGUIApp;
5190 struct __ecereNameSpace__ecere__sys__OldList allModules;
5191 char *  parsedCommand;
5192 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5193 } __attribute__ ((gcc_struct));
5194
5195 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5196 {
5197 struct __ecereNameSpace__ecere__com__Instance * module;
5198
5199 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5200 return 0x1;
5201 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5202 return 0x1;
5203 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5204 return 0x1;
5205 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5206 {
5207 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5208 return 0x1;
5209 }
5210 return 0x0;
5211 }
5212
5213 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5214
5215 void ReadString(char *  output, char *  string);
5216
5217 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5218
5219 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5220
5221 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5222
5223 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5224 {
5225 struct Type * source = sourceExp->expType;
5226 struct Type * realDest = dest;
5227 struct Type * backupSourceExpType = (((void *)0));
5228
5229 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5230 return 0x1;
5231 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5232 {
5233 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5234 {
5235 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5236
5237 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5238 ;
5239 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5240 ;
5241 if(sourceBase == destBase)
5242 return 0x1;
5243 }
5244 }
5245 if(source)
5246 {
5247 struct __ecereNameSpace__ecere__sys__OldList * specs;
5248 unsigned int flag = 0x0;
5249 long long value = (((int)0x7fffffff));
5250
5251 source->refCount++;
5252 dest->refCount++;
5253 if(sourceExp->type == 2)
5254 {
5255 if(source->isSigned)
5256 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5257 else
5258 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5259 }
5260 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5261 {
5262 if(source->isSigned)
5263 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5264 else
5265 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5266 }
5267 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5268 {
5269 FreeType(source);
5270 source = __extension__ ({
5271 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5272
5273 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5274 });
5275 }
5276 if(dest->kind == 8)
5277 {
5278 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5279
5280 if(_class && _class->type == 3)
5281 {
5282 if(source->kind != 8)
5283 {
5284 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5285 struct Type * tempDest, * tempSource;
5286
5287 for(; _class->base->type != 1000; _class = _class->base)
5288 ;
5289 tempSource = dest;
5290 tempDest = tempType;
5291 tempType->kind = 8;
5292 if(!_class->symbol)
5293 _class->symbol = FindClass(_class->fullName);
5294 tempType->_class = _class->symbol;
5295 tempType->truth = dest->truth;
5296 if(tempType->_class)
5297 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5298 backupSourceExpType = sourceExp->expType;
5299 sourceExp->expType = dest;
5300 dest->refCount++;
5301 flag = 0x1;
5302 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5303 }
5304 }
5305 if(_class && _class->type == 2 && source->kind != 8)
5306 {
5307 if(!dest->_class->registered->dataType)
5308 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5309 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5310 {
5311 FreeType(source);
5312 FreeType(sourceExp->expType);
5313 source = sourceExp->expType = MkClassType(dest->_class->string);
5314 source->refCount++;
5315 }
5316 }
5317 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5318 {
5319 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5320 struct Declarator * decl;
5321 char string[1024];
5322
5323 ReadString(string, sourceExp->string);
5324 decl = SpecDeclFromString(string, specs, (((void *)0)));
5325 FreeExpContents(sourceExp);
5326 FreeType(sourceExp->expType);
5327 sourceExp->type = 26;
5328 sourceExp->_classExp.specifiers = specs;
5329 sourceExp->_classExp.decl = decl;
5330 sourceExp->expType = dest;
5331 dest->refCount++;
5332 FreeType(source);
5333 FreeType(dest);
5334 if(backupSourceExpType)
5335 FreeType(backupSourceExpType);
5336 return 0x1;
5337 }
5338 }
5339 else if(source->kind == 8)
5340 {
5341 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5342
5343 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5344 {
5345 if(dest->kind != 8)
5346 {
5347 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5348 struct Type * tempDest, * tempSource;
5349
5350 if(!source->_class->registered->dataType)
5351 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5352 for(; _class->base->type != 1000; _class = _class->base)
5353 ;
5354 tempDest = source;
5355 tempSource = tempType;
5356 tempType->kind = 8;
5357 tempType->_class = FindClass(_class->fullName);
5358 tempType->truth = source->truth;
5359 tempType->classObjectType = source->classObjectType;
5360 if(tempType->_class)
5361 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5362 if(conversions->last)
5363 {
5364 ((struct Conversion *)conversions->last)->resultType = dest;
5365 dest->refCount++;
5366 }
5367 FreeType(sourceExp->expType);
5368 sourceExp->expType = MkClassType(_class->fullName);
5369 sourceExp->expType->truth = source->truth;
5370 sourceExp->expType->classObjectType = source->classObjectType;
5371 if(!sourceExp->destType)
5372 {
5373 FreeType(sourceExp->destType);
5374 sourceExp->destType = sourceExp->expType;
5375 if(sourceExp->expType)
5376 sourceExp->expType->refCount++;
5377 }
5378 if(!_class->dataType)
5379 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5380 FreeType(dest);
5381 dest = MkClassType(source->_class->string);
5382 dest->truth = source->truth;
5383 dest->classObjectType = source->classObjectType;
5384 FreeType(source);
5385 source = _class->dataType;
5386 source->refCount++;
5387 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5388 }
5389 }
5390 }
5391 if(!flag)
5392 {
5393 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5394 {
5395 FreeType(source);
5396 FreeType(dest);
5397 return 0x1;
5398 }
5399 }
5400 if(dest->kind == 8)
5401 {
5402 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5403
5404 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5405 {
5406 if(_class->type == 0 || _class->type == 5)
5407 {
5408 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5409
5410 *newExp = *sourceExp;
5411 if(sourceExp->destType)
5412 sourceExp->destType->refCount++;
5413 if(sourceExp->expType)
5414 sourceExp->expType->refCount++;
5415 sourceExp->type = 11;
5416 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5417 sourceExp->cast.exp = newExp;
5418 FreeType(sourceExp->expType);
5419 sourceExp->expType = (((void *)0));
5420 ProcessExpressionType(sourceExp);
5421 if(!inCompiler)
5422 {
5423 FreeType(sourceExp->expType);
5424 sourceExp->expType = dest;
5425 }
5426 FreeType(source);
5427 if(inCompiler)
5428 FreeType(dest);
5429 if(backupSourceExpType)
5430 FreeType(backupSourceExpType);
5431 return 0x1;
5432 }
5433 if(!_class->dataType)
5434 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5435 FreeType(dest);
5436 dest = _class->dataType;
5437 dest->refCount++;
5438 }
5439 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5440 {
5441 specs = MkListOne(MkSpecifier(DOUBLE));
5442 }
5443 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5444 {
5445 specs = MkListOne(MkSpecifier(FLOAT));
5446 }
5447 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5448 {
5449 specs = MkList();
5450 if(!dest->isSigned)
5451 ListAdd(specs, MkSpecifier(UNSIGNED));
5452 ListAdd(specs, MkSpecifier(INT64));
5453 }
5454 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5455 {
5456 specs = MkList();
5457 if(!dest->isSigned)
5458 ListAdd(specs, MkSpecifier(UNSIGNED));
5459 ListAdd(specs, MkSpecifier(INT));
5460 }
5461 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5462 {
5463 specs = MkList();
5464 if(!dest->isSigned)
5465 ListAdd(specs, MkSpecifier(UNSIGNED));
5466 ListAdd(specs, MkSpecifier(SHORT));
5467 }
5468 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5469 {
5470 specs = MkList();
5471 if(!dest->isSigned)
5472 ListAdd(specs, MkSpecifier(UNSIGNED));
5473 ListAdd(specs, MkSpecifier(CHAR));
5474 }
5475 else
5476 {
5477 FreeType(source);
5478 FreeType(dest);
5479 if(backupSourceExpType)
5480 {
5481 if(sourceExp->expType)
5482 FreeType(sourceExp->expType);
5483 sourceExp->expType = backupSourceExpType;
5484 }
5485 return 0x0;
5486 }
5487 }
5488 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5489 {
5490 specs = MkListOne(MkSpecifier(DOUBLE));
5491 }
5492 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5493 {
5494 specs = MkListOne(MkSpecifier(FLOAT));
5495 }
5496 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5497 {
5498 specs = MkList();
5499 ListAdd(specs, MkSpecifier(BOOL));
5500 }
5501 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5502 {
5503 specs = MkList();
5504 if(!dest->isSigned)
5505 ListAdd(specs, MkSpecifier(UNSIGNED));
5506 ListAdd(specs, MkSpecifier(CHAR));
5507 }
5508 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5509 {
5510 specs = MkList();
5511 if(!dest->isSigned)
5512 ListAdd(specs, MkSpecifier(UNSIGNED));
5513 ListAdd(specs, MkSpecifier(SHORT));
5514 }
5515 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5516 {
5517 specs = MkList();
5518 if(!dest->isSigned)
5519 ListAdd(specs, MkSpecifier(UNSIGNED));
5520 ListAdd(specs, MkSpecifier(INT));
5521 }
5522 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5523 {
5524 specs = MkList();
5525 if(!dest->isSigned)
5526 ListAdd(specs, MkSpecifier(UNSIGNED));
5527 ListAdd(specs, MkSpecifier(INT64));
5528 }
5529 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5530 {
5531 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5532 }
5533 else
5534 {
5535 FreeType(source);
5536 FreeType(dest);
5537 if(backupSourceExpType)
5538 {
5539 if(sourceExp->expType)
5540 FreeType(sourceExp->expType);
5541 sourceExp->expType = backupSourceExpType;
5542 }
5543 return 0x0;
5544 }
5545 if(!flag)
5546 {
5547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5548
5549 *newExp = *sourceExp;
5550 newExp->prev = (((void *)0));
5551 newExp->next = (((void *)0));
5552 if(sourceExp->destType)
5553 sourceExp->destType->refCount++;
5554 if(sourceExp->expType)
5555 sourceExp->expType->refCount++;
5556 sourceExp->type = 11;
5557 if(realDest->kind == 8)
5558 {
5559 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5560 FreeList(specs, FreeSpecifier);
5561 }
5562 else
5563 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5564 if(newExp->type == 4)
5565 {
5566 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5567 }
5568 else
5569 sourceExp->cast.exp = newExp;
5570 FreeType(sourceExp->expType);
5571 sourceExp->expType = (((void *)0));
5572 ProcessExpressionType(sourceExp);
5573 }
5574 else
5575 FreeList(specs, FreeSpecifier);
5576 FreeType(dest);
5577 FreeType(source);
5578 if(backupSourceExpType)
5579 FreeType(backupSourceExpType);
5580 return 0x1;
5581 }
5582 else
5583 {
5584 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5585 sourceExp = (*sourceExp->list).last;
5586 if(sourceExp->type == 0)
5587 {
5588 struct Identifier * id = sourceExp->identifier;
5589
5590 if(dest->kind == 8)
5591 {
5592 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5593 {
5594 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5595 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5596
5597 if(enumClass)
5598 {
5599 for(; _class && _class->type == 4; _class = _class->base)
5600 {
5601 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5602 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5603
5604 for(value = e->values.first; value; value = value->next)
5605 {
5606 if(!strcmp(value->name, id->string))
5607 break;
5608 }
5609 if(value)
5610 {
5611 FreeExpContents(sourceExp);
5612 FreeType(sourceExp->expType);
5613 sourceExp->isConstant = 0x1;
5614 sourceExp->expType = MkClassType(_class->fullName);
5615 {
5616 char constant[256];
5617
5618 sourceExp->type = 2;
5619 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5620 sprintf(constant, "%d", (int)value->data);
5621 else
5622 sprintf(constant, "0x%X", (int)value->data);
5623 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5624 }
5625 return 0x1;
5626 }
5627 }
5628 }
5629 }
5630 }
5631 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5632 return 0x1;
5633 }
5634 }
5635 return 0x0;
5636 }
5637
5638 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5639 {
5640 int value2 = op2->i;
5641
5642 exp->type = 2;
5643 exp->string = PrintInt(op1->i + value2);
5644 if(!exp->expType)
5645 {
5646 exp->expType = op1->type;
5647 if(op1->type)
5648 op1->type->refCount++;
5649 }
5650 return 0x1;
5651 }
5652
5653 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5654 {
5655 unsigned int value2 = op2->ui;
5656
5657 exp->type = 2;
5658 exp->string = PrintUInt(op1->ui + value2);
5659 if(!exp->expType)
5660 {
5661 exp->expType = op1->type;
5662 if(op1->type)
5663 op1->type->refCount++;
5664 }
5665 return 0x1;
5666 }
5667
5668 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5669 {
5670 int value2 = op2->i;
5671
5672 exp->type = 2;
5673 exp->string = PrintInt64(op1->i + value2);
5674 if(!exp->expType)
5675 {
5676 exp->expType = op1->type;
5677 if(op1->type)
5678 op1->type->refCount++;
5679 }
5680 return 0x1;
5681 }
5682
5683 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5684 {
5685 unsigned int value2 = op2->ui;
5686
5687 exp->type = 2;
5688 exp->string = PrintUInt64(op1->ui + value2);
5689 if(!exp->expType)
5690 {
5691 exp->expType = op1->type;
5692 if(op1->type)
5693 op1->type->refCount++;
5694 }
5695 return 0x1;
5696 }
5697
5698 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5699 {
5700 short value2 = op2->s;
5701
5702 exp->type = 2;
5703 exp->string = PrintShort(op1->s + value2);
5704 if(!exp->expType)
5705 {
5706 exp->expType = op1->type;
5707 if(op1->type)
5708 op1->type->refCount++;
5709 }
5710 return 0x1;
5711 }
5712
5713 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5714 {
5715 unsigned short value2 = op2->us;
5716
5717 exp->type = 2;
5718 exp->string = PrintUShort(op1->us + value2);
5719 if(!exp->expType)
5720 {
5721 exp->expType = op1->type;
5722 if(op1->type)
5723 op1->type->refCount++;
5724 }
5725 return 0x1;
5726 }
5727
5728 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5729 {
5730 char value2 = op2->c;
5731
5732 exp->type = 2;
5733 exp->string = PrintChar(op1->c + value2);
5734 if(!exp->expType)
5735 {
5736 exp->expType = op1->type;
5737 if(op1->type)
5738 op1->type->refCount++;
5739 }
5740 return 0x1;
5741 }
5742
5743 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5744 {
5745 unsigned char value2 = op2->uc;
5746
5747 exp->type = 2;
5748 exp->string = PrintUChar(op1->uc + value2);
5749 if(!exp->expType)
5750 {
5751 exp->expType = op1->type;
5752 if(op1->type)
5753 op1->type->refCount++;
5754 }
5755 return 0x1;
5756 }
5757
5758 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5759 {
5760 float value2 = op2->f;
5761
5762 exp->type = 2;
5763 exp->string = PrintFloat(op1->f + value2);
5764 if(!exp->expType)
5765 {
5766 exp->expType = op1->type;
5767 if(op1->type)
5768 op1->type->refCount++;
5769 }
5770 return 0x1;
5771 }
5772
5773 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5774 {
5775 double value2 = op2->d;
5776
5777 exp->type = 2;
5778 exp->string = PrintDouble(op1->d + value2);
5779 if(!exp->expType)
5780 {
5781 exp->expType = op1->type;
5782 if(op1->type)
5783 op1->type->refCount++;
5784 }
5785 return 0x1;
5786 }
5787
5788 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5789 {
5790 int value2 = op2->i;
5791
5792 exp->type = 2;
5793 exp->string = PrintInt(op1->i - value2);
5794 if(!exp->expType)
5795 {
5796 exp->expType = op1->type;
5797 if(op1->type)
5798 op1->type->refCount++;
5799 }
5800 return 0x1;
5801 }
5802
5803 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5804 {
5805 unsigned int value2 = op2->ui;
5806
5807 exp->type = 2;
5808 exp->string = PrintUInt(op1->ui - value2);
5809 if(!exp->expType)
5810 {
5811 exp->expType = op1->type;
5812 if(op1->type)
5813 op1->type->refCount++;
5814 }
5815 return 0x1;
5816 }
5817
5818 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5819 {
5820 int value2 = op2->i;
5821
5822 exp->type = 2;
5823 exp->string = PrintInt64(op1->i - value2);
5824 if(!exp->expType)
5825 {
5826 exp->expType = op1->type;
5827 if(op1->type)
5828 op1->type->refCount++;
5829 }
5830 return 0x1;
5831 }
5832
5833 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5834 {
5835 unsigned int value2 = op2->ui;
5836
5837 exp->type = 2;
5838 exp->string = PrintUInt64(op1->ui - value2);
5839 if(!exp->expType)
5840 {
5841 exp->expType = op1->type;
5842 if(op1->type)
5843 op1->type->refCount++;
5844 }
5845 return 0x1;
5846 }
5847
5848 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5849 {
5850 short value2 = op2->s;
5851
5852 exp->type = 2;
5853 exp->string = PrintShort(op1->s - value2);
5854 if(!exp->expType)
5855 {
5856 exp->expType = op1->type;
5857 if(op1->type)
5858 op1->type->refCount++;
5859 }
5860 return 0x1;
5861 }
5862
5863 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5864 {
5865 unsigned short value2 = op2->us;
5866
5867 exp->type = 2;
5868 exp->string = PrintUShort(op1->us - value2);
5869 if(!exp->expType)
5870 {
5871 exp->expType = op1->type;
5872 if(op1->type)
5873 op1->type->refCount++;
5874 }
5875 return 0x1;
5876 }
5877
5878 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5879 {
5880 char value2 = op2->c;
5881
5882 exp->type = 2;
5883 exp->string = PrintChar(op1->c - value2);
5884 if(!exp->expType)
5885 {
5886 exp->expType = op1->type;
5887 if(op1->type)
5888 op1->type->refCount++;
5889 }
5890 return 0x1;
5891 }
5892
5893 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5894 {
5895 unsigned char value2 = op2->uc;
5896
5897 exp->type = 2;
5898 exp->string = PrintUChar(op1->uc - value2);
5899 if(!exp->expType)
5900 {
5901 exp->expType = op1->type;
5902 if(op1->type)
5903 op1->type->refCount++;
5904 }
5905 return 0x1;
5906 }
5907
5908 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5909 {
5910 float value2 = op2->f;
5911
5912 exp->type = 2;
5913 exp->string = PrintFloat(op1->f - value2);
5914 if(!exp->expType)
5915 {
5916 exp->expType = op1->type;
5917 if(op1->type)
5918 op1->type->refCount++;
5919 }
5920 return 0x1;
5921 }
5922
5923 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5924 {
5925 double value2 = op2->d;
5926
5927 exp->type = 2;
5928 exp->string = PrintDouble(op1->d - value2);
5929 if(!exp->expType)
5930 {
5931 exp->expType = op1->type;
5932 if(op1->type)
5933 op1->type->refCount++;
5934 }
5935 return 0x1;
5936 }
5937
5938 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5939 {
5940 int value2 = op2->i;
5941
5942 exp->type = 2;
5943 exp->string = PrintInt(op1->i * value2);
5944 if(!exp->expType)
5945 {
5946 exp->expType = op1->type;
5947 if(op1->type)
5948 op1->type->refCount++;
5949 }
5950 return 0x1;
5951 }
5952
5953 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5954 {
5955 unsigned int value2 = op2->ui;
5956
5957 exp->type = 2;
5958 exp->string = PrintUInt(op1->ui * value2);
5959 if(!exp->expType)
5960 {
5961 exp->expType = op1->type;
5962 if(op1->type)
5963 op1->type->refCount++;
5964 }
5965 return 0x1;
5966 }
5967
5968 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5969 {
5970 int value2 = op2->i;
5971
5972 exp->type = 2;
5973 exp->string = PrintInt64(op1->i * value2);
5974 if(!exp->expType)
5975 {
5976 exp->expType = op1->type;
5977 if(op1->type)
5978 op1->type->refCount++;
5979 }
5980 return 0x1;
5981 }
5982
5983 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5984 {
5985 unsigned int value2 = op2->ui;
5986
5987 exp->type = 2;
5988 exp->string = PrintUInt64(op1->ui * value2);
5989 if(!exp->expType)
5990 {
5991 exp->expType = op1->type;
5992 if(op1->type)
5993 op1->type->refCount++;
5994 }
5995 return 0x1;
5996 }
5997
5998 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5999 {
6000 short value2 = op2->s;
6001
6002 exp->type = 2;
6003 exp->string = PrintShort(op1->s * value2);
6004 if(!exp->expType)
6005 {
6006 exp->expType = op1->type;
6007 if(op1->type)
6008 op1->type->refCount++;
6009 }
6010 return 0x1;
6011 }
6012
6013 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6014 {
6015 unsigned short value2 = op2->us;
6016
6017 exp->type = 2;
6018 exp->string = PrintUShort(op1->us * value2);
6019 if(!exp->expType)
6020 {
6021 exp->expType = op1->type;
6022 if(op1->type)
6023 op1->type->refCount++;
6024 }
6025 return 0x1;
6026 }
6027
6028 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6029 {
6030 char value2 = op2->c;
6031
6032 exp->type = 2;
6033 exp->string = PrintChar(op1->c * value2);
6034 if(!exp->expType)
6035 {
6036 exp->expType = op1->type;
6037 if(op1->type)
6038 op1->type->refCount++;
6039 }
6040 return 0x1;
6041 }
6042
6043 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6044 {
6045 unsigned char value2 = op2->uc;
6046
6047 exp->type = 2;
6048 exp->string = PrintUChar(op1->uc * value2);
6049 if(!exp->expType)
6050 {
6051 exp->expType = op1->type;
6052 if(op1->type)
6053 op1->type->refCount++;
6054 }
6055 return 0x1;
6056 }
6057
6058 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 {
6060 float value2 = op2->f;
6061
6062 exp->type = 2;
6063 exp->string = PrintFloat(op1->f * value2);
6064 if(!exp->expType)
6065 {
6066 exp->expType = op1->type;
6067 if(op1->type)
6068 op1->type->refCount++;
6069 }
6070 return 0x1;
6071 }
6072
6073 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 {
6075 double value2 = op2->d;
6076
6077 exp->type = 2;
6078 exp->string = PrintDouble(op1->d * value2);
6079 if(!exp->expType)
6080 {
6081 exp->expType = op1->type;
6082 if(op1->type)
6083 op1->type->refCount++;
6084 }
6085 return 0x1;
6086 }
6087
6088 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 {
6090 int value2 = op2->i;
6091
6092 exp->type = 2;
6093 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6094 if(!exp->expType)
6095 {
6096 exp->expType = op1->type;
6097 if(op1->type)
6098 op1->type->refCount++;
6099 }
6100 return 0x1;
6101 }
6102
6103 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 {
6105 unsigned int value2 = op2->ui;
6106
6107 exp->type = 2;
6108 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6109 if(!exp->expType)
6110 {
6111 exp->expType = op1->type;
6112 if(op1->type)
6113 op1->type->refCount++;
6114 }
6115 return 0x1;
6116 }
6117
6118 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 {
6120 int value2 = op2->i;
6121
6122 exp->type = 2;
6123 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6124 if(!exp->expType)
6125 {
6126 exp->expType = op1->type;
6127 if(op1->type)
6128 op1->type->refCount++;
6129 }
6130 return 0x1;
6131 }
6132
6133 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 {
6135 unsigned int value2 = op2->ui;
6136
6137 exp->type = 2;
6138 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
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 ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 {
6150 short value2 = op2->s;
6151
6152 exp->type = 2;
6153 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6154 if(!exp->expType)
6155 {
6156 exp->expType = op1->type;
6157 if(op1->type)
6158 op1->type->refCount++;
6159 }
6160 return 0x1;
6161 }
6162
6163 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 {
6165 unsigned short value2 = op2->us;
6166
6167 exp->type = 2;
6168 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6169 if(!exp->expType)
6170 {
6171 exp->expType = op1->type;
6172 if(op1->type)
6173 op1->type->refCount++;
6174 }
6175 return 0x1;
6176 }
6177
6178 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 {
6180 char value2 = op2->c;
6181
6182 exp->type = 2;
6183 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6184 if(!exp->expType)
6185 {
6186 exp->expType = op1->type;
6187 if(op1->type)
6188 op1->type->refCount++;
6189 }
6190 return 0x1;
6191 }
6192
6193 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 {
6195 unsigned char value2 = op2->uc;
6196
6197 exp->type = 2;
6198 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6199 if(!exp->expType)
6200 {
6201 exp->expType = op1->type;
6202 if(op1->type)
6203 op1->type->refCount++;
6204 }
6205 return 0x1;
6206 }
6207
6208 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 {
6210 float value2 = op2->f;
6211
6212 exp->type = 2;
6213 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6214 if(!exp->expType)
6215 {
6216 exp->expType = op1->type;
6217 if(op1->type)
6218 op1->type->refCount++;
6219 }
6220 return 0x1;
6221 }
6222
6223 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 {
6225 double value2 = op2->d;
6226
6227 exp->type = 2;
6228 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6229 if(!exp->expType)
6230 {
6231 exp->expType = op1->type;
6232 if(op1->type)
6233 op1->type->refCount++;
6234 }
6235 return 0x1;
6236 }
6237
6238 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 {
6240 int value2 = op2->i;
6241
6242 exp->type = 2;
6243 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6244 if(!exp->expType)
6245 {
6246 exp->expType = op1->type;
6247 if(op1->type)
6248 op1->type->refCount++;
6249 }
6250 return 0x1;
6251 }
6252
6253 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 {
6255 unsigned int value2 = op2->ui;
6256
6257 exp->type = 2;
6258 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6259 if(!exp->expType)
6260 {
6261 exp->expType = op1->type;
6262 if(op1->type)
6263 op1->type->refCount++;
6264 }
6265 return 0x1;
6266 }
6267
6268 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 {
6270 int value2 = op2->i;
6271
6272 exp->type = 2;
6273 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6274 if(!exp->expType)
6275 {
6276 exp->expType = op1->type;
6277 if(op1->type)
6278 op1->type->refCount++;
6279 }
6280 return 0x1;
6281 }
6282
6283 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 {
6285 unsigned int value2 = op2->ui;
6286
6287 exp->type = 2;
6288 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6289 if(!exp->expType)
6290 {
6291 exp->expType = op1->type;
6292 if(op1->type)
6293 op1->type->refCount++;
6294 }
6295 return 0x1;
6296 }
6297
6298 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 {
6300 short value2 = op2->s;
6301
6302 exp->type = 2;
6303 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6304 if(!exp->expType)
6305 {
6306 exp->expType = op1->type;
6307 if(op1->type)
6308 op1->type->refCount++;
6309 }
6310 return 0x1;
6311 }
6312
6313 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 {
6315 unsigned short value2 = op2->us;
6316
6317 exp->type = 2;
6318 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6319 if(!exp->expType)
6320 {
6321 exp->expType = op1->type;
6322 if(op1->type)
6323 op1->type->refCount++;
6324 }
6325 return 0x1;
6326 }
6327
6328 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 {
6330 char value2 = op2->c;
6331
6332 exp->type = 2;
6333 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
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 UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 {
6345 unsigned char value2 = op2->uc;
6346
6347 exp->type = 2;
6348 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6349 if(!exp->expType)
6350 {
6351 exp->expType = op1->type;
6352 if(op1->type)
6353 op1->type->refCount++;
6354 }
6355 return 0x1;
6356 }
6357
6358 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6359 {
6360 exp->type = 2;
6361 exp->string = PrintInt((-op1->i));
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 UIntNeg(struct Expression * exp, struct Operand * op1)
6372 {
6373 exp->type = 2;
6374 exp->string = PrintUInt((unsigned int)(-op1->ui));
6375 if(!exp->expType)
6376 {
6377 exp->expType = op1->type;
6378 if(op1->type)
6379 op1->type->refCount++;
6380 }
6381 return 0x1;
6382 }
6383
6384 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6385 {
6386 exp->type = 2;
6387 exp->string = PrintInt64((-op1->i));
6388 if(!exp->expType)
6389 {
6390 exp->expType = op1->type;
6391 if(op1->type)
6392 op1->type->refCount++;
6393 }
6394 return 0x1;
6395 }
6396
6397 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6398 {
6399 exp->type = 2;
6400 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6401 if(!exp->expType)
6402 {
6403 exp->expType = op1->type;
6404 if(op1->type)
6405 op1->type->refCount++;
6406 }
6407 return 0x1;
6408 }
6409
6410 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6411 {
6412 exp->type = 2;
6413 exp->string = PrintShort((-op1->s));
6414 if(!exp->expType)
6415 {
6416 exp->expType = op1->type;
6417 if(op1->type)
6418 op1->type->refCount++;
6419 }
6420 return 0x1;
6421 }
6422
6423 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6424 {
6425 exp->type = 2;
6426 exp->string = PrintUShort((unsigned short)(-op1->us));
6427 if(!exp->expType)
6428 {
6429 exp->expType = op1->type;
6430 if(op1->type)
6431 op1->type->refCount++;
6432 }
6433 return 0x1;
6434 }
6435
6436 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6437 {
6438 exp->type = 2;
6439 exp->string = PrintChar((-op1->c));
6440 if(!exp->expType)
6441 {
6442 exp->expType = op1->type;
6443 if(op1->type)
6444 op1->type->refCount++;
6445 }
6446 return 0x1;
6447 }
6448
6449 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6450 {
6451 exp->type = 2;
6452 exp->string = PrintUChar((unsigned char)(-op1->uc));
6453 if(!exp->expType)
6454 {
6455 exp->expType = op1->type;
6456 if(op1->type)
6457 op1->type->refCount++;
6458 }
6459 return 0x1;
6460 }
6461
6462 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6463 {
6464 exp->type = 2;
6465 exp->string = PrintFloat((float)(-op1->f));
6466 if(!exp->expType)
6467 {
6468 exp->expType = op1->type;
6469 if(op1->type)
6470 op1->type->refCount++;
6471 }
6472 return 0x1;
6473 }
6474
6475 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6476 {
6477 exp->type = 2;
6478 exp->string = PrintDouble((double)(-op1->d));
6479 if(!exp->expType)
6480 {
6481 exp->expType = op1->type;
6482 if(op1->type)
6483 op1->type->refCount++;
6484 }
6485 return 0x1;
6486 }
6487
6488 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6489 {
6490 exp->type = 2;
6491 exp->string = PrintInt((++op1->i));
6492 if(!exp->expType)
6493 {
6494 exp->expType = op1->type;
6495 if(op1->type)
6496 op1->type->refCount++;
6497 }
6498 return 0x1;
6499 }
6500
6501 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6502 {
6503 exp->type = 2;
6504 exp->string = PrintUInt((++op1->ui));
6505 if(!exp->expType)
6506 {
6507 exp->expType = op1->type;
6508 if(op1->type)
6509 op1->type->refCount++;
6510 }
6511 return 0x1;
6512 }
6513
6514 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6515 {
6516 exp->type = 2;
6517 exp->string = PrintInt64((++op1->i));
6518 if(!exp->expType)
6519 {
6520 exp->expType = op1->type;
6521 if(op1->type)
6522 op1->type->refCount++;
6523 }
6524 return 0x1;
6525 }
6526
6527 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6528 {
6529 exp->type = 2;
6530 exp->string = PrintUInt64((++op1->ui));
6531 if(!exp->expType)
6532 {
6533 exp->expType = op1->type;
6534 if(op1->type)
6535 op1->type->refCount++;
6536 }
6537 return 0x1;
6538 }
6539
6540 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6541 {
6542 exp->type = 2;
6543 exp->string = PrintShort((++op1->s));
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 0x1;
6551 }
6552
6553 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6554 {
6555 exp->type = 2;
6556 exp->string = PrintUShort((++op1->us));
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 CharInc(struct Expression * exp, struct Operand * op1)
6567 {
6568 exp->type = 2;
6569 exp->string = PrintChar((++op1->c));
6570 if(!exp->expType)
6571 {
6572 exp->expType = op1->type;
6573 if(op1->type)
6574 op1->type->refCount++;
6575 }
6576 return 0x1;
6577 }
6578
6579 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6580 {
6581 exp->type = 2;
6582 exp->string = PrintUChar((++op1->uc));
6583 if(!exp->expType)
6584 {
6585 exp->expType = op1->type;
6586 if(op1->type)
6587 op1->type->refCount++;
6588 }
6589 return 0x1;
6590 }
6591
6592 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6593 {
6594 exp->type = 2;
6595 exp->string = PrintFloat((float)(++op1->f));
6596 if(!exp->expType)
6597 {
6598 exp->expType = op1->type;
6599 if(op1->type)
6600 op1->type->refCount++;
6601 }
6602 return 0x1;
6603 }
6604
6605 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6606 {
6607 exp->type = 2;
6608 exp->string = PrintDouble((double)(++op1->d));
6609 if(!exp->expType)
6610 {
6611 exp->expType = op1->type;
6612 if(op1->type)
6613 op1->type->refCount++;
6614 }
6615 return 0x1;
6616 }
6617
6618 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6619 {
6620 exp->type = 2;
6621 exp->string = PrintInt((--op1->i));
6622 if(!exp->expType)
6623 {
6624 exp->expType = op1->type;
6625 if(op1->type)
6626 op1->type->refCount++;
6627 }
6628 return 0x1;
6629 }
6630
6631 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6632 {
6633 exp->type = 2;
6634 exp->string = PrintUInt((--op1->ui));
6635 if(!exp->expType)
6636 {
6637 exp->expType = op1->type;
6638 if(op1->type)
6639 op1->type->refCount++;
6640 }
6641 return 0x1;
6642 }
6643
6644 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6645 {
6646 exp->type = 2;
6647 exp->string = PrintInt64((--op1->i));
6648 if(!exp->expType)
6649 {
6650 exp->expType = op1->type;
6651 if(op1->type)
6652 op1->type->refCount++;
6653 }
6654 return 0x1;
6655 }
6656
6657 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6658 {
6659 exp->type = 2;
6660 exp->string = PrintUInt64((--op1->ui));
6661 if(!exp->expType)
6662 {
6663 exp->expType = op1->type;
6664 if(op1->type)
6665 op1->type->refCount++;
6666 }
6667 return 0x1;
6668 }
6669
6670 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6671 {
6672 exp->type = 2;
6673 exp->string = PrintShort((--op1->s));
6674 if(!exp->expType)
6675 {
6676 exp->expType = op1->type;
6677 if(op1->type)
6678 op1->type->refCount++;
6679 }
6680 return 0x1;
6681 }
6682
6683 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6684 {
6685 exp->type = 2;
6686 exp->string = PrintUShort((--op1->us));
6687 if(!exp->expType)
6688 {
6689 exp->expType = op1->type;
6690 if(op1->type)
6691 op1->type->refCount++;
6692 }
6693 return 0x1;
6694 }
6695
6696 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6697 {
6698 exp->type = 2;
6699 exp->string = PrintChar((--op1->c));
6700 if(!exp->expType)
6701 {
6702 exp->expType = op1->type;
6703 if(op1->type)
6704 op1->type->refCount++;
6705 }
6706 return 0x1;
6707 }
6708
6709 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6710 {
6711 exp->type = 2;
6712 exp->string = PrintUChar((--op1->uc));
6713 if(!exp->expType)
6714 {
6715 exp->expType = op1->type;
6716 if(op1->type)
6717 op1->type->refCount++;
6718 }
6719 return 0x1;
6720 }
6721
6722 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6723 {
6724 exp->type = 2;
6725 exp->string = PrintFloat((float)(--op1->f));
6726 if(!exp->expType)
6727 {
6728 exp->expType = op1->type;
6729 if(op1->type)
6730 op1->type->refCount++;
6731 }
6732 return 0x1;
6733 }
6734
6735 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6736 {
6737 exp->type = 2;
6738 exp->string = PrintDouble((double)(--op1->d));
6739 if(!exp->expType)
6740 {
6741 exp->expType = op1->type;
6742 if(op1->type)
6743 op1->type->refCount++;
6744 }
6745 return 0x1;
6746 }
6747
6748 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 {
6750 int value2 = op2->i;
6751
6752 exp->type = 2;
6753 exp->string = PrintInt(op1->i = value2);
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 0x1;
6761 }
6762
6763 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 {
6765 unsigned int value2 = op2->ui;
6766
6767 exp->type = 2;
6768 exp->string = PrintUInt(op1->ui = value2);
6769 if(!exp->expType)
6770 {
6771 exp->expType = op1->type;
6772 if(op1->type)
6773 op1->type->refCount++;
6774 }
6775 return 0x1;
6776 }
6777
6778 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6779 {
6780 int value2 = op2->i;
6781
6782 exp->type = 2;
6783 exp->string = PrintInt64(op1->i = value2);
6784 if(!exp->expType)
6785 {
6786 exp->expType = op1->type;
6787 if(op1->type)
6788 op1->type->refCount++;
6789 }
6790 return 0x1;
6791 }
6792
6793 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6794 {
6795 unsigned int value2 = op2->ui;
6796
6797 exp->type = 2;
6798 exp->string = PrintUInt64(op1->ui = value2);
6799 if(!exp->expType)
6800 {
6801 exp->expType = op1->type;
6802 if(op1->type)
6803 op1->type->refCount++;
6804 }
6805 return 0x1;
6806 }
6807
6808 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6809 {
6810 short value2 = op2->s;
6811
6812 exp->type = 2;
6813 exp->string = PrintShort(op1->s = value2);
6814 if(!exp->expType)
6815 {
6816 exp->expType = op1->type;
6817 if(op1->type)
6818 op1->type->refCount++;
6819 }
6820 return 0x1;
6821 }
6822
6823 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6824 {
6825 unsigned short value2 = op2->us;
6826
6827 exp->type = 2;
6828 exp->string = PrintUShort(op1->us = value2);
6829 if(!exp->expType)
6830 {
6831 exp->expType = op1->type;
6832 if(op1->type)
6833 op1->type->refCount++;
6834 }
6835 return 0x1;
6836 }
6837
6838 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6839 {
6840 char value2 = op2->c;
6841
6842 exp->type = 2;
6843 exp->string = PrintChar(op1->c = value2);
6844 if(!exp->expType)
6845 {
6846 exp->expType = op1->type;
6847 if(op1->type)
6848 op1->type->refCount++;
6849 }
6850 return 0x1;
6851 }
6852
6853 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6854 {
6855 unsigned char value2 = op2->uc;
6856
6857 exp->type = 2;
6858 exp->string = PrintUChar(op1->uc = value2);
6859 if(!exp->expType)
6860 {
6861 exp->expType = op1->type;
6862 if(op1->type)
6863 op1->type->refCount++;
6864 }
6865 return 0x1;
6866 }
6867
6868 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6869 {
6870 float value2 = op2->f;
6871
6872 exp->type = 2;
6873 exp->string = PrintFloat(op1->f = value2);
6874 if(!exp->expType)
6875 {
6876 exp->expType = op1->type;
6877 if(op1->type)
6878 op1->type->refCount++;
6879 }
6880 return 0x1;
6881 }
6882
6883 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6884 {
6885 double value2 = op2->d;
6886
6887 exp->type = 2;
6888 exp->string = PrintDouble(op1->d = value2);
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 0x1;
6896 }
6897
6898 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6899 {
6900 int value2 = op2->i;
6901
6902 exp->type = 2;
6903 exp->string = PrintInt(op1->i += value2);
6904 if(!exp->expType)
6905 {
6906 exp->expType = op1->type;
6907 if(op1->type)
6908 op1->type->refCount++;
6909 }
6910 return 0x1;
6911 }
6912
6913 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6914 {
6915 unsigned int value2 = op2->ui;
6916
6917 exp->type = 2;
6918 exp->string = PrintUInt(op1->ui += value2);
6919 if(!exp->expType)
6920 {
6921 exp->expType = op1->type;
6922 if(op1->type)
6923 op1->type->refCount++;
6924 }
6925 return 0x1;
6926 }
6927
6928 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6929 {
6930 int value2 = op2->i;
6931
6932 exp->type = 2;
6933 exp->string = PrintInt64(op1->i += value2);
6934 if(!exp->expType)
6935 {
6936 exp->expType = op1->type;
6937 if(op1->type)
6938 op1->type->refCount++;
6939 }
6940 return 0x1;
6941 }
6942
6943 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6944 {
6945 unsigned int value2 = op2->ui;
6946
6947 exp->type = 2;
6948 exp->string = PrintUInt64(op1->ui += value2);
6949 if(!exp->expType)
6950 {
6951 exp->expType = op1->type;
6952 if(op1->type)
6953 op1->type->refCount++;
6954 }
6955 return 0x1;
6956 }
6957
6958 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 {
6960 short value2 = op2->s;
6961
6962 exp->type = 2;
6963 exp->string = PrintShort(op1->s += value2);
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 0x1;
6971 }
6972
6973 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 {
6975 unsigned short value2 = op2->us;
6976
6977 exp->type = 2;
6978 exp->string = PrintUShort(op1->us += value2);
6979 if(!exp->expType)
6980 {
6981 exp->expType = op1->type;
6982 if(op1->type)
6983 op1->type->refCount++;
6984 }
6985 return 0x1;
6986 }
6987
6988 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 {
6990 char value2 = op2->c;
6991
6992 exp->type = 2;
6993 exp->string = PrintChar(op1->c += value2);
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 0x1;
7001 }
7002
7003 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 {
7005 unsigned char value2 = op2->uc;
7006
7007 exp->type = 2;
7008 exp->string = PrintUChar(op1->uc += value2);
7009 if(!exp->expType)
7010 {
7011 exp->expType = op1->type;
7012 if(op1->type)
7013 op1->type->refCount++;
7014 }
7015 return 0x1;
7016 }
7017
7018 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 {
7020 float value2 = op2->f;
7021
7022 exp->type = 2;
7023 exp->string = PrintFloat(op1->f += value2);
7024 if(!exp->expType)
7025 {
7026 exp->expType = op1->type;
7027 if(op1->type)
7028 op1->type->refCount++;
7029 }
7030 return 0x1;
7031 }
7032
7033 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 {
7035 double value2 = op2->d;
7036
7037 exp->type = 2;
7038 exp->string = PrintDouble(op1->d += value2);
7039 if(!exp->expType)
7040 {
7041 exp->expType = op1->type;
7042 if(op1->type)
7043 op1->type->refCount++;
7044 }
7045 return 0x1;
7046 }
7047
7048 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 {
7050 int value2 = op2->i;
7051
7052 exp->type = 2;
7053 exp->string = PrintInt(op1->i -= value2);
7054 if(!exp->expType)
7055 {
7056 exp->expType = op1->type;
7057 if(op1->type)
7058 op1->type->refCount++;
7059 }
7060 return 0x1;
7061 }
7062
7063 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 {
7065 unsigned int value2 = op2->ui;
7066
7067 exp->type = 2;
7068 exp->string = PrintUInt(op1->ui -= value2);
7069 if(!exp->expType)
7070 {
7071 exp->expType = op1->type;
7072 if(op1->type)
7073 op1->type->refCount++;
7074 }
7075 return 0x1;
7076 }
7077
7078 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 {
7080 int value2 = op2->i;
7081
7082 exp->type = 2;
7083 exp->string = PrintInt64(op1->i -= value2);
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 0x1;
7091 }
7092
7093 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 {
7095 unsigned int value2 = op2->ui;
7096
7097 exp->type = 2;
7098 exp->string = PrintUInt64(op1->ui -= value2);
7099 if(!exp->expType)
7100 {
7101 exp->expType = op1->type;
7102 if(op1->type)
7103 op1->type->refCount++;
7104 }
7105 return 0x1;
7106 }
7107
7108 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 {
7110 short value2 = op2->s;
7111
7112 exp->type = 2;
7113 exp->string = PrintShort(op1->s -= value2);
7114 if(!exp->expType)
7115 {
7116 exp->expType = op1->type;
7117 if(op1->type)
7118 op1->type->refCount++;
7119 }
7120 return 0x1;
7121 }
7122
7123 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 {
7125 unsigned short value2 = op2->us;
7126
7127 exp->type = 2;
7128 exp->string = PrintUShort(op1->us -= value2);
7129 if(!exp->expType)
7130 {
7131 exp->expType = op1->type;
7132 if(op1->type)
7133 op1->type->refCount++;
7134 }
7135 return 0x1;
7136 }
7137
7138 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 {
7140 char value2 = op2->c;
7141
7142 exp->type = 2;
7143 exp->string = PrintChar(op1->c -= value2);
7144 if(!exp->expType)
7145 {
7146 exp->expType = op1->type;
7147 if(op1->type)
7148 op1->type->refCount++;
7149 }
7150 return 0x1;
7151 }
7152
7153 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 {
7155 unsigned char value2 = op2->uc;
7156
7157 exp->type = 2;
7158 exp->string = PrintUChar(op1->uc -= value2);
7159 if(!exp->expType)
7160 {
7161 exp->expType = op1->type;
7162 if(op1->type)
7163 op1->type->refCount++;
7164 }
7165 return 0x1;
7166 }
7167
7168 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 {
7170 float value2 = op2->f;
7171
7172 exp->type = 2;
7173 exp->string = PrintFloat(op1->f -= value2);
7174 if(!exp->expType)
7175 {
7176 exp->expType = op1->type;
7177 if(op1->type)
7178 op1->type->refCount++;
7179 }
7180 return 0x1;
7181 }
7182
7183 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 {
7185 double value2 = op2->d;
7186
7187 exp->type = 2;
7188 exp->string = PrintDouble(op1->d -= value2);
7189 if(!exp->expType)
7190 {
7191 exp->expType = op1->type;
7192 if(op1->type)
7193 op1->type->refCount++;
7194 }
7195 return 0x1;
7196 }
7197
7198 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 {
7200 int value2 = op2->i;
7201
7202 exp->type = 2;
7203 exp->string = PrintInt(op1->i *= value2);
7204 if(!exp->expType)
7205 {
7206 exp->expType = op1->type;
7207 if(op1->type)
7208 op1->type->refCount++;
7209 }
7210 return 0x1;
7211 }
7212
7213 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 {
7215 unsigned int value2 = op2->ui;
7216
7217 exp->type = 2;
7218 exp->string = PrintUInt(op1->ui *= value2);
7219 if(!exp->expType)
7220 {
7221 exp->expType = op1->type;
7222 if(op1->type)
7223 op1->type->refCount++;
7224 }
7225 return 0x1;
7226 }
7227
7228 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 {
7230 int value2 = op2->i;
7231
7232 exp->type = 2;
7233 exp->string = PrintInt64(op1->i *= value2);
7234 if(!exp->expType)
7235 {
7236 exp->expType = op1->type;
7237 if(op1->type)
7238 op1->type->refCount++;
7239 }
7240 return 0x1;
7241 }
7242
7243 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 {
7245 unsigned int value2 = op2->ui;
7246
7247 exp->type = 2;
7248 exp->string = PrintUInt64(op1->ui *= value2);
7249 if(!exp->expType)
7250 {
7251 exp->expType = op1->type;
7252 if(op1->type)
7253 op1->type->refCount++;
7254 }
7255 return 0x1;
7256 }
7257
7258 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 {
7260 short value2 = op2->s;
7261
7262 exp->type = 2;
7263 exp->string = PrintShort(op1->s *= value2);
7264 if(!exp->expType)
7265 {
7266 exp->expType = op1->type;
7267 if(op1->type)
7268 op1->type->refCount++;
7269 }
7270 return 0x1;
7271 }
7272
7273 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 {
7275 unsigned short value2 = op2->us;
7276
7277 exp->type = 2;
7278 exp->string = PrintUShort(op1->us *= value2);
7279 if(!exp->expType)
7280 {
7281 exp->expType = op1->type;
7282 if(op1->type)
7283 op1->type->refCount++;
7284 }
7285 return 0x1;
7286 }
7287
7288 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 {
7290 char value2 = op2->c;
7291
7292 exp->type = 2;
7293 exp->string = PrintChar(op1->c *= value2);
7294 if(!exp->expType)
7295 {
7296 exp->expType = op1->type;
7297 if(op1->type)
7298 op1->type->refCount++;
7299 }
7300 return 0x1;
7301 }
7302
7303 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 {
7305 unsigned char value2 = op2->uc;
7306
7307 exp->type = 2;
7308 exp->string = PrintUChar(op1->uc *= value2);
7309 if(!exp->expType)
7310 {
7311 exp->expType = op1->type;
7312 if(op1->type)
7313 op1->type->refCount++;
7314 }
7315 return 0x1;
7316 }
7317
7318 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 {
7320 float value2 = op2->f;
7321
7322 exp->type = 2;
7323 exp->string = PrintFloat(op1->f *= value2);
7324 if(!exp->expType)
7325 {
7326 exp->expType = op1->type;
7327 if(op1->type)
7328 op1->type->refCount++;
7329 }
7330 return 0x1;
7331 }
7332
7333 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 {
7335 double value2 = op2->d;
7336
7337 exp->type = 2;
7338 exp->string = PrintDouble(op1->d *= value2);
7339 if(!exp->expType)
7340 {
7341 exp->expType = op1->type;
7342 if(op1->type)
7343 op1->type->refCount++;
7344 }
7345 return 0x1;
7346 }
7347
7348 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 {
7350 int value2 = op2->i;
7351
7352 exp->type = 2;
7353 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7354 if(!exp->expType)
7355 {
7356 exp->expType = op1->type;
7357 if(op1->type)
7358 op1->type->refCount++;
7359 }
7360 return 0x1;
7361 }
7362
7363 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 {
7365 unsigned int value2 = op2->ui;
7366
7367 exp->type = 2;
7368 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7369 if(!exp->expType)
7370 {
7371 exp->expType = op1->type;
7372 if(op1->type)
7373 op1->type->refCount++;
7374 }
7375 return 0x1;
7376 }
7377
7378 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 {
7380 int value2 = op2->i;
7381
7382 exp->type = 2;
7383 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7384 if(!exp->expType)
7385 {
7386 exp->expType = op1->type;
7387 if(op1->type)
7388 op1->type->refCount++;
7389 }
7390 return 0x1;
7391 }
7392
7393 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 {
7395 unsigned int value2 = op2->ui;
7396
7397 exp->type = 2;
7398 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7399 if(!exp->expType)
7400 {
7401 exp->expType = op1->type;
7402 if(op1->type)
7403 op1->type->refCount++;
7404 }
7405 return 0x1;
7406 }
7407
7408 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 {
7410 short value2 = op2->s;
7411
7412 exp->type = 2;
7413 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7414 if(!exp->expType)
7415 {
7416 exp->expType = op1->type;
7417 if(op1->type)
7418 op1->type->refCount++;
7419 }
7420 return 0x1;
7421 }
7422
7423 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 {
7425 unsigned short value2 = op2->us;
7426
7427 exp->type = 2;
7428 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7429 if(!exp->expType)
7430 {
7431 exp->expType = op1->type;
7432 if(op1->type)
7433 op1->type->refCount++;
7434 }
7435 return 0x1;
7436 }
7437
7438 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 {
7440 char value2 = op2->c;
7441
7442 exp->type = 2;
7443 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7444 if(!exp->expType)
7445 {
7446 exp->expType = op1->type;
7447 if(op1->type)
7448 op1->type->refCount++;
7449 }
7450 return 0x1;
7451 }
7452
7453 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 {
7455 unsigned char value2 = op2->uc;
7456
7457 exp->type = 2;
7458 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7459 if(!exp->expType)
7460 {
7461 exp->expType = op1->type;
7462 if(op1->type)
7463 op1->type->refCount++;
7464 }
7465 return 0x1;
7466 }
7467
7468 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 {
7470 float value2 = op2->f;
7471
7472 exp->type = 2;
7473 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7474 if(!exp->expType)
7475 {
7476 exp->expType = op1->type;
7477 if(op1->type)
7478 op1->type->refCount++;
7479 }
7480 return 0x1;
7481 }
7482
7483 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 {
7485 double value2 = op2->d;
7486
7487 exp->type = 2;
7488 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7489 if(!exp->expType)
7490 {
7491 exp->expType = op1->type;
7492 if(op1->type)
7493 op1->type->refCount++;
7494 }
7495 return 0x1;
7496 }
7497
7498 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7499 {
7500 int value2 = op2->i;
7501
7502 exp->type = 2;
7503 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7504 if(!exp->expType)
7505 {
7506 exp->expType = op1->type;
7507 if(op1->type)
7508 op1->type->refCount++;
7509 }
7510 return 0x1;
7511 }
7512
7513 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 {
7515 unsigned int value2 = op2->ui;
7516
7517 exp->type = 2;
7518 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7519 if(!exp->expType)
7520 {
7521 exp->expType = op1->type;
7522 if(op1->type)
7523 op1->type->refCount++;
7524 }
7525 return 0x1;
7526 }
7527
7528 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 {
7530 int value2 = op2->i;
7531
7532 exp->type = 2;
7533 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7534 if(!exp->expType)
7535 {
7536 exp->expType = op1->type;
7537 if(op1->type)
7538 op1->type->refCount++;
7539 }
7540 return 0x1;
7541 }
7542
7543 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 {
7545 unsigned int value2 = op2->ui;
7546
7547 exp->type = 2;
7548 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7549 if(!exp->expType)
7550 {
7551 exp->expType = op1->type;
7552 if(op1->type)
7553 op1->type->refCount++;
7554 }
7555 return 0x1;
7556 }
7557
7558 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 {
7560 short value2 = op2->s;
7561
7562 exp->type = 2;
7563 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7564 if(!exp->expType)
7565 {
7566 exp->expType = op1->type;
7567 if(op1->type)
7568 op1->type->refCount++;
7569 }
7570 return 0x1;
7571 }
7572
7573 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 {
7575 unsigned short value2 = op2->us;
7576
7577 exp->type = 2;
7578 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7579 if(!exp->expType)
7580 {
7581 exp->expType = op1->type;
7582 if(op1->type)
7583 op1->type->refCount++;
7584 }
7585 return 0x1;
7586 }
7587
7588 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 {
7590 char value2 = op2->c;
7591
7592 exp->type = 2;
7593 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7594 if(!exp->expType)
7595 {
7596 exp->expType = op1->type;
7597 if(op1->type)
7598 op1->type->refCount++;
7599 }
7600 return 0x1;
7601 }
7602
7603 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 {
7605 unsigned char value2 = op2->uc;
7606
7607 exp->type = 2;
7608 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7609 if(!exp->expType)
7610 {
7611 exp->expType = op1->type;
7612 if(op1->type)
7613 op1->type->refCount++;
7614 }
7615 return 0x1;
7616 }
7617
7618 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 {
7620 int value2 = op2->i;
7621
7622 exp->type = 2;
7623 exp->string = PrintInt(op1->i & value2);
7624 if(!exp->expType)
7625 {
7626 exp->expType = op1->type;
7627 if(op1->type)
7628 op1->type->refCount++;
7629 }
7630 return 0x1;
7631 }
7632
7633 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 {
7635 unsigned int value2 = op2->ui;
7636
7637 exp->type = 2;
7638 exp->string = PrintUInt(op1->ui & value2);
7639 if(!exp->expType)
7640 {
7641 exp->expType = op1->type;
7642 if(op1->type)
7643 op1->type->refCount++;
7644 }
7645 return 0x1;
7646 }
7647
7648 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 {
7650 int value2 = op2->i;
7651
7652 exp->type = 2;
7653 exp->string = PrintInt64(op1->i & value2);
7654 if(!exp->expType)
7655 {
7656 exp->expType = op1->type;
7657 if(op1->type)
7658 op1->type->refCount++;
7659 }
7660 return 0x1;
7661 }
7662
7663 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 {
7665 unsigned int value2 = op2->ui;
7666
7667 exp->type = 2;
7668 exp->string = PrintUInt64(op1->ui & value2);
7669 if(!exp->expType)
7670 {
7671 exp->expType = op1->type;
7672 if(op1->type)
7673 op1->type->refCount++;
7674 }
7675 return 0x1;
7676 }
7677
7678 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 {
7680 short value2 = op2->s;
7681
7682 exp->type = 2;
7683 exp->string = PrintShort(op1->s & value2);
7684 if(!exp->expType)
7685 {
7686 exp->expType = op1->type;
7687 if(op1->type)
7688 op1->type->refCount++;
7689 }
7690 return 0x1;
7691 }
7692
7693 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 {
7695 unsigned short value2 = op2->us;
7696
7697 exp->type = 2;
7698 exp->string = PrintUShort(op1->us & value2);
7699 if(!exp->expType)
7700 {
7701 exp->expType = op1->type;
7702 if(op1->type)
7703 op1->type->refCount++;
7704 }
7705 return 0x1;
7706 }
7707
7708 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 {
7710 char value2 = op2->c;
7711
7712 exp->type = 2;
7713 exp->string = PrintChar(op1->c & value2);
7714 if(!exp->expType)
7715 {
7716 exp->expType = op1->type;
7717 if(op1->type)
7718 op1->type->refCount++;
7719 }
7720 return 0x1;
7721 }
7722
7723 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 {
7725 unsigned char value2 = op2->uc;
7726
7727 exp->type = 2;
7728 exp->string = PrintUChar(op1->uc & value2);
7729 if(!exp->expType)
7730 {
7731 exp->expType = op1->type;
7732 if(op1->type)
7733 op1->type->refCount++;
7734 }
7735 return 0x1;
7736 }
7737
7738 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 {
7740 int value2 = op2->i;
7741
7742 exp->type = 2;
7743 exp->string = PrintInt(op1->i | value2);
7744 if(!exp->expType)
7745 {
7746 exp->expType = op1->type;
7747 if(op1->type)
7748 op1->type->refCount++;
7749 }
7750 return 0x1;
7751 }
7752
7753 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 {
7755 unsigned int value2 = op2->ui;
7756
7757 exp->type = 2;
7758 exp->string = PrintUInt(op1->ui | value2);
7759 if(!exp->expType)
7760 {
7761 exp->expType = op1->type;
7762 if(op1->type)
7763 op1->type->refCount++;
7764 }
7765 return 0x1;
7766 }
7767
7768 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 {
7770 int value2 = op2->i;
7771
7772 exp->type = 2;
7773 exp->string = PrintInt64(op1->i | value2);
7774 if(!exp->expType)
7775 {
7776 exp->expType = op1->type;
7777 if(op1->type)
7778 op1->type->refCount++;
7779 }
7780 return 0x1;
7781 }
7782
7783 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 {
7785 unsigned int value2 = op2->ui;
7786
7787 exp->type = 2;
7788 exp->string = PrintUInt64(op1->ui | value2);
7789 if(!exp->expType)
7790 {
7791 exp->expType = op1->type;
7792 if(op1->type)
7793 op1->type->refCount++;
7794 }
7795 return 0x1;
7796 }
7797
7798 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 {
7800 short value2 = op2->s;
7801
7802 exp->type = 2;
7803 exp->string = PrintShort(op1->s | value2);
7804 if(!exp->expType)
7805 {
7806 exp->expType = op1->type;
7807 if(op1->type)
7808 op1->type->refCount++;
7809 }
7810 return 0x1;
7811 }
7812
7813 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 {
7815 unsigned short value2 = op2->us;
7816
7817 exp->type = 2;
7818 exp->string = PrintUShort(op1->us | value2);
7819 if(!exp->expType)
7820 {
7821 exp->expType = op1->type;
7822 if(op1->type)
7823 op1->type->refCount++;
7824 }
7825 return 0x1;
7826 }
7827
7828 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 {
7830 char value2 = op2->c;
7831
7832 exp->type = 2;
7833 exp->string = PrintChar(op1->c | value2);
7834 if(!exp->expType)
7835 {
7836 exp->expType = op1->type;
7837 if(op1->type)
7838 op1->type->refCount++;
7839 }
7840 return 0x1;
7841 }
7842
7843 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 {
7845 unsigned char value2 = op2->uc;
7846
7847 exp->type = 2;
7848 exp->string = PrintUChar(op1->uc | value2);
7849 if(!exp->expType)
7850 {
7851 exp->expType = op1->type;
7852 if(op1->type)
7853 op1->type->refCount++;
7854 }
7855 return 0x1;
7856 }
7857
7858 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 {
7860 int value2 = op2->i;
7861
7862 exp->type = 2;
7863 exp->string = PrintInt(op1->i ^ value2);
7864 if(!exp->expType)
7865 {
7866 exp->expType = op1->type;
7867 if(op1->type)
7868 op1->type->refCount++;
7869 }
7870 return 0x1;
7871 }
7872
7873 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 {
7875 unsigned int value2 = op2->ui;
7876
7877 exp->type = 2;
7878 exp->string = PrintUInt(op1->ui ^ value2);
7879 if(!exp->expType)
7880 {
7881 exp->expType = op1->type;
7882 if(op1->type)
7883 op1->type->refCount++;
7884 }
7885 return 0x1;
7886 }
7887
7888 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 {
7890 int value2 = op2->i;
7891
7892 exp->type = 2;
7893 exp->string = PrintInt64(op1->i ^ value2);
7894 if(!exp->expType)
7895 {
7896 exp->expType = op1->type;
7897 if(op1->type)
7898 op1->type->refCount++;
7899 }
7900 return 0x1;
7901 }
7902
7903 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 {
7905 unsigned int value2 = op2->ui;
7906
7907 exp->type = 2;
7908 exp->string = PrintUInt64(op1->ui ^ value2);
7909 if(!exp->expType)
7910 {
7911 exp->expType = op1->type;
7912 if(op1->type)
7913 op1->type->refCount++;
7914 }
7915 return 0x1;
7916 }
7917
7918 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 {
7920 short value2 = op2->s;
7921
7922 exp->type = 2;
7923 exp->string = PrintShort(op1->s ^ value2);
7924 if(!exp->expType)
7925 {
7926 exp->expType = op1->type;
7927 if(op1->type)
7928 op1->type->refCount++;
7929 }
7930 return 0x1;
7931 }
7932
7933 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 {
7935 unsigned short value2 = op2->us;
7936
7937 exp->type = 2;
7938 exp->string = PrintUShort(op1->us ^ value2);
7939 if(!exp->expType)
7940 {
7941 exp->expType = op1->type;
7942 if(op1->type)
7943 op1->type->refCount++;
7944 }
7945 return 0x1;
7946 }
7947
7948 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 {
7950 char value2 = op2->c;
7951
7952 exp->type = 2;
7953 exp->string = PrintChar(op1->c ^ value2);
7954 if(!exp->expType)
7955 {
7956 exp->expType = op1->type;
7957 if(op1->type)
7958 op1->type->refCount++;
7959 }
7960 return 0x1;
7961 }
7962
7963 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7964 {
7965 unsigned char value2 = op2->uc;
7966
7967 exp->type = 2;
7968 exp->string = PrintUChar(op1->uc ^ value2);
7969 if(!exp->expType)
7970 {
7971 exp->expType = op1->type;
7972 if(op1->type)
7973 op1->type->refCount++;
7974 }
7975 return 0x1;
7976 }
7977
7978 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7979 {
7980 int value2 = op2->i;
7981
7982 exp->type = 2;
7983 exp->string = PrintInt(op1->i << value2);
7984 if(!exp->expType)
7985 {
7986 exp->expType = op1->type;
7987 if(op1->type)
7988 op1->type->refCount++;
7989 }
7990 return 0x1;
7991 }
7992
7993 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7994 {
7995 unsigned int value2 = op2->ui;
7996
7997 exp->type = 2;
7998 exp->string = PrintUInt(op1->ui << value2);
7999 if(!exp->expType)
8000 {
8001 exp->expType = op1->type;
8002 if(op1->type)
8003 op1->type->refCount++;
8004 }
8005 return 0x1;
8006 }
8007
8008 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8009 {
8010 int value2 = op2->i;
8011
8012 exp->type = 2;
8013 exp->string = PrintInt64(op1->i << value2);
8014 if(!exp->expType)
8015 {
8016 exp->expType = op1->type;
8017 if(op1->type)
8018 op1->type->refCount++;
8019 }
8020 return 0x1;
8021 }
8022
8023 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8024 {
8025 unsigned int value2 = op2->ui;
8026
8027 exp->type = 2;
8028 exp->string = PrintUInt64(op1->ui << value2);
8029 if(!exp->expType)
8030 {
8031 exp->expType = op1->type;
8032 if(op1->type)
8033 op1->type->refCount++;
8034 }
8035 return 0x1;
8036 }
8037
8038 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8039 {
8040 short value2 = op2->s;
8041
8042 exp->type = 2;
8043 exp->string = PrintShort(op1->s << value2);
8044 if(!exp->expType)
8045 {
8046 exp->expType = op1->type;
8047 if(op1->type)
8048 op1->type->refCount++;
8049 }
8050 return 0x1;
8051 }
8052
8053 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8054 {
8055 unsigned short value2 = op2->us;
8056
8057 exp->type = 2;
8058 exp->string = PrintUShort(op1->us << value2);
8059 if(!exp->expType)
8060 {
8061 exp->expType = op1->type;
8062 if(op1->type)
8063 op1->type->refCount++;
8064 }
8065 return 0x1;
8066 }
8067
8068 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8069 {
8070 char value2 = op2->c;
8071
8072 exp->type = 2;
8073 exp->string = PrintChar(op1->c << value2);
8074 if(!exp->expType)
8075 {
8076 exp->expType = op1->type;
8077 if(op1->type)
8078 op1->type->refCount++;
8079 }
8080 return 0x1;
8081 }
8082
8083 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8084 {
8085 unsigned char value2 = op2->uc;
8086
8087 exp->type = 2;
8088 exp->string = PrintUChar(op1->uc << value2);
8089 if(!exp->expType)
8090 {
8091 exp->expType = op1->type;
8092 if(op1->type)
8093 op1->type->refCount++;
8094 }
8095 return 0x1;
8096 }
8097
8098 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8099 {
8100 int value2 = op2->i;
8101
8102 exp->type = 2;
8103 exp->string = PrintInt(op1->i >> value2);
8104 if(!exp->expType)
8105 {
8106 exp->expType = op1->type;
8107 if(op1->type)
8108 op1->type->refCount++;
8109 }
8110 return 0x1;
8111 }
8112
8113 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 {
8115 unsigned int value2 = op2->ui;
8116
8117 exp->type = 2;
8118 exp->string = PrintUInt(op1->ui >> value2);
8119 if(!exp->expType)
8120 {
8121 exp->expType = op1->type;
8122 if(op1->type)
8123 op1->type->refCount++;
8124 }
8125 return 0x1;
8126 }
8127
8128 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 {
8130 int value2 = op2->i;
8131
8132 exp->type = 2;
8133 exp->string = PrintInt64(op1->i >> value2);
8134 if(!exp->expType)
8135 {
8136 exp->expType = op1->type;
8137 if(op1->type)
8138 op1->type->refCount++;
8139 }
8140 return 0x1;
8141 }
8142
8143 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 {
8145 unsigned int value2 = op2->ui;
8146
8147 exp->type = 2;
8148 exp->string = PrintUInt64(op1->ui >> value2);
8149 if(!exp->expType)
8150 {
8151 exp->expType = op1->type;
8152 if(op1->type)
8153 op1->type->refCount++;
8154 }
8155 return 0x1;
8156 }
8157
8158 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 {
8160 short value2 = op2->s;
8161
8162 exp->type = 2;
8163 exp->string = PrintShort(op1->s >> value2);
8164 if(!exp->expType)
8165 {
8166 exp->expType = op1->type;
8167 if(op1->type)
8168 op1->type->refCount++;
8169 }
8170 return 0x1;
8171 }
8172
8173 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 {
8175 unsigned short value2 = op2->us;
8176
8177 exp->type = 2;
8178 exp->string = PrintUShort(op1->us >> value2);
8179 if(!exp->expType)
8180 {
8181 exp->expType = op1->type;
8182 if(op1->type)
8183 op1->type->refCount++;
8184 }
8185 return 0x1;
8186 }
8187
8188 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 {
8190 char value2 = op2->c;
8191
8192 exp->type = 2;
8193 exp->string = PrintChar(op1->c >> value2);
8194 if(!exp->expType)
8195 {
8196 exp->expType = op1->type;
8197 if(op1->type)
8198 op1->type->refCount++;
8199 }
8200 return 0x1;
8201 }
8202
8203 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 {
8205 unsigned char value2 = op2->uc;
8206
8207 exp->type = 2;
8208 exp->string = PrintUChar(op1->uc >> value2);
8209 if(!exp->expType)
8210 {
8211 exp->expType = op1->type;
8212 if(op1->type)
8213 op1->type->refCount++;
8214 }
8215 return 0x1;
8216 }
8217
8218 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8219 {
8220 exp->type = 2;
8221 exp->string = PrintInt((~op1->i));
8222 if(!exp->expType)
8223 {
8224 exp->expType = op1->type;
8225 if(op1->type)
8226 op1->type->refCount++;
8227 }
8228 return 0x1;
8229 }
8230
8231 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8232 {
8233 exp->type = 2;
8234 exp->string = PrintUInt((unsigned int)(~op1->ui));
8235 if(!exp->expType)
8236 {
8237 exp->expType = op1->type;
8238 if(op1->type)
8239 op1->type->refCount++;
8240 }
8241 return 0x1;
8242 }
8243
8244 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8245 {
8246 exp->type = 2;
8247 exp->string = PrintInt64((~op1->i));
8248 if(!exp->expType)
8249 {
8250 exp->expType = op1->type;
8251 if(op1->type)
8252 op1->type->refCount++;
8253 }
8254 return 0x1;
8255 }
8256
8257 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8258 {
8259 exp->type = 2;
8260 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8261 if(!exp->expType)
8262 {
8263 exp->expType = op1->type;
8264 if(op1->type)
8265 op1->type->refCount++;
8266 }
8267 return 0x1;
8268 }
8269
8270 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8271 {
8272 exp->type = 2;
8273 exp->string = PrintShort((short)(~op1->s));
8274 if(!exp->expType)
8275 {
8276 exp->expType = op1->type;
8277 if(op1->type)
8278 op1->type->refCount++;
8279 }
8280 return 0x1;
8281 }
8282
8283 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8284 {
8285 exp->type = 2;
8286 exp->string = PrintUShort((unsigned short)(~op1->us));
8287 if(!exp->expType)
8288 {
8289 exp->expType = op1->type;
8290 if(op1->type)
8291 op1->type->refCount++;
8292 }
8293 return 0x1;
8294 }
8295
8296 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8297 {
8298 exp->type = 2;
8299 exp->string = PrintChar((char)(~op1->c));
8300 if(!exp->expType)
8301 {
8302 exp->expType = op1->type;
8303 if(op1->type)
8304 op1->type->refCount++;
8305 }
8306 return 0x1;
8307 }
8308
8309 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8310 {
8311 exp->type = 2;
8312 exp->string = PrintUChar((unsigned char)(~op1->uc));
8313 if(!exp->expType)
8314 {
8315 exp->expType = op1->type;
8316 if(op1->type)
8317 op1->type->refCount++;
8318 }
8319 return 0x1;
8320 }
8321
8322 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8323 {
8324 int value2 = op2->i;
8325
8326 exp->type = 2;
8327 exp->string = PrintInt(op1->i &= value2);
8328 if(!exp->expType)
8329 {
8330 exp->expType = op1->type;
8331 if(op1->type)
8332 op1->type->refCount++;
8333 }
8334 return 0x1;
8335 }
8336
8337 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8338 {
8339 unsigned int value2 = op2->ui;
8340
8341 exp->type = 2;
8342 exp->string = PrintUInt(op1->ui &= value2);
8343 if(!exp->expType)
8344 {
8345 exp->expType = op1->type;
8346 if(op1->type)
8347 op1->type->refCount++;
8348 }
8349 return 0x1;
8350 }
8351
8352 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8353 {
8354 int value2 = op2->i;
8355
8356 exp->type = 2;
8357 exp->string = PrintInt64(op1->i &= value2);
8358 if(!exp->expType)
8359 {
8360 exp->expType = op1->type;
8361 if(op1->type)
8362 op1->type->refCount++;
8363 }
8364 return 0x1;
8365 }
8366
8367 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8368 {
8369 unsigned int value2 = op2->ui;
8370
8371 exp->type = 2;
8372 exp->string = PrintUInt64(op1->ui &= value2);
8373 if(!exp->expType)
8374 {
8375 exp->expType = op1->type;
8376 if(op1->type)
8377 op1->type->refCount++;
8378 }
8379 return 0x1;
8380 }
8381
8382 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8383 {
8384 short value2 = op2->s;
8385
8386 exp->type = 2;
8387 exp->string = PrintShort(op1->s &= value2);
8388 if(!exp->expType)
8389 {
8390 exp->expType = op1->type;
8391 if(op1->type)
8392 op1->type->refCount++;
8393 }
8394 return 0x1;
8395 }
8396
8397 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8398 {
8399 unsigned short value2 = op2->us;
8400
8401 exp->type = 2;
8402 exp->string = PrintUShort(op1->us &= value2);
8403 if(!exp->expType)
8404 {
8405 exp->expType = op1->type;
8406 if(op1->type)
8407 op1->type->refCount++;
8408 }
8409 return 0x1;
8410 }
8411
8412 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8413 {
8414 char value2 = op2->c;
8415
8416 exp->type = 2;
8417 exp->string = PrintChar(op1->c &= value2);
8418 if(!exp->expType)
8419 {
8420 exp->expType = op1->type;
8421 if(op1->type)
8422 op1->type->refCount++;
8423 }
8424 return 0x1;
8425 }
8426
8427 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8428 {
8429 unsigned char value2 = op2->uc;
8430
8431 exp->type = 2;
8432 exp->string = PrintUChar(op1->uc &= value2);
8433 if(!exp->expType)
8434 {
8435 exp->expType = op1->type;
8436 if(op1->type)
8437 op1->type->refCount++;
8438 }
8439 return 0x1;
8440 }
8441
8442 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8443 {
8444 int value2 = op2->i;
8445
8446 exp->type = 2;
8447 exp->string = PrintInt(op1->i |= value2);
8448 if(!exp->expType)
8449 {
8450 exp->expType = op1->type;
8451 if(op1->type)
8452 op1->type->refCount++;
8453 }
8454 return 0x1;
8455 }
8456
8457 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8458 {
8459 unsigned int value2 = op2->ui;
8460
8461 exp->type = 2;
8462 exp->string = PrintUInt(op1->ui |= value2);
8463 if(!exp->expType)
8464 {
8465 exp->expType = op1->type;
8466 if(op1->type)
8467 op1->type->refCount++;
8468 }
8469 return 0x1;
8470 }
8471
8472 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8473 {
8474 int value2 = op2->i;
8475
8476 exp->type = 2;
8477 exp->string = PrintInt64(op1->i |= value2);
8478 if(!exp->expType)
8479 {
8480 exp->expType = op1->type;
8481 if(op1->type)
8482 op1->type->refCount++;
8483 }
8484 return 0x1;
8485 }
8486
8487 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8488 {
8489 unsigned int value2 = op2->ui;
8490
8491 exp->type = 2;
8492 exp->string = PrintUInt64(op1->ui |= value2);
8493 if(!exp->expType)
8494 {
8495 exp->expType = op1->type;
8496 if(op1->type)
8497 op1->type->refCount++;
8498 }
8499 return 0x1;
8500 }
8501
8502 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8503 {
8504 short value2 = op2->s;
8505
8506 exp->type = 2;
8507 exp->string = PrintShort(op1->s |= value2);
8508 if(!exp->expType)
8509 {
8510 exp->expType = op1->type;
8511 if(op1->type)
8512 op1->type->refCount++;
8513 }
8514 return 0x1;
8515 }
8516
8517 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8518 {
8519 unsigned short value2 = op2->us;
8520
8521 exp->type = 2;
8522 exp->string = PrintUShort(op1->us |= value2);
8523 if(!exp->expType)
8524 {
8525 exp->expType = op1->type;
8526 if(op1->type)
8527 op1->type->refCount++;
8528 }
8529 return 0x1;
8530 }
8531
8532 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8533 {
8534 char value2 = op2->c;
8535
8536 exp->type = 2;
8537 exp->string = PrintChar(op1->c |= value2);
8538 if(!exp->expType)
8539 {
8540 exp->expType = op1->type;
8541 if(op1->type)
8542 op1->type->refCount++;
8543 }
8544 return 0x1;
8545 }
8546
8547 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8548 {
8549 unsigned char value2 = op2->uc;
8550
8551 exp->type = 2;
8552 exp->string = PrintUChar(op1->uc |= value2);
8553 if(!exp->expType)
8554 {
8555 exp->expType = op1->type;
8556 if(op1->type)
8557 op1->type->refCount++;
8558 }
8559 return 0x1;
8560 }
8561
8562 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8563 {
8564 int value2 = op2->i;
8565
8566 exp->type = 2;
8567 exp->string = PrintInt(op1->i ^= value2);
8568 if(!exp->expType)
8569 {
8570 exp->expType = op1->type;
8571 if(op1->type)
8572 op1->type->refCount++;
8573 }
8574 return 0x1;
8575 }
8576
8577 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8578 {
8579 unsigned int value2 = op2->ui;
8580
8581 exp->type = 2;
8582 exp->string = PrintUInt(op1->ui ^= value2);
8583 if(!exp->expType)
8584 {
8585 exp->expType = op1->type;
8586 if(op1->type)
8587 op1->type->refCount++;
8588 }
8589 return 0x1;
8590 }
8591
8592 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8593 {
8594 int value2 = op2->i;
8595
8596 exp->type = 2;
8597 exp->string = PrintInt64(op1->i ^= value2);
8598 if(!exp->expType)
8599 {
8600 exp->expType = op1->type;
8601 if(op1->type)
8602 op1->type->refCount++;
8603 }
8604 return 0x1;
8605 }
8606
8607 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8608 {
8609 unsigned int value2 = op2->ui;
8610
8611 exp->type = 2;
8612 exp->string = PrintUInt64(op1->ui ^= value2);
8613 if(!exp->expType)
8614 {
8615 exp->expType = op1->type;
8616 if(op1->type)
8617 op1->type->refCount++;
8618 }
8619 return 0x1;
8620 }
8621
8622 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8623 {
8624 short value2 = op2->s;
8625
8626 exp->type = 2;
8627 exp->string = PrintShort(op1->s ^= value2);
8628 if(!exp->expType)
8629 {
8630 exp->expType = op1->type;
8631 if(op1->type)
8632 op1->type->refCount++;
8633 }
8634 return 0x1;
8635 }
8636
8637 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8638 {
8639 unsigned short value2 = op2->us;
8640
8641 exp->type = 2;
8642 exp->string = PrintUShort(op1->us ^= value2);
8643 if(!exp->expType)
8644 {
8645 exp->expType = op1->type;
8646 if(op1->type)
8647 op1->type->refCount++;
8648 }
8649 return 0x1;
8650 }
8651
8652 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8653 {
8654 char value2 = op2->c;
8655
8656 exp->type = 2;
8657 exp->string = PrintChar(op1->c ^= value2);
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 0x1;
8665 }
8666
8667 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8668 {
8669 unsigned char value2 = op2->uc;
8670
8671 exp->type = 2;
8672 exp->string = PrintUChar(op1->uc ^= value2);
8673 if(!exp->expType)
8674 {
8675 exp->expType = op1->type;
8676 if(op1->type)
8677 op1->type->refCount++;
8678 }
8679 return 0x1;
8680 }
8681
8682 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8683 {
8684 int value2 = op2->i;
8685
8686 exp->type = 2;
8687 exp->string = PrintInt(op1->i <<= value2);
8688 if(!exp->expType)
8689 {
8690 exp->expType = op1->type;
8691 if(op1->type)
8692 op1->type->refCount++;
8693 }
8694 return 0x1;
8695 }
8696
8697 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8698 {
8699 unsigned int value2 = op2->ui;
8700
8701 exp->type = 2;
8702 exp->string = PrintUInt(op1->ui <<= value2);
8703 if(!exp->expType)
8704 {
8705 exp->expType = op1->type;
8706 if(op1->type)
8707 op1->type->refCount++;
8708 }
8709 return 0x1;
8710 }
8711
8712 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8713 {
8714 int value2 = op2->i;
8715
8716 exp->type = 2;
8717 exp->string = PrintInt64(op1->i <<= value2);
8718 if(!exp->expType)
8719 {
8720 exp->expType = op1->type;
8721 if(op1->type)
8722 op1->type->refCount++;
8723 }
8724 return 0x1;
8725 }
8726
8727 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8728 {
8729 unsigned int value2 = op2->ui;
8730
8731 exp->type = 2;
8732 exp->string = PrintUInt64(op1->ui <<= value2);
8733 if(!exp->expType)
8734 {
8735 exp->expType = op1->type;
8736 if(op1->type)
8737 op1->type->refCount++;
8738 }
8739 return 0x1;
8740 }
8741
8742 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 {
8744 short value2 = op2->s;
8745
8746 exp->type = 2;
8747 exp->string = PrintShort(op1->s <<= value2);
8748 if(!exp->expType)
8749 {
8750 exp->expType = op1->type;
8751 if(op1->type)
8752 op1->type->refCount++;
8753 }
8754 return 0x1;
8755 }
8756
8757 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 {
8759 unsigned short value2 = op2->us;
8760
8761 exp->type = 2;
8762 exp->string = PrintUShort(op1->us <<= value2);
8763 if(!exp->expType)
8764 {
8765 exp->expType = op1->type;
8766 if(op1->type)
8767 op1->type->refCount++;
8768 }
8769 return 0x1;
8770 }
8771
8772 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 {
8774 char value2 = op2->c;
8775
8776 exp->type = 2;
8777 exp->string = PrintChar(op1->c <<= value2);
8778 if(!exp->expType)
8779 {
8780 exp->expType = op1->type;
8781 if(op1->type)
8782 op1->type->refCount++;
8783 }
8784 return 0x1;
8785 }
8786
8787 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 {
8789 unsigned char value2 = op2->uc;
8790
8791 exp->type = 2;
8792 exp->string = PrintUChar(op1->uc <<= value2);
8793 if(!exp->expType)
8794 {
8795 exp->expType = op1->type;
8796 if(op1->type)
8797 op1->type->refCount++;
8798 }
8799 return 0x1;
8800 }
8801
8802 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 {
8804 int value2 = op2->i;
8805
8806 exp->type = 2;
8807 exp->string = PrintInt(op1->i >>= value2);
8808 if(!exp->expType)
8809 {
8810 exp->expType = op1->type;
8811 if(op1->type)
8812 op1->type->refCount++;
8813 }
8814 return 0x1;
8815 }
8816
8817 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 {
8819 unsigned int value2 = op2->ui;
8820
8821 exp->type = 2;
8822 exp->string = PrintUInt(op1->ui >>= value2);
8823 if(!exp->expType)
8824 {
8825 exp->expType = op1->type;
8826 if(op1->type)
8827 op1->type->refCount++;
8828 }
8829 return 0x1;
8830 }
8831
8832 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 {
8834 int value2 = op2->i;
8835
8836 exp->type = 2;
8837 exp->string = PrintInt64(op1->i >>= value2);
8838 if(!exp->expType)
8839 {
8840 exp->expType = op1->type;
8841 if(op1->type)
8842 op1->type->refCount++;
8843 }
8844 return 0x1;
8845 }
8846
8847 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 {
8849 unsigned int value2 = op2->ui;
8850
8851 exp->type = 2;
8852 exp->string = PrintUInt64(op1->ui >>= value2);
8853 if(!exp->expType)
8854 {
8855 exp->expType = op1->type;
8856 if(op1->type)
8857 op1->type->refCount++;
8858 }
8859 return 0x1;
8860 }
8861
8862 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 {
8864 short value2 = op2->s;
8865
8866 exp->type = 2;
8867 exp->string = PrintShort(op1->s >>= value2);
8868 if(!exp->expType)
8869 {
8870 exp->expType = op1->type;
8871 if(op1->type)
8872 op1->type->refCount++;
8873 }
8874 return 0x1;
8875 }
8876
8877 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 {
8879 unsigned short value2 = op2->us;
8880
8881 exp->type = 2;
8882 exp->string = PrintUShort(op1->us >>= value2);
8883 if(!exp->expType)
8884 {
8885 exp->expType = op1->type;
8886 if(op1->type)
8887 op1->type->refCount++;
8888 }
8889 return 0x1;
8890 }
8891
8892 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 {
8894 char value2 = op2->c;
8895
8896 exp->type = 2;
8897 exp->string = PrintChar(op1->c >>= value2);
8898 if(!exp->expType)
8899 {
8900 exp->expType = op1->type;
8901 if(op1->type)
8902 op1->type->refCount++;
8903 }
8904 return 0x1;
8905 }
8906
8907 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 {
8909 unsigned char value2 = op2->uc;
8910
8911 exp->type = 2;
8912 exp->string = PrintUChar(op1->uc >>= value2);
8913 if(!exp->expType)
8914 {
8915 exp->expType = op1->type;
8916 if(op1->type)
8917 op1->type->refCount++;
8918 }
8919 return 0x1;
8920 }
8921
8922 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8923 {
8924 exp->type = 2;
8925 exp->string = PrintInt((int)(!op1->i));
8926 if(!exp->expType)
8927 {
8928 exp->expType = op1->type;
8929 if(op1->type)
8930 op1->type->refCount++;
8931 }
8932 return 0x1;
8933 }
8934
8935 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8936 {
8937 exp->type = 2;
8938 exp->string = PrintUInt((unsigned int)(!op1->ui));
8939 if(!exp->expType)
8940 {
8941 exp->expType = op1->type;
8942 if(op1->type)
8943 op1->type->refCount++;
8944 }
8945 return 0x1;
8946 }
8947
8948 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8949 {
8950 exp->type = 2;
8951 exp->string = PrintInt64((int)(!op1->i));
8952 if(!exp->expType)
8953 {
8954 exp->expType = op1->type;
8955 if(op1->type)
8956 op1->type->refCount++;
8957 }
8958 return 0x1;
8959 }
8960
8961 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8962 {
8963 exp->type = 2;
8964 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8965 if(!exp->expType)
8966 {
8967 exp->expType = op1->type;
8968 if(op1->type)
8969 op1->type->refCount++;
8970 }
8971 return 0x1;
8972 }
8973
8974 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8975 {
8976 exp->type = 2;
8977 exp->string = PrintShort((short)(!op1->s));
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 UShortNot(struct Expression * exp, struct Operand * op1)
8988 {
8989 exp->type = 2;
8990 exp->string = PrintUShort((unsigned short)(!op1->us));
8991 if(!exp->expType)
8992 {
8993 exp->expType = op1->type;
8994 if(op1->type)
8995 op1->type->refCount++;
8996 }
8997 return 0x1;
8998 }
8999
9000 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9001 {
9002 exp->type = 2;
9003 exp->string = PrintChar((char)(!op1->c));
9004 if(!exp->expType)
9005 {
9006 exp->expType = op1->type;
9007 if(op1->type)
9008 op1->type->refCount++;
9009 }
9010 return 0x1;
9011 }
9012
9013 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9014 {
9015 exp->type = 2;
9016 exp->string = PrintUChar((unsigned char)(!op1->uc));
9017 if(!exp->expType)
9018 {
9019 exp->expType = op1->type;
9020 if(op1->type)
9021 op1->type->refCount++;
9022 }
9023 return 0x1;
9024 }
9025
9026 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9027 {
9028 int value2 = op2->i;
9029
9030 exp->type = 2;
9031 exp->string = PrintInt(op1->i == value2);
9032 if(!exp->expType)
9033 {
9034 exp->expType = op1->type;
9035 if(op1->type)
9036 op1->type->refCount++;
9037 }
9038 return 0x1;
9039 }
9040
9041 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9042 {
9043 unsigned int value2 = op2->ui;
9044
9045 exp->type = 2;
9046 exp->string = PrintUInt(op1->ui == value2);
9047 if(!exp->expType)
9048 {
9049 exp->expType = op1->type;
9050 if(op1->type)
9051 op1->type->refCount++;
9052 }
9053 return 0x1;
9054 }
9055
9056 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9057 {
9058 int value2 = op2->i;
9059
9060 exp->type = 2;
9061 exp->string = PrintInt64(op1->i == value2);
9062 if(!exp->expType)
9063 {
9064 exp->expType = op1->type;
9065 if(op1->type)
9066 op1->type->refCount++;
9067 }
9068 return 0x1;
9069 }
9070
9071 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9072 {
9073 unsigned int value2 = op2->ui;
9074
9075 exp->type = 2;
9076 exp->string = PrintUInt64(op1->ui == value2);
9077 if(!exp->expType)
9078 {
9079 exp->expType = op1->type;
9080 if(op1->type)
9081 op1->type->refCount++;
9082 }
9083 return 0x1;
9084 }
9085
9086 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9087 {
9088 short value2 = op2->s;
9089
9090 exp->type = 2;
9091 exp->string = PrintShort(op1->s == value2);
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 UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9102 {
9103 unsigned short value2 = op2->us;
9104
9105 exp->type = 2;
9106 exp->string = PrintUShort(op1->us == value2);
9107 if(!exp->expType)
9108 {
9109 exp->expType = op1->type;
9110 if(op1->type)
9111 op1->type->refCount++;
9112 }
9113 return 0x1;
9114 }
9115
9116 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9117 {
9118 char value2 = op2->c;
9119
9120 exp->type = 2;
9121 exp->string = PrintChar(op1->c == value2);
9122 if(!exp->expType)
9123 {
9124 exp->expType = op1->type;
9125 if(op1->type)
9126 op1->type->refCount++;
9127 }
9128 return 0x1;
9129 }
9130
9131 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9132 {
9133 unsigned char value2 = op2->uc;
9134
9135 exp->type = 2;
9136 exp->string = PrintUChar(op1->uc == value2);
9137 if(!exp->expType)
9138 {
9139 exp->expType = op1->type;
9140 if(op1->type)
9141 op1->type->refCount++;
9142 }
9143 return 0x1;
9144 }
9145
9146 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9147 {
9148 float value2 = op2->f;
9149
9150 exp->type = 2;
9151 exp->string = PrintFloat(op1->f == value2);
9152 if(!exp->expType)
9153 {
9154 exp->expType = op1->type;
9155 if(op1->type)
9156 op1->type->refCount++;
9157 }
9158 return 0x1;
9159 }
9160
9161 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9162 {
9163 double value2 = op2->d;
9164
9165 exp->type = 2;
9166 exp->string = PrintDouble(op1->d == value2);
9167 if(!exp->expType)
9168 {
9169 exp->expType = op1->type;
9170 if(op1->type)
9171 op1->type->refCount++;
9172 }
9173 return 0x1;
9174 }
9175
9176 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9177 {
9178 int value2 = op2->i;
9179
9180 exp->type = 2;
9181 exp->string = PrintInt(op1->i != value2);
9182 if(!exp->expType)
9183 {
9184 exp->expType = op1->type;
9185 if(op1->type)
9186 op1->type->refCount++;
9187 }
9188 return 0x1;
9189 }
9190
9191 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9192 {
9193 unsigned int value2 = op2->ui;
9194
9195 exp->type = 2;
9196 exp->string = PrintUInt(op1->ui != value2);
9197 if(!exp->expType)
9198 {
9199 exp->expType = op1->type;
9200 if(op1->type)
9201 op1->type->refCount++;
9202 }
9203 return 0x1;
9204 }
9205
9206 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9207 {
9208 int value2 = op2->i;
9209
9210 exp->type = 2;
9211 exp->string = PrintInt64(op1->i != value2);
9212 if(!exp->expType)
9213 {
9214 exp->expType = op1->type;
9215 if(op1->type)
9216 op1->type->refCount++;
9217 }
9218 return 0x1;
9219 }
9220
9221 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9222 {
9223 unsigned int value2 = op2->ui;
9224
9225 exp->type = 2;
9226 exp->string = PrintUInt64(op1->ui != value2);
9227 if(!exp->expType)
9228 {
9229 exp->expType = op1->type;
9230 if(op1->type)
9231 op1->type->refCount++;
9232 }
9233 return 0x1;
9234 }
9235
9236 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9237 {
9238 short value2 = op2->s;
9239
9240 exp->type = 2;
9241 exp->string = PrintShort(op1->s != value2);
9242 if(!exp->expType)
9243 {
9244 exp->expType = op1->type;
9245 if(op1->type)
9246 op1->type->refCount++;
9247 }
9248 return 0x1;
9249 }
9250
9251 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9252 {
9253 unsigned short value2 = op2->us;
9254
9255 exp->type = 2;
9256 exp->string = PrintUShort(op1->us != value2);
9257 if(!exp->expType)
9258 {
9259 exp->expType = op1->type;
9260 if(op1->type)
9261 op1->type->refCount++;
9262 }
9263 return 0x1;
9264 }
9265
9266 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9267 {
9268 char value2 = op2->c;
9269
9270 exp->type = 2;
9271 exp->string = PrintChar(op1->c != value2);
9272 if(!exp->expType)
9273 {
9274 exp->expType = op1->type;
9275 if(op1->type)
9276 op1->type->refCount++;
9277 }
9278 return 0x1;
9279 }
9280
9281 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9282 {
9283 unsigned char value2 = op2->uc;
9284
9285 exp->type = 2;
9286 exp->string = PrintUChar(op1->uc != value2);
9287 if(!exp->expType)
9288 {
9289 exp->expType = op1->type;
9290 if(op1->type)
9291 op1->type->refCount++;
9292 }
9293 return 0x1;
9294 }
9295
9296 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9297 {
9298 float value2 = op2->f;
9299
9300 exp->type = 2;
9301 exp->string = PrintFloat(op1->f != value2);
9302 if(!exp->expType)
9303 {
9304 exp->expType = op1->type;
9305 if(op1->type)
9306 op1->type->refCount++;
9307 }
9308 return 0x1;
9309 }
9310
9311 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9312 {
9313 double value2 = op2->d;
9314
9315 exp->type = 2;
9316 exp->string = PrintDouble(op1->d != value2);
9317 if(!exp->expType)
9318 {
9319 exp->expType = op1->type;
9320 if(op1->type)
9321 op1->type->refCount++;
9322 }
9323 return 0x1;
9324 }
9325
9326 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9327 {
9328 int value2 = op2->i;
9329
9330 exp->type = 2;
9331 exp->string = PrintInt(op1->i && value2);
9332 if(!exp->expType)
9333 {
9334 exp->expType = op1->type;
9335 if(op1->type)
9336 op1->type->refCount++;
9337 }
9338 return 0x1;
9339 }
9340
9341 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9342 {
9343 unsigned int value2 = op2->ui;
9344
9345 exp->type = 2;
9346 exp->string = PrintUInt(op1->ui && value2);
9347 if(!exp->expType)
9348 {
9349 exp->expType = op1->type;
9350 if(op1->type)
9351 op1->type->refCount++;
9352 }
9353 return 0x1;
9354 }
9355
9356 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9357 {
9358 int value2 = op2->i;
9359
9360 exp->type = 2;
9361 exp->string = PrintInt64(op1->i && value2);
9362 if(!exp->expType)
9363 {
9364 exp->expType = op1->type;
9365 if(op1->type)
9366 op1->type->refCount++;
9367 }
9368 return 0x1;
9369 }
9370
9371 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9372 {
9373 unsigned int value2 = op2->ui;
9374
9375 exp->type = 2;
9376 exp->string = PrintUInt64(op1->ui && value2);
9377 if(!exp->expType)
9378 {
9379 exp->expType = op1->type;
9380 if(op1->type)
9381 op1->type->refCount++;
9382 }
9383 return 0x1;
9384 }
9385
9386 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9387 {
9388 short value2 = op2->s;
9389
9390 exp->type = 2;
9391 exp->string = PrintShort(op1->s && value2);
9392 if(!exp->expType)
9393 {
9394 exp->expType = op1->type;
9395 if(op1->type)
9396 op1->type->refCount++;
9397 }
9398 return 0x1;
9399 }
9400
9401 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9402 {
9403 unsigned short value2 = op2->us;
9404
9405 exp->type = 2;
9406 exp->string = PrintUShort(op1->us && value2);
9407 if(!exp->expType)
9408 {
9409 exp->expType = op1->type;
9410 if(op1->type)
9411 op1->type->refCount++;
9412 }
9413 return 0x1;
9414 }
9415
9416 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9417 {
9418 char value2 = op2->c;
9419
9420 exp->type = 2;
9421 exp->string = PrintChar(op1->c && value2);
9422 if(!exp->expType)
9423 {
9424 exp->expType = op1->type;
9425 if(op1->type)
9426 op1->type->refCount++;
9427 }
9428 return 0x1;
9429 }
9430
9431 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9432 {
9433 unsigned char value2 = op2->uc;
9434
9435 exp->type = 2;
9436 exp->string = PrintUChar(op1->uc && value2);
9437 if(!exp->expType)
9438 {
9439 exp->expType = op1->type;
9440 if(op1->type)
9441 op1->type->refCount++;
9442 }
9443 return 0x1;
9444 }
9445
9446 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9447 {
9448 float value2 = op2->f;
9449
9450 exp->type = 2;
9451 exp->string = PrintFloat(op1->f && value2);
9452 if(!exp->expType)
9453 {
9454 exp->expType = op1->type;
9455 if(op1->type)
9456 op1->type->refCount++;
9457 }
9458 return 0x1;
9459 }
9460
9461 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9462 {
9463 double value2 = op2->d;
9464
9465 exp->type = 2;
9466 exp->string = PrintDouble(op1->d && value2);
9467 if(!exp->expType)
9468 {
9469 exp->expType = op1->type;
9470 if(op1->type)
9471 op1->type->refCount++;
9472 }
9473 return 0x1;
9474 }
9475
9476 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9477 {
9478 int value2 = op2->i;
9479
9480 exp->type = 2;
9481 exp->string = PrintInt(op1->i || value2);
9482 if(!exp->expType)
9483 {
9484 exp->expType = op1->type;
9485 if(op1->type)
9486 op1->type->refCount++;
9487 }
9488 return 0x1;
9489 }
9490
9491 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9492 {
9493 unsigned int value2 = op2->ui;
9494
9495 exp->type = 2;
9496 exp->string = PrintUInt(op1->ui || value2);
9497 if(!exp->expType)
9498 {
9499 exp->expType = op1->type;
9500 if(op1->type)
9501 op1->type->refCount++;
9502 }
9503 return 0x1;
9504 }
9505
9506 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9507 {
9508 int value2 = op2->i;
9509
9510 exp->type = 2;
9511 exp->string = PrintInt64(op1->i || value2);
9512 if(!exp->expType)
9513 {
9514 exp->expType = op1->type;
9515 if(op1->type)
9516 op1->type->refCount++;
9517 }
9518 return 0x1;
9519 }
9520
9521 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9522 {
9523 unsigned int value2 = op2->ui;
9524
9525 exp->type = 2;
9526 exp->string = PrintUInt64(op1->ui || value2);
9527 if(!exp->expType)
9528 {
9529 exp->expType = op1->type;
9530 if(op1->type)
9531 op1->type->refCount++;
9532 }
9533 return 0x1;
9534 }
9535
9536 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9537 {
9538 short value2 = op2->s;
9539
9540 exp->type = 2;
9541 exp->string = PrintShort(op1->s || value2);
9542 if(!exp->expType)
9543 {
9544 exp->expType = op1->type;
9545 if(op1->type)
9546 op1->type->refCount++;
9547 }
9548 return 0x1;
9549 }
9550
9551 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9552 {
9553 unsigned short value2 = op2->us;
9554
9555 exp->type = 2;
9556 exp->string = PrintUShort(op1->us || value2);
9557 if(!exp->expType)
9558 {
9559 exp->expType = op1->type;
9560 if(op1->type)
9561 op1->type->refCount++;
9562 }
9563 return 0x1;
9564 }
9565
9566 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9567 {
9568 char value2 = op2->c;
9569
9570 exp->type = 2;
9571 exp->string = PrintChar(op1->c || value2);
9572 if(!exp->expType)
9573 {
9574 exp->expType = op1->type;
9575 if(op1->type)
9576 op1->type->refCount++;
9577 }
9578 return 0x1;
9579 }
9580
9581 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9582 {
9583 unsigned char value2 = op2->uc;
9584
9585 exp->type = 2;
9586 exp->string = PrintUChar(op1->uc || value2);
9587 if(!exp->expType)
9588 {
9589 exp->expType = op1->type;
9590 if(op1->type)
9591 op1->type->refCount++;
9592 }
9593 return 0x1;
9594 }
9595
9596 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9597 {
9598 float value2 = op2->f;
9599
9600 exp->type = 2;
9601 exp->string = PrintFloat(op1->f || value2);
9602 if(!exp->expType)
9603 {
9604 exp->expType = op1->type;
9605 if(op1->type)
9606 op1->type->refCount++;
9607 }
9608 return 0x1;
9609 }
9610
9611 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9612 {
9613 double value2 = op2->d;
9614
9615 exp->type = 2;
9616 exp->string = PrintDouble(op1->d || value2);
9617 if(!exp->expType)
9618 {
9619 exp->expType = op1->type;
9620 if(op1->type)
9621 op1->type->refCount++;
9622 }
9623 return 0x1;
9624 }
9625
9626 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9627 {
9628 int value2 = op2->i;
9629
9630 exp->type = 2;
9631 exp->string = PrintInt(op1->i > value2);
9632 if(!exp->expType)
9633 {
9634 exp->expType = op1->type;
9635 if(op1->type)
9636 op1->type->refCount++;
9637 }
9638 return 0x1;
9639 }
9640
9641 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9642 {
9643 unsigned int value2 = op2->ui;
9644
9645 exp->type = 2;
9646 exp->string = PrintUInt(op1->ui > value2);
9647 if(!exp->expType)
9648 {
9649 exp->expType = op1->type;
9650 if(op1->type)
9651 op1->type->refCount++;
9652 }
9653 return 0x1;
9654 }
9655
9656 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9657 {
9658 int value2 = op2->i;
9659
9660 exp->type = 2;
9661 exp->string = PrintInt64(op1->i > value2);
9662 if(!exp->expType)
9663 {
9664 exp->expType = op1->type;
9665 if(op1->type)
9666 op1->type->refCount++;
9667 }
9668 return 0x1;
9669 }
9670
9671 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9672 {
9673 unsigned int value2 = op2->ui;
9674
9675 exp->type = 2;
9676 exp->string = PrintUInt64(op1->ui > value2);
9677 if(!exp->expType)
9678 {
9679 exp->expType = op1->type;
9680 if(op1->type)
9681 op1->type->refCount++;
9682 }
9683 return 0x1;
9684 }
9685
9686 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9687 {
9688 short value2 = op2->s;
9689
9690 exp->type = 2;
9691 exp->string = PrintShort(op1->s > value2);
9692 if(!exp->expType)
9693 {
9694 exp->expType = op1->type;
9695 if(op1->type)
9696 op1->type->refCount++;
9697 }
9698 return 0x1;
9699 }
9700
9701 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9702 {
9703 unsigned short value2 = op2->us;
9704
9705 exp->type = 2;
9706 exp->string = PrintUShort(op1->us > value2);
9707 if(!exp->expType)
9708 {
9709 exp->expType = op1->type;
9710 if(op1->type)
9711 op1->type->refCount++;
9712 }
9713 return 0x1;
9714 }
9715
9716 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9717 {
9718 char value2 = op2->c;
9719
9720 exp->type = 2;
9721 exp->string = PrintChar(op1->c > value2);
9722 if(!exp->expType)
9723 {
9724 exp->expType = op1->type;
9725 if(op1->type)
9726 op1->type->refCount++;
9727 }
9728 return 0x1;
9729 }
9730
9731 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9732 {
9733 unsigned char value2 = op2->uc;
9734
9735 exp->type = 2;
9736 exp->string = PrintUChar(op1->uc > value2);
9737 if(!exp->expType)
9738 {
9739 exp->expType = op1->type;
9740 if(op1->type)
9741 op1->type->refCount++;
9742 }
9743 return 0x1;
9744 }
9745
9746 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9747 {
9748 float value2 = op2->f;
9749
9750 exp->type = 2;
9751 exp->string = PrintFloat(op1->f > value2);
9752 if(!exp->expType)
9753 {
9754 exp->expType = op1->type;
9755 if(op1->type)
9756 op1->type->refCount++;
9757 }
9758 return 0x1;
9759 }
9760
9761 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9762 {
9763 double value2 = op2->d;
9764
9765 exp->type = 2;
9766 exp->string = PrintDouble(op1->d > value2);
9767 if(!exp->expType)
9768 {
9769 exp->expType = op1->type;
9770 if(op1->type)
9771 op1->type->refCount++;
9772 }
9773 return 0x1;
9774 }
9775
9776 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9777 {
9778 int value2 = op2->i;
9779
9780 exp->type = 2;
9781 exp->string = PrintInt(op1->i < value2);
9782 if(!exp->expType)
9783 {
9784 exp->expType = op1->type;
9785 if(op1->type)
9786 op1->type->refCount++;
9787 }
9788 return 0x1;
9789 }
9790
9791 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9792 {
9793 unsigned int value2 = op2->ui;
9794
9795 exp->type = 2;
9796 exp->string = PrintUInt(op1->ui < value2);
9797 if(!exp->expType)
9798 {
9799 exp->expType = op1->type;
9800 if(op1->type)
9801 op1->type->refCount++;
9802 }
9803 return 0x1;
9804 }
9805
9806 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9807 {
9808 int value2 = op2->i;
9809
9810 exp->type = 2;
9811 exp->string = PrintInt64(op1->i < value2);
9812 if(!exp->expType)
9813 {
9814 exp->expType = op1->type;
9815 if(op1->type)
9816 op1->type->refCount++;
9817 }
9818 return 0x1;
9819 }
9820
9821 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9822 {
9823 unsigned int value2 = op2->ui;
9824
9825 exp->type = 2;
9826 exp->string = PrintUInt64(op1->ui < value2);
9827 if(!exp->expType)
9828 {
9829 exp->expType = op1->type;
9830 if(op1->type)
9831 op1->type->refCount++;
9832 }
9833 return 0x1;
9834 }
9835
9836 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9837 {
9838 short value2 = op2->s;
9839
9840 exp->type = 2;
9841 exp->string = PrintShort(op1->s < value2);
9842 if(!exp->expType)
9843 {
9844 exp->expType = op1->type;
9845 if(op1->type)
9846 op1->type->refCount++;
9847 }
9848 return 0x1;
9849 }
9850
9851 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9852 {
9853 unsigned short value2 = op2->us;
9854
9855 exp->type = 2;
9856 exp->string = PrintUShort(op1->us < value2);
9857 if(!exp->expType)
9858 {
9859 exp->expType = op1->type;
9860 if(op1->type)
9861 op1->type->refCount++;
9862 }
9863 return 0x1;
9864 }
9865
9866 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9867 {
9868 char value2 = op2->c;
9869
9870 exp->type = 2;
9871 exp->string = PrintChar(op1->c < value2);
9872 if(!exp->expType)
9873 {
9874 exp->expType = op1->type;
9875 if(op1->type)
9876 op1->type->refCount++;
9877 }
9878 return 0x1;
9879 }
9880
9881 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9882 {
9883 unsigned char value2 = op2->uc;
9884
9885 exp->type = 2;
9886 exp->string = PrintUChar(op1->uc < value2);
9887 if(!exp->expType)
9888 {
9889 exp->expType = op1->type;
9890 if(op1->type)
9891 op1->type->refCount++;
9892 }
9893 return 0x1;
9894 }
9895
9896 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9897 {
9898 float value2 = op2->f;
9899
9900 exp->type = 2;
9901 exp->string = PrintFloat(op1->f < value2);
9902 if(!exp->expType)
9903 {
9904 exp->expType = op1->type;
9905 if(op1->type)
9906 op1->type->refCount++;
9907 }
9908 return 0x1;
9909 }
9910
9911 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9912 {
9913 double value2 = op2->d;
9914
9915 exp->type = 2;
9916 exp->string = PrintDouble(op1->d < value2);
9917 if(!exp->expType)
9918 {
9919 exp->expType = op1->type;
9920 if(op1->type)
9921 op1->type->refCount++;
9922 }
9923 return 0x1;
9924 }
9925
9926 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9927 {
9928 int value2 = op2->i;
9929
9930 exp->type = 2;
9931 exp->string = PrintInt(op1->i >= value2);
9932 if(!exp->expType)
9933 {
9934 exp->expType = op1->type;
9935 if(op1->type)
9936 op1->type->refCount++;
9937 }
9938 return 0x1;
9939 }
9940
9941 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9942 {
9943 unsigned int value2 = op2->ui;
9944
9945 exp->type = 2;
9946 exp->string = PrintUInt(op1->ui >= value2);
9947 if(!exp->expType)
9948 {
9949 exp->expType = op1->type;
9950 if(op1->type)
9951 op1->type->refCount++;
9952 }
9953 return 0x1;
9954 }
9955
9956 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9957 {
9958 int value2 = op2->i;
9959
9960 exp->type = 2;
9961 exp->string = PrintInt64(op1->i >= value2);
9962 if(!exp->expType)
9963 {
9964 exp->expType = op1->type;
9965 if(op1->type)
9966 op1->type->refCount++;
9967 }
9968 return 0x1;
9969 }
9970
9971 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9972 {
9973 unsigned int value2 = op2->ui;
9974
9975 exp->type = 2;
9976 exp->string = PrintUInt64(op1->ui >= value2);
9977 if(!exp->expType)
9978 {
9979 exp->expType = op1->type;
9980 if(op1->type)
9981 op1->type->refCount++;
9982 }
9983 return 0x1;
9984 }
9985
9986 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9987 {
9988 short value2 = op2->s;
9989
9990 exp->type = 2;
9991 exp->string = PrintShort(op1->s >= value2);
9992 if(!exp->expType)
9993 {
9994 exp->expType = op1->type;
9995 if(op1->type)
9996 op1->type->refCount++;
9997 }
9998 return 0x1;
9999 }
10000
10001 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10002 {
10003 unsigned short value2 = op2->us;
10004
10005 exp->type = 2;
10006 exp->string = PrintUShort(op1->us >= value2);
10007 if(!exp->expType)
10008 {
10009 exp->expType = op1->type;
10010 if(op1->type)
10011 op1->type->refCount++;
10012 }
10013 return 0x1;
10014 }
10015
10016 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10017 {
10018 char value2 = op2->c;
10019
10020 exp->type = 2;
10021 exp->string = PrintChar(op1->c >= value2);
10022 if(!exp->expType)
10023 {
10024 exp->expType = op1->type;
10025 if(op1->type)
10026 op1->type->refCount++;
10027 }
10028 return 0x1;
10029 }
10030
10031 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10032 {
10033 unsigned char value2 = op2->uc;
10034
10035 exp->type = 2;
10036 exp->string = PrintUChar(op1->uc >= value2);
10037 if(!exp->expType)
10038 {
10039 exp->expType = op1->type;
10040 if(op1->type)
10041 op1->type->refCount++;
10042 }
10043 return 0x1;
10044 }
10045
10046 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10047 {
10048 float value2 = op2->f;
10049
10050 exp->type = 2;
10051 exp->string = PrintFloat(op1->f >= value2);
10052 if(!exp->expType)
10053 {
10054 exp->expType = op1->type;
10055 if(op1->type)
10056 op1->type->refCount++;
10057 }
10058 return 0x1;
10059 }
10060
10061 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10062 {
10063 double value2 = op2->d;
10064
10065 exp->type = 2;
10066 exp->string = PrintDouble(op1->d >= value2);
10067 if(!exp->expType)
10068 {
10069 exp->expType = op1->type;
10070 if(op1->type)
10071 op1->type->refCount++;
10072 }
10073 return 0x1;
10074 }
10075
10076 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10077 {
10078 int value2 = op2->i;
10079
10080 exp->type = 2;
10081 exp->string = PrintInt(op1->i <= value2);
10082 if(!exp->expType)
10083 {
10084 exp->expType = op1->type;
10085 if(op1->type)
10086 op1->type->refCount++;
10087 }
10088 return 0x1;
10089 }
10090
10091 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10092 {
10093 unsigned int value2 = op2->ui;
10094
10095 exp->type = 2;
10096 exp->string = PrintUInt(op1->ui <= value2);
10097 if(!exp->expType)
10098 {
10099 exp->expType = op1->type;
10100 if(op1->type)
10101 op1->type->refCount++;
10102 }
10103 return 0x1;
10104 }
10105
10106 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10107 {
10108 int value2 = op2->i;
10109
10110 exp->type = 2;
10111 exp->string = PrintInt64(op1->i <= value2);
10112 if(!exp->expType)
10113 {
10114 exp->expType = op1->type;
10115 if(op1->type)
10116 op1->type->refCount++;
10117 }
10118 return 0x1;
10119 }
10120
10121 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10122 {
10123 unsigned int value2 = op2->ui;
10124
10125 exp->type = 2;
10126 exp->string = PrintUInt64(op1->ui <= value2);
10127 if(!exp->expType)
10128 {
10129 exp->expType = op1->type;
10130 if(op1->type)
10131 op1->type->refCount++;
10132 }
10133 return 0x1;
10134 }
10135
10136 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10137 {
10138 short value2 = op2->s;
10139
10140 exp->type = 2;
10141 exp->string = PrintShort(op1->s <= value2);
10142 if(!exp->expType)
10143 {
10144 exp->expType = op1->type;
10145 if(op1->type)
10146 op1->type->refCount++;
10147 }
10148 return 0x1;
10149 }
10150
10151 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10152 {
10153 unsigned short value2 = op2->us;
10154
10155 exp->type = 2;
10156 exp->string = PrintUShort(op1->us <= value2);
10157 if(!exp->expType)
10158 {
10159 exp->expType = op1->type;
10160 if(op1->type)
10161 op1->type->refCount++;
10162 }
10163 return 0x1;
10164 }
10165
10166 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10167 {
10168 char value2 = op2->c;
10169
10170 exp->type = 2;
10171 exp->string = PrintChar(op1->c <= value2);
10172 if(!exp->expType)
10173 {
10174 exp->expType = op1->type;
10175 if(op1->type)
10176 op1->type->refCount++;
10177 }
10178 return 0x1;
10179 }
10180
10181 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10182 {
10183 unsigned char value2 = op2->uc;
10184
10185 exp->type = 2;
10186 exp->string = PrintUChar(op1->uc <= value2);
10187 if(!exp->expType)
10188 {
10189 exp->expType = op1->type;
10190 if(op1->type)
10191 op1->type->refCount++;
10192 }
10193 return 0x1;
10194 }
10195
10196 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10197 {
10198 float value2 = op2->f;
10199
10200 exp->type = 2;
10201 exp->string = PrintFloat(op1->f <= value2);
10202 if(!exp->expType)
10203 {
10204 exp->expType = op1->type;
10205 if(op1->type)
10206 op1->type->refCount++;
10207 }
10208 return 0x1;
10209 }
10210
10211 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10212 {
10213 double value2 = op2->d;
10214
10215 exp->type = 2;
10216 exp->string = PrintDouble(op1->d <= value2);
10217 if(!exp->expType)
10218 {
10219 exp->expType = op1->type;
10220 if(op1->type)
10221 op1->type->refCount++;
10222 }
10223 return 0x1;
10224 }
10225
10226 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10227 {
10228 exp->type = 2;
10229 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10230 if(!exp->expType)
10231 {
10232 exp->expType = op1->type;
10233 if(op1->type)
10234 op1->type->refCount++;
10235 }
10236 return 0x1;
10237 }
10238
10239 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10240 {
10241 exp->type = 2;
10242 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10243 if(!exp->expType)
10244 {
10245 exp->expType = op1->type;
10246 if(op1->type)
10247 op1->type->refCount++;
10248 }
10249 return 0x1;
10250 }
10251
10252 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10253 {
10254 exp->type = 2;
10255 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10256 if(!exp->expType)
10257 {
10258 exp->expType = op1->type;
10259 if(op1->type)
10260 op1->type->refCount++;
10261 }
10262 return 0x1;
10263 }
10264
10265 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10266 {
10267 exp->type = 2;
10268 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10269 if(!exp->expType)
10270 {
10271 exp->expType = op1->type;
10272 if(op1->type)
10273 op1->type->refCount++;
10274 }
10275 return 0x1;
10276 }
10277
10278 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10279 {
10280 exp->type = 2;
10281 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10282 if(!exp->expType)
10283 {
10284 exp->expType = op1->type;
10285 if(op1->type)
10286 op1->type->refCount++;
10287 }
10288 return 0x1;
10289 }
10290
10291 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10292 {
10293 exp->type = 2;
10294 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10295 if(!exp->expType)
10296 {
10297 exp->expType = op1->type;
10298 if(op1->type)
10299 op1->type->refCount++;
10300 }
10301 return 0x1;
10302 }
10303
10304 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10305 {
10306 exp->type = 2;
10307 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10308 if(!exp->expType)
10309 {
10310 exp->expType = op1->type;
10311 if(op1->type)
10312 op1->type->refCount++;
10313 }
10314 return 0x1;
10315 }
10316
10317 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10318 {
10319 exp->type = 2;
10320 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10321 if(!exp->expType)
10322 {
10323 exp->expType = op1->type;
10324 if(op1->type)
10325 op1->type->refCount++;
10326 }
10327 return 0x1;
10328 }
10329
10330 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10331 {
10332 exp->type = 2;
10333 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10334 if(!exp->expType)
10335 {
10336 exp->expType = op1->type;
10337 if(op1->type)
10338 op1->type->refCount++;
10339 }
10340 return 0x1;
10341 }
10342
10343 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10344 {
10345 exp->type = 2;
10346 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10347 if(!exp->expType)
10348 {
10349 exp->expType = op1->type;
10350 if(op1->type)
10351 op1->type->refCount++;
10352 }
10353 return 0x1;
10354 }
10355
10356 struct OpTable intOps = 
10357 {
10358 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
10359 };
10360
10361 struct OpTable uintOps = 
10362 {
10363 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
10364 };
10365
10366 struct OpTable int64Ops = 
10367 {
10368 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10369 };
10370
10371 struct OpTable uint64Ops = 
10372 {
10373 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10374 };
10375
10376 struct OpTable shortOps = 
10377 {
10378 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
10379 };
10380
10381 struct OpTable ushortOps = 
10382 {
10383 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
10384 };
10385
10386 struct OpTable floatOps = 
10387 {
10388 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
10389 };
10390
10391 struct OpTable doubleOps = 
10392 {
10393 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
10394 };
10395
10396 struct OpTable charOps = 
10397 {
10398 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
10399 };
10400
10401 struct OpTable ucharOps = 
10402 {
10403 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
10404 };
10405
10406 void ReadString(char * output, char * string)
10407 {
10408 int len = strlen(string);
10409 int c, d = 0;
10410 unsigned int quoted = 0x0, escaped = 0x0;
10411
10412 for(c = 0; c < len; c++)
10413 {
10414 char ch = string[c];
10415
10416 if(escaped)
10417 {
10418 switch(ch)
10419 {
10420 case 'n':
10421 output[d] = '\n';
10422 break;
10423 case 't':
10424 output[d] = '\t';
10425 break;
10426 case 'a':
10427 output[d] = '\a';
10428 break;
10429 case 'b':
10430 output[d] = '\b';
10431 break;
10432 case 'f':
10433 output[d] = '\f';
10434 break;
10435 case 'r':
10436 output[d] = '\r';
10437 break;
10438 case 'v':
10439 output[d] = '\v';
10440 break;
10441 case '\\':
10442 output[d] = '\\';
10443 break;
10444 case '\"':
10445 output[d] = '\"';
10446 break;
10447 default:
10448 output[d++] = '\\';
10449 output[d] = ch;
10450 }
10451 d++;
10452 escaped = 0x0;
10453 }
10454 else
10455 {
10456 if(ch == '\"')
10457 quoted ^= 0x1;
10458 else if(quoted)
10459 {
10460 if(ch == '\\')
10461 escaped = 0x1;
10462 else
10463 output[d++] = ch;
10464 }
10465 }
10466 }
10467 output[d] = '\0';
10468 }
10469
10470 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10471
10472 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10473
10474 extern double strtod(char * , char * * );
10475
10476 struct Operand GetOperand(struct Expression * exp)
10477 {
10478 struct Operand op = 
10479 {
10480 0, 0, 0, 0, 
10481 {
10482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10483 }
10484 };
10485 struct Type * type = exp->expType;
10486
10487 if(type)
10488 {
10489 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10490 {
10491 if(!type->_class->registered->dataType)
10492 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10493 type = type->_class->registered->dataType;
10494 }
10495 op.kind = type->kind;
10496 op.type = exp->expType;
10497 if(exp->isConstant && exp->type == 2)
10498 {
10499 switch(op.kind)
10500 {
10501 case 24:
10502 case 1:
10503 {
10504 if(exp->constant[0] == '\'')
10505 op.c = exp->constant[1];
10506 else if(type->isSigned)
10507 {
10508 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10509 op.ops = charOps;
10510 }
10511 else
10512 {
10513 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10514 op.ops = ucharOps;
10515 }
10516 break;
10517 }
10518 case 2:
10519 if(type->isSigned)
10520 {
10521 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10522 op.ops = shortOps;
10523 }
10524 else
10525 {
10526 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10527 op.ops = ushortOps;
10528 }
10529 break;
10530 case 3:
10531 case 5:
10532 if(type->isSigned)
10533 {
10534 op.i = strtol(exp->constant, (((void *)0)), 0);
10535 op.ops = intOps;
10536 }
10537 else
10538 {
10539 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10540 op.ops = uintOps;
10541 }
10542 op.kind = 3;
10543 break;
10544 case 4:
10545 if(type->isSigned)
10546 {
10547 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10548 op.ops = intOps;
10549 }
10550 else
10551 {
10552 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10553 op.ops = uintOps;
10554 }
10555 op.kind = 4;
10556 break;
10557 case 22:
10558 if(type->isSigned)
10559 {
10560 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10561 op.ops = int64Ops;
10562 }
10563 else
10564 {
10565 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10566 op.ops = uint64Ops;
10567 }
10568 op.kind = 4;
10569 break;
10570 case 23:
10571 if(type->isSigned)
10572 {
10573 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10574 op.ops = int64Ops;
10575 }
10576 else
10577 {
10578 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10579 op.ops = uint64Ops;
10580 }
10581 op.kind = 4;
10582 break;
10583 case 6:
10584 op.f = (float)strtod(exp->constant, (((void *)0)));
10585 op.ops = floatOps;
10586 break;
10587 case 7:
10588 op.d = (double)strtod(exp->constant, (((void *)0)));
10589 op.ops = doubleOps;
10590 break;
10591 case 12:
10592 case 13:
10593 case 8:
10594 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10595 op.kind = 13;
10596 op.ops = uintOps;
10597 break;
10598 }
10599 }
10600 }
10601 return op;
10602 }
10603
10604 int __ecereVMethodID_class_OnGetString;
10605
10606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10607
10608 static void UnusedFunction()
10609 {
10610 int a;
10611
10612 ((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);
10613 }
10614
10615 extern int __ecereVMethodID_class_OnGetString;
10616
10617 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10618 {
10619 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10620
10621 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10622 {
10623 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10624 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10625 else
10626 {
10627 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10628 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10629 struct Type * type;
10630 void * ptr = inst->data + dataMember->offset + offset;
10631 char * result = (((void *)0));
10632
10633 exp->loc = member->loc = inst->loc;
10634 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10635 if(!dataMember->dataType)
10636 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10637 type = dataMember->dataType;
10638 if(type->kind == 8)
10639 {
10640 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10641
10642 if(_class->type == 4)
10643 {
10644 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10645
10646 if(enumClass)
10647 {
10648 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10649 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10650
10651 for(item = e->values.first; item; item = item->next)
10652 {
10653 if((int)item->data == *(int *)ptr)
10654 {
10655 result = item->name;
10656 break;
10657 }
10658 }
10659 if(result)
10660 {
10661 exp->identifier = MkIdentifier(result);
10662 exp->type = 0;
10663 exp->destType = MkClassType(_class->fullName);
10664 ProcessExpressionType(exp);
10665 }
10666 }
10667 }
10668 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10669 {
10670 if(!_class->dataType)
10671 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10672 type = _class->dataType;
10673 }
10674 }
10675 if(!result)
10676 {
10677 switch(type->kind)
10678 {
10679 case 6:
10680 {
10681 FreeExpContents(exp);
10682 exp->constant = PrintFloat(*(float *)ptr);
10683 exp->type = 2;
10684 break;
10685 }
10686 case 7:
10687 {
10688 FreeExpContents(exp);
10689 exp->constant = PrintDouble(*(double *)ptr);
10690 exp->type = 2;
10691 break;
10692 }
10693 case 3:
10694 {
10695 FreeExpContents(exp);
10696 exp->constant = PrintInt(*(int *)ptr);
10697 exp->type = 2;
10698 break;
10699 }
10700 case 4:
10701 {
10702 FreeExpContents(exp);
10703 exp->constant = PrintInt64(*(long long *)ptr);
10704 exp->type = 2;
10705 break;
10706 }
10707 case 22:
10708 {
10709 FreeExpContents(exp);
10710 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10711 exp->type = 2;
10712 break;
10713 }
10714 case 23:
10715 {
10716 FreeExpContents(exp);
10717 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10718 exp->type = 2;
10719 break;
10720 }
10721 default:
10722 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10723 }
10724 }
10725 ListAdd(memberList, member);
10726 }
10727 if(parentDataMember->type == 1)
10728 break;
10729 }
10730 }
10731
10732 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10733
10734 void PopulateInstance(struct Instantiation * inst)
10735 {
10736 struct Symbol * classSym = inst->_class->symbol;
10737 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10738 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10739 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10740
10741 if(!inst->members)
10742 inst->members = MkListOne(MkMembersInitList(memberList));
10743 else
10744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10745 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10746 {
10747 if(!dataMember->isProperty)
10748 {
10749 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10750 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10751 else
10752 {
10753 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10754 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10755 struct Type * type;
10756 void * ptr = inst->data + dataMember->offset;
10757 char * result = (((void *)0));
10758
10759 exp->loc = member->loc = inst->loc;
10760 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10761 if(!dataMember->dataType)
10762 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10763 type = dataMember->dataType;
10764 if(type->kind == 8)
10765 {
10766 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10767
10768 if(_class->type == 4)
10769 {
10770 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10771
10772 if(enumClass)
10773 {
10774 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10775 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10776
10777 for(item = e->values.first; item; item = item->next)
10778 {
10779 if((int)item->data == *(int *)ptr)
10780 {
10781 result = item->name;
10782 break;
10783 }
10784 }
10785 }
10786 if(result)
10787 {
10788 exp->identifier = MkIdentifier(result);
10789 exp->type = 0;
10790 exp->destType = MkClassType(_class->fullName);
10791 ProcessExpressionType(exp);
10792 }
10793 }
10794 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10795 {
10796 if(!_class->dataType)
10797 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10798 type = _class->dataType;
10799 }
10800 }
10801 if(!result)
10802 {
10803 switch(type->kind)
10804 {
10805 case 6:
10806 {
10807 exp->constant = PrintFloat(*(float *)ptr);
10808 exp->type = 2;
10809 break;
10810 }
10811 case 7:
10812 {
10813 exp->constant = PrintDouble(*(double *)ptr);
10814 exp->type = 2;
10815 break;
10816 }
10817 case 3:
10818 {
10819 exp->constant = PrintInt(*(int *)ptr);
10820 exp->type = 2;
10821 break;
10822 }
10823 case 4:
10824 {
10825 exp->constant = PrintInt64(*(long long *)ptr);
10826 exp->type = 2;
10827 break;
10828 }
10829 case 22:
10830 {
10831 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10832 exp->type = 2;
10833 break;
10834 }
10835 default:
10836 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10837 }
10838 }
10839 ListAdd(memberList, member);
10840 }
10841 }
10842 }
10843 }
10844
10845 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);
10846
10847 extern void FreeInstance(struct Instantiation * inst);
10848
10849 void ComputeInstantiation(struct Expression * exp)
10850 {
10851 struct Instantiation * inst = exp->instance;
10852 struct MembersInit * members;
10853 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10854 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10855 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10856 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10857 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10858 int subMemberStackPos = 0;
10859 uint64 bits = 0;
10860
10861 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10862 {
10863 if(inst->data)
10864 return ;
10865 if(_class->type == 0 || _class->type == 5)
10866 {
10867 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10868 if(_class->type == 0)
10869 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10870 }
10871 else
10872 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10873 }
10874 if(inst->members)
10875 {
10876 for(members = (*inst->members).first; members; members = members->next)
10877 {
10878 switch(members->type)
10879 {
10880 case 0:
10881 {
10882 if(members->dataMembers)
10883 {
10884 struct MemberInit * member;
10885
10886 for(member = (*members->dataMembers).first; member; member = member->next)
10887 {
10888 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10889 unsigned int found = 0x0;
10890 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10891 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10892 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10893 unsigned int dataMemberOffset;
10894
10895 if(!ident)
10896 {
10897 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10898 if(curMember)
10899 {
10900 if(curMember->isProperty)
10901 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10902 else
10903 {
10904 dataMember = curMember;
10905 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10906 if(_class->type == 0)
10907 dataMemberOffset += _class->base->structSize;
10908 }
10909 found = 0x1;
10910 }
10911 }
10912 else
10913 {
10914 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10915 if(prop)
10916 {
10917 found = 0x1;
10918 if(prop->memberAccess == 1)
10919 {
10920 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10921 curClass = prop->_class;
10922 }
10923 }
10924 else
10925 {
10926 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10927 int _subMemberStackPos = 0;
10928
10929 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10930 if(dataMember)
10931 {
10932 found = 0x1;
10933 if(dataMember->memberAccess == 1)
10934 {
10935 curMember = dataMember;
10936 curClass = dataMember->_class;
10937 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10938 subMemberStackPos = _subMemberStackPos;
10939 }
10940 }
10941 }
10942 }
10943 if(found && member->initializer && member->initializer->type == 0)
10944 {
10945 struct Expression * value = member->initializer->exp;
10946 struct Type * type = (((void *)0));
10947 unsigned int deepMember = 0x0;
10948
10949 if(prop)
10950 {
10951 type = prop->dataType;
10952 }
10953 else if(dataMember)
10954 {
10955 if(!dataMember->dataType)
10956 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10957 type = dataMember->dataType;
10958 }
10959 if(ident && ident->next)
10960 {
10961 deepMember = 0x1;
10962 for(ident = ident->next; ident && type; ident = ident->next)
10963 {
10964 if(type->kind == 8)
10965 {
10966 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10967 if(prop)
10968 type = prop->dataType;
10969 else
10970 {
10971 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10972 if(dataMember)
10973 type = dataMember->dataType;
10974 }
10975 }
10976 else if(type->kind == 9 || type->kind == 10)
10977 {
10978 struct Type * memberType;
10979
10980 for(memberType = type->members.first; memberType; memberType = memberType->next)
10981 {
10982 if(!strcmp(memberType->name, ident->string))
10983 {
10984 type = memberType;
10985 break;
10986 }
10987 }
10988 }
10989 }
10990 }
10991 if(value)
10992 {
10993 FreeType(value->destType);
10994 value->destType = type;
10995 if(type)
10996 type->refCount++;
10997 ComputeExpression(value);
10998 }
10999 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11000 {
11001 if(type->kind == 8)
11002 {
11003 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11004
11005 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11006 {
11007 if(!_class->dataType)
11008 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11009 type = _class->dataType;
11010 }
11011 }
11012 if(dataMember)
11013 {
11014 void * ptr = inst->data + dataMemberOffset;
11015
11016 if(value->type == 2)
11017 {
11018 switch(type->kind)
11019 {
11020 case 3:
11021 {
11022 GetInt(value, (int *)ptr);
11023 break;
11024 }
11025 case 4:
11026 {
11027 GetInt64(value, (long long *)ptr);
11028 break;
11029 }
11030 case 22:
11031 {
11032 GetIntPtr(value, (intptr_t *)ptr);
11033 break;
11034 }
11035 case 23:
11036 {
11037 GetIntSize(value, (ssize_t *)ptr);
11038 break;
11039 }
11040 case 6:
11041 {
11042 GetFloat(value, (float *)ptr);
11043 break;
11044 }
11045 case 7:
11046 {
11047 GetDouble(value, (double *)ptr);
11048 break;
11049 }
11050 }
11051 }
11052 else if(value->type == 1)
11053 {
11054 if(type->kind == 8)
11055 {
11056 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11057
11058 if(_class->type == 1)
11059 {
11060 ComputeTypeSize(type);
11061 if(value->instance->data)
11062 memcpy(ptr, value->instance->data, type->size);
11063 }
11064 }
11065 }
11066 }
11067 else if(prop)
11068 {
11069 if(value->type == 1 && value->instance->data)
11070 {
11071 if(type->kind == 8)
11072 {
11073 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11074
11075 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
11076 {
11077 void (* Set)(void *, void *) = (void *)prop->Set;
11078
11079 Set(inst->data, value->instance->data);
11080 PopulateInstance(inst);
11081 }
11082 }
11083 }
11084 else if(value->type == 2)
11085 {
11086 switch(type->kind)
11087 {
11088 case 7:
11089 {
11090 void (* Set)(void *, double) = (void *)prop->Set;
11091
11092 Set(inst->data, strtod(value->constant, (((void *)0))));
11093 break;
11094 }
11095 case 6:
11096 {
11097 void (* Set)(void *, float) = (void *)prop->Set;
11098
11099 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11100 break;
11101 }
11102 case 3:
11103 {
11104 void (* Set)(void *, int) = (void *)prop->Set;
11105
11106 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11107 break;
11108 }
11109 case 4:
11110 {
11111 void (* Set)(void *, long long) = (void *)prop->Set;
11112
11113 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11114 break;
11115 }
11116 case 22:
11117 {
11118 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11119
11120 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11121 break;
11122 }
11123 case 23:
11124 {
11125 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11126
11127 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11128 break;
11129 }
11130 }
11131 }
11132 else if(value->type == 3)
11133 {
11134 char temp[1024];
11135
11136 ReadString(temp, value->string);
11137 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11138 }
11139 }
11140 }
11141 else if(!deepMember && type && _class->type == 3)
11142 {
11143 if(prop)
11144 {
11145 if(value->type == 2)
11146 {
11147 if(type->kind == 8)
11148 {
11149 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11150
11151 if(_class->type == 3)
11152 {
11153 if(!_class->dataType)
11154 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11155 type = _class->dataType;
11156 }
11157 }
11158 switch(type->kind)
11159 {
11160 case 6:
11161 {
11162 float fValue;
11163 float (* Set)(float) = (void *)prop->Set;
11164
11165 GetFloat(member->initializer->exp, &fValue);
11166 exp->constant = PrintFloat(Set(fValue));
11167 exp->type = 2;
11168 break;
11169 }
11170 case 7:
11171 {
11172 double dValue;
11173 double (* Set)(double) = (void *)prop->Set;
11174
11175 GetDouble(member->initializer->exp, &dValue);
11176 exp->constant = PrintDouble(Set(dValue));
11177 exp->type = 2;
11178 break;
11179 }
11180 }
11181 }
11182 }
11183 }
11184 else if(!deepMember && type && _class->type == 2)
11185 {
11186 if(prop)
11187 {
11188 if(value->type == 1 && value->instance->data)
11189 {
11190 unsigned int (* Set)(void *) = (void *)prop->Set;
11191
11192 bits = Set(value->instance->data);
11193 }
11194 else if(value->type == 2)
11195 {
11196 }
11197 }
11198 else if(dataMember)
11199 {
11200 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11201 struct Type * type;
11202 int part = 0;
11203
11204 GetInt(value, &part);
11205 bits = (bits & ~bitMember->mask);
11206 if(!bitMember->dataType)
11207 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11208 type = bitMember->dataType;
11209 if(type->kind == 8 && type->_class && type->_class->registered)
11210 {
11211 if(!type->_class->registered->dataType)
11212 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11213 type = type->_class->registered->dataType;
11214 }
11215 switch(type->kind)
11216 {
11217 case 24:
11218 case 1:
11219 if(type->isSigned)
11220 bits |= ((char)part << bitMember->pos);
11221 else
11222 bits |= ((unsigned char)part << bitMember->pos);
11223 break;
11224 case 2:
11225 if(type->isSigned)
11226 bits |= ((short)part << bitMember->pos);
11227 else
11228 bits |= ((unsigned short)part << bitMember->pos);
11229 break;
11230 case 3:
11231 case 5:
11232 if(type->isSigned)
11233 bits |= (part << bitMember->pos);
11234 else
11235 bits |= ((unsigned int)part << bitMember->pos);
11236 break;
11237 case 4:
11238 if(type->isSigned)
11239 bits |= ((long long)part << bitMember->pos);
11240 else
11241 bits |= ((uint64)part << bitMember->pos);
11242 break;
11243 case 22:
11244 if(type->isSigned)
11245 {
11246 bits |= ((intptr_t)part << bitMember->pos);
11247 }
11248 else
11249 {
11250 bits |= ((uintptr_t)part << bitMember->pos);
11251 }
11252 break;
11253 case 23:
11254 if(type->isSigned)
11255 {
11256 bits |= ((ssize_t)part << bitMember->pos);
11257 }
11258 else
11259 {
11260 bits |= ((size_t)part << bitMember->pos);
11261 }
11262 break;
11263 }
11264 }
11265 }
11266 }
11267 else
11268 {
11269 if(_class && _class->type == 3)
11270 {
11271 ComputeExpression(member->initializer->exp);
11272 exp->constant = member->initializer->exp->constant;
11273 exp->type = 2;
11274 member->initializer->exp->constant = (((void *)0));
11275 }
11276 }
11277 }
11278 }
11279 break;
11280 }
11281 }
11282 }
11283 }
11284 if(_class && _class->type == 2)
11285 {
11286 exp->constant = PrintHexUInt(bits);
11287 exp->type = 2;
11288 }
11289 if(exp->type != 1)
11290 {
11291 FreeInstance(inst);
11292 }
11293 }
11294
11295 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11296 {
11297 if(exp->op.op == SIZEOF)
11298 {
11299 FreeExpContents(exp);
11300 exp->type = 2;
11301 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11302 }
11303 else
11304 {
11305 if(!exp->op.exp1)
11306 {
11307 switch(exp->op.op)
11308 {
11309 case '+':
11310 {
11311 struct Expression * exp2 = exp->op.exp2;
11312
11313 exp->op.exp2 = (((void *)0));
11314 FreeExpContents(exp);
11315 FreeType(exp->expType);
11316 FreeType(exp->destType);
11317 *exp = *exp2;
11318 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11319 break;
11320 }
11321 case '-':
11322 if(op1->ops.Neg)
11323 {
11324 FreeExpContents(exp);
11325 op1->ops.Neg(exp, op1);
11326 }
11327 break;
11328 case '~':
11329 if(op1->ops.BitNot)
11330 {
11331 FreeExpContents(exp);
11332 op1->ops.BitNot(exp, op1);
11333 }
11334 break;
11335 case '!':
11336 if(op1->ops.Not)
11337 {
11338 FreeExpContents(exp);
11339 op1->ops.Not(exp, op1);
11340 }
11341 break;
11342 }
11343 }
11344 else
11345 {
11346 switch(exp->op.op)
11347 {
11348 case '+':
11349 if(op1->ops.Add)
11350 {
11351 FreeExpContents(exp);
11352 op1->ops.Add(exp, op1, op2);
11353 }
11354 break;
11355 case '-':
11356 if(op1->ops.Sub)
11357 {
11358 FreeExpContents(exp);
11359 op1->ops.Sub(exp, op1, op2);
11360 }
11361 break;
11362 case '*':
11363 if(op1->ops.Mul)
11364 {
11365 FreeExpContents(exp);
11366 op1->ops.Mul(exp, op1, op2);
11367 }
11368 break;
11369 case '/':
11370 if(op1->ops.Div)
11371 {
11372 FreeExpContents(exp);
11373 op1->ops.Div(exp, op1, op2);
11374 }
11375 break;
11376 case '%':
11377 if(op1->ops.Mod)
11378 {
11379 FreeExpContents(exp);
11380 op1->ops.Mod(exp, op1, op2);
11381 }
11382 break;
11383 case '&':
11384 if(exp->op.exp2)
11385 {
11386 if(op1->ops.BitAnd)
11387 {
11388 FreeExpContents(exp);
11389 op1->ops.BitAnd(exp, op1, op2);
11390 }
11391 }
11392 break;
11393 case '|':
11394 if(op1->ops.BitOr)
11395 {
11396 FreeExpContents(exp);
11397 op1->ops.BitOr(exp, op1, op2);
11398 }
11399 break;
11400 case '^':
11401 if(op1->ops.BitXor)
11402 {
11403 FreeExpContents(exp);
11404 op1->ops.BitXor(exp, op1, op2);
11405 }
11406 break;
11407 case LEFT_OP:
11408 if(op1->ops.LShift)
11409 {
11410 FreeExpContents(exp);
11411 op1->ops.LShift(exp, op1, op2);
11412 }
11413 break;
11414 case RIGHT_OP:
11415 if(op1->ops.RShift)
11416 {
11417 FreeExpContents(exp);
11418 op1->ops.RShift(exp, op1, op2);
11419 }
11420 break;
11421 case EQ_OP:
11422 if(op1->ops.Equ)
11423 {
11424 FreeExpContents(exp);
11425 op1->ops.Equ(exp, op1, op2);
11426 }
11427 break;
11428 case NE_OP:
11429 if(op1->ops.Nqu)
11430 {
11431 FreeExpContents(exp);
11432 op1->ops.Nqu(exp, op1, op2);
11433 }
11434 break;
11435 case AND_OP:
11436 if(op1->ops.And)
11437 {
11438 FreeExpContents(exp);
11439 op1->ops.And(exp, op1, op2);
11440 }
11441 break;
11442 case OR_OP:
11443 if(op1->ops.Or)
11444 {
11445 FreeExpContents(exp);
11446 op1->ops.Or(exp, op1, op2);
11447 }
11448 break;
11449 case '>':
11450 if(op1->ops.Grt)
11451 {
11452 FreeExpContents(exp);
11453 op1->ops.Grt(exp, op1, op2);
11454 }
11455 break;
11456 case '<':
11457 if(op1->ops.Sma)
11458 {
11459 FreeExpContents(exp);
11460 op1->ops.Sma(exp, op1, op2);
11461 }
11462 break;
11463 case GE_OP:
11464 if(op1->ops.GrtEqu)
11465 {
11466 FreeExpContents(exp);
11467 op1->ops.GrtEqu(exp, op1, op2);
11468 }
11469 break;
11470 case LE_OP:
11471 if(op1->ops.SmaEqu)
11472 {
11473 FreeExpContents(exp);
11474 op1->ops.SmaEqu(exp, op1, op2);
11475 }
11476 break;
11477 }
11478 }
11479 }
11480 }
11481
11482 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11483
11484 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11485
11486 void ComputeExpression(struct Expression * exp)
11487 {
11488 char expString[10240];
11489
11490 expString[0] = '\0';
11491 switch(exp->type)
11492 {
11493 case 1:
11494 {
11495 ComputeInstantiation(exp);
11496 break;
11497 }
11498 case 4:
11499 {
11500 struct Expression * exp1, * exp2 = (((void *)0));
11501 struct Operand op1 = 
11502 {
11503 0, 0, 0, 0, 
11504 {
11505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11506 }
11507 };
11508 struct Operand op2 = 
11509 {
11510 0, 0, 0, 0, 
11511 {
11512 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11513 }
11514 };
11515
11516 if(exp->op.exp2)
11517 ComputeExpression(exp->op.exp2);
11518 if(exp->op.exp1)
11519 {
11520 ComputeExpression(exp->op.exp1);
11521 exp1 = exp->op.exp1;
11522 exp2 = exp->op.exp2;
11523 op1 = GetOperand(exp1);
11524 if(op1.type)
11525 op1.type->refCount++;
11526 if(exp2)
11527 {
11528 op2 = GetOperand(exp2);
11529 if(op2.type)
11530 op2.type->refCount++;
11531 }
11532 }
11533 else
11534 {
11535 exp1 = exp->op.exp2;
11536 op1 = GetOperand(exp1);
11537 if(op1.type)
11538 op1.type->refCount++;
11539 }
11540 CallOperator(exp, exp1, exp2, &op1, &op2);
11541 if(op1.type)
11542 FreeType(op1.type);
11543 if(op2.type)
11544 FreeType(op2.type);
11545 break;
11546 }
11547 case 5:
11548 case 34:
11549 {
11550 struct Expression * e, * n;
11551
11552 for(e = (*exp->list).first; e; e = n)
11553 {
11554 n = e->next;
11555 if(!n)
11556 {
11557 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11558
11559 ComputeExpression(e);
11560 FreeType(exp->expType);
11561 FreeType(exp->destType);
11562 *exp = *e;
11563 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11564 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11565 }
11566 else
11567 {
11568 FreeExpression(e);
11569 }
11570 }
11571 break;
11572 }
11573 case 8:
11574 {
11575 struct Expression * memberExp = exp->member.exp;
11576 struct Identifier * memberID = exp->member.member;
11577 struct Type * type;
11578
11579 ComputeExpression(exp->member.exp);
11580 type = exp->member.exp->expType;
11581 if(type)
11582 {
11583 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)));
11584 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11585 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11586 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11587
11588 if(type->kind == 19 && exp->member.exp->type == 26)
11589 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11590 if(!_class)
11591 {
11592 char string[256];
11593 struct Symbol * classSym;
11594
11595 string[0] = '\0';
11596 PrintTypeNoConst(type, string, 0x0, 0x1);
11597 classSym = FindClass(string);
11598 _class = classSym ? classSym->registered : (((void *)0));
11599 }
11600 if(exp->member.member)
11601 {
11602 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11603 if(!prop)
11604 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11605 }
11606 if(!prop && !member && _class && exp->member.member)
11607 {
11608 struct Symbol * classSym = FindClass(exp->member.member->string);
11609
11610 convertTo = _class;
11611 _class = classSym ? classSym->registered : (((void *)0));
11612 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11613 }
11614 if(prop)
11615 {
11616 if(prop->compiled)
11617 {
11618 struct Type * type = prop->dataType;
11619
11620 if(_class->type == 3)
11621 {
11622 if(type->kind == 8)
11623 {
11624 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11625
11626 if(_class->type == 3)
11627 {
11628 if(!_class->dataType)
11629 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11630 type = _class->dataType;
11631 }
11632 }
11633 switch(type->kind)
11634 {
11635 case 6:
11636 {
11637 float value;
11638 float (* Get)(float) = (void *)prop->Get;
11639
11640 GetFloat(exp->member.exp, &value);
11641 exp->constant = PrintFloat(Get ? Get(value) : value);
11642 exp->type = 2;
11643 break;
11644 }
11645 case 7:
11646 {
11647 double value;
11648 double (* Get)(double);
11649
11650 GetDouble(exp->member.exp, &value);
11651 if(convertTo)
11652 Get = (void *)prop->Set;
11653 else
11654 Get = (void *)prop->Get;
11655 exp->constant = PrintDouble(Get ? Get(value) : value);
11656 exp->type = 2;
11657 break;
11658 }
11659 }
11660 }
11661 else
11662 {
11663 if(convertTo)
11664 {
11665 struct Expression * value = exp->member.exp;
11666 struct Type * type;
11667
11668 if(!prop->dataType)
11669 ProcessPropertyType(prop);
11670 type = prop->dataType;
11671 if(!type)
11672 {
11673 }
11674 else if(_class->type == 1)
11675 {
11676 switch(type->kind)
11677 {
11678 case 8:
11679 {
11680 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11681
11682 if(propertyClass->type == 1 && value->type == 1)
11683 {
11684 void (* Set)(void *, void *) = (void *)prop->Set;
11685
11686 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11687 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11688 exp->instance->_class = MkSpecifierName(_class->fullName);
11689 exp->instance->loc = exp->loc;
11690 exp->type = 1;
11691 Set(exp->instance->data, value->instance->data);
11692 PopulateInstance(exp->instance);
11693 }
11694 break;
11695 }
11696 case 3:
11697 {
11698 int intValue;
11699 void (* Set)(void *, int) = (void *)prop->Set;
11700
11701 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11702 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11703 exp->instance->_class = MkSpecifierName(_class->fullName);
11704 exp->instance->loc = exp->loc;
11705 exp->type = 1;
11706 GetInt(value, &intValue);
11707 Set(exp->instance->data, intValue);
11708 PopulateInstance(exp->instance);
11709 break;
11710 }
11711 case 4:
11712 {
11713 long long intValue;
11714 void (* Set)(void *, long long) = (void *)prop->Set;
11715
11716 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11717 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11718 exp->instance->_class = MkSpecifierName(_class->fullName);
11719 exp->instance->loc = exp->loc;
11720 exp->type = 1;
11721 GetInt64(value, &intValue);
11722 Set(exp->instance->data, intValue);
11723 PopulateInstance(exp->instance);
11724 break;
11725 }
11726 case 22:
11727 {
11728 intptr_t intValue;
11729 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11730
11731 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11732 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11733 exp->instance->_class = MkSpecifierName(_class->fullName);
11734 exp->instance->loc = exp->loc;
11735 exp->type = 1;
11736 GetIntPtr(value, &intValue);
11737 Set(exp->instance->data, intValue);
11738 PopulateInstance(exp->instance);
11739 break;
11740 }
11741 case 23:
11742 {
11743 ssize_t intValue;
11744 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11745
11746 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11747 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11748 exp->instance->_class = MkSpecifierName(_class->fullName);
11749 exp->instance->loc = exp->loc;
11750 exp->type = 1;
11751 GetIntSize(value, &intValue);
11752 Set(exp->instance->data, intValue);
11753 PopulateInstance(exp->instance);
11754 break;
11755 }
11756 case 7:
11757 {
11758 double doubleValue;
11759 void (* Set)(void *, double) = (void *)prop->Set;
11760
11761 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11762 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11763 exp->instance->_class = MkSpecifierName(_class->fullName);
11764 exp->instance->loc = exp->loc;
11765 exp->type = 1;
11766 GetDouble(value, &doubleValue);
11767 Set(exp->instance->data, doubleValue);
11768 PopulateInstance(exp->instance);
11769 break;
11770 }
11771 }
11772 }
11773 else if(_class->type == 2)
11774 {
11775 switch(type->kind)
11776 {
11777 case 8:
11778 {
11779 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11780
11781 if(propertyClass->type == 1 && value->instance->data)
11782 {
11783 unsigned int (* Set)(void *) = (void *)prop->Set;
11784 unsigned int bits = Set(value->instance->data);
11785
11786 exp->constant = PrintHexUInt(bits);
11787 exp->type = 2;
11788 break;
11789 }
11790 else if(_class->type == 2)
11791 {
11792 unsigned int value;
11793 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11794 unsigned int bits;
11795
11796 GetUInt(exp->member.exp, &value);
11797 bits = Set(value);
11798 exp->constant = PrintHexUInt(bits);
11799 exp->type = 2;
11800 }
11801 }
11802 }
11803 }
11804 }
11805 else
11806 {
11807 if(_class->type == 2)
11808 {
11809 unsigned int value;
11810
11811 GetUInt(exp->member.exp, &value);
11812 switch(type->kind)
11813 {
11814 case 8:
11815 {
11816 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11817
11818 if(_class->type == 1)
11819 {
11820 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11821
11822 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11823 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11824 exp->instance->_class = MkSpecifierName(_class->fullName);
11825 exp->instance->loc = exp->loc;
11826 exp->type = 1;
11827 Get(value, exp->instance->data);
11828 PopulateInstance(exp->instance);
11829 }
11830 else if(_class->type == 2)
11831 {
11832 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11833 uint64 bits = Get(value);
11834
11835 exp->constant = PrintHexUInt64(bits);
11836 exp->type = 2;
11837 }
11838 break;
11839 }
11840 }
11841 }
11842 else if(_class->type == 1)
11843 {
11844 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11845
11846 switch(type->kind)
11847 {
11848 case 8:
11849 {
11850 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11851
11852 if(_class->type == 1 && value)
11853 {
11854 void (* Get)(void *, void *) = (void *)prop->Get;
11855
11856 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11857 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11858 exp->instance->_class = MkSpecifierName(_class->fullName);
11859 exp->instance->loc = exp->loc;
11860 exp->type = 1;
11861 Get(value, exp->instance->data);
11862 PopulateInstance(exp->instance);
11863 }
11864 break;
11865 }
11866 }
11867 }
11868 }
11869 }
11870 }
11871 else
11872 {
11873 exp->isConstant = 0x0;
11874 }
11875 }
11876 else if(member)
11877 {
11878 }
11879 }
11880 if(exp->type != 8)
11881 {
11882 FreeExpression(memberExp);
11883 FreeIdentifier(memberID);
11884 }
11885 break;
11886 }
11887 case 10:
11888 {
11889 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11890
11891 FreeExpContents(exp);
11892 exp->constant = PrintUInt(ComputeTypeSize(type));
11893 exp->type = 2;
11894 FreeType(type);
11895 break;
11896 }
11897 case 15:
11898 {
11899 struct Symbol * classSym = exp->_class->symbol;
11900
11901 if(classSym && classSym->registered)
11902 {
11903 if(classSym->registered->fixed)
11904 {
11905 FreeSpecifier(exp->_class);
11906 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11907 exp->type = 2;
11908 }
11909 else
11910 {
11911 char className[1024];
11912
11913 strcpy(className, "__ecereClass_");
11914 FullClassNameCat(className, classSym->string, 0x1);
11915 MangleClassName(className);
11916 DeclareClass(classSym, className);
11917 FreeExpContents(exp);
11918 exp->type = 9;
11919 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11920 exp->member.member = MkIdentifier("structSize");
11921 }
11922 }
11923 break;
11924 }
11925 case 11:
11926 {
11927 struct Type * type;
11928 struct Expression * e = exp;
11929
11930 if(exp->type == 11)
11931 {
11932 if(exp->cast.exp)
11933 ComputeExpression(exp->cast.exp);
11934 e = exp->cast.exp;
11935 }
11936 if(e && exp->expType)
11937 {
11938 type = exp->expType;
11939 if(type->kind == 8)
11940 {
11941 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11942
11943 if(_class && (_class->type == 3 || _class->type == 2))
11944 {
11945 if(!_class->dataType)
11946 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11947 type = _class->dataType;
11948 }
11949 }
11950 switch(type->kind)
11951 {
11952 case 24:
11953 case 1:
11954 if(type->isSigned)
11955 {
11956 char value;
11957
11958 GetChar(e, &value);
11959 FreeExpContents(exp);
11960 exp->constant = PrintChar(value);
11961 exp->type = 2;
11962 }
11963 else
11964 {
11965 unsigned char value;
11966
11967 GetUChar(e, &value);
11968 FreeExpContents(exp);
11969 exp->constant = PrintUChar(value);
11970 exp->type = 2;
11971 }
11972 break;
11973 case 2:
11974 if(type->isSigned)
11975 {
11976 short value;
11977
11978 GetShort(e, &value);
11979 FreeExpContents(exp);
11980 exp->constant = PrintShort(value);
11981 exp->type = 2;
11982 }
11983 else
11984 {
11985 unsigned short value;
11986
11987 GetUShort(e, &value);
11988 FreeExpContents(exp);
11989 exp->constant = PrintUShort(value);
11990 exp->type = 2;
11991 }
11992 break;
11993 case 3:
11994 if(type->isSigned)
11995 {
11996 int value;
11997
11998 GetInt(e, &value);
11999 FreeExpContents(exp);
12000 exp->constant = PrintInt(value);
12001 exp->type = 2;
12002 }
12003 else
12004 {
12005 unsigned int value;
12006
12007 GetUInt(e, &value);
12008 FreeExpContents(exp);
12009 exp->constant = PrintUInt(value);
12010 exp->type = 2;
12011 }
12012 break;
12013 case 4:
12014 if(type->isSigned)
12015 {
12016 long long value;
12017
12018 GetInt64(e, &value);
12019 FreeExpContents(exp);
12020 exp->constant = PrintInt64(value);
12021 exp->type = 2;
12022 }
12023 else
12024 {
12025 uint64 value;
12026
12027 GetUInt64(e, &value);
12028 FreeExpContents(exp);
12029 exp->constant = PrintUInt64(value);
12030 exp->type = 2;
12031 }
12032 break;
12033 case 22:
12034 if(type->isSigned)
12035 {
12036 intptr_t value;
12037
12038 GetIntPtr(e, &value);
12039 FreeExpContents(exp);
12040 exp->constant = PrintInt64((long long)value);
12041 exp->type = 2;
12042 }
12043 else
12044 {
12045 uintptr_t value;
12046
12047 GetUIntPtr(e, &value);
12048 FreeExpContents(exp);
12049 exp->constant = PrintUInt64((uint64)value);
12050 exp->type = 2;
12051 }
12052 break;
12053 case 23:
12054 if(type->isSigned)
12055 {
12056 ssize_t value;
12057
12058 GetIntSize(e, &value);
12059 FreeExpContents(exp);
12060 exp->constant = PrintInt64((long long)value);
12061 exp->type = 2;
12062 }
12063 else
12064 {
12065 size_t value;
12066
12067 GetUIntSize(e, &value);
12068 FreeExpContents(exp);
12069 exp->constant = PrintUInt64((uint64)value);
12070 exp->type = 2;
12071 }
12072 break;
12073 case 6:
12074 {
12075 float value;
12076
12077 GetFloat(e, &value);
12078 FreeExpContents(exp);
12079 exp->constant = PrintFloat(value);
12080 exp->type = 2;
12081 break;
12082 }
12083 case 7:
12084 {
12085 double value;
12086
12087 GetDouble(e, &value);
12088 FreeExpContents(exp);
12089 exp->constant = PrintDouble(value);
12090 exp->type = 2;
12091 break;
12092 }
12093 }
12094 }
12095 break;
12096 }
12097 case 12:
12098 {
12099 struct Operand op1 = 
12100 {
12101 0, 0, 0, 0, 
12102 {
12103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12104 }
12105 };
12106 struct Operand op2 = 
12107 {
12108 0, 0, 0, 0, 
12109 {
12110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12111 }
12112 };
12113 struct Operand op3 = 
12114 {
12115 0, 0, 0, 0, 
12116 {
12117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12118 }
12119 };
12120
12121 if(exp->cond.exp)
12122 ComputeExpression((*exp->cond.exp).last);
12123 if(exp->cond.elseExp)
12124 ComputeExpression(exp->cond.elseExp);
12125 if(exp->cond.cond)
12126 ComputeExpression(exp->cond.cond);
12127 op1 = GetOperand(exp->cond.cond);
12128 if(op1.type)
12129 op1.type->refCount++;
12130 op2 = GetOperand((*exp->cond.exp).last);
12131 if(op2.type)
12132 op2.type->refCount++;
12133 op3 = GetOperand(exp->cond.elseExp);
12134 if(op3.type)
12135 op3.type->refCount++;
12136 if(op1.ops.Cond)
12137 {
12138 FreeExpContents(exp);
12139 op1.ops.Cond(exp, &op1, &op2, &op3);
12140 }
12141 if(op1.type)
12142 FreeType(op1.type);
12143 if(op2.type)
12144 FreeType(op2.type);
12145 if(op3.type)
12146 FreeType(op3.type);
12147 break;
12148 }
12149 }
12150 }
12151
12152 void ApplyAnyObjectLogic(struct Expression * e);
12153
12154 extern void CopyTypeInto(struct Type * type, struct Type * src);
12155
12156 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12157 {
12158 unsigned int result = 0x1;
12159
12160 if(destType)
12161 {
12162 struct __ecereNameSpace__ecere__sys__OldList converts = 
12163 {
12164 0, 0, 0, 0, 0
12165 };
12166 struct Conversion * convert;
12167
12168 if(destType->kind == 0)
12169 return 0x0;
12170 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12171 result = 0x0;
12172 if(converts.count)
12173 {
12174 for(convert = converts.first; convert; convert = convert->next)
12175 {
12176 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12177
12178 if(!empty)
12179 {
12180 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12181 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12182
12183 *newExp = *exp;
12184 newExp->destType = (((void *)0));
12185 if(convert->isGet)
12186 {
12187 exp->type = 8;
12188 exp->addedThis = 0x1;
12189 exp->member.exp = newExp;
12190 FreeType(exp->member.exp->expType);
12191 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12192 exp->member.exp->expType->classObjectType = objectType;
12193 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12194 exp->member.memberType = 1;
12195 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12196 exp->needCast = 0x1;
12197 if(exp->expType)
12198 exp->expType->refCount++;
12199 ApplyAnyObjectLogic(exp->member.exp);
12200 }
12201 else
12202 {
12203 {
12204 exp->type = 8;
12205 exp->addedThis = 0x1;
12206 exp->member.exp = newExp;
12207 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12208 {
12209 newExp->byReference = 0x1;
12210 }
12211 FreeType(exp->member.exp->expType);
12212 exp->member.exp->expType = (((void *)0));
12213 if(convert->convert->dataType)
12214 {
12215 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12216 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12217 exp->member.exp->expType->refCount = 1;
12218 exp->member.exp->expType->classObjectType = objectType;
12219 ApplyAnyObjectLogic(exp->member.exp);
12220 }
12221 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12222 exp->member.memberType = 4;
12223 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12224 exp->needCast = 0x1;
12225 if(convert->resultType)
12226 convert->resultType->refCount++;
12227 }
12228 }
12229 }
12230 else
12231 {
12232 FreeType(exp->expType);
12233 if(convert->isGet)
12234 {
12235 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12236 exp->needCast = 0x1;
12237 if(exp->expType)
12238 exp->expType->refCount++;
12239 }
12240 else
12241 {
12242 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12243 exp->needCast = 0x1;
12244 if(convert->resultType)
12245 convert->resultType->refCount++;
12246 }
12247 }
12248 }
12249 if(exp->isConstant && inCompiler)
12250 ComputeExpression(exp);
12251 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12252 }
12253 if(!result && exp->expType && converts.count)
12254 {
12255 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12256 }
12257 if(!result && exp->expType && exp->destType)
12258 {
12259 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))
12260 result = 0x1;
12261 }
12262 }
12263 return result;
12264 }
12265
12266 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12267
12268 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12269
12270 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12271
12272 void CheckTemplateTypes(struct Expression * exp)
12273 {
12274 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12275 {
12276 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12277 struct Statement * compound;
12278 struct Context * context;
12279
12280 *newExp = *exp;
12281 if(exp->destType)
12282 exp->destType->refCount++;
12283 if(exp->expType)
12284 exp->expType->refCount++;
12285 newExp->prev = (((void *)0));
12286 newExp->next = (((void *)0));
12287 switch(exp->expType->kind)
12288 {
12289 case 7:
12290 if(exp->destType->classObjectType)
12291 {
12292 if(exp->destType)
12293 exp->destType->refCount--;
12294 if(exp->expType)
12295 exp->expType->refCount--;
12296 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12297 }
12298 else
12299 {
12300 struct __ecereNameSpace__ecere__sys__OldList * specs;
12301 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12302 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12303
12304 context = PushContext();
12305 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12306 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12307 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12308 exp->type = 25;
12309 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12310 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12311 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12312 exp->compound->compound.context = context;
12313 PopContext(context);
12314 }
12315 break;
12316 default:
12317 exp->type = 11;
12318 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12319 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12320 break;
12321 }
12322 }
12323 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12324 {
12325 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12326 struct Statement * compound;
12327 struct Context * context;
12328
12329 *newExp = *exp;
12330 if(exp->destType)
12331 exp->destType->refCount++;
12332 if(exp->expType)
12333 exp->expType->refCount++;
12334 newExp->prev = (((void *)0));
12335 newExp->next = (((void *)0));
12336 switch(exp->expType->kind)
12337 {
12338 case 7:
12339 if(exp->destType->classObjectType)
12340 {
12341 if(exp->destType)
12342 exp->destType->refCount--;
12343 if(exp->expType)
12344 exp->expType->refCount--;
12345 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12346 }
12347 else
12348 {
12349 struct __ecereNameSpace__ecere__sys__OldList * specs;
12350 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12351 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12352
12353 context = PushContext();
12354 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12355 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12356 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12357 exp->type = 25;
12358 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12359 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12360 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12361 exp->compound->compound.context = context;
12362 PopContext(context);
12363 }
12364 break;
12365 case 8:
12366 {
12367 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12368 {
12369 exp->type = 5;
12370 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12371 ProcessExpressionType((*exp->list).first);
12372 break;
12373 }
12374 else
12375 {
12376 exp->type = 5;
12377 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12378 newExp->needCast = 0x1;
12379 ProcessExpressionType((*exp->list).first);
12380 break;
12381 }
12382 }
12383 default:
12384 {
12385 if(exp->expType->kind == 20)
12386 {
12387 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12388
12389 if(type)
12390 {
12391 FreeType(exp->destType);
12392 FreeType(exp->expType);
12393 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12394 break;
12395 }
12396 }
12397 if(newExp->type == 8 && newExp->member.memberType == 3)
12398 {
12399 exp->type = 4;
12400 exp->op.op = '*';
12401 exp->op.exp1 = (((void *)0));
12402 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12403 }
12404 else
12405 {
12406 char typeString[1024];
12407 struct Declarator * decl;
12408 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12409
12410 typeString[0] = '\0';
12411 PrintType(exp->expType, typeString, 0x0, 0x0);
12412 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12413 exp->type = 11;
12414 exp->cast.typeName = MkTypeName(specs, decl);
12415 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12416 exp->cast.exp->needCast = 0x1;
12417 }
12418 break;
12419 }
12420 }
12421 }
12422 }
12423
12424 extern int strncmp(const char * , const char * , size_t n);
12425
12426 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12427
12428 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12429 {
12430 int nsLen = strlen(nameSpace);
12431 struct Symbol * symbol;
12432
12433 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)))
12434 {
12435 char * s = symbol->string;
12436
12437 if(!strncmp(s, nameSpace, nsLen))
12438 {
12439 int c;
12440 char * namePart;
12441
12442 for(c = strlen(s) - 1; c >= 0; c--)
12443 if(s[c] == ':')
12444 break;
12445 namePart = s + c + 1;
12446 if(!strcmp(namePart, name))
12447 {
12448 return symbol;
12449 }
12450 }
12451 else
12452 break;
12453 }
12454 return (((void *)0));
12455 }
12456
12457 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12458 {
12459 int c;
12460 char nameSpace[1024];
12461 char * namePart;
12462 unsigned int gotColon = 0x0;
12463
12464 nameSpace[0] = '\0';
12465 for(c = strlen(name) - 1; c >= 0; c--)
12466 if(name[c] == ':')
12467 {
12468 gotColon = 0x1;
12469 break;
12470 }
12471 namePart = name + c + 1;
12472 while(c >= 0 && name[c] == ':')
12473 c--;
12474 if(c >= 0)
12475 {
12476 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12477
12478 if(symbol)
12479 return symbol;
12480 memcpy(nameSpace, name, c + 1);
12481 nameSpace[c + 1] = (char)0;
12482 return ScanWithNameSpace(tree, nameSpace, namePart);
12483 }
12484 else if(gotColon)
12485 {
12486 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12487
12488 return symbol;
12489 }
12490 else
12491 {
12492 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12493
12494 if(symbol)
12495 return symbol;
12496 return ScanWithNameSpace(tree, "", namePart);
12497 }
12498 return (((void *)0));
12499 }
12500
12501 static void ProcessDeclaration(struct Declaration * decl);
12502
12503 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12504 {
12505 struct Context * ctx;
12506 struct Symbol * symbol = (((void *)0));
12507
12508 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12509 {
12510 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12511 {
12512 symbol = (((void *)0));
12513 if(thisNameSpace)
12514 {
12515 char curName[1024];
12516
12517 strcpy(curName, thisNameSpace);
12518 strcat(curName, "::");
12519 strcat(curName, name);
12520 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12521 }
12522 if(!symbol)
12523 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12524 }
12525 else
12526 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12527 if(symbol || ctx == endContext)
12528 break;
12529 }
12530 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12531 {
12532 if(symbol->pointerExternal->type == 0)
12533 {
12534 struct FunctionDefinition * function = symbol->pointerExternal->function;
12535 struct Context * tmpContext = curContext;
12536
12537 curContext = (((void *)0));
12538 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12539 curContext = tmpContext;
12540 symbol->pointerExternal->symbol = symbol;
12541 DeclareType(symbol->type, 0x1, 0x1);
12542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12543 symbol->id = curExternal->symbol->idCode;
12544 }
12545 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12546 {
12547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12548 symbol->id = curExternal->symbol->idCode;
12549 }
12550 }
12551 return symbol;
12552 }
12553
12554 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12555 {
12556 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12557 ListAdd(specs, MkSpecifier(UNSIGNED));
12558 switch(type->kind)
12559 {
12560 case 8:
12561 {
12562 if(type->_class->registered)
12563 {
12564 if(!type->_class->registered->dataType)
12565 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12566 GetTypeSpecs(type->_class->registered->dataType, specs);
12567 }
12568 break;
12569 }
12570 case 7:
12571 ListAdd(specs, MkSpecifier(DOUBLE));
12572 break;
12573 case 6:
12574 ListAdd(specs, MkSpecifier(FLOAT));
12575 break;
12576 case 1:
12577 ListAdd(specs, MkSpecifier(CHAR));
12578 break;
12579 case 24:
12580 ListAdd(specs, MkSpecifier(_BOOL));
12581 break;
12582 case 2:
12583 ListAdd(specs, MkSpecifier(SHORT));
12584 break;
12585 case 4:
12586 ListAdd(specs, MkSpecifier(INT64));
12587 break;
12588 case 22:
12589 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12590 break;
12591 case 23:
12592 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12593 break;
12594 case 3:
12595 default:
12596 ListAdd(specs, MkSpecifier(INT));
12597 break;
12598 }
12599 }
12600
12601 static void PrintArraySize(struct Type * arrayType, char * string)
12602 {
12603 char size[256];
12604
12605 size[0] = '\0';
12606 strcat(size, "[");
12607 if(arrayType->enumClass)
12608 strcat(size, arrayType->enumClass->string);
12609 else if(arrayType->arraySizeExp)
12610 PrintExpression(arrayType->arraySizeExp, size);
12611 strcat(size, "]");
12612 strcat(string, size);
12613 }
12614
12615 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12616 {
12617 if(type)
12618 {
12619 if(printConst && type->constant)
12620 strcat(string, "const ");
12621 switch(type->kind)
12622 {
12623 case 8:
12624 {
12625 struct Symbol * c = type->_class;
12626
12627 if(type->classObjectType == 2)
12628 strcat(string, "typed_object");
12629 else if(type->classObjectType == 3)
12630 strcat(string, "any_object");
12631 else
12632 {
12633 if(c && c->string)
12634 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12635 }
12636 if(type->byReference)
12637 strcat(string, " &");
12638 break;
12639 }
12640 case 0:
12641 strcat(string, "void");
12642 break;
12643 case 3:
12644 strcat(string, type->isSigned ? "int" : "uint");
12645 break;
12646 case 4:
12647 strcat(string, type->isSigned ? "int64" : "uint64");
12648 break;
12649 case 22:
12650 strcat(string, type->isSigned ? "intptr" : "uintptr");
12651 break;
12652 case 23:
12653 strcat(string, type->isSigned ? "intsize" : "uintsize");
12654 break;
12655 case 1:
12656 strcat(string, type->isSigned ? "char" : "byte");
12657 break;
12658 case 24:
12659 strcat(string, "_Bool");
12660 break;
12661 case 2:
12662 strcat(string, type->isSigned ? "short" : "uint16");
12663 break;
12664 case 6:
12665 strcat(string, "float");
12666 break;
12667 case 7:
12668 strcat(string, "double");
12669 break;
12670 case 9:
12671 if(type->enumName)
12672 {
12673 strcat(string, "struct ");
12674 strcat(string, type->enumName);
12675 }
12676 else if(type->typeName)
12677 strcat(string, type->typeName);
12678 else
12679 {
12680 struct Type * member;
12681
12682 strcat(string, "struct { ");
12683 for(member = type->members.first; member; member = member->next)
12684 {
12685 PrintType(member, string, 0x1, fullName);
12686 strcat(string, "; ");
12687 }
12688 strcat(string, "}");
12689 }
12690 break;
12691 case 10:
12692 if(type->enumName)
12693 {
12694 strcat(string, "union ");
12695 strcat(string, type->enumName);
12696 }
12697 else if(type->typeName)
12698 strcat(string, type->typeName);
12699 else
12700 {
12701 strcat(string, "union ");
12702 strcat(string, "(unnamed)");
12703 }
12704 break;
12705 case 15:
12706 if(type->enumName)
12707 {
12708 strcat(string, "enum ");
12709 strcat(string, type->enumName);
12710 }
12711 else if(type->typeName)
12712 strcat(string, type->typeName);
12713 else
12714 strcat(string, "int");
12715 break;
12716 case 14:
12717 strcat(string, "...");
12718 break;
12719 case 19:
12720 strcat(string, "subclass(");
12721 strcat(string, type->_class ? type->_class->string : "int");
12722 strcat(string, ")");
12723 break;
12724 case 20:
12725 strcat(string, type->templateParameter->identifier->string);
12726 break;
12727 case 21:
12728 strcat(string, "thisclass");
12729 break;
12730 case 17:
12731 strcat(string, "__builtin_va_list");
12732 break;
12733 }
12734 }
12735 }
12736
12737 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12738
12739 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12740 {
12741 if(type->name && type->name[0])
12742 {
12743 if(fullName)
12744 strcat(string, type->name);
12745 else
12746 {
12747 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12748
12749 if(name)
12750 name += 2;
12751 else
12752 name = type->name;
12753 strcat(string, name);
12754 }
12755 }
12756 }
12757
12758 static void PrintAttribs(struct Type * type, char * string)
12759 {
12760 if(type)
12761 {
12762 if(type->dllExport)
12763 strcat(string, "dllexport ");
12764 if(type->attrStdcall)
12765 strcat(string, "stdcall ");
12766 }
12767 }
12768
12769 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12770 {
12771 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12772 {
12773 struct Type * attrType = (((void *)0));
12774
12775 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12776 PrintAttribs(type, string);
12777 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12778 strcat(string, " const");
12779 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12780 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12781 strcat(string, " (");
12782 if(type->kind == 13)
12783 {
12784 if(type->type->kind == 11 || type->type->kind == 16)
12785 PrintAttribs(type->type, string);
12786 }
12787 if(type->kind == 13)
12788 {
12789 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12790 strcat(string, "*");
12791 else
12792 strcat(string, " *");
12793 }
12794 if(printConst && type->constant && type->kind == 13)
12795 strcat(string, " const");
12796 }
12797 else
12798 PrintTypeSpecs(type, string, fullName, printConst);
12799 }
12800
12801 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12802 {
12803 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12804 strcat(string, ")");
12805 if(type->kind == 12)
12806 PrintArraySize(type, string);
12807 else if(type->kind == 11)
12808 {
12809 struct Type * param;
12810
12811 strcat(string, "(");
12812 for(param = type->params.first; param; param = param->next)
12813 {
12814 PrintType(param, string, 0x1, fullName);
12815 if(param->next)
12816 strcat(string, ", ");
12817 }
12818 strcat(string, ")");
12819 }
12820 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12821 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12822 }
12823
12824 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12825 {
12826 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12827 if(type->thisClass || (printName && type->name && type->name[0]))
12828 strcat(string, " ");
12829 if((type->thisClass || type->staticMethod))
12830 {
12831 struct Symbol * _class = type->thisClass;
12832
12833 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12834 {
12835 if(type->classObjectType == 1)
12836 strcat(string, "class");
12837 else
12838 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12839 }
12840 else if(_class && _class->string)
12841 {
12842 char * s = _class->string;
12843
12844 if(fullName)
12845 strcat(string, s);
12846 else
12847 {
12848 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12849
12850 if(name)
12851 name += 2;
12852 else
12853 name = s;
12854 strcat(string, name);
12855 }
12856 }
12857 strcat(string, "::");
12858 }
12859 if(printName && type->name)
12860 PrintName(type, string, fullName);
12861 PostPrintType(type, string, fullName);
12862 if(type->bitFieldCount)
12863 {
12864 char count[100];
12865
12866 sprintf(count, ":%d", type->bitFieldCount);
12867 strcat(string, count);
12868 }
12869 }
12870
12871 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12872 {
12873 _PrintType(type, string, printName, fullName, 0x1);
12874 }
12875
12876 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12877 {
12878 _PrintType(type, string, printName, fullName, 0x0);
12879 }
12880
12881 static struct Type * FindMember(struct Type * type, char * string)
12882 {
12883 struct Type * memberType;
12884
12885 for(memberType = type->members.first; memberType; memberType = memberType->next)
12886 {
12887 if(!memberType->name)
12888 {
12889 struct Type * subType = FindMember(memberType, string);
12890
12891 if(subType)
12892 return subType;
12893 }
12894 else if(!strcmp(memberType->name, string))
12895 return memberType;
12896 }
12897 return (((void *)0));
12898 }
12899
12900 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12901 {
12902 struct Type * memberType;
12903
12904 for(memberType = type->members.first; memberType; memberType = memberType->next)
12905 {
12906 if(!memberType->name)
12907 {
12908 struct Type * subType = FindMember(memberType, string);
12909
12910 if(subType)
12911 {
12912 *offset += memberType->offset;
12913 return subType;
12914 }
12915 }
12916 else if(!strcmp(memberType->name, string))
12917 {
12918 *offset += memberType->offset;
12919 return memberType;
12920 }
12921 }
12922 return (((void *)0));
12923 }
12924
12925 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12926
12927 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12928
12929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12930
12931 struct Expression * ParseExpressionString(char * expression)
12932 {
12933 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12934 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
12935 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12936
12937 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12938 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12939 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12940 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12941
12942 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12943 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12944 echoOn = 0x0;
12945 parsedExpression = (((void *)0));
12946 resetScanner();
12947 expression_yyparse();
12948 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12949 return parsedExpression;
12950 }
12951
12952 extern char *  QMkString(char *  source);
12953
12954 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12955 {
12956 struct Identifier * id = exp->identifier;
12957 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12958 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12959 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12961
12962 if(_class && _class->type == 4)
12963 {
12964 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12965 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12966
12967 if(enumClass)
12968 {
12969 struct __ecereNameSpace__ecere__com__Class * baseClass;
12970
12971 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12972 {
12973 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12974
12975 for(value = e->values.first; value; value = value->next)
12976 {
12977 if(!strcmp(value->name, id->string))
12978 break;
12979 }
12980 if(value)
12981 {
12982 char constant[256];
12983
12984 FreeExpContents(exp);
12985 exp->type = 2;
12986 exp->isConstant = 0x1;
12987 if(!strcmp(baseClass->dataTypeString, "int"))
12988 sprintf(constant, "%d", (int)value->data);
12989 else
12990 sprintf(constant, "0x%X", (int)value->data);
12991 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12992 exp->expType = MkClassType(baseClass->fullName);
12993 break;
12994 }
12995 }
12996 }
12997 if(value)
12998 return 0x1;
12999 }
13000 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13001 {
13002 ProcessMethodType(method);
13003 exp->expType = __extension__ ({
13004 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13005
13006 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13007 });
13008 return 0x1;
13009 }
13010 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13011 {
13012 if(!prop->dataType)
13013 ProcessPropertyType(prop);
13014 exp->expType = prop->dataType;
13015 if(prop->dataType)
13016 prop->dataType->refCount++;
13017 return 0x1;
13018 }
13019 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13020 {
13021 if(!member->dataType)
13022 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13023 exp->expType = member->dataType;
13024 if(member->dataType)
13025 member->dataType->refCount++;
13026 return 0x1;
13027 }
13028 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13029 {
13030 if(!classProp->dataType)
13031 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13032 if(classProp->constant)
13033 {
13034 FreeExpContents(exp);
13035 exp->isConstant = 0x1;
13036 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13037 {
13038 exp->type = 3;
13039 exp->constant = QMkString((char *)classProp->Get(_class));
13040 }
13041 else
13042 {
13043 char constant[256];
13044
13045 exp->type = 2;
13046 sprintf(constant, "%d", (int)classProp->Get(_class));
13047 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13048 }
13049 }
13050 else
13051 {
13052 }
13053 exp->expType = classProp->dataType;
13054 if(classProp->dataType)
13055 classProp->dataType->refCount++;
13056 return 0x1;
13057 }
13058 return 0x0;
13059 }
13060
13061 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13062 {
13063 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13064 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13065 struct __ecereNameSpace__ecere__com__NameSpace * child;
13066
13067 if(!data)
13068 {
13069 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)))
13070 {
13071 data = ScanGlobalData(child, name);
13072 if(data)
13073 break;
13074 }
13075 }
13076 return data;
13077 }
13078
13079 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13080
13081 extern char *  strncpy(char * , const char * , size_t n);
13082
13083 static struct GlobalData * FindGlobalData(char * name)
13084 {
13085 int start = 0, c;
13086 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13087
13088 nameSpace = globalData;
13089 for(c = 0; name[c]; c++)
13090 {
13091 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13092 {
13093 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13094 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13095
13096 strncpy(spaceName, name + start, c - start);
13097 spaceName[c - start] = '\0';
13098 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13099 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13100 if(!newSpace)
13101 return (((void *)0));
13102 nameSpace = newSpace;
13103 if(name[c] == ':')
13104 c++;
13105 start = c + 1;
13106 }
13107 }
13108 if(c - start)
13109 {
13110 return ScanGlobalData(nameSpace, name + start);
13111 }
13112 return (((void *)0));
13113 }
13114
13115 static int definedExpStackPos;
13116
13117 static void * definedExpStack[512];
13118
13119 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13120 {
13121 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13122
13123 FreeExpContents(checkedExp);
13124 FreeType(checkedExp->expType);
13125 FreeType(checkedExp->destType);
13126 *checkedExp = *newExp;
13127 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13128 checkedExp->prev = prev;
13129 checkedExp->next = next;
13130 }
13131
13132 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13133
13134 extern int printf(char * , ...);
13135
13136 void __ecereMethod_Expression_Clear();
13137
13138 void ApplyAnyObjectLogic(struct Expression * e)
13139 {
13140 struct Type * destType = e->destType;
13141
13142 if(destType && (destType->classObjectType == 3))
13143 {
13144 if(e && e->expType)
13145 {
13146 struct Type * type = e->expType;
13147 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13148
13149 if(type->kind == 8 && type->_class && type->_class->registered)
13150 {
13151 _class = type->_class->registered;
13152 }
13153 else if(type->kind == 19)
13154 {
13155 _class = FindClass("ecere::com::Class")->registered;
13156 }
13157 else
13158 {
13159 char string[1024] = "";
13160 struct Symbol * classSym;
13161
13162 PrintTypeNoConst(type, string, 0x0, 0x1);
13163 classSym = FindClass(string);
13164 if(classSym)
13165 _class = classSym->registered;
13166 }
13167 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
13168 {
13169 if(!_class || strcmp(_class->fullName, "char *"))
13170 {
13171 struct Expression * checkedExp = e, * newExp;
13172
13173 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13174 {
13175 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13176 {
13177 if(checkedExp->type == 25)
13178 {
13179 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13180 }
13181 else
13182 checkedExp = (*checkedExp->list).last;
13183 }
13184 else if(checkedExp->type == 11)
13185 checkedExp = checkedExp->cast.exp;
13186 }
13187 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13188 {
13189 newExp = checkedExp->op.exp2;
13190 checkedExp->op.exp2 = (((void *)0));
13191 FreeExpContents(checkedExp);
13192 if(e->expType && e->expType->passAsTemplate)
13193 {
13194 char size[100];
13195
13196 ComputeTypeSize(e->expType);
13197 sprintf(size, "%d", e->expType->size);
13198 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))))));
13199 }
13200 ReplaceExpContents(checkedExp, newExp);
13201 e->byReference = 0x1;
13202 }
13203 else if(!e->byReference || (_class && _class->type == 5))
13204 {
13205 struct Expression * checkedExp, * newExp;
13206
13207 {
13208 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;
13209
13210 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13211 {
13212 struct Context * context = PushContext();
13213 struct Declarator * decl;
13214 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13215 char typeString[1024];
13216 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13217
13218 typeString[0] = '\0';
13219 *newExp = *e;
13220 newExp->prev = (((void *)0));
13221 newExp->next = (((void *)0));
13222 newExp->expType = (((void *)0));
13223 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13224 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13225 newExp->destType = ProcessType(specs, decl);
13226 curContext = context;
13227 if(curCompound)
13228 {
13229 char name[100];
13230 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13231
13232 e->type = 25;
13233 sprintf(name, "__internalValue%03X", internalValueCounter++);
13234 if(!curCompound->compound.declarations)
13235 curCompound->compound.declarations = MkList();
13236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13237 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13238 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13239 e->compound = MkCompoundStmt((((void *)0)), stmts);
13240 }
13241 else
13242 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13243 {
13244 struct Type * type = e->destType;
13245
13246 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13247 CopyTypeInto(e->destType, type);
13248 e->destType->refCount = 1;
13249 e->destType->classObjectType = 0;
13250 FreeType(type);
13251 }
13252 e->compound->compound.context = context;
13253 PopContext(context);
13254 curContext = context->parent;
13255 }
13256 }
13257 checkedExp = e;
13258 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13259 {
13260 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13261 {
13262 if(checkedExp->type == 25)
13263 {
13264 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13265 }
13266 else
13267 checkedExp = (*checkedExp->list).last;
13268 }
13269 else if(checkedExp->type == 11)
13270 checkedExp = checkedExp->cast.exp;
13271 }
13272 {
13273 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13274
13275 *operand = *checkedExp;
13276 checkedExp->destType = (((void *)0));
13277 checkedExp->expType = (((void *)0));
13278 __ecereMethod_Expression_Clear(checkedExp);
13279 checkedExp->type = 4;
13280 checkedExp->op.op = '&';
13281 checkedExp->op.exp1 = (((void *)0));
13282 checkedExp->op.exp2 = operand;
13283 }
13284 }
13285 }
13286 }
13287 }
13288 }
13289 {
13290 }
13291 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))))
13292 {
13293 if(e->expType->classObjectType && destType && destType->classObjectType)
13294 {
13295 return ;
13296 }
13297 else
13298 {
13299 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13300
13301 *thisExp = *e;
13302 thisExp->prev = (((void *)0));
13303 thisExp->next = (((void *)0));
13304 __ecereMethod_Expression_Clear(e);
13305 e->type = 5;
13306 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13307 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13308 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13309 {
13310 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13311 CopyTypeInto(e->expType, thisExp->expType);
13312 e->expType->byReference = 0x0;
13313 e->expType->refCount = 1;
13314 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))
13315 {
13316 e->expType->classObjectType = 0;
13317 }
13318 }
13319 }
13320 }
13321 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13322 {
13323 if(destType->kind == 14)
13324 {
13325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13326 }
13327 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13328 {
13329 unsigned int byReference = e->expType->byReference;
13330 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13331 struct Declarator * decl;
13332 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13333 char typeString[1024];
13334 struct Type * type;
13335 int backupClassObjectType;
13336 unsigned int backupByReference;
13337
13338 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13339 type = e->expType;
13340 else
13341 type = destType;
13342 backupClassObjectType = type->classObjectType;
13343 backupByReference = type->byReference;
13344 type->classObjectType = 0;
13345 type->byReference = 0x0;
13346 typeString[0] = '\0';
13347 PrintType(type, typeString, 0x0, 0x1);
13348 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13349 type->classObjectType = backupClassObjectType;
13350 type->byReference = backupByReference;
13351 *thisExp = *e;
13352 thisExp->prev = (((void *)0));
13353 thisExp->next = (((void *)0));
13354 __ecereMethod_Expression_Clear(e);
13355 if((type->kind == 8 && type->_class && type->_class->registered && (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 != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
13356 {
13357 e->type = 4;
13358 e->op.op = '*';
13359 e->op.exp1 = (((void *)0));
13360 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13361 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13362 CopyTypeInto(e->expType, type);
13363 e->expType->byReference = 0x0;
13364 e->expType->refCount = 1;
13365 }
13366 else
13367 {
13368 e->type = 11;
13369 e->cast.typeName = MkTypeName(specs, decl);
13370 e->cast.exp = thisExp;
13371 e->byReference = 0x1;
13372 e->expType = type;
13373 type->refCount++;
13374 }
13375 e->destType = destType;
13376 destType->refCount++;
13377 }
13378 }
13379 }
13380
13381 extern char *  strstr(const char * , const char * );
13382
13383 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13384
13385 struct __ecereNameSpace__ecere__com__DefinedExpression
13386 {
13387 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13388 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13389 char *  name;
13390 char *  value;
13391 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13392 } __attribute__ ((gcc_struct));
13393
13394 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13395
13396 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13397
13398 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13399
13400 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13401
13402 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13403
13404 extern struct Expression * CopyExpression(struct Expression * exp);
13405
13406 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13407
13408 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13409
13410 static void ProcessStatement(struct Statement * stmt);
13411
13412 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13413
13414 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13415
13416 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13417
13418 extern char *  sourceFile;
13419
13420 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13421
13422 void ProcessExpressionType(struct Expression * exp)
13423 {
13424 unsigned int unresolved = 0x0;
13425 struct Location oldyylloc = yylloc;
13426 unsigned int notByReference = 0x0;
13427
13428 if(!exp || exp->expType)
13429 return ;
13430 yylloc = exp->loc;
13431 switch(exp->type)
13432 {
13433 case 0:
13434 {
13435 struct Identifier * id = exp->identifier;
13436
13437 if(!id)
13438 return ;
13439 if(id->_class && id->_class->name)
13440 {
13441 id->classSym = id->_class->symbol;
13442 }
13443 if(strstr(id->string, "__ecereClass") == id->string)
13444 {
13445 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13446 break;
13447 }
13448 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13449 {
13450 ReplaceClassMembers(exp, thisClass);
13451 if(exp->type != 0)
13452 {
13453 ProcessExpressionType(exp);
13454 break;
13455 }
13456 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13457 break;
13458 }
13459 else
13460 {
13461 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13462
13463 if(!symbol)
13464 {
13465 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13466 break;
13467 else
13468 {
13469 if(thisClass)
13470 {
13471 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13472 if(exp->type != 0)
13473 {
13474 ProcessExpressionType(exp);
13475 break;
13476 }
13477 }
13478 else if(currentClass && !id->_class)
13479 {
13480 if(ResolveIdWithClass(exp, currentClass, 0x1))
13481 break;
13482 }
13483 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13484 }
13485 }
13486 if(symbol)
13487 {
13488 struct Type * type = symbol->type;
13489 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13490
13491 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13492 {
13493 struct Context * context = SetupTemplatesContext(_class);
13494
13495 type = ReplaceThisClassType(_class);
13496 FinishTemplatesContext(context);
13497 if(type)
13498 type->refCount = 0;
13499 }
13500 FreeSpecifier(id->_class);
13501 id->_class = (((void *)0));
13502 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13503 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13504 id->classSym = (((void *)0));
13505 exp->expType = type;
13506 if(type)
13507 type->refCount++;
13508 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13509 exp->isConstant = 0x1;
13510 if(symbol->isParam || !strcmp(id->string, "this"))
13511 {
13512 if(_class && _class->type == 1 && !type->declaredWithStruct)
13513 exp->byReference = 0x1;
13514 }
13515 if(symbol->isIterator)
13516 {
13517 if(symbol->isIterator == 3)
13518 {
13519 exp->type = 5;
13520 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13521 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13522 exp->expType = (((void *)0));
13523 ProcessExpressionType(exp);
13524 }
13525 else if(symbol->isIterator != 4)
13526 {
13527 exp->type = 8;
13528 exp->member.exp = MkExpIdentifier(exp->identifier);
13529 exp->member.exp->expType = exp->expType;
13530 exp->member.member = MkIdentifier("data");
13531 exp->expType = (((void *)0));
13532 ProcessExpressionType(exp);
13533 }
13534 }
13535 break;
13536 }
13537 else
13538 {
13539 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13540
13541 if(thisNameSpace && !(id->_class && !id->_class->name))
13542 {
13543 char name[1024];
13544
13545 strcpy(name, thisNameSpace);
13546 strcat(name, "::");
13547 strcat(name, id->string);
13548 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13549 }
13550 if(!definedExp)
13551 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13552 if(definedExp)
13553 {
13554 int c;
13555
13556 for(c = 0; c < definedExpStackPos; c++)
13557 if(definedExpStack[c] == definedExp)
13558 break;
13559 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13560 {
13561 struct Location backupYylloc = yylloc;
13562
13563 definedExpStack[definedExpStackPos++] = definedExp;
13564 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13565 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13566 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13567
13568 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13569 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13570 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13571 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13572
13573 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13574 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13575 echoOn = 0x0;
13576 parsedExpression = (((void *)0));
13577 resetScanner();
13578 expression_yyparse();
13579 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13580 yylloc = backupYylloc;
13581 if(parsedExpression)
13582 {
13583 FreeIdentifier(id);
13584 exp->type = 5;
13585 exp->list = MkListOne(parsedExpression);
13586 parsedExpression->loc = yylloc;
13587 ProcessExpressionType(exp);
13588 definedExpStackPos--;
13589 return ;
13590 }
13591 definedExpStackPos--;
13592 }
13593 else
13594 {
13595 if(inCompiler)
13596 {
13597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13598 }
13599 }
13600 }
13601 else
13602 {
13603 struct GlobalData * data = (((void *)0));
13604
13605 if(thisNameSpace && !(id->_class && !id->_class->name))
13606 {
13607 char name[1024];
13608
13609 strcpy(name, thisNameSpace);
13610 strcat(name, "::");
13611 strcat(name, id->string);
13612 data = FindGlobalData(name);
13613 }
13614 if(!data)
13615 data = FindGlobalData(id->string);
13616 if(data)
13617 {
13618 DeclareGlobalData(data);
13619 exp->expType = data->dataType;
13620 if(data->dataType)
13621 data->dataType->refCount++;
13622 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13623 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13624 FreeSpecifier(id->_class);
13625 id->_class = (((void *)0));
13626 break;
13627 }
13628 else
13629 {
13630 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13631
13632 if(thisNameSpace && !(id->_class && !id->_class->name))
13633 {
13634 char name[1024];
13635
13636 strcpy(name, thisNameSpace);
13637 strcat(name, "::");
13638 strcat(name, id->string);
13639 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13640 }
13641 if(!function)
13642 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13643 if(function)
13644 {
13645 char name[1024];
13646
13647 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13648 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13649 name[0] = (char)0;
13650 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13651 strcpy(name, "__ecereFunction_");
13652 FullClassNameCat(name, id->string, 0x0);
13653 if(DeclareFunction(function, name))
13654 {
13655 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13656 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13657 }
13658 exp->expType = function->dataType;
13659 if(function->dataType)
13660 function->dataType->refCount++;
13661 FreeSpecifier(id->_class);
13662 id->_class = (((void *)0));
13663 break;
13664 }
13665 }
13666 }
13667 }
13668 }
13669 unresolved = 0x1;
13670 break;
13671 }
13672 case 1:
13673 {
13674 struct __ecereNameSpace__ecere__com__Class * _class;
13675
13676 if(!exp->instance->_class)
13677 {
13678 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13679 {
13680 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13681 }
13682 }
13683 ProcessInstantiationType(exp->instance);
13684 exp->isConstant = exp->instance->isConstant;
13685 if(exp->instance->_class)
13686 {
13687 exp->expType = MkClassType(exp->instance->_class->name);
13688 }
13689 break;
13690 }
13691 case 2:
13692 {
13693 if(!exp->expType)
13694 {
13695 char * constant = exp->constant;
13696 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13697
13698 exp->expType = type;
13699 if(constant[0] == '\'')
13700 {
13701 if((int)((unsigned char *)constant)[1] > 127)
13702 {
13703 int nb;
13704 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13705
13706 if(nb < 2)
13707 ch = constant[1];
13708 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13709 exp->constant = PrintUInt(ch);
13710 type->kind = 8;
13711 type->_class = FindClass("unichar");
13712 type->isSigned = 0x0;
13713 }
13714 else
13715 {
13716 type->kind = 1;
13717 type->isSigned = 0x1;
13718 }
13719 }
13720 else
13721 {
13722 char * dot = strchr(constant, '.');
13723 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13724 char * exponent;
13725
13726 if(isHex)
13727 {
13728 exponent = strchr(constant, 'p');
13729 if(!exponent)
13730 exponent = strchr(constant, 'P');
13731 }
13732 else
13733 {
13734 exponent = strchr(constant, 'e');
13735 if(!exponent)
13736 exponent = strchr(constant, 'E');
13737 }
13738 if(dot || exponent)
13739 {
13740 if(strchr(constant, 'f') || strchr(constant, 'F'))
13741 type->kind = 6;
13742 else
13743 type->kind = 7;
13744 type->isSigned = 0x1;
13745 }
13746 else
13747 {
13748 unsigned int isSigned = constant[0] == '-';
13749 long long i64 = strtoll(constant, (((void *)0)), 0);
13750 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13751 unsigned int is64Bit = 0x0;
13752
13753 if(isSigned)
13754 {
13755 if(i64 < (((int)0x80000000)))
13756 is64Bit = 0x1;
13757 }
13758 else
13759 {
13760 if(ui64 > (((int)0x7fffffff)))
13761 {
13762 if(ui64 > (0xffffffff))
13763 {
13764 is64Bit = 0x1;
13765 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13766 isSigned = 0x1;
13767 }
13768 }
13769 else if(constant[0] != '0' || !constant[1])
13770 isSigned = 0x1;
13771 }
13772 type->kind = is64Bit ? 4 : 3;
13773 type->isSigned = isSigned;
13774 }
13775 }
13776 exp->isConstant = 0x1;
13777 if(exp->destType && exp->destType->kind == 7)
13778 type->kind = 7;
13779 else if(exp->destType && exp->destType->kind == 6)
13780 type->kind = 6;
13781 else if(exp->destType && exp->destType->kind == 4)
13782 type->kind = 4;
13783 }
13784 break;
13785 }
13786 case 3:
13787 {
13788 exp->isConstant = 0x1;
13789 exp->expType = __extension__ ({
13790 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13791
13792 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13793 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13794
13795 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13796 }), __ecereInstance2;
13797 });
13798 break;
13799 }
13800 case 13:
13801 case 28:
13802 ProcessExpressionType(exp->_new.size);
13803 exp->expType = __extension__ ({
13804 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13805
13806 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13807 });
13808 DeclareType(exp->expType->type, 0x0, 0x0);
13809 break;
13810 case 14:
13811 case 29:
13812 ProcessExpressionType(exp->_renew.size);
13813 ProcessExpressionType(exp->_renew.exp);
13814 exp->expType = __extension__ ({
13815 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13816
13817 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13818 });
13819 DeclareType(exp->expType->type, 0x0, 0x0);
13820 break;
13821 case 4:
13822 {
13823 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13824 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13825 unsigned int useDestType = 0x0, useSideType = 0x0;
13826 struct Location oldyylloc = yylloc;
13827 unsigned int useSideUnit = 0x0;
13828 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13829
13830 switch(exp->op.op)
13831 {
13832 case '=':
13833 case MUL_ASSIGN:
13834 case DIV_ASSIGN:
13835 case MOD_ASSIGN:
13836 case ADD_ASSIGN:
13837 case SUB_ASSIGN:
13838 case LEFT_ASSIGN:
13839 case RIGHT_ASSIGN:
13840 case AND_ASSIGN:
13841 case XOR_ASSIGN:
13842 case OR_ASSIGN:
13843 assign = 0x1;
13844 break;
13845 case '!':
13846 break;
13847 case AND_OP:
13848 case OR_OP:
13849 boolOps = 0x1;
13850 boolResult = 0x1;
13851 break;
13852 case EQ_OP:
13853 case '<':
13854 case '>':
13855 case LE_OP:
13856 case GE_OP:
13857 case NE_OP:
13858 boolResult = 0x1;
13859 useSideType = 0x1;
13860 break;
13861 case '+':
13862 case '-':
13863 useSideUnit = 0x1;
13864 case '|':
13865 case '&':
13866 case '^':
13867 case '/':
13868 case '%':
13869 case '*':
13870 if(exp->op.op != '*' || exp->op.exp1)
13871 {
13872 useSideType = 0x1;
13873 useDestType = 0x1;
13874 }
13875 break;
13876 }
13877 if(exp->op.op == '&')
13878 {
13879 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13880 {
13881 struct Identifier * id = exp->op.exp2->identifier;
13882 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13883
13884 if(symbol && symbol->isIterator == 2)
13885 {
13886 exp->type = 8;
13887 exp->member.exp = exp->op.exp2;
13888 exp->member.member = MkIdentifier("key");
13889 exp->expType = (((void *)0));
13890 exp->op.exp2->expType = symbol->type;
13891 symbol->type->refCount++;
13892 ProcessExpressionType(exp);
13893 FreeType(dummy);
13894 break;
13895 }
13896 }
13897 }
13898 if(exp->op.exp1)
13899 {
13900 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))
13901 {
13902 if(exp->op.exp1->destType)
13903 FreeType(exp->op.exp1->destType);
13904 exp->op.exp1->destType = exp->destType;
13905 if(exp->destType)
13906 exp->destType->refCount++;
13907 }
13908 else if(!assign)
13909 {
13910 if(exp->op.exp1->destType)
13911 FreeType(exp->op.exp1->destType);
13912 exp->op.exp1->destType = dummy;
13913 dummy->refCount++;
13914 }
13915 if(exp->op.exp1->destType && exp->op.op != '=')
13916 exp->op.exp1->destType->count++;
13917 ProcessExpressionType(exp->op.exp1);
13918 if(exp->op.exp1->destType && exp->op.op != '=')
13919 exp->op.exp1->destType->count--;
13920 if(exp->op.exp1->destType == dummy)
13921 {
13922 FreeType(dummy);
13923 exp->op.exp1->destType = (((void *)0));
13924 }
13925 type1 = exp->op.exp1->expType;
13926 }
13927 if(exp->op.exp2)
13928 {
13929 char expString[10240];
13930
13931 expString[0] = '\0';
13932 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13933 {
13934 if(exp->op.exp1)
13935 {
13936 exp->op.exp2->destType = exp->op.exp1->expType;
13937 if(exp->op.exp1->expType)
13938 exp->op.exp1->expType->refCount++;
13939 }
13940 else
13941 {
13942 exp->op.exp2->destType = exp->destType;
13943 if(exp->destType)
13944 exp->destType->refCount++;
13945 }
13946 if(type1)
13947 type1->refCount++;
13948 exp->expType = type1;
13949 }
13950 else if(assign)
13951 {
13952 if(inCompiler)
13953 PrintExpression(exp->op.exp2, expString);
13954 if(type1 && type1->kind == 13)
13955 {
13956 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)
13957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13958 else if(exp->op.op == '=')
13959 {
13960 if(exp->op.exp2->destType)
13961 FreeType(exp->op.exp2->destType);
13962 exp->op.exp2->destType = type1;
13963 if(type1)
13964 type1->refCount++;
13965 }
13966 }
13967 else
13968 {
13969 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)
13970 ;
13971 else
13972 {
13973 if(exp->op.exp2->destType)
13974 FreeType(exp->op.exp2->destType);
13975 exp->op.exp2->destType = type1;
13976 if(type1)
13977 type1->refCount++;
13978 }
13979 }
13980 if(type1)
13981 type1->refCount++;
13982 exp->expType = type1;
13983 }
13984 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)))
13985 {
13986 if(exp->op.exp2->destType)
13987 FreeType(exp->op.exp2->destType);
13988 exp->op.exp2->destType = exp->destType;
13989 if(exp->destType)
13990 exp->destType->refCount++;
13991 }
13992 else
13993 {
13994 if(exp->op.exp2->destType)
13995 FreeType(exp->op.exp2->destType);
13996 exp->op.exp2->destType = dummy;
13997 dummy->refCount++;
13998 }
13999 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14000 {
14001 FreeType(exp->op.exp2->destType);
14002 exp->op.exp2->destType = type1;
14003 type1->refCount++;
14004 }
14005 if(exp->op.exp2->destType && exp->op.op != '=')
14006 exp->op.exp2->destType->count++;
14007 ProcessExpressionType(exp->op.exp2);
14008 if(exp->op.exp2->destType && exp->op.op != '=')
14009 exp->op.exp2->destType->count--;
14010 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14011 {
14012 if(exp->op.exp2->expType->kind == 23 || 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)
14013 {
14014 if(exp->op.op != '=' && type1->type->kind == 0)
14015 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14016 }
14017 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)))
14018 {
14019 if(exp->op.op == ADD_ASSIGN)
14020 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14021 }
14022 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))
14023 {
14024 if(exp->op.op == ADD_ASSIGN)
14025 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14026 }
14027 else if(inCompiler)
14028 {
14029 char type1String[1024];
14030 char type2String[1024];
14031
14032 type1String[0] = '\0';
14033 type2String[0] = '\0';
14034 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14035 PrintType(type1, type2String, 0x0, 0x1);
14036 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14037 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14038 }
14039 }
14040 if(exp->op.exp2->destType == dummy)
14041 {
14042 FreeType(dummy);
14043 exp->op.exp2->destType = (((void *)0));
14044 }
14045 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14046 {
14047 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14048 type2->refCount = 1;
14049 CopyTypeInto(type2, exp->op.exp2->expType);
14050 type2->isSigned = 0x1;
14051 }
14052 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14053 {
14054 type2 = __extension__ ({
14055 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14056
14057 __ecereInstance1->kind = 3, __ecereInstance1;
14058 });
14059 type2->refCount = 1;
14060 type2->isSigned = 0x1;
14061 }
14062 else
14063 type2 = exp->op.exp2->expType;
14064 }
14065 dummy->kind = 0;
14066 if(exp->op.op == SIZEOF)
14067 {
14068 exp->expType = __extension__ ({
14069 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14070
14071 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14072 });
14073 exp->isConstant = 0x1;
14074 }
14075 else if(exp->op.op == '*' && !exp->op.exp1)
14076 {
14077 exp->expType = Dereference(type2);
14078 if(type2 && type2->kind == 8)
14079 notByReference = 0x1;
14080 }
14081 else if(exp->op.op == '&' && !exp->op.exp1)
14082 exp->expType = Reference(type2);
14083 else if(!assign)
14084 {
14085 if(boolOps)
14086 {
14087 if(exp->op.exp1)
14088 {
14089 if(exp->op.exp1->destType)
14090 FreeType(exp->op.exp1->destType);
14091 exp->op.exp1->destType = MkClassType("bool");
14092 exp->op.exp1->destType->truth = 0x1;
14093 if(!exp->op.exp1->expType)
14094 ProcessExpressionType(exp->op.exp1);
14095 else
14096 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14097 FreeType(exp->op.exp1->expType);
14098 exp->op.exp1->expType = MkClassType("bool");
14099 exp->op.exp1->expType->truth = 0x1;
14100 }
14101 if(exp->op.exp2)
14102 {
14103 if(exp->op.exp2->destType)
14104 FreeType(exp->op.exp2->destType);
14105 exp->op.exp2->destType = MkClassType("bool");
14106 exp->op.exp2->destType->truth = 0x1;
14107 if(!exp->op.exp2->expType)
14108 ProcessExpressionType(exp->op.exp2);
14109 else
14110 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14111 FreeType(exp->op.exp2->expType);
14112 exp->op.exp2->expType = MkClassType("bool");
14113 exp->op.exp2->expType->truth = 0x1;
14114 }
14115 }
14116 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")))))
14117 {
14118 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14119 {
14120 if(exp->op.exp2->destType)
14121 FreeType(exp->op.exp2->destType);
14122 exp->op.exp2->destType = type1;
14123 type1->refCount++;
14124 if(exp->op.exp1->destType)
14125 FreeType(exp->op.exp1->destType);
14126 exp->op.exp1->destType = type2;
14127 type2->refCount++;
14128 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)
14129 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14130 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14131 {
14132 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14133
14134 if(argExp)
14135 {
14136 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14137
14138 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14139 ProcessExpressionType(exp->op.exp1);
14140 if(type2->kind != 13)
14141 {
14142 ProcessExpressionType(classExp);
14143 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"))))))));
14144 if(!exp->op.exp2->expType)
14145 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14146 ProcessExpressionType(exp->op.exp2);
14147 }
14148 }
14149 }
14150 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
14151 {
14152 if(type1->kind != 8 && type1->type->kind == 0)
14153 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14154 exp->expType = type1;
14155 if(type1)
14156 type1->refCount++;
14157 }
14158 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
14159 {
14160 if(type2->kind != 8 && type2->type->kind == 0)
14161 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14162 exp->expType = type2;
14163 if(type2)
14164 type2->refCount++;
14165 }
14166 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))
14167 {
14168 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14169 }
14170 else
14171 {
14172 unsigned int success = 0x0;
14173
14174 if(type1->kind == 13 && type2->kind == 13)
14175 {
14176 if(exp->op.op == '+')
14177 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14178 else if(exp->op.op == '-')
14179 {
14180 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14181 {
14182 exp->expType = __extension__ ({
14183 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14184
14185 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14186 });
14187 success = 0x1;
14188 if(type1->type->kind == 20)
14189 {
14190 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14191
14192 if(argExp)
14193 {
14194 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14195
14196 ProcessExpressionType(classExp);
14197 exp->type = 5;
14198 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")))))));
14199 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14200 FreeType(dummy);
14201 return ;
14202 }
14203 }
14204 }
14205 }
14206 }
14207 if(!success && exp->op.exp1->type == 2)
14208 {
14209 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14210 {
14211 if(exp->expType)
14212 FreeType(exp->expType);
14213 exp->expType = exp->op.exp1->destType;
14214 if(exp->op.exp1->destType)
14215 exp->op.exp1->destType->refCount++;
14216 success = 0x1;
14217 }
14218 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14219 {
14220 if(exp->expType)
14221 FreeType(exp->expType);
14222 exp->expType = exp->op.exp2->destType;
14223 if(exp->op.exp2->destType)
14224 exp->op.exp2->destType->refCount++;
14225 success = 0x1;
14226 }
14227 }
14228 else if(!success)
14229 {
14230 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14231 {
14232 if(exp->expType)
14233 FreeType(exp->expType);
14234 exp->expType = exp->op.exp2->destType;
14235 if(exp->op.exp2->destType)
14236 exp->op.exp2->destType->refCount++;
14237 success = 0x1;
14238 }
14239 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14240 {
14241 if(exp->expType)
14242 FreeType(exp->expType);
14243 exp->expType = exp->op.exp1->destType;
14244 if(exp->op.exp1->destType)
14245 exp->op.exp1->destType->refCount++;
14246 success = 0x1;
14247 }
14248 }
14249 if(!success)
14250 {
14251 char expString1[10240];
14252 char expString2[10240];
14253 char type1[1024];
14254 char type2[1024];
14255
14256 expString1[0] = '\0';
14257 expString2[0] = '\0';
14258 type1[0] = '\0';
14259 type2[0] = '\0';
14260 if(inCompiler)
14261 {
14262 PrintExpression(exp->op.exp1, expString1);
14263 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14264 PrintExpression(exp->op.exp2, expString2);
14265 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14266 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14267 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14268 }
14269 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14270 }
14271 }
14272 }
14273 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14274 {
14275 if(exp->op.exp1->destType)
14276 FreeType(exp->op.exp1->destType);
14277 exp->op.exp1->destType = type2->_class->registered->dataType;
14278 if(type2->_class->registered->dataType)
14279 type2->_class->registered->dataType->refCount++;
14280 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14281 exp->expType = type2;
14282 if(type2)
14283 type2->refCount++;
14284 }
14285 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14286 {
14287 if(exp->op.exp2->destType)
14288 FreeType(exp->op.exp2->destType);
14289 exp->op.exp2->destType = type1->_class->registered->dataType;
14290 if(type1->_class->registered->dataType)
14291 type1->_class->registered->dataType->refCount++;
14292 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14293 exp->expType = type1;
14294 if(type1)
14295 type1->refCount++;
14296 }
14297 else if(type1)
14298 {
14299 unsigned int valid = 0x0;
14300
14301 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14302 {
14303 if(exp->op.exp2->destType)
14304 FreeType(exp->op.exp2->destType);
14305 if(!type1->_class->registered->dataType)
14306 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14307 exp->op.exp2->destType = type1->_class->registered->dataType;
14308 exp->op.exp2->destType->refCount++;
14309 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14310 type2 = exp->op.exp2->destType;
14311 exp->expType = type2;
14312 type2->refCount++;
14313 }
14314 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14315 {
14316 if(exp->op.exp1->destType)
14317 FreeType(exp->op.exp1->destType);
14318 if(!type2->_class->registered->dataType)
14319 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14320 exp->op.exp1->destType = type2->_class->registered->dataType;
14321 exp->op.exp1->destType->refCount++;
14322 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14323 type1 = exp->op.exp1->destType;
14324 exp->expType = type1;
14325 type1->refCount++;
14326 }
14327 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14328 {
14329 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14330 {
14331 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14332 {
14333 if(exp->expType)
14334 FreeType(exp->expType);
14335 exp->expType = exp->op.exp1->expType;
14336 if(exp->op.exp2->expType)
14337 exp->op.exp1->expType->refCount++;
14338 valid = 0x1;
14339 }
14340 }
14341 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14342 {
14343 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14344 {
14345 if(exp->expType)
14346 FreeType(exp->expType);
14347 exp->expType = exp->op.exp2->expType;
14348 if(exp->op.exp2->expType)
14349 exp->op.exp2->expType->refCount++;
14350 valid = 0x1;
14351 }
14352 }
14353 }
14354 if(!valid)
14355 {
14356 if(exp->op.exp2->destType)
14357 FreeType(exp->op.exp2->destType);
14358 exp->op.exp2->destType = type1;
14359 type1->refCount++;
14360 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14361 {
14362 if(exp->expType)
14363 FreeType(exp->expType);
14364 exp->expType = exp->op.exp2->destType;
14365 if(exp->op.exp2->destType)
14366 exp->op.exp2->destType->refCount++;
14367 }
14368 else if(type1 && type2)
14369 {
14370 char expString1[10240];
14371 char expString2[10240];
14372 char type1String[1024];
14373 char type2String[1024];
14374
14375 expString1[0] = '\0';
14376 expString2[0] = '\0';
14377 type1String[0] = '\0';
14378 type2String[0] = '\0';
14379 if(inCompiler)
14380 {
14381 PrintExpression(exp->op.exp1, expString1);
14382 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14383 PrintExpression(exp->op.exp2, expString2);
14384 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14385 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14386 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14387 }
14388 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14389 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14390 {
14391 exp->expType = exp->op.exp1->expType;
14392 if(exp->op.exp1->expType)
14393 exp->op.exp1->expType->refCount++;
14394 }
14395 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14396 {
14397 exp->expType = exp->op.exp2->expType;
14398 if(exp->op.exp2->expType)
14399 exp->op.exp2->expType->refCount++;
14400 }
14401 }
14402 }
14403 }
14404 else if(type2)
14405 {
14406 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14407 {
14408 struct Type * oldType = exp->op.exp1->expType;
14409
14410 exp->op.exp1->expType = (((void *)0));
14411 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14412 FreeType(oldType);
14413 else
14414 exp->op.exp1->expType = oldType;
14415 }
14416 if(exp->op.exp1->destType)
14417 FreeType(exp->op.exp1->destType);
14418 exp->op.exp1->destType = type2;
14419 type2->refCount++;
14420 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14421 {
14422 if(exp->expType)
14423 FreeType(exp->expType);
14424 exp->expType = exp->op.exp1->destType;
14425 if(exp->op.exp1->destType)
14426 exp->op.exp1->destType->refCount++;
14427 }
14428 }
14429 }
14430 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14431 {
14432 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14433 {
14434 if(exp->op.exp1->destType)
14435 FreeType(exp->op.exp1->destType);
14436 exp->op.exp1->destType = type2->_class->registered->dataType;
14437 if(type2->_class->registered->dataType)
14438 type2->_class->registered->dataType->refCount++;
14439 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14440 }
14441 if(exp->op.op == '!')
14442 {
14443 exp->expType = MkClassType("bool");
14444 exp->expType->truth = 0x1;
14445 }
14446 else
14447 {
14448 exp->expType = type2;
14449 if(type2)
14450 type2->refCount++;
14451 }
14452 }
14453 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14454 {
14455 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14456 {
14457 if(exp->op.exp2->destType)
14458 FreeType(exp->op.exp2->destType);
14459 exp->op.exp2->destType = type1->_class->registered->dataType;
14460 if(type1->_class->registered->dataType)
14461 type1->_class->registered->dataType->refCount++;
14462 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14463 }
14464 exp->expType = type1;
14465 if(type1)
14466 type1->refCount++;
14467 }
14468 }
14469 yylloc = exp->loc;
14470 if(exp->op.exp1 && !exp->op.exp1->expType)
14471 {
14472 char expString[10000];
14473
14474 expString[0] = '\0';
14475 if(inCompiler)
14476 {
14477 PrintExpression(exp->op.exp1, expString);
14478 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14479 }
14480 if(expString[0])
14481 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14482 }
14483 if(exp->op.exp2 && !exp->op.exp2->expType)
14484 {
14485 char expString[10240];
14486
14487 expString[0] = '\0';
14488 if(inCompiler)
14489 {
14490 PrintExpression(exp->op.exp2, expString);
14491 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14492 }
14493 if(expString[0])
14494 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14495 }
14496 if(boolResult)
14497 {
14498 FreeType(exp->expType);
14499 exp->expType = MkClassType("bool");
14500 exp->expType->truth = 0x1;
14501 }
14502 if(exp->op.op != SIZEOF)
14503 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14504 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14505 {
14506 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14507 }
14508 yylloc = oldyylloc;
14509 FreeType(dummy);
14510 break;
14511 }
14512 case 5:
14513 case 34:
14514 {
14515 struct Expression * e;
14516
14517 exp->isConstant = 0x1;
14518 for(e = (*exp->list).first; e; e = e->next)
14519 {
14520 unsigned int inced = 0x0;
14521
14522 if(!e->next)
14523 {
14524 FreeType(e->destType);
14525 e->destType = exp->destType;
14526 if(e->destType)
14527 {
14528 exp->destType->refCount++;
14529 e->destType->count++;
14530 inced = 0x1;
14531 }
14532 }
14533 ProcessExpressionType(e);
14534 if(inced)
14535 exp->destType->count--;
14536 if(!exp->expType && !e->next)
14537 {
14538 exp->expType = e->expType;
14539 if(e->expType)
14540 e->expType->refCount++;
14541 }
14542 if(!e->isConstant)
14543 exp->isConstant = 0x0;
14544 }
14545 e = (*exp->list).first;
14546 if(!e->next && e->type == 8)
14547 {
14548 struct Expression * next = exp->next, * prev = exp->prev;
14549
14550 FreeType(exp->expType);
14551 FreeType(exp->destType);
14552 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14553 *exp = *e;
14554 exp->prev = prev;
14555 exp->next = next;
14556 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14557 ProcessExpressionType(exp);
14558 }
14559 break;
14560 }
14561 case 6:
14562 {
14563 struct Expression * e;
14564
14565 exp->isConstant = 0x1;
14566 ProcessExpressionType(exp->index.exp);
14567 if(!exp->index.exp->isConstant)
14568 exp->isConstant = 0x0;
14569 if(exp->index.exp->expType)
14570 {
14571 struct Type * source = exp->index.exp->expType;
14572
14573 if(source->kind == 8 && source->_class && source->_class->registered)
14574 {
14575 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14576 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14577
14578 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14579 {
14580 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14581 if(exp->index.index && (*exp->index.index).last)
14582 {
14583 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14584 }
14585 }
14586 }
14587 }
14588 for(e = (*exp->index.index).first; e; e = e->next)
14589 {
14590 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14591 {
14592 if(e->destType)
14593 FreeType(e->destType);
14594 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14595 }
14596 ProcessExpressionType(e);
14597 if(!e->next)
14598 {
14599 }
14600 if(!e->isConstant)
14601 exp->isConstant = 0x0;
14602 }
14603 if(!exp->expType)
14604 exp->expType = Dereference(exp->index.exp->expType);
14605 if(exp->expType)
14606 DeclareType(exp->expType, 0x0, 0x0);
14607 break;
14608 }
14609 case 7:
14610 {
14611 struct Expression * e;
14612 struct Type * functionType;
14613 struct Type * methodType = (((void *)0));
14614 char name[1024];
14615
14616 name[0] = '\0';
14617 if(inCompiler)
14618 {
14619 PrintExpression(exp->call.exp, name);
14620 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14621 {
14622 PrintExpression(exp->call.exp, name);
14623 }
14624 }
14625 if(exp->call.exp->type == 0)
14626 {
14627 struct Expression * idExp = exp->call.exp;
14628 struct Identifier * id = idExp->identifier;
14629
14630 if(!strcmp(id->string, "__builtin_frame_address"))
14631 {
14632 exp->expType = ProcessTypeString("void *", 0x1);
14633 if(exp->call.arguments && (*exp->call.arguments).first)
14634 ProcessExpressionType((*exp->call.arguments).first);
14635 break;
14636 }
14637 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14638 {
14639 exp->expType = ProcessTypeString("int", 0x1);
14640 if(exp->call.arguments && (*exp->call.arguments).first)
14641 ProcessExpressionType((*exp->call.arguments).first);
14642 break;
14643 }
14644 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14645 {
14646 struct Expression * a = (((void *)0));
14647 struct Expression * b = (((void *)0));
14648 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14649
14650 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14651 {
14652 a = (*exp->call.arguments).first;
14653 b = (*exp->call.arguments).last;
14654 tempExp1 = a;
14655 tempExp2 = b;
14656 }
14657 else if((*exp->call.arguments).count == 1)
14658 {
14659 a = (*exp->call.arguments).first;
14660 tempExp1 = a;
14661 }
14662 if(a)
14663 {
14664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14665 idExp->identifier = (((void *)0));
14666 FreeExpContents(exp);
14667 ProcessExpressionType(a);
14668 if(b)
14669 ProcessExpressionType(b);
14670 exp->type = 5;
14671 exp->list = MkList();
14672 if(a->expType && (!b || b->expType))
14673 {
14674 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14675 {
14676 if(inCompiler)
14677 {
14678 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14679 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14680 struct Declaration * decl;
14681 char temp1[1024], temp2[1024];
14682
14683 GetTypeSpecs(a->expType, specs);
14684 if(a && !a->isConstant && a->type != 0)
14685 {
14686 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14687 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14688 tempExp1 = QMkExpId(temp1);
14689 tempExp1->expType = a->expType;
14690 if(a->expType)
14691 a->expType->refCount++;
14692 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14693 }
14694 if(b && !b->isConstant && b->type != 0)
14695 {
14696 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14697 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14698 tempExp2 = QMkExpId(temp2);
14699 tempExp2->expType = b->expType;
14700 if(b->expType)
14701 b->expType->refCount++;
14702 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14703 }
14704 decl = MkDeclaration(specs, decls);
14705 if(!curCompound->compound.declarations)
14706 curCompound->compound.declarations = MkList();
14707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14708 }
14709 }
14710 }
14711 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14712 {
14713 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14714
14715 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14716 exp->expType = a->expType;
14717 if(a->expType)
14718 a->expType->refCount++;
14719 }
14720 else if(!strcmp(id->string, "Abs"))
14721 {
14722 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14723 exp->expType = a->expType;
14724 if(a->expType)
14725 a->expType->refCount++;
14726 }
14727 else if(!strcmp(id->string, "Sgn"))
14728 {
14729 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"))))));
14730 exp->expType = ProcessTypeString("int", 0x0);
14731 }
14732 FreeExpression(tempExp1);
14733 if(tempExp2)
14734 FreeExpression(tempExp2);
14735 FreeIdentifier(id);
14736 break;
14737 }
14738 }
14739 }
14740 {
14741 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14742
14743 if(!exp->call.exp->destType)
14744 {
14745 exp->call.exp->destType = dummy;
14746 dummy->refCount++;
14747 }
14748 ProcessExpressionType(exp->call.exp);
14749 if(exp->call.exp->destType == dummy)
14750 {
14751 FreeType(dummy);
14752 exp->call.exp->destType = (((void *)0));
14753 }
14754 FreeType(dummy);
14755 }
14756 functionType = exp->call.exp->expType;
14757 if(functionType && functionType->kind == 16)
14758 {
14759 methodType = functionType;
14760 functionType = methodType->method->dataType;
14761 if(exp->call.exp->expType->usedClass)
14762 {
14763 char typeString[1024];
14764
14765 typeString[0] = '\0';
14766 {
14767 struct Symbol * back = functionType->thisClass;
14768
14769 functionType->thisClass = (((void *)0));
14770 PrintType(functionType, typeString, 0x1, 0x1);
14771 functionType->thisClass = back;
14772 }
14773 if(strstr(typeString, "thisclass"))
14774 {
14775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14776 struct Declarator * decl;
14777
14778 {
14779 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14780
14781 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14782 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14783 thisClassParams = 0x0;
14784 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14785 {
14786 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14787
14788 thisClass = exp->call.exp->expType->usedClass;
14789 ProcessDeclarator(decl);
14790 thisClass = backupThisClass;
14791 }
14792 thisClassParams = 0x1;
14793 functionType = ProcessType(specs, decl);
14794 functionType->refCount = 0;
14795 FinishTemplatesContext(context);
14796 }
14797 FreeList(specs, FreeSpecifier);
14798 FreeDeclarator(decl);
14799 }
14800 }
14801 }
14802 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14803 {
14804 struct Type * type = functionType->type;
14805
14806 if(!functionType->refCount)
14807 {
14808 functionType->type = (((void *)0));
14809 FreeType(functionType);
14810 }
14811 functionType = type;
14812 }
14813 if(functionType && functionType->kind != 11)
14814 {
14815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
14816 }
14817 else if(functionType)
14818 {
14819 unsigned int emptyParams = 0x0, noParams = 0x0;
14820 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14821 struct Type * type = functionType->params.first;
14822 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14823 int extra = 0;
14824 struct Location oldyylloc = yylloc;
14825
14826 if(!type)
14827 emptyParams = 0x1;
14828 if(functionType->extraParam && e && functionType->thisClass)
14829 {
14830 e->destType = MkClassType(functionType->thisClass->string);
14831 e = e->next;
14832 }
14833 if(!functionType->staticMethod && !functionType->extraParam)
14834 {
14835 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14836 {
14837 type = MkClassType(memberExp->member.exp->expType->_class->string);
14838 if(e)
14839 {
14840 e->destType = type;
14841 e = e->next;
14842 type = functionType->params.first;
14843 }
14844 else
14845 type->refCount = 0;
14846 }
14847 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14848 {
14849 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14850 type->byReference = functionType->byReference;
14851 type->typedByReference = functionType->typedByReference;
14852 if(e)
14853 {
14854 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14855 e = e->next;
14856 e->destType = type;
14857 e = e->next;
14858 type = functionType->params.first;
14859 }
14860 else
14861 type->refCount = 0;
14862 }
14863 }
14864 if(type && type->kind == 0)
14865 {
14866 noParams = 0x1;
14867 if(!type->refCount)
14868 FreeType(type);
14869 type = (((void *)0));
14870 }
14871 for(; e; e = e->next)
14872 {
14873 if(!type && !emptyParams)
14874 {
14875 yylloc = e->loc;
14876 if(methodType && methodType->methodClass)
14877 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14878 else
14879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14880 break;
14881 }
14882 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14883 {
14884 struct Type * templatedType = (((void *)0));
14885 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14886 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14887 int id = 0;
14888
14889 if(_class && _class->templateArgs)
14890 {
14891 struct __ecereNameSpace__ecere__com__Class * sClass;
14892
14893 for(sClass = _class; sClass; sClass = sClass->base)
14894 {
14895 if(sClass->templateClass)
14896 sClass = sClass->templateClass;
14897 id = 0;
14898 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14899 {
14900 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14901 {
14902 struct __ecereNameSpace__ecere__com__Class * nextClass;
14903
14904 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14905 {
14906 if(nextClass->templateClass)
14907 nextClass = nextClass->templateClass;
14908 id += nextClass->templateParams.count;
14909 }
14910 break;
14911 }
14912 id++;
14913 }
14914 if(curParam)
14915 break;
14916 }
14917 }
14918 if(curParam && _class->templateArgs[id].dataTypeString)
14919 {
14920 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14921
14922 {
14923 struct Context * context = SetupTemplatesContext(_class);
14924
14925 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14926 FinishTemplatesContext(context);
14927 }
14928 e->destType = templatedType;
14929 if(templatedType)
14930 {
14931 templatedType->passAsTemplate = 0x1;
14932 }
14933 }
14934 else
14935 {
14936 e->destType = type;
14937 if(type)
14938 type->refCount++;
14939 }
14940 }
14941 else
14942 {
14943 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14944 {
14945 e->destType = type->prev;
14946 e->destType->refCount++;
14947 }
14948 else
14949 {
14950 e->destType = type;
14951 if(type)
14952 type->refCount++;
14953 }
14954 }
14955 if(type && type->kind != 14)
14956 {
14957 struct Type * next = type->next;
14958
14959 if(!type->refCount)
14960 FreeType(type);
14961 type = next;
14962 }
14963 }
14964 if(type && type->kind != 14)
14965 {
14966 if(methodType && methodType->methodClass)
14967 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14968 else
14969 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14970 }
14971 yylloc = oldyylloc;
14972 if(type && !type->refCount)
14973 FreeType(type);
14974 }
14975 else
14976 {
14977 functionType = __extension__ ({
14978 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14979
14980 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14981 });
14982 if(exp->call.exp->type == 0)
14983 {
14984 char * string = exp->call.exp->identifier->string;
14985
14986 if(inCompiler)
14987 {
14988 struct Symbol * symbol;
14989 struct Location oldyylloc = yylloc;
14990
14991 yylloc = exp->call.exp->identifier->loc;
14992 if(strstr(string, "__builtin_") == string)
14993 {
14994 if(exp->destType)
14995 {
14996 functionType->returnType = exp->destType;
14997 exp->destType->refCount++;
14998 }
14999 }
15000 else
15001 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15002 symbol = __extension__ ({
15003 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15004
15005 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15006 });
15007 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15008 if(strstr(symbol->string, "::"))
15009 globalContext->hasNameSpace = 0x1;
15010 yylloc = oldyylloc;
15011 }
15012 }
15013 else if(exp->call.exp->type == 8)
15014 {
15015 }
15016 else
15017 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15018 if(!functionType->returnType)
15019 {
15020 functionType->returnType = __extension__ ({
15021 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15022
15023 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15024 });
15025 }
15026 }
15027 if(functionType && functionType->kind == 11)
15028 {
15029 exp->expType = functionType->returnType;
15030 if(functionType->returnType)
15031 functionType->returnType->refCount++;
15032 if(!functionType->refCount)
15033 FreeType(functionType);
15034 }
15035 if(exp->call.arguments)
15036 {
15037 for(e = (*exp->call.arguments).first; e; e = e->next)
15038 {
15039 struct Type * destType = e->destType;
15040
15041 ProcessExpressionType(e);
15042 }
15043 }
15044 break;
15045 }
15046 case 8:
15047 {
15048 struct Type * type;
15049 struct Location oldyylloc = yylloc;
15050 unsigned int thisPtr;
15051 struct Expression * checkExp = exp->member.exp;
15052
15053 while(checkExp)
15054 {
15055 if(checkExp->type == 11)
15056 checkExp = checkExp->cast.exp;
15057 else if(checkExp->type == 5)
15058 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15059 else
15060 break;
15061 }
15062 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15063 exp->thisPtr = thisPtr;
15064 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15065 {
15066 exp->member.member->classSym = exp->member.member->_class->symbol;
15067 }
15068 ProcessExpressionType(exp->member.exp);
15069 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)
15070 {
15071 exp->isConstant = 0x0;
15072 }
15073 else
15074 exp->isConstant = exp->member.exp->isConstant;
15075 type = exp->member.exp->expType;
15076 yylloc = exp->loc;
15077 if(type && (type->kind == 20))
15078 {
15079 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15080 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15081
15082 if(_class)
15083 {
15084 for(param = _class->templateParams.first; param; param = param->next)
15085 {
15086 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15087 break;
15088 }
15089 }
15090 if(param && param->defaultArg.member)
15091 {
15092 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15093
15094 if(argExp)
15095 {
15096 struct Expression * expMember = exp->member.exp;
15097 struct Declarator * decl;
15098 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15099 char thisClassTypeString[1024];
15100
15101 FreeIdentifier(exp->member.member);
15102 ProcessExpressionType(argExp);
15103 {
15104 char * colon = strstr(param->defaultArg.memberString, "::");
15105
15106 if(colon)
15107 {
15108 char className[1024];
15109 struct __ecereNameSpace__ecere__com__Class * sClass;
15110
15111 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15112 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15113 }
15114 else
15115 strcpy(thisClassTypeString, _class->fullName);
15116 }
15117 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15118 exp->expType = ProcessType(specs, decl);
15119 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15120 {
15121 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15122 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15123 int c;
15124 int paramCount = 0;
15125 int lastParam = -1;
15126 char templateString[1024];
15127 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15128
15129 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15130 for(cClass = expClass; cClass; cClass = cClass->base)
15131 {
15132 int p = 0;
15133
15134 for(param = cClass->templateParams.first; param; param = param->next)
15135 {
15136 int id = p;
15137 struct __ecereNameSpace__ecere__com__Class * sClass;
15138 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15139
15140 for(sClass = cClass->base; sClass; sClass = sClass->base)
15141 id += sClass->templateParams.count;
15142 arg = expClass->templateArgs[id];
15143 for(sClass = _class; sClass; sClass = sClass->base)
15144 {
15145 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15146 int p = 0;
15147 struct __ecereNameSpace__ecere__com__Class * nextClass;
15148
15149 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15150 p += nextClass->templateParams.count;
15151 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15152 {
15153 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15154 {
15155 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15156 {
15157 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15158 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15159 break;
15160 }
15161 }
15162 }
15163 }
15164 {
15165 char argument[256];
15166
15167 argument[0] = '\0';
15168 switch(param->type)
15169 {
15170 case 2:
15171 {
15172 char expString[1024];
15173 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15174 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15175 struct Expression * exp;
15176 char * string = PrintHexUInt64(arg.expression.ui64);
15177
15178 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15179 ProcessExpressionType(exp);
15180 ComputeExpression(exp);
15181 expString[0] = '\0';
15182 PrintExpression(exp, expString);
15183 strcat(argument, expString);
15184 FreeExpression(exp);
15185 break;
15186 }
15187 case 1:
15188 {
15189 strcat(argument, arg.member->name);
15190 break;
15191 }
15192 case 0:
15193 {
15194 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15195 {
15196 if(!strcmp(arg.dataTypeString, "thisclass"))
15197 strcat(argument, thisClassTypeString);
15198 else
15199 strcat(argument, arg.dataTypeString);
15200 }
15201 break;
15202 }
15203 }
15204 if(argument[0])
15205 {
15206 if(paramCount)
15207 strcat(templateString, ", ");
15208 if(lastParam != p - 1)
15209 {
15210 strcat(templateString, param->name);
15211 strcat(templateString, " = ");
15212 }
15213 strcat(templateString, argument);
15214 paramCount++;
15215 lastParam = p;
15216 }
15217 p++;
15218 }
15219 }
15220 }
15221 {
15222 int len = strlen(templateString);
15223
15224 if(templateString[len - 1] == '>')
15225 templateString[len++] = ' ';
15226 templateString[len++] = '>';
15227 templateString[len++] = '\0';
15228 }
15229 {
15230 struct Context * context = SetupTemplatesContext(_class);
15231
15232 FreeType(exp->expType);
15233 exp->expType = ProcessTypeString(templateString, 0x0);
15234 FinishTemplatesContext(context);
15235 }
15236 }
15237 exp->type = 5;
15238 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")))))))));
15239 }
15240 }
15241 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15242 {
15243 type = ProcessTemplateParameterType(type->templateParameter);
15244 }
15245 }
15246 if(type && (type->kind == 20))
15247 ;
15248 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 24 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
15249 {
15250 struct Identifier * id = exp->member.member;
15251 int typeKind = type->kind;
15252 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));
15253
15254 if(typeKind == 19 && exp->member.exp->type == 26)
15255 {
15256 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15257 typeKind = 8;
15258 }
15259 if(id)
15260 {
15261 if(typeKind == 3 || typeKind == 15)
15262 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15263 else if(!_class)
15264 {
15265 if(type->kind == 8 && type->_class && type->_class->registered)
15266 {
15267 _class = type->_class->registered;
15268 }
15269 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15270 {
15271 _class = FindClass("char *")->registered;
15272 }
15273 else if(type->kind == 13)
15274 {
15275 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15276 FreeType(exp->expType);
15277 exp->expType = ProcessTypeString("uintptr", 0x0);
15278 exp->byReference = 0x1;
15279 }
15280 else
15281 {
15282 char string[1024] = "";
15283 struct Symbol * classSym;
15284
15285 PrintTypeNoConst(type, string, 0x0, 0x1);
15286 classSym = FindClass(string);
15287 if(classSym)
15288 _class = classSym->registered;
15289 }
15290 }
15291 }
15292 if(_class && id)
15293 {
15294 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15295 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15296 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15299
15300 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15301 exp->member.memberType = 1;
15302 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15303 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15304 if(typeKind != 19)
15305 {
15306 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15307 {
15308 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15309 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15310 {
15311 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15312 if(prop)
15313 member = (((void *)0));
15314 }
15315 if(!member && !prop)
15316 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15317 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15318 exp->member.thisPtr = 0x1;
15319 }
15320 else
15321 {
15322 if(!id->classSym)
15323 {
15324 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15325 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15326 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15327 }
15328 if(!prop && !member)
15329 {
15330 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15331 if(!method)
15332 {
15333 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15334 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15335 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15336 }
15337 }
15338 if(member && prop)
15339 {
15340 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15341 prop = (((void *)0));
15342 else
15343 member = (((void *)0));
15344 }
15345 }
15346 }
15347 if(!prop && !member && !method)
15348 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15349 if(!prop && !member && !method)
15350 {
15351 if(typeKind == 19)
15352 {
15353 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15354 if(classProp)
15355 {
15356 exp->member.memberType = 5;
15357 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15358 }
15359 else
15360 {
15361 char structName[1024];
15362 struct Identifier * id = exp->member.member;
15363 struct Expression * classExp = exp->member.exp;
15364
15365 type->refCount++;
15366 FreeType(classExp->expType);
15367 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15368 strcpy(structName, "__ecereClassData_");
15369 FullClassNameCat(structName, type->_class->string, 0x0);
15370 exp->type = 9;
15371 exp->member.member = id;
15372 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"))))))));
15373 FreeType(type);
15374 ProcessExpressionType(exp);
15375 return ;
15376 }
15377 }
15378 else
15379 {
15380 struct Symbol * classSym = FindClass(id->string);
15381
15382 if(classSym)
15383 {
15384 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15385
15386 if(convertClass)
15387 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15388 }
15389 }
15390 }
15391 if(prop)
15392 {
15393 exp->member.memberType = 1;
15394 if(!prop->dataType)
15395 ProcessPropertyType(prop);
15396 exp->expType = prop->dataType;
15397 if(prop->dataType)
15398 prop->dataType->refCount++;
15399 }
15400 else if(member)
15401 {
15402 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15403 {
15404 FreeExpContents(exp);
15405 exp->type = 0;
15406 exp->identifier = MkIdentifier("class");
15407 ProcessExpressionType(exp);
15408 return ;
15409 }
15410 exp->member.memberType = 3;
15411 DeclareStruct(_class->fullName, 0x0);
15412 if(!member->dataType)
15413 {
15414 struct Context * context = SetupTemplatesContext(_class);
15415
15416 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15417 FinishTemplatesContext(context);
15418 }
15419 exp->expType = member->dataType;
15420 if(member->dataType)
15421 member->dataType->refCount++;
15422 }
15423 else if(revConvert)
15424 {
15425 exp->member.memberType = 4;
15426 exp->expType = MkClassType(revConvert->_class->fullName);
15427 }
15428 else if(method)
15429 {
15430 {
15431 exp->member.memberType = 2;
15432 }
15433 if(!method->dataType)
15434 ProcessMethodType(method);
15435 exp->expType = __extension__ ({
15436 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15437
15438 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15439 });
15440 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15441 exp->expType->usedClass = _class;
15442 }
15443 else if(!classProp)
15444 {
15445 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15446 {
15447 FreeExpContents(exp);
15448 exp->type = 0;
15449 exp->identifier = MkIdentifier("class");
15450 ProcessExpressionType(exp);
15451 return ;
15452 }
15453 yylloc = exp->member.member->loc;
15454 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15455 if(inCompiler)
15456 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15457 }
15458 if(_class && exp->expType)
15459 {
15460 struct __ecereNameSpace__ecere__com__Class * tClass;
15461
15462 tClass = _class;
15463 while(tClass && !tClass->templateClass)
15464 tClass = tClass->base;
15465 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15466 {
15467 int id = 0;
15468 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15469 struct __ecereNameSpace__ecere__com__Class * sClass;
15470
15471 for(sClass = tClass; sClass; sClass = sClass->base)
15472 {
15473 id = 0;
15474 if(sClass->templateClass)
15475 sClass = sClass->templateClass;
15476 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15477 {
15478 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15479 {
15480 for(sClass = sClass->base; sClass; sClass = sClass->base)
15481 id += sClass->templateParams.count;
15482 break;
15483 }
15484 id++;
15485 }
15486 if(curParam)
15487 break;
15488 }
15489 if(curParam && tClass->templateArgs[id].dataTypeString)
15490 {
15491 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15492 struct Context * context = SetupTemplatesContext(tClass);
15493
15494 FreeType(exp->expType);
15495 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15496 if(exp->expType)
15497 {
15498 if(exp->expType->kind == 21)
15499 {
15500 FreeType(exp->expType);
15501 exp->expType = ReplaceThisClassType(_class);
15502 }
15503 if(tClass->templateClass)
15504 exp->expType->passAsTemplate = 0x1;
15505 if(!exp->destType)
15506 {
15507 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15508 if(exp->destType->kind == 21)
15509 {
15510 FreeType(exp->destType);
15511 exp->destType = ReplaceThisClassType(_class);
15512 }
15513 }
15514 }
15515 FinishTemplatesContext(context);
15516 }
15517 }
15518 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15519 {
15520 int id = 0;
15521 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15522 struct __ecereNameSpace__ecere__com__Class * sClass;
15523
15524 for(sClass = tClass; sClass; sClass = sClass->base)
15525 {
15526 id = 0;
15527 if(sClass->templateClass)
15528 sClass = sClass->templateClass;
15529 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15530 {
15531 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15532 {
15533 for(sClass = sClass->base; sClass; sClass = sClass->base)
15534 id += sClass->templateParams.count;
15535 break;
15536 }
15537 id++;
15538 }
15539 if(curParam)
15540 break;
15541 }
15542 if(curParam)
15543 {
15544 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15545 struct Context * context = SetupTemplatesContext(tClass);
15546 struct Type * basicType;
15547
15548 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15549 if(basicType)
15550 {
15551 if(basicType->kind == 21)
15552 {
15553 FreeType(basicType);
15554 basicType = ReplaceThisClassType(_class);
15555 }
15556 FreeType(exp->expType);
15557 exp->expType = __extension__ ({
15558 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15559
15560 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15561 });
15562 if(!exp->destType)
15563 {
15564 exp->destType = exp->expType;
15565 exp->destType->refCount++;
15566 }
15567 {
15568 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15570 struct Declarator * decl;
15571
15572 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15573 *newExp = *exp;
15574 if(exp->destType)
15575 exp->destType->refCount++;
15576 if(exp->expType)
15577 exp->expType->refCount++;
15578 exp->type = 11;
15579 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15580 exp->cast.exp = newExp;
15581 }
15582 }
15583 FinishTemplatesContext(context);
15584 }
15585 }
15586 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15587 {
15588 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15589
15590 if(expClass)
15591 {
15592 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15593 int c;
15594 int p = 0;
15595 int paramCount = 0;
15596 int lastParam = -1;
15597 char templateString[1024];
15598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15599
15600 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15601 while(cClass != expClass)
15602 {
15603 struct __ecereNameSpace__ecere__com__Class * sClass;
15604
15605 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15606 ;
15607 cClass = sClass;
15608 for(param = cClass->templateParams.first; param; param = param->next)
15609 {
15610 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15611 int c;
15612 int cp = 0;
15613 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15614 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15615
15616 while(cClassCur != tClass && !paramCur)
15617 {
15618 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15619
15620 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15621 ;
15622 cClassCur = sClassCur;
15623 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15624 {
15625 if(!strcmp(paramCur->name, param->name))
15626 {
15627 break;
15628 }
15629 cp++;
15630 }
15631 }
15632 if(paramCur && paramCur->type == 0)
15633 arg = tClass->templateArgs[cp];
15634 else
15635 arg = expClass->templateArgs[p];
15636 {
15637 char argument[256];
15638
15639 argument[0] = '\0';
15640 switch(param->type)
15641 {
15642 case 2:
15643 {
15644 char expString[1024];
15645 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15646 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15647 struct Expression * exp;
15648 char * string = PrintHexUInt64(arg.expression.ui64);
15649
15650 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15651 ProcessExpressionType(exp);
15652 ComputeExpression(exp);
15653 expString[0] = '\0';
15654 PrintExpression(exp, expString);
15655 strcat(argument, expString);
15656 FreeExpression(exp);
15657 break;
15658 }
15659 case 1:
15660 {
15661 strcat(argument, arg.member->name);
15662 break;
15663 }
15664 case 0:
15665 {
15666 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15667 strcat(argument, arg.dataTypeString);
15668 break;
15669 }
15670 }
15671 if(argument[0])
15672 {
15673 if(paramCount)
15674 strcat(templateString, ", ");
15675 if(lastParam != p - 1)
15676 {
15677 strcat(templateString, param->name);
15678 strcat(templateString, " = ");
15679 }
15680 strcat(templateString, argument);
15681 paramCount++;
15682 lastParam = p;
15683 }
15684 }
15685 p++;
15686 }
15687 }
15688 {
15689 int len = strlen(templateString);
15690
15691 if(templateString[len - 1] == '>')
15692 templateString[len++] = ' ';
15693 templateString[len++] = '>';
15694 templateString[len++] = '\0';
15695 }
15696 FreeType(exp->expType);
15697 {
15698 struct Context * context = SetupTemplatesContext(tClass);
15699
15700 exp->expType = ProcessTypeString(templateString, 0x0);
15701 FinishTemplatesContext(context);
15702 }
15703 }
15704 }
15705 }
15706 }
15707 else
15708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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)");
15709 }
15710 else if(type && (type->kind == 9 || type->kind == 10))
15711 {
15712 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15713
15714 if(memberType)
15715 {
15716 exp->expType = memberType;
15717 if(memberType)
15718 memberType->refCount++;
15719 }
15720 }
15721 else
15722 {
15723 char expString[10240];
15724
15725 expString[0] = '\0';
15726 if(inCompiler)
15727 {
15728 PrintExpression(exp, expString);
15729 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15730 }
15731 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15732 }
15733 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15734 {
15735 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15736 {
15737 struct Identifier * id = exp->member.member;
15738 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));
15739
15740 if(_class)
15741 {
15742 FreeType(exp->expType);
15743 exp->expType = ReplaceThisClassType(_class);
15744 }
15745 }
15746 }
15747 yylloc = oldyylloc;
15748 break;
15749 }
15750 case 9:
15751 {
15752 struct Type * destType = exp->destType;
15753
15754 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15755 {
15756 exp->member.member->classSym = exp->member.member->_class->symbol;
15757 }
15758 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15759 exp->type = 8;
15760 if(destType)
15761 destType->count++;
15762 ProcessExpressionType(exp);
15763 if(destType)
15764 destType->count--;
15765 break;
15766 }
15767 case 15:
15768 {
15769 struct Symbol * classSym = exp->_class->symbol;
15770
15771 if(classSym && classSym->registered)
15772 {
15773 if(classSym->registered->type == 5)
15774 {
15775 char name[1024];
15776
15777 name[0] = '\0';
15778 DeclareStruct(classSym->string, 0x0);
15779 FreeSpecifier(exp->_class);
15780 exp->type = 10;
15781 FullClassNameCat(name, classSym->string, 0x0);
15782 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15783 }
15784 else
15785 {
15786 if(classSym->registered->fixed)
15787 {
15788 FreeSpecifier(exp->_class);
15789 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15790 exp->type = 2;
15791 }
15792 else
15793 {
15794 char className[1024];
15795
15796 strcpy(className, "__ecereClass_");
15797 FullClassNameCat(className, classSym->string, 0x1);
15798 MangleClassName(className);
15799 DeclareClass(classSym, className);
15800 FreeExpContents(exp);
15801 exp->type = 9;
15802 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15803 exp->member.member = MkIdentifier("structSize");
15804 }
15805 }
15806 }
15807 exp->expType = __extension__ ({
15808 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15809
15810 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15811 });
15812 break;
15813 }
15814 case 10:
15815 {
15816 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15817
15818 exp->expType = __extension__ ({
15819 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15820
15821 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15822 });
15823 exp->isConstant = 0x1;
15824 DeclareType(type, 0x0, 0x0);
15825 FreeType(type);
15826 break;
15827 }
15828 case 11:
15829 {
15830 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15831
15832 type->count = 1;
15833 FreeType(exp->cast.exp->destType);
15834 exp->cast.exp->destType = type;
15835 type->refCount++;
15836 ProcessExpressionType(exp->cast.exp);
15837 type->count = 0;
15838 exp->expType = type;
15839 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15840 {
15841 void * prev = exp->prev, * next = exp->next;
15842 struct Type * expType = exp->cast.exp->destType;
15843 struct Expression * castExp = exp->cast.exp;
15844 struct Type * destType = exp->destType;
15845
15846 if(expType)
15847 expType->refCount++;
15848 FreeType(exp->expType);
15849 FreeTypeName(exp->cast.typeName);
15850 *exp = *castExp;
15851 FreeType(exp->expType);
15852 FreeType(exp->destType);
15853 exp->expType = expType;
15854 exp->destType = destType;
15855 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15856 exp->prev = prev;
15857 exp->next = next;
15858 }
15859 else
15860 {
15861 exp->isConstant = exp->cast.exp->isConstant;
15862 }
15863 break;
15864 }
15865 case 35:
15866 {
15867 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15868
15869 exp->expType = type;
15870 break;
15871 }
15872 case 36:
15873 {
15874 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15875
15876 ProcessExpressionType(exp->vaArg.exp);
15877 exp->expType = type;
15878 break;
15879 }
15880 case 12:
15881 {
15882 struct Expression * e;
15883
15884 exp->isConstant = 0x1;
15885 FreeType(exp->cond.cond->destType);
15886 exp->cond.cond->destType = MkClassType("bool");
15887 exp->cond.cond->destType->truth = 0x1;
15888 ProcessExpressionType(exp->cond.cond);
15889 if(!exp->cond.cond->isConstant)
15890 exp->isConstant = 0x0;
15891 for(e = (*exp->cond.exp).first; e; e = e->next)
15892 {
15893 if(!e->next)
15894 {
15895 FreeType(e->destType);
15896 e->destType = exp->destType;
15897 if(e->destType)
15898 e->destType->refCount++;
15899 }
15900 ProcessExpressionType(e);
15901 if(!e->next)
15902 {
15903 exp->expType = e->expType;
15904 if(e->expType)
15905 e->expType->refCount++;
15906 }
15907 if(!e->isConstant)
15908 exp->isConstant = 0x0;
15909 }
15910 FreeType(exp->cond.elseExp->destType);
15911 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15912 if(exp->cond.elseExp->destType)
15913 exp->cond.elseExp->destType->refCount++;
15914 ProcessExpressionType(exp->cond.elseExp);
15915 if(!exp->cond.elseExp->isConstant)
15916 exp->isConstant = 0x0;
15917 break;
15918 }
15919 case 25:
15920 {
15921 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15922 {
15923 struct Statement * last = (*exp->compound->compound.statements).last;
15924
15925 if(last->type == 3 && last->expressions && (*last->expressions).last)
15926 {
15927 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15928 if(exp->destType)
15929 exp->destType->refCount++;
15930 }
15931 ProcessStatement(exp->compound);
15932 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15933 if(exp->expType)
15934 exp->expType->refCount++;
15935 }
15936 break;
15937 }
15938 case 26:
15939 {
15940 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15941
15942 if(spec && spec->type == 1)
15943 {
15944 exp->expType = MkClassType(spec->name);
15945 exp->expType->kind = 19;
15946 exp->byReference = 0x1;
15947 }
15948 else
15949 {
15950 exp->expType = MkClassType("ecere::com::Class");
15951 exp->byReference = 0x1;
15952 }
15953 break;
15954 }
15955 case 27:
15956 {
15957 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15958
15959 if(_class)
15960 {
15961 struct Identifier * id = exp->classData.id;
15962 char structName[1024];
15963 struct Expression * classExp;
15964
15965 strcpy(structName, "__ecereClassData_");
15966 FullClassNameCat(structName, _class->fullName, 0x0);
15967 exp->type = 9;
15968 exp->member.member = id;
15969 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15970 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15971 else
15972 classExp = MkExpIdentifier(MkIdentifier("class"));
15973 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"))))))));
15974 ProcessExpressionType(exp);
15975 return ;
15976 }
15977 break;
15978 }
15979 case 37:
15980 {
15981 struct Type * type = (((void *)0));
15982 char * typeString = (((void *)0));
15983 char typeStringBuf[1024];
15984
15985 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))
15986 {
15987 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15988
15989 typeString = templateClass->templateArgs[2].dataTypeString;
15990 }
15991 else if(exp->list)
15992 {
15993 struct Expression * e;
15994
15995 for(e = (*exp->list).first; e; e = e->next)
15996 {
15997 ProcessExpressionType(e);
15998 if(e->expType)
15999 {
16000 if(!type)
16001 {
16002 type = e->expType;
16003 type->refCount++;
16004 }
16005 else
16006 {
16007 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16008 {
16009 FreeType(type);
16010 type = e->expType;
16011 e->expType = (((void *)0));
16012 e = (*exp->list).first;
16013 ProcessExpressionType(e);
16014 if(e->expType)
16015 {
16016 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16017 {
16018 FreeType(e->expType);
16019 e->expType = (((void *)0));
16020 FreeType(type);
16021 type = (((void *)0));
16022 break;
16023 }
16024 }
16025 }
16026 }
16027 if(e->expType)
16028 {
16029 FreeType(e->expType);
16030 e->expType = (((void *)0));
16031 }
16032 }
16033 }
16034 if(type)
16035 {
16036 typeStringBuf[0] = '\0';
16037 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16038 typeString = typeStringBuf;
16039 FreeType(type);
16040 type = (((void *)0));
16041 }
16042 }
16043 if(typeString)
16044 {
16045 char templateString[1024];
16046 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16047 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16048 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16049 struct Expression * expExt;
16050 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16051
16052 sprintf(templateString, "Container<%s>", typeString);
16053 if(exp->list)
16054 {
16055 struct Expression * e;
16056
16057 type = ProcessTypeString(typeString, 0x0);
16058 while(e = (*exp->list).first)
16059 {
16060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16061 e->destType = type;
16062 type->refCount++;
16063 ProcessExpressionType(e);
16064 ListAdd(initializers, MkInitializerAssignment(e));
16065 }
16066 FreeType(type);
16067 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16068 }
16069 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16070 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16071 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16072 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16073 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16074 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16075 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16076 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16077 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16078 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16079 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16080
16081 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16082 })));
16083 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16084 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16085 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16086 exp->expType = ProcessTypeString(templateString, 0x0);
16087 exp->type = 5;
16088 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16089 ProcessExpressionType(expExt);
16090 }
16091 else
16092 {
16093 exp->expType = ProcessTypeString("Container", 0x0);
16094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16095 }
16096 break;
16097 }
16098 }
16099 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16100 {
16101 FreeType(exp->expType);
16102 exp->expType = ReplaceThisClassType(thisClass);
16103 }
16104 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16105 {
16106 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16107
16108 if(symbol)
16109 {
16110 if(exp->expType->kind != 15)
16111 {
16112 struct Type * member;
16113 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16114
16115 FreeType(exp->expType);
16116 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16117 exp->expType->kind = symbol->type->kind;
16118 exp->expType->refCount++;
16119 exp->expType->enumName = enumName;
16120 exp->expType->members = symbol->type->members;
16121 for(member = symbol->type->members.first; member; member = member->next)
16122 member->refCount++;
16123 }
16124 else
16125 {
16126 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16127
16128 for(member = symbol->type->members.first; member; member = member->next)
16129 {
16130 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16131
16132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16133 }
16134 }
16135 }
16136 }
16137 yylloc = exp->loc;
16138 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16139 ;
16140 else if(exp->destType && !exp->destType->keepCast)
16141 {
16142 if(!CheckExpressionType(exp, exp->destType, 0x0))
16143 {
16144 if(!exp->destType->count || unresolved)
16145 {
16146 if(!exp->expType)
16147 {
16148 yylloc = exp->loc;
16149 if(exp->destType->kind != 14)
16150 {
16151 char type2[1024];
16152
16153 type2[0] = '\0';
16154 if(inCompiler)
16155 {
16156 char expString[10240];
16157
16158 expString[0] = '\0';
16159 PrintType(exp->destType, type2, 0x0, 0x1);
16160 if(inCompiler)
16161 {
16162 PrintExpression(exp, expString);
16163 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16164 }
16165 if(unresolved)
16166 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16167 else if(exp->type != 16)
16168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16169 }
16170 }
16171 else
16172 {
16173 char expString[10240];
16174
16175 expString[0] = '\0';
16176 if(inCompiler)
16177 {
16178 PrintExpression(exp, expString);
16179 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16180 }
16181 if(unresolved)
16182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16183 else if(exp->type != 16)
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16185 }
16186 }
16187 else
16188 {
16189 char type1[1024];
16190 char type2[1024];
16191
16192 type1[0] = '\0';
16193 type2[0] = '\0';
16194 if(inCompiler)
16195 {
16196 PrintType(exp->expType, type1, 0x0, 0x1);
16197 PrintType(exp->destType, type2, 0x0, 0x1);
16198 }
16199 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)))
16200 ;
16201 else
16202 {
16203 char expString[10240];
16204
16205 expString[0] = '\0';
16206 if(inCompiler)
16207 {
16208 PrintExpression(exp, expString);
16209 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16210 }
16211 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16212 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16213 FreeType(exp->expType);
16214 exp->destType->refCount++;
16215 exp->expType = exp->destType;
16216 }
16217 }
16218 }
16219 }
16220 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16221 {
16222 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16223 char typeString[1024];
16224 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16225 struct Declarator * decl;
16226
16227 typeString[0] = '\0';
16228 *newExp = *exp;
16229 if(exp->expType)
16230 exp->expType->refCount++;
16231 if(exp->expType)
16232 exp->expType->refCount++;
16233 exp->type = 11;
16234 newExp->destType = exp->expType;
16235 PrintType(exp->expType, typeString, 0x0, 0x0);
16236 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16237 exp->cast.typeName = MkTypeName(specs, decl);
16238 exp->cast.exp = newExp;
16239 }
16240 }
16241 else if(unresolved)
16242 {
16243 if(exp->identifier->_class && exp->identifier->_class->name)
16244 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16245 else if(exp->identifier->string && exp->identifier->string[0])
16246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16247 }
16248 else if(!exp->expType && exp->type != 16)
16249 {
16250 char expString[10240];
16251
16252 expString[0] = '\0';
16253 if(inCompiler)
16254 {
16255 PrintExpression(exp, expString);
16256 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16257 }
16258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16259 }
16260 if(inCompiler)
16261 ApplyAnyObjectLogic(exp);
16262 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1 && exp->destType->kind != 24)))
16263 {
16264 exp->byReference = 0x1;
16265 }
16266 yylloc = oldyylloc;
16267 }
16268
16269 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)
16270 {
16271 if(*curMember)
16272 {
16273 *curMember = (*curMember)->next;
16274 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16275 {
16276 *curMember = subMemberStack[--(*subMemberStackPos)];
16277 *curMember = (*curMember)->next;
16278 }
16279 while((*curMember) && (*curMember)->isProperty)
16280 *curMember = (*curMember)->next;
16281 if(subMemberStackPos)
16282 {
16283 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16284 {
16285 subMemberStack[(*subMemberStackPos)++] = *curMember;
16286 *curMember = (*curMember)->members.first;
16287 while(*curMember && (*curMember)->isProperty)
16288 *curMember = (*curMember)->next;
16289 }
16290 }
16291 }
16292 while(!*curMember)
16293 {
16294 if(!*curMember)
16295 {
16296 if(subMemberStackPos && *subMemberStackPos)
16297 {
16298 *curMember = subMemberStack[--(*subMemberStackPos)];
16299 *curMember = (*curMember)->next;
16300 }
16301 else
16302 {
16303 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16304
16305 if(*curClass == _class)
16306 break;
16307 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16308 ;
16309 *curMember = (*curClass)->membersAndProperties.first;
16310 }
16311 while((*curMember) && (*curMember)->isProperty)
16312 *curMember = (*curMember)->next;
16313 if(subMemberStackPos)
16314 {
16315 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16316 {
16317 subMemberStack[(*subMemberStackPos)++] = *curMember;
16318 *curMember = (*curMember)->members.first;
16319 while(*curMember && (*curMember)->isProperty)
16320 *curMember = (*curMember)->next;
16321 }
16322 }
16323 }
16324 }
16325 }
16326
16327 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16328 {
16329 switch(init->type)
16330 {
16331 case 0:
16332 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16333 {
16334 if(init->exp && !init->exp->destType)
16335 {
16336 FreeType(init->exp->destType);
16337 init->exp->destType = type;
16338 if(type)
16339 type->refCount++;
16340 }
16341 if(init->exp)
16342 {
16343 ProcessExpressionType(init->exp);
16344 init->isConstant = init->exp->isConstant;
16345 }
16346 break;
16347 }
16348 else
16349 {
16350 struct Expression * exp = init->exp;
16351 struct Instantiation * inst = exp->instance;
16352 struct MembersInit * members;
16353
16354 init->type = 1;
16355 init->list = MkList();
16356 if(inst->members)
16357 {
16358 for(members = (*inst->members).first; members; members = members->next)
16359 {
16360 if(members->type == 0)
16361 {
16362 struct MemberInit * member;
16363
16364 for(member = (*members->dataMembers).first; member; member = member->next)
16365 {
16366 ListAdd(init->list, member->initializer);
16367 member->initializer = (((void *)0));
16368 }
16369 }
16370 }
16371 }
16372 FreeExpression(exp);
16373 }
16374 case 1:
16375 {
16376 struct Initializer * i;
16377 struct Type * initializerType = (((void *)0));
16378 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16379 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16381 int subMemberStackPos = 0;
16382
16383 if(type && type->kind == 12)
16384 initializerType = Dereference(type);
16385 else if(type && (type->kind == 9 || type->kind == 10))
16386 initializerType = type->members.first;
16387 for(i = (*init->list).first; i; i = i->next)
16388 {
16389 if(type && type->kind == 8 && type->_class && type->_class->registered)
16390 {
16391 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16392 if(curMember)
16393 {
16394 if(!curMember->dataType)
16395 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16396 initializerType = curMember->dataType;
16397 }
16398 }
16399 ProcessInitializer(i, initializerType);
16400 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16401 initializerType = initializerType->next;
16402 if(!i->isConstant)
16403 init->isConstant = 0x0;
16404 }
16405 if(type && type->kind == 12)
16406 FreeType(initializerType);
16407 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16408 {
16409 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16410 }
16411 break;
16412 }
16413 }
16414 }
16415
16416 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16417
16418 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16419
16420 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16421 {
16422 switch(spec->type)
16423 {
16424 case 0:
16425 {
16426 if(spec->specifier == THISCLASS)
16427 {
16428 if(thisClass)
16429 {
16430 spec->type = 1;
16431 spec->name = ReplaceThisClass(thisClass);
16432 spec->symbol = FindClass(spec->name);
16433 ProcessSpecifier(spec, declareStruct);
16434 }
16435 }
16436 break;
16437 }
16438 case 1:
16439 {
16440 struct Symbol * symbol = FindType(curContext, spec->name);
16441
16442 if(symbol)
16443 DeclareType(symbol->type, 0x1, 0x1);
16444 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16445 DeclareStruct(spec->name, 0x0);
16446 break;
16447 }
16448 case 2:
16449 {
16450 struct Enumerator * e;
16451
16452 if(spec->list)
16453 {
16454 for(e = (*spec->list).first; e; e = e->next)
16455 {
16456 if(e->exp)
16457 ProcessExpressionType(e->exp);
16458 }
16459 }
16460 break;
16461 }
16462 case 3:
16463 case 4:
16464 {
16465 if(spec->definitions)
16466 {
16467 struct ClassDef * def;
16468 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16469
16470 ProcessClass(spec->definitions, symbol);
16471 }
16472 break;
16473 }
16474 }
16475 }
16476
16477 static void ProcessDeclarator(struct Declarator * decl)
16478 {
16479 switch(decl->type)
16480 {
16481 case 1:
16482 if(decl->identifier->classSym)
16483 {
16484 FreeSpecifier(decl->identifier->_class);
16485 decl->identifier->_class = (((void *)0));
16486 }
16487 break;
16488 case 3:
16489 if(decl->array.exp)
16490 ProcessExpressionType(decl->array.exp);
16491 case 0:
16492 case 2:
16493 case 4:
16494 case 5:
16495 case 6:
16496 case 7:
16497 if(decl->declarator)
16498 ProcessDeclarator(decl->declarator);
16499 if(decl->type == 4)
16500 {
16501 struct Identifier * id = GetDeclId(decl);
16502
16503 if(id && id->_class)
16504 {
16505 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16506
16507 if(!decl->function.parameters)
16508 decl->function.parameters = MkList();
16509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16510 id->_class = (((void *)0));
16511 }
16512 if(decl->function.parameters)
16513 {
16514 struct TypeName * param;
16515
16516 for(param = (*decl->function.parameters).first; param; param = param->next)
16517 {
16518 if(param->qualifiers && (*param->qualifiers).first)
16519 {
16520 struct Specifier * spec = (*param->qualifiers).first;
16521
16522 if(spec && spec->specifier == TYPED_OBJECT)
16523 {
16524 struct Declarator * d = param->declarator;
16525 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);
16526
16527 FreeList(param->qualifiers, FreeSpecifier);
16528 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16529 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16531 param = newParam;
16532 }
16533 else if(spec && spec->specifier == ANY_OBJECT)
16534 {
16535 struct Declarator * d = param->declarator;
16536
16537 FreeList(param->qualifiers, FreeSpecifier);
16538 param->qualifiers = MkListOne(MkSpecifier(VOID));
16539 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16540 }
16541 else if(spec->specifier == THISCLASS)
16542 {
16543 if(thisClass)
16544 {
16545 spec->type = 1;
16546 spec->name = ReplaceThisClass(thisClass);
16547 spec->symbol = FindClass(spec->name);
16548 ProcessSpecifier(spec, 0x0);
16549 }
16550 }
16551 }
16552 if(param->declarator)
16553 ProcessDeclarator(param->declarator);
16554 }
16555 }
16556 }
16557 break;
16558 }
16559 }
16560
16561 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16562
16563 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16564
16565 static void ProcessDeclaration(struct Declaration * decl)
16566 {
16567 yylloc = decl->loc;
16568 switch(decl->type)
16569 {
16570 case 1:
16571 {
16572 unsigned int declareStruct = 0x0;
16573
16574 if(decl->declarators)
16575 {
16576 struct InitDeclarator * d;
16577
16578 for(d = (*decl->declarators).first; d; d = d->next)
16579 {
16580 struct Type * type, * subType;
16581
16582 ProcessDeclarator(d->declarator);
16583 type = ProcessType(decl->specifiers, d->declarator);
16584 if(d->initializer)
16585 {
16586 ProcessInitializer(d->initializer, type);
16587 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16588 {
16589 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16590 {
16591 struct Instantiation * inst = d->initializer->exp->instance;
16592
16593 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16594 d->initializer->exp->instance = (((void *)0));
16595 if(decl->specifiers)
16596 FreeList(decl->specifiers, FreeSpecifier);
16597 FreeList(decl->declarators, FreeInitDeclarator);
16598 d = (((void *)0));
16599 decl->type = 2;
16600 decl->inst = inst;
16601 }
16602 }
16603 }
16604 for(subType = type; subType; )
16605 {
16606 if(subType->kind == 8)
16607 {
16608 declareStruct = 0x1;
16609 break;
16610 }
16611 else if(subType->kind == 13)
16612 break;
16613 else if(subType->kind == 12)
16614 subType = subType->arrayType;
16615 else
16616 break;
16617 }
16618 FreeType(type);
16619 if(!d)
16620 break;
16621 }
16622 }
16623 if(decl->specifiers)
16624 {
16625 struct Specifier * s;
16626
16627 for(s = (*decl->specifiers).first; s; s = s->next)
16628 {
16629 ProcessSpecifier(s, declareStruct);
16630 }
16631 }
16632 break;
16633 }
16634 case 2:
16635 {
16636 ProcessInstantiationType(decl->inst);
16637 break;
16638 }
16639 case 0:
16640 {
16641 struct Specifier * spec;
16642 struct Declarator * d;
16643 unsigned int declareStruct = 0x0;
16644
16645 if(decl->declarators)
16646 {
16647 for(d = (*decl->declarators).first; d; d = d->next)
16648 {
16649 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16650 struct Type * subType;
16651
16652 ProcessDeclarator(d);
16653 for(subType = type; subType; )
16654 {
16655 if(subType->kind == 8)
16656 {
16657 declareStruct = 0x1;
16658 break;
16659 }
16660 else if(subType->kind == 13)
16661 break;
16662 else if(subType->kind == 12)
16663 subType = subType->arrayType;
16664 else
16665 break;
16666 }
16667 FreeType(type);
16668 }
16669 }
16670 if(decl->specifiers)
16671 {
16672 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16673 ProcessSpecifier(spec, declareStruct);
16674 }
16675 break;
16676 }
16677 }
16678 }
16679
16680 static struct FunctionDefinition * curFunction;
16681
16682 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16683 {
16684 char propName[1024], propNameM[1024];
16685 char getName[1024], setName[1024];
16686 struct __ecereNameSpace__ecere__sys__OldList * args;
16687
16688 DeclareProperty(prop, setName, getName);
16689 strcpy(propName, "__ecereProp_");
16690 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16691 strcat(propName, "_");
16692 FullClassNameCat(propName, prop->name, 0x1);
16693 MangleClassName(propName);
16694 strcpy(propNameM, "__ecerePropM_");
16695 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16696 strcat(propNameM, "_");
16697 FullClassNameCat(propNameM, prop->name, 0x1);
16698 MangleClassName(propNameM);
16699 if(prop->isWatchable)
16700 {
16701 args = MkList();
16702 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16703 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16704 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16705 args = MkList();
16706 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16707 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16708 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16709 }
16710 {
16711 args = MkList();
16712 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16713 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16714 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16715 args = MkList();
16716 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16717 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16718 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16719 }
16720 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16721 curFunction->propSet->fireWatchersDone = 0x1;
16722 }
16723
16724 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16725
16726 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16727
16728 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16729
16730 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16731
16732 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16733
16734 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16735
16736 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16737
16738 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16739
16740 static void ProcessStatement(struct Statement * stmt)
16741 {
16742 yylloc = stmt->loc;
16743 switch(stmt->type)
16744 {
16745 case 0:
16746 ProcessStatement(stmt->labeled.stmt);
16747 break;
16748 case 1:
16749 if(stmt->caseStmt.exp)
16750 {
16751 FreeType(stmt->caseStmt.exp->destType);
16752 stmt->caseStmt.exp->destType = curSwitchType;
16753 if(curSwitchType)
16754 curSwitchType->refCount++;
16755 ProcessExpressionType(stmt->caseStmt.exp);
16756 ComputeExpression(stmt->caseStmt.exp);
16757 }
16758 if(stmt->caseStmt.stmt)
16759 ProcessStatement(stmt->caseStmt.stmt);
16760 break;
16761 case 2:
16762 {
16763 if(stmt->compound.context)
16764 {
16765 struct Declaration * decl;
16766 struct Statement * s;
16767 struct Statement * prevCompound = curCompound;
16768 struct Context * prevContext = curContext;
16769
16770 if(!stmt->compound.isSwitch)
16771 curCompound = stmt;
16772 curContext = stmt->compound.context;
16773 if(stmt->compound.declarations)
16774 {
16775 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16776 ProcessDeclaration(decl);
16777 }
16778 if(stmt->compound.statements)
16779 {
16780 for(s = (*stmt->compound.statements).first; s; s = s->next)
16781 ProcessStatement(s);
16782 }
16783 curContext = prevContext;
16784 curCompound = prevCompound;
16785 }
16786 break;
16787 }
16788 case 3:
16789 {
16790 struct Expression * exp;
16791
16792 if(stmt->expressions)
16793 {
16794 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16795 ProcessExpressionType(exp);
16796 }
16797 break;
16798 }
16799 case 4:
16800 {
16801 struct Expression * exp;
16802
16803 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16804 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16805 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16806 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16807 {
16808 ProcessExpressionType(exp);
16809 }
16810 if(stmt->ifStmt.stmt)
16811 ProcessStatement(stmt->ifStmt.stmt);
16812 if(stmt->ifStmt.elseStmt)
16813 ProcessStatement(stmt->ifStmt.elseStmt);
16814 break;
16815 }
16816 case 5:
16817 {
16818 struct Type * oldSwitchType = curSwitchType;
16819
16820 if(stmt->switchStmt.exp)
16821 {
16822 struct Expression * exp;
16823
16824 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16825 {
16826 if(!exp->next)
16827 {
16828 ProcessExpressionType(exp);
16829 }
16830 if(!exp->next)
16831 curSwitchType = exp->expType;
16832 }
16833 }
16834 ProcessStatement(stmt->switchStmt.stmt);
16835 curSwitchType = oldSwitchType;
16836 break;
16837 }
16838 case 6:
16839 {
16840 if(stmt->whileStmt.exp)
16841 {
16842 struct Expression * exp;
16843
16844 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16845 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16846 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16847 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16848 {
16849 ProcessExpressionType(exp);
16850 }
16851 }
16852 if(stmt->whileStmt.stmt)
16853 ProcessStatement(stmt->whileStmt.stmt);
16854 break;
16855 }
16856 case 7:
16857 {
16858 if(stmt->doWhile.exp)
16859 {
16860 struct Expression * exp;
16861
16862 if((*stmt->doWhile.exp).last)
16863 {
16864 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16865 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16866 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16867 }
16868 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16869 {
16870 ProcessExpressionType(exp);
16871 }
16872 }
16873 if(stmt->doWhile.stmt)
16874 ProcessStatement(stmt->doWhile.stmt);
16875 break;
16876 }
16877 case 8:
16878 {
16879 struct Expression * exp;
16880
16881 if(stmt->forStmt.init)
16882 ProcessStatement(stmt->forStmt.init);
16883 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16884 {
16885 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16886 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16887 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16888 }
16889 if(stmt->forStmt.check)
16890 ProcessStatement(stmt->forStmt.check);
16891 if(stmt->forStmt.increment)
16892 {
16893 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16894 ProcessExpressionType(exp);
16895 }
16896 if(stmt->forStmt.stmt)
16897 ProcessStatement(stmt->forStmt.stmt);
16898 break;
16899 }
16900 case 18:
16901 {
16902 struct Identifier * id = stmt->forEachStmt.id;
16903 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16904 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16905 struct Statement * block = stmt->forEachStmt.stmt;
16906 char iteratorType[1024];
16907 struct Type * source;
16908 struct Expression * e;
16909 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));
16910 struct Expression * arrayExp;
16911 char * typeString = (((void *)0));
16912 int builtinCount = 0;
16913
16914 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16915 {
16916 if(!e->next)
16917 {
16918 FreeType(e->destType);
16919 e->destType = ProcessTypeString("Container", 0x0);
16920 }
16921 if(!isBuiltin || e->next)
16922 ProcessExpressionType(e);
16923 }
16924 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16925 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16926 {
16927 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16928 struct Symbol * symbol;
16929 struct Expression * expIt = (((void *)0));
16930 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16931 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16932 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16933 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16934
16935 stmt->type = 2;
16936 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16937 stmt->compound.context->parent = curContext;
16938 curContext = stmt->compound.context;
16939 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16940 {
16941 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16942 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16943
16944 isCustomAVLTree = 0x1;
16945 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16946 isAVLTree = 0x1;
16947 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16948 isMap = 0x1;
16949 }
16950 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16951 isArray = 0x1;
16952 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16953 {
16954 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16955
16956 isLinkList = 0x1;
16957 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16958 }
16959 if(isArray)
16960 {
16961 struct Declarator * decl;
16962 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16963
16964 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16965 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16966 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16967 }
16968 else if(isBuiltin)
16969 {
16970 struct Type * type = (((void *)0));
16971 char typeStringBuf[1024];
16972
16973 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16974 if(((struct Expression *)(*exp).last)->type == 11)
16975 {
16976 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16977
16978 if(typeName)
16979 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16980 }
16981 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)
16982 {
16983 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16984
16985 typeString = templateClass->templateArgs[2].dataTypeString;
16986 }
16987 else if(arrayExp->list)
16988 {
16989 struct Expression * e;
16990
16991 for(e = (*arrayExp->list).first; e; e = e->next)
16992 {
16993 ProcessExpressionType(e);
16994 if(e->expType)
16995 {
16996 if(!type)
16997 {
16998 type = e->expType;
16999 type->refCount++;
17000 }
17001 else
17002 {
17003 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17004 {
17005 FreeType(type);
17006 type = e->expType;
17007 e->expType = (((void *)0));
17008 e = (*arrayExp->list).first;
17009 ProcessExpressionType(e);
17010 if(e->expType)
17011 {
17012 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17013 {
17014 FreeType(e->expType);
17015 e->expType = (((void *)0));
17016 FreeType(type);
17017 type = (((void *)0));
17018 break;
17019 }
17020 }
17021 }
17022 }
17023 if(e->expType)
17024 {
17025 FreeType(e->expType);
17026 e->expType = (((void *)0));
17027 }
17028 }
17029 }
17030 if(type)
17031 {
17032 typeStringBuf[0] = '\0';
17033 PrintType(type, typeStringBuf, 0x0, 0x1);
17034 typeString = typeStringBuf;
17035 FreeType(type);
17036 }
17037 }
17038 if(typeString)
17039 {
17040 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17041 struct Declarator * decl;
17042 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17043
17044 if(arrayExp->list)
17045 {
17046 struct Expression * e;
17047
17048 builtinCount = (*arrayExp->list).count;
17049 type = ProcessTypeString(typeString, 0x0);
17050 while(e = (*arrayExp->list).first)
17051 {
17052 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17053 e->destType = type;
17054 type->refCount++;
17055 ProcessExpressionType(e);
17056 ListAdd(initializers, MkInitializerAssignment(e));
17057 }
17058 FreeType(type);
17059 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17060 }
17061 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17062 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17063 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17064 FreeList(exp, FreeExpression);
17065 }
17066 else
17067 {
17068 arrayExp->expType = ProcessTypeString("Container", 0x0);
17069 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17070 }
17071 }
17072 else if(isLinkList && !isList)
17073 {
17074 struct Declarator * decl;
17075 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17076
17077 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17078 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17079 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17080 }
17081 else if(_class->templateArgs)
17082 {
17083 if(isMap)
17084 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17085 else
17086 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17087 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17088 }
17089 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17090 if(block)
17091 {
17092 switch(block->type)
17093 {
17094 case 2:
17095 if(block->compound.context)
17096 block->compound.context->parent = stmt->compound.context;
17097 break;
17098 case 4:
17099 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17100 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17101 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17102 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17103 break;
17104 case 5:
17105 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17106 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17107 break;
17108 case 6:
17109 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17110 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17111 break;
17112 case 7:
17113 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17114 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17115 break;
17116 case 8:
17117 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17118 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17119 break;
17120 case 18:
17121 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17122 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17123 break;
17124 }
17125 }
17126 if(filter)
17127 {
17128 block = MkIfStmt(filter, block, (((void *)0)));
17129 }
17130 if(isArray)
17131 {
17132 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));
17133 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17134 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17135 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17136 }
17137 else if(isBuiltin)
17138 {
17139 char count[128];
17140
17141 sprintf(count, "%d", builtinCount);
17142 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));
17143 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17144 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17145 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17146 }
17147 else if(isLinkList && !isList)
17148 {
17149 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17150 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17151
17152 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17153 {
17154 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));
17155 }
17156 else
17157 {
17158 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17159 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17160
17161 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));
17162 }
17163 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17164 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17165 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17166 }
17167 else
17168 {
17169 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17170 }
17171 ProcessExpressionType(expIt);
17172 if((*stmt->compound.declarations).first)
17173 ProcessDeclaration((*stmt->compound.declarations).first);
17174 if(symbol)
17175 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17176 ProcessStatement(stmt);
17177 curContext = stmt->compound.context->parent;
17178 break;
17179 }
17180 else
17181 {
17182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17183 }
17184 break;
17185 }
17186 case 9:
17187 break;
17188 case 10:
17189 break;
17190 case 11:
17191 break;
17192 case 12:
17193 {
17194 struct Expression * exp;
17195
17196 if(stmt->expressions)
17197 {
17198 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17199 {
17200 if(!exp->next)
17201 {
17202 if(curFunction && !curFunction->type)
17203 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17204 FreeType(exp->destType);
17205 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17206 if(exp->destType)
17207 exp->destType->refCount++;
17208 }
17209 ProcessExpressionType(exp);
17210 }
17211 }
17212 break;
17213 }
17214 case 14:
17215 {
17216 ProcessDeclaration(stmt->decl);
17217 break;
17218 }
17219 case 13:
17220 {
17221 struct AsmField * field;
17222
17223 if(stmt->asmStmt.inputFields)
17224 {
17225 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17226 if(field->expression)
17227 ProcessExpressionType(field->expression);
17228 }
17229 if(stmt->asmStmt.outputFields)
17230 {
17231 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17232 if(field->expression)
17233 ProcessExpressionType(field->expression);
17234 }
17235 if(stmt->asmStmt.clobberedFields)
17236 {
17237 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17238 {
17239 if(field->expression)
17240 ProcessExpressionType(field->expression);
17241 }
17242 }
17243 break;
17244 }
17245 case 17:
17246 {
17247 struct PropertyWatch * propWatch;
17248 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17249 struct Expression * object = stmt->_watch.object;
17250 struct Expression * watcher = stmt->_watch.watcher;
17251
17252 if(watcher)
17253 ProcessExpressionType(watcher);
17254 if(object)
17255 ProcessExpressionType(object);
17256 if(inCompiler)
17257 {
17258 if(watcher || thisClass)
17259 {
17260 struct External * external = curExternal;
17261 struct Context * context = curContext;
17262
17263 stmt->type = 3;
17264 stmt->expressions = MkList();
17265 curExternal = external->prev;
17266 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17267 {
17268 struct ClassFunction * func;
17269 char watcherName[1024];
17270 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17271 struct External * createdExternal;
17272 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17273
17274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17275 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17276 if(propWatch->deleteWatch)
17277 strcat(watcherName, "_delete");
17278 else
17279 {
17280 struct Identifier * propID;
17281
17282 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17283 {
17284 strcat(watcherName, "_");
17285 strcat(watcherName, propID->string);
17286 }
17287 }
17288 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17289 {
17290 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17291 ProcessClassFunctionBody(func, propWatch->compound);
17292 propWatch->compound = (((void *)0));
17293 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17294 createdExternal->symbol->idCode = external->symbol->idCode;
17295 curExternal = createdExternal;
17296 ProcessFunction(createdExternal->function);
17297 {
17298 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17299
17300 externalDecl->declaration = decl;
17301 if(decl->symbol && !decl->symbol->pointerExternal)
17302 decl->symbol->pointerExternal = externalDecl;
17303 }
17304 if(propWatch->deleteWatch)
17305 {
17306 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17307
17308 ListAdd(args, CopyExpression(object));
17309 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17310 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17311 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17312 }
17313 else
17314 {
17315 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17316 struct Identifier * propID;
17317
17318 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17319 {
17320 char propName[1024];
17321 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17322
17323 if(prop)
17324 {
17325 char getName[1024], setName[1024];
17326 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17327
17328 DeclareProperty(prop, setName, getName);
17329 strcpy(propName, "__ecereProp_");
17330 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17331 strcat(propName, "_");
17332 FullClassNameCat(propName, prop->name, 0x1);
17333 ListAdd(args, CopyExpression(object));
17334 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17335 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17336 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17337 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17338 }
17339 else
17340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17341 }
17342 }
17343 }
17344 else
17345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17346 }
17347 curExternal = external;
17348 curContext = context;
17349 if(watcher)
17350 FreeExpression(watcher);
17351 if(object)
17352 FreeExpression(object);
17353 FreeList(watches, FreePropertyWatch);
17354 }
17355 else
17356 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17357 }
17358 else
17359 {
17360 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17361 {
17362 ProcessStatement(propWatch->compound);
17363 }
17364 }
17365 break;
17366 }
17367 case 15:
17368 {
17369 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17370 struct Expression * object = stmt->_watch.object;
17371 struct __ecereNameSpace__ecere__com__Class * _class;
17372
17373 if(object)
17374 ProcessExpressionType(object);
17375 if(inCompiler)
17376 {
17377 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17378 if(_class)
17379 {
17380 struct Identifier * propID;
17381
17382 stmt->type = 3;
17383 stmt->expressions = MkList();
17384 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17385 {
17386 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17387 }
17388 else if(!watches)
17389 {
17390 }
17391 if(watches)
17392 {
17393 for(propID = (*watches).first; propID; propID = propID->next)
17394 {
17395 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17396
17397 if(prop)
17398 {
17399 CreateFireWatcher(prop, object, stmt);
17400 }
17401 else
17402 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17403 }
17404 }
17405 else
17406 {
17407 struct __ecereNameSpace__ecere__com__Property * prop;
17408 struct __ecereNameSpace__ecere__com__Class * base;
17409
17410 for(base = _class; base; base = base->base)
17411 {
17412 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17413 {
17414 if(prop->isProperty && prop->isWatchable)
17415 {
17416 CreateFireWatcher(prop, object, stmt);
17417 }
17418 }
17419 }
17420 }
17421 if(object)
17422 FreeExpression(object);
17423 FreeList(watches, FreeIdentifier);
17424 }
17425 else
17426 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17427 }
17428 break;
17429 }
17430 case 16:
17431 {
17432 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17433 struct Expression * object = stmt->_watch.object;
17434 struct Expression * watcher = stmt->_watch.watcher;
17435 struct __ecereNameSpace__ecere__com__Class * _class;
17436
17437 if(object)
17438 ProcessExpressionType(object);
17439 if(watcher)
17440 ProcessExpressionType(watcher);
17441 if(inCompiler)
17442 {
17443 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17444 if(watcher || thisClass)
17445 {
17446 if(_class)
17447 {
17448 struct Identifier * propID;
17449
17450 stmt->type = 3;
17451 stmt->expressions = MkList();
17452 if(!watches)
17453 {
17454 struct __ecereNameSpace__ecere__sys__OldList * args;
17455
17456 args = MkList();
17457 ListAdd(args, CopyExpression(object));
17458 ListAdd(args, MkExpConstant("0"));
17459 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17460 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17461 }
17462 else
17463 {
17464 for(propID = (*watches).first; propID; propID = propID->next)
17465 {
17466 char propName[1024];
17467 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17468
17469 if(prop)
17470 {
17471 char getName[1024], setName[1024];
17472 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17473
17474 DeclareProperty(prop, setName, getName);
17475 strcpy(propName, "__ecereProp_");
17476 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17477 strcat(propName, "_");
17478 FullClassNameCat(propName, prop->name, 0x1);
17479 MangleClassName(propName);
17480 ListAdd(args, CopyExpression(object));
17481 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17482 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17483 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17484 }
17485 else
17486 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17487 }
17488 }
17489 if(object)
17490 FreeExpression(object);
17491 if(watcher)
17492 FreeExpression(watcher);
17493 FreeList(watches, FreeIdentifier);
17494 }
17495 else
17496 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17497 }
17498 else
17499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17500 }
17501 break;
17502 }
17503 }
17504 }
17505
17506 extern struct Expression * QBrackets(struct Expression * exp);
17507
17508 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17509
17510 extern struct Declarator * QMkPtrDecl(char *  id);
17511
17512 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17513
17514 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17515
17516 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17517
17518 static void ProcessFunction(struct FunctionDefinition * function)
17519 {
17520 struct Identifier * id = GetDeclId(function->declarator);
17521 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17522 struct Type * type = symbol ? symbol->type : (((void *)0));
17523 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17524 struct Context * oldTopContext = topContext;
17525
17526 yylloc = function->loc;
17527 if(type && type->thisClass)
17528 {
17529 struct Symbol * classSym = type->thisClass;
17530 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17531 char className[1024];
17532 char structName[1024];
17533 struct Declarator * funcDecl;
17534 struct Symbol * thisSymbol;
17535 unsigned int typedObject = 0x0;
17536
17537 if(_class && !_class->base)
17538 {
17539 _class = currentClass;
17540 if(_class && !_class->symbol)
17541 _class->symbol = FindClass(_class->fullName);
17542 classSym = _class ? _class->symbol : (((void *)0));
17543 typedObject = 0x1;
17544 }
17545 thisClass = _class;
17546 if(inCompiler && _class)
17547 {
17548 if(type->kind == 11)
17549 {
17550 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17551 {
17552 struct Type * param = symbol->type->params.first;
17553
17554 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17555 FreeType(param);
17556 }
17557 if(type->classObjectType != 1)
17558 {
17559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17560 symbol->type->staticMethod = 0x1;
17561 symbol->type->thisClass = (((void *)0));
17562 symbol->type->extraParam = 0x0;
17563 }
17564 }
17565 strcpy(className, "__ecereClass_");
17566 FullClassNameCat(className, _class->fullName, 0x1);
17567 MangleClassName(className);
17568 structName[0] = (char)0;
17569 FullClassNameCat(structName, _class->fullName, 0x0);
17570 funcDecl = GetFuncDecl(function->declarator);
17571 if(funcDecl)
17572 {
17573 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17574 {
17575 struct TypeName * param = (*funcDecl->function.parameters).first;
17576
17577 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17578 {
17579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17580 FreeTypeName(param);
17581 }
17582 }
17583 if(!function->propertyNoThis)
17584 {
17585 struct TypeName * thisParam;
17586
17587 if(type->classObjectType != 1)
17588 {
17589 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17590 if(!funcDecl->function.parameters)
17591 funcDecl->function.parameters = MkList();
17592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17593 }
17594 if(typedObject)
17595 {
17596 if(type->classObjectType != 1)
17597 {
17598 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17599 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17600 }
17601 thisParam = __extension__ ({
17602 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17603
17604 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17605 });
17606 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17607 }
17608 }
17609 }
17610 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17611 {
17612 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17613
17614 funcDecl = GetFuncDecl(initDecl->declarator);
17615 if(funcDecl)
17616 {
17617 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17618 {
17619 struct TypeName * param = (*funcDecl->function.parameters).first;
17620
17621 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17622 {
17623 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17624 FreeTypeName(param);
17625 }
17626 }
17627 if(type->classObjectType != 1)
17628 {
17629 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17630 {
17631 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17632
17633 if(!funcDecl->function.parameters)
17634 funcDecl->function.parameters = MkList();
17635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17636 }
17637 }
17638 }
17639 }
17640 }
17641 if(function->body)
17642 {
17643 if(type->classObjectType != 1)
17644 {
17645 thisSymbol = __extension__ ({
17646 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17647
17648 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17649 });
17650 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17651 if(typedObject && thisSymbol->type)
17652 {
17653 thisSymbol->type->classObjectType = 2;
17654 thisSymbol->type->byReference = type->byReference;
17655 thisSymbol->type->typedByReference = type->byReference;
17656 }
17657 }
17658 }
17659 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17660 {
17661 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17662
17663 {
17664 struct __ecereNameSpace__ecere__com__Class * base;
17665
17666 for(base = _class; base && base->type != 1000; base = base->next)
17667 {
17668 for(member = base->membersAndProperties.first; member; member = member->next)
17669 if(!member->isProperty)
17670 break;
17671 if(member)
17672 break;
17673 }
17674 }
17675 for(member = _class->membersAndProperties.first; member; member = member->next)
17676 if(!member->isProperty)
17677 break;
17678 if(member)
17679 {
17680 char pointerName[1024];
17681 struct Declaration * decl;
17682 struct Initializer * initializer;
17683 struct Expression * exp, * bytePtr;
17684
17685 strcpy(pointerName, "__ecerePointer_");
17686 FullClassNameCat(pointerName, _class->fullName, 0x0);
17687 {
17688 char className[1024];
17689
17690 strcpy(className, "__ecereClass_");
17691 FullClassNameCat(className, classSym->string, 0x1);
17692 MangleClassName(className);
17693 DeclareClass(classSym, className);
17694 }
17695 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17696 if(_class->fixed)
17697 {
17698 char string[256];
17699
17700 sprintf(string, "%d", _class->offset);
17701 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17702 }
17703 else
17704 {
17705 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17706 }
17707 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17708 exp->expType = __extension__ ({
17709 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17710
17711 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17712 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17713
17714 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17715 }), __ecereInstance2;
17716 });
17717 if(function->body)
17718 {
17719 yylloc = function->body->loc;
17720 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17721 {
17722 struct Context * prevContext = curContext;
17723
17724 curContext = function->body->compound.context;
17725 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17726 curContext = prevContext;
17727 }
17728 decl->symbol = (((void *)0));
17729 if(!function->body->compound.declarations)
17730 function->body->compound.declarations = MkList();
17731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17732 }
17733 }
17734 }
17735 }
17736 else
17737 thisClass = (((void *)0));
17738 if(id)
17739 {
17740 FreeSpecifier(id->_class);
17741 id->_class = (((void *)0));
17742 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17743 {
17744 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17745
17746 id = GetDeclId(initDecl->declarator);
17747 FreeSpecifier(id->_class);
17748 id->_class = (((void *)0));
17749 }
17750 }
17751 if(function->body)
17752 topContext = function->body->compound.context;
17753 {
17754 struct FunctionDefinition * oldFunction = curFunction;
17755
17756 curFunction = function;
17757 if(function->body)
17758 ProcessStatement(function->body);
17759 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17760 {
17761 struct Statement * prevCompound = curCompound;
17762 struct Context * prevContext = curContext;
17763 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17764
17765 if(!function->body->compound.statements)
17766 function->body->compound.statements = MkList();
17767 ListAdd(function->body->compound.statements, fireWatchers);
17768 curCompound = function->body;
17769 curContext = function->body->compound.context;
17770 ProcessStatement(fireWatchers);
17771 curContext = prevContext;
17772 curCompound = prevCompound;
17773 }
17774 curFunction = oldFunction;
17775 }
17776 if(function->declarator)
17777 {
17778 ProcessDeclarator(function->declarator);
17779 }
17780 topContext = oldTopContext;
17781 thisClass = oldThisClass;
17782 }
17783
17784 extern void FreeSymbol(struct Symbol * symbol);
17785
17786 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17787
17788 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17789 {
17790 struct ClassDef * def;
17791 struct External * external = curExternal;
17792 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17793
17794 for(def = definitions->first; def; def = def->next)
17795 {
17796 if(def->type == 0)
17797 {
17798 if(def->function->declarator)
17799 curExternal = def->function->declarator->symbol->pointerExternal;
17800 else
17801 curExternal = external;
17802 ProcessFunction((struct FunctionDefinition *)def->function);
17803 }
17804 else if(def->type == 2)
17805 {
17806 if(def->decl->type == 2)
17807 {
17808 thisClass = regClass;
17809 ProcessInstantiationType(def->decl->inst);
17810 thisClass = (((void *)0));
17811 }
17812 else
17813 {
17814 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17815
17816 if(regClass)
17817 thisClass = regClass;
17818 ProcessDeclaration(def->decl);
17819 thisClass = backThisClass;
17820 }
17821 }
17822 else if(def->type == 1 && def->defProperties)
17823 {
17824 struct MemberInit * defProperty;
17825 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);
17826
17827 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17828 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17829 {
17830 thisClass = regClass;
17831 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17832 thisClass = (((void *)0));
17833 }
17834 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17835 FreeSymbol(thisSymbol);
17836 }
17837 else if(def->type == 3 && def->propertyDef)
17838 {
17839 struct PropertyDef * prop = def->propertyDef;
17840
17841 thisClass = regClass;
17842 if(prop->setStmt)
17843 {
17844 if(regClass)
17845 {
17846 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17847
17848 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17849 }
17850 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17851 ProcessStatement(prop->setStmt);
17852 }
17853 if(prop->getStmt)
17854 {
17855 if(regClass)
17856 {
17857 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17858
17859 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17860 }
17861 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17862 ProcessStatement(prop->getStmt);
17863 }
17864 if(prop->issetStmt)
17865 {
17866 if(regClass)
17867 {
17868 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17869
17870 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17871 }
17872 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17873 ProcessStatement(prop->issetStmt);
17874 }
17875 thisClass = (((void *)0));
17876 }
17877 else if(def->type == 4 && def->propertyWatch)
17878 {
17879 struct PropertyWatch * propertyWatch = def->propertyWatch;
17880
17881 thisClass = regClass;
17882 if(propertyWatch->compound)
17883 {
17884 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);
17885
17886 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17887 curExternal = (((void *)0));
17888 ProcessStatement(propertyWatch->compound);
17889 }
17890 thisClass = (((void *)0));
17891 }
17892 }
17893 }
17894
17895 void DeclareFunctionUtil(char * s)
17896 {
17897 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17898
17899 if(function)
17900 {
17901 char name[1024];
17902
17903 name[0] = (char)0;
17904 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17905 strcpy(name, "__ecereFunction_");
17906 FullClassNameCat(name, s, 0x0);
17907 DeclareFunction(function, name);
17908 }
17909 }
17910
17911 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17912
17913 void ComputeDataTypes()
17914 {
17915 struct External * external;
17916 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17917 struct External * after = (((void *)0));
17918
17919 currentClass = (((void *)0));
17920 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17921 for(external = (*ast).first; external; external = external->next)
17922 {
17923 if(external->type == 1)
17924 {
17925 struct Declaration * decl = external->declaration;
17926
17927 if(decl)
17928 {
17929 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17930
17931 if(decls)
17932 {
17933 struct InitDeclarator * initDecl = (*decls).first;
17934
17935 if(initDecl)
17936 {
17937 struct Declarator * declarator = initDecl->declarator;
17938
17939 if(declarator && declarator->type == 1)
17940 {
17941 struct Identifier * id = declarator->identifier;
17942
17943 if(id && id->string)
17944 {
17945 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17946 {
17947 external->symbol->id = -1001, external->symbol->idCode = -1001;
17948 after = external;
17949 }
17950 }
17951 }
17952 }
17953 }
17954 }
17955 }
17956 }
17957 temp->symbol = __extension__ ({
17958 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17959
17960 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17961 });
17962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17963 curExternal = temp;
17964 DeclareFunctionUtil("eSystem_New");
17965 DeclareFunctionUtil("eSystem_New0");
17966 DeclareFunctionUtil("eSystem_Renew");
17967 DeclareFunctionUtil("eSystem_Renew0");
17968 DeclareFunctionUtil("eClass_GetProperty");
17969 DeclareStruct("ecere::com::Class", 0x0);
17970 DeclareStruct("ecere::com::Instance", 0x0);
17971 DeclareStruct("ecere::com::Property", 0x0);
17972 DeclareStruct("ecere::com::DataMember", 0x0);
17973 DeclareStruct("ecere::com::Method", 0x0);
17974 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17975 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17976 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17977 for(external = (*ast).first; external; external = external->next)
17978 {
17979 afterExternal = curExternal = external;
17980 if(external->type == 0)
17981 {
17982 currentClass = external->function->_class;
17983 ProcessFunction(external->function);
17984 }
17985 else if(external->type == 1)
17986 {
17987 currentClass = (((void *)0));
17988 ProcessDeclaration(external->declaration);
17989 }
17990 else if(external->type == 2)
17991 {
17992 struct ClassDefinition * _class = external->_class;
17993
17994 currentClass = external->symbol->registered;
17995 if(_class->definitions)
17996 {
17997 ProcessClass(_class->definitions, _class->symbol);
17998 }
17999 if(inCompiler)
18000 {
18001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18002 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18003 }
18004 }
18005 else if(external->type == 4)
18006 {
18007 thisNameSpace = external->id->string;
18008 }
18009 }
18010 currentClass = (((void *)0));
18011 thisNameSpace = (((void *)0));
18012 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18013 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18014 }
18015
18016 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);
18017
18018 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18019
18020 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18021
18022 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18023 {
18024 struct __ecereNameSpace__ecere__com__Class * class;
18025
18026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
18062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18065 __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);
18066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18078 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18079 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18080 __ecereClass_Conversion = class;
18081 __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);
18082 __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);
18083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18084 __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);
18085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18103 }
18104
18105 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18106 {
18107
18108 }
18109