compiler/libec: Fixed missing cast assigning data to a MapIterator
[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_NamedLink64            (_64BIT ? 32 : 24)
44
45 struct __ecereNameSpace__ecere__com__Instance;
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
52
53 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
54
55 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
56
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
58
59 struct __ecereNameSpace__ecere__sys__BTNode;
60
61 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
62
63 struct __ecereNameSpace__ecere__sys__BinaryTree
64 {
65 struct __ecereNameSpace__ecere__sys__BTNode * root;
66 int count;
67 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
68 void (*  FreeKey)(void *  key);
69 } __attribute__ ((gcc_struct));
70
71 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
72
73 struct __ecereNameSpace__ecere__sys__OldList
74 {
75 void *  first;
76 void *  last;
77 int count;
78 unsigned int offset;
79 unsigned int circ;
80 } __attribute__ ((gcc_struct));
81
82 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
83
84 struct __ecereNameSpace__ecere__com__Method
85 {
86 const char *  name;
87 struct __ecereNameSpace__ecere__com__Method * parent;
88 struct __ecereNameSpace__ecere__com__Method * left;
89 struct __ecereNameSpace__ecere__com__Method * right;
90 int depth;
91 int (*  function)();
92 int vid;
93 int type;
94 struct __ecereNameSpace__ecere__com__Class * _class;
95 void *  symbol;
96 const char *  dataTypeString;
97 struct Type * dataType;
98 int memberAccess;
99 } __attribute__ ((gcc_struct));
100
101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
102
103 struct __ecereNameSpace__ecere__com__Property
104 {
105 struct __ecereNameSpace__ecere__com__Property * prev;
106 struct __ecereNameSpace__ecere__com__Property * next;
107 const char *  name;
108 unsigned int isProperty;
109 int memberAccess;
110 int id;
111 struct __ecereNameSpace__ecere__com__Class * _class;
112 const char *  dataTypeString;
113 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
114 struct Type * dataType;
115 void (*  Set)(void * , int);
116 int (*  Get)(void * );
117 unsigned int (*  IsSet)(void * );
118 void *  data;
119 void *  symbol;
120 int vid;
121 unsigned int conversion;
122 unsigned int watcherOffset;
123 const char *  category;
124 unsigned int compiled;
125 unsigned int selfWatchable;
126 unsigned int isWatchable;
127 } __attribute__ ((gcc_struct));
128
129 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
130
131 struct CodePosition
132 {
133 int line;
134 int charPos;
135 int pos;
136 int included;
137 } __attribute__ ((gcc_struct));
138
139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
140
141 struct Location
142 {
143 struct CodePosition start;
144 struct CodePosition end;
145 } __attribute__ ((gcc_struct));
146
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
148
149 struct Attrib;
150
151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
152
153 struct ExtDecl
154 {
155 struct Location loc;
156 int type;
157 union
158 {
159 char * s;
160 struct Attrib * attr;
161 } __attribute__ ((gcc_struct)) __anon1;
162 } __attribute__ ((gcc_struct));
163
164 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
165
166 struct ClassDefinition
167 {
168 struct ClassDefinition * prev;
169 struct ClassDefinition * next;
170 struct Location loc;
171 struct Specifier * _class;
172 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
173 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
174 struct Symbol * symbol;
175 struct Location blockStart;
176 struct Location nameLoc;
177 int endid;
178 int declMode;
179 unsigned int deleteWatchable;
180 } __attribute__ ((gcc_struct));
181
182 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
183
184 struct Context
185 {
186 struct Context * parent;
187 struct __ecereNameSpace__ecere__sys__BinaryTree types;
188 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
189 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
190 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
191 int nextID;
192 int simpleID;
193 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
194 struct ClassDefinition * classDef;
195 unsigned int templateTypesOnly;
196 unsigned int hasNameSpace;
197 } __attribute__ ((gcc_struct));
198
199 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
200
201 struct Instantiation
202 {
203 struct Instantiation * prev;
204 struct Instantiation * next;
205 struct Location loc;
206 struct Specifier * _class;
207 struct Expression * exp;
208 struct __ecereNameSpace__ecere__sys__OldList *  members;
209 struct Symbol * symbol;
210 unsigned int fullSet;
211 unsigned int isConstant;
212 unsigned char *  data;
213 struct Location nameLoc;
214 struct Location insideLoc;
215 unsigned int built;
216 } __attribute__ ((gcc_struct));
217
218 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
219
220 struct Declaration
221 {
222 struct Declaration * prev;
223 struct Declaration * next;
224 struct Location loc;
225 int type;
226 union
227 {
228 struct
229 {
230 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
231 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
232 } __attribute__ ((gcc_struct)) __anon1;
233 struct Instantiation * inst;
234 struct
235 {
236 struct Identifier * id;
237 struct Expression * exp;
238 } __attribute__ ((gcc_struct)) __anon2;
239 } __attribute__ ((gcc_struct)) __anon1;
240 struct Specifier * extStorage;
241 struct Symbol * symbol;
242 int declMode;
243 } __attribute__ ((gcc_struct));
244
245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
246
247 struct Statement
248 {
249 struct Statement * prev;
250 struct Statement * next;
251 struct Location loc;
252 int type;
253 union
254 {
255 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
256 struct
257 {
258 struct Identifier * id;
259 struct Statement * stmt;
260 } __attribute__ ((gcc_struct)) labeled;
261 struct
262 {
263 struct Expression * exp;
264 struct Statement * stmt;
265 } __attribute__ ((gcc_struct)) caseStmt;
266 struct
267 {
268 struct __ecereNameSpace__ecere__sys__OldList * declarations;
269 struct __ecereNameSpace__ecere__sys__OldList * statements;
270 struct Context * context;
271 unsigned int isSwitch;
272 } __attribute__ ((gcc_struct)) compound;
273 struct
274 {
275 struct __ecereNameSpace__ecere__sys__OldList * exp;
276 struct Statement * stmt;
277 struct Statement * elseStmt;
278 } __attribute__ ((gcc_struct)) ifStmt;
279 struct
280 {
281 struct __ecereNameSpace__ecere__sys__OldList * exp;
282 struct Statement * stmt;
283 } __attribute__ ((gcc_struct)) switchStmt;
284 struct
285 {
286 struct __ecereNameSpace__ecere__sys__OldList * exp;
287 struct Statement * stmt;
288 } __attribute__ ((gcc_struct)) whileStmt;
289 struct
290 {
291 struct __ecereNameSpace__ecere__sys__OldList * exp;
292 struct Statement * stmt;
293 } __attribute__ ((gcc_struct)) doWhile;
294 struct
295 {
296 struct Statement * init;
297 struct Statement * check;
298 struct __ecereNameSpace__ecere__sys__OldList * increment;
299 struct Statement * stmt;
300 } __attribute__ ((gcc_struct)) forStmt;
301 struct
302 {
303 struct Identifier * id;
304 } __attribute__ ((gcc_struct)) gotoStmt;
305 struct
306 {
307 struct Specifier * spec;
308 char * statements;
309 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
310 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
311 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
312 } __attribute__ ((gcc_struct)) asmStmt;
313 struct
314 {
315 struct Expression * watcher;
316 struct Expression * object;
317 struct __ecereNameSpace__ecere__sys__OldList * watches;
318 } __attribute__ ((gcc_struct)) _watch;
319 struct
320 {
321 struct Identifier * id;
322 struct __ecereNameSpace__ecere__sys__OldList * exp;
323 struct __ecereNameSpace__ecere__sys__OldList * filter;
324 struct Statement * stmt;
325 } __attribute__ ((gcc_struct)) forEachStmt;
326 struct Declaration * decl;
327 } __attribute__ ((gcc_struct)) __anon1;
328 } __attribute__ ((gcc_struct));
329
330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
331
332 struct TypeName
333 {
334 struct TypeName * prev;
335 struct TypeName * next;
336 struct Location loc;
337 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
338 struct Declarator * declarator;
339 int classObjectType;
340 struct Expression * bitCount;
341 } __attribute__ ((gcc_struct));
342
343 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
344
345 struct Initializer
346 {
347 struct Initializer * prev;
348 struct Initializer * next;
349 struct Location loc;
350 int type;
351 union
352 {
353 struct Expression * exp;
354 struct __ecereNameSpace__ecere__sys__OldList *  list;
355 } __attribute__ ((gcc_struct)) __anon1;
356 unsigned int isConstant;
357 struct Identifier * id;
358 } __attribute__ ((gcc_struct));
359
360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
361
362 struct __ecereNameSpace__ecere__com__DataValue
363 {
364 union
365 {
366 char c;
367 unsigned char uc;
368 short s;
369 unsigned short us;
370 int i;
371 unsigned int ui;
372 void *  p;
373 float f;
374 double d;
375 long long i64;
376 uint64 ui64;
377 } __attribute__ ((gcc_struct)) __anon1;
378 } __attribute__ ((gcc_struct));
379
380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
381
382 struct Expression
383 {
384 struct Expression * prev;
385 struct Expression * next;
386 struct Location loc;
387 int type;
388 union
389 {
390 struct
391 {
392 char *  constant;
393 struct Identifier * identifier;
394 } __attribute__ ((gcc_struct)) __anon1;
395 struct Statement * compound;
396 struct Instantiation * instance;
397 struct
398 {
399 char *  string;
400 unsigned int intlString;
401 } __attribute__ ((gcc_struct)) __anon2;
402 struct __ecereNameSpace__ecere__sys__OldList *  list;
403 struct
404 {
405 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
406 struct Declarator * decl;
407 } __attribute__ ((gcc_struct)) _classExp;
408 struct
409 {
410 struct Identifier * id;
411 } __attribute__ ((gcc_struct)) classData;
412 struct
413 {
414 struct Expression * exp;
415 struct __ecereNameSpace__ecere__sys__OldList * arguments;
416 struct Location argLoc;
417 } __attribute__ ((gcc_struct)) call;
418 struct
419 {
420 struct Expression * exp;
421 struct __ecereNameSpace__ecere__sys__OldList * index;
422 } __attribute__ ((gcc_struct)) index;
423 struct
424 {
425 struct Expression * exp;
426 struct Identifier * member;
427 int memberType;
428 unsigned int thisPtr;
429 } __attribute__ ((gcc_struct)) member;
430 struct
431 {
432 int op;
433 struct Expression * exp1;
434 struct Expression * exp2;
435 } __attribute__ ((gcc_struct)) op;
436 struct TypeName * typeName;
437 struct Specifier * _class;
438 struct
439 {
440 struct TypeName * typeName;
441 struct Expression * exp;
442 } __attribute__ ((gcc_struct)) cast;
443 struct
444 {
445 struct Expression * cond;
446 struct __ecereNameSpace__ecere__sys__OldList * exp;
447 struct Expression * elseExp;
448 } __attribute__ ((gcc_struct)) cond;
449 struct
450 {
451 struct TypeName * typeName;
452 struct Expression * size;
453 } __attribute__ ((gcc_struct)) _new;
454 struct
455 {
456 struct TypeName * typeName;
457 struct Expression * size;
458 struct Expression * exp;
459 } __attribute__ ((gcc_struct)) _renew;
460 struct
461 {
462 char * table;
463 struct Identifier * id;
464 } __attribute__ ((gcc_struct)) db;
465 struct
466 {
467 struct Expression * ds;
468 struct Expression * name;
469 } __attribute__ ((gcc_struct)) dbopen;
470 struct
471 {
472 struct TypeName * typeName;
473 struct Initializer * initializer;
474 } __attribute__ ((gcc_struct)) initializer;
475 struct
476 {
477 struct Expression * exp;
478 struct TypeName * typeName;
479 } __attribute__ ((gcc_struct)) vaArg;
480 } __attribute__ ((gcc_struct)) __anon1;
481 unsigned int debugValue;
482 struct __ecereNameSpace__ecere__com__DataValue val;
483 uint64 address;
484 unsigned int hasAddress;
485 struct Type * expType;
486 struct Type * destType;
487 unsigned int usage;
488 int tempCount;
489 unsigned int byReference;
490 unsigned int isConstant;
491 unsigned int addedThis;
492 unsigned int needCast;
493 unsigned int thisPtr;
494 unsigned int opDestType;
495 unsigned int needTemplateCast;
496 } __attribute__ ((gcc_struct));
497
498 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
499
500 struct TemplateDatatype
501 {
502 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
503 struct Declarator * decl;
504 } __attribute__ ((gcc_struct));
505
506 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
507
508 struct TemplateArgument;
509
510 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
511
512 struct TemplateParameter
513 {
514 struct TemplateParameter * prev;
515 struct TemplateParameter * next;
516 struct Location loc;
517 int type;
518 struct Identifier * identifier;
519 union
520 {
521 struct TemplateDatatype * dataType;
522 int memberType;
523 } __attribute__ ((gcc_struct)) __anon1;
524 struct TemplateArgument * defaultArgument;
525 const char *  dataTypeString;
526 struct Type * baseType;
527 } __attribute__ ((gcc_struct));
528
529 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
530
531 struct Specifier
532 {
533 struct Specifier * prev;
534 struct Specifier * next;
535 struct Location loc;
536 int type;
537 union
538 {
539 int specifier;
540 struct
541 {
542 struct ExtDecl * extDecl;
543 char *  name;
544 struct Symbol * symbol;
545 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
546 } __attribute__ ((gcc_struct)) __anon1;
547 struct
548 {
549 struct Identifier * id;
550 struct __ecereNameSpace__ecere__sys__OldList *  list;
551 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
552 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
553 unsigned int addNameSpace;
554 struct Context * ctx;
555 struct ExtDecl * extDeclStruct;
556 } __attribute__ ((gcc_struct)) __anon2;
557 struct Expression * expression;
558 struct Specifier * _class;
559 struct TemplateParameter * templateParameter;
560 } __attribute__ ((gcc_struct)) __anon1;
561 } __attribute__ ((gcc_struct));
562
563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
564
565 struct Identifier
566 {
567 struct Identifier * prev;
568 struct Identifier * next;
569 struct Location loc;
570 struct Symbol * classSym;
571 struct Specifier * _class;
572 char *  string;
573 struct Identifier * badID;
574 } __attribute__ ((gcc_struct));
575
576 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
577
578 struct Pointer;
579
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
581
582 struct Declarator
583 {
584 struct Declarator * prev;
585 struct Declarator * next;
586 struct Location loc;
587 int type;
588 struct Symbol * symbol;
589 struct Declarator * declarator;
590 union
591 {
592 struct Identifier * identifier;
593 struct
594 {
595 struct Expression * exp;
596 struct Expression * posExp;
597 struct Attrib * attrib;
598 } __attribute__ ((gcc_struct)) structDecl;
599 struct
600 {
601 struct Expression * exp;
602 struct Specifier * enumClass;
603 } __attribute__ ((gcc_struct)) array;
604 struct
605 {
606 struct __ecereNameSpace__ecere__sys__OldList * parameters;
607 } __attribute__ ((gcc_struct)) function;
608 struct
609 {
610 struct Pointer * pointer;
611 } __attribute__ ((gcc_struct)) pointer;
612 struct
613 {
614 struct ExtDecl * extended;
615 } __attribute__ ((gcc_struct)) extended;
616 } __attribute__ ((gcc_struct)) __anon1;
617 } __attribute__ ((gcc_struct));
618
619 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
620
621 struct FunctionDefinition
622 {
623 struct FunctionDefinition * prev;
624 struct FunctionDefinition * next;
625 struct Location loc;
626 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
627 struct Declarator * declarator;
628 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
629 struct Statement * body;
630 struct __ecereNameSpace__ecere__com__Class * _class;
631 struct __ecereNameSpace__ecere__sys__OldList attached;
632 int declMode;
633 struct Type * type;
634 struct Symbol * propSet;
635 int tempCount;
636 unsigned int propertyNoThis;
637 } __attribute__ ((gcc_struct));
638
639 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
640
641 struct DBTableDef;
642
643 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
644
645 struct External
646 {
647 struct External * prev;
648 struct External * next;
649 struct Location loc;
650 int type;
651 struct Symbol * symbol;
652 union
653 {
654 struct FunctionDefinition * function;
655 struct ClassDefinition * _class;
656 struct Declaration * declaration;
657 char *  importString;
658 struct Identifier * id;
659 struct DBTableDef * table;
660 } __attribute__ ((gcc_struct)) __anon1;
661 int importType;
662 } __attribute__ ((gcc_struct));
663
664 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
665
666 struct ModuleImport
667 {
668 struct ModuleImport * prev;
669 struct ModuleImport * next;
670 char *  name;
671 struct __ecereNameSpace__ecere__sys__OldList classes;
672 struct __ecereNameSpace__ecere__sys__OldList functions;
673 int importType;
674 int importAccess;
675 } __attribute__ ((gcc_struct));
676
677 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
678
679 struct ClassImport
680 {
681 struct ClassImport * prev;
682 struct ClassImport * next;
683 char *  name;
684 struct __ecereNameSpace__ecere__sys__OldList methods;
685 struct __ecereNameSpace__ecere__sys__OldList properties;
686 unsigned int itself;
687 int isRemote;
688 } __attribute__ ((gcc_struct));
689
690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
691
692 struct Symbol
693 {
694 char *  string;
695 struct Symbol * parent;
696 struct Symbol * left;
697 struct Symbol * right;
698 int depth;
699 struct Type * type;
700 union
701 {
702 struct __ecereNameSpace__ecere__com__Method * method;
703 struct __ecereNameSpace__ecere__com__Property * _property;
704 struct __ecereNameSpace__ecere__com__Class * registered;
705 } __attribute__ ((gcc_struct)) __anon1;
706 int id;
707 int idCode;
708 union
709 {
710 struct
711 {
712 struct External * pointerExternal;
713 struct External * structExternal;
714 } __attribute__ ((gcc_struct)) __anon1;
715 struct
716 {
717 struct External * externalGet;
718 struct External * externalSet;
719 struct External * externalPtr;
720 struct External * externalIsSet;
721 } __attribute__ ((gcc_struct)) __anon2;
722 struct
723 {
724 struct External * methodExternal;
725 struct External * methodCodeExternal;
726 } __attribute__ ((gcc_struct)) __anon3;
727 } __attribute__ ((gcc_struct)) __anon2;
728 unsigned int imported;
729 unsigned int declaredStructSym;
730 struct __ecereNameSpace__ecere__com__Class * _class;
731 unsigned int declaredStruct;
732 unsigned int needConstructor;
733 unsigned int needDestructor;
734 char *  constructorName;
735 char *  structName;
736 char *  className;
737 char *  destructorName;
738 struct ModuleImport * module;
739 struct ClassImport * _import;
740 struct Location nameLoc;
741 unsigned int isParam;
742 unsigned int isRemote;
743 unsigned int isStruct;
744 unsigned int fireWatchersDone;
745 int declaring;
746 unsigned int classData;
747 unsigned int isStatic;
748 char *  shortName;
749 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
750 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
751 struct Context * ctx;
752 int isIterator;
753 struct Expression * propCategory;
754 } __attribute__ ((gcc_struct));
755
756 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
757
758 struct Type
759 {
760 struct Type * prev;
761 struct Type * next;
762 int refCount;
763 union
764 {
765 struct Symbol * _class;
766 struct
767 {
768 struct __ecereNameSpace__ecere__sys__OldList members;
769 char *  enumName;
770 } __attribute__ ((gcc_struct)) __anon1;
771 struct
772 {
773 struct Type * returnType;
774 struct __ecereNameSpace__ecere__sys__OldList params;
775 struct Symbol * thisClass;
776 unsigned int staticMethod;
777 struct TemplateParameter * thisClassTemplate;
778 } __attribute__ ((gcc_struct)) __anon2;
779 struct
780 {
781 struct __ecereNameSpace__ecere__com__Method * method;
782 struct __ecereNameSpace__ecere__com__Class * methodClass;
783 struct __ecereNameSpace__ecere__com__Class * usedClass;
784 } __attribute__ ((gcc_struct)) __anon3;
785 struct
786 {
787 struct Type * arrayType;
788 int arraySize;
789 struct Expression * arraySizeExp;
790 unsigned int freeExp;
791 struct Symbol * enumClass;
792 } __attribute__ ((gcc_struct)) __anon4;
793 struct Type * type;
794 struct TemplateParameter * templateParameter;
795 } __attribute__ ((gcc_struct)) __anon1;
796 int kind;
797 unsigned int size;
798 char *  name;
799 char *  typeName;
800 int classObjectType;
801 int alignment;
802 unsigned int offset;
803 int bitFieldCount;
804 int count;
805 unsigned int isSigned : 1;
806 unsigned int constant : 1;
807 unsigned int truth : 1;
808 unsigned int byReference : 1;
809 unsigned int extraParam : 1;
810 unsigned int directClassAccess : 1;
811 unsigned int computing : 1;
812 unsigned int keepCast : 1;
813 unsigned int passAsTemplate : 1;
814 unsigned int dllExport : 1;
815 unsigned int attrStdcall : 1;
816 unsigned int declaredWithStruct : 1;
817 unsigned int typedByReference : 1;
818 unsigned int casted : 1;
819 } __attribute__ ((gcc_struct));
820
821 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
822
823 struct __ecereNameSpace__ecere__com__Class
824 {
825 struct __ecereNameSpace__ecere__com__Class * prev;
826 struct __ecereNameSpace__ecere__com__Class * next;
827 const char *  name;
828 int offset;
829 int structSize;
830 int (* *  _vTbl)();
831 int vTblSize;
832 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
833 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
834 int offsetClass;
835 int sizeClass;
836 struct __ecereNameSpace__ecere__com__Class * base;
837 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
838 struct __ecereNameSpace__ecere__sys__BinaryTree members;
839 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
840 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
841 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
842 struct __ecereNameSpace__ecere__sys__OldList derivatives;
843 int memberID;
844 int startMemberID;
845 int type;
846 struct __ecereNameSpace__ecere__com__Instance * module;
847 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
848 const char *  dataTypeString;
849 struct Type * dataType;
850 int typeSize;
851 int defaultAlignment;
852 void (*  Initialize)();
853 int memberOffset;
854 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
855 const char *  designerClass;
856 unsigned int noExpansion;
857 const char *  defaultProperty;
858 unsigned int comRedefinition;
859 int count;
860 int isRemote;
861 unsigned int internalDecl;
862 void *  data;
863 unsigned int computeSize;
864 int structAlignment;
865 int destructionWatchOffset;
866 unsigned int fixed;
867 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
868 int inheritanceAccess;
869 const char *  fullName;
870 void *  symbol;
871 struct __ecereNameSpace__ecere__sys__OldList conversions;
872 struct __ecereNameSpace__ecere__sys__OldList templateParams;
873 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
874 struct __ecereNameSpace__ecere__com__Class * templateClass;
875 struct __ecereNameSpace__ecere__sys__OldList templatized;
876 int numParams;
877 unsigned int isInstanceClass;
878 unsigned int byValueSystemClass;
879 } __attribute__ ((gcc_struct));
880
881 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
882
883 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
884
885 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
886
887 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
888
889 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
890
891 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
892
893 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
894
895 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
896
897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
898
899 struct __ecereNameSpace__ecere__com__Instance
900 {
901 int (* *  _vTbl)();
902 struct __ecereNameSpace__ecere__com__Class * _class;
903 int _refCount;
904 } __attribute__ ((gcc_struct));
905
906 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
907
908 struct __ecereNameSpace__ecere__com__DataMember
909 {
910 struct __ecereNameSpace__ecere__com__DataMember * prev;
911 struct __ecereNameSpace__ecere__com__DataMember * next;
912 const char *  name;
913 unsigned int isProperty;
914 int memberAccess;
915 int id;
916 struct __ecereNameSpace__ecere__com__Class * _class;
917 const char *  dataTypeString;
918 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
919 struct Type * dataType;
920 int type;
921 int offset;
922 int memberID;
923 struct __ecereNameSpace__ecere__sys__OldList members;
924 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
925 int memberOffset;
926 int structAlignment;
927 } __attribute__ ((gcc_struct));
928
929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
930
931 struct __ecereNameSpace__ecere__com__SerialBuffer
932 {
933 unsigned char *  _buffer;
934 unsigned int count;
935 unsigned int _size;
936 unsigned int pos;
937 } __attribute__ ((gcc_struct));
938
939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
940
941 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
942 {
943 union
944 {
945 struct
946 {
947 const char *  dataTypeString;
948 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
949 } __attribute__ ((gcc_struct)) __anon1;
950 struct __ecereNameSpace__ecere__com__DataValue expression;
951 struct
952 {
953 const char *  memberString;
954 union
955 {
956 struct __ecereNameSpace__ecere__com__DataMember * member;
957 struct __ecereNameSpace__ecere__com__Property * prop;
958 struct __ecereNameSpace__ecere__com__Method * method;
959 } __attribute__ ((gcc_struct)) __anon1;
960 } __attribute__ ((gcc_struct)) __anon2;
961 } __attribute__ ((gcc_struct)) __anon1;
962 } __attribute__ ((gcc_struct));
963
964 void exit(int status);
965
966 void * calloc(size_t nmemb, size_t size);
967
968 void free(void * ptr);
969
970 void * malloc(size_t size);
971
972 void * realloc(void * ptr, size_t size);
973
974 long int strtol(const char * nptr, char ** endptr, int base);
975
976 long long int strtoll(const char * nptr, char ** endptr, int base);
977
978 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
979
980 enum yytokentype
981 {
982 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
983 };
984
985 typedef union YYSTYPE
986 {
987 int specifierType;
988 int i;
989 int declMode;
990 struct Identifier * id;
991 struct Expression * exp;
992 struct Specifier * specifier;
993 struct __ecereNameSpace__ecere__sys__OldList * list;
994 struct Enumerator * enumerator;
995 struct Declarator * declarator;
996 struct Pointer * pointer;
997 struct Initializer * initializer;
998 struct InitDeclarator * initDeclarator;
999 struct TypeName * typeName;
1000 struct Declaration * declaration;
1001 struct Statement * stmt;
1002 struct FunctionDefinition * function;
1003 struct External * external;
1004 struct Context * context;
1005 struct AsmField * asmField;
1006 struct Attrib * attrib;
1007 struct ExtDecl * extDecl;
1008 struct Attribute * attribute;
1009 struct Instantiation * instance;
1010 struct MembersInit * membersInit;
1011 struct MemberInit * memberInit;
1012 struct ClassFunction * classFunction;
1013 struct ClassDefinition * _class;
1014 struct ClassDef * classDef;
1015 struct PropertyDef * prop;
1016 char * string;
1017 struct Symbol * symbol;
1018 struct PropertyWatch * propertyWatch;
1019 struct TemplateParameter * templateParameter;
1020 struct TemplateArgument * templateArgument;
1021 struct TemplateDatatype * templateDatatype;
1022 struct DBTableEntry * dbtableEntry;
1023 struct DBIndexItem * dbindexItem;
1024 struct DBTableDef * dbtableDef;
1025 } __attribute__ ((gcc_struct)) YYSTYPE;
1026
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1028
1029 struct Enumerator
1030 {
1031 struct Enumerator * prev;
1032 struct Enumerator * next;
1033 struct Location loc;
1034 struct Identifier * id;
1035 struct Expression * exp;
1036 } __attribute__ ((gcc_struct));
1037
1038 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1039
1040 struct InitDeclarator
1041 {
1042 struct InitDeclarator * prev;
1043 struct InitDeclarator * next;
1044 struct Location loc;
1045 struct Declarator * declarator;
1046 struct Initializer * initializer;
1047 } __attribute__ ((gcc_struct));
1048
1049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1050
1051 struct AsmField
1052 {
1053 struct AsmField * prev;
1054 struct AsmField * next;
1055 struct Location loc;
1056 char *  command;
1057 struct Expression * expression;
1058 struct Identifier * symbolic;
1059 } __attribute__ ((gcc_struct));
1060
1061 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1062
1063 struct Attribute;
1064
1065 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1066
1067 struct ClassFunction
1068 {
1069 struct ClassFunction * prev;
1070 struct ClassFunction * next;
1071 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1073 struct Declarator * declarator;
1074 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1075 struct Statement * body;
1076 struct __ecereNameSpace__ecere__com__Class * _class;
1077 struct __ecereNameSpace__ecere__sys__OldList attached;
1078 int declMode;
1079 struct Type * type;
1080 struct Symbol * propSet;
1081 unsigned int isVirtual;
1082 unsigned int isConstructor;
1083 unsigned int isDestructor;
1084 unsigned int dontMangle;
1085 int id;
1086 int idCode;
1087 } __attribute__ ((gcc_struct));
1088
1089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1090
1091 struct MembersInit
1092 {
1093 struct MembersInit * prev;
1094 struct MembersInit * next;
1095 struct Location loc;
1096 int type;
1097 union
1098 {
1099 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1100 struct ClassFunction * function;
1101 } __attribute__ ((gcc_struct)) __anon1;
1102 } __attribute__ ((gcc_struct));
1103
1104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1105
1106 struct MemberInit
1107 {
1108 struct MemberInit * prev;
1109 struct MemberInit * next;
1110 struct Location loc;
1111 struct Location realLoc;
1112 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1113 struct Initializer * initializer;
1114 unsigned int used;
1115 unsigned int variable;
1116 unsigned int takeOutExp;
1117 } __attribute__ ((gcc_struct));
1118
1119 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1120
1121 struct PropertyDef
1122 {
1123 struct PropertyDef * prev;
1124 struct PropertyDef * next;
1125 struct Location loc;
1126 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1127 struct Declarator * declarator;
1128 struct Identifier * id;
1129 struct Statement * getStmt;
1130 struct Statement * setStmt;
1131 struct Statement * issetStmt;
1132 struct Symbol * symbol;
1133 struct Expression * category;
1134 struct
1135 {
1136 unsigned int conversion : 1;
1137 unsigned int isWatchable : 1;
1138 unsigned int isDBProp : 1;
1139 } __attribute__ ((gcc_struct)) __anon1;
1140 } __attribute__ ((gcc_struct));
1141
1142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1143
1144 struct PropertyWatch
1145 {
1146 struct PropertyWatch * prev;
1147 struct PropertyWatch * next;
1148 struct Location loc;
1149 struct Statement * compound;
1150 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1151 unsigned int deleteWatch;
1152 } __attribute__ ((gcc_struct));
1153
1154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1155
1156 struct ClassDef
1157 {
1158 struct ClassDef * prev;
1159 struct ClassDef * next;
1160 struct Location loc;
1161 int type;
1162 union
1163 {
1164 struct Declaration * decl;
1165 struct ClassFunction * function;
1166 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1167 struct PropertyDef * propertyDef;
1168 struct PropertyWatch * propertyWatch;
1169 char *  designer;
1170 struct Identifier * defaultProperty;
1171 struct
1172 {
1173 struct Identifier * id;
1174 struct Initializer * initializer;
1175 } __attribute__ ((gcc_struct)) __anon1;
1176 } __attribute__ ((gcc_struct)) __anon1;
1177 int memberAccess;
1178 void *  object;
1179 } __attribute__ ((gcc_struct));
1180
1181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1182
1183 struct DBTableEntry;
1184
1185 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1186
1187 struct DBIndexItem;
1188
1189 extern YYSTYPE yylval;
1190
1191 extern struct Location yylloc;
1192
1193 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1194
1195 extern int returnCode;
1196
1197 extern struct Expression * parsedExpression;
1198
1199 extern unsigned int yydebug;
1200
1201 void SetYydebug(unsigned int b)
1202 {
1203 yydebug = b;
1204 }
1205
1206 extern unsigned int echoOn;
1207
1208 void resetScanner();
1209
1210 int propWatcherID;
1211
1212 int expression_yyparse();
1213
1214 static struct Statement * curCompound;
1215
1216 struct External * curExternal, * afterExternal;
1217
1218 static struct Type * curSwitchType;
1219
1220 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1221
1222 struct __ecereNameSpace__ecere__com__Class * thisClass;
1223
1224 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1225 {
1226 thisClass = c;
1227 }
1228
1229 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1230 {
1231 return thisClass;
1232 }
1233
1234 static char * thisNameSpace;
1235
1236 struct __ecereNameSpace__ecere__com__Class * containerClass;
1237
1238 unsigned int thisClassParams = 1;
1239
1240 unsigned int internalValueCounter;
1241
1242 extern unsigned int outputLineNumbers;
1243
1244 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1245
1246 extern size_t strlen(const char * );
1247
1248 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1249
1250 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1251
1252 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1253
1254 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1255
1256 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1257
1258 void PrintExpression(struct Expression * exp, char * string)
1259 {
1260 {
1261 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1262 int count;
1263 unsigned int backOutputLineNumbers = outputLineNumbers;
1264
1265 outputLineNumbers = 0;
1266 if(exp)
1267 OutputExpression(exp, f);
1268 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1269 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1270
1271 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1272 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1273 count = strlen(string);
1274 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1275 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1276
1277 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1278 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1279 string[count] = '\0';
1280 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1281 outputLineNumbers = backOutputLineNumbers;
1282 }
1283 }
1284
1285 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1286
1287 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1288
1289 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1290 {
1291 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1292 {
1293 if(!param->baseType)
1294 {
1295 if(param->dataTypeString)
1296 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1297 else
1298 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1299 }
1300 return param->baseType;
1301 }
1302 return (((void *)0));
1303 }
1304
1305 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1306 {
1307 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1308 return 1;
1309 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1310 {
1311 return 0;
1312 }
1313 if(type1->kind == type2->kind)
1314 {
1315 switch(type1->kind)
1316 {
1317 case 24:
1318 case 1:
1319 case 2:
1320 case 3:
1321 case 4:
1322 case 22:
1323 case 23:
1324 if(type1->passAsTemplate && !type2->passAsTemplate)
1325 return 1;
1326 return type1->isSigned != type2->isSigned;
1327 case 8:
1328 return type1->__anon1._class != type2->__anon1._class;
1329 case 13:
1330 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1331 default:
1332 return 1;
1333 }
1334 }
1335 return 1;
1336 }
1337
1338 extern int strcmp(const char * , const char * );
1339
1340 extern struct Context * curContext;
1341
1342 extern struct Context * topContext;
1343
1344 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1345
1346 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1347
1348 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1349
1350 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1351
1352 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1353
1354 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1355
1356 struct __ecereNameSpace__ecere__com__ClassProperty
1357 {
1358 const char *  name;
1359 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1360 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1361 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1362 int depth;
1363 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1364 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1365 const char *  dataTypeString;
1366 struct Type * dataType;
1367 unsigned int constant;
1368 } __attribute__ ((gcc_struct));
1369
1370 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1371
1372 extern struct Expression * QMkExpId(const char *  id);
1373
1374 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1375
1376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1377 {
1378 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1379 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1380 const char *  name;
1381 int type;
1382 union
1383 {
1384 const char *  dataTypeString;
1385 int memberType;
1386 } __attribute__ ((gcc_struct)) __anon1;
1387 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1388 void *  param;
1389 } __attribute__ ((gcc_struct));
1390
1391 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1392
1393 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1394
1395 extern void FreeIdentifier(struct Identifier * id);
1396
1397 void ProcessExpressionType(struct Expression * exp);
1398
1399 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1400
1401 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1402
1403 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1404
1405 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1406
1407 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1408
1409 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1410
1411 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1412
1413 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1414
1415 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1416 {
1417 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1418 {
1419 struct Identifier * id = exp->__anon1.__anon1.identifier;
1420 struct Context * ctx;
1421 struct Symbol * symbol = (((void *)0));
1422
1423 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1424 {
1425 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1426 {
1427 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1428 if(symbol)
1429 break;
1430 }
1431 }
1432 if(!symbol && ((!id->_class || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->__anon1.registered))))
1433 {
1434 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1435 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1436 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1437 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1438
1439 if(!prop)
1440 {
1441 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1442 }
1443 if(!prop && !method)
1444 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1445 if(!prop && !method && !member)
1446 {
1447 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1448 }
1449 if(prop || method || member || classProp)
1450 {
1451 exp->type = 8;
1452 exp->__anon1.member.member = id;
1453 exp->__anon1.member.memberType = 0;
1454 exp->__anon1.member.exp = QMkExpId("this");
1455 exp->addedThis = 1;
1456 }
1457 else if(_class && _class->templateParams.first)
1458 {
1459 struct __ecereNameSpace__ecere__com__Class * sClass;
1460
1461 for(sClass = _class; sClass; sClass = sClass->base)
1462 {
1463 if(sClass->templateParams.first)
1464 {
1465 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1466
1467 for(param = sClass->templateParams.first; param; param = param->next)
1468 {
1469 if(param->type == 2 && !strcmp(param->name, id->string))
1470 {
1471 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1472
1473 if(argExp)
1474 {
1475 struct Declarator * decl;
1476 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1477
1478 FreeIdentifier(exp->__anon1.member.member);
1479 ProcessExpressionType(argExp);
1480 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1481 exp->expType = ProcessType(specs, decl);
1482 exp->type = 5;
1483 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1484 }
1485 }
1486 }
1487 }
1488 }
1489 }
1490 }
1491 }
1492 }
1493
1494 extern int sprintf(char * , const char * , ...);
1495
1496 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1497
1498 extern char *  strcat(char * , const char * );
1499
1500 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1501
1502 char * PrintInt(long long result)
1503 {
1504 char temp[100];
1505
1506 if(result > (((int)0x7fffffff)))
1507 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1508 else
1509 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1510 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1511 strcat(temp, "LL");
1512 return __ecereNameSpace__ecere__sys__CopyString(temp);
1513 }
1514
1515 char * PrintUInt(uint64 result)
1516 {
1517 char temp[100];
1518
1519 if(result > (0xffffffff))
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1521 else if(result > (((int)0x7fffffff)))
1522 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1523 else
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1525 return __ecereNameSpace__ecere__sys__CopyString(temp);
1526 }
1527
1528 char * PrintInt64(long long result)
1529 {
1530 char temp[100];
1531
1532 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1533 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1534 else
1535 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1536 return __ecereNameSpace__ecere__sys__CopyString(temp);
1537 }
1538
1539 char * PrintUInt64(uint64 result)
1540 {
1541 char temp[100];
1542
1543 if(result > (0xffffffff))
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1545 else if(result > (((int)0x7fffffff)))
1546 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1547 else
1548 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1549 return __ecereNameSpace__ecere__sys__CopyString(temp);
1550 }
1551
1552 char * PrintHexUInt(uint64 result)
1553 {
1554 char temp[100];
1555
1556 if(result > (0xffffffff))
1557 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1558 else
1559 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1560 if(result > (0xffffffff))
1561 strcat(temp, "LL");
1562 return __ecereNameSpace__ecere__sys__CopyString(temp);
1563 }
1564
1565 char * PrintHexUInt64(uint64 result)
1566 {
1567 char temp[100];
1568
1569 if(result > (0xffffffff))
1570 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1571 else
1572 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 }
1575
1576 char * PrintShort(short result)
1577 {
1578 char temp[100];
1579
1580 sprintf(temp, "%d", (unsigned short)result);
1581 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 }
1583
1584 char * PrintUShort(unsigned short result)
1585 {
1586 char temp[100];
1587
1588 if(result > (unsigned short)32767)
1589 sprintf(temp, "0x%X", (int)result);
1590 else
1591 sprintf(temp, "%d", (int)result);
1592 return __ecereNameSpace__ecere__sys__CopyString(temp);
1593 }
1594
1595 extern int isprint(int c);
1596
1597 char * PrintChar(char result)
1598 {
1599 char temp[100];
1600
1601 if(result > (char)0 && isprint(result))
1602 sprintf(temp, "'%c'", result);
1603 else if(result < (char)0)
1604 sprintf(temp, "%d", (int)result);
1605 else
1606 sprintf(temp, "0x%X", (unsigned char)result);
1607 return __ecereNameSpace__ecere__sys__CopyString(temp);
1608 }
1609
1610 char * PrintUChar(unsigned char result)
1611 {
1612 char temp[100];
1613
1614 sprintf(temp, "0x%X", result);
1615 return __ecereNameSpace__ecere__sys__CopyString(temp);
1616 }
1617
1618 extern char *  strcpy(char * , const char * );
1619
1620 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1621
1622 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1623
1624 extern int (* __ecereProp_float_Get_signBit)(float this);
1625
1626 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1627
1628 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1629
1630 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1631
1632 char * PrintFloat(float result)
1633 {
1634 char temp[350];
1635
1636 if(__ecereProp_float_Get_isInf(result))
1637 {
1638 if(__ecereProp_float_Get_signBit(result))
1639 strcpy(temp, "-inf");
1640 else
1641 strcpy(temp, "inf");
1642 }
1643 else if(__ecereProp_float_Get_isNan(result))
1644 {
1645 if(__ecereProp_float_Get_signBit(result))
1646 strcpy(temp, "-nan");
1647 else
1648 strcpy(temp, "nan");
1649 }
1650 else
1651 sprintf(temp, "%.16ff", result);
1652 return __ecereNameSpace__ecere__sys__CopyString(temp);
1653 }
1654
1655 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1656
1657 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1658
1659 extern int (* __ecereProp_double_Get_signBit)(double this);
1660
1661 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1662
1663 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1664
1665 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1666
1667 char * PrintDouble(double result)
1668 {
1669 char temp[350];
1670
1671 if(__ecereProp_double_Get_isInf(result))
1672 {
1673 if(__ecereProp_double_Get_signBit(result))
1674 strcpy(temp, "-inf");
1675 else
1676 strcpy(temp, "inf");
1677 }
1678 else if(__ecereProp_double_Get_isNan(result))
1679 {
1680 if(__ecereProp_double_Get_signBit(result))
1681 strcpy(temp, "-nan");
1682 else
1683 strcpy(temp, "nan");
1684 }
1685 else
1686 sprintf(temp, "%.16f", result);
1687 return __ecereNameSpace__ecere__sys__CopyString(temp);
1688 }
1689
1690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1691
1692 struct OpTable
1693 {
1694 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1700 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1701 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1702 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1714 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  Not)(struct Expression *, struct Operand *);
1720 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1725 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1728 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1729 } __attribute__ ((gcc_struct));
1730
1731 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1732
1733 struct Operand
1734 {
1735 int kind;
1736 struct Type * type;
1737 unsigned int ptrSize;
1738 union
1739 {
1740 char c;
1741 unsigned char uc;
1742 short s;
1743 unsigned short us;
1744 int i;
1745 unsigned int ui;
1746 float f;
1747 double d;
1748 long long i64;
1749 uint64 ui64;
1750 } __attribute__ ((gcc_struct)) __anon1;
1751 struct OpTable ops;
1752 } __attribute__ ((gcc_struct));
1753
1754 unsigned int GetOpInt(struct Operand * op2, int * value2)
1755 {
1756 if(op2->kind == 3 && op2->type->isSigned)
1757 *value2 = op2->__anon1.i;
1758 else if(op2->kind == 3)
1759 *value2 = (int)op2->__anon1.ui;
1760 else if(op2->kind == 4 && op2->type->isSigned)
1761 *value2 = (int)op2->__anon1.i64;
1762 else if(op2->kind == 4)
1763 *value2 = (int)op2->__anon1.ui64;
1764 else if(op2->kind == 23 && op2->type->isSigned)
1765 *value2 = (int)op2->__anon1.i64;
1766 else if(op2->kind == 23)
1767 *value2 = (int)op2->__anon1.ui64;
1768 else if(op2->kind == 22 && op2->type->isSigned)
1769 *value2 = (int)op2->__anon1.i64;
1770 else if(op2->kind == 22)
1771 *value2 = (int)op2->__anon1.ui64;
1772 else if(op2->kind == 2 && op2->type->isSigned)
1773 *value2 = (int)op2->__anon1.s;
1774 else if(op2->kind == 2)
1775 *value2 = (int)op2->__anon1.us;
1776 else if(op2->kind == 1 && op2->type->isSigned)
1777 *value2 = (int)op2->__anon1.c;
1778 else if(op2->kind == 24 || op2->kind == 1)
1779 *value2 = (int)op2->__anon1.uc;
1780 else if(op2->kind == 6)
1781 *value2 = (int)op2->__anon1.f;
1782 else if(op2->kind == 7)
1783 *value2 = (int)op2->__anon1.d;
1784 else if(op2->kind == 13)
1785 *value2 = (int)op2->__anon1.ui64;
1786 else
1787 return 0;
1788 return 1;
1789 }
1790
1791 struct Operand GetOperand(struct Expression * exp);
1792
1793 unsigned int GetInt(struct Expression * exp, int * value2)
1794 {
1795 struct Operand op2 = GetOperand(exp);
1796
1797 return GetOpInt(&op2, value2);
1798 }
1799
1800 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1801 {
1802 if(op2->kind == 3 && op2->type->isSigned)
1803 *value2 = (unsigned int)op2->__anon1.i;
1804 else if(op2->kind == 3)
1805 *value2 = op2->__anon1.ui;
1806 else if(op2->kind == 4 && op2->type->isSigned)
1807 *value2 = (unsigned int)op2->__anon1.i64;
1808 else if(op2->kind == 4)
1809 *value2 = (unsigned int)op2->__anon1.ui64;
1810 else if(op2->kind == 23 && op2->type->isSigned)
1811 *value2 = (unsigned int)op2->__anon1.i64;
1812 else if(op2->kind == 23)
1813 *value2 = (unsigned int)op2->__anon1.ui64;
1814 else if(op2->kind == 22 && op2->type->isSigned)
1815 *value2 = (unsigned int)op2->__anon1.i64;
1816 else if(op2->kind == 22)
1817 *value2 = (unsigned int)op2->__anon1.ui64;
1818 else if(op2->kind == 2 && op2->type->isSigned)
1819 *value2 = (unsigned int)op2->__anon1.s;
1820 else if(op2->kind == 2)
1821 *value2 = (unsigned int)op2->__anon1.us;
1822 else if(op2->kind == 1 && op2->type->isSigned)
1823 *value2 = (unsigned int)op2->__anon1.c;
1824 else if(op2->kind == 24 || op2->kind == 1)
1825 *value2 = (unsigned int)op2->__anon1.uc;
1826 else if(op2->kind == 6)
1827 *value2 = (unsigned int)op2->__anon1.f;
1828 else if(op2->kind == 7)
1829 *value2 = (unsigned int)op2->__anon1.d;
1830 else if(op2->kind == 13)
1831 *value2 = (unsigned int)op2->__anon1.ui64;
1832 else
1833 return 0;
1834 return 1;
1835 }
1836
1837 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1838 {
1839 struct Operand op2 = GetOperand(exp);
1840
1841 return GetOpUInt(&op2, value2);
1842 }
1843
1844 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1845 {
1846 if(op2->kind == 3 && op2->type->isSigned)
1847 *value2 = (long long)op2->__anon1.i;
1848 else if(op2->kind == 3)
1849 *value2 = (long long)op2->__anon1.ui;
1850 else if(op2->kind == 4 && op2->type->isSigned)
1851 *value2 = op2->__anon1.i64;
1852 else if(op2->kind == 4)
1853 *value2 = (long long)op2->__anon1.ui64;
1854 else if(op2->kind == 23 && op2->type->isSigned)
1855 *value2 = op2->__anon1.i64;
1856 else if(op2->kind == 23)
1857 *value2 = (long long)op2->__anon1.ui64;
1858 else if(op2->kind == 22 && op2->type->isSigned)
1859 *value2 = op2->__anon1.i64;
1860 else if(op2->kind == 22)
1861 *value2 = (long long)op2->__anon1.ui64;
1862 else if(op2->kind == 2 && op2->type->isSigned)
1863 *value2 = (long long)op2->__anon1.s;
1864 else if(op2->kind == 2)
1865 *value2 = (long long)op2->__anon1.us;
1866 else if(op2->kind == 1 && op2->type->isSigned)
1867 *value2 = (long long)op2->__anon1.c;
1868 else if(op2->kind == 24 || op2->kind == 1)
1869 *value2 = (long long)op2->__anon1.uc;
1870 else if(op2->kind == 6)
1871 *value2 = (long long)op2->__anon1.f;
1872 else if(op2->kind == 7)
1873 *value2 = (long long)op2->__anon1.d;
1874 else if(op2->kind == 13)
1875 *value2 = (long long)op2->__anon1.ui64;
1876 else
1877 return 0;
1878 return 1;
1879 }
1880
1881 unsigned int GetInt64(struct Expression * exp, long long * value2)
1882 {
1883 struct Operand op2 = GetOperand(exp);
1884
1885 return GetOpInt64(&op2, value2);
1886 }
1887
1888 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1889 {
1890 if(op2->kind == 3 && op2->type->isSigned)
1891 *value2 = (uint64)op2->__anon1.i;
1892 else if(op2->kind == 3)
1893 *value2 = (uint64)op2->__anon1.ui;
1894 else if(op2->kind == 4 && op2->type->isSigned)
1895 *value2 = (uint64)op2->__anon1.i64;
1896 else if(op2->kind == 4)
1897 *value2 = op2->__anon1.ui64;
1898 else if(op2->kind == 23 && op2->type->isSigned)
1899 *value2 = (uint64)op2->__anon1.i64;
1900 else if(op2->kind == 23)
1901 *value2 = op2->__anon1.ui64;
1902 else if(op2->kind == 22 && op2->type->isSigned)
1903 *value2 = (uint64)op2->__anon1.i64;
1904 else if(op2->kind == 22)
1905 *value2 = op2->__anon1.ui64;
1906 else if(op2->kind == 2 && op2->type->isSigned)
1907 *value2 = (uint64)op2->__anon1.s;
1908 else if(op2->kind == 2)
1909 *value2 = (uint64)op2->__anon1.us;
1910 else if(op2->kind == 1 && op2->type->isSigned)
1911 *value2 = (uint64)op2->__anon1.c;
1912 else if(op2->kind == 24 || op2->kind == 1)
1913 *value2 = (uint64)op2->__anon1.uc;
1914 else if(op2->kind == 6)
1915 *value2 = (uint64)op2->__anon1.f;
1916 else if(op2->kind == 7)
1917 *value2 = (uint64)op2->__anon1.d;
1918 else if(op2->kind == 13)
1919 *value2 = op2->__anon1.ui64;
1920 else
1921 return 0;
1922 return 1;
1923 }
1924
1925 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1926 {
1927 struct Operand op2 = GetOperand(exp);
1928
1929 return GetOpUInt64(&op2, value2);
1930 }
1931
1932 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1933 {
1934 if(op2->kind == 3 && op2->type->isSigned)
1935 *value2 = (intptr_t)op2->__anon1.i;
1936 else if(op2->kind == 3)
1937 *value2 = (intptr_t)op2->__anon1.ui;
1938 else if(op2->kind == 4 && op2->type->isSigned)
1939 *value2 = (intptr_t)op2->__anon1.i64;
1940 else if(op2->kind == 4)
1941 *value2 = (intptr_t)op2->__anon1.ui64;
1942 else if(op2->kind == 23 && op2->type->isSigned)
1943 *value2 = (intptr_t)op2->__anon1.i64;
1944 else if(op2->kind == 23)
1945 *value2 = (intptr_t)op2->__anon1.ui64;
1946 else if(op2->kind == 22 && op2->type->isSigned)
1947 *value2 = (intptr_t)op2->__anon1.i64;
1948 else if(op2->kind == 22)
1949 *value2 = (intptr_t)op2->__anon1.ui64;
1950 else if(op2->kind == 2 && op2->type->isSigned)
1951 *value2 = (intptr_t)op2->__anon1.s;
1952 else if(op2->kind == 2)
1953 *value2 = (intptr_t)op2->__anon1.us;
1954 else if(op2->kind == 1 && op2->type->isSigned)
1955 *value2 = (intptr_t)op2->__anon1.c;
1956 else if(op2->kind == 24 || op2->kind == 1)
1957 *value2 = (intptr_t)op2->__anon1.uc;
1958 else if(op2->kind == 6)
1959 *value2 = (intptr_t)op2->__anon1.f;
1960 else if(op2->kind == 7)
1961 *value2 = (intptr_t)op2->__anon1.d;
1962 else if(op2->kind == 13)
1963 *value2 = (intptr_t)op2->__anon1.ui64;
1964 else
1965 return 0;
1966 return 1;
1967 }
1968
1969 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1970 {
1971 struct Operand op2 = GetOperand(exp);
1972
1973 return GetOpIntPtr(&op2, value2);
1974 }
1975
1976 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1977 {
1978 if(op2->kind == 3 && op2->type->isSigned)
1979 *value2 = (uintptr_t)op2->__anon1.i;
1980 else if(op2->kind == 3)
1981 *value2 = (uintptr_t)op2->__anon1.ui;
1982 else if(op2->kind == 4 && op2->type->isSigned)
1983 *value2 = (uintptr_t)op2->__anon1.i64;
1984 else if(op2->kind == 4)
1985 *value2 = (uintptr_t)op2->__anon1.ui64;
1986 else if(op2->kind == 23 && op2->type->isSigned)
1987 *value2 = (uintptr_t)op2->__anon1.i64;
1988 else if(op2->kind == 23)
1989 *value2 = (uintptr_t)op2->__anon1.ui64;
1990 else if(op2->kind == 22 && op2->type->isSigned)
1991 *value2 = (uintptr_t)op2->__anon1.i64;
1992 else if(op2->kind == 22)
1993 *value2 = (uintptr_t)op2->__anon1.ui64;
1994 else if(op2->kind == 2 && op2->type->isSigned)
1995 *value2 = (uintptr_t)op2->__anon1.s;
1996 else if(op2->kind == 2)
1997 *value2 = (uintptr_t)op2->__anon1.us;
1998 else if(op2->kind == 1 && op2->type->isSigned)
1999 *value2 = (uintptr_t)op2->__anon1.c;
2000 else if(op2->kind == 24 || op2->kind == 1)
2001 *value2 = (uintptr_t)op2->__anon1.uc;
2002 else if(op2->kind == 6)
2003 *value2 = (uintptr_t)op2->__anon1.f;
2004 else if(op2->kind == 7)
2005 *value2 = (uintptr_t)op2->__anon1.d;
2006 else if(op2->kind == 13)
2007 *value2 = (uintptr_t)op2->__anon1.ui64;
2008 else
2009 return 0;
2010 return 1;
2011 }
2012
2013 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2014 {
2015 struct Operand op2 = GetOperand(exp);
2016
2017 return GetOpUIntPtr(&op2, value2);
2018 }
2019
2020 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2021 {
2022 if(op2->kind == 3 && op2->type->isSigned)
2023 *value2 = (ssize_t)op2->__anon1.i;
2024 else if(op2->kind == 3)
2025 *value2 = (ssize_t)op2->__anon1.ui;
2026 else if(op2->kind == 4 && op2->type->isSigned)
2027 *value2 = (ssize_t)op2->__anon1.i64;
2028 else if(op2->kind == 4)
2029 *value2 = (ssize_t)op2->__anon1.ui64;
2030 else if(op2->kind == 23 && op2->type->isSigned)
2031 *value2 = (ssize_t)op2->__anon1.i64;
2032 else if(op2->kind == 23)
2033 *value2 = (ssize_t)op2->__anon1.ui64;
2034 else if(op2->kind == 22 && op2->type->isSigned)
2035 *value2 = (ssize_t)op2->__anon1.i64;
2036 else if(op2->kind == 22)
2037 *value2 = (ssize_t)op2->__anon1.ui64;
2038 else if(op2->kind == 2 && op2->type->isSigned)
2039 *value2 = (ssize_t)op2->__anon1.s;
2040 else if(op2->kind == 2)
2041 *value2 = (ssize_t)op2->__anon1.us;
2042 else if(op2->kind == 1 && op2->type->isSigned)
2043 *value2 = (ssize_t)op2->__anon1.c;
2044 else if(op2->kind == 24 || op2->kind == 1)
2045 *value2 = (ssize_t)op2->__anon1.uc;
2046 else if(op2->kind == 6)
2047 *value2 = (ssize_t)op2->__anon1.f;
2048 else if(op2->kind == 7)
2049 *value2 = (ssize_t)op2->__anon1.d;
2050 else if(op2->kind == 13)
2051 *value2 = (ssize_t)op2->__anon1.ui64;
2052 else
2053 return 0;
2054 return 1;
2055 }
2056
2057 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2058 {
2059 struct Operand op2 = GetOperand(exp);
2060
2061 return GetOpIntSize(&op2, value2);
2062 }
2063
2064 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2065 {
2066 if(op2->kind == 3 && op2->type->isSigned)
2067 *value2 = (size_t)op2->__anon1.i;
2068 else if(op2->kind == 3)
2069 *value2 = (size_t)op2->__anon1.ui;
2070 else if(op2->kind == 4 && op2->type->isSigned)
2071 *value2 = (size_t)op2->__anon1.i64;
2072 else if(op2->kind == 4)
2073 *value2 = (size_t)op2->__anon1.ui64;
2074 else if(op2->kind == 23 && op2->type->isSigned)
2075 *value2 = (size_t)op2->__anon1.i64;
2076 else if(op2->kind == 23)
2077 *value2 = (size_t)op2->__anon1.ui64;
2078 else if(op2->kind == 22 && op2->type->isSigned)
2079 *value2 = (size_t)op2->__anon1.i64;
2080 else if(op2->kind == 22)
2081 *value2 = (size_t)op2->__anon1.ui64;
2082 else if(op2->kind == 2 && op2->type->isSigned)
2083 *value2 = (size_t)op2->__anon1.s;
2084 else if(op2->kind == 2)
2085 *value2 = (size_t)op2->__anon1.us;
2086 else if(op2->kind == 1 && op2->type->isSigned)
2087 *value2 = (size_t)op2->__anon1.c;
2088 else if(op2->kind == 24 || op2->kind == 1)
2089 *value2 = (size_t)op2->__anon1.uc;
2090 else if(op2->kind == 6)
2091 *value2 = (size_t)op2->__anon1.f;
2092 else if(op2->kind == 7)
2093 *value2 = (size_t)op2->__anon1.d;
2094 else if(op2->kind == 13)
2095 *value2 = (size_t)op2->__anon1.ui64;
2096 else
2097 return 0;
2098 return 1;
2099 }
2100
2101 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2102 {
2103 struct Operand op2 = GetOperand(exp);
2104
2105 return GetOpUIntSize(&op2, value2);
2106 }
2107
2108 unsigned int GetOpShort(struct Operand * op2, short * value2)
2109 {
2110 if(op2->kind == 3 && op2->type->isSigned)
2111 *value2 = (short)op2->__anon1.i;
2112 else if(op2->kind == 3)
2113 *value2 = (short)op2->__anon1.ui;
2114 else if(op2->kind == 4 && op2->type->isSigned)
2115 *value2 = (short)op2->__anon1.i64;
2116 else if(op2->kind == 4)
2117 *value2 = (short)op2->__anon1.ui64;
2118 else if(op2->kind == 23 && op2->type->isSigned)
2119 *value2 = (short)op2->__anon1.i64;
2120 else if(op2->kind == 23)
2121 *value2 = (short)op2->__anon1.ui64;
2122 else if(op2->kind == 22 && op2->type->isSigned)
2123 *value2 = (short)op2->__anon1.i64;
2124 else if(op2->kind == 22)
2125 *value2 = (short)op2->__anon1.ui64;
2126 else if(op2->kind == 2 && op2->type->isSigned)
2127 *value2 = op2->__anon1.s;
2128 else if(op2->kind == 2)
2129 *value2 = (short)op2->__anon1.us;
2130 else if(op2->kind == 1 && op2->type->isSigned)
2131 *value2 = (short)op2->__anon1.c;
2132 else if(op2->kind == 24 || op2->kind == 1)
2133 *value2 = (short)op2->__anon1.uc;
2134 else if(op2->kind == 6)
2135 *value2 = (short)op2->__anon1.f;
2136 else if(op2->kind == 7)
2137 *value2 = (short)op2->__anon1.d;
2138 else if(op2->kind == 13)
2139 *value2 = (short)op2->__anon1.ui64;
2140 else
2141 return 0;
2142 return 1;
2143 }
2144
2145 unsigned int GetShort(struct Expression * exp, short * value2)
2146 {
2147 struct Operand op2 = GetOperand(exp);
2148
2149 return GetOpShort(&op2, value2);
2150 }
2151
2152 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2153 {
2154 if(op2->kind == 3 && op2->type->isSigned)
2155 *value2 = (unsigned short)op2->__anon1.i;
2156 else if(op2->kind == 3)
2157 *value2 = (unsigned short)op2->__anon1.ui;
2158 else if(op2->kind == 4 && op2->type->isSigned)
2159 *value2 = (unsigned short)op2->__anon1.i64;
2160 else if(op2->kind == 4)
2161 *value2 = (unsigned short)op2->__anon1.ui64;
2162 else if(op2->kind == 23 && op2->type->isSigned)
2163 *value2 = (unsigned short)op2->__anon1.i64;
2164 else if(op2->kind == 23)
2165 *value2 = (unsigned short)op2->__anon1.ui64;
2166 else if(op2->kind == 22 && op2->type->isSigned)
2167 *value2 = (unsigned short)op2->__anon1.i64;
2168 else if(op2->kind == 22)
2169 *value2 = (unsigned short)op2->__anon1.ui64;
2170 else if(op2->kind == 2 && op2->type->isSigned)
2171 *value2 = (unsigned short)op2->__anon1.s;
2172 else if(op2->kind == 2)
2173 *value2 = op2->__anon1.us;
2174 else if(op2->kind == 1 && op2->type->isSigned)
2175 *value2 = (unsigned short)op2->__anon1.c;
2176 else if(op2->kind == 24 || op2->kind == 1)
2177 *value2 = (unsigned short)op2->__anon1.uc;
2178 else if(op2->kind == 6)
2179 *value2 = (unsigned short)op2->__anon1.f;
2180 else if(op2->kind == 7)
2181 *value2 = (unsigned short)op2->__anon1.d;
2182 else if(op2->kind == 13)
2183 *value2 = (unsigned short)op2->__anon1.ui64;
2184 else
2185 return 0;
2186 return 1;
2187 }
2188
2189 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2190 {
2191 struct Operand op2 = GetOperand(exp);
2192
2193 return GetOpUShort(&op2, value2);
2194 }
2195
2196 unsigned int GetOpChar(struct Operand * op2, char * value2)
2197 {
2198 if(op2->kind == 3 && op2->type->isSigned)
2199 *value2 = (char)op2->__anon1.i;
2200 else if(op2->kind == 3)
2201 *value2 = (char)op2->__anon1.ui;
2202 else if(op2->kind == 4 && op2->type->isSigned)
2203 *value2 = (char)op2->__anon1.i64;
2204 else if(op2->kind == 4)
2205 *value2 = (char)op2->__anon1.ui64;
2206 else if(op2->kind == 23 && op2->type->isSigned)
2207 *value2 = (char)op2->__anon1.i64;
2208 else if(op2->kind == 23)
2209 *value2 = (char)op2->__anon1.ui64;
2210 else if(op2->kind == 22 && op2->type->isSigned)
2211 *value2 = (char)op2->__anon1.i64;
2212 else if(op2->kind == 22)
2213 *value2 = (char)op2->__anon1.ui64;
2214 else if(op2->kind == 2 && op2->type->isSigned)
2215 *value2 = (char)op2->__anon1.s;
2216 else if(op2->kind == 2)
2217 *value2 = (char)op2->__anon1.us;
2218 else if(op2->kind == 1 && op2->type->isSigned)
2219 *value2 = op2->__anon1.c;
2220 else if(op2->kind == 24 || op2->kind == 1)
2221 *value2 = (char)op2->__anon1.uc;
2222 else if(op2->kind == 6)
2223 *value2 = (char)op2->__anon1.f;
2224 else if(op2->kind == 7)
2225 *value2 = (char)op2->__anon1.d;
2226 else if(op2->kind == 13)
2227 *value2 = (char)op2->__anon1.ui64;
2228 else
2229 return 0;
2230 return 1;
2231 }
2232
2233 unsigned int GetChar(struct Expression * exp, char * value2)
2234 {
2235 struct Operand op2 = GetOperand(exp);
2236
2237 return GetOpChar(&op2, value2);
2238 }
2239
2240 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2241 {
2242 if(op2->kind == 3 && op2->type->isSigned)
2243 *value2 = (unsigned char)op2->__anon1.i;
2244 else if(op2->kind == 3)
2245 *value2 = (unsigned char)op2->__anon1.ui;
2246 else if(op2->kind == 4 && op2->type->isSigned)
2247 *value2 = (unsigned char)op2->__anon1.i64;
2248 else if(op2->kind == 4)
2249 *value2 = (unsigned char)op2->__anon1.ui64;
2250 else if(op2->kind == 23 && op2->type->isSigned)
2251 *value2 = (unsigned char)op2->__anon1.i64;
2252 else if(op2->kind == 23)
2253 *value2 = (unsigned char)op2->__anon1.ui64;
2254 else if(op2->kind == 22 && op2->type->isSigned)
2255 *value2 = (unsigned char)op2->__anon1.i64;
2256 else if(op2->kind == 22)
2257 *value2 = (unsigned char)op2->__anon1.ui64;
2258 else if(op2->kind == 2 && op2->type->isSigned)
2259 *value2 = (unsigned char)op2->__anon1.s;
2260 else if(op2->kind == 2)
2261 *value2 = (unsigned char)op2->__anon1.us;
2262 else if(op2->kind == 1 && op2->type->isSigned)
2263 *value2 = (unsigned char)op2->__anon1.c;
2264 else if(op2->kind == 24 || op2->kind == 1)
2265 *value2 = op2->__anon1.uc;
2266 else if(op2->kind == 6)
2267 *value2 = (unsigned char)op2->__anon1.f;
2268 else if(op2->kind == 7)
2269 *value2 = (unsigned char)op2->__anon1.d;
2270 else if(op2->kind == 13)
2271 *value2 = (unsigned char)op2->__anon1.ui64;
2272 else
2273 return 0;
2274 return 1;
2275 }
2276
2277 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2278 {
2279 struct Operand op2 = GetOperand(exp);
2280
2281 return GetOpUChar(&op2, value2);
2282 }
2283
2284 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2285 {
2286 if(op2->kind == 3 && op2->type->isSigned)
2287 *value2 = (float)(float)op2->__anon1.i;
2288 else if(op2->kind == 3)
2289 *value2 = (float)(float)op2->__anon1.ui;
2290 else if(op2->kind == 4 && op2->type->isSigned)
2291 *value2 = (float)(float)op2->__anon1.i64;
2292 else if(op2->kind == 4)
2293 *value2 = (float)(float)op2->__anon1.ui64;
2294 else if(op2->kind == 23 && op2->type->isSigned)
2295 *value2 = (float)(float)op2->__anon1.i64;
2296 else if(op2->kind == 23)
2297 *value2 = (float)(float)op2->__anon1.ui64;
2298 else if(op2->kind == 22 && op2->type->isSigned)
2299 *value2 = (float)(float)op2->__anon1.i64;
2300 else if(op2->kind == 22)
2301 *value2 = (float)(float)op2->__anon1.ui64;
2302 else if(op2->kind == 2 && op2->type->isSigned)
2303 *value2 = (float)(float)op2->__anon1.s;
2304 else if(op2->kind == 2)
2305 *value2 = (float)(float)op2->__anon1.us;
2306 else if(op2->kind == 1 && op2->type->isSigned)
2307 *value2 = (float)(float)op2->__anon1.c;
2308 else if(op2->kind == 24 || op2->kind == 1)
2309 *value2 = (float)(float)op2->__anon1.uc;
2310 else if(op2->kind == 6)
2311 *value2 = (float)op2->__anon1.f;
2312 else if(op2->kind == 7)
2313 *value2 = (float)op2->__anon1.d;
2314 else if(op2->kind == 13)
2315 *value2 = (float)(float)op2->__anon1.ui64;
2316 else
2317 return 0;
2318 return 1;
2319 }
2320
2321 unsigned int GetFloat(struct Expression * exp, float * value2)
2322 {
2323 struct Operand op2 = GetOperand(exp);
2324
2325 return GetOpFloat(&op2, value2);
2326 }
2327
2328 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2329 {
2330 if(op2->kind == 3 && op2->type->isSigned)
2331 *value2 = (double)(double)op2->__anon1.i;
2332 else if(op2->kind == 3)
2333 *value2 = (double)(double)op2->__anon1.ui;
2334 else if(op2->kind == 4 && op2->type->isSigned)
2335 *value2 = (double)(double)op2->__anon1.i64;
2336 else if(op2->kind == 4)
2337 *value2 = (double)(double)op2->__anon1.ui64;
2338 else if(op2->kind == 23 && op2->type->isSigned)
2339 *value2 = (double)(double)op2->__anon1.i64;
2340 else if(op2->kind == 23)
2341 *value2 = (double)(double)op2->__anon1.ui64;
2342 else if(op2->kind == 22 && op2->type->isSigned)
2343 *value2 = (double)(double)op2->__anon1.i64;
2344 else if(op2->kind == 22)
2345 *value2 = (double)(double)op2->__anon1.ui64;
2346 else if(op2->kind == 2 && op2->type->isSigned)
2347 *value2 = (double)(double)op2->__anon1.s;
2348 else if(op2->kind == 2)
2349 *value2 = (double)(double)op2->__anon1.us;
2350 else if(op2->kind == 1 && op2->type->isSigned)
2351 *value2 = (double)(double)op2->__anon1.c;
2352 else if(op2->kind == 24 || op2->kind == 1)
2353 *value2 = (double)(double)op2->__anon1.uc;
2354 else if(op2->kind == 6)
2355 *value2 = (double)op2->__anon1.f;
2356 else if(op2->kind == 7)
2357 *value2 = (double)op2->__anon1.d;
2358 else if(op2->kind == 13)
2359 *value2 = (double)(double)op2->__anon1.ui64;
2360 else
2361 return 0;
2362 return 1;
2363 }
2364
2365 unsigned int GetDouble(struct Expression * exp, double * value2)
2366 {
2367 struct Operand op2 = GetOperand(exp);
2368
2369 return GetOpDouble(&op2, value2);
2370 }
2371
2372 void ComputeExpression(struct Expression * exp);
2373
2374 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2375
2376 extern int targetBits;
2377
2378 int ComputeTypeSize(struct Type * type);
2379
2380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2381
2382 struct __ecereNameSpace__ecere__com__BitMember
2383 {
2384 struct __ecereNameSpace__ecere__com__BitMember * prev;
2385 struct __ecereNameSpace__ecere__com__BitMember * next;
2386 const char *  name;
2387 unsigned int isProperty;
2388 int memberAccess;
2389 int id;
2390 struct __ecereNameSpace__ecere__com__Class * _class;
2391 const char *  dataTypeString;
2392 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2393 struct Type * dataType;
2394 int type;
2395 int size;
2396 int pos;
2397 uint64 mask;
2398 } __attribute__ ((gcc_struct));
2399
2400 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2401
2402 struct __ecereNameSpace__ecere__sys__OldLink
2403 {
2404 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2405 struct __ecereNameSpace__ecere__sys__OldLink * next;
2406 void *  data;
2407 } __attribute__ ((gcc_struct));
2408
2409 void FinishTemplatesContext(struct Context * context);
2410
2411 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2412 {
2413 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2414 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2415
2416 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))
2417 {
2418 int unionMemberOffset = 0;
2419 int bitFields = 0;
2420
2421 if(member)
2422 {
2423 member->memberOffset = 0;
2424 if(targetBits < sizeof(void *) * 8)
2425 member->structAlignment = 0;
2426 }
2427 else if(targetBits < sizeof(void *) * 8)
2428 _class->structAlignment = 0;
2429 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2430 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2431 if(!member && _class->destructionWatchOffset)
2432 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2433 {
2434 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2435
2436 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2437 {
2438 if(!dataMember->isProperty)
2439 {
2440 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2441 {
2442 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
2443 }
2444 }
2445 }
2446 }
2447 {
2448 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2449
2450 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2451 {
2452 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2453 {
2454 if(!isMember && _class->type == 2 && dataMember->dataType)
2455 {
2456 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2457 uint64 mask = 0;
2458 int d;
2459
2460 ComputeTypeSize(dataMember->dataType);
2461 if(bitMember->pos == -1)
2462 bitMember->pos = _class->memberOffset;
2463 if(!bitMember->size)
2464 bitMember->size = dataMember->dataType->size * 8;
2465 _class->memberOffset = bitMember->pos + bitMember->size;
2466 for(d = 0; d < bitMember->size; d++)
2467 {
2468 if(d)
2469 mask <<= 1;
2470 mask |= 1;
2471 }
2472 bitMember->mask = mask << bitMember->pos;
2473 }
2474 else if(dataMember->type == 0 && dataMember->dataType)
2475 {
2476 int size;
2477 int alignment = 0;
2478
2479 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->__anon1._class || !dataMember->dataType->__anon1._class->__anon1.registered || dataMember->dataType->__anon1._class->__anon1.registered != _class || _class->type != 1)))
2480 ComputeTypeSize(dataMember->dataType);
2481 if(dataMember->dataType->bitFieldCount)
2482 {
2483 bitFields += dataMember->dataType->bitFieldCount;
2484 size = 0;
2485 }
2486 else
2487 {
2488 if(bitFields)
2489 {
2490 int size = (bitFields + 7) / 8;
2491
2492 if(isMember)
2493 {
2494 int __simpleStruct0;
2495
2496 if(alignment)
2497 {
2498 int __simpleStruct0;
2499
2500 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2501 if(member->memberOffset % alignment)
2502 member->memberOffset += alignment - (member->memberOffset % alignment);
2503 }
2504 dataMember->offset = member->memberOffset;
2505 if(member->type == 1)
2506 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2507 else
2508 {
2509 member->memberOffset += size;
2510 }
2511 }
2512 else
2513 {
2514 if(alignment)
2515 {
2516 int __simpleStruct0;
2517
2518 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2519 if(_class->memberOffset % alignment)
2520 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2521 }
2522 dataMember->offset = _class->memberOffset;
2523 _class->memberOffset += size;
2524 }
2525 bitFields = 0;
2526 }
2527 size = dataMember->dataType->size;
2528 alignment = dataMember->dataType->alignment;
2529 }
2530 if(isMember)
2531 {
2532 int __simpleStruct0;
2533
2534 if(alignment)
2535 {
2536 int __simpleStruct0;
2537
2538 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2539 if(member->memberOffset % alignment)
2540 member->memberOffset += alignment - (member->memberOffset % alignment);
2541 }
2542 dataMember->offset = member->memberOffset;
2543 if(member->type == 1)
2544 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2545 else
2546 {
2547 member->memberOffset += size;
2548 }
2549 }
2550 else
2551 {
2552 if(alignment)
2553 {
2554 int __simpleStruct0;
2555
2556 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2557 if(_class->memberOffset % alignment)
2558 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2559 }
2560 dataMember->offset = _class->memberOffset;
2561 _class->memberOffset += size;
2562 }
2563 }
2564 else
2565 {
2566 int alignment;
2567
2568 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
2569 alignment = dataMember->structAlignment;
2570 if(isMember)
2571 {
2572 int __simpleStruct0;
2573
2574 if(alignment)
2575 {
2576 int __simpleStruct0;
2577
2578 if(member->memberOffset % alignment)
2579 member->memberOffset += alignment - (member->memberOffset % alignment);
2580 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2581 }
2582 dataMember->offset = member->memberOffset;
2583 if(member->type == 1)
2584 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2585 else
2586 member->memberOffset += dataMember->memberOffset;
2587 }
2588 else
2589 {
2590 if(alignment)
2591 {
2592 int __simpleStruct0;
2593
2594 if(_class->memberOffset % alignment)
2595 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2596 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2597 }
2598 dataMember->offset = _class->memberOffset;
2599 _class->memberOffset += dataMember->memberOffset;
2600 }
2601 }
2602 }
2603 }
2604 if(bitFields)
2605 {
2606 int alignment = 0;
2607 int size = (bitFields + 7) / 8;
2608
2609 if(isMember)
2610 {
2611 int __simpleStruct0;
2612
2613 if(alignment)
2614 {
2615 int __simpleStruct0;
2616
2617 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2618 if(member->memberOffset % alignment)
2619 member->memberOffset += alignment - (member->memberOffset % alignment);
2620 }
2621 if(member->type == 1)
2622 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2623 else
2624 {
2625 member->memberOffset += size;
2626 }
2627 }
2628 else
2629 {
2630 if(alignment)
2631 {
2632 int __simpleStruct0;
2633
2634 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2635 if(_class->memberOffset % alignment)
2636 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2637 }
2638 _class->memberOffset += size;
2639 }
2640 bitFields = 0;
2641 }
2642 }
2643 if(member && member->type == 1)
2644 {
2645 member->memberOffset = unionMemberOffset;
2646 }
2647 if(!isMember)
2648 {
2649 if(_class->type != 2)
2650 {
2651 int extra = 0;
2652
2653 if(_class->structAlignment)
2654 {
2655 if(_class->memberOffset % _class->structAlignment)
2656 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2657 }
2658 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2659 if(!member)
2660 {
2661 struct __ecereNameSpace__ecere__com__Property * prop;
2662
2663 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2664 {
2665 if(prop->isProperty && prop->isWatchable)
2666 {
2667 prop->watcherOffset = _class->structSize;
2668 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2669 }
2670 }
2671 }
2672 {
2673 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2674
2675 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2676 {
2677 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2678
2679 if(deriv->computeSize)
2680 {
2681 deriv->offset = _class->structSize;
2682 deriv->memberOffset = 0;
2683 deriv->structSize = deriv->offset;
2684 ComputeClassMembers(deriv, 0);
2685 }
2686 }
2687 }
2688 }
2689 }
2690 }
2691 if(context)
2692 FinishTemplatesContext(context);
2693 }
2694
2695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2696
2697 struct __ecereNameSpace__ecere__com__NameSpace
2698 {
2699 const char *  name;
2700 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2701 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2702 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2703 int depth;
2704 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2705 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2706 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2707 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2708 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2709 } __attribute__ ((gcc_struct));
2710
2711 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2712
2713 struct __ecereNameSpace__ecere__com__Module
2714 {
2715 struct __ecereNameSpace__ecere__com__Instance * application;
2716 struct __ecereNameSpace__ecere__sys__OldList classes;
2717 struct __ecereNameSpace__ecere__sys__OldList defines;
2718 struct __ecereNameSpace__ecere__sys__OldList functions;
2719 struct __ecereNameSpace__ecere__sys__OldList modules;
2720 struct __ecereNameSpace__ecere__com__Instance * prev;
2721 struct __ecereNameSpace__ecere__com__Instance * next;
2722 const char *  name;
2723 void *  library;
2724 void *  Unload;
2725 int importType;
2726 int origImportType;
2727 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2728 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2729 } __attribute__ ((gcc_struct));
2730
2731 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2732 {
2733 struct __ecereNameSpace__ecere__com__Class * _class;
2734 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2735
2736 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2737 ComputeModuleClasses(subModule->data);
2738 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2739 ComputeClassMembers(_class, 0);
2740 }
2741
2742 extern unsigned int inCompiler;
2743
2744 extern void Compiler_Error(const char *  format, ...);
2745
2746 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2747
2748 int ComputeTypeSize(struct Type * type)
2749 {
2750 unsigned int size = type ? type->size : 0;
2751
2752 if(!size && type && !type->computing)
2753 {
2754 type->computing = 1;
2755 switch(type->kind)
2756 {
2757 case 24:
2758 type->alignment = size = sizeof(char);
2759 break;
2760 case 1:
2761 type->alignment = size = sizeof(char);
2762 break;
2763 case 3:
2764 type->alignment = size = sizeof(int);
2765 break;
2766 case 4:
2767 type->alignment = size = sizeof(long long);
2768 break;
2769 case 22:
2770 type->alignment = size = targetBits / 8;
2771 break;
2772 case 23:
2773 type->alignment = size = targetBits / 8;
2774 break;
2775 case 5:
2776 type->alignment = size = sizeof(long);
2777 break;
2778 case 2:
2779 type->alignment = size = sizeof(short);
2780 break;
2781 case 6:
2782 type->alignment = size = sizeof(float);
2783 break;
2784 case 7:
2785 type->alignment = size = sizeof(double);
2786 break;
2787 case 8:
2788 {
2789 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2790
2791 if(_class && _class->type == 1)
2792 {
2793 ComputeClassMembers(_class, 0);
2794 type->alignment = _class->structAlignment;
2795 size = _class->structSize;
2796 if(type->alignment && size % type->alignment)
2797 size += type->alignment - (size % type->alignment);
2798 }
2799 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2800 {
2801 if(!_class->dataType)
2802 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
2803 size = type->alignment = ComputeTypeSize(_class->dataType);
2804 }
2805 else
2806 size = type->alignment = targetBits / 8;
2807 break;
2808 }
2809 case 13:
2810 case 19:
2811 size = type->alignment = targetBits / 8;
2812 break;
2813 case 12:
2814 if(type->__anon1.__anon4.arraySizeExp)
2815 {
2816 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2817 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2818 if(!type->__anon1.__anon4.arraySizeExp->isConstant || (type->__anon1.__anon4.arraySizeExp->expType->kind != 3 && type->__anon1.__anon4.arraySizeExp->expType->kind != 2 && type->__anon1.__anon4.arraySizeExp->expType->kind != 1 && type->__anon1.__anon4.arraySizeExp->expType->kind != 5 && type->__anon1.__anon4.arraySizeExp->expType->kind != 4 && type->__anon1.__anon4.arraySizeExp->expType->kind != 23 && type->__anon1.__anon4.arraySizeExp->expType->kind != 22 && type->__anon1.__anon4.arraySizeExp->expType->kind != 15 && (type->__anon1.__anon4.arraySizeExp->expType->kind != 8 || !type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered || type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered->type != 4)))
2819 {
2820 struct Location oldLoc = yylloc;
2821 char expression[10240];
2822
2823 expression[0] = '\0';
2824 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2825 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2826 if(inCompiler)
2827 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2828 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2829 yylloc = oldLoc;
2830 }
2831 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2832 }
2833 else if(type->__anon1.__anon4.enumClass)
2834 {
2835 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2836 {
2837 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2838 }
2839 else
2840 type->__anon1.__anon4.arraySize = 0;
2841 }
2842 else
2843 {
2844 type->__anon1.__anon4.arraySize = 0;
2845 }
2846 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2847 if(type->__anon1.type)
2848 type->alignment = type->__anon1.type->alignment;
2849 break;
2850 case 9:
2851 {
2852 struct Type * member;
2853
2854 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2855 {
2856 int __simpleStruct0, __simpleStruct1;
2857 unsigned int addSize = ComputeTypeSize(member);
2858
2859 member->offset = size;
2860 if(member->alignment && size % member->alignment)
2861 member->offset += member->alignment - (size % member->alignment);
2862 size = member->offset;
2863 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2864 size += addSize;
2865 }
2866 if(type->alignment && size % type->alignment)
2867 size += type->alignment - (size % type->alignment);
2868 break;
2869 }
2870 case 10:
2871 {
2872 struct Type * member;
2873
2874 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2875 {
2876 int __simpleStruct0, __simpleStruct1;
2877 unsigned int addSize = ComputeTypeSize(member);
2878
2879 member->offset = size;
2880 if(member->alignment && size % member->alignment)
2881 member->offset += member->alignment - (size % member->alignment);
2882 size = member->offset;
2883 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2884 size = ((size > addSize) ? size : addSize);
2885 }
2886 if(type->alignment && size % type->alignment)
2887 size += type->alignment - (size % type->alignment);
2888 break;
2889 }
2890 case 20:
2891 {
2892 struct TemplateParameter * param = type->__anon1.templateParameter;
2893 struct Type * baseType = ProcessTemplateParameterType(param);
2894
2895 if(baseType)
2896 {
2897 size = ComputeTypeSize(baseType);
2898 type->alignment = baseType->alignment;
2899 }
2900 else
2901 type->alignment = size = sizeof(uint64);
2902 break;
2903 }
2904 case 15:
2905 {
2906 type->alignment = size = sizeof(enum
2907 {
2908 test
2909 });
2910 break;
2911 }
2912 case 21:
2913 {
2914 type->alignment = size = targetBits / 8;
2915 break;
2916 }
2917 }
2918 type->size = size;
2919 type->computing = 0;
2920 }
2921 return size;
2922 }
2923
2924 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2925
2926 extern struct Identifier * MkIdentifier(const char *  string);
2927
2928 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2929
2930 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2931
2932 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2933
2934 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2935
2936 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2937
2938 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2939
2940 extern void FreeType(struct Type * type);
2941
2942 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2943
2944 extern struct Specifier * MkSpecifier(int specifier);
2945
2946 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2947
2948 extern struct Expression * MkExpConstant(const char *  string);
2949
2950 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)
2951 {
2952 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2953 unsigned int totalSize = 0;
2954 unsigned int maxSize = 0;
2955 int alignment;
2956 unsigned int size;
2957 struct __ecereNameSpace__ecere__com__DataMember * member;
2958 int anonID = 1;
2959 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2960
2961 if(addedPadding)
2962 *addedPadding = 0;
2963 if(!isMember && _class->base)
2964 {
2965 maxSize = _class->structSize;
2966 {
2967 if(_class->type == 1 || _class->type == 5)
2968 AddMembers(declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
2969 else
2970 {
2971 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2972
2973 if(maxSize > baseSize)
2974 maxSize -= baseSize;
2975 else
2976 maxSize = 0;
2977 }
2978 }
2979 }
2980 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2981 {
2982 if(!member->isProperty)
2983 {
2984 switch(member->type)
2985 {
2986 case 0:
2987 {
2988 if(member->dataTypeString)
2989 {
2990 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2991 struct Declarator * decl;
2992
2993 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2994 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2995 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2996 if(!member->dataType)
2997 member->dataType = ProcessType(specs, decl);
2998 ReplaceThisClassSpecifiers(specs, topClass);
2999 {
3000 struct Type * type = ProcessType(specs, decl);
3001
3002 DeclareType(member->dataType, 0, 0);
3003 FreeType(type);
3004 }
3005 ComputeTypeSize(member->dataType);
3006 size = member->dataType->size;
3007 alignment = member->dataType->alignment;
3008 if(alignment)
3009 {
3010 if(totalSize % alignment)
3011 totalSize += alignment - (totalSize % alignment);
3012 }
3013 totalSize += size;
3014 }
3015 break;
3016 }
3017 case 1:
3018 case 2:
3019 {
3020 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3021 char id[100];
3022
3023 sprintf(id, "__anon%d", anonID++);
3024 size = 0;
3025 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
3026 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3027 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3028 alignment = member->structAlignment;
3029 if(alignment)
3030 {
3031 if(totalSize % alignment)
3032 totalSize += alignment - (totalSize % alignment);
3033 }
3034 totalSize += size;
3035 break;
3036 }
3037 }
3038 }
3039 }
3040 if(retSize)
3041 {
3042 unsigned int __simpleStruct0;
3043
3044 if(topMember && topMember->type == 1)
3045 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3046 else
3047 *retSize += totalSize;
3048 }
3049 else if(totalSize < maxSize && _class->type != 1000)
3050 {
3051 int autoPadding = 0;
3052
3053 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3054 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3055 if(totalSize + autoPadding < maxSize)
3056 {
3057 char sizeString[50];
3058
3059 sprintf(sizeString, "%d", maxSize - totalSize);
3060 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3061 if(addedPadding)
3062 *addedPadding = 1;
3063 }
3064 }
3065 if(context)
3066 FinishTemplatesContext(context);
3067 return topMember ? topMember->memberID : _class->memberID;
3068 }
3069
3070 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3071 {
3072 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3073 struct __ecereNameSpace__ecere__com__DataMember * member;
3074 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3075
3076 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3077 DeclareMembers(_class->base, 0);
3078 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3079 {
3080 if(!member->isProperty)
3081 {
3082 switch(member->type)
3083 {
3084 case 0:
3085 {
3086 if(!member->dataType && member->dataTypeString)
3087 member->dataType = ProcessTypeString(member->dataTypeString, 0);
3088 if(member->dataType)
3089 DeclareType(member->dataType, 0, 0);
3090 break;
3091 }
3092 case 1:
3093 case 2:
3094 {
3095 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 1);
3096 break;
3097 }
3098 }
3099 }
3100 }
3101 if(context)
3102 FinishTemplatesContext(context);
3103 return topMember ? topMember->memberID : _class->memberID;
3104 }
3105
3106 extern struct Identifier * GetDeclId(struct Declarator * decl);
3107
3108 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3109 {
3110 struct ClassDef * def;
3111 int anonID = 1;
3112
3113 for(def = (*definitions).first; def; def = def->next)
3114 {
3115 if(def->type == 2)
3116 {
3117 struct Declaration * decl = def->__anon1.decl;
3118
3119 if(decl && decl->__anon1.__anon1.specifiers)
3120 {
3121 struct Specifier * spec;
3122 unsigned int isStruct = 0;
3123
3124 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3125 {
3126 if(spec->type == 3 || spec->type == 4)
3127 {
3128 if(spec->__anon1.__anon2.definitions)
3129 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3130 isStruct = 1;
3131 }
3132 }
3133 if(isStruct)
3134 {
3135 struct Declarator * d = (((void *)0));
3136
3137 if(decl->__anon1.__anon1.declarators)
3138 {
3139 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3140 {
3141 struct Identifier * idDecl = GetDeclId(d);
3142
3143 if(idDecl)
3144 break;
3145 }
3146 }
3147 if(!d)
3148 {
3149 char id[100];
3150
3151 sprintf(id, "__anon%d", anonID++);
3152 if(!decl->__anon1.__anon1.declarators)
3153 decl->__anon1.__anon1.declarators = MkList();
3154 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3155 }
3156 }
3157 }
3158 }
3159 }
3160 }
3161
3162 extern struct Symbol * FindClass(const char *  name);
3163
3164 extern char *  strchr(const char * , int);
3165
3166 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3167
3168 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3169
3170 extern void FreeClassDef(struct ClassDef * def);
3171
3172 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3173
3174 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3175
3176 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3177
3178 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3179
3180 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3181
3182 void DeclareStruct(const char * name, unsigned int skipNoHead)
3183 {
3184 struct External * external = (((void *)0));
3185 struct Symbol * classSym = FindClass(name);
3186
3187 if(!inCompiler || !classSym)
3188 return ;
3189 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3190 return ;
3191 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3192 {
3193 struct Declaration * decl;
3194 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3195 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3196 char structName[1024];
3197 struct Specifier * spec = (((void *)0));
3198
3199 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3200 classSym->declaring++;
3201 if(strchr(classSym->string, '<'))
3202 {
3203 if(classSym->__anon1.registered->templateClass)
3204 {
3205 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3206 classSym->declaring--;
3207 }
3208 return ;
3209 }
3210 DeclareMembers(classSym->__anon1.registered, 0);
3211 structName[0] = (char)0;
3212 FullClassNameCat(structName, name, 0);
3213 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3214 {
3215 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3216 {
3217 if(spec->type == 3 || spec->type == 4)
3218 break;
3219 }
3220 }
3221 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3222 {
3223 unsigned int addedPadding = 0;
3224
3225 classSym->declaredStructSym = 1;
3226 declarations = MkList();
3227 AddMembers(declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3228 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3229 {
3230 FreeList(declarations, FreeClassDef);
3231 declarations = (((void *)0));
3232 }
3233 }
3234 if(skipNoHead || declarations)
3235 {
3236 if(spec)
3237 {
3238 if(declarations)
3239 spec->__anon1.__anon2.definitions = declarations;
3240 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3241 {
3242 if(classSym->__anon2.__anon1.structExternal)
3243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3245 classSym->id = curExternal->symbol->idCode;
3246 classSym->idCode = curExternal->symbol->idCode;
3247 }
3248 }
3249 else
3250 {
3251 if(!external)
3252 external = MkExternalDeclaration((((void *)0)));
3253 specifiers = MkList();
3254 declarators = MkList();
3255 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3256 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3257 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3258 decl->symbol->__anon2.__anon1.pointerExternal = external;
3259 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3260 {
3261 char className[1024];
3262
3263 strcpy(className, "__ecereClass_");
3264 FullClassNameCat(className, classSym->string, 1);
3265 DeclareClass(classSym, className);
3266 external->symbol = classSym;
3267 classSym->__anon2.__anon1.pointerExternal = external;
3268 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3269 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3270 }
3271 else
3272 {
3273 char className[1024];
3274
3275 strcpy(className, "__ecereClass_");
3276 FullClassNameCat(className, classSym->string, 1);
3277 classSym->__anon2.__anon1.structExternal = external;
3278 DeclareClass(classSym, className);
3279 external->symbol = classSym;
3280 }
3281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3282 }
3283 }
3284 classSym->declaring--;
3285 }
3286 else
3287 {
3288 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3289 {
3290 struct Specifier * spec;
3291
3292 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3293 {
3294 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3295 }
3296 }
3297 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3298 {
3299 classSym->declaring++;
3300 {
3301 if(classSym->__anon1.registered)
3302 DeclareMembers(classSym->__anon1.registered, 0);
3303 }
3304 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3305 {
3306 if(classSym->__anon2.__anon1.structExternal)
3307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3309 classSym->id = curExternal->symbol->idCode;
3310 classSym->idCode = curExternal->symbol->idCode;
3311 }
3312 classSym->declaring--;
3313 }
3314 }
3315 }
3316
3317 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3318
3319 extern struct ModuleImport * mainModule;
3320
3321 extern struct Specifier * MkSpecifierName(const char *  name);
3322
3323 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3324
3325 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3326
3327 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3328
3329 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3330
3331 extern void FreeDeclarator(struct Declarator * decl);
3332
3333 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3334
3335 struct PropertyImport
3336 {
3337 struct PropertyImport * prev;
3338 struct PropertyImport * next;
3339 char *  name;
3340 unsigned int isVirtual;
3341 unsigned int hasSet;
3342 unsigned int hasGet;
3343 } __attribute__ ((gcc_struct));
3344
3345 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3346
3347 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3348 {
3349 struct Symbol * symbol = prop->symbol;
3350
3351 strcpy(setName, "__ecereProp_");
3352 FullClassNameCat(setName, prop->_class->fullName, 0);
3353 strcat(setName, "_Set_");
3354 FullClassNameCat(setName, prop->name, 1);
3355 strcpy(getName, "__ecereProp_");
3356 FullClassNameCat(getName, prop->_class->fullName, 0);
3357 strcat(getName, "_Get_");
3358 FullClassNameCat(getName, prop->name, 1);
3359 if(prop->_class->type == 1)
3360 DeclareStruct(prop->_class->fullName, 0);
3361 if(!symbol || curExternal->symbol->idCode < symbol->id)
3362 {
3363 unsigned int imported = 0;
3364 unsigned int dllImport = 0;
3365
3366 if(!symbol || symbol->_import)
3367 {
3368 if(!symbol)
3369 {
3370 struct Symbol * classSym;
3371
3372 if(!prop->_class->symbol)
3373 prop->_class->symbol = FindClass(prop->_class->fullName);
3374 classSym = prop->_class->symbol;
3375 if(classSym && !classSym->_import)
3376 {
3377 struct ModuleImport * module;
3378
3379 if(prop->_class->module)
3380 module = FindModule(prop->_class->module);
3381 else
3382 module = mainModule;
3383 classSym->_import = __extension__ ({
3384 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3385
3386 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3387 });
3388 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3389 }
3390 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3391 symbol->_import = (struct ClassImport *)__extension__ ({
3392 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3393
3394 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3395 });
3396 if(classSym)
3397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3398 }
3399 imported = 1;
3400 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3401 dllImport = 1;
3402 }
3403 if(!symbol->type)
3404 {
3405 struct Context * context = SetupTemplatesContext(prop->_class);
3406
3407 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3408 FinishTemplatesContext(context);
3409 }
3410 if(prop->Get)
3411 {
3412 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3413 {
3414 struct Declaration * decl;
3415 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3416 struct Declarator * d;
3417 struct __ecereNameSpace__ecere__sys__OldList * params;
3418 struct Specifier * spec;
3419 struct External * external;
3420 struct Declarator * typeDecl;
3421 unsigned int simple = 0;
3422
3423 specifiers = MkList();
3424 declarators = MkList();
3425 params = MkList();
3426 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3427 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3428 if(dllImport)
3429 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3430 {
3431 struct Context * context = SetupTemplatesContext(prop->_class);
3432
3433 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3434 FinishTemplatesContext(context);
3435 }
3436 for(spec = (*specifiers).first; spec; spec = spec->next)
3437 {
3438 if(spec->type == 1)
3439 {
3440 if((!typeDecl || typeDecl->type == 1))
3441 {
3442 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3443
3444 symbol->_class = classSym->__anon1.registered;
3445 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3446 {
3447 DeclareStruct(spec->__anon1.__anon1.name, 0);
3448 simple = 1;
3449 }
3450 }
3451 }
3452 }
3453 if(!simple)
3454 d = PlugDeclarator(typeDecl, d);
3455 else
3456 {
3457 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3458 specifiers = MkList();
3459 }
3460 d = MkDeclaratorFunction(d, params);
3461 if(dllImport)
3462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3463 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3465 if(simple)
3466 ListAdd(specifiers, MkSpecifier(VOID));
3467 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3468 decl = MkDeclaration(specifiers, declarators);
3469 external = MkExternalDeclaration(decl);
3470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3471 external->symbol = symbol;
3472 symbol->__anon2.__anon2.externalGet = external;
3473 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3474 if(typeDecl)
3475 FreeDeclarator(typeDecl);
3476 }
3477 else
3478 {
3479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3480 }
3481 }
3482 if(prop->Set)
3483 {
3484 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3485 {
3486 struct Declaration * decl;
3487 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3488 struct Declarator * d;
3489 struct __ecereNameSpace__ecere__sys__OldList * params;
3490 struct Specifier * spec;
3491 struct External * external;
3492 struct Declarator * typeDecl;
3493
3494 declarators = MkList();
3495 params = MkList();
3496 if(!prop->conversion || prop->_class->type == 1)
3497 {
3498 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3499 }
3500 specifiers = MkList();
3501 {
3502 struct Context * context = SetupTemplatesContext(prop->_class);
3503
3504 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3505 FinishTemplatesContext(context);
3506 }
3507 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3508 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3509 ListAdd(params, MkTypeName(specifiers, d));
3510 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3511 if(dllImport)
3512 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3513 d = MkDeclaratorFunction(d, params);
3514 for(spec = (*specifiers).first; spec; spec = spec->next)
3515 {
3516 if(spec->type == 1)
3517 {
3518 if((!typeDecl || typeDecl->type == 1))
3519 {
3520 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3521
3522 symbol->_class = classSym->__anon1.registered;
3523 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3524 DeclareStruct(spec->__anon1.__anon1.name, 0);
3525 }
3526 }
3527 }
3528 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3529 specifiers = MkList();
3530 if(dllImport)
3531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3532 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3533 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3534 if(!prop->conversion || prop->_class->type == 1)
3535 ListAdd(specifiers, MkSpecifier(VOID));
3536 else
3537 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3538 decl = MkDeclaration(specifiers, declarators);
3539 external = MkExternalDeclaration(decl);
3540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3541 external->symbol = symbol;
3542 symbol->__anon2.__anon2.externalSet = external;
3543 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3544 }
3545 else
3546 {
3547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3548 }
3549 }
3550 if(!symbol->__anon2.__anon2.externalPtr)
3551 {
3552 struct Declaration * decl;
3553 struct External * external;
3554 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3555 char propName[1024];
3556
3557 if(imported)
3558 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3559 else
3560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3561 ListAdd(specifiers, MkSpecifierName("Property"));
3562 strcpy(propName, "__ecereProp_");
3563 FullClassNameCat(propName, prop->_class->fullName, 0);
3564 strcat(propName, "_");
3565 FullClassNameCat(propName, prop->name, 1);
3566 {
3567 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3568
3569 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3570 if(!imported)
3571 {
3572 strcpy(propName, "__ecerePropM_");
3573 FullClassNameCat(propName, prop->_class->fullName, 0);
3574 strcat(propName, "_");
3575 FullClassNameCat(propName, prop->name, 1);
3576 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3577 }
3578 decl = MkDeclaration(specifiers, list);
3579 }
3580 external = MkExternalDeclaration(decl);
3581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3582 external->symbol = symbol;
3583 symbol->__anon2.__anon2.externalPtr = external;
3584 }
3585 else
3586 {
3587 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3588 }
3589 symbol->id = curExternal->symbol->idCode;
3590 }
3591 }
3592
3593 struct Type * Dereference(struct Type * source)
3594 {
3595 struct Type * type = (((void *)0));
3596
3597 if(source)
3598 {
3599 if(source->kind == 13 || source->kind == 12)
3600 {
3601 type = source->__anon1.type;
3602 source->__anon1.type->refCount++;
3603 }
3604 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3605 {
3606 type = __extension__ ({
3607 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3608
3609 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3610 });
3611 }
3612 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3613 {
3614 type = source;
3615 source->refCount++;
3616 }
3617 else
3618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3619 }
3620 return type;
3621 }
3622
3623 static struct Type * Reference(struct Type * source)
3624 {
3625 struct Type * type = (((void *)0));
3626
3627 if(source)
3628 {
3629 type = __extension__ ({
3630 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3631
3632 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3633 });
3634 source->refCount++;
3635 }
3636 return type;
3637 }
3638
3639 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);
3640
3641 extern void *  memcpy(void * , const void * , size_t size);
3642
3643 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3644
3645 extern void FreeExpression(struct Expression * exp);
3646
3647 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3648
3649 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, unsigned int warnConst);
3650
3651 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3652
3653 extern struct Type * MkClassType(const char *  name);
3654
3655 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
3656
3657 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)
3658 {
3659 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3660 unsigned int found = 0;
3661 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3662 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3663 unsigned int freeType = 0;
3664
3665 yylloc = member->loc;
3666 if(!ident)
3667 {
3668 if(curMember)
3669 {
3670 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3671 if(*curMember)
3672 {
3673 found = 1;
3674 dataMember = *curMember;
3675 }
3676 }
3677 }
3678 else
3679 {
3680 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3681 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3682 int _subMemberStackPos = 0;
3683
3684 if(!thisMember)
3685 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3686 if(thisMember)
3687 {
3688 dataMember = thisMember;
3689 if(curMember && thisMember->memberAccess == 1)
3690 {
3691 *curMember = thisMember;
3692 *curClass = thisMember->_class;
3693 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3694 *subMemberStackPos = _subMemberStackPos;
3695 }
3696 found = 1;
3697 }
3698 else
3699 {
3700 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3701 if(method && method->type == 1)
3702 found = 1;
3703 else
3704 method = (((void *)0));
3705 }
3706 }
3707 if(found)
3708 {
3709 struct Type * type = (((void *)0));
3710
3711 if(dataMember)
3712 {
3713 if(!dataMember->dataType && dataMember->dataTypeString)
3714 {
3715 struct Context * context = SetupTemplatesContext(_class);
3716
3717 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3718 FinishTemplatesContext(context);
3719 }
3720 type = dataMember->dataType;
3721 }
3722 else if(method)
3723 {
3724 if(!method->dataType)
3725 ProcessMethodType(method);
3726 type = method->dataType;
3727 }
3728 if(ident && ident->next)
3729 {
3730 for(ident = ident->next; ident && type; ident = ident->next)
3731 {
3732 if(type->kind == 8)
3733 {
3734 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3735 if(!dataMember)
3736 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3737 if(dataMember)
3738 type = dataMember->dataType;
3739 }
3740 else if(type->kind == 9 || type->kind == 10)
3741 {
3742 struct Type * memberType;
3743
3744 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3745 {
3746 if(!strcmp(memberType->name, ident->string))
3747 {
3748 type = memberType;
3749 break;
3750 }
3751 }
3752 }
3753 }
3754 }
3755 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3756 {
3757 int id = 0;
3758 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3759 struct __ecereNameSpace__ecere__com__Class * sClass;
3760
3761 for(sClass = _class; sClass; sClass = sClass->base)
3762 {
3763 id = 0;
3764 if(sClass->templateClass)
3765 sClass = sClass->templateClass;
3766 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3767 {
3768 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3769 {
3770 for(sClass = sClass->base; sClass; sClass = sClass->base)
3771 {
3772 if(sClass->templateClass)
3773 sClass = sClass->templateClass;
3774 id += sClass->templateParams.count;
3775 }
3776 break;
3777 }
3778 id++;
3779 }
3780 if(curParam)
3781 break;
3782 }
3783 if(curParam)
3784 {
3785 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3786
3787 if(arg.__anon1.__anon1.dataTypeString)
3788 {
3789 unsigned int constant = type->constant;
3790
3791 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3792 if(type->kind == 8 && constant)
3793 type->constant = 1;
3794 else if(type->kind == 13)
3795 {
3796 struct Type * t = type->__anon1.type;
3797
3798 while(t->kind == 13)
3799 t = t->__anon1.type;
3800 if(constant)
3801 t->constant = constant;
3802 }
3803 freeType = 1;
3804 if(type && _class->templateClass)
3805 type->passAsTemplate = 1;
3806 if(type)
3807 {
3808 }
3809 }
3810 }
3811 }
3812 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3813 {
3814 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3815 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3816 int paramCount = 0;
3817 int lastParam = -1;
3818 char templateString[1024];
3819 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3820
3821 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3822 for(cClass = expClass; cClass; cClass = cClass->base)
3823 {
3824 int p = 0;
3825
3826 if(cClass->templateClass)
3827 cClass = cClass->templateClass;
3828 for(param = cClass->templateParams.first; param; param = param->next)
3829 {
3830 int id = p;
3831 struct __ecereNameSpace__ecere__com__Class * sClass;
3832 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3833
3834 for(sClass = cClass->base; sClass; sClass = sClass->base)
3835 {
3836 if(sClass->templateClass)
3837 sClass = sClass->templateClass;
3838 id += sClass->templateParams.count;
3839 }
3840 arg = expClass->templateArgs[id];
3841 for(sClass = _class; sClass; sClass = sClass->base)
3842 {
3843 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3844 int p = 0;
3845 struct __ecereNameSpace__ecere__com__Class * nextClass;
3846
3847 if(sClass->templateClass)
3848 sClass = sClass->templateClass;
3849 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3850 {
3851 if(nextClass->templateClass)
3852 nextClass = nextClass->templateClass;
3853 p += nextClass->templateParams.count;
3854 }
3855 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3856 {
3857 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3858 {
3859 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3860 {
3861 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3862 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3863 break;
3864 }
3865 }
3866 }
3867 }
3868 {
3869 char argument[256];
3870
3871 argument[0] = '\0';
3872 switch(param->type)
3873 {
3874 case 2:
3875 {
3876 char expString[1024];
3877 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3878 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3879 struct Expression * exp;
3880 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3881
3882 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3883 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3884 ProcessExpressionType(exp);
3885 ComputeExpression(exp);
3886 expString[0] = '\0';
3887 PrintExpression(exp, expString);
3888 strcat(argument, expString);
3889 FreeExpression(exp);
3890 break;
3891 }
3892 case 1:
3893 {
3894 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3895 break;
3896 }
3897 case 0:
3898 {
3899 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3900 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3901 break;
3902 }
3903 }
3904 if(argument[0])
3905 {
3906 if(paramCount)
3907 strcat(templateString, ", ");
3908 if(lastParam != p - 1)
3909 {
3910 strcat(templateString, param->name);
3911 strcat(templateString, " = ");
3912 }
3913 strcat(templateString, argument);
3914 paramCount++;
3915 lastParam = p;
3916 }
3917 p++;
3918 }
3919 }
3920 }
3921 {
3922 int len = strlen(templateString);
3923
3924 if(templateString[len - 1] == '<')
3925 len--;
3926 else
3927 {
3928 if(templateString[len - 1] == '>')
3929 templateString[len++] = ' ';
3930 templateString[len++] = '>';
3931 }
3932 templateString[len++] = '\0';
3933 }
3934 {
3935 struct Context * context = SetupTemplatesContext(_class);
3936
3937 if(freeType)
3938 FreeType(type);
3939 type = ProcessTypeString(templateString, 0);
3940 freeType = 1;
3941 FinishTemplatesContext(context);
3942 }
3943 }
3944 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3945 {
3946 ProcessExpressionType(member->initializer->__anon1.exp);
3947 if(!member->initializer->__anon1.exp->expType)
3948 {
3949 if(inCompiler)
3950 {
3951 char expString[10240];
3952
3953 expString[0] = '\0';
3954 PrintExpression(member->initializer->__anon1.exp, expString);
3955 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3957 }
3958 }
3959 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3960 {
3961 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3962 }
3963 }
3964 else if(member->initializer)
3965 {
3966 ProcessInitializer(member->initializer, type);
3967 }
3968 if(freeType)
3969 FreeType(type);
3970 }
3971 else
3972 {
3973 if(_class && _class->type == 3)
3974 {
3975 if(member->initializer)
3976 {
3977 struct Type * type = MkClassType(_class->fullName);
3978
3979 ProcessInitializer(member->initializer, type);
3980 FreeType(type);
3981 }
3982 }
3983 else
3984 {
3985 if(member->initializer)
3986 {
3987 ProcessInitializer(member->initializer, (((void *)0)));
3988 }
3989 if(ident)
3990 {
3991 if(method)
3992 {
3993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3994 }
3995 else if(_class)
3996 {
3997 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3998 if(inCompiler)
3999 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4000 }
4001 }
4002 else if(_class)
4003 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4004 }
4005 }
4006 }
4007
4008 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);
4009
4010 extern void FreeSpecifier(struct Specifier * spec);
4011
4012 static void ProcessFunction(struct FunctionDefinition * function);
4013
4014 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4015
4016 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4017
4018 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4019
4020 extern void FreeClassFunction(struct ClassFunction * func);
4021
4022 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4023
4024 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4025
4026 void ProcessInstantiationType(struct Instantiation * inst)
4027 {
4028 yylloc = inst->loc;
4029 if(inst->_class)
4030 {
4031 struct MembersInit * members;
4032 struct Symbol * classSym;
4033 struct __ecereNameSpace__ecere__com__Class * _class;
4034
4035 classSym = inst->_class->__anon1.__anon1.symbol;
4036 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4037 if(!_class || _class->type != 5)
4038 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4039 afterExternal = afterExternal ? afterExternal : curExternal;
4040 if(inst->exp)
4041 ProcessExpressionType(inst->exp);
4042 inst->isConstant = 1;
4043 if(inst->members)
4044 {
4045 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4046 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4047 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4048 int subMemberStackPos = 0;
4049
4050 for(members = (*inst->members).first; members; members = members->next)
4051 {
4052 switch(members->type)
4053 {
4054 case 1:
4055 {
4056 char name[1024];
4057 static unsigned int instMethodID = 0;
4058 struct External * external = curExternal;
4059 struct Context * context = curContext;
4060 struct Declarator * declarator = members->__anon1.function->declarator;
4061 struct Identifier * nameID = GetDeclId(declarator);
4062 char * unmangled = nameID ? nameID->string : (((void *)0));
4063 struct Expression * exp;
4064 struct External * createdExternal = (((void *)0));
4065
4066 if(inCompiler)
4067 {
4068 char number[16];
4069
4070 strcpy(name, "__ecereInstMeth_");
4071 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4072 strcat(name, "_");
4073 strcat(name, nameID->string);
4074 strcat(name, "_");
4075 sprintf(number, "_%08d", instMethodID++);
4076 strcat(name, number);
4077 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4078 }
4079 if(declarator)
4080 {
4081 struct Symbol * symbol = declarator->symbol;
4082 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4083
4084 if(method && method->type == 1)
4085 {
4086 symbol->__anon1.method = method;
4087 ProcessMethodType(method);
4088 if(!symbol->type->__anon1.__anon2.thisClass)
4089 {
4090 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4091 {
4092 if(!currentClass->symbol)
4093 currentClass->symbol = FindClass(currentClass->fullName);
4094 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4095 }
4096 else
4097 {
4098 if(!_class->symbol)
4099 _class->symbol = FindClass(_class->fullName);
4100 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4101 }
4102 }
4103 DeclareType(symbol->type, 1, 1);
4104 }
4105 else if(classSym)
4106 {
4107 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4108 }
4109 }
4110 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4111 if(nameID)
4112 {
4113 FreeSpecifier(nameID->_class);
4114 nameID->_class = (((void *)0));
4115 }
4116 if(inCompiler)
4117 {
4118 struct External * oldExternal = curExternal;
4119
4120 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4121 {
4122 struct External * externalDecl;
4123
4124 externalDecl = MkExternalDeclaration((((void *)0)));
4125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4126 if(createdExternal->__anon1.function)
4127 {
4128 ProcessFunction(createdExternal->__anon1.function);
4129 {
4130 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4131
4132 externalDecl->__anon1.declaration = decl;
4133 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4134 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4135 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4136 }
4137 }
4138 }
4139 }
4140 else if(declarator)
4141 {
4142 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4143 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4144 }
4145 curExternal = external;
4146 curContext = context;
4147 if(inCompiler)
4148 {
4149 FreeClassFunction(members->__anon1.function);
4150 exp = QMkExpId(name);
4151 members->type = 0;
4152 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4153 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4154 }
4155 break;
4156 }
4157 case 0:
4158 {
4159 if(members->__anon1.dataMembers && classSym)
4160 {
4161 struct MemberInit * member;
4162 struct Location oldyyloc = yylloc;
4163
4164 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4165 {
4166 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4167 if(member->initializer && !member->initializer->isConstant)
4168 inst->isConstant = 0;
4169 }
4170 yylloc = oldyyloc;
4171 }
4172 break;
4173 }
4174 }
4175 }
4176 }
4177 }
4178 }
4179
4180 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4181 {
4182 if(inCompiler)
4183 {
4184 if(type->kind == 11)
4185 {
4186 struct Type * param;
4187
4188 if(declareParams)
4189 {
4190 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4191 DeclareType(param, declarePointers, 1);
4192 }
4193 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4194 }
4195 else if(type->kind == 13 && declarePointers)
4196 DeclareType(type->__anon1.type, declarePointers, 0);
4197 else if(type->kind == 8)
4198 {
4199 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4200 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4201 }
4202 else if(type->kind == 9 || type->kind == 10)
4203 {
4204 struct Type * member;
4205
4206 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4207 DeclareType(member, 0, 0);
4208 }
4209 else if(type->kind == 12)
4210 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4211 }
4212 }
4213
4214 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4215
4216 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4217 {
4218 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4219 int id = 0;
4220 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4221 struct __ecereNameSpace__ecere__com__Class * sClass;
4222
4223 for(sClass = _class; sClass; sClass = sClass->base)
4224 {
4225 id = 0;
4226 if(sClass->templateClass)
4227 sClass = sClass->templateClass;
4228 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4229 {
4230 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4231 {
4232 for(sClass = sClass->base; sClass; sClass = sClass->base)
4233 {
4234 if(sClass->templateClass)
4235 sClass = sClass->templateClass;
4236 id += sClass->templateParams.count;
4237 }
4238 break;
4239 }
4240 id++;
4241 }
4242 if(curParam)
4243 break;
4244 }
4245 if(curParam)
4246 {
4247 arg = &_class->templateArgs[id];
4248 if(arg && param->type == 0)
4249 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4250 }
4251 return arg;
4252 }
4253
4254 extern struct Context * PushContext(void);
4255
4256 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4257
4258 struct TemplatedType
4259 {
4260 uintptr_t key;
4261 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4262 struct __ecereNameSpace__ecere__sys__BTNode * left;
4263 struct __ecereNameSpace__ecere__sys__BTNode * right;
4264 int depth;
4265 struct TemplateParameter * param;
4266 } __attribute__ ((gcc_struct));
4267
4268 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4269
4270 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4271 {
4272 struct Context * context = PushContext();
4273
4274 context->templateTypesOnly = 1;
4275 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4276 {
4277 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4278
4279 for(; param; param = param->next)
4280 {
4281 if(param->type == 0 && param->identifier)
4282 {
4283 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4284
4285 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4286 }
4287 }
4288 }
4289 else if(_class)
4290 {
4291 struct __ecereNameSpace__ecere__com__Class * sClass;
4292
4293 for(sClass = _class; sClass; sClass = sClass->base)
4294 {
4295 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4296
4297 for(p = sClass->templateParams.first; p; p = p->next)
4298 {
4299 if(p->type == 0)
4300 {
4301 struct TemplateParameter * param = p->param;
4302 struct TemplatedType * type;
4303
4304 if(!param)
4305 {
4306 p->param = param = __extension__ ({
4307 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4308
4309 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4310 });
4311 }
4312 type = __extension__ ({
4313 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4314
4315 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4316 });
4317 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4318 }
4319 }
4320 }
4321 }
4322 return context;
4323 }
4324
4325 extern void PopContext(struct Context * ctx);
4326
4327 extern void FreeContext(struct Context * context);
4328
4329 void FinishTemplatesContext(struct Context * context)
4330 {
4331 PopContext(context);
4332 FreeContext(context);
4333 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4334 }
4335
4336 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4337 {
4338 if(!method->dataType)
4339 {
4340 struct Context * context = SetupTemplatesContext(method->_class);
4341
4342 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4343 FinishTemplatesContext(context);
4344 if(method->type != 1 && method->dataType)
4345 {
4346 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4347 {
4348 if(!method->_class->symbol)
4349 method->_class->symbol = FindClass(method->_class->fullName);
4350 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4351 }
4352 }
4353 }
4354 }
4355
4356 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4357 {
4358 if(!prop->dataType)
4359 {
4360 struct Context * context = SetupTemplatesContext(prop->_class);
4361
4362 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4363 FinishTemplatesContext(context);
4364 }
4365 }
4366
4367 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4368
4369 extern void FreeTypeName(struct TypeName * typeName);
4370
4371 static void ProcessDeclarator(struct Declarator * decl);
4372
4373 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4374
4375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4376
4377 struct MethodImport
4378 {
4379 struct MethodImport * prev;
4380 struct MethodImport * next;
4381 char *  name;
4382 unsigned int isVirtual;
4383 } __attribute__ ((gcc_struct));
4384
4385 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4386
4387 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4388 {
4389 struct Symbol * symbol = method->symbol;
4390
4391 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4392 {
4393 unsigned int dllImport = 0;
4394
4395 if(!method->dataType)
4396 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4397 if(!symbol || symbol->_import || method->type == 1)
4398 {
4399 if(!symbol || method->type == 1)
4400 {
4401 struct Symbol * classSym;
4402
4403 if(!method->_class->symbol)
4404 method->_class->symbol = FindClass(method->_class->fullName);
4405 classSym = method->_class->symbol;
4406 if(!classSym->_import)
4407 {
4408 struct ModuleImport * module;
4409
4410 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4411 module = FindModule(method->_class->module);
4412 else
4413 module = mainModule;
4414 classSym->_import = __extension__ ({
4415 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4416
4417 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4418 });
4419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4420 }
4421 if(!symbol)
4422 {
4423 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4424 }
4425 if(!symbol->_import)
4426 {
4427 symbol->_import = (struct ClassImport *)__extension__ ({
4428 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4429
4430 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4431 });
4432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4433 }
4434 if(!symbol)
4435 {
4436 symbol->type = method->dataType;
4437 if(symbol->type)
4438 symbol->type->refCount++;
4439 }
4440 }
4441 if(!method->dataType->dllExport)
4442 {
4443 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4444 dllImport = 1;
4445 }
4446 }
4447 if(method->type != 1 && method->dataType)
4448 DeclareType(method->dataType, 1, 1);
4449 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4450 {
4451 struct Declaration * decl;
4452 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4453 struct Declarator * d;
4454 struct Declarator * funcDecl;
4455 struct External * external;
4456
4457 specifiers = MkList();
4458 declarators = MkList();
4459 if(dllImport)
4460 ListAdd(specifiers, MkSpecifier(EXTERN));
4461 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4462 ListAdd(specifiers, MkSpecifier(STATIC));
4463 if(method->type == 1)
4464 {
4465 ListAdd(specifiers, MkSpecifier(INT));
4466 d = MkDeclaratorIdentifier(MkIdentifier(name));
4467 }
4468 else
4469 {
4470 d = MkDeclaratorIdentifier(MkIdentifier(name));
4471 if(dllImport)
4472 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4473 {
4474 struct Context * context = SetupTemplatesContext(method->_class);
4475
4476 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4477 FinishTemplatesContext(context);
4478 }
4479 funcDecl = GetFuncDecl(d);
4480 if(dllImport)
4481 {
4482 struct Specifier * spec, * next;
4483
4484 for(spec = (*specifiers).first; spec; spec = next)
4485 {
4486 next = spec->next;
4487 if(spec->type == 5)
4488 {
4489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4490 FreeSpecifier(spec);
4491 }
4492 }
4493 }
4494 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4495 {
4496 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4497 {
4498 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4499 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4500 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4501 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4502
4503 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4504 {
4505 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4506
4507 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4508 FreeTypeName(param);
4509 }
4510 if(!funcDecl->__anon1.function.parameters)
4511 funcDecl->__anon1.function.parameters = MkList();
4512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4513 }
4514 }
4515 }
4516 ProcessDeclarator(d);
4517 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4518 decl = MkDeclaration(specifiers, declarators);
4519 ReplaceThisClassSpecifiers(specifiers, method->_class);
4520 if(symbol->__anon2.__anon1.pointerExternal)
4521 {
4522 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4523
4524 {
4525 *functionSymbol = *symbol;
4526 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4527 if(functionSymbol->type)
4528 functionSymbol->type->refCount++;
4529 }
4530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4531 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4532 }
4533 external = MkExternalDeclaration(decl);
4534 if(curExternal)
4535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4536 external->symbol = symbol;
4537 symbol->__anon2.__anon1.pointerExternal = external;
4538 }
4539 else if(ast)
4540 {
4541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4542 }
4543 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4544 }
4545 }
4546
4547 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4548 {
4549 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4550 {
4551 unsigned int first = 1;
4552 int p = 0;
4553 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4554 int lastParam = -1;
4555 char className[1024];
4556
4557 strcpy(className, _class->fullName);
4558 for(param = _class->templateParams.first; param; param = param->next)
4559 {
4560 {
4561 if(first)
4562 strcat(className, "<");
4563 if(!first)
4564 strcat(className, ", ");
4565 if(lastParam + 1 != p)
4566 {
4567 strcat(className, param->name);
4568 strcat(className, " = ");
4569 }
4570 strcat(className, param->name);
4571 first = 0;
4572 lastParam = p;
4573 }
4574 p++;
4575 }
4576 if(!first)
4577 {
4578 int len = strlen(className);
4579
4580 if(className[len - 1] == '>')
4581 className[len++] = ' ';
4582 className[len++] = '>';
4583 className[len++] = '\0';
4584 }
4585 return __ecereNameSpace__ecere__sys__CopyString(className);
4586 }
4587 else
4588 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4589 }
4590
4591 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4592 {
4593 struct Type * type;
4594
4595 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4596 {
4597 unsigned int first = 1;
4598 int p = 0;
4599 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4600 int lastParam = -1;
4601 char className[1024];
4602
4603 strcpy(className, _class->fullName);
4604 for(param = _class->templateParams.first; param; param = param->next)
4605 {
4606 {
4607 if(first)
4608 strcat(className, "<");
4609 if(!first)
4610 strcat(className, ", ");
4611 if(lastParam + 1 != p)
4612 {
4613 strcat(className, param->name);
4614 strcat(className, " = ");
4615 }
4616 strcat(className, param->name);
4617 first = 0;
4618 lastParam = p;
4619 }
4620 p++;
4621 }
4622 if(!first)
4623 {
4624 int len = strlen(className);
4625
4626 if(className[len - 1] == '>')
4627 className[len++] = ' ';
4628 className[len++] = '>';
4629 className[len++] = '\0';
4630 }
4631 type = MkClassType(className);
4632 }
4633 else
4634 {
4635 type = MkClassType(_class->fullName);
4636 }
4637 return type;
4638 }
4639
4640 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4641 {
4642 if(specs != (((void *)0)) && _class)
4643 {
4644 struct Specifier * spec;
4645
4646 for(spec = specs->first; spec; spec = spec->next)
4647 {
4648 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4649 {
4650 spec->type = 1;
4651 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4652 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4653 }
4654 }
4655 }
4656 }
4657
4658 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4659
4660 struct __ecereNameSpace__ecere__com__GlobalFunction
4661 {
4662 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4663 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4664 const char *  name;
4665 int (*  function)();
4666 struct __ecereNameSpace__ecere__com__Instance * module;
4667 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4668 const char *  dataTypeString;
4669 struct Type * dataType;
4670 void *  symbol;
4671 } __attribute__ ((gcc_struct));
4672
4673 extern struct Context * globalContext;
4674
4675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4676
4677 struct FunctionImport
4678 {
4679 struct FunctionImport * prev;
4680 struct FunctionImport * next;
4681 char *  name;
4682 } __attribute__ ((gcc_struct));
4683
4684 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4685 {
4686 struct Symbol * symbol = function->symbol;
4687
4688 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4689 {
4690 unsigned int imported = 0;
4691 unsigned int dllImport = 0;
4692
4693 if(!function->dataType)
4694 {
4695 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4696 if(!function->dataType->__anon1.__anon2.thisClass)
4697 function->dataType->__anon1.__anon2.staticMethod = 1;
4698 }
4699 if(inCompiler)
4700 {
4701 if(!symbol)
4702 {
4703 struct ModuleImport * module = FindModule(function->module);
4704
4705 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4706 if(module->name)
4707 {
4708 if(!function->dataType->dllExport)
4709 {
4710 symbol->_import = (struct ClassImport *)__extension__ ({
4711 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4712
4713 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4714 });
4715 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4716 }
4717 }
4718 {
4719 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4720 if(!symbol->type->__anon1.__anon2.thisClass)
4721 symbol->type->__anon1.__anon2.staticMethod = 1;
4722 }
4723 }
4724 imported = symbol->_import ? 1 : 0;
4725 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4726 dllImport = 1;
4727 }
4728 DeclareType(function->dataType, 1, 1);
4729 if(inCompiler)
4730 {
4731 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4732 {
4733 struct Declaration * decl;
4734 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4735 struct Declarator * d;
4736 struct Declarator * funcDecl;
4737 struct External * external;
4738
4739 specifiers = MkList();
4740 declarators = MkList();
4741 ListAdd(specifiers, MkSpecifier(EXTERN));
4742 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4743 if(dllImport)
4744 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4745 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4746 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4747 {
4748 struct Specifier * spec;
4749
4750 for(spec = (*specifiers).first; spec; spec = spec->next)
4751 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4752 {
4753 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4754 FreeSpecifier(spec);
4755 break;
4756 }
4757 }
4758 funcDecl = GetFuncDecl(d);
4759 if(funcDecl && !funcDecl->__anon1.function.parameters)
4760 {
4761 funcDecl->__anon1.function.parameters = MkList();
4762 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4763 }
4764 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4765 {
4766 struct Context * oldCtx = curContext;
4767
4768 curContext = globalContext;
4769 decl = MkDeclaration(specifiers, declarators);
4770 curContext = oldCtx;
4771 }
4772 if(symbol->__anon2.__anon1.pointerExternal)
4773 {
4774 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4775
4776 {
4777 *functionSymbol = *symbol;
4778 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4779 if(functionSymbol->type)
4780 functionSymbol->type->refCount++;
4781 }
4782 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4783 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4784 }
4785 external = MkExternalDeclaration(decl);
4786 if(curExternal)
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4788 external->symbol = symbol;
4789 symbol->__anon2.__anon1.pointerExternal = external;
4790 }
4791 else
4792 {
4793 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4794 }
4795 if(curExternal)
4796 symbol->id = curExternal->symbol->idCode;
4797 }
4798 }
4799 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4800 }
4801
4802 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4803
4804 struct GlobalData
4805 {
4806 uintptr_t key;
4807 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4808 struct __ecereNameSpace__ecere__sys__BTNode * left;
4809 struct __ecereNameSpace__ecere__sys__BTNode * right;
4810 int depth;
4811 struct __ecereNameSpace__ecere__com__Instance * module;
4812 char *  dataTypeString;
4813 struct Type * dataType;
4814 void *  symbol;
4815 char *  fullName;
4816 } __attribute__ ((gcc_struct));
4817
4818 void DeclareGlobalData(struct GlobalData * data)
4819 {
4820 struct Symbol * symbol = data->symbol;
4821
4822 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4823 {
4824 if(inCompiler)
4825 {
4826 if(!symbol)
4827 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4828 }
4829 if(!data->dataType)
4830 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4831 DeclareType(data->dataType, 1, 1);
4832 if(inCompiler)
4833 {
4834 if(!symbol->__anon2.__anon1.pointerExternal)
4835 {
4836 struct Declaration * decl;
4837 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4838 struct Declarator * d;
4839 struct External * external;
4840
4841 specifiers = MkList();
4842 declarators = MkList();
4843 ListAdd(specifiers, MkSpecifier(EXTERN));
4844 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4845 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4846 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4847 decl = MkDeclaration(specifiers, declarators);
4848 external = MkExternalDeclaration(decl);
4849 if(curExternal)
4850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4851 external->symbol = symbol;
4852 symbol->__anon2.__anon1.pointerExternal = external;
4853 }
4854 else
4855 {
4856 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4857 }
4858 if(curExternal)
4859 symbol->id = curExternal->symbol->idCode;
4860 }
4861 }
4862 }
4863
4864 struct Conversion
4865 {
4866 struct Conversion * prev, * next;
4867 struct __ecereNameSpace__ecere__com__Property * convert;
4868 unsigned int isGet;
4869 struct Type * resultType;
4870 } __attribute__ ((gcc_struct));
4871
4872 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4873
4874 extern void Compiler_Warning(const char *  format, ...);
4875
4876 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4877 {
4878 unsigned int status = 1;
4879
4880 if(((source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered) || dest->kind == 13))
4881 {
4882 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4883 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4884
4885 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4886 {
4887 struct Type * sourceType = source, * destType = dest;
4888
4889 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4890 sourceType = sourceType->__anon1.type;
4891 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4892 destType = destType->__anon1.type;
4893 if(!destType->constant && sourceType->constant)
4894 {
4895 status = 0;
4896 if(warn)
4897 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4898 }
4899 }
4900 }
4901 return status;
4902 }
4903
4904 extern void CopyTypeInto(struct Type * type, struct Type * src);
4905
4906 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4907
4908 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, unsigned int warnConst)
4909 {
4910 if(source && dest)
4911 {
4912 if(warnConst)
4913 CheckConstCompatibility(source, dest, 1);
4914 if(source->kind == 20 && dest->kind != 20)
4915 {
4916 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4917
4918 if(type)
4919 source = type;
4920 }
4921 if(dest->kind == 20 && source->kind != 20)
4922 {
4923 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4924
4925 if(type)
4926 dest = type;
4927 }
4928 if(dest->classObjectType == 2 && dest->kind != 11)
4929 {
4930 if(source->classObjectType != 3)
4931 return 1;
4932 else
4933 {
4934 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4935 {
4936 return 1;
4937 }
4938 }
4939 }
4940 else
4941 {
4942 if(source->kind != 11 && source->classObjectType == 3)
4943 return 1;
4944 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4945 return 1;
4946 }
4947 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4948 {
4949 if((dest->__anon1.__anon1.enumName && source->__anon1.__anon1.enumName && !strcmp(dest->__anon1.__anon1.enumName, source->__anon1.__anon1.enumName)) || (source->__anon1.__anon1.members.first && source->__anon1.__anon1.members.first == dest->__anon1.__anon1.members.first))
4950 return 1;
4951 }
4952 if(dest->kind == 14 && source->kind != 0)
4953 return 1;
4954 if(dest->kind == 13 && dest->__anon1.type->kind == 0 && ((source->kind == 8 && (!source->__anon1._class || !source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type == 1 || source->__anon1._class->__anon1.registered->type == 0 || source->__anon1._class->__anon1.registered->type == 5 || source->__anon1._class->__anon1.registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4955 return 1;
4956 if(!isConversionExploration && source->kind == 13 && source->__anon1.type->kind == 0 && ((dest->kind == 8 && (!dest->__anon1._class || !dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type == 1 || dest->__anon1._class->__anon1.registered->type == 0 || dest->__anon1._class->__anon1.registered->type == 5 || dest->__anon1._class->__anon1.registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4957 return 1;
4958 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4959 {
4960 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4961 {
4962 if(conversions != (((void *)0)))
4963 {
4964 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4965 return 1;
4966 }
4967 else
4968 {
4969 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4970
4971 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4972 ;
4973 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4974 ;
4975 if(sourceBase == destBase)
4976 return 1;
4977 }
4978 }
4979 else if(source->__anon1._class && dest->__anon1._class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type != 4) || (!dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, dest->__anon1._class->__anon1.registered))
4980 return 1;
4981 else
4982 {
4983 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
4984 {
4985 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4986 {
4987 return 1;
4988 }
4989 }
4990 }
4991 }
4992 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
4993 return 1;
4994 if(doConversion)
4995 {
4996 if(source->kind == 8)
4997 {
4998 struct __ecereNameSpace__ecere__com__Class * _class;
4999
5000 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5001 {
5002 struct __ecereNameSpace__ecere__com__Property * convert;
5003
5004 for(convert = _class->conversions.first; convert; convert = convert->next)
5005 {
5006 if(convert->memberAccess == 1 || _class->module == privateModule)
5007 {
5008 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5009
5010 if(!convert->dataType)
5011 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5012 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 1 : 0, convert->dataType->kind == 8, 0, 1, warnConst))
5013 {
5014 if(!conversions && !convert->Get)
5015 return 1;
5016 else if(conversions != (((void *)0)))
5017 {
5018 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5019 return 1;
5020 else
5021 {
5022 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5023
5024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5025 return 1;
5026 }
5027 }
5028 }
5029 }
5030 }
5031 }
5032 }
5033 if(dest->kind == 8)
5034 {
5035 struct __ecereNameSpace__ecere__com__Class * _class;
5036
5037 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5038 {
5039 struct __ecereNameSpace__ecere__com__Property * convert;
5040
5041 for(convert = _class->conversions.first; convert; convert = convert->next)
5042 {
5043 if(convert->memberAccess == 1 || _class->module == privateModule)
5044 {
5045 struct Type * constType = (((void *)0));
5046 unsigned int success = 0;
5047
5048 if(!convert->dataType)
5049 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5050 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5051 {
5052 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5053
5054 constType = __extension__ ({
5055 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5056
5057 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5058 });
5059 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5060 ptrType->constant = 1;
5061 }
5062 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5063 {
5064 if(!conversions && !convert->Set)
5065 success = 1;
5066 else if(conversions != (((void *)0)))
5067 {
5068 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (source->kind != 8 || source->__anon1._class->__anon1.registered != _class->base))
5069 success = 1;
5070 else
5071 {
5072 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5073
5074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5075 success = 1;
5076 }
5077 }
5078 }
5079 if(constType)
5080 FreeType(constType);
5081 if(success)
5082 return 1;
5083 }
5084 }
5085 }
5086 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5087 {
5088 if(!dest->__anon1._class->__anon1.registered->dataType)
5089 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5090 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5091 {
5092 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5093 {
5094 return 1;
5095 }
5096 }
5097 }
5098 }
5099 if(source->kind == 8)
5100 {
5101 struct __ecereNameSpace__ecere__com__Class * _class;
5102
5103 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5104 {
5105 struct __ecereNameSpace__ecere__com__Property * convert;
5106
5107 for(convert = _class->conversions.first; convert; convert = convert->next)
5108 {
5109 if(convert->memberAccess == 1 || _class->module == privateModule)
5110 {
5111 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5112
5113 if(!convert->dataType)
5114 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5115 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0, 1, warnConst))
5116 {
5117 if(!conversions && !convert->Get)
5118 return 1;
5119 else if(conversions != (((void *)0)))
5120 {
5121 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5122 return 1;
5123 else
5124 {
5125 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5126
5127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5128 return 1;
5129 }
5130 }
5131 }
5132 }
5133 }
5134 }
5135 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5136 {
5137 if(!source->__anon1._class->__anon1.registered->dataType)
5138 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5139 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5140 {
5141 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5142 return 1;
5143 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5144 return 1;
5145 }
5146 }
5147 }
5148 }
5149 if(source->kind == 8 || source->kind == 19)
5150 ;
5151 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5152 return 1;
5153 else if(dest->kind == 7 && source->kind == 6)
5154 return 1;
5155 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5156 return 1;
5157 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5158 return 1;
5159 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5160 return 1;
5161 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5162 return 1;
5163 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5164 return 1;
5165 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))
5166 return 1;
5167 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5168 return 1;
5169 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->__anon1.type->kind == 11) || source->kind == 16)))
5170 {
5171 struct Type * paramSource, * paramDest;
5172
5173 if(dest->kind == 16)
5174 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5175 if(source->kind == 16)
5176 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5177 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5178 dest = dest->__anon1.type;
5179 if(source->kind == 13 && source->__anon1.type->kind == 11)
5180 source = source->__anon1.type;
5181 if(dest->kind == 16)
5182 dest = dest->__anon1.__anon3.method->dataType;
5183 if(source->kind == 16)
5184 source = source->__anon1.__anon3.method->dataType;
5185 paramSource = source->__anon1.__anon2.params.first;
5186 if(paramSource && paramSource->kind == 0)
5187 paramSource = (((void *)0));
5188 paramDest = dest->__anon1.__anon2.params.first;
5189 if(paramDest && paramDest->kind == 0)
5190 paramDest = (((void *)0));
5191 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5192 {
5193 if(!paramDest || (!(paramDest->kind == 13 && paramDest->__anon1.type && paramDest->__anon1.type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, paramDest->__anon1._class->__anon1.registered))))
5194 {
5195 if(paramDest && paramDest->kind == 8)
5196 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5197 else
5198 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5199 return 0;
5200 }
5201 paramDest = paramDest->next;
5202 }
5203 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5204 {
5205 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5206 {
5207 if(dest->__anon1.__anon2.thisClass)
5208 {
5209 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5210 {
5211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5212 return 0;
5213 }
5214 }
5215 else
5216 {
5217 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5218 {
5219 if(owningClassDest)
5220 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5221 else
5222 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5223 return 0;
5224 }
5225 }
5226 paramSource = paramSource->next;
5227 }
5228 else
5229 {
5230 if(dest->__anon1.__anon2.thisClass)
5231 {
5232 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5233 {
5234 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5235 return 0;
5236 }
5237 }
5238 else
5239 {
5240 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5241 {
5242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5243 return 0;
5244 }
5245 }
5246 }
5247 }
5248 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5249 {
5250 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5251 return 0;
5252 }
5253 else
5254 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5255 for(; paramDest; paramDest = paramDest->next)
5256 {
5257 if(!paramSource)
5258 {
5259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5260 return 0;
5261 }
5262 {
5263 struct Type * paramDestType = paramDest;
5264 struct Type * paramSourceType = paramSource;
5265 struct Type * type = paramDestType;
5266
5267 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5268 {
5269 int id = 0;
5270 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5271 struct __ecereNameSpace__ecere__com__Class * sClass;
5272
5273 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5274 {
5275 id = 0;
5276 if(sClass->templateClass)
5277 sClass = sClass->templateClass;
5278 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5279 {
5280 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5281 {
5282 for(sClass = sClass->base; sClass; sClass = sClass->base)
5283 {
5284 if(sClass->templateClass)
5285 sClass = sClass->templateClass;
5286 id += sClass->templateParams.count;
5287 }
5288 break;
5289 }
5290 id++;
5291 }
5292 if(curParam)
5293 break;
5294 }
5295 if(curParam)
5296 {
5297 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5298
5299 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5300 }
5301 }
5302 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst)))
5303 {
5304 char type[1024];
5305
5306 type[0] = (char)0;
5307 PrintType(paramDest, type, 0, 1);
5308 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5309 if(paramDestType != paramDest)
5310 FreeType(paramDestType);
5311 return 0;
5312 }
5313 if(paramDestType != paramDest)
5314 FreeType(paramDestType);
5315 }
5316 paramSource = paramSource->next;
5317 }
5318 if(paramSource)
5319 {
5320 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5321 return 0;
5322 }
5323 return 1;
5324 }
5325 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5326 {
5327 return 1;
5328 }
5329 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5330 {
5331 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5332 return 1;
5333 }
5334 }
5335 return 0;
5336 }
5337
5338 static void FreeConvert(struct Conversion * convert)
5339 {
5340 if(convert->resultType)
5341 FreeType(convert->resultType);
5342 }
5343
5344 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5345
5346 struct __ecereNameSpace__ecere__com__BTNamedLink
5347 {
5348 const char *  name;
5349 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5350 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5351 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5352 int depth;
5353 void *  data;
5354 } __attribute__ ((gcc_struct));
5355
5356 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5357
5358 struct __ecereNameSpace__ecere__com__EnumClassData
5359 {
5360 struct __ecereNameSpace__ecere__sys__OldList values;
5361 long long largest;
5362 } __attribute__ ((gcc_struct));
5363
5364 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5365
5366 struct __ecereNameSpace__ecere__sys__NamedLink64
5367 {
5368 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5369 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5370 char *  name;
5371 long long data;
5372 } __attribute__ ((gcc_struct));
5373
5374 extern void FreeExpContents(struct Expression * exp);
5375
5376 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5377
5378 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5379
5380 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5381
5382 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5383
5384 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5385
5386 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5387 {
5388 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5389
5390 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)))
5391 {
5392 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5393
5394 if(_class->type == 4)
5395 {
5396 struct __ecereNameSpace__ecere__sys__OldList converts =
5397 {
5398 0, 0, 0, 0, 0
5399 };
5400 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5401
5402 type->kind = 8;
5403 if(!_class->symbol)
5404 _class->symbol = FindClass(_class->fullName);
5405 type->__anon1._class = _class->symbol;
5406 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5407 {
5408 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5409 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5410
5411 if(enumClass)
5412 {
5413 struct __ecereNameSpace__ecere__com__Class * baseClass;
5414
5415 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5416 {
5417 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5418
5419 for(value = e->values.first; value; value = value->next)
5420 {
5421 if(!strcmp(value->name, string))
5422 break;
5423 }
5424 if(value)
5425 {
5426 FreeExpContents(sourceExp);
5427 FreeType(sourceExp->expType);
5428 sourceExp->isConstant = 1;
5429 sourceExp->expType = MkClassType(baseClass->fullName);
5430 {
5431 char constant[256];
5432
5433 sourceExp->type = 2;
5434 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5435 sprintf(constant, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), value->data);
5436 else
5437 sprintf(constant, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5438 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5439 }
5440 while(converts.first)
5441 {
5442 struct Conversion * convert = converts.first;
5443
5444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5446 }
5447 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5448 return 1;
5449 }
5450 }
5451 }
5452 }
5453 if(converts.first)
5454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5455 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5456 }
5457 }
5458 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)))
5459 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5460 return 1;
5461 return 0;
5462 }
5463
5464 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5465
5466 struct __ecereNameSpace__ecere__com__SubModule
5467 {
5468 struct __ecereNameSpace__ecere__com__SubModule * prev;
5469 struct __ecereNameSpace__ecere__com__SubModule * next;
5470 struct __ecereNameSpace__ecere__com__Instance * module;
5471 int importMode;
5472 } __attribute__ ((gcc_struct));
5473
5474 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5475 {
5476 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5477
5478 if(searchFor == searchIn)
5479 return 1;
5480 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5481 {
5482 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5483 {
5484 if(ModuleVisibility(subModule->module, searchFor))
5485 return 1;
5486 }
5487 }
5488 return 0;
5489 }
5490
5491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5492
5493 struct __ecereNameSpace__ecere__com__Application
5494 {
5495 int argc;
5496 const char * *  argv;
5497 int exitCode;
5498 unsigned int isGUIApp;
5499 struct __ecereNameSpace__ecere__sys__OldList allModules;
5500 char *  parsedCommand;
5501 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5502 } __attribute__ ((gcc_struct));
5503
5504 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5505 {
5506 struct __ecereNameSpace__ecere__com__Instance * module;
5507
5508 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))
5509 return 1;
5510 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))
5511 return 1;
5512 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))
5513 return 1;
5514 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)
5515 {
5516 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5517 return 1;
5518 }
5519 return 0;
5520 }
5521
5522 extern struct Expression * CopyExpression(struct Expression * exp);
5523
5524 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5525
5526 void ReadString(char *  output, char *  string);
5527
5528 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5529
5530 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5531
5532 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5533
5534 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5535 {
5536 struct Type * source;
5537 struct Type * realDest = dest;
5538 struct Type * backupSourceExpType = (((void *)0));
5539 struct Expression * computedExp = sourceExp;
5540
5541 dest->refCount++;
5542 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5543 {
5544 computedExp = CopyExpression(sourceExp);
5545 ComputeExpression(computedExp);
5546 }
5547 source = sourceExp->expType;
5548 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5549 {
5550 if(computedExp != sourceExp)
5551 {
5552 FreeExpression(computedExp);
5553 computedExp = sourceExp;
5554 }
5555 FreeType(dest);
5556 return 1;
5557 }
5558 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5559 {
5560 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5561 {
5562 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5563
5564 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5565 ;
5566 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5567 ;
5568 if(sourceBase == destBase)
5569 {
5570 if(computedExp != sourceExp)
5571 {
5572 FreeExpression(computedExp);
5573 computedExp = sourceExp;
5574 }
5575 FreeType(dest);
5576 return 1;
5577 }
5578 }
5579 }
5580 if(source)
5581 {
5582 struct __ecereNameSpace__ecere__sys__OldList * specs;
5583 unsigned int flag = 0;
5584 long long value = (((int)0x7fffffff));
5585
5586 source->refCount++;
5587 if(computedExp->type == 2)
5588 {
5589 if(source->isSigned)
5590 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5591 else
5592 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5593 }
5594 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5595 {
5596 if(source->isSigned)
5597 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5598 else
5599 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5600 }
5601 if(computedExp != sourceExp)
5602 {
5603 FreeExpression(computedExp);
5604 computedExp = sourceExp;
5605 }
5606 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "ecere::com::unichar"))
5607 {
5608 FreeType(source);
5609 source = __extension__ ({
5610 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5611
5612 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5613 });
5614 }
5615 if(dest->kind == 8)
5616 {
5617 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5618
5619 if(_class && _class->type == 3)
5620 {
5621 if(source->kind != 8)
5622 {
5623 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5624 struct Type * tempDest, * tempSource;
5625
5626 for(; _class->base->type != 1000; _class = _class->base)
5627 ;
5628 tempSource = dest;
5629 tempDest = tempType;
5630 tempType->kind = 8;
5631 if(!_class->symbol)
5632 _class->symbol = FindClass(_class->fullName);
5633 tempType->__anon1._class = _class->symbol;
5634 tempType->truth = dest->truth;
5635 if(tempType->__anon1._class)
5636 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5637 backupSourceExpType = sourceExp->expType;
5638 sourceExp->expType = dest;
5639 dest->refCount++;
5640 flag = 1;
5641 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5642 }
5643 }
5644 if(_class && _class->type == 2 && source->kind != 8)
5645 {
5646 if(!dest->__anon1._class->__anon1.registered->dataType)
5647 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5648 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5649 {
5650 FreeType(source);
5651 FreeType(sourceExp->expType);
5652 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5653 source->refCount++;
5654 }
5655 }
5656 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5657 {
5658 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5659 struct Declarator * decl;
5660 char string[1024];
5661
5662 ReadString(string, sourceExp->__anon1.__anon2.string);
5663 decl = SpecDeclFromString(string, specs, (((void *)0)));
5664 FreeExpContents(sourceExp);
5665 FreeType(sourceExp->expType);
5666 sourceExp->type = 24;
5667 sourceExp->__anon1._classExp.specifiers = specs;
5668 sourceExp->__anon1._classExp.decl = decl;
5669 sourceExp->expType = dest;
5670 dest->refCount++;
5671 FreeType(source);
5672 FreeType(dest);
5673 if(backupSourceExpType)
5674 FreeType(backupSourceExpType);
5675 return 1;
5676 }
5677 }
5678 else if(source->kind == 8)
5679 {
5680 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5681
5682 if(_class && (_class->type == 3 || _class->type == 2))
5683 {
5684 if(dest->kind != 8)
5685 {
5686 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5687 struct Type * tempDest, * tempSource;
5688
5689 if(!source->__anon1._class->__anon1.registered->dataType)
5690 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5691 for(; _class->base->type != 1000; _class = _class->base)
5692 ;
5693 tempDest = source;
5694 tempSource = tempType;
5695 tempType->kind = 8;
5696 tempType->__anon1._class = FindClass(_class->fullName);
5697 tempType->truth = source->truth;
5698 tempType->classObjectType = source->classObjectType;
5699 if(tempType->__anon1._class)
5700 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5701 if(conversions->last)
5702 {
5703 ((struct Conversion *)conversions->last)->resultType = dest;
5704 dest->refCount++;
5705 }
5706 FreeType(sourceExp->expType);
5707 sourceExp->expType = MkClassType(_class->fullName);
5708 sourceExp->expType->truth = source->truth;
5709 sourceExp->expType->classObjectType = source->classObjectType;
5710 if(!sourceExp->destType)
5711 {
5712 FreeType(sourceExp->destType);
5713 sourceExp->destType = sourceExp->expType;
5714 if(sourceExp->expType)
5715 sourceExp->expType->refCount++;
5716 }
5717 if(!_class->dataType)
5718 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5719 FreeType(dest);
5720 dest = MkClassType(source->__anon1._class->string);
5721 dest->truth = source->truth;
5722 dest->classObjectType = source->classObjectType;
5723 FreeType(source);
5724 source = _class->dataType;
5725 source->refCount++;
5726 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5727 }
5728 }
5729 }
5730 if(!flag)
5731 {
5732 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5733 {
5734 FreeType(source);
5735 FreeType(dest);
5736 return 1;
5737 }
5738 }
5739 if(dest->kind == 8)
5740 {
5741 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5742 unsigned int fittingValue = 0;
5743
5744 if(_class && _class->type == 4)
5745 {
5746 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5747 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5748
5749 if(c && value >= 0 && value <= c->largest)
5750 fittingValue = 1;
5751 }
5752 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5753 {
5754 if(_class->type == 0 || _class->type == 5)
5755 {
5756 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5757
5758 *newExp = *sourceExp;
5759 if(sourceExp->destType)
5760 sourceExp->destType->refCount++;
5761 if(sourceExp->expType)
5762 sourceExp->expType->refCount++;
5763 sourceExp->type = 11;
5764 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5765 sourceExp->__anon1.cast.exp = newExp;
5766 FreeType(sourceExp->expType);
5767 sourceExp->expType = (((void *)0));
5768 ProcessExpressionType(sourceExp);
5769 if(!inCompiler)
5770 {
5771 FreeType(sourceExp->expType);
5772 sourceExp->expType = dest;
5773 }
5774 FreeType(source);
5775 if(inCompiler)
5776 FreeType(dest);
5777 if(backupSourceExpType)
5778 FreeType(backupSourceExpType);
5779 return 1;
5780 }
5781 if(!_class->dataType)
5782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5783 FreeType(dest);
5784 dest = _class->dataType;
5785 dest->refCount++;
5786 }
5787 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))
5788 {
5789 specs = MkListOne(MkSpecifier(DOUBLE));
5790 }
5791 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))
5792 {
5793 specs = MkListOne(MkSpecifier(FLOAT));
5794 }
5795 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))
5796 {
5797 specs = MkList();
5798 if(!dest->isSigned)
5799 ListAdd(specs, MkSpecifier(UNSIGNED));
5800 ListAdd(specs, MkSpecifier(INT64));
5801 }
5802 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5803 {
5804 specs = MkList();
5805 if(!dest->isSigned)
5806 ListAdd(specs, MkSpecifier(UNSIGNED));
5807 ListAdd(specs, MkSpecifier(INT));
5808 }
5809 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5810 {
5811 specs = MkList();
5812 if(!dest->isSigned)
5813 ListAdd(specs, MkSpecifier(UNSIGNED));
5814 ListAdd(specs, MkSpecifier(SHORT));
5815 }
5816 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5817 {
5818 specs = MkList();
5819 if(!dest->isSigned)
5820 ListAdd(specs, MkSpecifier(UNSIGNED));
5821 ListAdd(specs, MkSpecifier(CHAR));
5822 }
5823 else
5824 {
5825 FreeType(source);
5826 FreeType(dest);
5827 if(backupSourceExpType)
5828 {
5829 if(sourceExp->expType)
5830 FreeType(sourceExp->expType);
5831 sourceExp->expType = backupSourceExpType;
5832 }
5833 return 0;
5834 }
5835 }
5836 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))
5837 {
5838 specs = MkListOne(MkSpecifier(DOUBLE));
5839 }
5840 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))
5841 {
5842 specs = MkListOne(MkSpecifier(FLOAT));
5843 }
5844 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5845 {
5846 specs = MkList();
5847 ListAdd(specs, MkSpecifier(BOOL));
5848 }
5849 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)))
5850 {
5851 specs = MkList();
5852 if(!dest->isSigned)
5853 ListAdd(specs, MkSpecifier(UNSIGNED));
5854 ListAdd(specs, MkSpecifier(CHAR));
5855 }
5856 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)))))
5857 {
5858 specs = MkList();
5859 if(!dest->isSigned)
5860 ListAdd(specs, MkSpecifier(UNSIGNED));
5861 ListAdd(specs, MkSpecifier(SHORT));
5862 }
5863 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5864 {
5865 specs = MkList();
5866 if(!dest->isSigned)
5867 ListAdd(specs, MkSpecifier(UNSIGNED));
5868 ListAdd(specs, MkSpecifier(INT));
5869 }
5870 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5871 {
5872 specs = MkList();
5873 if(!dest->isSigned)
5874 ListAdd(specs, MkSpecifier(UNSIGNED));
5875 ListAdd(specs, MkSpecifier(INT64));
5876 }
5877 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5878 {
5879 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5880 }
5881 else
5882 {
5883 FreeType(source);
5884 FreeType(dest);
5885 if(backupSourceExpType)
5886 {
5887 if(sourceExp->expType)
5888 FreeType(sourceExp->expType);
5889 sourceExp->expType = backupSourceExpType;
5890 }
5891 return 0;
5892 }
5893 if(!flag && !sourceExp->opDestType)
5894 {
5895 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5896
5897 *newExp = *sourceExp;
5898 newExp->prev = (((void *)0));
5899 newExp->next = (((void *)0));
5900 if(sourceExp->destType)
5901 sourceExp->destType->refCount++;
5902 if(sourceExp->expType)
5903 sourceExp->expType->refCount++;
5904 sourceExp->type = 11;
5905 if(realDest->kind == 8)
5906 {
5907 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5908 FreeList(specs, FreeSpecifier);
5909 }
5910 else
5911 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5912 if(newExp->type == 4)
5913 {
5914 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5915 }
5916 else
5917 sourceExp->__anon1.cast.exp = newExp;
5918 FreeType(sourceExp->expType);
5919 sourceExp->expType = (((void *)0));
5920 ProcessExpressionType(sourceExp);
5921 }
5922 else
5923 FreeList(specs, FreeSpecifier);
5924 FreeType(dest);
5925 FreeType(source);
5926 if(backupSourceExpType)
5927 FreeType(backupSourceExpType);
5928 return 1;
5929 }
5930 else
5931 {
5932 if(computedExp != sourceExp)
5933 {
5934 FreeExpression(computedExp);
5935 computedExp = sourceExp;
5936 }
5937 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5938 sourceExp = (*sourceExp->__anon1.list).last;
5939 if(sourceExp->type == 0)
5940 {
5941 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5942
5943 if(dest->kind == 8)
5944 {
5945 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5946 {
5947 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5948 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5949
5950 if(enumClass)
5951 {
5952 for(; _class && _class->type == 4; _class = _class->base)
5953 {
5954 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5955 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5956
5957 for(value = e->values.first; value; value = value->next)
5958 {
5959 if(!strcmp(value->name, id->string))
5960 break;
5961 }
5962 if(value)
5963 {
5964 FreeExpContents(sourceExp);
5965 FreeType(sourceExp->expType);
5966 sourceExp->isConstant = 1;
5967 sourceExp->expType = MkClassType(_class->fullName);
5968 {
5969 sourceExp->type = 2;
5970 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5971 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5972 else
5973 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5974 }
5975 FreeType(dest);
5976 return 1;
5977 }
5978 }
5979 }
5980 }
5981 }
5982 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5983 {
5984 FreeType(dest);
5985 return 1;
5986 }
5987 }
5988 FreeType(dest);
5989 }
5990 return 0;
5991 }
5992
5993 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5994 {
5995 int value2 = op2->__anon1.i;
5996
5997 exp->type = 2;
5998 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
5999 if(!exp->expType)
6000 {
6001 exp->expType = op1->type;
6002 if(op1->type)
6003 op1->type->refCount++;
6004 }
6005 return 1;
6006 }
6007
6008 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6009 {
6010 unsigned int value2 = op2->__anon1.ui;
6011
6012 exp->type = 2;
6013 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6014 if(!exp->expType)
6015 {
6016 exp->expType = op1->type;
6017 if(op1->type)
6018 op1->type->refCount++;
6019 }
6020 return 1;
6021 }
6022
6023 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6024 {
6025 long long value2 = op2->__anon1.i64;
6026
6027 exp->type = 2;
6028 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6029 if(!exp->expType)
6030 {
6031 exp->expType = op1->type;
6032 if(op1->type)
6033 op1->type->refCount++;
6034 }
6035 return 1;
6036 }
6037
6038 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6039 {
6040 uint64 value2 = op2->__anon1.ui64;
6041
6042 exp->type = 2;
6043 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6044 if(!exp->expType)
6045 {
6046 exp->expType = op1->type;
6047 if(op1->type)
6048 op1->type->refCount++;
6049 }
6050 return 1;
6051 }
6052
6053 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6054 {
6055 short value2 = op2->__anon1.s;
6056
6057 exp->type = 2;
6058 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6059 if(!exp->expType)
6060 {
6061 exp->expType = op1->type;
6062 if(op1->type)
6063 op1->type->refCount++;
6064 }
6065 return 1;
6066 }
6067
6068 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6069 {
6070 unsigned short value2 = op2->__anon1.us;
6071
6072 exp->type = 2;
6073 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6074 if(!exp->expType)
6075 {
6076 exp->expType = op1->type;
6077 if(op1->type)
6078 op1->type->refCount++;
6079 }
6080 return 1;
6081 }
6082
6083 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6084 {
6085 char value2 = op2->__anon1.c;
6086
6087 exp->type = 2;
6088 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6089 if(!exp->expType)
6090 {
6091 exp->expType = op1->type;
6092 if(op1->type)
6093 op1->type->refCount++;
6094 }
6095 return 1;
6096 }
6097
6098 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6099 {
6100 unsigned char value2 = op2->__anon1.uc;
6101
6102 exp->type = 2;
6103 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6104 if(!exp->expType)
6105 {
6106 exp->expType = op1->type;
6107 if(op1->type)
6108 op1->type->refCount++;
6109 }
6110 return 1;
6111 }
6112
6113 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6114 {
6115 float value2 = op2->__anon1.f;
6116
6117 exp->type = 2;
6118 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6119 if(!exp->expType)
6120 {
6121 exp->expType = op1->type;
6122 if(op1->type)
6123 op1->type->refCount++;
6124 }
6125 return 1;
6126 }
6127
6128 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6129 {
6130 double value2 = op2->__anon1.d;
6131
6132 exp->type = 2;
6133 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6134 if(!exp->expType)
6135 {
6136 exp->expType = op1->type;
6137 if(op1->type)
6138 op1->type->refCount++;
6139 }
6140 return 1;
6141 }
6142
6143 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6144 {
6145 int value2 = op2->__anon1.i;
6146
6147 exp->type = 2;
6148 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6149 if(!exp->expType)
6150 {
6151 exp->expType = op1->type;
6152 if(op1->type)
6153 op1->type->refCount++;
6154 }
6155 return 1;
6156 }
6157
6158 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6159 {
6160 unsigned int value2 = op2->__anon1.ui;
6161
6162 exp->type = 2;
6163 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6164 if(!exp->expType)
6165 {
6166 exp->expType = op1->type;
6167 if(op1->type)
6168 op1->type->refCount++;
6169 }
6170 return 1;
6171 }
6172
6173 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6174 {
6175 long long value2 = op2->__anon1.i64;
6176
6177 exp->type = 2;
6178 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6179 if(!exp->expType)
6180 {
6181 exp->expType = op1->type;
6182 if(op1->type)
6183 op1->type->refCount++;
6184 }
6185 return 1;
6186 }
6187
6188 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6189 {
6190 uint64 value2 = op2->__anon1.ui64;
6191
6192 exp->type = 2;
6193 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6194 if(!exp->expType)
6195 {
6196 exp->expType = op1->type;
6197 if(op1->type)
6198 op1->type->refCount++;
6199 }
6200 return 1;
6201 }
6202
6203 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6204 {
6205 short value2 = op2->__anon1.s;
6206
6207 exp->type = 2;
6208 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6209 if(!exp->expType)
6210 {
6211 exp->expType = op1->type;
6212 if(op1->type)
6213 op1->type->refCount++;
6214 }
6215 return 1;
6216 }
6217
6218 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6219 {
6220 unsigned short value2 = op2->__anon1.us;
6221
6222 exp->type = 2;
6223 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6224 if(!exp->expType)
6225 {
6226 exp->expType = op1->type;
6227 if(op1->type)
6228 op1->type->refCount++;
6229 }
6230 return 1;
6231 }
6232
6233 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6234 {
6235 char value2 = op2->__anon1.c;
6236
6237 exp->type = 2;
6238 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6239 if(!exp->expType)
6240 {
6241 exp->expType = op1->type;
6242 if(op1->type)
6243 op1->type->refCount++;
6244 }
6245 return 1;
6246 }
6247
6248 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6249 {
6250 unsigned char value2 = op2->__anon1.uc;
6251
6252 exp->type = 2;
6253 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6254 if(!exp->expType)
6255 {
6256 exp->expType = op1->type;
6257 if(op1->type)
6258 op1->type->refCount++;
6259 }
6260 return 1;
6261 }
6262
6263 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6264 {
6265 float value2 = op2->__anon1.f;
6266
6267 exp->type = 2;
6268 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6269 if(!exp->expType)
6270 {
6271 exp->expType = op1->type;
6272 if(op1->type)
6273 op1->type->refCount++;
6274 }
6275 return 1;
6276 }
6277
6278 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6279 {
6280 double value2 = op2->__anon1.d;
6281
6282 exp->type = 2;
6283 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6284 if(!exp->expType)
6285 {
6286 exp->expType = op1->type;
6287 if(op1->type)
6288 op1->type->refCount++;
6289 }
6290 return 1;
6291 }
6292
6293 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6294 {
6295 int value2 = op2->__anon1.i;
6296
6297 exp->type = 2;
6298 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6299 if(!exp->expType)
6300 {
6301 exp->expType = op1->type;
6302 if(op1->type)
6303 op1->type->refCount++;
6304 }
6305 return 1;
6306 }
6307
6308 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6309 {
6310 unsigned int value2 = op2->__anon1.ui;
6311
6312 exp->type = 2;
6313 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6314 if(!exp->expType)
6315 {
6316 exp->expType = op1->type;
6317 if(op1->type)
6318 op1->type->refCount++;
6319 }
6320 return 1;
6321 }
6322
6323 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6324 {
6325 long long value2 = op2->__anon1.i64;
6326
6327 exp->type = 2;
6328 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6329 if(!exp->expType)
6330 {
6331 exp->expType = op1->type;
6332 if(op1->type)
6333 op1->type->refCount++;
6334 }
6335 return 1;
6336 }
6337
6338 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6339 {
6340 uint64 value2 = op2->__anon1.ui64;
6341
6342 exp->type = 2;
6343 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6344 if(!exp->expType)
6345 {
6346 exp->expType = op1->type;
6347 if(op1->type)
6348 op1->type->refCount++;
6349 }
6350 return 1;
6351 }
6352
6353 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6354 {
6355 short value2 = op2->__anon1.s;
6356
6357 exp->type = 2;
6358 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6359 if(!exp->expType)
6360 {
6361 exp->expType = op1->type;
6362 if(op1->type)
6363 op1->type->refCount++;
6364 }
6365 return 1;
6366 }
6367
6368 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6369 {
6370 unsigned short value2 = op2->__anon1.us;
6371
6372 exp->type = 2;
6373 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6374 if(!exp->expType)
6375 {
6376 exp->expType = op1->type;
6377 if(op1->type)
6378 op1->type->refCount++;
6379 }
6380 return 1;
6381 }
6382
6383 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6384 {
6385 char value2 = op2->__anon1.c;
6386
6387 exp->type = 2;
6388 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6389 if(!exp->expType)
6390 {
6391 exp->expType = op1->type;
6392 if(op1->type)
6393 op1->type->refCount++;
6394 }
6395 return 1;
6396 }
6397
6398 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6399 {
6400 unsigned char value2 = op2->__anon1.uc;
6401
6402 exp->type = 2;
6403 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6404 if(!exp->expType)
6405 {
6406 exp->expType = op1->type;
6407 if(op1->type)
6408 op1->type->refCount++;
6409 }
6410 return 1;
6411 }
6412
6413 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6414 {
6415 float value2 = op2->__anon1.f;
6416
6417 exp->type = 2;
6418 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6419 if(!exp->expType)
6420 {
6421 exp->expType = op1->type;
6422 if(op1->type)
6423 op1->type->refCount++;
6424 }
6425 return 1;
6426 }
6427
6428 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6429 {
6430 double value2 = op2->__anon1.d;
6431
6432 exp->type = 2;
6433 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6434 if(!exp->expType)
6435 {
6436 exp->expType = op1->type;
6437 if(op1->type)
6438 op1->type->refCount++;
6439 }
6440 return 1;
6441 }
6442
6443 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6444 {
6445 int value2 = op2->__anon1.i;
6446
6447 exp->type = 2;
6448 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6449 if(!exp->expType)
6450 {
6451 exp->expType = op1->type;
6452 if(op1->type)
6453 op1->type->refCount++;
6454 }
6455 return 1;
6456 }
6457
6458 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6459 {
6460 unsigned int value2 = op2->__anon1.ui;
6461
6462 exp->type = 2;
6463 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6464 if(!exp->expType)
6465 {
6466 exp->expType = op1->type;
6467 if(op1->type)
6468 op1->type->refCount++;
6469 }
6470 return 1;
6471 }
6472
6473 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6474 {
6475 long long value2 = op2->__anon1.i64;
6476
6477 exp->type = 2;
6478 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6479 if(!exp->expType)
6480 {
6481 exp->expType = op1->type;
6482 if(op1->type)
6483 op1->type->refCount++;
6484 }
6485 return 1;
6486 }
6487
6488 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6489 {
6490 uint64 value2 = op2->__anon1.ui64;
6491
6492 exp->type = 2;
6493 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6494 if(!exp->expType)
6495 {
6496 exp->expType = op1->type;
6497 if(op1->type)
6498 op1->type->refCount++;
6499 }
6500 return 1;
6501 }
6502
6503 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6504 {
6505 short value2 = op2->__anon1.s;
6506
6507 exp->type = 2;
6508 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6509 if(!exp->expType)
6510 {
6511 exp->expType = op1->type;
6512 if(op1->type)
6513 op1->type->refCount++;
6514 }
6515 return 1;
6516 }
6517
6518 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6519 {
6520 unsigned short value2 = op2->__anon1.us;
6521
6522 exp->type = 2;
6523 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6524 if(!exp->expType)
6525 {
6526 exp->expType = op1->type;
6527 if(op1->type)
6528 op1->type->refCount++;
6529 }
6530 return 1;
6531 }
6532
6533 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6534 {
6535 char value2 = op2->__anon1.c;
6536
6537 exp->type = 2;
6538 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6539 if(!exp->expType)
6540 {
6541 exp->expType = op1->type;
6542 if(op1->type)
6543 op1->type->refCount++;
6544 }
6545 return 1;
6546 }
6547
6548 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6549 {
6550 unsigned char value2 = op2->__anon1.uc;
6551
6552 exp->type = 2;
6553 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6554 if(!exp->expType)
6555 {
6556 exp->expType = op1->type;
6557 if(op1->type)
6558 op1->type->refCount++;
6559 }
6560 return 1;
6561 }
6562
6563 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6564 {
6565 float value2 = op2->__anon1.f;
6566
6567 exp->type = 2;
6568 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6569 if(!exp->expType)
6570 {
6571 exp->expType = op1->type;
6572 if(op1->type)
6573 op1->type->refCount++;
6574 }
6575 return 1;
6576 }
6577
6578 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6579 {
6580 double value2 = op2->__anon1.d;
6581
6582 exp->type = 2;
6583 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6584 if(!exp->expType)
6585 {
6586 exp->expType = op1->type;
6587 if(op1->type)
6588 op1->type->refCount++;
6589 }
6590 return 1;
6591 }
6592
6593 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6594 {
6595 int value2 = op2->__anon1.i;
6596
6597 exp->type = 2;
6598 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6599 if(!exp->expType)
6600 {
6601 exp->expType = op1->type;
6602 if(op1->type)
6603 op1->type->refCount++;
6604 }
6605 return 1;
6606 }
6607
6608 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6609 {
6610 unsigned int value2 = op2->__anon1.ui;
6611
6612 exp->type = 2;
6613 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6614 if(!exp->expType)
6615 {
6616 exp->expType = op1->type;
6617 if(op1->type)
6618 op1->type->refCount++;
6619 }
6620 return 1;
6621 }
6622
6623 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6624 {
6625 long long value2 = op2->__anon1.i64;
6626
6627 exp->type = 2;
6628 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6629 if(!exp->expType)
6630 {
6631 exp->expType = op1->type;
6632 if(op1->type)
6633 op1->type->refCount++;
6634 }
6635 return 1;
6636 }
6637
6638 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6639 {
6640 uint64 value2 = op2->__anon1.ui64;
6641
6642 exp->type = 2;
6643 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6644 if(!exp->expType)
6645 {
6646 exp->expType = op1->type;
6647 if(op1->type)
6648 op1->type->refCount++;
6649 }
6650 return 1;
6651 }
6652
6653 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6654 {
6655 short value2 = op2->__anon1.s;
6656
6657 exp->type = 2;
6658 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6659 if(!exp->expType)
6660 {
6661 exp->expType = op1->type;
6662 if(op1->type)
6663 op1->type->refCount++;
6664 }
6665 return 1;
6666 }
6667
6668 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6669 {
6670 unsigned short value2 = op2->__anon1.us;
6671
6672 exp->type = 2;
6673 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6674 if(!exp->expType)
6675 {
6676 exp->expType = op1->type;
6677 if(op1->type)
6678 op1->type->refCount++;
6679 }
6680 return 1;
6681 }
6682
6683 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6684 {
6685 char value2 = op2->__anon1.c;
6686
6687 exp->type = 2;
6688 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6689 if(!exp->expType)
6690 {
6691 exp->expType = op1->type;
6692 if(op1->type)
6693 op1->type->refCount++;
6694 }
6695 return 1;
6696 }
6697
6698 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6699 {
6700 unsigned char value2 = op2->__anon1.uc;
6701
6702 exp->type = 2;
6703 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6704 if(!exp->expType)
6705 {
6706 exp->expType = op1->type;
6707 if(op1->type)
6708 op1->type->refCount++;
6709 }
6710 return 1;
6711 }
6712
6713 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6714 {
6715 exp->type = 2;
6716 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6717 if(!exp->expType)
6718 {
6719 exp->expType = op1->type;
6720 if(op1->type)
6721 op1->type->refCount++;
6722 }
6723 return 1;
6724 }
6725
6726 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6727 {
6728 exp->type = 2;
6729 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6730 if(!exp->expType)
6731 {
6732 exp->expType = op1->type;
6733 if(op1->type)
6734 op1->type->refCount++;
6735 }
6736 return 1;
6737 }
6738
6739 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6740 {
6741 exp->type = 2;
6742 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6743 if(!exp->expType)
6744 {
6745 exp->expType = op1->type;
6746 if(op1->type)
6747 op1->type->refCount++;
6748 }
6749 return 1;
6750 }
6751
6752 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6753 {
6754 exp->type = 2;
6755 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6756 if(!exp->expType)
6757 {
6758 exp->expType = op1->type;
6759 if(op1->type)
6760 op1->type->refCount++;
6761 }
6762 return 1;
6763 }
6764
6765 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6766 {
6767 exp->type = 2;
6768 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6769 if(!exp->expType)
6770 {
6771 exp->expType = op1->type;
6772 if(op1->type)
6773 op1->type->refCount++;
6774 }
6775 return 1;
6776 }
6777
6778 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6779 {
6780 exp->type = 2;
6781 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6782 if(!exp->expType)
6783 {
6784 exp->expType = op1->type;
6785 if(op1->type)
6786 op1->type->refCount++;
6787 }
6788 return 1;
6789 }
6790
6791 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6792 {
6793 exp->type = 2;
6794 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6795 if(!exp->expType)
6796 {
6797 exp->expType = op1->type;
6798 if(op1->type)
6799 op1->type->refCount++;
6800 }
6801 return 1;
6802 }
6803
6804 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6805 {
6806 exp->type = 2;
6807 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6808 if(!exp->expType)
6809 {
6810 exp->expType = op1->type;
6811 if(op1->type)
6812 op1->type->refCount++;
6813 }
6814 return 1;
6815 }
6816
6817 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6818 {
6819 exp->type = 2;
6820 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6821 if(!exp->expType)
6822 {
6823 exp->expType = op1->type;
6824 if(op1->type)
6825 op1->type->refCount++;
6826 }
6827 return 1;
6828 }
6829
6830 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6831 {
6832 exp->type = 2;
6833 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6834 if(!exp->expType)
6835 {
6836 exp->expType = op1->type;
6837 if(op1->type)
6838 op1->type->refCount++;
6839 }
6840 return 1;
6841 }
6842
6843 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6844 {
6845 exp->type = 2;
6846 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6847 if(!exp->expType)
6848 {
6849 exp->expType = op1->type;
6850 if(op1->type)
6851 op1->type->refCount++;
6852 }
6853 return 1;
6854 }
6855
6856 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6857 {
6858 exp->type = 2;
6859 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6860 if(!exp->expType)
6861 {
6862 exp->expType = op1->type;
6863 if(op1->type)
6864 op1->type->refCount++;
6865 }
6866 return 1;
6867 }
6868
6869 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6870 {
6871 exp->type = 2;
6872 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6873 if(!exp->expType)
6874 {
6875 exp->expType = op1->type;
6876 if(op1->type)
6877 op1->type->refCount++;
6878 }
6879 return 1;
6880 }
6881
6882 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6883 {
6884 exp->type = 2;
6885 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6886 if(!exp->expType)
6887 {
6888 exp->expType = op1->type;
6889 if(op1->type)
6890 op1->type->refCount++;
6891 }
6892 return 1;
6893 }
6894
6895 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6896 {
6897 exp->type = 2;
6898 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6899 if(!exp->expType)
6900 {
6901 exp->expType = op1->type;
6902 if(op1->type)
6903 op1->type->refCount++;
6904 }
6905 return 1;
6906 }
6907
6908 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6909 {
6910 exp->type = 2;
6911 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6912 if(!exp->expType)
6913 {
6914 exp->expType = op1->type;
6915 if(op1->type)
6916 op1->type->refCount++;
6917 }
6918 return 1;
6919 }
6920
6921 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6922 {
6923 exp->type = 2;
6924 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6925 if(!exp->expType)
6926 {
6927 exp->expType = op1->type;
6928 if(op1->type)
6929 op1->type->refCount++;
6930 }
6931 return 1;
6932 }
6933
6934 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6935 {
6936 exp->type = 2;
6937 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6938 if(!exp->expType)
6939 {
6940 exp->expType = op1->type;
6941 if(op1->type)
6942 op1->type->refCount++;
6943 }
6944 return 1;
6945 }
6946
6947 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6948 {
6949 exp->type = 2;
6950 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 1;
6958 }
6959
6960 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6961 {
6962 exp->type = 2;
6963 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 1;
6971 }
6972
6973 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6974 {
6975 exp->type = 2;
6976 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6977 if(!exp->expType)
6978 {
6979 exp->expType = op1->type;
6980 if(op1->type)
6981 op1->type->refCount++;
6982 }
6983 return 1;
6984 }
6985
6986 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6987 {
6988 exp->type = 2;
6989 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6990 if(!exp->expType)
6991 {
6992 exp->expType = op1->type;
6993 if(op1->type)
6994 op1->type->refCount++;
6995 }
6996 return 1;
6997 }
6998
6999 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7000 {
7001 exp->type = 2;
7002 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7003 if(!exp->expType)
7004 {
7005 exp->expType = op1->type;
7006 if(op1->type)
7007 op1->type->refCount++;
7008 }
7009 return 1;
7010 }
7011
7012 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7013 {
7014 exp->type = 2;
7015 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7016 if(!exp->expType)
7017 {
7018 exp->expType = op1->type;
7019 if(op1->type)
7020 op1->type->refCount++;
7021 }
7022 return 1;
7023 }
7024
7025 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7026 {
7027 exp->type = 2;
7028 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7029 if(!exp->expType)
7030 {
7031 exp->expType = op1->type;
7032 if(op1->type)
7033 op1->type->refCount++;
7034 }
7035 return 1;
7036 }
7037
7038 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7039 {
7040 exp->type = 2;
7041 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7042 if(!exp->expType)
7043 {
7044 exp->expType = op1->type;
7045 if(op1->type)
7046 op1->type->refCount++;
7047 }
7048 return 1;
7049 }
7050
7051 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7052 {
7053 exp->type = 2;
7054 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 1;
7062 }
7063
7064 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7065 {
7066 exp->type = 2;
7067 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 1;
7075 }
7076
7077 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7078 {
7079 exp->type = 2;
7080 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7081 if(!exp->expType)
7082 {
7083 exp->expType = op1->type;
7084 if(op1->type)
7085 op1->type->refCount++;
7086 }
7087 return 1;
7088 }
7089
7090 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7091 {
7092 exp->type = 2;
7093 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 1;
7101 }
7102
7103 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7104 {
7105 int value2 = op2->__anon1.i;
7106
7107 exp->type = 2;
7108 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7109 if(!exp->expType)
7110 {
7111 exp->expType = op1->type;
7112 if(op1->type)
7113 op1->type->refCount++;
7114 }
7115 return 1;
7116 }
7117
7118 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7119 {
7120 unsigned int value2 = op2->__anon1.ui;
7121
7122 exp->type = 2;
7123 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7124 if(!exp->expType)
7125 {
7126 exp->expType = op1->type;
7127 if(op1->type)
7128 op1->type->refCount++;
7129 }
7130 return 1;
7131 }
7132
7133 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7134 {
7135 long long value2 = op2->__anon1.i64;
7136
7137 exp->type = 2;
7138 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7139 if(!exp->expType)
7140 {
7141 exp->expType = op1->type;
7142 if(op1->type)
7143 op1->type->refCount++;
7144 }
7145 return 1;
7146 }
7147
7148 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7149 {
7150 uint64 value2 = op2->__anon1.ui64;
7151
7152 exp->type = 2;
7153 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7154 if(!exp->expType)
7155 {
7156 exp->expType = op1->type;
7157 if(op1->type)
7158 op1->type->refCount++;
7159 }
7160 return 1;
7161 }
7162
7163 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7164 {
7165 short value2 = op2->__anon1.s;
7166
7167 exp->type = 2;
7168 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7169 if(!exp->expType)
7170 {
7171 exp->expType = op1->type;
7172 if(op1->type)
7173 op1->type->refCount++;
7174 }
7175 return 1;
7176 }
7177
7178 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7179 {
7180 unsigned short value2 = op2->__anon1.us;
7181
7182 exp->type = 2;
7183 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7184 if(!exp->expType)
7185 {
7186 exp->expType = op1->type;
7187 if(op1->type)
7188 op1->type->refCount++;
7189 }
7190 return 1;
7191 }
7192
7193 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7194 {
7195 char value2 = op2->__anon1.c;
7196
7197 exp->type = 2;
7198 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7199 if(!exp->expType)
7200 {
7201 exp->expType = op1->type;
7202 if(op1->type)
7203 op1->type->refCount++;
7204 }
7205 return 1;
7206 }
7207
7208 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7209 {
7210 unsigned char value2 = op2->__anon1.uc;
7211
7212 exp->type = 2;
7213 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7214 if(!exp->expType)
7215 {
7216 exp->expType = op1->type;
7217 if(op1->type)
7218 op1->type->refCount++;
7219 }
7220 return 1;
7221 }
7222
7223 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7224 {
7225 float value2 = op2->__anon1.f;
7226
7227 exp->type = 2;
7228 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7229 if(!exp->expType)
7230 {
7231 exp->expType = op1->type;
7232 if(op1->type)
7233 op1->type->refCount++;
7234 }
7235 return 1;
7236 }
7237
7238 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7239 {
7240 double value2 = op2->__anon1.d;
7241
7242 exp->type = 2;
7243 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7244 if(!exp->expType)
7245 {
7246 exp->expType = op1->type;
7247 if(op1->type)
7248 op1->type->refCount++;
7249 }
7250 return 1;
7251 }
7252
7253 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7254 {
7255 int value2 = op2->__anon1.i;
7256
7257 exp->type = 2;
7258 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7259 if(!exp->expType)
7260 {
7261 exp->expType = op1->type;
7262 if(op1->type)
7263 op1->type->refCount++;
7264 }
7265 return 1;
7266 }
7267
7268 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7269 {
7270 unsigned int value2 = op2->__anon1.ui;
7271
7272 exp->type = 2;
7273 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7274 if(!exp->expType)
7275 {
7276 exp->expType = op1->type;
7277 if(op1->type)
7278 op1->type->refCount++;
7279 }
7280 return 1;
7281 }
7282
7283 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7284 {
7285 long long value2 = op2->__anon1.i64;
7286
7287 exp->type = 2;
7288 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7289 if(!exp->expType)
7290 {
7291 exp->expType = op1->type;
7292 if(op1->type)
7293 op1->type->refCount++;
7294 }
7295 return 1;
7296 }
7297
7298 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7299 {
7300 uint64 value2 = op2->__anon1.ui64;
7301
7302 exp->type = 2;
7303 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7304 if(!exp->expType)
7305 {
7306 exp->expType = op1->type;
7307 if(op1->type)
7308 op1->type->refCount++;
7309 }
7310 return 1;
7311 }
7312
7313 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7314 {
7315 short value2 = op2->__anon1.s;
7316
7317 exp->type = 2;
7318 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7319 if(!exp->expType)
7320 {
7321 exp->expType = op1->type;
7322 if(op1->type)
7323 op1->type->refCount++;
7324 }
7325 return 1;
7326 }
7327
7328 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7329 {
7330 unsigned short value2 = op2->__anon1.us;
7331
7332 exp->type = 2;
7333 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7334 if(!exp->expType)
7335 {
7336 exp->expType = op1->type;
7337 if(op1->type)
7338 op1->type->refCount++;
7339 }
7340 return 1;
7341 }
7342
7343 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7344 {
7345 char value2 = op2->__anon1.c;
7346
7347 exp->type = 2;
7348 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7349 if(!exp->expType)
7350 {
7351 exp->expType = op1->type;
7352 if(op1->type)
7353 op1->type->refCount++;
7354 }
7355 return 1;
7356 }
7357
7358 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7359 {
7360 unsigned char value2 = op2->__anon1.uc;
7361
7362 exp->type = 2;
7363 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7364 if(!exp->expType)
7365 {
7366 exp->expType = op1->type;
7367 if(op1->type)
7368 op1->type->refCount++;
7369 }
7370 return 1;
7371 }
7372
7373 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7374 {
7375 float value2 = op2->__anon1.f;
7376
7377 exp->type = 2;
7378 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7379 if(!exp->expType)
7380 {
7381 exp->expType = op1->type;
7382 if(op1->type)
7383 op1->type->refCount++;
7384 }
7385 return 1;
7386 }
7387
7388 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7389 {
7390 double value2 = op2->__anon1.d;
7391
7392 exp->type = 2;
7393 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7394 if(!exp->expType)
7395 {
7396 exp->expType = op1->type;
7397 if(op1->type)
7398 op1->type->refCount++;
7399 }
7400 return 1;
7401 }
7402
7403 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7404 {
7405 int value2 = op2->__anon1.i;
7406
7407 exp->type = 2;
7408 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7409 if(!exp->expType)
7410 {
7411 exp->expType = op1->type;
7412 if(op1->type)
7413 op1->type->refCount++;
7414 }
7415 return 1;
7416 }
7417
7418 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7419 {
7420 unsigned int value2 = op2->__anon1.ui;
7421
7422 exp->type = 2;
7423 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7424 if(!exp->expType)
7425 {
7426 exp->expType = op1->type;
7427 if(op1->type)
7428 op1->type->refCount++;
7429 }
7430 return 1;
7431 }
7432
7433 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7434 {
7435 long long value2 = op2->__anon1.i64;
7436
7437 exp->type = 2;
7438 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7439 if(!exp->expType)
7440 {
7441 exp->expType = op1->type;
7442 if(op1->type)
7443 op1->type->refCount++;
7444 }
7445 return 1;
7446 }
7447
7448 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7449 {
7450 uint64 value2 = op2->__anon1.ui64;
7451
7452 exp->type = 2;
7453 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7454 if(!exp->expType)
7455 {
7456 exp->expType = op1->type;
7457 if(op1->type)
7458 op1->type->refCount++;
7459 }
7460 return 1;
7461 }
7462
7463 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7464 {
7465 short value2 = op2->__anon1.s;
7466
7467 exp->type = 2;
7468 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7469 if(!exp->expType)
7470 {
7471 exp->expType = op1->type;
7472 if(op1->type)
7473 op1->type->refCount++;
7474 }
7475 return 1;
7476 }
7477
7478 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7479 {
7480 unsigned short value2 = op2->__anon1.us;
7481
7482 exp->type = 2;
7483 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7484 if(!exp->expType)
7485 {
7486 exp->expType = op1->type;
7487 if(op1->type)
7488 op1->type->refCount++;
7489 }
7490 return 1;
7491 }
7492
7493 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7494 {
7495 char value2 = op2->__anon1.c;
7496
7497 exp->type = 2;
7498 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7499 if(!exp->expType)
7500 {
7501 exp->expType = op1->type;
7502 if(op1->type)
7503 op1->type->refCount++;
7504 }
7505 return 1;
7506 }
7507
7508 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7509 {
7510 unsigned char value2 = op2->__anon1.uc;
7511
7512 exp->type = 2;
7513 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7514 if(!exp->expType)
7515 {
7516 exp->expType = op1->type;
7517 if(op1->type)
7518 op1->type->refCount++;
7519 }
7520 return 1;
7521 }
7522
7523 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7524 {
7525 float value2 = op2->__anon1.f;
7526
7527 exp->type = 2;
7528 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7529 if(!exp->expType)
7530 {
7531 exp->expType = op1->type;
7532 if(op1->type)
7533 op1->type->refCount++;
7534 }
7535 return 1;
7536 }
7537
7538 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7539 {
7540 double value2 = op2->__anon1.d;
7541
7542 exp->type = 2;
7543 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7544 if(!exp->expType)
7545 {
7546 exp->expType = op1->type;
7547 if(op1->type)
7548 op1->type->refCount++;
7549 }
7550 return 1;
7551 }
7552
7553 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7554 {
7555 int value2 = op2->__anon1.i;
7556
7557 exp->type = 2;
7558 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7559 if(!exp->expType)
7560 {
7561 exp->expType = op1->type;
7562 if(op1->type)
7563 op1->type->refCount++;
7564 }
7565 return 1;
7566 }
7567
7568 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7569 {
7570 unsigned int value2 = op2->__anon1.ui;
7571
7572 exp->type = 2;
7573 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7574 if(!exp->expType)
7575 {
7576 exp->expType = op1->type;
7577 if(op1->type)
7578 op1->type->refCount++;
7579 }
7580 return 1;
7581 }
7582
7583 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7584 {
7585 long long value2 = op2->__anon1.i64;
7586
7587 exp->type = 2;
7588 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7589 if(!exp->expType)
7590 {
7591 exp->expType = op1->type;
7592 if(op1->type)
7593 op1->type->refCount++;
7594 }
7595 return 1;
7596 }
7597
7598 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7599 {
7600 uint64 value2 = op2->__anon1.ui64;
7601
7602 exp->type = 2;
7603 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7604 if(!exp->expType)
7605 {
7606 exp->expType = op1->type;
7607 if(op1->type)
7608 op1->type->refCount++;
7609 }
7610 return 1;
7611 }
7612
7613 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7614 {
7615 short value2 = op2->__anon1.s;
7616
7617 exp->type = 2;
7618 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7619 if(!exp->expType)
7620 {
7621 exp->expType = op1->type;
7622 if(op1->type)
7623 op1->type->refCount++;
7624 }
7625 return 1;
7626 }
7627
7628 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7629 {
7630 unsigned short value2 = op2->__anon1.us;
7631
7632 exp->type = 2;
7633 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7634 if(!exp->expType)
7635 {
7636 exp->expType = op1->type;
7637 if(op1->type)
7638 op1->type->refCount++;
7639 }
7640 return 1;
7641 }
7642
7643 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7644 {
7645 char value2 = op2->__anon1.c;
7646
7647 exp->type = 2;
7648 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7649 if(!exp->expType)
7650 {
7651 exp->expType = op1->type;
7652 if(op1->type)
7653 op1->type->refCount++;
7654 }
7655 return 1;
7656 }
7657
7658 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7659 {
7660 unsigned char value2 = op2->__anon1.uc;
7661
7662 exp->type = 2;
7663 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7664 if(!exp->expType)
7665 {
7666 exp->expType = op1->type;
7667 if(op1->type)
7668 op1->type->refCount++;
7669 }
7670 return 1;
7671 }
7672
7673 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7674 {
7675 float value2 = op2->__anon1.f;
7676
7677 exp->type = 2;
7678 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7679 if(!exp->expType)
7680 {
7681 exp->expType = op1->type;
7682 if(op1->type)
7683 op1->type->refCount++;
7684 }
7685 return 1;
7686 }
7687
7688 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7689 {
7690 double value2 = op2->__anon1.d;
7691
7692 exp->type = 2;
7693 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7694 if(!exp->expType)
7695 {
7696 exp->expType = op1->type;
7697 if(op1->type)
7698 op1->type->refCount++;
7699 }
7700 return 1;
7701 }
7702
7703 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7704 {
7705 int value2 = op2->__anon1.i;
7706
7707 exp->type = 2;
7708 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7709 if(!exp->expType)
7710 {
7711 exp->expType = op1->type;
7712 if(op1->type)
7713 op1->type->refCount++;
7714 }
7715 return 1;
7716 }
7717
7718 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7719 {
7720 unsigned int value2 = op2->__anon1.ui;
7721
7722 exp->type = 2;
7723 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7724 if(!exp->expType)
7725 {
7726 exp->expType = op1->type;
7727 if(op1->type)
7728 op1->type->refCount++;
7729 }
7730 return 1;
7731 }
7732
7733 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7734 {
7735 long long value2 = op2->__anon1.i64;
7736
7737 exp->type = 2;
7738 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7739 if(!exp->expType)
7740 {
7741 exp->expType = op1->type;
7742 if(op1->type)
7743 op1->type->refCount++;
7744 }
7745 return 1;
7746 }
7747
7748 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7749 {
7750 uint64 value2 = op2->__anon1.ui64;
7751
7752 exp->type = 2;
7753 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7754 if(!exp->expType)
7755 {
7756 exp->expType = op1->type;
7757 if(op1->type)
7758 op1->type->refCount++;
7759 }
7760 return 1;
7761 }
7762
7763 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7764 {
7765 short value2 = op2->__anon1.s;
7766
7767 exp->type = 2;
7768 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7769 if(!exp->expType)
7770 {
7771 exp->expType = op1->type;
7772 if(op1->type)
7773 op1->type->refCount++;
7774 }
7775 return 1;
7776 }
7777
7778 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7779 {
7780 unsigned short value2 = op2->__anon1.us;
7781
7782 exp->type = 2;
7783 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7784 if(!exp->expType)
7785 {
7786 exp->expType = op1->type;
7787 if(op1->type)
7788 op1->type->refCount++;
7789 }
7790 return 1;
7791 }
7792
7793 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7794 {
7795 char value2 = op2->__anon1.c;
7796
7797 exp->type = 2;
7798 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7799 if(!exp->expType)
7800 {
7801 exp->expType = op1->type;
7802 if(op1->type)
7803 op1->type->refCount++;
7804 }
7805 return 1;
7806 }
7807
7808 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7809 {
7810 unsigned char value2 = op2->__anon1.uc;
7811
7812 exp->type = 2;
7813 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7814 if(!exp->expType)
7815 {
7816 exp->expType = op1->type;
7817 if(op1->type)
7818 op1->type->refCount++;
7819 }
7820 return 1;
7821 }
7822
7823 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7824 {
7825 float value2 = op2->__anon1.f;
7826
7827 exp->type = 2;
7828 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7829 if(!exp->expType)
7830 {
7831 exp->expType = op1->type;
7832 if(op1->type)
7833 op1->type->refCount++;
7834 }
7835 return 1;
7836 }
7837
7838 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7839 {
7840 double value2 = op2->__anon1.d;
7841
7842 exp->type = 2;
7843 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7844 if(!exp->expType)
7845 {
7846 exp->expType = op1->type;
7847 if(op1->type)
7848 op1->type->refCount++;
7849 }
7850 return 1;
7851 }
7852
7853 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7854 {
7855 int value2 = op2->__anon1.i;
7856
7857 exp->type = 2;
7858 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7859 if(!exp->expType)
7860 {
7861 exp->expType = op1->type;
7862 if(op1->type)
7863 op1->type->refCount++;
7864 }
7865 return 1;
7866 }
7867
7868 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7869 {
7870 unsigned int value2 = op2->__anon1.ui;
7871
7872 exp->type = 2;
7873 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7874 if(!exp->expType)
7875 {
7876 exp->expType = op1->type;
7877 if(op1->type)
7878 op1->type->refCount++;
7879 }
7880 return 1;
7881 }
7882
7883 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7884 {
7885 long long value2 = op2->__anon1.i64;
7886
7887 exp->type = 2;
7888 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7889 if(!exp->expType)
7890 {
7891 exp->expType = op1->type;
7892 if(op1->type)
7893 op1->type->refCount++;
7894 }
7895 return 1;
7896 }
7897
7898 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7899 {
7900 uint64 value2 = op2->__anon1.ui64;
7901
7902 exp->type = 2;
7903 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7904 if(!exp->expType)
7905 {
7906 exp->expType = op1->type;
7907 if(op1->type)
7908 op1->type->refCount++;
7909 }
7910 return 1;
7911 }
7912
7913 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7914 {
7915 short value2 = op2->__anon1.s;
7916
7917 exp->type = 2;
7918 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7919 if(!exp->expType)
7920 {
7921 exp->expType = op1->type;
7922 if(op1->type)
7923 op1->type->refCount++;
7924 }
7925 return 1;
7926 }
7927
7928 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7929 {
7930 unsigned short value2 = op2->__anon1.us;
7931
7932 exp->type = 2;
7933 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7934 if(!exp->expType)
7935 {
7936 exp->expType = op1->type;
7937 if(op1->type)
7938 op1->type->refCount++;
7939 }
7940 return 1;
7941 }
7942
7943 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7944 {
7945 char value2 = op2->__anon1.c;
7946
7947 exp->type = 2;
7948 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7949 if(!exp->expType)
7950 {
7951 exp->expType = op1->type;
7952 if(op1->type)
7953 op1->type->refCount++;
7954 }
7955 return 1;
7956 }
7957
7958 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7959 {
7960 unsigned char value2 = op2->__anon1.uc;
7961
7962 exp->type = 2;
7963 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7964 if(!exp->expType)
7965 {
7966 exp->expType = op1->type;
7967 if(op1->type)
7968 op1->type->refCount++;
7969 }
7970 return 1;
7971 }
7972
7973 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7974 {
7975 int value2 = op2->__anon1.i;
7976
7977 exp->type = 2;
7978 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7979 if(!exp->expType)
7980 {
7981 exp->expType = op1->type;
7982 if(op1->type)
7983 op1->type->refCount++;
7984 }
7985 return 1;
7986 }
7987
7988 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7989 {
7990 unsigned int value2 = op2->__anon1.ui;
7991
7992 exp->type = 2;
7993 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
7994 if(!exp->expType)
7995 {
7996 exp->expType = op1->type;
7997 if(op1->type)
7998 op1->type->refCount++;
7999 }
8000 return 1;
8001 }
8002
8003 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8004 {
8005 long long value2 = op2->__anon1.i64;
8006
8007 exp->type = 2;
8008 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8009 if(!exp->expType)
8010 {
8011 exp->expType = op1->type;
8012 if(op1->type)
8013 op1->type->refCount++;
8014 }
8015 return 1;
8016 }
8017
8018 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8019 {
8020 uint64 value2 = op2->__anon1.ui64;
8021
8022 exp->type = 2;
8023 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8024 if(!exp->expType)
8025 {
8026 exp->expType = op1->type;
8027 if(op1->type)
8028 op1->type->refCount++;
8029 }
8030 return 1;
8031 }
8032
8033 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8034 {
8035 short value2 = op2->__anon1.s;
8036
8037 exp->type = 2;
8038 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8039 if(!exp->expType)
8040 {
8041 exp->expType = op1->type;
8042 if(op1->type)
8043 op1->type->refCount++;
8044 }
8045 return 1;
8046 }
8047
8048 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8049 {
8050 unsigned short value2 = op2->__anon1.us;
8051
8052 exp->type = 2;
8053 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8054 if(!exp->expType)
8055 {
8056 exp->expType = op1->type;
8057 if(op1->type)
8058 op1->type->refCount++;
8059 }
8060 return 1;
8061 }
8062
8063 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8064 {
8065 char value2 = op2->__anon1.c;
8066
8067 exp->type = 2;
8068 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8069 if(!exp->expType)
8070 {
8071 exp->expType = op1->type;
8072 if(op1->type)
8073 op1->type->refCount++;
8074 }
8075 return 1;
8076 }
8077
8078 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8079 {
8080 unsigned char value2 = op2->__anon1.uc;
8081
8082 exp->type = 2;
8083 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8084 if(!exp->expType)
8085 {
8086 exp->expType = op1->type;
8087 if(op1->type)
8088 op1->type->refCount++;
8089 }
8090 return 1;
8091 }
8092
8093 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8094 {
8095 int value2 = op2->__anon1.i;
8096
8097 exp->type = 2;
8098 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8099 if(!exp->expType)
8100 {
8101 exp->expType = op1->type;
8102 if(op1->type)
8103 op1->type->refCount++;
8104 }
8105 return 1;
8106 }
8107
8108 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8109 {
8110 unsigned int value2 = op2->__anon1.ui;
8111
8112 exp->type = 2;
8113 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8114 if(!exp->expType)
8115 {
8116 exp->expType = op1->type;
8117 if(op1->type)
8118 op1->type->refCount++;
8119 }
8120 return 1;
8121 }
8122
8123 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8124 {
8125 long long value2 = op2->__anon1.i64;
8126
8127 exp->type = 2;
8128 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8129 if(!exp->expType)
8130 {
8131 exp->expType = op1->type;
8132 if(op1->type)
8133 op1->type->refCount++;
8134 }
8135 return 1;
8136 }
8137
8138 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8139 {
8140 uint64 value2 = op2->__anon1.ui64;
8141
8142 exp->type = 2;
8143 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8144 if(!exp->expType)
8145 {
8146 exp->expType = op1->type;
8147 if(op1->type)
8148 op1->type->refCount++;
8149 }
8150 return 1;
8151 }
8152
8153 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8154 {
8155 short value2 = op2->__anon1.s;
8156
8157 exp->type = 2;
8158 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8159 if(!exp->expType)
8160 {
8161 exp->expType = op1->type;
8162 if(op1->type)
8163 op1->type->refCount++;
8164 }
8165 return 1;
8166 }
8167
8168 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8169 {
8170 unsigned short value2 = op2->__anon1.us;
8171
8172 exp->type = 2;
8173 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8174 if(!exp->expType)
8175 {
8176 exp->expType = op1->type;
8177 if(op1->type)
8178 op1->type->refCount++;
8179 }
8180 return 1;
8181 }
8182
8183 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8184 {
8185 char value2 = op2->__anon1.c;
8186
8187 exp->type = 2;
8188 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8189 if(!exp->expType)
8190 {
8191 exp->expType = op1->type;
8192 if(op1->type)
8193 op1->type->refCount++;
8194 }
8195 return 1;
8196 }
8197
8198 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8199 {
8200 unsigned char value2 = op2->__anon1.uc;
8201
8202 exp->type = 2;
8203 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8204 if(!exp->expType)
8205 {
8206 exp->expType = op1->type;
8207 if(op1->type)
8208 op1->type->refCount++;
8209 }
8210 return 1;
8211 }
8212
8213 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8214 {
8215 int value2 = op2->__anon1.i;
8216
8217 exp->type = 2;
8218 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8219 if(!exp->expType)
8220 {
8221 exp->expType = op1->type;
8222 if(op1->type)
8223 op1->type->refCount++;
8224 }
8225 return 1;
8226 }
8227
8228 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8229 {
8230 unsigned int value2 = op2->__anon1.ui;
8231
8232 exp->type = 2;
8233 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8234 if(!exp->expType)
8235 {
8236 exp->expType = op1->type;
8237 if(op1->type)
8238 op1->type->refCount++;
8239 }
8240 return 1;
8241 }
8242
8243 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8244 {
8245 long long value2 = op2->__anon1.i64;
8246
8247 exp->type = 2;
8248 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8249 if(!exp->expType)
8250 {
8251 exp->expType = op1->type;
8252 if(op1->type)
8253 op1->type->refCount++;
8254 }
8255 return 1;
8256 }
8257
8258 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8259 {
8260 uint64 value2 = op2->__anon1.ui64;
8261
8262 exp->type = 2;
8263 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8264 if(!exp->expType)
8265 {
8266 exp->expType = op1->type;
8267 if(op1->type)
8268 op1->type->refCount++;
8269 }
8270 return 1;
8271 }
8272
8273 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8274 {
8275 short value2 = op2->__anon1.s;
8276
8277 exp->type = 2;
8278 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8279 if(!exp->expType)
8280 {
8281 exp->expType = op1->type;
8282 if(op1->type)
8283 op1->type->refCount++;
8284 }
8285 return 1;
8286 }
8287
8288 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8289 {
8290 unsigned short value2 = op2->__anon1.us;
8291
8292 exp->type = 2;
8293 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8294 if(!exp->expType)
8295 {
8296 exp->expType = op1->type;
8297 if(op1->type)
8298 op1->type->refCount++;
8299 }
8300 return 1;
8301 }
8302
8303 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8304 {
8305 char value2 = op2->__anon1.c;
8306
8307 exp->type = 2;
8308 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8309 if(!exp->expType)
8310 {
8311 exp->expType = op1->type;
8312 if(op1->type)
8313 op1->type->refCount++;
8314 }
8315 return 1;
8316 }
8317
8318 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8319 {
8320 unsigned char value2 = op2->__anon1.uc;
8321
8322 exp->type = 2;
8323 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8324 if(!exp->expType)
8325 {
8326 exp->expType = op1->type;
8327 if(op1->type)
8328 op1->type->refCount++;
8329 }
8330 return 1;
8331 }
8332
8333 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8334 {
8335 int value2 = op2->__anon1.i;
8336
8337 exp->type = 2;
8338 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8339 if(!exp->expType)
8340 {
8341 exp->expType = op1->type;
8342 if(op1->type)
8343 op1->type->refCount++;
8344 }
8345 return 1;
8346 }
8347
8348 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8349 {
8350 unsigned int value2 = op2->__anon1.ui;
8351
8352 exp->type = 2;
8353 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8354 if(!exp->expType)
8355 {
8356 exp->expType = op1->type;
8357 if(op1->type)
8358 op1->type->refCount++;
8359 }
8360 return 1;
8361 }
8362
8363 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8364 {
8365 long long value2 = op2->__anon1.i64;
8366
8367 exp->type = 2;
8368 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8369 if(!exp->expType)
8370 {
8371 exp->expType = op1->type;
8372 if(op1->type)
8373 op1->type->refCount++;
8374 }
8375 return 1;
8376 }
8377
8378 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8379 {
8380 uint64 value2 = op2->__anon1.ui64;
8381
8382 exp->type = 2;
8383 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8384 if(!exp->expType)
8385 {
8386 exp->expType = op1->type;
8387 if(op1->type)
8388 op1->type->refCount++;
8389 }
8390 return 1;
8391 }
8392
8393 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8394 {
8395 short value2 = op2->__anon1.s;
8396
8397 exp->type = 2;
8398 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8399 if(!exp->expType)
8400 {
8401 exp->expType = op1->type;
8402 if(op1->type)
8403 op1->type->refCount++;
8404 }
8405 return 1;
8406 }
8407
8408 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8409 {
8410 unsigned short value2 = op2->__anon1.us;
8411
8412 exp->type = 2;
8413 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8414 if(!exp->expType)
8415 {
8416 exp->expType = op1->type;
8417 if(op1->type)
8418 op1->type->refCount++;
8419 }
8420 return 1;
8421 }
8422
8423 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8424 {
8425 char value2 = op2->__anon1.c;
8426
8427 exp->type = 2;
8428 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8429 if(!exp->expType)
8430 {
8431 exp->expType = op1->type;
8432 if(op1->type)
8433 op1->type->refCount++;
8434 }
8435 return 1;
8436 }
8437
8438 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8439 {
8440 unsigned char value2 = op2->__anon1.uc;
8441
8442 exp->type = 2;
8443 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8444 if(!exp->expType)
8445 {
8446 exp->expType = op1->type;
8447 if(op1->type)
8448 op1->type->refCount++;
8449 }
8450 return 1;
8451 }
8452
8453 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8454 {
8455 int value2 = op2->__anon1.i;
8456
8457 exp->type = 2;
8458 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8459 if(!exp->expType)
8460 {
8461 exp->expType = op1->type;
8462 if(op1->type)
8463 op1->type->refCount++;
8464 }
8465 return 1;
8466 }
8467
8468 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8469 {
8470 unsigned int value2 = op2->__anon1.ui;
8471
8472 exp->type = 2;
8473 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8474 if(!exp->expType)
8475 {
8476 exp->expType = op1->type;
8477 if(op1->type)
8478 op1->type->refCount++;
8479 }
8480 return 1;
8481 }
8482
8483 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8484 {
8485 long long value2 = op2->__anon1.i64;
8486
8487 exp->type = 2;
8488 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8489 if(!exp->expType)
8490 {
8491 exp->expType = op1->type;
8492 if(op1->type)
8493 op1->type->refCount++;
8494 }
8495 return 1;
8496 }
8497
8498 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8499 {
8500 uint64 value2 = op2->__anon1.ui64;
8501
8502 exp->type = 2;
8503 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8504 if(!exp->expType)
8505 {
8506 exp->expType = op1->type;
8507 if(op1->type)
8508 op1->type->refCount++;
8509 }
8510 return 1;
8511 }
8512
8513 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8514 {
8515 short value2 = op2->__anon1.s;
8516
8517 exp->type = 2;
8518 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8519 if(!exp->expType)
8520 {
8521 exp->expType = op1->type;
8522 if(op1->type)
8523 op1->type->refCount++;
8524 }
8525 return 1;
8526 }
8527
8528 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8529 {
8530 unsigned short value2 = op2->__anon1.us;
8531
8532 exp->type = 2;
8533 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8534 if(!exp->expType)
8535 {
8536 exp->expType = op1->type;
8537 if(op1->type)
8538 op1->type->refCount++;
8539 }
8540 return 1;
8541 }
8542
8543 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8544 {
8545 char value2 = op2->__anon1.c;
8546
8547 exp->type = 2;
8548 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8549 if(!exp->expType)
8550 {
8551 exp->expType = op1->type;
8552 if(op1->type)
8553 op1->type->refCount++;
8554 }
8555 return 1;
8556 }
8557
8558 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8559 {
8560 unsigned char value2 = op2->__anon1.uc;
8561
8562 exp->type = 2;
8563 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8564 if(!exp->expType)
8565 {
8566 exp->expType = op1->type;
8567 if(op1->type)
8568 op1->type->refCount++;
8569 }
8570 return 1;
8571 }
8572
8573 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8574 {
8575 exp->type = 2;
8576 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8577 if(!exp->expType)
8578 {
8579 exp->expType = op1->type;
8580 if(op1->type)
8581 op1->type->refCount++;
8582 }
8583 return 1;
8584 }
8585
8586 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8587 {
8588 exp->type = 2;
8589 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8590 if(!exp->expType)
8591 {
8592 exp->expType = op1->type;
8593 if(op1->type)
8594 op1->type->refCount++;
8595 }
8596 return 1;
8597 }
8598
8599 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8600 {
8601 exp->type = 2;
8602 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8603 if(!exp->expType)
8604 {
8605 exp->expType = op1->type;
8606 if(op1->type)
8607 op1->type->refCount++;
8608 }
8609 return 1;
8610 }
8611
8612 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8613 {
8614 exp->type = 2;
8615 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8616 if(!exp->expType)
8617 {
8618 exp->expType = op1->type;
8619 if(op1->type)
8620 op1->type->refCount++;
8621 }
8622 return 1;
8623 }
8624
8625 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8626 {
8627 exp->type = 2;
8628 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8629 if(!exp->expType)
8630 {
8631 exp->expType = op1->type;
8632 if(op1->type)
8633 op1->type->refCount++;
8634 }
8635 return 1;
8636 }
8637
8638 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8639 {
8640 exp->type = 2;
8641 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8642 if(!exp->expType)
8643 {
8644 exp->expType = op1->type;
8645 if(op1->type)
8646 op1->type->refCount++;
8647 }
8648 return 1;
8649 }
8650
8651 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8652 {
8653 exp->type = 2;
8654 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8655 if(!exp->expType)
8656 {
8657 exp->expType = op1->type;
8658 if(op1->type)
8659 op1->type->refCount++;
8660 }
8661 return 1;
8662 }
8663
8664 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8665 {
8666 exp->type = 2;
8667 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8668 if(!exp->expType)
8669 {
8670 exp->expType = op1->type;
8671 if(op1->type)
8672 op1->type->refCount++;
8673 }
8674 return 1;
8675 }
8676
8677 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8678 {
8679 int value2 = op2->__anon1.i;
8680
8681 exp->type = 2;
8682 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8683 if(!exp->expType)
8684 {
8685 exp->expType = op1->type;
8686 if(op1->type)
8687 op1->type->refCount++;
8688 }
8689 return 1;
8690 }
8691
8692 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8693 {
8694 unsigned int value2 = op2->__anon1.ui;
8695
8696 exp->type = 2;
8697 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8698 if(!exp->expType)
8699 {
8700 exp->expType = op1->type;
8701 if(op1->type)
8702 op1->type->refCount++;
8703 }
8704 return 1;
8705 }
8706
8707 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8708 {
8709 long long value2 = op2->__anon1.i64;
8710
8711 exp->type = 2;
8712 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8713 if(!exp->expType)
8714 {
8715 exp->expType = op1->type;
8716 if(op1->type)
8717 op1->type->refCount++;
8718 }
8719 return 1;
8720 }
8721
8722 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8723 {
8724 uint64 value2 = op2->__anon1.ui64;
8725
8726 exp->type = 2;
8727 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8728 if(!exp->expType)
8729 {
8730 exp->expType = op1->type;
8731 if(op1->type)
8732 op1->type->refCount++;
8733 }
8734 return 1;
8735 }
8736
8737 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8738 {
8739 short value2 = op2->__anon1.s;
8740
8741 exp->type = 2;
8742 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8743 if(!exp->expType)
8744 {
8745 exp->expType = op1->type;
8746 if(op1->type)
8747 op1->type->refCount++;
8748 }
8749 return 1;
8750 }
8751
8752 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8753 {
8754 unsigned short value2 = op2->__anon1.us;
8755
8756 exp->type = 2;
8757 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8758 if(!exp->expType)
8759 {
8760 exp->expType = op1->type;
8761 if(op1->type)
8762 op1->type->refCount++;
8763 }
8764 return 1;
8765 }
8766
8767 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8768 {
8769 char value2 = op2->__anon1.c;
8770
8771 exp->type = 2;
8772 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8773 if(!exp->expType)
8774 {
8775 exp->expType = op1->type;
8776 if(op1->type)
8777 op1->type->refCount++;
8778 }
8779 return 1;
8780 }
8781
8782 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8783 {
8784 unsigned char value2 = op2->__anon1.uc;
8785
8786 exp->type = 2;
8787 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8788 if(!exp->expType)
8789 {
8790 exp->expType = op1->type;
8791 if(op1->type)
8792 op1->type->refCount++;
8793 }
8794 return 1;
8795 }
8796
8797 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8798 {
8799 int value2 = op2->__anon1.i;
8800
8801 exp->type = 2;
8802 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8803 if(!exp->expType)
8804 {
8805 exp->expType = op1->type;
8806 if(op1->type)
8807 op1->type->refCount++;
8808 }
8809 return 1;
8810 }
8811
8812 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8813 {
8814 unsigned int value2 = op2->__anon1.ui;
8815
8816 exp->type = 2;
8817 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8818 if(!exp->expType)
8819 {
8820 exp->expType = op1->type;
8821 if(op1->type)
8822 op1->type->refCount++;
8823 }
8824 return 1;
8825 }
8826
8827 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8828 {
8829 long long value2 = op2->__anon1.i64;
8830
8831 exp->type = 2;
8832 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8833 if(!exp->expType)
8834 {
8835 exp->expType = op1->type;
8836 if(op1->type)
8837 op1->type->refCount++;
8838 }
8839 return 1;
8840 }
8841
8842 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8843 {
8844 uint64 value2 = op2->__anon1.ui64;
8845
8846 exp->type = 2;
8847 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8848 if(!exp->expType)
8849 {
8850 exp->expType = op1->type;
8851 if(op1->type)
8852 op1->type->refCount++;
8853 }
8854 return 1;
8855 }
8856
8857 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8858 {
8859 short value2 = op2->__anon1.s;
8860
8861 exp->type = 2;
8862 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8863 if(!exp->expType)
8864 {
8865 exp->expType = op1->type;
8866 if(op1->type)
8867 op1->type->refCount++;
8868 }
8869 return 1;
8870 }
8871
8872 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8873 {
8874 unsigned short value2 = op2->__anon1.us;
8875
8876 exp->type = 2;
8877 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8878 if(!exp->expType)
8879 {
8880 exp->expType = op1->type;
8881 if(op1->type)
8882 op1->type->refCount++;
8883 }
8884 return 1;
8885 }
8886
8887 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8888 {
8889 char value2 = op2->__anon1.c;
8890
8891 exp->type = 2;
8892 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8893 if(!exp->expType)
8894 {
8895 exp->expType = op1->type;
8896 if(op1->type)
8897 op1->type->refCount++;
8898 }
8899 return 1;
8900 }
8901
8902 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8903 {
8904 unsigned char value2 = op2->__anon1.uc;
8905
8906 exp->type = 2;
8907 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8908 if(!exp->expType)
8909 {
8910 exp->expType = op1->type;
8911 if(op1->type)
8912 op1->type->refCount++;
8913 }
8914 return 1;
8915 }
8916
8917 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8918 {
8919 int value2 = op2->__anon1.i;
8920
8921 exp->type = 2;
8922 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8923 if(!exp->expType)
8924 {
8925 exp->expType = op1->type;
8926 if(op1->type)
8927 op1->type->refCount++;
8928 }
8929 return 1;
8930 }
8931
8932 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8933 {
8934 unsigned int value2 = op2->__anon1.ui;
8935
8936 exp->type = 2;
8937 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8938 if(!exp->expType)
8939 {
8940 exp->expType = op1->type;
8941 if(op1->type)
8942 op1->type->refCount++;
8943 }
8944 return 1;
8945 }
8946
8947 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8948 {
8949 long long value2 = op2->__anon1.i64;
8950
8951 exp->type = 2;
8952 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8953 if(!exp->expType)
8954 {
8955 exp->expType = op1->type;
8956 if(op1->type)
8957 op1->type->refCount++;
8958 }
8959 return 1;
8960 }
8961
8962 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8963 {
8964 uint64 value2 = op2->__anon1.ui64;
8965
8966 exp->type = 2;
8967 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8968 if(!exp->expType)
8969 {
8970 exp->expType = op1->type;
8971 if(op1->type)
8972 op1->type->refCount++;
8973 }
8974 return 1;
8975 }
8976
8977 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8978 {
8979 short value2 = op2->__anon1.s;
8980
8981 exp->type = 2;
8982 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8983 if(!exp->expType)
8984 {
8985 exp->expType = op1->type;
8986 if(op1->type)
8987 op1->type->refCount++;
8988 }
8989 return 1;
8990 }
8991
8992 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8993 {
8994 unsigned short value2 = op2->__anon1.us;
8995
8996 exp->type = 2;
8997 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
8998 if(!exp->expType)
8999 {
9000 exp->expType = op1->type;
9001 if(op1->type)
9002 op1->type->refCount++;
9003 }
9004 return 1;
9005 }
9006
9007 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9008 {
9009 char value2 = op2->__anon1.c;
9010
9011 exp->type = 2;
9012 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9013 if(!exp->expType)
9014 {
9015 exp->expType = op1->type;
9016 if(op1->type)
9017 op1->type->refCount++;
9018 }
9019 return 1;
9020 }
9021
9022 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9023 {
9024 unsigned char value2 = op2->__anon1.uc;
9025
9026 exp->type = 2;
9027 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9028 if(!exp->expType)
9029 {
9030 exp->expType = op1->type;
9031 if(op1->type)
9032 op1->type->refCount++;
9033 }
9034 return 1;
9035 }
9036
9037 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9038 {
9039 int value2 = op2->__anon1.i;
9040
9041 exp->type = 2;
9042 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9043 if(!exp->expType)
9044 {
9045 exp->expType = op1->type;
9046 if(op1->type)
9047 op1->type->refCount++;
9048 }
9049 return 1;
9050 }
9051
9052 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9053 {
9054 unsigned int value2 = op2->__anon1.ui;
9055
9056 exp->type = 2;
9057 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9058 if(!exp->expType)
9059 {
9060 exp->expType = op1->type;
9061 if(op1->type)
9062 op1->type->refCount++;
9063 }
9064 return 1;
9065 }
9066
9067 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9068 {
9069 long long value2 = op2->__anon1.i64;
9070
9071 exp->type = 2;
9072 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9073 if(!exp->expType)
9074 {
9075 exp->expType = op1->type;
9076 if(op1->type)
9077 op1->type->refCount++;
9078 }
9079 return 1;
9080 }
9081
9082 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9083 {
9084 uint64 value2 = op2->__anon1.ui64;
9085
9086 exp->type = 2;
9087 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9088 if(!exp->expType)
9089 {
9090 exp->expType = op1->type;
9091 if(op1->type)
9092 op1->type->refCount++;
9093 }
9094 return 1;
9095 }
9096
9097 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9098 {
9099 short value2 = op2->__anon1.s;
9100
9101 exp->type = 2;
9102 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9103 if(!exp->expType)
9104 {
9105 exp->expType = op1->type;
9106 if(op1->type)
9107 op1->type->refCount++;
9108 }
9109 return 1;
9110 }
9111
9112 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9113 {
9114 unsigned short value2 = op2->__anon1.us;
9115
9116 exp->type = 2;
9117 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9118 if(!exp->expType)
9119 {
9120 exp->expType = op1->type;
9121 if(op1->type)
9122 op1->type->refCount++;
9123 }
9124 return 1;
9125 }
9126
9127 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9128 {
9129 char value2 = op2->__anon1.c;
9130
9131 exp->type = 2;
9132 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9133 if(!exp->expType)
9134 {
9135 exp->expType = op1->type;
9136 if(op1->type)
9137 op1->type->refCount++;
9138 }
9139 return 1;
9140 }
9141
9142 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9143 {
9144 unsigned char value2 = op2->__anon1.uc;
9145
9146 exp->type = 2;
9147 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9148 if(!exp->expType)
9149 {
9150 exp->expType = op1->type;
9151 if(op1->type)
9152 op1->type->refCount++;
9153 }
9154 return 1;
9155 }
9156
9157 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9158 {
9159 int value2 = op2->__anon1.i;
9160
9161 exp->type = 2;
9162 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9163 if(!exp->expType)
9164 {
9165 exp->expType = op1->type;
9166 if(op1->type)
9167 op1->type->refCount++;
9168 }
9169 return 1;
9170 }
9171
9172 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9173 {
9174 unsigned int value2 = op2->__anon1.ui;
9175
9176 exp->type = 2;
9177 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9178 if(!exp->expType)
9179 {
9180 exp->expType = op1->type;
9181 if(op1->type)
9182 op1->type->refCount++;
9183 }
9184 return 1;
9185 }
9186
9187 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9188 {
9189 long long value2 = op2->__anon1.i64;
9190
9191 exp->type = 2;
9192 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9193 if(!exp->expType)
9194 {
9195 exp->expType = op1->type;
9196 if(op1->type)
9197 op1->type->refCount++;
9198 }
9199 return 1;
9200 }
9201
9202 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9203 {
9204 uint64 value2 = op2->__anon1.ui64;
9205
9206 exp->type = 2;
9207 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9208 if(!exp->expType)
9209 {
9210 exp->expType = op1->type;
9211 if(op1->type)
9212 op1->type->refCount++;
9213 }
9214 return 1;
9215 }
9216
9217 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9218 {
9219 short value2 = op2->__anon1.s;
9220
9221 exp->type = 2;
9222 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9223 if(!exp->expType)
9224 {
9225 exp->expType = op1->type;
9226 if(op1->type)
9227 op1->type->refCount++;
9228 }
9229 return 1;
9230 }
9231
9232 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9233 {
9234 unsigned short value2 = op2->__anon1.us;
9235
9236 exp->type = 2;
9237 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9238 if(!exp->expType)
9239 {
9240 exp->expType = op1->type;
9241 if(op1->type)
9242 op1->type->refCount++;
9243 }
9244 return 1;
9245 }
9246
9247 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9248 {
9249 char value2 = op2->__anon1.c;
9250
9251 exp->type = 2;
9252 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9253 if(!exp->expType)
9254 {
9255 exp->expType = op1->type;
9256 if(op1->type)
9257 op1->type->refCount++;
9258 }
9259 return 1;
9260 }
9261
9262 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9263 {
9264 unsigned char value2 = op2->__anon1.uc;
9265
9266 exp->type = 2;
9267 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9268 if(!exp->expType)
9269 {
9270 exp->expType = op1->type;
9271 if(op1->type)
9272 op1->type->refCount++;
9273 }
9274 return 1;
9275 }
9276
9277 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9278 {
9279 exp->type = 2;
9280 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9281 if(!exp->expType)
9282 {
9283 exp->expType = op1->type;
9284 if(op1->type)
9285 op1->type->refCount++;
9286 }
9287 return 1;
9288 }
9289
9290 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9291 {
9292 exp->type = 2;
9293 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9294 if(!exp->expType)
9295 {
9296 exp->expType = op1->type;
9297 if(op1->type)
9298 op1->type->refCount++;
9299 }
9300 return 1;
9301 }
9302
9303 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9304 {
9305 exp->type = 2;
9306 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9307 if(!exp->expType)
9308 {
9309 exp->expType = op1->type;
9310 if(op1->type)
9311 op1->type->refCount++;
9312 }
9313 return 1;
9314 }
9315
9316 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9317 {
9318 exp->type = 2;
9319 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9320 if(!exp->expType)
9321 {
9322 exp->expType = op1->type;
9323 if(op1->type)
9324 op1->type->refCount++;
9325 }
9326 return 1;
9327 }
9328
9329 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9330 {
9331 exp->type = 2;
9332 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9333 if(!exp->expType)
9334 {
9335 exp->expType = op1->type;
9336 if(op1->type)
9337 op1->type->refCount++;
9338 }
9339 return 1;
9340 }
9341
9342 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9343 {
9344 exp->type = 2;
9345 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9346 if(!exp->expType)
9347 {
9348 exp->expType = op1->type;
9349 if(op1->type)
9350 op1->type->refCount++;
9351 }
9352 return 1;
9353 }
9354
9355 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9356 {
9357 exp->type = 2;
9358 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9359 if(!exp->expType)
9360 {
9361 exp->expType = op1->type;
9362 if(op1->type)
9363 op1->type->refCount++;
9364 }
9365 return 1;
9366 }
9367
9368 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9369 {
9370 exp->type = 2;
9371 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9372 if(!exp->expType)
9373 {
9374 exp->expType = op1->type;
9375 if(op1->type)
9376 op1->type->refCount++;
9377 }
9378 return 1;
9379 }
9380
9381 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9382 {
9383 int value2 = op2->__anon1.i;
9384
9385 exp->type = 2;
9386 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9387 if(!exp->expType)
9388 {
9389 exp->expType = op1->type;
9390 if(op1->type)
9391 op1->type->refCount++;
9392 }
9393 return 1;
9394 }
9395
9396 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9397 {
9398 unsigned int value2 = op2->__anon1.ui;
9399
9400 exp->type = 2;
9401 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9402 if(!exp->expType)
9403 {
9404 exp->expType = op1->type;
9405 if(op1->type)
9406 op1->type->refCount++;
9407 }
9408 return 1;
9409 }
9410
9411 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9412 {
9413 long long value2 = op2->__anon1.i64;
9414
9415 exp->type = 2;
9416 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9417 if(!exp->expType)
9418 {
9419 exp->expType = op1->type;
9420 if(op1->type)
9421 op1->type->refCount++;
9422 }
9423 return 1;
9424 }
9425
9426 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9427 {
9428 uint64 value2 = op2->__anon1.ui64;
9429
9430 exp->type = 2;
9431 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9432 if(!exp->expType)
9433 {
9434 exp->expType = op1->type;
9435 if(op1->type)
9436 op1->type->refCount++;
9437 }
9438 return 1;
9439 }
9440
9441 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9442 {
9443 short value2 = op2->__anon1.s;
9444
9445 exp->type = 2;
9446 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9447 if(!exp->expType)
9448 {
9449 exp->expType = op1->type;
9450 if(op1->type)
9451 op1->type->refCount++;
9452 }
9453 return 1;
9454 }
9455
9456 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9457 {
9458 unsigned short value2 = op2->__anon1.us;
9459
9460 exp->type = 2;
9461 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9462 if(!exp->expType)
9463 {
9464 exp->expType = op1->type;
9465 if(op1->type)
9466 op1->type->refCount++;
9467 }
9468 return 1;
9469 }
9470
9471 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9472 {
9473 char value2 = op2->__anon1.c;
9474
9475 exp->type = 2;
9476 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9477 if(!exp->expType)
9478 {
9479 exp->expType = op1->type;
9480 if(op1->type)
9481 op1->type->refCount++;
9482 }
9483 return 1;
9484 }
9485
9486 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9487 {
9488 unsigned char value2 = op2->__anon1.uc;
9489
9490 exp->type = 2;
9491 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9492 if(!exp->expType)
9493 {
9494 exp->expType = op1->type;
9495 if(op1->type)
9496 op1->type->refCount++;
9497 }
9498 return 1;
9499 }
9500
9501 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9502 {
9503 float value2 = op2->__anon1.f;
9504
9505 exp->type = 2;
9506 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9507 if(!exp->expType)
9508 {
9509 exp->expType = op1->type;
9510 if(op1->type)
9511 op1->type->refCount++;
9512 }
9513 return 1;
9514 }
9515
9516 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9517 {
9518 double value2 = op2->__anon1.d;
9519
9520 exp->type = 2;
9521 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9522 if(!exp->expType)
9523 {
9524 exp->expType = op1->type;
9525 if(op1->type)
9526 op1->type->refCount++;
9527 }
9528 return 1;
9529 }
9530
9531 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9532 {
9533 int value2 = op2->__anon1.i;
9534
9535 exp->type = 2;
9536 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9537 if(!exp->expType)
9538 {
9539 exp->expType = op1->type;
9540 if(op1->type)
9541 op1->type->refCount++;
9542 }
9543 return 1;
9544 }
9545
9546 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9547 {
9548 unsigned int value2 = op2->__anon1.ui;
9549
9550 exp->type = 2;
9551 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9552 if(!exp->expType)
9553 {
9554 exp->expType = op1->type;
9555 if(op1->type)
9556 op1->type->refCount++;
9557 }
9558 return 1;
9559 }
9560
9561 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9562 {
9563 long long value2 = op2->__anon1.i64;
9564
9565 exp->type = 2;
9566 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9567 if(!exp->expType)
9568 {
9569 exp->expType = op1->type;
9570 if(op1->type)
9571 op1->type->refCount++;
9572 }
9573 return 1;
9574 }
9575
9576 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9577 {
9578 uint64 value2 = op2->__anon1.ui64;
9579
9580 exp->type = 2;
9581 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9582 if(!exp->expType)
9583 {
9584 exp->expType = op1->type;
9585 if(op1->type)
9586 op1->type->refCount++;
9587 }
9588 return 1;
9589 }
9590
9591 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9592 {
9593 short value2 = op2->__anon1.s;
9594
9595 exp->type = 2;
9596 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9597 if(!exp->expType)
9598 {
9599 exp->expType = op1->type;
9600 if(op1->type)
9601 op1->type->refCount++;
9602 }
9603 return 1;
9604 }
9605
9606 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9607 {
9608 unsigned short value2 = op2->__anon1.us;
9609
9610 exp->type = 2;
9611 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9612 if(!exp->expType)
9613 {
9614 exp->expType = op1->type;
9615 if(op1->type)
9616 op1->type->refCount++;
9617 }
9618 return 1;
9619 }
9620
9621 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9622 {
9623 char value2 = op2->__anon1.c;
9624
9625 exp->type = 2;
9626 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9627 if(!exp->expType)
9628 {
9629 exp->expType = op1->type;
9630 if(op1->type)
9631 op1->type->refCount++;
9632 }
9633 return 1;
9634 }
9635
9636 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9637 {
9638 unsigned char value2 = op2->__anon1.uc;
9639
9640 exp->type = 2;
9641 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9642 if(!exp->expType)
9643 {
9644 exp->expType = op1->type;
9645 if(op1->type)
9646 op1->type->refCount++;
9647 }
9648 return 1;
9649 }
9650
9651 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9652 {
9653 float value2 = op2->__anon1.f;
9654
9655 exp->type = 2;
9656 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9657 if(!exp->expType)
9658 {
9659 exp->expType = op1->type;
9660 if(op1->type)
9661 op1->type->refCount++;
9662 }
9663 return 1;
9664 }
9665
9666 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9667 {
9668 double value2 = op2->__anon1.d;
9669
9670 exp->type = 2;
9671 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9672 if(!exp->expType)
9673 {
9674 exp->expType = op1->type;
9675 if(op1->type)
9676 op1->type->refCount++;
9677 }
9678 return 1;
9679 }
9680
9681 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9682 {
9683 int value2 = op2->__anon1.i;
9684
9685 exp->type = 2;
9686 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9687 if(!exp->expType)
9688 {
9689 exp->expType = op1->type;
9690 if(op1->type)
9691 op1->type->refCount++;
9692 }
9693 return 1;
9694 }
9695
9696 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9697 {
9698 unsigned int value2 = op2->__anon1.ui;
9699
9700 exp->type = 2;
9701 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9702 if(!exp->expType)
9703 {
9704 exp->expType = op1->type;
9705 if(op1->type)
9706 op1->type->refCount++;
9707 }
9708 return 1;
9709 }
9710
9711 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9712 {
9713 long long value2 = op2->__anon1.i64;
9714
9715 exp->type = 2;
9716 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9717 if(!exp->expType)
9718 {
9719 exp->expType = op1->type;
9720 if(op1->type)
9721 op1->type->refCount++;
9722 }
9723 return 1;
9724 }
9725
9726 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9727 {
9728 uint64 value2 = op2->__anon1.ui64;
9729
9730 exp->type = 2;
9731 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9732 if(!exp->expType)
9733 {
9734 exp->expType = op1->type;
9735 if(op1->type)
9736 op1->type->refCount++;
9737 }
9738 return 1;
9739 }
9740
9741 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9742 {
9743 short value2 = op2->__anon1.s;
9744
9745 exp->type = 2;
9746 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9747 if(!exp->expType)
9748 {
9749 exp->expType = op1->type;
9750 if(op1->type)
9751 op1->type->refCount++;
9752 }
9753 return 1;
9754 }
9755
9756 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9757 {
9758 unsigned short value2 = op2->__anon1.us;
9759
9760 exp->type = 2;
9761 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9762 if(!exp->expType)
9763 {
9764 exp->expType = op1->type;
9765 if(op1->type)
9766 op1->type->refCount++;
9767 }
9768 return 1;
9769 }
9770
9771 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9772 {
9773 char value2 = op2->__anon1.c;
9774
9775 exp->type = 2;
9776 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9777 if(!exp->expType)
9778 {
9779 exp->expType = op1->type;
9780 if(op1->type)
9781 op1->type->refCount++;
9782 }
9783 return 1;
9784 }
9785
9786 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9787 {
9788 unsigned char value2 = op2->__anon1.uc;
9789
9790 exp->type = 2;
9791 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9792 if(!exp->expType)
9793 {
9794 exp->expType = op1->type;
9795 if(op1->type)
9796 op1->type->refCount++;
9797 }
9798 return 1;
9799 }
9800
9801 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9802 {
9803 float value2 = op2->__anon1.f;
9804
9805 exp->type = 2;
9806 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9807 if(!exp->expType)
9808 {
9809 exp->expType = op1->type;
9810 if(op1->type)
9811 op1->type->refCount++;
9812 }
9813 return 1;
9814 }
9815
9816 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9817 {
9818 double value2 = op2->__anon1.d;
9819
9820 exp->type = 2;
9821 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9822 if(!exp->expType)
9823 {
9824 exp->expType = op1->type;
9825 if(op1->type)
9826 op1->type->refCount++;
9827 }
9828 return 1;
9829 }
9830
9831 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9832 {
9833 int value2 = op2->__anon1.i;
9834
9835 exp->type = 2;
9836 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9837 if(!exp->expType)
9838 {
9839 exp->expType = op1->type;
9840 if(op1->type)
9841 op1->type->refCount++;
9842 }
9843 return 1;
9844 }
9845
9846 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9847 {
9848 unsigned int value2 = op2->__anon1.ui;
9849
9850 exp->type = 2;
9851 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9852 if(!exp->expType)
9853 {
9854 exp->expType = op1->type;
9855 if(op1->type)
9856 op1->type->refCount++;
9857 }
9858 return 1;
9859 }
9860
9861 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9862 {
9863 long long value2 = op2->__anon1.i64;
9864
9865 exp->type = 2;
9866 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9867 if(!exp->expType)
9868 {
9869 exp->expType = op1->type;
9870 if(op1->type)
9871 op1->type->refCount++;
9872 }
9873 return 1;
9874 }
9875
9876 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9877 {
9878 uint64 value2 = op2->__anon1.ui64;
9879
9880 exp->type = 2;
9881 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9882 if(!exp->expType)
9883 {
9884 exp->expType = op1->type;
9885 if(op1->type)
9886 op1->type->refCount++;
9887 }
9888 return 1;
9889 }
9890
9891 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9892 {
9893 short value2 = op2->__anon1.s;
9894
9895 exp->type = 2;
9896 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9897 if(!exp->expType)
9898 {
9899 exp->expType = op1->type;
9900 if(op1->type)
9901 op1->type->refCount++;
9902 }
9903 return 1;
9904 }
9905
9906 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9907 {
9908 unsigned short value2 = op2->__anon1.us;
9909
9910 exp->type = 2;
9911 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9912 if(!exp->expType)
9913 {
9914 exp->expType = op1->type;
9915 if(op1->type)
9916 op1->type->refCount++;
9917 }
9918 return 1;
9919 }
9920
9921 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9922 {
9923 char value2 = op2->__anon1.c;
9924
9925 exp->type = 2;
9926 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9927 if(!exp->expType)
9928 {
9929 exp->expType = op1->type;
9930 if(op1->type)
9931 op1->type->refCount++;
9932 }
9933 return 1;
9934 }
9935
9936 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9937 {
9938 unsigned char value2 = op2->__anon1.uc;
9939
9940 exp->type = 2;
9941 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9942 if(!exp->expType)
9943 {
9944 exp->expType = op1->type;
9945 if(op1->type)
9946 op1->type->refCount++;
9947 }
9948 return 1;
9949 }
9950
9951 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9952 {
9953 float value2 = op2->__anon1.f;
9954
9955 exp->type = 2;
9956 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9957 if(!exp->expType)
9958 {
9959 exp->expType = op1->type;
9960 if(op1->type)
9961 op1->type->refCount++;
9962 }
9963 return 1;
9964 }
9965
9966 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9967 {
9968 double value2 = op2->__anon1.d;
9969
9970 exp->type = 2;
9971 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9972 if(!exp->expType)
9973 {
9974 exp->expType = op1->type;
9975 if(op1->type)
9976 op1->type->refCount++;
9977 }
9978 return 1;
9979 }
9980
9981 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9982 {
9983 int value2 = op2->__anon1.i;
9984
9985 exp->type = 2;
9986 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
9987 if(!exp->expType)
9988 {
9989 exp->expType = op1->type;
9990 if(op1->type)
9991 op1->type->refCount++;
9992 }
9993 return 1;
9994 }
9995
9996 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9997 {
9998 unsigned int value2 = op2->__anon1.ui;
9999
10000 exp->type = 2;
10001 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10002 if(!exp->expType)
10003 {
10004 exp->expType = op1->type;
10005 if(op1->type)
10006 op1->type->refCount++;
10007 }
10008 return 1;
10009 }
10010
10011 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10012 {
10013 long long value2 = op2->__anon1.i64;
10014
10015 exp->type = 2;
10016 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10017 if(!exp->expType)
10018 {
10019 exp->expType = op1->type;
10020 if(op1->type)
10021 op1->type->refCount++;
10022 }
10023 return 1;
10024 }
10025
10026 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10027 {
10028 uint64 value2 = op2->__anon1.ui64;
10029
10030 exp->type = 2;
10031 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10032 if(!exp->expType)
10033 {
10034 exp->expType = op1->type;
10035 if(op1->type)
10036 op1->type->refCount++;
10037 }
10038 return 1;
10039 }
10040
10041 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10042 {
10043 short value2 = op2->__anon1.s;
10044
10045 exp->type = 2;
10046 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10047 if(!exp->expType)
10048 {
10049 exp->expType = op1->type;
10050 if(op1->type)
10051 op1->type->refCount++;
10052 }
10053 return 1;
10054 }
10055
10056 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10057 {
10058 unsigned short value2 = op2->__anon1.us;
10059
10060 exp->type = 2;
10061 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10062 if(!exp->expType)
10063 {
10064 exp->expType = op1->type;
10065 if(op1->type)
10066 op1->type->refCount++;
10067 }
10068 return 1;
10069 }
10070
10071 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10072 {
10073 char value2 = op2->__anon1.c;
10074
10075 exp->type = 2;
10076 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10077 if(!exp->expType)
10078 {
10079 exp->expType = op1->type;
10080 if(op1->type)
10081 op1->type->refCount++;
10082 }
10083 return 1;
10084 }
10085
10086 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10087 {
10088 unsigned char value2 = op2->__anon1.uc;
10089
10090 exp->type = 2;
10091 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10092 if(!exp->expType)
10093 {
10094 exp->expType = op1->type;
10095 if(op1->type)
10096 op1->type->refCount++;
10097 }
10098 return 1;
10099 }
10100
10101 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10102 {
10103 float value2 = op2->__anon1.f;
10104
10105 exp->type = 2;
10106 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10107 if(!exp->expType)
10108 {
10109 exp->expType = op1->type;
10110 if(op1->type)
10111 op1->type->refCount++;
10112 }
10113 return 1;
10114 }
10115
10116 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10117 {
10118 double value2 = op2->__anon1.d;
10119
10120 exp->type = 2;
10121 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10122 if(!exp->expType)
10123 {
10124 exp->expType = op1->type;
10125 if(op1->type)
10126 op1->type->refCount++;
10127 }
10128 return 1;
10129 }
10130
10131 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10132 {
10133 int value2 = op2->__anon1.i;
10134
10135 exp->type = 2;
10136 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10137 if(!exp->expType)
10138 {
10139 exp->expType = op1->type;
10140 if(op1->type)
10141 op1->type->refCount++;
10142 }
10143 return 1;
10144 }
10145
10146 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10147 {
10148 unsigned int value2 = op2->__anon1.ui;
10149
10150 exp->type = 2;
10151 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10152 if(!exp->expType)
10153 {
10154 exp->expType = op1->type;
10155 if(op1->type)
10156 op1->type->refCount++;
10157 }
10158 return 1;
10159 }
10160
10161 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10162 {
10163 long long value2 = op2->__anon1.i64;
10164
10165 exp->type = 2;
10166 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10167 if(!exp->expType)
10168 {
10169 exp->expType = op1->type;
10170 if(op1->type)
10171 op1->type->refCount++;
10172 }
10173 return 1;
10174 }
10175
10176 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10177 {
10178 uint64 value2 = op2->__anon1.ui64;
10179
10180 exp->type = 2;
10181 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10182 if(!exp->expType)
10183 {
10184 exp->expType = op1->type;
10185 if(op1->type)
10186 op1->type->refCount++;
10187 }
10188 return 1;
10189 }
10190
10191 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10192 {
10193 short value2 = op2->__anon1.s;
10194
10195 exp->type = 2;
10196 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10197 if(!exp->expType)
10198 {
10199 exp->expType = op1->type;
10200 if(op1->type)
10201 op1->type->refCount++;
10202 }
10203 return 1;
10204 }
10205
10206 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10207 {
10208 unsigned short value2 = op2->__anon1.us;
10209
10210 exp->type = 2;
10211 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10212 if(!exp->expType)
10213 {
10214 exp->expType = op1->type;
10215 if(op1->type)
10216 op1->type->refCount++;
10217 }
10218 return 1;
10219 }
10220
10221 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10222 {
10223 char value2 = op2->__anon1.c;
10224
10225 exp->type = 2;
10226 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10227 if(!exp->expType)
10228 {
10229 exp->expType = op1->type;
10230 if(op1->type)
10231 op1->type->refCount++;
10232 }
10233 return 1;
10234 }
10235
10236 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10237 {
10238 unsigned char value2 = op2->__anon1.uc;
10239
10240 exp->type = 2;
10241 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10242 if(!exp->expType)
10243 {
10244 exp->expType = op1->type;
10245 if(op1->type)
10246 op1->type->refCount++;
10247 }
10248 return 1;
10249 }
10250
10251 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10252 {
10253 float value2 = op2->__anon1.f;
10254
10255 exp->type = 2;
10256 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10257 if(!exp->expType)
10258 {
10259 exp->expType = op1->type;
10260 if(op1->type)
10261 op1->type->refCount++;
10262 }
10263 return 1;
10264 }
10265
10266 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10267 {
10268 double value2 = op2->__anon1.d;
10269
10270 exp->type = 2;
10271 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10272 if(!exp->expType)
10273 {
10274 exp->expType = op1->type;
10275 if(op1->type)
10276 op1->type->refCount++;
10277 }
10278 return 1;
10279 }
10280
10281 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10282 {
10283 int value2 = op2->__anon1.i;
10284
10285 exp->type = 2;
10286 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10287 if(!exp->expType)
10288 {
10289 exp->expType = op1->type;
10290 if(op1->type)
10291 op1->type->refCount++;
10292 }
10293 return 1;
10294 }
10295
10296 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10297 {
10298 unsigned int value2 = op2->__anon1.ui;
10299
10300 exp->type = 2;
10301 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10302 if(!exp->expType)
10303 {
10304 exp->expType = op1->type;
10305 if(op1->type)
10306 op1->type->refCount++;
10307 }
10308 return 1;
10309 }
10310
10311 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10312 {
10313 long long value2 = op2->__anon1.i64;
10314
10315 exp->type = 2;
10316 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10317 if(!exp->expType)
10318 {
10319 exp->expType = op1->type;
10320 if(op1->type)
10321 op1->type->refCount++;
10322 }
10323 return 1;
10324 }
10325
10326 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10327 {
10328 uint64 value2 = op2->__anon1.ui64;
10329
10330 exp->type = 2;
10331 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10332 if(!exp->expType)
10333 {
10334 exp->expType = op1->type;
10335 if(op1->type)
10336 op1->type->refCount++;
10337 }
10338 return 1;
10339 }
10340
10341 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10342 {
10343 short value2 = op2->__anon1.s;
10344
10345 exp->type = 2;
10346 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10347 if(!exp->expType)
10348 {
10349 exp->expType = op1->type;
10350 if(op1->type)
10351 op1->type->refCount++;
10352 }
10353 return 1;
10354 }
10355
10356 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10357 {
10358 unsigned short value2 = op2->__anon1.us;
10359
10360 exp->type = 2;
10361 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10362 if(!exp->expType)
10363 {
10364 exp->expType = op1->type;
10365 if(op1->type)
10366 op1->type->refCount++;
10367 }
10368 return 1;
10369 }
10370
10371 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10372 {
10373 char value2 = op2->__anon1.c;
10374
10375 exp->type = 2;
10376 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10377 if(!exp->expType)
10378 {
10379 exp->expType = op1->type;
10380 if(op1->type)
10381 op1->type->refCount++;
10382 }
10383 return 1;
10384 }
10385
10386 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10387 {
10388 unsigned char value2 = op2->__anon1.uc;
10389
10390 exp->type = 2;
10391 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10392 if(!exp->expType)
10393 {
10394 exp->expType = op1->type;
10395 if(op1->type)
10396 op1->type->refCount++;
10397 }
10398 return 1;
10399 }
10400
10401 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10402 {
10403 float value2 = op2->__anon1.f;
10404
10405 exp->type = 2;
10406 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10407 if(!exp->expType)
10408 {
10409 exp->expType = op1->type;
10410 if(op1->type)
10411 op1->type->refCount++;
10412 }
10413 return 1;
10414 }
10415
10416 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10417 {
10418 double value2 = op2->__anon1.d;
10419
10420 exp->type = 2;
10421 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10422 if(!exp->expType)
10423 {
10424 exp->expType = op1->type;
10425 if(op1->type)
10426 op1->type->refCount++;
10427 }
10428 return 1;
10429 }
10430
10431 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10432 {
10433 int value2 = op2->__anon1.i;
10434
10435 exp->type = 2;
10436 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10437 if(!exp->expType)
10438 {
10439 exp->expType = op1->type;
10440 if(op1->type)
10441 op1->type->refCount++;
10442 }
10443 return 1;
10444 }
10445
10446 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10447 {
10448 unsigned int value2 = op2->__anon1.ui;
10449
10450 exp->type = 2;
10451 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10452 if(!exp->expType)
10453 {
10454 exp->expType = op1->type;
10455 if(op1->type)
10456 op1->type->refCount++;
10457 }
10458 return 1;
10459 }
10460
10461 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10462 {
10463 long long value2 = op2->__anon1.i64;
10464
10465 exp->type = 2;
10466 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10467 if(!exp->expType)
10468 {
10469 exp->expType = op1->type;
10470 if(op1->type)
10471 op1->type->refCount++;
10472 }
10473 return 1;
10474 }
10475
10476 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10477 {
10478 uint64 value2 = op2->__anon1.ui64;
10479
10480 exp->type = 2;
10481 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10482 if(!exp->expType)
10483 {
10484 exp->expType = op1->type;
10485 if(op1->type)
10486 op1->type->refCount++;
10487 }
10488 return 1;
10489 }
10490
10491 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10492 {
10493 short value2 = op2->__anon1.s;
10494
10495 exp->type = 2;
10496 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10497 if(!exp->expType)
10498 {
10499 exp->expType = op1->type;
10500 if(op1->type)
10501 op1->type->refCount++;
10502 }
10503 return 1;
10504 }
10505
10506 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10507 {
10508 unsigned short value2 = op2->__anon1.us;
10509
10510 exp->type = 2;
10511 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10512 if(!exp->expType)
10513 {
10514 exp->expType = op1->type;
10515 if(op1->type)
10516 op1->type->refCount++;
10517 }
10518 return 1;
10519 }
10520
10521 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10522 {
10523 char value2 = op2->__anon1.c;
10524
10525 exp->type = 2;
10526 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10527 if(!exp->expType)
10528 {
10529 exp->expType = op1->type;
10530 if(op1->type)
10531 op1->type->refCount++;
10532 }
10533 return 1;
10534 }
10535
10536 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10537 {
10538 unsigned char value2 = op2->__anon1.uc;
10539
10540 exp->type = 2;
10541 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10542 if(!exp->expType)
10543 {
10544 exp->expType = op1->type;
10545 if(op1->type)
10546 op1->type->refCount++;
10547 }
10548 return 1;
10549 }
10550
10551 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10552 {
10553 float value2 = op2->__anon1.f;
10554
10555 exp->type = 2;
10556 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10557 if(!exp->expType)
10558 {
10559 exp->expType = op1->type;
10560 if(op1->type)
10561 op1->type->refCount++;
10562 }
10563 return 1;
10564 }
10565
10566 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10567 {
10568 double value2 = op2->__anon1.d;
10569
10570 exp->type = 2;
10571 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10572 if(!exp->expType)
10573 {
10574 exp->expType = op1->type;
10575 if(op1->type)
10576 op1->type->refCount++;
10577 }
10578 return 1;
10579 }
10580
10581 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10582 {
10583 exp->type = 2;
10584 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10585 if(!exp->expType)
10586 {
10587 exp->expType = op1->type;
10588 if(op1->type)
10589 op1->type->refCount++;
10590 }
10591 return 1;
10592 }
10593
10594 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10595 {
10596 exp->type = 2;
10597 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10598 if(!exp->expType)
10599 {
10600 exp->expType = op1->type;
10601 if(op1->type)
10602 op1->type->refCount++;
10603 }
10604 return 1;
10605 }
10606
10607 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10608 {
10609 exp->type = 2;
10610 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10611 if(!exp->expType)
10612 {
10613 exp->expType = op1->type;
10614 if(op1->type)
10615 op1->type->refCount++;
10616 }
10617 return 1;
10618 }
10619
10620 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10621 {
10622 exp->type = 2;
10623 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10624 if(!exp->expType)
10625 {
10626 exp->expType = op1->type;
10627 if(op1->type)
10628 op1->type->refCount++;
10629 }
10630 return 1;
10631 }
10632
10633 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10634 {
10635 exp->type = 2;
10636 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10637 if(!exp->expType)
10638 {
10639 exp->expType = op1->type;
10640 if(op1->type)
10641 op1->type->refCount++;
10642 }
10643 return 1;
10644 }
10645
10646 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10647 {
10648 exp->type = 2;
10649 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10650 if(!exp->expType)
10651 {
10652 exp->expType = op1->type;
10653 if(op1->type)
10654 op1->type->refCount++;
10655 }
10656 return 1;
10657 }
10658
10659 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10660 {
10661 exp->type = 2;
10662 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10663 if(!exp->expType)
10664 {
10665 exp->expType = op1->type;
10666 if(op1->type)
10667 op1->type->refCount++;
10668 }
10669 return 1;
10670 }
10671
10672 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10673 {
10674 exp->type = 2;
10675 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10676 if(!exp->expType)
10677 {
10678 exp->expType = op1->type;
10679 if(op1->type)
10680 op1->type->refCount++;
10681 }
10682 return 1;
10683 }
10684
10685 struct OpTable intOps =
10686 {
10687 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
10688 };
10689
10690 struct OpTable uintOps =
10691 {
10692 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
10693 };
10694
10695 struct OpTable int64Ops =
10696 {
10697 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
10698 };
10699
10700 struct OpTable uint64Ops =
10701 {
10702 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
10703 };
10704
10705 struct OpTable shortOps =
10706 {
10707 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
10708 };
10709
10710 struct OpTable ushortOps =
10711 {
10712 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
10713 };
10714
10715 struct OpTable floatOps =
10716 {
10717 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
10718 };
10719
10720 struct OpTable doubleOps =
10721 {
10722 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
10723 };
10724
10725 struct OpTable charOps =
10726 {
10727 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
10728 };
10729
10730 struct OpTable ucharOps =
10731 {
10732 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
10733 };
10734
10735 void ReadString(char * output, char * string)
10736 {
10737 int len = strlen(string);
10738 int c, d = 0;
10739 unsigned int quoted = 0, escaped = 0;
10740
10741 for(c = 0; c < len; c++)
10742 {
10743 char ch = string[c];
10744
10745 if(escaped)
10746 {
10747 switch(ch)
10748 {
10749 case 'n':
10750 output[d] = '\n';
10751 break;
10752 case 't':
10753 output[d] = '\t';
10754 break;
10755 case 'a':
10756 output[d] = '\a';
10757 break;
10758 case 'b':
10759 output[d] = '\b';
10760 break;
10761 case 'f':
10762 output[d] = '\f';
10763 break;
10764 case 'r':
10765 output[d] = '\r';
10766 break;
10767 case 'v':
10768 output[d] = '\v';
10769 break;
10770 case '\\':
10771 output[d] = '\\';
10772 break;
10773 case '\"':
10774 output[d] = '\"';
10775 break;
10776 case '\'':
10777 output[d] = '\'';
10778 break;
10779 default:
10780 output[d] = ch;
10781 }
10782 d++;
10783 escaped = 0;
10784 }
10785 else
10786 {
10787 if(ch == '\"')
10788 quoted ^= 1;
10789 else if(quoted)
10790 {
10791 if(ch == '\\')
10792 escaped = 1;
10793 else
10794 output[d++] = ch;
10795 }
10796 }
10797 }
10798 output[d] = '\0';
10799 }
10800
10801 int UnescapeString(char * d, char * s, int len)
10802 {
10803 int j = 0, k = 0;
10804 char ch;
10805
10806 while(j < len && (ch = s[j]))
10807 {
10808 switch(ch)
10809 {
10810 case '\\':
10811 switch((ch = s[++j]))
10812 {
10813 case 'n':
10814 d[k] = '\n';
10815 break;
10816 case 't':
10817 d[k] = '\t';
10818 break;
10819 case 'a':
10820 d[k] = '\a';
10821 break;
10822 case 'b':
10823 d[k] = '\b';
10824 break;
10825 case 'f':
10826 d[k] = '\f';
10827 break;
10828 case 'r':
10829 d[k] = '\r';
10830 break;
10831 case 'v':
10832 d[k] = '\v';
10833 break;
10834 case '\\':
10835 d[k] = '\\';
10836 break;
10837 case '\"':
10838 d[k] = '\"';
10839 break;
10840 case '\'':
10841 d[k] = '\'';
10842 break;
10843 default:
10844 d[k] = '\\';
10845 d[k] = ch;
10846 }
10847 break;
10848 default:
10849 d[k] = ch;
10850 }
10851 j++, k++;
10852 }
10853 d[k] = '\0';
10854 return k;
10855 }
10856
10857 char * OffsetEscapedString(char * s, int len, int offset)
10858 {
10859 char ch;
10860 int j = 0, k = 0;
10861
10862 while(j < len && k < offset && (ch = s[j]))
10863 {
10864 if(ch == '\\')
10865 ++j;
10866 j++, k++;
10867 }
10868 return (k == offset) ? s + j : (((void *)0));
10869 }
10870
10871 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10872
10873 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10874
10875 extern double strtod(const char * , char * * );
10876
10877 extern float (* __ecereMethod_float_inf)(void);
10878
10879 extern float (* __ecereMethod_float_nan)(void);
10880
10881 extern double (* __ecereMethod_double_inf)(void);
10882
10883 extern double (* __ecereMethod_double_nan)(void);
10884
10885 struct Operand GetOperand(struct Expression * exp)
10886 {
10887 struct Operand op =
10888 {
10889 0, 0, 0,
10890 .__anon1 = {
10891 .c = 0
10892 },
10893 {
10894 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10895 }
10896 };
10897 struct Type * type = exp->expType;
10898
10899 if(type)
10900 {
10901 while(type->kind == 8 && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
10902 {
10903 if(!type->__anon1._class->__anon1.registered->dataType)
10904 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10905 type = type->__anon1._class->__anon1.registered->dataType;
10906 }
10907 if(exp->type == 3 && op.kind == 13)
10908 {
10909 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10910 op.kind = 13;
10911 op.ops = uint64Ops;
10912 }
10913 else if(exp->isConstant && exp->type == 2)
10914 {
10915 op.kind = type->kind;
10916 op.type = type;
10917 switch(op.kind)
10918 {
10919 case 24:
10920 case 1:
10921 {
10922 if(exp->__anon1.__anon1.constant[0] == '\'')
10923 {
10924 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10925 op.ops = charOps;
10926 }
10927 else if(type->isSigned)
10928 {
10929 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10930 op.ops = charOps;
10931 }
10932 else
10933 {
10934 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10935 op.ops = ucharOps;
10936 }
10937 break;
10938 }
10939 case 2:
10940 if(type->isSigned)
10941 {
10942 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10943 op.ops = shortOps;
10944 }
10945 else
10946 {
10947 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10948 op.ops = ushortOps;
10949 }
10950 break;
10951 case 3:
10952 case 5:
10953 if(type->isSigned)
10954 {
10955 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10956 op.ops = intOps;
10957 }
10958 else
10959 {
10960 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10961 op.ops = uintOps;
10962 }
10963 op.kind = 3;
10964 break;
10965 case 4:
10966 if(type->isSigned)
10967 {
10968 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10969 op.ops = int64Ops;
10970 }
10971 else
10972 {
10973 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10974 op.ops = uint64Ops;
10975 }
10976 op.kind = 4;
10977 break;
10978 case 22:
10979 if(type->isSigned)
10980 {
10981 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10982 op.ops = int64Ops;
10983 }
10984 else
10985 {
10986 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10987 op.ops = uint64Ops;
10988 }
10989 op.kind = 4;
10990 break;
10991 case 23:
10992 if(type->isSigned)
10993 {
10994 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10995 op.ops = int64Ops;
10996 }
10997 else
10998 {
10999 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11000 op.ops = uint64Ops;
11001 }
11002 op.kind = 4;
11003 break;
11004 case 6:
11005 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11006 op.__anon1.f = __ecereMethod_float_inf();
11007 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11008 op.__anon1.f = -__ecereMethod_float_inf();
11009 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11010 op.__anon1.f = __ecereMethod_float_nan();
11011 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11012 op.__anon1.f = -__ecereMethod_float_nan();
11013 else
11014 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11015 op.ops = floatOps;
11016 break;
11017 case 7:
11018 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11019 op.__anon1.d = __ecereMethod_double_inf();
11020 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11021 op.__anon1.d = -__ecereMethod_double_inf();
11022 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11023 op.__anon1.d = __ecereMethod_double_nan();
11024 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11025 op.__anon1.d = -__ecereMethod_double_nan();
11026 else
11027 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11028 op.ops = doubleOps;
11029 break;
11030 case 12:
11031 case 13:
11032 case 8:
11033 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11034 op.kind = 13;
11035 op.ops = uint64Ops;
11036 break;
11037 }
11038 }
11039 }
11040 return op;
11041 }
11042
11043 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11044 {
11045 long long v = 0;
11046
11047 switch(_class->typeSize)
11048 {
11049 case 8:
11050 if(!strcmp(_class->dataTypeString, "uint64"))
11051 v = (long long)*(uint64 *)ptr;
11052 else
11053 v = *(long long *)ptr;
11054 break;
11055 case 4:
11056 if(!strcmp(_class->dataTypeString, "uint"))
11057 v = (long long)*(unsigned int *)ptr;
11058 else
11059 v = (long long)*(int *)ptr;
11060 break;
11061 case 2:
11062 if(!strcmp(_class->dataTypeString, "uint16"))
11063 v = (long long)*(unsigned short *)ptr;
11064 else
11065 v = (long long)*(short *)ptr;
11066 break;
11067 case 1:
11068 if(!strcmp(_class->dataTypeString, "byte"))
11069 v = (long long)*(unsigned char *)ptr;
11070 else
11071 v = (long long)*(char *)ptr;
11072 break;
11073 }
11074 return v;
11075 }
11076
11077 int __ecereVMethodID_class_OnGetString;
11078
11079 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11080
11081 static __attribute__((unused)) void UnusedFunction()
11082 {
11083 int a;
11084
11085 ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
11086 }
11087
11088 extern int __ecereVMethodID_class_OnGetString;
11089
11090 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11091 {
11092 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11093
11094 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11095 {
11096 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11097 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11098 else
11099 {
11100 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11101 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11102 struct Type * type;
11103 void * ptr = inst->data + dataMember->offset + offset;
11104 char * result = (((void *)0));
11105
11106 exp->loc = member->loc = inst->loc;
11107 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11108 if(!dataMember->dataType)
11109 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11110 type = dataMember->dataType;
11111 if(type->kind == 8)
11112 {
11113 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11114
11115 if(_class->type == 4)
11116 {
11117 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11118
11119 if(enumClass)
11120 {
11121 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11122 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11123
11124 for(item = e->values.first; item; item = item->next)
11125 {
11126 if(item->data == GetEnumValue(_class, ptr))
11127 {
11128 result = item->name;
11129 break;
11130 }
11131 }
11132 if(result)
11133 {
11134 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11135 exp->type = 0;
11136 exp->destType = MkClassType(_class->fullName);
11137 ProcessExpressionType(exp);
11138 }
11139 }
11140 }
11141 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11142 {
11143 if(!_class->dataType)
11144 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11145 type = _class->dataType;
11146 }
11147 }
11148 if(!result)
11149 {
11150 switch(type->kind)
11151 {
11152 case 6:
11153 {
11154 FreeExpContents(exp);
11155 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11156 exp->type = 2;
11157 break;
11158 }
11159 case 7:
11160 {
11161 FreeExpContents(exp);
11162 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11163 exp->type = 2;
11164 break;
11165 }
11166 case 3:
11167 {
11168 FreeExpContents(exp);
11169 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11170 exp->type = 2;
11171 break;
11172 }
11173 case 4:
11174 {
11175 FreeExpContents(exp);
11176 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11177 exp->type = 2;
11178 break;
11179 }
11180 case 22:
11181 {
11182 FreeExpContents(exp);
11183 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11184 exp->type = 2;
11185 break;
11186 }
11187 case 23:
11188 {
11189 FreeExpContents(exp);
11190 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11191 exp->type = 2;
11192 break;
11193 }
11194 default:
11195 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11196 }
11197 }
11198 ListAdd(memberList, member);
11199 }
11200 if(parentDataMember->type == 1)
11201 break;
11202 }
11203 }
11204
11205 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11206
11207 void PopulateInstance(struct Instantiation * inst)
11208 {
11209 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11210 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11211 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11212 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11213
11214 if(!inst->members)
11215 inst->members = MkListOne(MkMembersInitList(memberList));
11216 else
11217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11218 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11219 {
11220 if(!dataMember->isProperty)
11221 {
11222 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11223 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11224 else
11225 {
11226 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11227 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11228 struct Type * type;
11229 void * ptr = inst->data + dataMember->offset;
11230 char * result = (((void *)0));
11231
11232 exp->loc = member->loc = inst->loc;
11233 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11234 if(!dataMember->dataType)
11235 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11236 type = dataMember->dataType;
11237 if(type->kind == 8)
11238 {
11239 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11240
11241 if(_class->type == 4)
11242 {
11243 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11244
11245 if(enumClass)
11246 {
11247 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11248 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11249
11250 for(item = e->values.first; item; item = item->next)
11251 {
11252 if(item->data == GetEnumValue(_class, ptr))
11253 {
11254 result = item->name;
11255 break;
11256 }
11257 }
11258 }
11259 if(result)
11260 {
11261 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11262 exp->type = 0;
11263 exp->destType = MkClassType(_class->fullName);
11264 ProcessExpressionType(exp);
11265 }
11266 }
11267 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11268 {
11269 if(!_class->dataType)
11270 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11271 type = _class->dataType;
11272 }
11273 }
11274 if(!result)
11275 {
11276 switch(type->kind)
11277 {
11278 case 6:
11279 {
11280 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11281 exp->type = 2;
11282 break;
11283 }
11284 case 7:
11285 {
11286 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11287 exp->type = 2;
11288 break;
11289 }
11290 case 3:
11291 {
11292 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11293 exp->type = 2;
11294 break;
11295 }
11296 case 4:
11297 {
11298 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11299 exp->type = 2;
11300 break;
11301 }
11302 case 22:
11303 {
11304 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11305 exp->type = 2;
11306 break;
11307 }
11308 default:
11309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11310 }
11311 }
11312 ListAdd(memberList, member);
11313 }
11314 }
11315 }
11316 }
11317
11318 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, unsigned int *  offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
11319
11320 extern void FreeInstance(struct Instantiation * inst);
11321
11322 void ComputeInstantiation(struct Expression * exp)
11323 {
11324 struct Instantiation * inst = exp->__anon1.instance;
11325 struct MembersInit * members;
11326 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11327 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11328 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11329 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11330 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11331 int subMemberStackPos = 0;
11332 uint64 bits = 0;
11333
11334 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11335 {
11336 if(inst->data)
11337 return ;
11338 if(_class->type == 0 || _class->type == 5)
11339 {
11340 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11341 if(_class->type == 0)
11342 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11343 }
11344 else
11345 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11346 }
11347 if(inst->members)
11348 {
11349 for(members = (*inst->members).first; members; members = members->next)
11350 {
11351 switch(members->type)
11352 {
11353 case 0:
11354 {
11355 if(members->__anon1.dataMembers)
11356 {
11357 struct MemberInit * member;
11358
11359 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11360 {
11361 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11362 unsigned int found = 0;
11363 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11364 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11365 unsigned int dataMemberOffset;
11366
11367 if(!ident)
11368 {
11369 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11370 if(curMember)
11371 {
11372 if(curMember->isProperty)
11373 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11374 else
11375 {
11376 dataMember = curMember;
11377 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11378 if(_class->type == 0)
11379 dataMemberOffset += _class->base->structSize;
11380 }
11381 found = 1;
11382 }
11383 }
11384 else
11385 {
11386 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11387 if(prop)
11388 {
11389 found = 1;
11390 if(prop->memberAccess == 1)
11391 {
11392 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11393 curClass = prop->_class;
11394 }
11395 }
11396 else
11397 {
11398 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11399 int _subMemberStackPos = 0;
11400
11401 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11402 if(dataMember)
11403 {
11404 found = 1;
11405 if(dataMember->memberAccess == 1)
11406 {
11407 curMember = dataMember;
11408 curClass = dataMember->_class;
11409 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11410 subMemberStackPos = _subMemberStackPos;
11411 }
11412 }
11413 }
11414 }
11415 if(found && member->initializer && member->initializer->type == 0)
11416 {
11417 struct Expression * value = member->initializer->__anon1.exp;
11418 struct Type * type = (((void *)0));
11419 unsigned int deepMember = 0;
11420
11421 if(prop)
11422 {
11423 type = prop->dataType;
11424 }
11425 else if(dataMember)
11426 {
11427 if(!dataMember->dataType)
11428 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11429 type = dataMember->dataType;
11430 }
11431 if(ident && ident->next)
11432 {
11433 deepMember = 1;
11434 for(ident = ident->next; ident && type; ident = ident->next)
11435 {
11436 if(type->kind == 8)
11437 {
11438 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11439 if(prop)
11440 type = prop->dataType;
11441 else
11442 {
11443 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11444 if(dataMember)
11445 type = dataMember->dataType;
11446 }
11447 }
11448 else if(type->kind == 9 || type->kind == 10)
11449 {
11450 struct Type * memberType;
11451
11452 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11453 {
11454 if(!strcmp(memberType->name, ident->string))
11455 {
11456 type = memberType;
11457 break;
11458 }
11459 }
11460 }
11461 }
11462 }
11463 if(value)
11464 {
11465 FreeType(value->destType);
11466 value->destType = type;
11467 if(type)
11468 type->refCount++;
11469 ComputeExpression(value);
11470 }
11471 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11472 {
11473 if(type->kind == 8)
11474 {
11475 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11476
11477 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11478 {
11479 if(!_class->dataType)
11480 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11481 type = _class->dataType;
11482 }
11483 }
11484 if(dataMember)
11485 {
11486 void * ptr = inst->data + dataMemberOffset;
11487
11488 if(value->type == 2)
11489 {
11490 switch(type->kind)
11491 {
11492 case 3:
11493 {
11494 GetInt(value, (int *)ptr);
11495 break;
11496 }
11497 case 4:
11498 {
11499 GetInt64(value, (long long *)ptr);
11500 break;
11501 }
11502 case 22:
11503 {
11504 GetIntPtr(value, (intptr_t *)ptr);
11505 break;
11506 }
11507 case 23:
11508 {
11509 GetIntSize(value, (ssize_t *)ptr);
11510 break;
11511 }
11512 case 6:
11513 {
11514 GetFloat(value, (float *)ptr);
11515 break;
11516 }
11517 case 7:
11518 {
11519 GetDouble(value, (double *)ptr);
11520 break;
11521 }
11522 }
11523 }
11524 else if(value->type == 1)
11525 {
11526 if(type->kind == 8)
11527 {
11528 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11529
11530 if(_class->type == 1)
11531 {
11532 ComputeTypeSize(type);
11533 if(value->__anon1.instance->data)
11534 memcpy(ptr, value->__anon1.instance->data, type->size);
11535 }
11536 }
11537 }
11538 }
11539 else if(prop)
11540 {
11541 if(value->type == 1 && value->__anon1.instance->data)
11542 {
11543 if(type->kind == 8)
11544 {
11545 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11546
11547 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->__anon1.instance->data))->_class, _class)))
11548 {
11549 void (* Set)(void *, void *) = (void *)prop->Set;
11550
11551 Set(inst->data, value->__anon1.instance->data);
11552 PopulateInstance(inst);
11553 }
11554 }
11555 }
11556 else if(value->type == 2)
11557 {
11558 switch(type->kind)
11559 {
11560 case 7:
11561 {
11562 void (* Set)(void *, double) = (void *)prop->Set;
11563
11564 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11565 break;
11566 }
11567 case 6:
11568 {
11569 void (* Set)(void *, float) = (void *)prop->Set;
11570
11571 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11572 break;
11573 }
11574 case 3:
11575 {
11576 void (* Set)(void *, int) = (void *)prop->Set;
11577
11578 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11579 break;
11580 }
11581 case 4:
11582 {
11583 void (* Set)(void *, long long) = (void *)prop->Set;
11584
11585 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11586 break;
11587 }
11588 case 22:
11589 {
11590 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11591
11592 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11593 break;
11594 }
11595 case 23:
11596 {
11597 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11598
11599 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11600 break;
11601 }
11602 }
11603 }
11604 else if(value->type == 3)
11605 {
11606 char temp[1024];
11607
11608 ReadString(temp, value->__anon1.__anon2.string);
11609 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11610 }
11611 }
11612 }
11613 else if(!deepMember && type && _class->type == 3)
11614 {
11615 if(prop)
11616 {
11617 if(value->type == 2)
11618 {
11619 if(type->kind == 8)
11620 {
11621 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11622
11623 if(_class->type == 3)
11624 {
11625 if(!_class->dataType)
11626 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11627 type = _class->dataType;
11628 }
11629 }
11630 switch(type->kind)
11631 {
11632 case 6:
11633 {
11634 float fValue;
11635 float (* Set)(float) = (void *)prop->Set;
11636
11637 GetFloat(member->initializer->__anon1.exp, &fValue);
11638 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11639 exp->type = 2;
11640 break;
11641 }
11642 case 7:
11643 {
11644 double dValue;
11645 double (* Set)(double) = (void *)prop->Set;
11646
11647 GetDouble(member->initializer->__anon1.exp, &dValue);
11648 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11649 exp->type = 2;
11650 break;
11651 }
11652 }
11653 }
11654 }
11655 }
11656 else if(!deepMember && type && _class->type == 2)
11657 {
11658 if(prop)
11659 {
11660 if(value->type == 1 && value->__anon1.instance->data)
11661 {
11662 unsigned int (* Set)(void *) = (void *)prop->Set;
11663
11664 bits = Set(value->__anon1.instance->data);
11665 }
11666 else if(value->type == 2)
11667 {
11668 }
11669 }
11670 else if(dataMember)
11671 {
11672 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11673 struct Type * type;
11674 uint64 part = 0;
11675
11676 bits = (bits & ~bitMember->mask);
11677 if(!bitMember->dataType)
11678 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11679 type = bitMember->dataType;
11680 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11681 {
11682 if(!type->__anon1._class->__anon1.registered->dataType)
11683 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11684 type = type->__anon1._class->__anon1.registered->dataType;
11685 }
11686 switch(type->kind)
11687 {
11688 case 24:
11689 case 1:
11690 {
11691 unsigned char v;
11692
11693 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11694 part = (uint64)v;
11695 break;
11696 }
11697 case 2:
11698 {
11699 unsigned short v;
11700
11701 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11702 part = (uint64)v;
11703 break;
11704 }
11705 case 3:
11706 case 5:
11707 {
11708 unsigned int v;
11709
11710 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11711 part = (uint64)v;
11712 break;
11713 }
11714 case 4:
11715 {
11716 uint64 v;
11717
11718 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11719 part = v;
11720 break;
11721 }
11722 case 22:
11723 {
11724 uintptr_t v;
11725
11726 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11727 part = (uint64)v;
11728 break;
11729 }
11730 case 23:
11731 {
11732 size_t v;
11733
11734 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11735 part = (uint64)v;
11736 break;
11737 }
11738 }
11739 bits |= part << bitMember->pos;
11740 }
11741 }
11742 }
11743 else
11744 {
11745 if(_class && _class->type == 3)
11746 {
11747 ComputeExpression(member->initializer->__anon1.exp);
11748 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11749 exp->type = 2;
11750 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11751 }
11752 }
11753 }
11754 }
11755 break;
11756 }
11757 }
11758 }
11759 }
11760 if(_class && _class->type == 2)
11761 {
11762 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11763 exp->type = 2;
11764 }
11765 if(exp->type != 1)
11766 {
11767 FreeInstance(inst);
11768 }
11769 }
11770
11771 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11772 {
11773 unsigned int result = 0;
11774
11775 switch(kind)
11776 {
11777 case 2:
11778 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11779 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11780 break;
11781 case 3:
11782 case 5:
11783 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11784 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11785 break;
11786 case 4:
11787 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11788 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11789 break;
11790 case 6:
11791 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11792 result = GetOpFloat(op, &op->__anon1.f);
11793 break;
11794 case 7:
11795 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11796 result = GetOpDouble(op, &op->__anon1.d);
11797 break;
11798 case 13:
11799 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11800 result = GetOpUInt64(op, &op->__anon1.ui64);
11801 break;
11802 case 15:
11803 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11804 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11805 break;
11806 case 22:
11807 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11808 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11809 break;
11810 case 23:
11811 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11812 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11813 break;
11814 }
11815 return result;
11816 }
11817
11818 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11819 {
11820 if(exp->__anon1.op.op == SIZEOF)
11821 {
11822 FreeExpContents(exp);
11823 exp->type = 2;
11824 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11825 }
11826 else
11827 {
11828 if(!exp->__anon1.op.exp1)
11829 {
11830 switch(exp->__anon1.op.op)
11831 {
11832 case '+':
11833 {
11834 struct Expression * exp2 = exp->__anon1.op.exp2;
11835
11836 exp->__anon1.op.exp2 = (((void *)0));
11837 FreeExpContents(exp);
11838 FreeType(exp->expType);
11839 FreeType(exp->destType);
11840 *exp = *exp2;
11841 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11842 break;
11843 }
11844 case '-':
11845 if(op1->ops.Neg)
11846 {
11847 FreeExpContents(exp);
11848 op1->ops.Neg(exp, op1);
11849 }
11850 break;
11851 case '~':
11852 if(op1->ops.BitNot)
11853 {
11854 FreeExpContents(exp);
11855 op1->ops.BitNot(exp, op1);
11856 }
11857 break;
11858 case '!':
11859 if(op1->ops.Not)
11860 {
11861 FreeExpContents(exp);
11862 op1->ops.Not(exp, op1);
11863 }
11864 break;
11865 }
11866 }
11867 else
11868 {
11869 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11870 {
11871 if(Promote(op2, op1->kind, op1->type->isSigned))
11872 op2->kind = op1->kind, op2->ops = op1->ops;
11873 else if(Promote(op1, op2->kind, op2->type->isSigned))
11874 op1->kind = op2->kind, op1->ops = op2->ops;
11875 }
11876 switch(exp->__anon1.op.op)
11877 {
11878 case '+':
11879 if(op1->ops.Add)
11880 {
11881 FreeExpContents(exp);
11882 op1->ops.Add(exp, op1, op2);
11883 }
11884 break;
11885 case '-':
11886 if(op1->ops.Sub)
11887 {
11888 FreeExpContents(exp);
11889 op1->ops.Sub(exp, op1, op2);
11890 }
11891 break;
11892 case '*':
11893 if(op1->ops.Mul)
11894 {
11895 FreeExpContents(exp);
11896 op1->ops.Mul(exp, op1, op2);
11897 }
11898 break;
11899 case '/':
11900 if(op1->ops.Div)
11901 {
11902 FreeExpContents(exp);
11903 op1->ops.Div(exp, op1, op2);
11904 }
11905 break;
11906 case '%':
11907 if(op1->ops.Mod)
11908 {
11909 FreeExpContents(exp);
11910 op1->ops.Mod(exp, op1, op2);
11911 }
11912 break;
11913 case '&':
11914 if(exp->__anon1.op.exp2)
11915 {
11916 if(op1->ops.BitAnd)
11917 {
11918 FreeExpContents(exp);
11919 op1->ops.BitAnd(exp, op1, op2);
11920 }
11921 }
11922 break;
11923 case '|':
11924 if(op1->ops.BitOr)
11925 {
11926 FreeExpContents(exp);
11927 op1->ops.BitOr(exp, op1, op2);
11928 }
11929 break;
11930 case '^':
11931 if(op1->ops.BitXor)
11932 {
11933 FreeExpContents(exp);
11934 op1->ops.BitXor(exp, op1, op2);
11935 }
11936 break;
11937 case LEFT_OP:
11938 if(op1->ops.LShift)
11939 {
11940 FreeExpContents(exp);
11941 op1->ops.LShift(exp, op1, op2);
11942 }
11943 break;
11944 case RIGHT_OP:
11945 if(op1->ops.RShift)
11946 {
11947 FreeExpContents(exp);
11948 op1->ops.RShift(exp, op1, op2);
11949 }
11950 break;
11951 case EQ_OP:
11952 if(op1->ops.Equ)
11953 {
11954 FreeExpContents(exp);
11955 op1->ops.Equ(exp, op1, op2);
11956 }
11957 break;
11958 case NE_OP:
11959 if(op1->ops.Nqu)
11960 {
11961 FreeExpContents(exp);
11962 op1->ops.Nqu(exp, op1, op2);
11963 }
11964 break;
11965 case AND_OP:
11966 if(op1->ops.And)
11967 {
11968 FreeExpContents(exp);
11969 op1->ops.And(exp, op1, op2);
11970 }
11971 break;
11972 case OR_OP:
11973 if(op1->ops.Or)
11974 {
11975 FreeExpContents(exp);
11976 op1->ops.Or(exp, op1, op2);
11977 }
11978 break;
11979 case '>':
11980 if(op1->ops.Grt)
11981 {
11982 FreeExpContents(exp);
11983 op1->ops.Grt(exp, op1, op2);
11984 }
11985 break;
11986 case '<':
11987 if(op1->ops.Sma)
11988 {
11989 FreeExpContents(exp);
11990 op1->ops.Sma(exp, op1, op2);
11991 }
11992 break;
11993 case GE_OP:
11994 if(op1->ops.GrtEqu)
11995 {
11996 FreeExpContents(exp);
11997 op1->ops.GrtEqu(exp, op1, op2);
11998 }
11999 break;
12000 case LE_OP:
12001 if(op1->ops.SmaEqu)
12002 {
12003 FreeExpContents(exp);
12004 op1->ops.SmaEqu(exp, op1, op2);
12005 }
12006 break;
12007 }
12008 }
12009 }
12010 }
12011
12012 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12013
12014 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12015
12016 void ComputeExpression(struct Expression * exp)
12017 {
12018 switch(exp->type)
12019 {
12020 case 1:
12021 {
12022 ComputeInstantiation(exp);
12023 break;
12024 }
12025 case 4:
12026 {
12027 struct Expression * exp1, * exp2 = (((void *)0));
12028 struct Operand op1 =
12029 {
12030 0, 0, 0,
12031 .__anon1 = {
12032 .c = 0
12033 },
12034 {
12035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12036 }
12037 };
12038 struct Operand op2 =
12039 {
12040 0, 0, 0,
12041 .__anon1 = {
12042 .c = 0
12043 },
12044 {
12045 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12046 }
12047 };
12048
12049 if(exp->__anon1.op.exp2)
12050 {
12051 struct Expression * e = exp->__anon1.op.exp2;
12052
12053 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12054 {
12055 if(e->type == 5 || e->type == 32 || e->type == 23)
12056 {
12057 if(e->type == 23)
12058 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12059 else
12060 e = (*e->__anon1.list).last;
12061 }
12062 }
12063 if(exp->__anon1.op.op == 261 && e && e->expType)
12064 {
12065 if(e->type == 3 && e->__anon1.__anon2.string)
12066 {
12067 char * string = e->__anon1.__anon2.string;
12068 int len = strlen(string);
12069 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12070
12071 len = UnescapeString(tmp, string + 1, len - 2);
12072 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12073 FreeExpContents(exp);
12074 exp->type = 2;
12075 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12076 }
12077 else
12078 {
12079 struct Type * type = e->expType;
12080
12081 type->refCount++;
12082 FreeExpContents(exp);
12083 exp->type = 2;
12084 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12085 FreeType(type);
12086 }
12087 break;
12088 }
12089 else
12090 ComputeExpression(exp->__anon1.op.exp2);
12091 }
12092 if(exp->__anon1.op.exp1)
12093 {
12094 ComputeExpression(exp->__anon1.op.exp1);
12095 exp1 = exp->__anon1.op.exp1;
12096 exp2 = exp->__anon1.op.exp2;
12097 op1 = GetOperand(exp1);
12098 if(op1.type)
12099 op1.type->refCount++;
12100 if(exp2)
12101 {
12102 op2 = GetOperand(exp2);
12103 if(op2.type)
12104 op2.type->refCount++;
12105 }
12106 }
12107 else
12108 {
12109 exp1 = exp->__anon1.op.exp2;
12110 op1 = GetOperand(exp1);
12111 if(op1.type)
12112 op1.type->refCount++;
12113 }
12114 CallOperator(exp, exp1, exp2, &op1, &op2);
12115 if(op1.type)
12116 FreeType(op1.type);
12117 if(op2.type)
12118 FreeType(op2.type);
12119 break;
12120 }
12121 case 5:
12122 case 32:
12123 {
12124 struct Expression * e, * n;
12125
12126 for(e = (*exp->__anon1.list).first; e; e = n)
12127 {
12128 n = e->next;
12129 if(!n)
12130 {
12131 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12132 struct Expression * prev = exp->prev;
12133 struct Expression * next = exp->next;
12134
12135 ComputeExpression(e);
12136 FreeType(exp->expType);
12137 FreeType(exp->destType);
12138 *exp = *e;
12139 exp->prev = prev;
12140 exp->next = next;
12141 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12142 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12143 }
12144 else
12145 {
12146 FreeExpression(e);
12147 }
12148 }
12149 break;
12150 }
12151 case 8:
12152 {
12153 struct Expression * memberExp = exp->__anon1.member.exp;
12154 struct Identifier * memberID = exp->__anon1.member.member;
12155 struct Type * type;
12156
12157 ComputeExpression(exp->__anon1.member.exp);
12158 type = exp->__anon1.member.exp->expType;
12159 if(type)
12160 {
12161 struct __ecereNameSpace__ecere__com__Class * _class = (exp->__anon1.member.member && exp->__anon1.member.member->classSym) ? exp->__anon1.member.member->classSym->__anon1.registered : (((type->kind == 8 || type->kind == 19) && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0)));
12162 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12163 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12164 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12165
12166 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12167 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12168 if(!_class)
12169 {
12170 char string[256];
12171 struct Symbol * classSym;
12172
12173 string[0] = '\0';
12174 PrintTypeNoConst(type, string, 0, 1);
12175 classSym = FindClass(string);
12176 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12177 }
12178 if(exp->__anon1.member.member)
12179 {
12180 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12181 if(!prop)
12182 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12183 }
12184 if(!prop && !member && _class && exp->__anon1.member.member)
12185 {
12186 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12187
12188 convertTo = _class;
12189 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12190 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12191 }
12192 if(prop)
12193 {
12194 if(prop->compiled)
12195 {
12196 struct Type * type = prop->dataType;
12197
12198 if(_class->type == 3)
12199 {
12200 if(type->kind == 8)
12201 {
12202 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12203
12204 if(_class->type == 3)
12205 {
12206 if(!_class->dataType)
12207 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12208 type = _class->dataType;
12209 }
12210 }
12211 switch(type->kind)
12212 {
12213 case 6:
12214 {
12215 float value;
12216 float (* Get)(float) = (void *)prop->Get;
12217
12218 GetFloat(exp->__anon1.member.exp, &value);
12219 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12220 exp->type = 2;
12221 break;
12222 }
12223 case 7:
12224 {
12225 double value;
12226 double (* Get)(double);
12227
12228 GetDouble(exp->__anon1.member.exp, &value);
12229 if(convertTo)
12230 Get = (void *)prop->Set;
12231 else
12232 Get = (void *)prop->Get;
12233 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12234 exp->type = 2;
12235 break;
12236 }
12237 }
12238 }
12239 else
12240 {
12241 if(convertTo)
12242 {
12243 struct Expression * value = exp->__anon1.member.exp;
12244 struct Type * type;
12245
12246 if(!prop->dataType)
12247 ProcessPropertyType(prop);
12248 type = prop->dataType;
12249 if(!type)
12250 {
12251 }
12252 else if(_class->type == 1)
12253 {
12254 switch(type->kind)
12255 {
12256 case 8:
12257 {
12258 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12259
12260 if(propertyClass->type == 1 && value->type == 1)
12261 {
12262 void (* Set)(void *, void *) = (void *)prop->Set;
12263
12264 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12265 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12266 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12267 exp->__anon1.instance->loc = exp->loc;
12268 exp->type = 1;
12269 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12270 PopulateInstance(exp->__anon1.instance);
12271 }
12272 break;
12273 }
12274 case 3:
12275 {
12276 int intValue;
12277 void (* Set)(void *, int) = (void *)prop->Set;
12278
12279 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12280 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12281 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12282 exp->__anon1.instance->loc = exp->loc;
12283 exp->type = 1;
12284 GetInt(value, &intValue);
12285 Set(exp->__anon1.instance->data, intValue);
12286 PopulateInstance(exp->__anon1.instance);
12287 break;
12288 }
12289 case 4:
12290 {
12291 long long intValue;
12292 void (* Set)(void *, long long) = (void *)prop->Set;
12293
12294 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12295 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12296 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12297 exp->__anon1.instance->loc = exp->loc;
12298 exp->type = 1;
12299 GetInt64(value, &intValue);
12300 Set(exp->__anon1.instance->data, intValue);
12301 PopulateInstance(exp->__anon1.instance);
12302 break;
12303 }
12304 case 22:
12305 {
12306 intptr_t intValue;
12307 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12308
12309 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12310 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12311 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12312 exp->__anon1.instance->loc = exp->loc;
12313 exp->type = 1;
12314 GetIntPtr(value, &intValue);
12315 Set(exp->__anon1.instance->data, intValue);
12316 PopulateInstance(exp->__anon1.instance);
12317 break;
12318 }
12319 case 23:
12320 {
12321 ssize_t intValue;
12322 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12323
12324 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12325 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12326 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12327 exp->__anon1.instance->loc = exp->loc;
12328 exp->type = 1;
12329 GetIntSize(value, &intValue);
12330 Set(exp->__anon1.instance->data, intValue);
12331 PopulateInstance(exp->__anon1.instance);
12332 break;
12333 }
12334 case 6:
12335 {
12336 float floatValue;
12337 void (* Set)(void *, float) = (void *)prop->Set;
12338
12339 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12340 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12341 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12342 exp->__anon1.instance->loc = exp->loc;
12343 exp->type = 1;
12344 GetFloat(value, &floatValue);
12345 Set(exp->__anon1.instance->data, floatValue);
12346 PopulateInstance(exp->__anon1.instance);
12347 break;
12348 }
12349 case 7:
12350 {
12351 double doubleValue;
12352 void (* Set)(void *, double) = (void *)prop->Set;
12353
12354 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12355 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12356 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12357 exp->__anon1.instance->loc = exp->loc;
12358 exp->type = 1;
12359 GetDouble(value, &doubleValue);
12360 Set(exp->__anon1.instance->data, doubleValue);
12361 PopulateInstance(exp->__anon1.instance);
12362 break;
12363 }
12364 }
12365 }
12366 else if(_class->type == 2)
12367 {
12368 switch(type->kind)
12369 {
12370 case 8:
12371 {
12372 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12373
12374 if(propertyClass->type == 1 && value->__anon1.instance->data)
12375 {
12376 unsigned int (* Set)(void *) = (void *)prop->Set;
12377 unsigned int bits = Set(value->__anon1.instance->data);
12378
12379 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12380 exp->type = 2;
12381 break;
12382 }
12383 else if(_class->type == 2)
12384 {
12385 unsigned int value;
12386 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12387 unsigned int bits;
12388
12389 GetUInt(exp->__anon1.member.exp, &value);
12390 bits = Set(value);
12391 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12392 exp->type = 2;
12393 }
12394 }
12395 }
12396 }
12397 }
12398 else
12399 {
12400 if(_class->type == 2)
12401 {
12402 unsigned int value;
12403
12404 GetUInt(exp->__anon1.member.exp, &value);
12405 switch(type->kind)
12406 {
12407 case 8:
12408 {
12409 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12410
12411 if(_class->type == 1)
12412 {
12413 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12414
12415 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12416 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12417 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12418 exp->__anon1.instance->loc = exp->loc;
12419 exp->type = 1;
12420 Get(value, exp->__anon1.instance->data);
12421 PopulateInstance(exp->__anon1.instance);
12422 }
12423 else if(_class->type == 2)
12424 {
12425 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12426 uint64 bits = Get(value);
12427
12428 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12429 exp->type = 2;
12430 }
12431 break;
12432 }
12433 }
12434 }
12435 else if(_class->type == 1)
12436 {
12437 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12438
12439 switch(type->kind)
12440 {
12441 case 8:
12442 {
12443 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12444
12445 if(_class->type == 1 && value)
12446 {
12447 void (* Get)(void *, void *) = (void *)prop->Get;
12448
12449 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12450 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12451 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12452 exp->__anon1.instance->loc = exp->loc;
12453 exp->type = 1;
12454 Get(value, exp->__anon1.instance->data);
12455 PopulateInstance(exp->__anon1.instance);
12456 }
12457 break;
12458 }
12459 }
12460 }
12461 }
12462 }
12463 }
12464 else
12465 {
12466 exp->isConstant = 0;
12467 }
12468 }
12469 else if(member)
12470 {
12471 }
12472 }
12473 if(exp->type != 8)
12474 {
12475 FreeExpression(memberExp);
12476 FreeIdentifier(memberID);
12477 }
12478 break;
12479 }
12480 case 10:
12481 {
12482 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12483
12484 FreeExpContents(exp);
12485 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12486 exp->type = 2;
12487 FreeType(type);
12488 break;
12489 }
12490 case 15:
12491 {
12492 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12493
12494 if(classSym && classSym->__anon1.registered)
12495 {
12496 if(classSym->__anon1.registered->fixed)
12497 {
12498 FreeSpecifier(exp->__anon1._class);
12499 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12500 exp->type = 2;
12501 }
12502 else
12503 {
12504 char className[1024];
12505
12506 strcpy(className, "__ecereClass_");
12507 FullClassNameCat(className, classSym->string, 1);
12508 DeclareClass(classSym, className);
12509 FreeExpContents(exp);
12510 exp->type = 9;
12511 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12512 exp->__anon1.member.member = MkIdentifier("structSize");
12513 }
12514 }
12515 break;
12516 }
12517 case 11:
12518 {
12519 struct Type * type;
12520 struct Expression * e = exp;
12521
12522 if(exp->type == 11)
12523 {
12524 if(exp->__anon1.cast.exp)
12525 ComputeExpression(exp->__anon1.cast.exp);
12526 e = exp->__anon1.cast.exp;
12527 }
12528 if(e && exp->expType)
12529 {
12530 type = exp->expType;
12531 if(type->kind == 8)
12532 {
12533 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12534
12535 if(_class && (_class->type == 3 || _class->type == 2))
12536 {
12537 if(!_class->dataType)
12538 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12539 type = _class->dataType;
12540 }
12541 }
12542 switch(type->kind)
12543 {
12544 case 24:
12545 case 1:
12546 if(type->isSigned)
12547 {
12548 char value = (char)0;
12549
12550 if(GetChar(e, &value))
12551 {
12552 FreeExpContents(exp);
12553 exp->__anon1.__anon1.constant = PrintChar(value);
12554 exp->type = 2;
12555 }
12556 }
12557 else
12558 {
12559 unsigned char value = (unsigned char)0;
12560
12561 if(GetUChar(e, &value))
12562 {
12563 FreeExpContents(exp);
12564 exp->__anon1.__anon1.constant = PrintUChar(value);
12565 exp->type = 2;
12566 }
12567 }
12568 break;
12569 case 2:
12570 if(type->isSigned)
12571 {
12572 short value = (short)0;
12573
12574 if(GetShort(e, &value))
12575 {
12576 FreeExpContents(exp);
12577 exp->__anon1.__anon1.constant = PrintShort(value);
12578 exp->type = 2;
12579 }
12580 }
12581 else
12582 {
12583 unsigned short value = (unsigned short)0;
12584
12585 if(GetUShort(e, &value))
12586 {
12587 FreeExpContents(exp);
12588 exp->__anon1.__anon1.constant = PrintUShort(value);
12589 exp->type = 2;
12590 }
12591 }
12592 break;
12593 case 3:
12594 if(type->isSigned)
12595 {
12596 int value = 0;
12597
12598 if(GetInt(e, &value))
12599 {
12600 FreeExpContents(exp);
12601 exp->__anon1.__anon1.constant = PrintInt(value);
12602 exp->type = 2;
12603 }
12604 }
12605 else
12606 {
12607 unsigned int value = 0;
12608
12609 if(GetUInt(e, &value))
12610 {
12611 FreeExpContents(exp);
12612 exp->__anon1.__anon1.constant = PrintUInt(value);
12613 exp->type = 2;
12614 }
12615 }
12616 break;
12617 case 4:
12618 if(type->isSigned)
12619 {
12620 long long value = 0;
12621
12622 if(GetInt64(e, &value))
12623 {
12624 FreeExpContents(exp);
12625 exp->__anon1.__anon1.constant = PrintInt64(value);
12626 exp->type = 2;
12627 }
12628 }
12629 else
12630 {
12631 uint64 value = 0;
12632
12633 if(GetUInt64(e, &value))
12634 {
12635 FreeExpContents(exp);
12636 exp->__anon1.__anon1.constant = PrintUInt64(value);
12637 exp->type = 2;
12638 }
12639 }
12640 break;
12641 case 22:
12642 if(type->isSigned)
12643 {
12644 intptr_t value = 0;
12645
12646 if(GetIntPtr(e, &value))
12647 {
12648 FreeExpContents(exp);
12649 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12650 exp->type = 2;
12651 }
12652 }
12653 else
12654 {
12655 uintptr_t value = 0;
12656
12657 if(GetUIntPtr(e, &value))
12658 {
12659 FreeExpContents(exp);
12660 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12661 exp->type = 2;
12662 }
12663 }
12664 break;
12665 case 23:
12666 if(type->isSigned)
12667 {
12668 ssize_t value = 0;
12669
12670 if(GetIntSize(e, &value))
12671 {
12672 FreeExpContents(exp);
12673 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12674 exp->type = 2;
12675 }
12676 }
12677 else
12678 {
12679 size_t value = 0;
12680
12681 if(GetUIntSize(e, &value))
12682 {
12683 FreeExpContents(exp);
12684 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12685 exp->type = 2;
12686 }
12687 }
12688 break;
12689 case 6:
12690 {
12691 float value = 0;
12692
12693 if(GetFloat(e, &value))
12694 {
12695 FreeExpContents(exp);
12696 exp->__anon1.__anon1.constant = PrintFloat(value);
12697 exp->type = 2;
12698 }
12699 break;
12700 }
12701 case 7:
12702 {
12703 double value = 0;
12704
12705 if(GetDouble(e, &value))
12706 {
12707 FreeExpContents(exp);
12708 exp->__anon1.__anon1.constant = PrintDouble(value);
12709 exp->type = 2;
12710 }
12711 break;
12712 }
12713 }
12714 }
12715 break;
12716 }
12717 case 12:
12718 {
12719 struct Operand op1 =
12720 {
12721 0, 0, 0,
12722 .__anon1 = {
12723 .c = 0
12724 },
12725 {
12726 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12727 }
12728 };
12729 struct Operand op2 =
12730 {
12731 0, 0, 0,
12732 .__anon1 = {
12733 .c = 0
12734 },
12735 {
12736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12737 }
12738 };
12739 struct Operand op3 =
12740 {
12741 0, 0, 0,
12742 .__anon1 = {
12743 .c = 0
12744 },
12745 {
12746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12747 }
12748 };
12749
12750 if(exp->__anon1.cond.exp)
12751 ComputeExpression((*exp->__anon1.cond.exp).last);
12752 if(exp->__anon1.cond.elseExp)
12753 ComputeExpression(exp->__anon1.cond.elseExp);
12754 if(exp->__anon1.cond.cond)
12755 ComputeExpression(exp->__anon1.cond.cond);
12756 op1 = GetOperand(exp->__anon1.cond.cond);
12757 if(op1.type)
12758 op1.type->refCount++;
12759 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12760 if(op2.type)
12761 op2.type->refCount++;
12762 op3 = GetOperand(exp->__anon1.cond.elseExp);
12763 if(op3.type)
12764 op3.type->refCount++;
12765 if(op1.ops.Cond)
12766 {
12767 FreeExpContents(exp);
12768 op1.ops.Cond(exp, &op1, &op2, &op3);
12769 }
12770 if(op1.type)
12771 FreeType(op1.type);
12772 if(op2.type)
12773 FreeType(op2.type);
12774 if(op3.type)
12775 FreeType(op3.type);
12776 break;
12777 }
12778 }
12779 }
12780
12781 void ApplyAnyObjectLogic(struct Expression * e);
12782
12783 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12784 {
12785 unsigned int result = 1;
12786
12787 if(destType)
12788 {
12789 struct __ecereNameSpace__ecere__sys__OldList converts =
12790 {
12791 0, 0, 0, 0, 0
12792 };
12793 struct Conversion * convert;
12794
12795 if(destType->kind == 0)
12796 return 0;
12797 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12798 result = 0;
12799 if(converts.count)
12800 {
12801 for(convert = converts.first; convert; convert = convert->next)
12802 {
12803 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12804
12805 if(!empty)
12806 {
12807 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12808 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12809
12810 *newExp = *exp;
12811 newExp->prev = (((void *)0));
12812 newExp->next = (((void *)0));
12813 newExp->destType = (((void *)0));
12814 if(convert->isGet)
12815 {
12816 exp->type = 8;
12817 exp->addedThis = 1;
12818 exp->__anon1.member.exp = newExp;
12819 FreeType(exp->__anon1.member.exp->expType);
12820 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12821 exp->__anon1.member.exp->expType->classObjectType = objectType;
12822 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12823 exp->__anon1.member.memberType = 1;
12824 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12825 exp->needCast = 1;
12826 if(exp->expType)
12827 exp->expType->refCount++;
12828 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12829 }
12830 else
12831 {
12832 {
12833 exp->type = 8;
12834 exp->addedThis = 1;
12835 exp->__anon1.member.exp = newExp;
12836 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->__anon1._class && newExp->expType->__anon1._class->__anon1.registered && newExp->expType->__anon1._class->__anon1.registered->type == 5)
12837 {
12838 newExp->byReference = 1;
12839 }
12840 FreeType(exp->__anon1.member.exp->expType);
12841 exp->__anon1.member.exp->expType = (((void *)0));
12842 if(convert->convert->dataType)
12843 {
12844 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12845 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12846 exp->__anon1.member.exp->expType->refCount = 1;
12847 exp->__anon1.member.exp->expType->classObjectType = objectType;
12848 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12849 }
12850 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12851 exp->__anon1.member.memberType = 4;
12852 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12853 exp->needCast = 1;
12854 if(convert->resultType)
12855 convert->resultType->refCount++;
12856 }
12857 }
12858 }
12859 else
12860 {
12861 FreeType(exp->expType);
12862 if(convert->isGet)
12863 {
12864 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12865 if(exp->destType->casted)
12866 exp->needCast = 1;
12867 if(exp->expType)
12868 exp->expType->refCount++;
12869 }
12870 else
12871 {
12872 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12873 if(exp->destType->casted)
12874 exp->needCast = 1;
12875 if(convert->resultType)
12876 convert->resultType->refCount++;
12877 }
12878 }
12879 }
12880 if(exp->isConstant && inCompiler)
12881 ComputeExpression(exp);
12882 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12883 }
12884 if(!result && exp->expType && converts.count)
12885 {
12886 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12887 }
12888 if(!result && exp->expType && exp->destType)
12889 {
12890 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->__anon1.type->kind == 8 && exp->expType->__anon1.type->__anon1._class == exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->__anon1.type->kind == 8 && exp->destType->__anon1.type->__anon1._class == exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1))
12891 result = 1;
12892 }
12893 }
12894 return result;
12895 }
12896
12897 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12898
12899 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12900
12901 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12902
12903 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12904
12905 void CheckTemplateTypes(struct Expression * exp)
12906 {
12907 struct Expression * nbExp = GetNonBracketsExp(exp);
12908
12909 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12910 {
12911 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12912 struct Context * context;
12913
12914 *newExp = *exp;
12915 if(exp->destType)
12916 exp->destType->refCount++;
12917 if(exp->expType)
12918 exp->expType->refCount++;
12919 newExp->prev = (((void *)0));
12920 newExp->next = (((void *)0));
12921 switch(exp->expType->kind)
12922 {
12923 case 7:
12924 if(exp->destType->classObjectType)
12925 {
12926 if(exp->destType)
12927 exp->destType->refCount--;
12928 if(exp->expType)
12929 exp->expType->refCount--;
12930 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12931 }
12932 else
12933 {
12934 struct __ecereNameSpace__ecere__sys__OldList * specs;
12935 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12936 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12937
12938 context = PushContext();
12939 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12940 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12941 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12942 exp->type = 23;
12943 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12944 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12945 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12946 exp->__anon1.compound->__anon1.compound.context = context;
12947 PopContext(context);
12948 }
12949 break;
12950 default:
12951 exp->type = 11;
12952 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12953 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12954 exp->needCast = 1;
12955 break;
12956 }
12957 }
12958 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12959 {
12960 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12961 struct Context * context;
12962
12963 *newExp = *exp;
12964 if(exp->destType)
12965 exp->destType->refCount++;
12966 if(exp->expType)
12967 exp->expType->refCount++;
12968 newExp->prev = (((void *)0));
12969 newExp->next = (((void *)0));
12970 switch(exp->expType->kind)
12971 {
12972 case 7:
12973 if(exp->destType->classObjectType)
12974 {
12975 if(exp->destType)
12976 exp->destType->refCount--;
12977 if(exp->expType)
12978 exp->expType->refCount--;
12979 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12980 }
12981 else
12982 {
12983 struct __ecereNameSpace__ecere__sys__OldList * specs;
12984 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12985 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12986
12987 context = PushContext();
12988 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12989 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12990 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12991 exp->type = 23;
12992 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12993 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12994 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12995 exp->__anon1.compound->__anon1.compound.context = context;
12996 PopContext(context);
12997 }
12998 break;
12999 case 8:
13000 {
13001 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13002 {
13003 exp->type = 5;
13004 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
13005 ProcessExpressionType((*exp->__anon1.list).first);
13006 break;
13007 }
13008 else
13009 {
13010 exp->type = 5;
13011 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13012 exp->needTemplateCast = 2;
13013 newExp->needCast = 1;
13014 newExp->needTemplateCast = 2;
13015 ProcessExpressionType((*exp->__anon1.list).first);
13016 break;
13017 }
13018 }
13019 default:
13020 {
13021 if(exp->expType->kind == 20)
13022 {
13023 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13024
13025 if(type)
13026 {
13027 FreeType(exp->destType);
13028 FreeType(exp->expType);
13029 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13030 break;
13031 }
13032 }
13033 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13034 {
13035 exp->type = 4;
13036 exp->__anon1.op.op = '*';
13037 exp->__anon1.op.exp1 = (((void *)0));
13038 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13039 }
13040 else
13041 {
13042 char typeString[1024];
13043 struct Declarator * decl;
13044 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13045
13046 typeString[0] = '\0';
13047 PrintType(exp->expType, typeString, 0, 0);
13048 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13049 exp->type = 11;
13050 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13051 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13052 exp->__anon1.cast.exp->needCast = 1;
13053 }
13054 break;
13055 }
13056 }
13057 }
13058 }
13059
13060 extern int strncmp(const char * , const char * , size_t n);
13061
13062 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13063
13064 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13065 {
13066 int nsLen = strlen(nameSpace);
13067 struct Symbol * symbol;
13068
13069 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)))
13070 {
13071 char * s = symbol->string;
13072
13073 if(!strncmp(s, nameSpace, nsLen))
13074 {
13075 int c;
13076 char * namePart;
13077
13078 for(c = strlen(s) - 1; c >= 0; c--)
13079 if(s[c] == ':')
13080 break;
13081 namePart = s + c + 1;
13082 if(!strcmp(namePart, name))
13083 {
13084 return symbol;
13085 }
13086 }
13087 else
13088 break;
13089 }
13090 return (((void *)0));
13091 }
13092
13093 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13094 {
13095 int c;
13096 char nameSpace[1024];
13097 const char * namePart;
13098 unsigned int gotColon = 0;
13099
13100 nameSpace[0] = '\0';
13101 for(c = strlen(name) - 1; c >= 0; c--)
13102 if(name[c] == ':')
13103 {
13104 gotColon = 1;
13105 break;
13106 }
13107 namePart = name + c + 1;
13108 while(c >= 0 && name[c] == ':')
13109 c--;
13110 if(c >= 0)
13111 {
13112 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13113
13114 if(symbol)
13115 return symbol;
13116 memcpy(nameSpace, name, c + 1);
13117 nameSpace[c + 1] = (char)0;
13118 return ScanWithNameSpace(tree, nameSpace, namePart);
13119 }
13120 else if(gotColon)
13121 {
13122 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13123
13124 return symbol;
13125 }
13126 else
13127 {
13128 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13129
13130 if(symbol)
13131 return symbol;
13132 return ScanWithNameSpace(tree, "", namePart);
13133 }
13134 return (((void *)0));
13135 }
13136
13137 static void ProcessDeclaration(struct Declaration * decl);
13138
13139 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13140 {
13141 struct Context * ctx;
13142 struct Symbol * symbol = (((void *)0));
13143
13144 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13145 {
13146 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13147 {
13148 symbol = (((void *)0));
13149 if(thisNameSpace)
13150 {
13151 char curName[1024];
13152
13153 strcpy(curName, thisNameSpace);
13154 strcat(curName, "::");
13155 strcat(curName, name);
13156 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13157 }
13158 if(!symbol)
13159 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13160 }
13161 else
13162 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13163 if(symbol || ctx == endContext)
13164 break;
13165 }
13166 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13167 {
13168 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13169 {
13170 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13171 struct Context * tmpContext = curContext;
13172
13173 curContext = (((void *)0));
13174 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13175 curContext = tmpContext;
13176 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13177 DeclareType(symbol->type, 1, 1);
13178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13179 symbol->id = curExternal->symbol->idCode;
13180 }
13181 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13182 {
13183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13184 symbol->id = curExternal->symbol->idCode;
13185 }
13186 }
13187 return symbol;
13188 }
13189
13190 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13191 {
13192 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13193 ListAdd(specs, MkSpecifier(UNSIGNED));
13194 switch(type->kind)
13195 {
13196 case 8:
13197 {
13198 if(type->__anon1._class->__anon1.registered)
13199 {
13200 if(!type->__anon1._class->__anon1.registered->dataType)
13201 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13202 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13203 }
13204 break;
13205 }
13206 case 7:
13207 ListAdd(specs, MkSpecifier(DOUBLE));
13208 break;
13209 case 6:
13210 ListAdd(specs, MkSpecifier(FLOAT));
13211 break;
13212 case 1:
13213 ListAdd(specs, MkSpecifier(CHAR));
13214 break;
13215 case 24:
13216 ListAdd(specs, MkSpecifier(_BOOL));
13217 break;
13218 case 2:
13219 ListAdd(specs, MkSpecifier(SHORT));
13220 break;
13221 case 4:
13222 ListAdd(specs, MkSpecifier(INT64));
13223 break;
13224 case 22:
13225 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13226 break;
13227 case 23:
13228 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13229 break;
13230 case 3:
13231 default:
13232 ListAdd(specs, MkSpecifier(INT));
13233 break;
13234 }
13235 }
13236
13237 static void PrintArraySize(struct Type * arrayType, char * string)
13238 {
13239 char size[256];
13240
13241 size[0] = '\0';
13242 strcat(size, "[");
13243 if(arrayType->__anon1.__anon4.enumClass)
13244 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13245 else if(arrayType->__anon1.__anon4.arraySizeExp)
13246 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13247 strcat(size, "]");
13248 strcat(string, size);
13249 }
13250
13251 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13252 {
13253 if(type)
13254 {
13255 if(printConst && type->constant)
13256 strcat(string, "const ");
13257 switch(type->kind)
13258 {
13259 case 8:
13260 {
13261 struct Symbol * c = type->__anon1._class;
13262
13263 if(type->classObjectType == 2)
13264 strcat(string, "typed_object");
13265 else if(type->classObjectType == 3)
13266 strcat(string, "any_object");
13267 else
13268 {
13269 if(c && c->string)
13270 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13271 }
13272 if(type->byReference)
13273 strcat(string, " &");
13274 break;
13275 }
13276 case 0:
13277 strcat(string, "void");
13278 break;
13279 case 3:
13280 strcat(string, type->isSigned ? "int" : "uint");
13281 break;
13282 case 4:
13283 strcat(string, type->isSigned ? "int64" : "uint64");
13284 break;
13285 case 22:
13286 strcat(string, type->isSigned ? "intptr" : "uintptr");
13287 break;
13288 case 23:
13289 strcat(string, type->isSigned ? "intsize" : "uintsize");
13290 break;
13291 case 1:
13292 strcat(string, type->isSigned ? "char" : "byte");
13293 break;
13294 case 24:
13295 strcat(string, "_Bool");
13296 break;
13297 case 2:
13298 strcat(string, type->isSigned ? "short" : "uint16");
13299 break;
13300 case 6:
13301 strcat(string, "float");
13302 break;
13303 case 7:
13304 strcat(string, "double");
13305 break;
13306 case 9:
13307 if(type->__anon1.__anon1.enumName)
13308 {
13309 strcat(string, "struct ");
13310 strcat(string, type->__anon1.__anon1.enumName);
13311 }
13312 else if(type->typeName)
13313 strcat(string, type->typeName);
13314 else
13315 {
13316 struct Type * member;
13317
13318 strcat(string, "struct { ");
13319 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13320 {
13321 PrintType(member, string, 1, fullName);
13322 strcat(string, "; ");
13323 }
13324 strcat(string, "}");
13325 }
13326 break;
13327 case 10:
13328 if(type->__anon1.__anon1.enumName)
13329 {
13330 strcat(string, "union ");
13331 strcat(string, type->__anon1.__anon1.enumName);
13332 }
13333 else if(type->typeName)
13334 strcat(string, type->typeName);
13335 else
13336 {
13337 strcat(string, "union ");
13338 strcat(string, "(unnamed)");
13339 }
13340 break;
13341 case 15:
13342 if(type->__anon1.__anon1.enumName)
13343 {
13344 strcat(string, "enum ");
13345 strcat(string, type->__anon1.__anon1.enumName);
13346 }
13347 else if(type->typeName)
13348 strcat(string, type->typeName);
13349 else
13350 strcat(string, "int");
13351 break;
13352 case 14:
13353 strcat(string, "...");
13354 break;
13355 case 19:
13356 strcat(string, "subclass(");
13357 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13358 strcat(string, ")");
13359 break;
13360 case 20:
13361 strcat(string, type->__anon1.templateParameter->identifier->string);
13362 break;
13363 case 21:
13364 strcat(string, "thisclass");
13365 break;
13366 case 17:
13367 strcat(string, "__builtin_va_list");
13368 break;
13369 }
13370 }
13371 }
13372
13373 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13374
13375 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13376 {
13377 if(type->name && type->name[0])
13378 {
13379 if(fullName)
13380 strcat(string, type->name);
13381 else
13382 {
13383 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13384
13385 if(name)
13386 name += 2;
13387 else
13388 name = type->name;
13389 strcat(string, name);
13390 }
13391 }
13392 }
13393
13394 static void PrintAttribs(struct Type * type, char * string)
13395 {
13396 if(type)
13397 {
13398 if(type->dllExport)
13399 strcat(string, "dllexport ");
13400 if(type->attrStdcall)
13401 strcat(string, "stdcall ");
13402 }
13403 }
13404
13405 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13406 {
13407 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13408 {
13409 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13410 PrintAttribs(type, string);
13411 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13412 strcat(string, " const");
13413 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13414 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13415 strcat(string, " (");
13416 if(type->kind == 13)
13417 {
13418 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13419 PrintAttribs(type->__anon1.type, string);
13420 }
13421 if(type->kind == 13)
13422 {
13423 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13424 strcat(string, "*");
13425 else
13426 strcat(string, " *");
13427 }
13428 if(printConst && type->constant && type->kind == 13)
13429 strcat(string, " const");
13430 }
13431 else
13432 PrintTypeSpecs(type, string, fullName, printConst);
13433 }
13434
13435 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13436 {
13437 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13438 strcat(string, ")");
13439 if(type->kind == 12)
13440 PrintArraySize(type, string);
13441 else if(type->kind == 11)
13442 {
13443 struct Type * param;
13444
13445 strcat(string, "(");
13446 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13447 {
13448 PrintType(param, string, 1, fullName);
13449 if(param->next)
13450 strcat(string, ", ");
13451 }
13452 strcat(string, ")");
13453 }
13454 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13455 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13456 }
13457
13458 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13459 {
13460 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13461 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13462 strcat(string, " ");
13463 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13464 {
13465 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13466
13467 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13468 {
13469 if(type->classObjectType == 1)
13470 strcat(string, "class");
13471 else
13472 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13473 }
13474 else if(_class && _class->string)
13475 {
13476 char * s = _class->string;
13477
13478 if(fullName)
13479 strcat(string, s);
13480 else
13481 {
13482 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13483
13484 if(name)
13485 name += 2;
13486 else
13487 name = s;
13488 strcat(string, name);
13489 }
13490 }
13491 strcat(string, "::");
13492 }
13493 if(printName && type->name)
13494 PrintName(type, string, fullName);
13495 PostPrintType(type, string, fullName);
13496 if(type->bitFieldCount)
13497 {
13498 char count[100];
13499
13500 sprintf(count, ":%d", type->bitFieldCount);
13501 strcat(string, count);
13502 }
13503 }
13504
13505 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13506 {
13507 _PrintType(type, string, printName, fullName, 1);
13508 }
13509
13510 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13511 {
13512 _PrintType(type, string, printName, fullName, 0);
13513 }
13514
13515 static struct Type * FindMember(struct Type * type, char * string)
13516 {
13517 struct Type * memberType;
13518
13519 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13520 {
13521 if(!memberType->name)
13522 {
13523 struct Type * subType = FindMember(memberType, string);
13524
13525 if(subType)
13526 return subType;
13527 }
13528 else if(!strcmp(memberType->name, string))
13529 return memberType;
13530 }
13531 return (((void *)0));
13532 }
13533
13534 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13535 {
13536 struct Type * memberType;
13537
13538 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13539 {
13540 if(!memberType->name)
13541 {
13542 struct Type * subType = FindMember(memberType, string);
13543
13544 if(subType)
13545 {
13546 *offset += memberType->offset;
13547 return subType;
13548 }
13549 }
13550 else if(!strcmp(memberType->name, string))
13551 {
13552 *offset += memberType->offset;
13553 return memberType;
13554 }
13555 }
13556 return (((void *)0));
13557 }
13558
13559 extern unsigned int parseError;
13560
13561 unsigned int GetParseError()
13562 {
13563 return parseError;
13564 }
13565
13566 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13567
13568 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13569
13570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13571
13572 struct Expression * ParseExpressionString(char * expression)
13573 {
13574 parseError = 0;
13575 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13576 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13577 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13578
13579 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13580 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13581 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13582 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13583
13584 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13585 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13586 echoOn = 0;
13587 parsedExpression = (((void *)0));
13588 resetScanner();
13589 expression_yyparse();
13590 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13591 return parsedExpression;
13592 }
13593
13594 extern char *  QMkString(const char *  source);
13595
13596 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13597 {
13598 struct Identifier * id = exp->__anon1.__anon1.identifier;
13599 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13600 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13601 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13602 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13603
13604 if(_class && _class->type == 4)
13605 {
13606 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13607 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13608
13609 if(enumClass)
13610 {
13611 struct __ecereNameSpace__ecere__com__Class * baseClass;
13612
13613 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13614 {
13615 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13616
13617 for(value = e->values.first; value; value = value->next)
13618 {
13619 if(!strcmp(value->name, id->string))
13620 break;
13621 }
13622 if(value)
13623 {
13624 char constant[256];
13625
13626 FreeExpContents(exp);
13627 exp->type = 2;
13628 exp->isConstant = 1;
13629 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13630 sprintf(constant, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), value->data);
13631 else
13632 sprintf(constant, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), value->data);
13633 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13634 exp->expType = MkClassType(baseClass->fullName);
13635 break;
13636 }
13637 }
13638 }
13639 if(value)
13640 return 1;
13641 }
13642 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13643 {
13644 ProcessMethodType(method);
13645 exp->expType = __extension__ ({
13646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13647
13648 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13649 });
13650 return 1;
13651 }
13652 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13653 {
13654 if(!prop->dataType)
13655 ProcessPropertyType(prop);
13656 exp->expType = prop->dataType;
13657 if(prop->dataType)
13658 prop->dataType->refCount++;
13659 return 1;
13660 }
13661 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13662 {
13663 if(!member->dataType)
13664 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13665 exp->expType = member->dataType;
13666 if(member->dataType)
13667 member->dataType->refCount++;
13668 return 1;
13669 }
13670 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13671 {
13672 if(!classProp->dataType)
13673 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13674 if(classProp->constant)
13675 {
13676 FreeExpContents(exp);
13677 exp->isConstant = 1;
13678 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13679 {
13680 exp->type = 3;
13681 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13682 }
13683 else
13684 {
13685 char constant[256];
13686
13687 exp->type = 2;
13688 sprintf(constant, "%d", (int)classProp->Get(_class));
13689 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13690 }
13691 }
13692 else
13693 {
13694 }
13695 exp->expType = classProp->dataType;
13696 if(classProp->dataType)
13697 classProp->dataType->refCount++;
13698 return 1;
13699 }
13700 return 0;
13701 }
13702
13703 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13704 {
13705 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13706 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13707 struct __ecereNameSpace__ecere__com__NameSpace * child;
13708
13709 if(!data)
13710 {
13711 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)))
13712 {
13713 data = ScanGlobalData(child, name);
13714 if(data)
13715 break;
13716 }
13717 }
13718 return data;
13719 }
13720
13721 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13722
13723 extern char *  strncpy(char * , const char * , size_t n);
13724
13725 static struct GlobalData * FindGlobalData(char * name)
13726 {
13727 int start = 0, c;
13728 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13729
13730 nameSpace = globalData;
13731 for(c = 0; name[c]; c++)
13732 {
13733 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13734 {
13735 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13736 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13737
13738 strncpy(spaceName, name + start, c - start);
13739 spaceName[c - start] = '\0';
13740 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13741 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13742 if(!newSpace)
13743 return (((void *)0));
13744 nameSpace = newSpace;
13745 if(name[c] == ':')
13746 c++;
13747 start = c + 1;
13748 }
13749 }
13750 if(c - start)
13751 {
13752 return ScanGlobalData(nameSpace, name + start);
13753 }
13754 return (((void *)0));
13755 }
13756
13757 static int definedExpStackPos;
13758
13759 static void * definedExpStack[512];
13760
13761 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13762 {
13763 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13764
13765 FreeExpContents(checkedExp);
13766 FreeType(checkedExp->expType);
13767 FreeType(checkedExp->destType);
13768 *checkedExp = *newExp;
13769 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13770 checkedExp->prev = prev;
13771 checkedExp->next = next;
13772 }
13773
13774 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13775
13776 extern int printf(const char * , ...);
13777
13778 void __ecereMethod_Expression_Clear();
13779
13780 void ApplyAnyObjectLogic(struct Expression * e)
13781 {
13782 struct Type * destType = e->destType;
13783
13784 if(destType && (destType->classObjectType == 3))
13785 {
13786 if(e && e->expType)
13787 {
13788 struct Type * type = e->expType;
13789 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13790
13791 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13792 {
13793 _class = type->__anon1._class->__anon1.registered;
13794 }
13795 else if(type->kind == 19)
13796 {
13797 _class = FindClass("ecere::com::Class")->__anon1.registered;
13798 }
13799 else
13800 {
13801 char string[1024] = "";
13802 struct Symbol * classSym;
13803
13804 PrintTypeNoConst(type, string, 0, 1);
13805 classSym = FindClass(string);
13806 if(classSym)
13807 _class = classSym->__anon1.registered;
13808 }
13809 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->__anon1._class || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type == 1))) || destType->byReference)))
13810 {
13811 if(!_class || strcmp(_class->fullName, "char *"))
13812 {
13813 struct Expression * checkedExp = e, * newExp;
13814
13815 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13816 {
13817 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13818 {
13819 if(checkedExp->type == 23)
13820 {
13821 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13822 }
13823 else
13824 checkedExp = (*checkedExp->__anon1.list).last;
13825 }
13826 else if(checkedExp->type == 11)
13827 checkedExp = checkedExp->__anon1.cast.exp;
13828 }
13829 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13830 {
13831 newExp = checkedExp->__anon1.op.exp2;
13832 checkedExp->__anon1.op.exp2 = (((void *)0));
13833 FreeExpContents(checkedExp);
13834 if(e->expType && e->expType->passAsTemplate)
13835 {
13836 char size[100];
13837
13838 ComputeTypeSize(e->expType);
13839 sprintf(size, "%d", e->expType->size);
13840 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))))));
13841 }
13842 ReplaceExpContents(checkedExp, newExp);
13843 e->byReference = 1;
13844 }
13845 else if(!e->byReference || (_class && _class->type == 5))
13846 {
13847 struct Expression * checkedExp;
13848
13849 {
13850 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->__anon1.member.memberType == 3) || (e->type == 9 && e->__anon1.member.memberType == 3) || (e->type == 4 && !e->__anon1.op.exp1 && e->__anon1.op.op == '*') || e->type == 6;
13851
13852 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13853 {
13854 struct Context * context = PushContext();
13855 struct Declarator * decl;
13856 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13857 char typeString[1024];
13858 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13859
13860 typeString[0] = '\0';
13861 *newExp = *e;
13862 newExp->prev = (((void *)0));
13863 newExp->next = (((void *)0));
13864 newExp->expType = (((void *)0));
13865 PrintTypeNoConst(e->expType, typeString, 0, 1);
13866 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13867 newExp->destType = ProcessType(specs, decl);
13868 curContext = context;
13869 if(curCompound)
13870 {
13871 char name[100];
13872 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13873
13874 e->type = 23;
13875 sprintf(name, "__internalValue%03X", internalValueCounter++);
13876 if(!curCompound->__anon1.compound.declarations)
13877 curCompound->__anon1.compound.declarations = MkList();
13878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13879 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13880 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13881 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13882 }
13883 else
13884 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13885 {
13886 struct Type * type = e->destType;
13887
13888 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13889 CopyTypeInto(e->destType, type);
13890 e->destType->refCount = 1;
13891 e->destType->classObjectType = 0;
13892 FreeType(type);
13893 }
13894 e->__anon1.compound->__anon1.compound.context = context;
13895 PopContext(context);
13896 curContext = context->parent;
13897 }
13898 }
13899 checkedExp = e;
13900 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13901 {
13902 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13903 {
13904 if(checkedExp->type == 23)
13905 {
13906 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13907 }
13908 else
13909 checkedExp = (*checkedExp->__anon1.list).last;
13910 }
13911 else if(checkedExp->type == 11)
13912 checkedExp = checkedExp->__anon1.cast.exp;
13913 }
13914 {
13915 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13916
13917 *operand = *checkedExp;
13918 __ecereMethod_Expression_Clear(checkedExp);
13919 checkedExp->destType = ProcessTypeString("void *", 0);
13920 checkedExp->expType = checkedExp->destType;
13921 checkedExp->destType->refCount++;
13922 checkedExp->type = 4;
13923 checkedExp->__anon1.op.op = '&';
13924 checkedExp->__anon1.op.exp1 = (((void *)0));
13925 checkedExp->__anon1.op.exp2 = operand;
13926 }
13927 }
13928 }
13929 }
13930 }
13931 }
13932 {
13933 }
13934 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->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))))
13935 {
13936 if(e->expType->classObjectType && destType && destType->classObjectType)
13937 {
13938 return ;
13939 }
13940 else
13941 {
13942 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13943
13944 *thisExp = *e;
13945 thisExp->prev = (((void *)0));
13946 thisExp->next = (((void *)0));
13947 __ecereMethod_Expression_Clear(e);
13948 e->type = 5;
13949 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13950 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13951 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13952 {
13953 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13954 CopyTypeInto(e->expType, thisExp->expType);
13955 e->expType->byReference = 0;
13956 e->expType->refCount = 1;
13957 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))
13958 {
13959 e->expType->classObjectType = 0;
13960 }
13961 }
13962 }
13963 }
13964 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13965 {
13966 if(destType->kind == 14)
13967 {
13968 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13969 }
13970 else if(!(destType->truth && e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && e->expType->__anon1._class->__anon1.registered->type == 1))
13971 {
13972 unsigned int byReference = e->expType->byReference;
13973 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13974 struct Declarator * decl;
13975 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13976 char typeString[1024];
13977 struct Type * type;
13978 int backupClassObjectType;
13979 unsigned int backupByReference;
13980
13981 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13982 type = e->expType;
13983 else
13984 type = destType;
13985 backupClassObjectType = type->classObjectType;
13986 backupByReference = type->byReference;
13987 type->classObjectType = 0;
13988 type->byReference = 0;
13989 typeString[0] = '\0';
13990 PrintType(type, typeString, 0, 1);
13991 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13992 type->classObjectType = backupClassObjectType;
13993 type->byReference = backupByReference;
13994 *thisExp = *e;
13995 thisExp->prev = (((void *)0));
13996 thisExp->next = (((void *)0));
13997 __ecereMethod_Expression_Clear(e);
13998 if((type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1000 || type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 4 || type->__anon1._class->__anon1.registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
13999 {
14000 e->type = 4;
14001 e->__anon1.op.op = '*';
14002 e->__anon1.op.exp1 = (((void *)0));
14003 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14004 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14005 CopyTypeInto(e->expType, type);
14006 e->expType->byReference = 0;
14007 e->expType->refCount = 1;
14008 }
14009 else
14010 {
14011 e->type = 11;
14012 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14013 e->__anon1.cast.exp = thisExp;
14014 e->byReference = 1;
14015 e->expType = type;
14016 type->refCount++;
14017 }
14018 e->destType = destType;
14019 destType->refCount++;
14020 }
14021 }
14022 }
14023
14024 void ApplyLocation(struct Expression * exp, struct Location * loc)
14025 {
14026 exp->loc = *loc;
14027 switch(exp->type)
14028 {
14029 case 4:
14030 if(exp->__anon1.op.exp1)
14031 ApplyLocation(exp->__anon1.op.exp1, loc);
14032 if(exp->__anon1.op.exp2)
14033 ApplyLocation(exp->__anon1.op.exp2, loc);
14034 break;
14035 case 5:
14036 if(exp->__anon1.list)
14037 {
14038 struct Expression * e;
14039
14040 for(e = (*exp->__anon1.list).first; e; e = e->next)
14041 ApplyLocation(e, loc);
14042 }
14043 break;
14044 case 6:
14045 if(exp->__anon1.index.index)
14046 {
14047 struct Expression * e;
14048
14049 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14050 ApplyLocation(e, loc);
14051 }
14052 if(exp->__anon1.index.exp)
14053 ApplyLocation(exp->__anon1.index.exp, loc);
14054 break;
14055 case 7:
14056 if(exp->__anon1.call.arguments)
14057 {
14058 struct Expression * arg;
14059
14060 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14061 ApplyLocation(arg, loc);
14062 }
14063 if(exp->__anon1.call.exp)
14064 ApplyLocation(exp->__anon1.call.exp, loc);
14065 break;
14066 case 8:
14067 case 9:
14068 if(exp->__anon1.member.exp)
14069 ApplyLocation(exp->__anon1.member.exp, loc);
14070 break;
14071 case 11:
14072 if(exp->__anon1.cast.exp)
14073 ApplyLocation(exp->__anon1.cast.exp, loc);
14074 break;
14075 case 12:
14076 if(exp->__anon1.cond.exp)
14077 {
14078 struct Expression * e;
14079
14080 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14081 ApplyLocation(e, loc);
14082 }
14083 if(exp->__anon1.cond.cond)
14084 ApplyLocation(exp->__anon1.cond.cond, loc);
14085 if(exp->__anon1.cond.elseExp)
14086 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14087 break;
14088 case 34:
14089 if(exp->__anon1.vaArg.exp)
14090 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14091 break;
14092 default:
14093 break;
14094 }
14095 }
14096
14097 extern char *  strstr(const char * , const char * );
14098
14099 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14100
14101 struct __ecereNameSpace__ecere__com__DefinedExpression
14102 {
14103 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14104 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14105 const char *  name;
14106 const char *  value;
14107 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14108 } __attribute__ ((gcc_struct));
14109
14110 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14111
14112 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14113
14114 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14115
14116 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14117
14118 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14119
14120 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14121
14122 static void ProcessStatement(struct Statement * stmt);
14123
14124 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14125
14126 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14127
14128 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14129
14130 extern const char *  sourceFile;
14131
14132 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14133
14134 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
14135
14136 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14137
14138 void ProcessExpressionType(struct Expression * exp)
14139 {
14140 unsigned int unresolved = 0;
14141 struct Location oldyylloc = yylloc;
14142 unsigned int notByReference = 0;
14143
14144 if(!exp || exp->expType)
14145 return ;
14146 yylloc = exp->loc;
14147 switch(exp->type)
14148 {
14149 case 0:
14150 {
14151 struct Identifier * id = exp->__anon1.__anon1.identifier;
14152
14153 if(!id || !topContext)
14154 return ;
14155 if(id->_class && id->_class->__anon1.__anon1.name)
14156 {
14157 id->classSym = id->_class->__anon1.__anon1.symbol;
14158 }
14159 if(strstr(id->string, "__ecereClass") == id->string)
14160 {
14161 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14162 break;
14163 }
14164 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14165 {
14166 ReplaceClassMembers(exp, thisClass);
14167 if(exp->type != 0)
14168 {
14169 ProcessExpressionType(exp);
14170 break;
14171 }
14172 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14173 break;
14174 }
14175 else
14176 {
14177 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14178
14179 if(!symbol)
14180 {
14181 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14182 break;
14183 else
14184 {
14185 if(thisClass)
14186 {
14187 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14188 if(exp->type != 0)
14189 {
14190 ProcessExpressionType(exp);
14191 break;
14192 }
14193 }
14194 else if(currentClass && !id->_class)
14195 {
14196 if(ResolveIdWithClass(exp, currentClass, 1))
14197 break;
14198 }
14199 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14200 }
14201 }
14202 if(symbol)
14203 {
14204 struct Type * type = symbol->type;
14205 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14206
14207 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14208 {
14209 struct Context * context = SetupTemplatesContext(_class);
14210
14211 type = ReplaceThisClassType(_class);
14212 FinishTemplatesContext(context);
14213 if(type)
14214 type->refCount = 0;
14215 }
14216 FreeSpecifier(id->_class);
14217 id->_class = (((void *)0));
14218 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14219 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14220 id->classSym = (((void *)0));
14221 exp->expType = type;
14222 if(type)
14223 type->refCount++;
14224 if(type && (type->kind == 15))
14225 exp->isConstant = 1;
14226 if(symbol->isParam || !strcmp(id->string, "this"))
14227 {
14228 if(_class && _class->type == 1 && !type->declaredWithStruct)
14229 exp->byReference = 1;
14230 }
14231 if(symbol->isIterator)
14232 {
14233 if(symbol->isIterator == 3)
14234 {
14235 exp->type = 5;
14236 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14237 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14238 exp->expType = (((void *)0));
14239 ProcessExpressionType(exp);
14240 }
14241 else if(symbol->isIterator != 4)
14242 {
14243 exp->type = 8;
14244 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14245 exp->__anon1.member.exp->expType = exp->expType;
14246 exp->__anon1.member.member = MkIdentifier("data");
14247 exp->expType = (((void *)0));
14248 ProcessExpressionType(exp);
14249 }
14250 }
14251 break;
14252 }
14253 else
14254 {
14255 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14256
14257 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14258 {
14259 char name[1024];
14260
14261 strcpy(name, thisNameSpace);
14262 strcat(name, "::");
14263 strcat(name, id->string);
14264 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14265 }
14266 if(!definedExp)
14267 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14268 if(definedExp)
14269 {
14270 int c;
14271
14272 for(c = 0; c < definedExpStackPos; c++)
14273 if(definedExpStack[c] == definedExp)
14274 break;
14275 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14276 {
14277 struct Location backupYylloc = yylloc;
14278 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14279
14280 definedExpStack[definedExpStackPos++] = definedExp;
14281 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14282 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14283 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14284
14285 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14286 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14287 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14288 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14289
14290 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14291 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14292 echoOn = 0;
14293 parsedExpression = (((void *)0));
14294 resetScanner();
14295 expression_yyparse();
14296 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14297 if(backInput)
14298 fileInput = backInput;
14299 yylloc = backupYylloc;
14300 if(parsedExpression)
14301 {
14302 FreeIdentifier(id);
14303 exp->type = 5;
14304 exp->__anon1.list = MkListOne(parsedExpression);
14305 ApplyLocation(parsedExpression, &yylloc);
14306 ProcessExpressionType(exp);
14307 definedExpStackPos--;
14308 return ;
14309 }
14310 definedExpStackPos--;
14311 }
14312 else
14313 {
14314 if(inCompiler)
14315 {
14316 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14317 }
14318 }
14319 }
14320 else
14321 {
14322 struct GlobalData * data = (((void *)0));
14323
14324 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14325 {
14326 char name[1024];
14327
14328 strcpy(name, thisNameSpace);
14329 strcat(name, "::");
14330 strcat(name, id->string);
14331 data = FindGlobalData(name);
14332 }
14333 if(!data)
14334 data = FindGlobalData(id->string);
14335 if(data)
14336 {
14337 DeclareGlobalData(data);
14338 exp->expType = data->dataType;
14339 if(data->dataType)
14340 data->dataType->refCount++;
14341 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14342 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14343 FreeSpecifier(id->_class);
14344 id->_class = (((void *)0));
14345 break;
14346 }
14347 else
14348 {
14349 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14350
14351 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14352 {
14353 char name[1024];
14354
14355 strcpy(name, thisNameSpace);
14356 strcat(name, "::");
14357 strcat(name, id->string);
14358 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14359 }
14360 if(!function)
14361 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14362 if(function)
14363 {
14364 char name[1024];
14365
14366 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14367 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14368 name[0] = (char)0;
14369 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14370 strcpy(name, "__ecereFunction_");
14371 FullClassNameCat(name, id->string, 0);
14372 if(DeclareFunction(function, name))
14373 {
14374 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14375 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14376 }
14377 exp->expType = function->dataType;
14378 if(function->dataType)
14379 function->dataType->refCount++;
14380 FreeSpecifier(id->_class);
14381 id->_class = (((void *)0));
14382 break;
14383 }
14384 }
14385 }
14386 }
14387 }
14388 unresolved = 1;
14389 break;
14390 }
14391 case 1:
14392 {
14393 if(!exp->__anon1.instance->_class)
14394 {
14395 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14396 {
14397 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14398 }
14399 }
14400 ProcessInstantiationType(exp->__anon1.instance);
14401 exp->isConstant = exp->__anon1.instance->isConstant;
14402 if(exp->__anon1.instance->_class)
14403 {
14404 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14405 }
14406 break;
14407 }
14408 case 2:
14409 {
14410 if(!exp->expType)
14411 {
14412 char * constant = exp->__anon1.__anon1.constant;
14413 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14414
14415 exp->expType = type;
14416 if(constant[0] == '\'')
14417 {
14418 if((int)((unsigned char *)constant)[1] > 127)
14419 {
14420 int nb;
14421 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14422
14423 if(nb < 2)
14424 ch = constant[1];
14425 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14426 exp->__anon1.__anon1.constant = PrintUInt(ch);
14427 type->kind = 8;
14428 type->__anon1._class = FindClass("unichar");
14429 type->isSigned = 0;
14430 }
14431 else
14432 {
14433 type->kind = 1;
14434 type->isSigned = 1;
14435 }
14436 }
14437 else
14438 {
14439 char * dot = strchr(constant, '.');
14440 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14441 char * exponent;
14442
14443 if(isHex)
14444 {
14445 exponent = strchr(constant, 'p');
14446 if(!exponent)
14447 exponent = strchr(constant, 'P');
14448 }
14449 else
14450 {
14451 exponent = strchr(constant, 'e');
14452 if(!exponent)
14453 exponent = strchr(constant, 'E');
14454 }
14455 if(dot || exponent)
14456 {
14457 if(strchr(constant, 'f') || strchr(constant, 'F'))
14458 type->kind = 6;
14459 else
14460 type->kind = 7;
14461 type->isSigned = 1;
14462 }
14463 else
14464 {
14465 unsigned int isSigned = constant[0] == '-';
14466 char * endP = (((void *)0));
14467 long long i64 = strtoll(constant, &endP, 0);
14468 uint64 ui64 = strtoull(constant, &endP, 0);
14469 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14470
14471 if(isSigned)
14472 {
14473 if(i64 < (((int)0x80000000)))
14474 is64Bit = 1;
14475 }
14476 else
14477 {
14478 if(ui64 > (((int)0x7fffffff)))
14479 {
14480 if(ui64 > (0xffffffff))
14481 {
14482 is64Bit = 1;
14483 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14484 isSigned = 1;
14485 }
14486 }
14487 else if(constant[0] != '0' || !constant[1])
14488 isSigned = 1;
14489 }
14490 type->kind = is64Bit ? 4 : 3;
14491 type->isSigned = isSigned;
14492 }
14493 }
14494 exp->isConstant = 1;
14495 if(exp->destType && exp->destType->kind == 7)
14496 type->kind = 7;
14497 else if(exp->destType && exp->destType->kind == 6)
14498 type->kind = 6;
14499 else if(exp->destType && exp->destType->kind == 4)
14500 type->kind = 4;
14501 }
14502 break;
14503 }
14504 case 3:
14505 {
14506 exp->isConstant = 1;
14507 exp->expType = __extension__ ({
14508 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14509
14510 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14511 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14512
14513 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14514 }), __ecereInstance2;
14515 });
14516 break;
14517 }
14518 case 13:
14519 case 26:
14520 ProcessExpressionType(exp->__anon1._new.size);
14521 exp->expType = __extension__ ({
14522 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14523
14524 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14525 });
14526 DeclareType(exp->expType->__anon1.type, 0, 0);
14527 break;
14528 case 14:
14529 case 27:
14530 ProcessExpressionType(exp->__anon1._renew.size);
14531 ProcessExpressionType(exp->__anon1._renew.exp);
14532 exp->expType = __extension__ ({
14533 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14534
14535 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14536 });
14537 DeclareType(exp->expType->__anon1.type, 0, 0);
14538 break;
14539 case 4:
14540 {
14541 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14542 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14543 unsigned int useDestType = 0, useSideType = 0;
14544 struct Location oldyylloc = yylloc;
14545 unsigned int useSideUnit = 0;
14546 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14547 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14548
14549 switch(exp->__anon1.op.op)
14550 {
14551 case '=':
14552 case MUL_ASSIGN:
14553 case DIV_ASSIGN:
14554 case MOD_ASSIGN:
14555 case ADD_ASSIGN:
14556 case SUB_ASSIGN:
14557 case LEFT_ASSIGN:
14558 case RIGHT_ASSIGN:
14559 case AND_ASSIGN:
14560 case XOR_ASSIGN:
14561 case OR_ASSIGN:
14562 assign = 1;
14563 break;
14564 case '!':
14565 break;
14566 case AND_OP:
14567 case OR_OP:
14568 boolOps = 1;
14569 boolResult = 1;
14570 break;
14571 case EQ_OP:
14572 case '<':
14573 case '>':
14574 case LE_OP:
14575 case GE_OP:
14576 case NE_OP:
14577 boolResult = 1;
14578 useSideType = 1;
14579 break;
14580 case '+':
14581 case '-':
14582 useSideUnit = 1;
14583 useSideType = 1;
14584 useDestType = 1;
14585 break;
14586 case LEFT_OP:
14587 case RIGHT_OP:
14588 useSideType = 1;
14589 useDestType = 1;
14590 break;
14591 case '|':
14592 case '^':
14593 useSideType = 1;
14594 useDestType = 1;
14595 break;
14596 case '/':
14597 case '%':
14598 useSideType = 1;
14599 useDestType = 1;
14600 break;
14601 case '&':
14602 case '*':
14603 if(exp->__anon1.op.exp1)
14604 {
14605 useSideType = 1;
14606 useDestType = 1;
14607 }
14608 break;
14609 }
14610 if(exp->__anon1.op.op == '&')
14611 {
14612 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14613 {
14614 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14615 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14616
14617 if(symbol && symbol->isIterator == 2)
14618 {
14619 exp->type = 8;
14620 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14621 exp->__anon1.member.member = MkIdentifier("key");
14622 exp->expType = (((void *)0));
14623 exp->__anon1.op.exp2->expType = symbol->type;
14624 symbol->type->refCount++;
14625 ProcessExpressionType(exp);
14626 FreeType(dummy);
14627 break;
14628 }
14629 }
14630 }
14631 if(exp->__anon1.op.exp1)
14632 {
14633 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14634 useDestType = 0;
14635 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14636 {
14637 if(exp->__anon1.op.exp1->destType)
14638 FreeType(exp->__anon1.op.exp1->destType);
14639 exp->__anon1.op.exp1->destType = exp->destType;
14640 exp->__anon1.op.exp1->opDestType = 1;
14641 if(exp->destType)
14642 exp->destType->refCount++;
14643 }
14644 else if(!assign)
14645 {
14646 if(exp->__anon1.op.exp1->destType)
14647 FreeType(exp->__anon1.op.exp1->destType);
14648 exp->__anon1.op.exp1->destType = dummy;
14649 dummy->refCount++;
14650 }
14651 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14652 exp->__anon1.op.exp1->destType->count++;
14653 ProcessExpressionType(exp->__anon1.op.exp1);
14654 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14655 exp->__anon1.op.exp1->destType->count--;
14656 exp->__anon1.op.exp1->opDestType = 0;
14657 if(!exp->__anon1.op.exp2 && (exp->__anon1.op.op == INC_OP || exp->__anon1.op.op == DEC_OP) && exp->__anon1.op.exp1->expType && exp->__anon1.op.exp1->expType->kind == 8 && exp->__anon1.op.exp1->expType->__anon1._class && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered->type == 3)
14658 {
14659 exp->__anon1.op.exp2 = MkExpConstant("1");
14660 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14661 assign = 1;
14662 }
14663 if(exp->__anon1.op.exp1->destType == dummy)
14664 {
14665 FreeType(dummy);
14666 exp->__anon1.op.exp1->destType = (((void *)0));
14667 }
14668 type1 = exp->__anon1.op.exp1->expType;
14669 }
14670 if(exp->__anon1.op.exp2)
14671 {
14672 char expString[10240];
14673
14674 expString[0] = '\0';
14675 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14676 {
14677 if(exp->__anon1.op.exp1)
14678 {
14679 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14680 if(exp->__anon1.op.exp1->expType)
14681 exp->__anon1.op.exp1->expType->refCount++;
14682 }
14683 else
14684 {
14685 exp->__anon1.op.exp2->destType = exp->destType;
14686 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14687 exp->__anon1.op.exp2->opDestType = 1;
14688 if(exp->destType)
14689 exp->destType->refCount++;
14690 }
14691 if(type1)
14692 type1->refCount++;
14693 exp->expType = type1;
14694 }
14695 else if(assign)
14696 {
14697 if(inCompiler)
14698 PrintExpression(exp->__anon1.op.exp2, expString);
14699 if(type1 && type1->kind == 13)
14700 {
14701 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN || exp->__anon1.op.op == AND_ASSIGN || exp->__anon1.op.op == OR_ASSIGN)
14702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14703 else if(exp->__anon1.op.op == '=')
14704 {
14705 if(exp->__anon1.op.exp2->destType)
14706 FreeType(exp->__anon1.op.exp2->destType);
14707 exp->__anon1.op.exp2->destType = type1;
14708 if(type1)
14709 type1->refCount++;
14710 }
14711 }
14712 else
14713 {
14714 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN)
14715 ;
14716 else
14717 {
14718 if(exp->__anon1.op.exp2->destType)
14719 FreeType(exp->__anon1.op.exp2->destType);
14720 exp->__anon1.op.exp2->destType = type1;
14721 if(type1)
14722 type1->refCount++;
14723 }
14724 }
14725 if(type1)
14726 type1->refCount++;
14727 exp->expType = type1;
14728 }
14729 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14730 {
14731 if(exp->__anon1.op.exp2->destType)
14732 FreeType(exp->__anon1.op.exp2->destType);
14733 exp->__anon1.op.exp2->destType = exp->destType;
14734 if(exp->__anon1.op.op != '&')
14735 exp->__anon1.op.exp2->opDestType = 1;
14736 if(exp->destType)
14737 exp->destType->refCount++;
14738 }
14739 else
14740 {
14741 if(exp->__anon1.op.exp2->destType)
14742 FreeType(exp->__anon1.op.exp2->destType);
14743 exp->__anon1.op.exp2->destType = dummy;
14744 dummy->refCount++;
14745 }
14746 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && (type1->__anon1._class->__anon1.registered->type == 2 || type1->__anon1._class->__anon1.registered->type == 4))
14747 {
14748 FreeType(exp->__anon1.op.exp2->destType);
14749 exp->__anon1.op.exp2->destType = type1;
14750 type1->refCount++;
14751 }
14752 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14753 exp->__anon1.op.exp2->destType->count++;
14754 if(exp->__anon1.op.op == SIZEOF)
14755 {
14756 struct Expression * e = exp->__anon1.op.exp2;
14757
14758 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14759 {
14760 if(e->type == 5 || e->type == 32 || e->type == 23)
14761 {
14762 if(e->type == 23)
14763 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14764 else
14765 e = (*e->__anon1.list).last;
14766 }
14767 }
14768 if(e->type == 11 && e->__anon1.cast.exp)
14769 e->__anon1.cast.exp->needCast = 1;
14770 }
14771 ProcessExpressionType(exp->__anon1.op.exp2);
14772 exp->__anon1.op.exp2->opDestType = 0;
14773 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14774 exp->__anon1.op.exp2->destType->count--;
14775 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14776 {
14777 if(exp->__anon1.op.exp2->expType->kind == 23 || exp->__anon1.op.exp2->expType->kind == 22 || exp->__anon1.op.exp2->expType->kind == 4 || exp->__anon1.op.exp2->expType->kind == 3 || exp->__anon1.op.exp2->expType->kind == 2 || exp->__anon1.op.exp2->expType->kind == 1)
14778 {
14779 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14780 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14781 }
14782 else if(exp->__anon1.op.exp2->expType->kind == 13 || exp->__anon1.op.exp2->expType->kind == 12 || exp->__anon1.op.exp2->expType->kind == 11 || exp->__anon1.op.exp2->expType->kind == 16 || (type1->__anon1.type->kind == 0 && exp->__anon1.op.exp2->expType->kind == 8 && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && (exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 0 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 5)))
14783 {
14784 if(exp->__anon1.op.op == ADD_ASSIGN)
14785 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14786 }
14787 else if((exp->__anon1.op.exp2->expType->kind == 8 && type1->kind == 13 && type1->__anon1.type->kind == 8 && type1->__anon1.type->__anon1._class == exp->__anon1.op.exp2->expType->__anon1._class && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1))
14788 {
14789 if(exp->__anon1.op.op == ADD_ASSIGN)
14790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14791 }
14792 else if(inCompiler)
14793 {
14794 char type1String[1024];
14795 char type2String[1024];
14796
14797 type1String[0] = '\0';
14798 type2String[0] = '\0';
14799 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14800 PrintType(type1, type2String, 0, 1);
14801 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14802 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14803 }
14804 }
14805 if(exp->__anon1.op.exp2->destType == dummy)
14806 {
14807 FreeType(dummy);
14808 exp->__anon1.op.exp2->destType = (((void *)0));
14809 }
14810 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14811 {
14812 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14813 type2->refCount = 1;
14814 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14815 type2->isSigned = 1;
14816 }
14817 else if(exp->__anon1.op.op == '~' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && (!exp->__anon1.op.exp2->expType->isSigned || exp->__anon1.op.exp2->expType->kind != 3))
14818 {
14819 type2 = __extension__ ({
14820 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14821
14822 __ecereInstance1->kind = 3, __ecereInstance1;
14823 });
14824 type2->refCount = 1;
14825 type2->isSigned = 1;
14826 }
14827 else
14828 {
14829 type2 = exp->__anon1.op.exp2->expType;
14830 if(type2)
14831 type2->refCount++;
14832 }
14833 }
14834 dummy->kind = 0;
14835 if(exp->__anon1.op.op == SIZEOF)
14836 {
14837 exp->expType = __extension__ ({
14838 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14839
14840 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14841 });
14842 exp->isConstant = 1;
14843 }
14844 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14845 {
14846 exp->expType = Dereference(type2);
14847 if(type2 && type2->kind == 8)
14848 notByReference = 1;
14849 }
14850 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14851 exp->expType = Reference(type2);
14852 else if(!assign)
14853 {
14854 if(boolOps)
14855 {
14856 if(exp->__anon1.op.exp1)
14857 {
14858 if(exp->__anon1.op.exp1->destType)
14859 FreeType(exp->__anon1.op.exp1->destType);
14860 exp->__anon1.op.exp1->destType = MkClassType("bool");
14861 exp->__anon1.op.exp1->destType->truth = 1;
14862 if(!exp->__anon1.op.exp1->expType)
14863 ProcessExpressionType(exp->__anon1.op.exp1);
14864 else
14865 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14866 FreeType(exp->__anon1.op.exp1->expType);
14867 exp->__anon1.op.exp1->expType = MkClassType("bool");
14868 exp->__anon1.op.exp1->expType->truth = 1;
14869 }
14870 if(exp->__anon1.op.exp2)
14871 {
14872 if(exp->__anon1.op.exp2->destType)
14873 FreeType(exp->__anon1.op.exp2->destType);
14874 exp->__anon1.op.exp2->destType = MkClassType("bool");
14875 exp->__anon1.op.exp2->destType->truth = 1;
14876 if(!exp->__anon1.op.exp2->expType)
14877 ProcessExpressionType(exp->__anon1.op.exp2);
14878 else
14879 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14880 FreeType(exp->__anon1.op.exp2->expType);
14881 exp->__anon1.op.exp2->expType = MkClassType("bool");
14882 exp->__anon1.op.exp2->expType->truth = 1;
14883 }
14884 }
14885 else if(exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->__anon1._class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->__anon1._class->string, "String")))))
14886 {
14887 if(type1 && type2 && ((type1->kind == 8 && type1->__anon1._class && strcmp(type1->__anon1._class->string, "String")) == (type2->kind == 8 && type2->__anon1._class && strcmp(type2->__anon1._class->string, "String"))))
14888 {
14889 if(exp->__anon1.op.op == '-' && ((type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4) || (type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)))
14890 {
14891 struct Type * intType;
14892
14893 if(!type1->__anon1._class->__anon1.registered->dataType)
14894 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14895 if(!type2->__anon1._class->__anon1.registered->dataType)
14896 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14897 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14898 if(exp->__anon1.op.exp1->destType)
14899 FreeType(exp->__anon1.op.exp1->destType);
14900 if(exp->__anon1.op.exp2->destType)
14901 FreeType(exp->__anon1.op.exp2->destType);
14902 exp->__anon1.op.exp1->destType = intType;
14903 exp->__anon1.op.exp2->destType = intType;
14904 intType->refCount++;
14905 }
14906 else
14907 {
14908 if(exp->__anon1.op.exp2->destType)
14909 FreeType(exp->__anon1.op.exp2->destType);
14910 exp->__anon1.op.exp2->destType = type1;
14911 type1->refCount++;
14912 if(exp->__anon1.op.exp1->destType)
14913 FreeType(exp->__anon1.op.exp1->destType);
14914 exp->__anon1.op.exp1->destType = type2;
14915 type2->refCount++;
14916 }
14917 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1->__anon1._class->__anon1.registered != type2->__anon1._class->__anon1.registered)
14918 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->__anon1._class->string, type2->__anon1._class->string, type1->__anon1._class->string);
14919 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14920 {
14921 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14922
14923 if(argExp)
14924 {
14925 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14926
14927 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14928 ProcessExpressionType(exp->__anon1.op.exp1);
14929 if(type2->kind != 13)
14930 {
14931 ProcessExpressionType(classExp);
14932 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14933 if(!exp->__anon1.op.exp2->expType)
14934 {
14935 if(type2)
14936 FreeType(type2);
14937 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14938 type2->refCount++;
14939 }
14940 ProcessExpressionType(exp->__anon1.op.exp2);
14941 }
14942 }
14943 }
14944 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->__anon1._class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
14945 {
14946 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14947 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14948 exp->expType = type1;
14949 if(type1)
14950 type1->refCount++;
14951 }
14952 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->__anon1._class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
14953 {
14954 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14956 exp->expType = type2;
14957 if(type2)
14958 type2->refCount++;
14959 }
14960 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))
14961 {
14962 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14963 }
14964 else
14965 {
14966 unsigned int success = 0;
14967
14968 if(type1->kind == 13 && type2->kind == 13)
14969 {
14970 if(exp->__anon1.op.op == '+')
14971 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14972 else if(exp->__anon1.op.op == '-')
14973 {
14974 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
14975 {
14976 exp->expType = __extension__ ({
14977 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14978
14979 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14980 });
14981 success = 1;
14982 if(type1->__anon1.type->kind == 20)
14983 {
14984 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14985
14986 if(argExp)
14987 {
14988 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14989
14990 ProcessExpressionType(classExp);
14991 exp->type = 5;
14992 exp->__anon1.list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp1))), exp->__anon1.op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp2)))))), '/', MkExpMember(classExp, MkIdentifier("typeSize"))));
14993 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
14994 FreeType(dummy);
14995 return ;
14996 }
14997 }
14998 }
14999 }
15000 }
15001 if(!success && exp->__anon1.op.exp1->type == 2)
15002 {
15003 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15004 {
15005 if(exp->expType)
15006 FreeType(exp->expType);
15007 exp->expType = exp->__anon1.op.exp1->destType;
15008 if(exp->__anon1.op.exp1->destType)
15009 exp->__anon1.op.exp1->destType->refCount++;
15010 success = 1;
15011 }
15012 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15013 {
15014 if(exp->expType)
15015 FreeType(exp->expType);
15016 exp->expType = exp->__anon1.op.exp2->destType;
15017 if(exp->__anon1.op.exp2->destType)
15018 exp->__anon1.op.exp2->destType->refCount++;
15019 success = 1;
15020 }
15021 }
15022 else if(!success)
15023 {
15024 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15025 {
15026 if(exp->expType)
15027 FreeType(exp->expType);
15028 exp->expType = exp->__anon1.op.exp2->destType;
15029 if(exp->__anon1.op.exp2->destType)
15030 exp->__anon1.op.exp2->destType->refCount++;
15031 success = 1;
15032 }
15033 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15034 {
15035 if(exp->expType)
15036 FreeType(exp->expType);
15037 exp->expType = exp->__anon1.op.exp1->destType;
15038 if(exp->__anon1.op.exp1->destType)
15039 exp->__anon1.op.exp1->destType->refCount++;
15040 success = 1;
15041 }
15042 }
15043 if(!success)
15044 {
15045 char expString1[10240];
15046 char expString2[10240];
15047 char type1[1024];
15048 char type2[1024];
15049
15050 expString1[0] = '\0';
15051 expString2[0] = '\0';
15052 type1[0] = '\0';
15053 type2[0] = '\0';
15054 if(inCompiler)
15055 {
15056 PrintExpression(exp->__anon1.op.exp1, expString1);
15057 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15058 PrintExpression(exp->__anon1.op.exp2, expString2);
15059 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15060 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15061 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15062 }
15063 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15064 }
15065 }
15066 }
15067 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15068 {
15069 if(exp->__anon1.op.exp1->destType)
15070 FreeType(exp->__anon1.op.exp1->destType);
15071 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15072 if(type2->__anon1._class->__anon1.registered->dataType)
15073 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15074 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15075 exp->expType = type2;
15076 if(type2)
15077 type2->refCount++;
15078 }
15079 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15080 {
15081 if(exp->__anon1.op.exp2->destType)
15082 FreeType(exp->__anon1.op.exp2->destType);
15083 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15084 if(type1->__anon1._class->__anon1.registered->dataType)
15085 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15086 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15087 exp->expType = type1;
15088 if(type1)
15089 type1->refCount++;
15090 }
15091 else if(type1)
15092 {
15093 unsigned int valid = 0;
15094
15095 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15096 {
15097 if(exp->__anon1.op.exp2->destType)
15098 FreeType(exp->__anon1.op.exp2->destType);
15099 if(!type1->__anon1._class->__anon1.registered->dataType)
15100 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15101 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15102 exp->__anon1.op.exp2->destType->refCount++;
15103 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15104 if(type2)
15105 FreeType(type2);
15106 type2 = exp->__anon1.op.exp2->destType;
15107 if(type2)
15108 type2->refCount++;
15109 exp->expType = type2;
15110 type2->refCount++;
15111 }
15112 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15113 {
15114 if(exp->__anon1.op.exp1->destType)
15115 FreeType(exp->__anon1.op.exp1->destType);
15116 if(!type2->__anon1._class->__anon1.registered->dataType)
15117 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15118 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15119 exp->__anon1.op.exp1->destType->refCount++;
15120 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15121 type1 = exp->__anon1.op.exp1->destType;
15122 exp->expType = type1;
15123 type1->refCount++;
15124 }
15125 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15126 {
15127 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15128 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15129
15130 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15131 {
15132 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15133 {
15134 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15135 {
15136 if(exp->expType)
15137 FreeType(exp->expType);
15138 exp->expType = exp->__anon1.op.exp2->expType;
15139 if(exp->__anon1.op.exp2->expType)
15140 exp->__anon1.op.exp2->expType->refCount++;
15141 valid = 1;
15142 }
15143 }
15144 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15145 {
15146 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15147 {
15148 if(exp->expType)
15149 FreeType(exp->expType);
15150 exp->expType = exp->__anon1.op.exp1->expType;
15151 if(exp->__anon1.op.exp1->expType)
15152 exp->__anon1.op.exp1->expType->refCount++;
15153 valid = 1;
15154 }
15155 }
15156 }
15157 else
15158 {
15159 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15160 {
15161 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15162 {
15163 if(exp->expType)
15164 FreeType(exp->expType);
15165 exp->expType = exp->__anon1.op.exp1->expType;
15166 if(exp->__anon1.op.exp1->expType)
15167 exp->__anon1.op.exp1->expType->refCount++;
15168 valid = 1;
15169 }
15170 }
15171 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15172 {
15173 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15174 {
15175 if(exp->expType)
15176 FreeType(exp->expType);
15177 exp->expType = exp->__anon1.op.exp2->expType;
15178 if(exp->__anon1.op.exp2->expType)
15179 exp->__anon1.op.exp2->expType->refCount++;
15180 valid = 1;
15181 }
15182 }
15183 }
15184 }
15185 if(!valid)
15186 {
15187 if(type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && (type1->kind != 8 || !type1->__anon1._class || !type1->__anon1._class->__anon1.registered || type1->__anon1._class->__anon1.registered->type != 3))
15188 {
15189 if(exp->__anon1.op.exp1->destType)
15190 FreeType(exp->__anon1.op.exp1->destType);
15191 exp->__anon1.op.exp1->destType = type2;
15192 type2->refCount++;
15193 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15194 {
15195 if(exp->expType)
15196 FreeType(exp->expType);
15197 exp->expType = exp->__anon1.op.exp1->destType;
15198 if(exp->__anon1.op.exp1->destType)
15199 exp->__anon1.op.exp1->destType->refCount++;
15200 }
15201 }
15202 else
15203 {
15204 if(exp->__anon1.op.exp2->destType)
15205 FreeType(exp->__anon1.op.exp2->destType);
15206 exp->__anon1.op.exp2->destType = type1;
15207 type1->refCount++;
15208 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15209 {
15210 if(exp->expType)
15211 FreeType(exp->expType);
15212 exp->expType = exp->__anon1.op.exp2->destType;
15213 if(exp->__anon1.op.exp2->destType)
15214 exp->__anon1.op.exp2->destType->refCount++;
15215 }
15216 else if(type1 && type2)
15217 {
15218 char expString1[10240];
15219 char expString2[10240];
15220 char type1String[1024];
15221 char type2String[1024];
15222
15223 expString1[0] = '\0';
15224 expString2[0] = '\0';
15225 type1String[0] = '\0';
15226 type2String[0] = '\0';
15227 if(inCompiler)
15228 {
15229 PrintExpression(exp->__anon1.op.exp1, expString1);
15230 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15231 PrintExpression(exp->__anon1.op.exp2, expString2);
15232 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15233 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15234 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15235 }
15236 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15237 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15238 {
15239 exp->expType = exp->__anon1.op.exp1->expType;
15240 if(exp->__anon1.op.exp1->expType)
15241 exp->__anon1.op.exp1->expType->refCount++;
15242 }
15243 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15244 {
15245 exp->expType = exp->__anon1.op.exp2->expType;
15246 if(exp->__anon1.op.exp2->expType)
15247 exp->__anon1.op.exp2->expType->refCount++;
15248 }
15249 }
15250 }
15251 }
15252 }
15253 else if(type2)
15254 {
15255 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15256 {
15257 struct Type * oldType = exp->__anon1.op.exp1->expType;
15258
15259 exp->__anon1.op.exp1->expType = (((void *)0));
15260 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15261 FreeType(oldType);
15262 else
15263 exp->__anon1.op.exp1->expType = oldType;
15264 }
15265 if(exp->__anon1.op.exp1->destType)
15266 FreeType(exp->__anon1.op.exp1->destType);
15267 exp->__anon1.op.exp1->destType = type2;
15268 type2->refCount++;
15269 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15270 {
15271 if(exp->expType)
15272 FreeType(exp->expType);
15273 exp->expType = exp->__anon1.op.exp1->destType;
15274 if(exp->__anon1.op.exp1->destType)
15275 exp->__anon1.op.exp1->destType->refCount++;
15276 }
15277 }
15278 }
15279 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15280 {
15281 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15282 {
15283 if(exp->__anon1.op.exp1->destType)
15284 FreeType(exp->__anon1.op.exp1->destType);
15285 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15286 if(type2->__anon1._class->__anon1.registered->dataType)
15287 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15288 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15289 }
15290 if(exp->__anon1.op.op == '!')
15291 {
15292 exp->expType = MkClassType("bool");
15293 exp->expType->truth = 1;
15294 }
15295 else
15296 {
15297 exp->expType = type2;
15298 if(type2)
15299 type2->refCount++;
15300 }
15301 }
15302 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15303 {
15304 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15305 {
15306 if(exp->__anon1.op.exp2->destType)
15307 FreeType(exp->__anon1.op.exp2->destType);
15308 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15309 if(type1->__anon1._class->__anon1.registered->dataType)
15310 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15311 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15312 }
15313 exp->expType = type1;
15314 if(type1)
15315 type1->refCount++;
15316 }
15317 }
15318 yylloc = exp->loc;
15319 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15320 {
15321 char expString[10000];
15322
15323 expString[0] = '\0';
15324 if(inCompiler)
15325 {
15326 PrintExpression(exp->__anon1.op.exp1, expString);
15327 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15328 }
15329 if(expString[0])
15330 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15331 }
15332 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15333 {
15334 char expString[10240];
15335
15336 expString[0] = '\0';
15337 if(inCompiler)
15338 {
15339 PrintExpression(exp->__anon1.op.exp2, expString);
15340 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15341 }
15342 if(expString[0])
15343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15344 }
15345 if(boolResult)
15346 {
15347 FreeType(exp->expType);
15348 exp->expType = MkClassType("bool");
15349 exp->expType->truth = 1;
15350 }
15351 if(exp->__anon1.op.op != SIZEOF)
15352 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15353 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15354 {
15355 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15356 }
15357 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15358 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15359 yylloc = oldyylloc;
15360 FreeType(dummy);
15361 if(type2)
15362 FreeType(type2);
15363 break;
15364 }
15365 case 5:
15366 case 32:
15367 {
15368 struct Expression * e;
15369
15370 exp->isConstant = 1;
15371 for(e = (*exp->__anon1.list).first; e; e = e->next)
15372 {
15373 unsigned int inced = 0;
15374
15375 if(!e->next)
15376 {
15377 FreeType(e->destType);
15378 e->opDestType = exp->opDestType;
15379 e->destType = exp->destType;
15380 if(e->destType)
15381 {
15382 exp->destType->refCount++;
15383 e->destType->count++;
15384 inced = 1;
15385 }
15386 }
15387 ProcessExpressionType(e);
15388 if(inced)
15389 exp->destType->count--;
15390 if(!exp->expType && !e->next)
15391 {
15392 exp->expType = e->expType;
15393 if(e->expType)
15394 e->expType->refCount++;
15395 }
15396 if(!e->isConstant)
15397 exp->isConstant = 0;
15398 }
15399 e = (*exp->__anon1.list).first;
15400 if(!e->next && e->type == 8)
15401 {
15402 struct Expression * next = exp->next, * prev = exp->prev;
15403
15404 FreeType(exp->expType);
15405 FreeType(exp->destType);
15406 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15407 *exp = *e;
15408 exp->prev = prev;
15409 exp->next = next;
15410 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15411 ProcessExpressionType(exp);
15412 }
15413 break;
15414 }
15415 case 6:
15416 {
15417 struct Expression * e;
15418
15419 exp->isConstant = 1;
15420 ProcessExpressionType(exp->__anon1.index.exp);
15421 if(!exp->__anon1.index.exp->isConstant)
15422 exp->isConstant = 0;
15423 if(exp->__anon1.index.exp->expType)
15424 {
15425 struct Type * source = exp->__anon1.index.exp->expType;
15426
15427 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15428 {
15429 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15430 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15431
15432 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15433 {
15434 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15435 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15436 {
15437 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15438
15439 if(type->kind == 8)
15440 type->constant = 1;
15441 else if(type->kind == 13)
15442 {
15443 struct Type * t = type;
15444
15445 while(t->kind == 13)
15446 t = t->__anon1.type;
15447 t->constant = 1;
15448 }
15449 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15450 }
15451 }
15452 }
15453 }
15454 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15455 {
15456 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15457 {
15458 if(e->destType)
15459 FreeType(e->destType);
15460 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15461 }
15462 ProcessExpressionType(e);
15463 if(!e->next)
15464 {
15465 }
15466 if(!e->isConstant)
15467 exp->isConstant = 0;
15468 }
15469 if(!exp->expType)
15470 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15471 if(exp->expType)
15472 DeclareType(exp->expType, 0, 0);
15473 break;
15474 }
15475 case 7:
15476 {
15477 struct Expression * e;
15478 struct Type * functionType;
15479 struct Type * methodType = (((void *)0));
15480 char name[1024];
15481
15482 name[0] = '\0';
15483 if(inCompiler)
15484 {
15485 PrintExpression(exp->__anon1.call.exp, name);
15486 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15487 {
15488 PrintExpression(exp->__anon1.call.exp, name);
15489 }
15490 }
15491 if(exp->__anon1.call.exp->type == 0)
15492 {
15493 struct Expression * idExp = exp->__anon1.call.exp;
15494 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15495
15496 if(!strcmp(id->string, "__builtin_frame_address"))
15497 {
15498 exp->expType = ProcessTypeString("void *", 1);
15499 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15500 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15501 break;
15502 }
15503 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15504 {
15505 exp->expType = ProcessTypeString("int", 1);
15506 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15507 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15508 break;
15509 }
15510 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15511 {
15512 struct Expression * a = (((void *)0));
15513 struct Expression * b = (((void *)0));
15514 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15515
15516 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15517 {
15518 a = (*exp->__anon1.call.arguments).first;
15519 b = (*exp->__anon1.call.arguments).last;
15520 tempExp1 = a;
15521 tempExp2 = b;
15522 }
15523 else if((*exp->__anon1.call.arguments).count == 1)
15524 {
15525 a = (*exp->__anon1.call.arguments).first;
15526 tempExp1 = a;
15527 }
15528 if(a)
15529 {
15530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15531 idExp->__anon1.__anon1.identifier = (((void *)0));
15532 FreeExpContents(exp);
15533 ProcessExpressionType(a);
15534 if(b)
15535 ProcessExpressionType(b);
15536 exp->type = 5;
15537 exp->__anon1.list = MkList();
15538 if(a->expType && (!b || b->expType))
15539 {
15540 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15541 {
15542 if(inCompiler)
15543 {
15544 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15545 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15546 struct Declaration * decl;
15547 char temp1[1024], temp2[1024];
15548
15549 GetTypeSpecs(a->expType, specs);
15550 if(a && !a->isConstant && a->type != 0)
15551 {
15552 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15553 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15554 tempExp1 = QMkExpId(temp1);
15555 tempExp1->expType = a->expType;
15556 if(a->expType)
15557 a->expType->refCount++;
15558 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15559 }
15560 if(b && !b->isConstant && b->type != 0)
15561 {
15562 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15563 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15564 tempExp2 = QMkExpId(temp2);
15565 tempExp2->expType = b->expType;
15566 if(b->expType)
15567 b->expType->refCount++;
15568 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15569 }
15570 decl = MkDeclaration(specs, decls);
15571 if(!curCompound->__anon1.compound.declarations)
15572 curCompound->__anon1.compound.declarations = MkList();
15573 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15574 }
15575 }
15576 }
15577 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15578 {
15579 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15580
15581 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15582 exp->expType = a->expType;
15583 if(a->expType)
15584 a->expType->refCount++;
15585 }
15586 else if(!strcmp(id->string, "Abs"))
15587 {
15588 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15589 exp->expType = a->expType;
15590 if(a->expType)
15591 a->expType->refCount++;
15592 }
15593 else if(!strcmp(id->string, "Sgn"))
15594 {
15595 ListAdd(exp->__anon1.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"))))));
15596 exp->expType = ProcessTypeString("int", 0);
15597 }
15598 FreeExpression(tempExp1);
15599 if(tempExp2)
15600 FreeExpression(tempExp2);
15601 FreeIdentifier(id);
15602 break;
15603 }
15604 }
15605 }
15606 {
15607 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15608
15609 if(!exp->__anon1.call.exp->destType)
15610 {
15611 exp->__anon1.call.exp->destType = dummy;
15612 dummy->refCount++;
15613 }
15614 ProcessExpressionType(exp->__anon1.call.exp);
15615 if(exp->__anon1.call.exp->destType == dummy)
15616 {
15617 FreeType(dummy);
15618 exp->__anon1.call.exp->destType = (((void *)0));
15619 }
15620 FreeType(dummy);
15621 }
15622 functionType = exp->__anon1.call.exp->expType;
15623 if(functionType && functionType->kind == 16)
15624 {
15625 methodType = functionType;
15626 functionType = methodType->__anon1.__anon3.method->dataType;
15627 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15628 {
15629 char typeString[1024];
15630
15631 typeString[0] = '\0';
15632 {
15633 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15634
15635 functionType->__anon1.__anon2.thisClass = (((void *)0));
15636 PrintType(functionType, typeString, 1, 1);
15637 functionType->__anon1.__anon2.thisClass = back;
15638 }
15639 if(strstr(typeString, "thisclass"))
15640 {
15641 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15642 struct Declarator * decl;
15643
15644 {
15645 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15646
15647 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15648 if(thisClass != (exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass ? exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass : exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass))
15649 thisClassParams = 0;
15650 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15651 {
15652 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15653
15654 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15655 ProcessDeclarator(decl);
15656 thisClass = backupThisClass;
15657 }
15658 thisClassParams = 1;
15659 functionType = ProcessType(specs, decl);
15660 functionType->refCount = 0;
15661 FinishTemplatesContext(context);
15662 }
15663 FreeList(specs, FreeSpecifier);
15664 FreeDeclarator(decl);
15665 }
15666 }
15667 }
15668 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15669 {
15670 struct Type * type = functionType->__anon1.type;
15671
15672 if(!functionType->refCount)
15673 {
15674 functionType->__anon1.type = (((void *)0));
15675 FreeType(functionType);
15676 }
15677 functionType = type;
15678 }
15679 if(functionType && functionType->kind != 11)
15680 {
15681 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15682 }
15683 else if(functionType)
15684 {
15685 unsigned int emptyParams = 0, noParams = 0;
15686 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15687 struct Type * type = functionType->__anon1.__anon2.params.first;
15688 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15689 int extra = 0;
15690 struct Location oldyylloc = yylloc;
15691
15692 if(!type)
15693 emptyParams = 1;
15694 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15695 {
15696 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15697 e = e->next;
15698 }
15699 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15700 {
15701 if(memberExp && memberExp->__anon1.member.exp && memberExp->__anon1.member.exp->expType && memberExp->__anon1.member.exp->expType->kind == 19 && memberExp->__anon1.member.exp->expType->__anon1._class)
15702 {
15703 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15704 if(e)
15705 {
15706 e->destType = type;
15707 e = e->next;
15708 type = functionType->__anon1.__anon2.params.first;
15709 }
15710 else
15711 type->refCount = 0;
15712 }
15713 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15714 {
15715 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15716 type->byReference = functionType->byReference;
15717 type->typedByReference = functionType->typedByReference;
15718 if(e)
15719 {
15720 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15721 e = e->next;
15722 e->destType = type;
15723 e = e->next;
15724 type = functionType->__anon1.__anon2.params.first;
15725 }
15726 else
15727 type->refCount = 0;
15728 }
15729 }
15730 if(type && type->kind == 0)
15731 {
15732 noParams = 1;
15733 if(!type->refCount)
15734 FreeType(type);
15735 type = (((void *)0));
15736 }
15737 for(; e; e = e->next)
15738 {
15739 if(!type && !emptyParams)
15740 {
15741 yylloc = e->loc;
15742 if(methodType && methodType->__anon1.__anon3.methodClass)
15743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15744 else
15745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15746 break;
15747 }
15748 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15749 {
15750 struct Type * templatedType = (((void *)0));
15751 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15752 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15753 int id = 0;
15754
15755 if(_class && _class->templateArgs)
15756 {
15757 struct __ecereNameSpace__ecere__com__Class * sClass;
15758
15759 for(sClass = _class; sClass; sClass = sClass->base)
15760 {
15761 if(sClass->templateClass)
15762 sClass = sClass->templateClass;
15763 id = 0;
15764 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15765 {
15766 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15767 {
15768 struct __ecereNameSpace__ecere__com__Class * nextClass;
15769
15770 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15771 {
15772 if(nextClass->templateClass)
15773 nextClass = nextClass->templateClass;
15774 id += nextClass->templateParams.count;
15775 }
15776 break;
15777 }
15778 id++;
15779 }
15780 if(curParam)
15781 break;
15782 }
15783 }
15784 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15785 {
15786 unsigned int constant = type->constant;
15787 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15788
15789 {
15790 struct Context * context = SetupTemplatesContext(_class);
15791
15792 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15793 FinishTemplatesContext(context);
15794 }
15795 if(templatedType->kind == 8 && constant)
15796 templatedType->constant = 1;
15797 else if(templatedType->kind == 13)
15798 {
15799 struct Type * t = templatedType->__anon1.type;
15800
15801 while(t->kind == 13)
15802 t = t->__anon1.type;
15803 if(constant)
15804 t->constant = constant;
15805 }
15806 e->destType = templatedType;
15807 if(templatedType)
15808 {
15809 templatedType->passAsTemplate = 1;
15810 }
15811 }
15812 else
15813 {
15814 e->destType = type;
15815 if(type)
15816 type->refCount++;
15817 }
15818 }
15819 else
15820 {
15821 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15822 {
15823 e->destType = type->prev;
15824 e->destType->refCount++;
15825 }
15826 else
15827 {
15828 e->destType = type;
15829 if(type)
15830 type->refCount++;
15831 }
15832 }
15833 if(type && type->kind != 14)
15834 {
15835 struct Type * next = type->next;
15836
15837 if(!type->refCount)
15838 FreeType(type);
15839 type = next;
15840 }
15841 }
15842 if(type && type->kind != 14)
15843 {
15844 if(methodType && methodType->__anon1.__anon3.methodClass)
15845 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15846 else
15847 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15848 }
15849 yylloc = oldyylloc;
15850 if(type && !type->refCount)
15851 FreeType(type);
15852 }
15853 else
15854 {
15855 functionType = __extension__ ({
15856 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15857
15858 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15859 });
15860 if(exp->__anon1.call.exp->type == 0)
15861 {
15862 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15863
15864 if(inCompiler)
15865 {
15866 struct Symbol * symbol;
15867 struct Location oldyylloc = yylloc;
15868
15869 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15870 if(strstr(string, "__builtin_") == string)
15871 {
15872 if(exp->destType)
15873 {
15874 functionType->__anon1.__anon2.returnType = exp->destType;
15875 exp->destType->refCount++;
15876 }
15877 }
15878 else
15879 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15880 symbol = __extension__ ({
15881 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15882
15883 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15884 });
15885 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15886 if(strstr(symbol->string, "::"))
15887 globalContext->hasNameSpace = 1;
15888 yylloc = oldyylloc;
15889 }
15890 }
15891 else if(exp->__anon1.call.exp->type == 8)
15892 {
15893 }
15894 else
15895 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15896 if(!functionType->__anon1.__anon2.returnType)
15897 {
15898 functionType->__anon1.__anon2.returnType = __extension__ ({
15899 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15900
15901 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15902 });
15903 }
15904 }
15905 if(functionType && functionType->kind == 11)
15906 {
15907 exp->expType = functionType->__anon1.__anon2.returnType;
15908 if(functionType->__anon1.__anon2.returnType)
15909 functionType->__anon1.__anon2.returnType->refCount++;
15910 if(!functionType->refCount)
15911 FreeType(functionType);
15912 }
15913 if(exp->__anon1.call.arguments)
15914 {
15915 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15916 ProcessExpressionType(e);
15917 }
15918 break;
15919 }
15920 case 8:
15921 {
15922 struct Type * type;
15923 struct Location oldyylloc = yylloc;
15924 unsigned int thisPtr;
15925 struct Expression * checkExp = exp->__anon1.member.exp;
15926
15927 while(checkExp)
15928 {
15929 if(checkExp->type == 11)
15930 checkExp = checkExp->__anon1.cast.exp;
15931 else if(checkExp->type == 5)
15932 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15933 else
15934 break;
15935 }
15936 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15937 exp->thisPtr = thisPtr;
15938 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15939 {
15940 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15941 }
15942 ProcessExpressionType(exp->__anon1.member.exp);
15943 if(exp->__anon1.member.exp->expType && exp->__anon1.member.exp->expType->kind == 8 && exp->__anon1.member.exp->expType->__anon1._class && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered->type == 0)
15944 {
15945 exp->isConstant = 0;
15946 }
15947 else
15948 exp->isConstant = exp->__anon1.member.exp->isConstant;
15949 type = exp->__anon1.member.exp->expType;
15950 yylloc = exp->loc;
15951 if(type && (type->kind == 20))
15952 {
15953 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15954 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15955
15956 if(_class)
15957 {
15958 for(param = _class->templateParams.first; param; param = param->next)
15959 {
15960 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15961 break;
15962 }
15963 }
15964 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15965 {
15966 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15967
15968 if(argExp)
15969 {
15970 struct Expression * expMember = exp->__anon1.member.exp;
15971 struct Declarator * decl;
15972 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15973 char thisClassTypeString[1024];
15974
15975 FreeIdentifier(exp->__anon1.member.member);
15976 ProcessExpressionType(argExp);
15977 {
15978 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15979
15980 if(colon)
15981 {
15982 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15983 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15984 }
15985 else
15986 strcpy(thisClassTypeString, _class->fullName);
15987 }
15988 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15989 exp->expType = ProcessType(specs, decl);
15990 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
15991 {
15992 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
15993 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15994 int paramCount = 0;
15995 int lastParam = -1;
15996 char templateString[1024];
15997 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15998
15999 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16000 for(cClass = expClass; cClass; cClass = cClass->base)
16001 {
16002 int p = 0;
16003
16004 for(param = cClass->templateParams.first; param; param = param->next)
16005 {
16006 int id = p;
16007 struct __ecereNameSpace__ecere__com__Class * sClass;
16008 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16009
16010 for(sClass = cClass->base; sClass; sClass = sClass->base)
16011 id += sClass->templateParams.count;
16012 arg = expClass->templateArgs[id];
16013 for(sClass = _class; sClass; sClass = sClass->base)
16014 {
16015 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16016 int p = 0;
16017 struct __ecereNameSpace__ecere__com__Class * nextClass;
16018
16019 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16020 p += nextClass->templateParams.count;
16021 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16022 {
16023 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16024 {
16025 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16026 {
16027 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16028 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16029 break;
16030 }
16031 }
16032 }
16033 }
16034 {
16035 char argument[256];
16036
16037 argument[0] = '\0';
16038 switch(param->type)
16039 {
16040 case 2:
16041 {
16042 char expString[1024];
16043 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16044 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16045 struct Expression * exp;
16046 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16047
16048 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16049 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16050 ProcessExpressionType(exp);
16051 ComputeExpression(exp);
16052 expString[0] = '\0';
16053 PrintExpression(exp, expString);
16054 strcat(argument, expString);
16055 FreeExpression(exp);
16056 break;
16057 }
16058 case 1:
16059 {
16060 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16061 break;
16062 }
16063 case 0:
16064 {
16065 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16066 {
16067 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16068 strcat(argument, thisClassTypeString);
16069 else
16070 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16071 }
16072 break;
16073 }
16074 }
16075 if(argument[0])
16076 {
16077 if(paramCount)
16078 strcat(templateString, ", ");
16079 if(lastParam != p - 1)
16080 {
16081 strcat(templateString, param->name);
16082 strcat(templateString, " = ");
16083 }
16084 strcat(templateString, argument);
16085 paramCount++;
16086 lastParam = p;
16087 }
16088 p++;
16089 }
16090 }
16091 }
16092 {
16093 int len = strlen(templateString);
16094
16095 if(templateString[len - 1] == '>')
16096 templateString[len++] = ' ';
16097 templateString[len++] = '>';
16098 templateString[len++] = '\0';
16099 }
16100 {
16101 struct Context * context = SetupTemplatesContext(_class);
16102
16103 FreeType(exp->expType);
16104 exp->expType = ProcessTypeString(templateString, 0);
16105 FinishTemplatesContext(context);
16106 }
16107 }
16108 exp->type = 5;
16109 exp->__anon1.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")))))))));
16110 }
16111 }
16112 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16113 {
16114 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16115 }
16116 }
16117 if(type && (type->kind == 20))
16118 ;
16119 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->__anon1.type->kind == 1)))
16120 {
16121 struct Identifier * id = exp->__anon1.member.member;
16122 int typeKind = type->kind;
16123 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
16124
16125 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16126 {
16127 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16128 typeKind = 8;
16129 }
16130 if(id)
16131 {
16132 if(typeKind == 3 || typeKind == 15)
16133 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16134 else if(!_class)
16135 {
16136 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16137 {
16138 _class = type->__anon1._class->__anon1.registered;
16139 }
16140 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16141 {
16142 _class = FindClass("char *")->__anon1.registered;
16143 }
16144 else if(type->kind == 13)
16145 {
16146 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16147 FreeType(exp->expType);
16148 exp->expType = ProcessTypeString("uintptr", 0);
16149 exp->byReference = 1;
16150 }
16151 else
16152 {
16153 char string[1024] = "";
16154 struct Symbol * classSym;
16155
16156 PrintTypeNoConst(type, string, 0, 1);
16157 classSym = FindClass(string);
16158 if(classSym)
16159 _class = classSym->__anon1.registered;
16160 }
16161 }
16162 }
16163 if(_class && id)
16164 {
16165 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16166 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16167 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16168 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16169 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16170
16171 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16172 exp->__anon1.member.memberType = 1;
16173 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16174 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16175 if(typeKind != 19)
16176 {
16177 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16178 {
16179 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16180 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16181 {
16182 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16183 if(prop)
16184 member = (((void *)0));
16185 }
16186 if(!member && !prop)
16187 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16188 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16189 exp->__anon1.member.thisPtr = 1;
16190 }
16191 else
16192 {
16193 unsigned int useMemberForNonConst = 0;
16194
16195 if(!id->classSym)
16196 {
16197 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16198 useMemberForNonConst = prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16199 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16200 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16201 }
16202 if((!prop || useMemberForNonConst) && !member)
16203 {
16204 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16205 if(!method)
16206 {
16207 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16208 useMemberForNonConst |= prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16209 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16210 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16211 }
16212 }
16213 if(member && prop)
16214 {
16215 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16216 prop = (((void *)0));
16217 else
16218 member = (((void *)0));
16219 }
16220 }
16221 }
16222 if(!prop && !member && !method)
16223 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16224 if(!prop && !member && !method)
16225 {
16226 if(typeKind == 19)
16227 {
16228 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16229 if(classProp)
16230 {
16231 exp->__anon1.member.memberType = 5;
16232 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16233 }
16234 else
16235 {
16236 char structName[1024];
16237 struct Identifier * id = exp->__anon1.member.member;
16238 struct Expression * classExp = exp->__anon1.member.exp;
16239
16240 type->refCount++;
16241 FreeType(classExp->expType);
16242 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16243 strcpy(structName, "__ecereClassData_");
16244 FullClassNameCat(structName, type->__anon1._class->string, 0);
16245 exp->type = 9;
16246 exp->__anon1.member.member = id;
16247 exp->__anon1.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->__anon1._class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
16248 FreeType(type);
16249 ProcessExpressionType(exp);
16250 return ;
16251 }
16252 }
16253 else
16254 {
16255 struct Symbol * classSym = FindClass(id->string);
16256
16257 if(classSym)
16258 {
16259 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16260
16261 if(convertClass)
16262 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16263 }
16264 }
16265 }
16266 if(!exp->__anon1.member.exp->destType)
16267 {
16268 if(method && !method->_class->symbol)
16269 method->_class->symbol = FindClass(method->_class->fullName);
16270 if(prop && !prop->_class->symbol)
16271 prop->_class->symbol = FindClass(prop->_class->fullName);
16272 exp->__anon1.member.exp->destType = __extension__ ({
16273 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16274
16275 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16276 });
16277 }
16278 if(prop)
16279 {
16280 exp->__anon1.member.memberType = 1;
16281 if(!prop->dataType)
16282 ProcessPropertyType(prop);
16283 exp->expType = prop->dataType;
16284 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16285 {
16286 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16287
16288 CopyTypeInto(type, exp->expType);
16289 type->refCount = 1;
16290 type->constant = 1;
16291 exp->expType = type;
16292 }
16293 else if(prop->dataType)
16294 prop->dataType->refCount++;
16295 }
16296 else if(member)
16297 {
16298 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16299 {
16300 FreeExpContents(exp);
16301 exp->type = 0;
16302 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16303 ProcessExpressionType(exp);
16304 return ;
16305 }
16306 exp->__anon1.member.memberType = 3;
16307 DeclareStruct(_class->fullName, 0);
16308 if(!member->dataType)
16309 {
16310 struct Context * context = SetupTemplatesContext(_class);
16311
16312 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16313 FinishTemplatesContext(context);
16314 }
16315 exp->expType = member->dataType;
16316 if(member->dataType)
16317 member->dataType->refCount++;
16318 }
16319 else if(revConvert)
16320 {
16321 exp->__anon1.member.memberType = 4;
16322 exp->expType = MkClassType(revConvert->_class->fullName);
16323 }
16324 else if(method)
16325 {
16326 {
16327 exp->__anon1.member.memberType = 2;
16328 }
16329 if(!method->dataType)
16330 ProcessMethodType(method);
16331 exp->expType = __extension__ ({
16332 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16333
16334 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16335 });
16336 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16337 exp->expType->__anon1.__anon3.usedClass = _class;
16338 }
16339 else if(!classProp)
16340 {
16341 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16342 {
16343 FreeExpContents(exp);
16344 exp->type = 0;
16345 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16346 FreeType(exp->expType);
16347 exp->expType = MkClassType("ecere::com::Class");
16348 return ;
16349 }
16350 yylloc = exp->__anon1.member.member->loc;
16351 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16352 if(inCompiler)
16353 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16354 }
16355 if(_class && exp->expType)
16356 {
16357 struct __ecereNameSpace__ecere__com__Class * tClass;
16358
16359 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16360 while(tClass && !tClass->templateClass)
16361 tClass = tClass->base;
16362 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16363 {
16364 int id = 0;
16365 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16366 struct __ecereNameSpace__ecere__com__Class * sClass;
16367
16368 for(sClass = tClass; sClass; sClass = sClass->base)
16369 {
16370 id = 0;
16371 if(sClass->templateClass)
16372 sClass = sClass->templateClass;
16373 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16374 {
16375 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16376 {
16377 for(sClass = sClass->base; sClass; sClass = sClass->base)
16378 id += sClass->templateParams.count;
16379 break;
16380 }
16381 id++;
16382 }
16383 if(curParam)
16384 break;
16385 }
16386 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16387 {
16388 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16389 struct Context * context = SetupTemplatesContext(tClass);
16390 unsigned int constant = exp->expType->constant;
16391
16392 FreeType(exp->expType);
16393 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16394 if(exp->expType->kind == 8 && constant)
16395 exp->expType->constant = 1;
16396 else if(exp->expType->kind == 13)
16397 {
16398 struct Type * t = exp->expType->__anon1.type;
16399
16400 while(t->kind == 13)
16401 t = t->__anon1.type;
16402 if(constant)
16403 t->constant = constant;
16404 }
16405 if(exp->expType)
16406 {
16407 if(exp->expType->kind == 21)
16408 {
16409 FreeType(exp->expType);
16410 exp->expType = ReplaceThisClassType(_class);
16411 }
16412 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16413 exp->expType->passAsTemplate = 1;
16414 if(!exp->destType)
16415 {
16416 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16417 if(exp->destType->kind == 8 && constant)
16418 exp->destType->constant = 1;
16419 else if(exp->destType->kind == 13)
16420 {
16421 struct Type * t = exp->destType->__anon1.type;
16422
16423 while(t->kind == 13)
16424 t = t->__anon1.type;
16425 if(constant)
16426 t->constant = constant;
16427 }
16428 if(exp->destType->kind == 21)
16429 {
16430 FreeType(exp->destType);
16431 exp->destType = ReplaceThisClassType(_class);
16432 }
16433 }
16434 }
16435 FinishTemplatesContext(context);
16436 }
16437 }
16438 else if(tClass && exp->expType->kind == 13 && exp->expType->__anon1.type && exp->expType->__anon1.type->kind == 20 && exp->expType->__anon1.type->__anon1.templateParameter->type == 0)
16439 {
16440 int id = 0;
16441 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16442 struct __ecereNameSpace__ecere__com__Class * sClass;
16443
16444 for(sClass = tClass; sClass; sClass = sClass->base)
16445 {
16446 id = 0;
16447 if(sClass->templateClass)
16448 sClass = sClass->templateClass;
16449 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16450 {
16451 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16452 {
16453 for(sClass = sClass->base; sClass; sClass = sClass->base)
16454 id += sClass->templateParams.count;
16455 break;
16456 }
16457 id++;
16458 }
16459 if(curParam)
16460 break;
16461 }
16462 if(curParam)
16463 {
16464 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16465 struct Context * context = SetupTemplatesContext(tClass);
16466 struct Type * basicType;
16467
16468 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16469 if(basicType)
16470 {
16471 if(basicType->kind == 21)
16472 {
16473 FreeType(basicType);
16474 basicType = ReplaceThisClassType(_class);
16475 }
16476 FreeType(exp->expType);
16477 exp->expType = __extension__ ({
16478 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16479
16480 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16481 });
16482 if(!exp->destType)
16483 {
16484 exp->destType = exp->expType;
16485 exp->destType->refCount++;
16486 }
16487 {
16488 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16489 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16490 struct Declarator * decl;
16491
16492 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16493 *newExp = *exp;
16494 if(exp->destType)
16495 exp->destType->refCount++;
16496 if(exp->expType)
16497 exp->expType->refCount++;
16498 exp->type = 11;
16499 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16500 exp->__anon1.cast.exp = newExp;
16501 }
16502 }
16503 FinishTemplatesContext(context);
16504 }
16505 }
16506 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16507 {
16508 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16509
16510 if(expClass)
16511 {
16512 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16513 int p = 0;
16514 int paramCount = 0;
16515 int lastParam = -1;
16516 char templateString[1024];
16517 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16518
16519 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16520 while(cClass != expClass)
16521 {
16522 struct __ecereNameSpace__ecere__com__Class * sClass;
16523
16524 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16525 ;
16526 cClass = sClass;
16527 for(param = cClass->templateParams.first; param; param = param->next)
16528 {
16529 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16530 int cp = 0;
16531 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16532 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16533
16534 while(cClassCur != tClass && !paramCur)
16535 {
16536 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16537
16538 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16539 ;
16540 cClassCur = sClassCur;
16541 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16542 {
16543 if(!strcmp(paramCur->name, param->name))
16544 {
16545 break;
16546 }
16547 cp++;
16548 }
16549 }
16550 if(paramCur && paramCur->type == 0)
16551 arg = tClass->templateArgs[cp];
16552 else
16553 arg = expClass->templateArgs[p];
16554 {
16555 char argument[256];
16556
16557 argument[0] = '\0';
16558 switch(param->type)
16559 {
16560 case 2:
16561 {
16562 char expString[1024];
16563 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16564 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16565 struct Expression * exp;
16566 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16567
16568 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16569 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16570 ProcessExpressionType(exp);
16571 ComputeExpression(exp);
16572 expString[0] = '\0';
16573 PrintExpression(exp, expString);
16574 strcat(argument, expString);
16575 FreeExpression(exp);
16576 break;
16577 }
16578 case 1:
16579 {
16580 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16581 break;
16582 }
16583 case 0:
16584 {
16585 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16586 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16587 break;
16588 }
16589 }
16590 if(argument[0])
16591 {
16592 if(paramCount)
16593 strcat(templateString, ", ");
16594 if(lastParam != p - 1)
16595 {
16596 strcat(templateString, param->name);
16597 strcat(templateString, " = ");
16598 }
16599 strcat(templateString, argument);
16600 paramCount++;
16601 lastParam = p;
16602 }
16603 }
16604 p++;
16605 }
16606 }
16607 {
16608 int len = strlen(templateString);
16609
16610 if(templateString[len - 1] == '>')
16611 templateString[len++] = ' ';
16612 templateString[len++] = '>';
16613 templateString[len++] = '\0';
16614 }
16615 FreeType(exp->expType);
16616 {
16617 struct Context * context = SetupTemplatesContext(tClass);
16618
16619 exp->expType = ProcessTypeString(templateString, 0);
16620 FinishTemplatesContext(context);
16621 }
16622 }
16623 }
16624 }
16625 }
16626 else
16627 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->string : (type->__anon1._class ? type->__anon1._class->string : (((void *)0)))) : "(null)");
16628 }
16629 else if(type && (type->kind == 9 || type->kind == 10))
16630 {
16631 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16632
16633 if(memberType)
16634 {
16635 exp->expType = memberType;
16636 if(memberType)
16637 memberType->refCount++;
16638 }
16639 }
16640 else
16641 {
16642 char expString[10240];
16643
16644 expString[0] = '\0';
16645 if(inCompiler)
16646 {
16647 PrintExpression(exp, expString);
16648 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16649 }
16650 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16651 }
16652 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16653 {
16654 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16655 {
16656 struct Identifier * id = exp->__anon1.member.member;
16657 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
16658
16659 if(_class)
16660 {
16661 FreeType(exp->expType);
16662 exp->expType = ReplaceThisClassType(_class);
16663 }
16664 }
16665 }
16666 yylloc = oldyylloc;
16667 break;
16668 }
16669 case 9:
16670 {
16671 struct Type * destType = exp->destType;
16672
16673 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16674 {
16675 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16676 }
16677 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16678 exp->type = 8;
16679 if(destType)
16680 destType->count++;
16681 ProcessExpressionType(exp);
16682 if(destType)
16683 destType->count--;
16684 break;
16685 }
16686 case 15:
16687 {
16688 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16689
16690 if(classSym && classSym->__anon1.registered)
16691 {
16692 if(classSym->__anon1.registered->type == 5)
16693 {
16694 char name[1024];
16695
16696 name[0] = '\0';
16697 DeclareStruct(classSym->string, 0);
16698 FreeSpecifier(exp->__anon1._class);
16699 exp->type = 10;
16700 FullClassNameCat(name, classSym->string, 0);
16701 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16702 }
16703 else
16704 {
16705 if(classSym->__anon1.registered->fixed)
16706 {
16707 FreeSpecifier(exp->__anon1._class);
16708 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16709 exp->type = 2;
16710 }
16711 else
16712 {
16713 char className[1024];
16714
16715 strcpy(className, "__ecereClass_");
16716 FullClassNameCat(className, classSym->string, 1);
16717 DeclareClass(classSym, className);
16718 FreeExpContents(exp);
16719 exp->type = 9;
16720 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16721 exp->__anon1.member.member = MkIdentifier("structSize");
16722 }
16723 }
16724 }
16725 exp->expType = __extension__ ({
16726 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16727
16728 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16729 });
16730 break;
16731 }
16732 case 10:
16733 {
16734 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16735
16736 exp->expType = __extension__ ({
16737 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16738
16739 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16740 });
16741 exp->isConstant = 1;
16742 DeclareType(type, 0, 0);
16743 FreeType(type);
16744 break;
16745 }
16746 case 11:
16747 {
16748 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16749
16750 type->count = 1;
16751 FreeType(exp->__anon1.cast.exp->destType);
16752 exp->__anon1.cast.exp->destType = type;
16753 type->refCount++;
16754 type->casted = 1;
16755 ProcessExpressionType(exp->__anon1.cast.exp);
16756 type->casted = 0;
16757 type->count = 0;
16758 exp->expType = type;
16759 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16760 {
16761 void * prev = exp->prev, * next = exp->next;
16762 struct Type * expType = exp->__anon1.cast.exp->destType;
16763 struct Expression * castExp = exp->__anon1.cast.exp;
16764 struct Type * destType = exp->destType;
16765
16766 if(expType)
16767 expType->refCount++;
16768 FreeType(exp->expType);
16769 FreeTypeName(exp->__anon1.cast.typeName);
16770 *exp = *castExp;
16771 FreeType(exp->expType);
16772 FreeType(exp->destType);
16773 exp->expType = expType;
16774 exp->destType = destType;
16775 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16776 exp->prev = prev;
16777 exp->next = next;
16778 }
16779 else
16780 {
16781 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16782 }
16783 break;
16784 }
16785 case 33:
16786 {
16787 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16788
16789 exp->expType = type;
16790 break;
16791 }
16792 case 34:
16793 {
16794 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16795
16796 ProcessExpressionType(exp->__anon1.vaArg.exp);
16797 exp->expType = type;
16798 break;
16799 }
16800 case 12:
16801 {
16802 struct Expression * e;
16803
16804 exp->isConstant = 1;
16805 FreeType(exp->__anon1.cond.cond->destType);
16806 exp->__anon1.cond.cond->destType = MkClassType("bool");
16807 exp->__anon1.cond.cond->destType->truth = 1;
16808 ProcessExpressionType(exp->__anon1.cond.cond);
16809 if(!exp->__anon1.cond.cond->isConstant)
16810 exp->isConstant = 0;
16811 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16812 {
16813 if(!e->next)
16814 {
16815 FreeType(e->destType);
16816 e->destType = exp->destType;
16817 if(e->destType)
16818 e->destType->refCount++;
16819 }
16820 ProcessExpressionType(e);
16821 if(!e->next)
16822 {
16823 exp->expType = e->expType;
16824 if(e->expType)
16825 e->expType->refCount++;
16826 }
16827 if(!e->isConstant)
16828 exp->isConstant = 0;
16829 }
16830 FreeType(exp->__anon1.cond.elseExp->destType);
16831 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16832 if(exp->__anon1.cond.elseExp->destType)
16833 exp->__anon1.cond.elseExp->destType->refCount++;
16834 ProcessExpressionType(exp->__anon1.cond.elseExp);
16835 if(!exp->__anon1.cond.elseExp->isConstant)
16836 exp->isConstant = 0;
16837 break;
16838 }
16839 case 23:
16840 {
16841 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16842 {
16843 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16844
16845 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16846 {
16847 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16848 if(exp->destType)
16849 exp->destType->refCount++;
16850 }
16851 ProcessStatement(exp->__anon1.compound);
16852 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16853 if(exp->expType)
16854 exp->expType->refCount++;
16855 }
16856 break;
16857 }
16858 case 24:
16859 {
16860 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16861
16862 if(spec && spec->type == 1)
16863 {
16864 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16865 exp->expType->kind = 19;
16866 exp->byReference = 1;
16867 }
16868 else
16869 {
16870 exp->expType = MkClassType("ecere::com::Class");
16871 exp->byReference = 1;
16872 }
16873 break;
16874 }
16875 case 25:
16876 {
16877 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16878
16879 if(_class)
16880 {
16881 struct Identifier * id = exp->__anon1.classData.id;
16882 char structName[1024];
16883 struct Expression * classExp;
16884
16885 strcpy(structName, "__ecereClassData_");
16886 FullClassNameCat(structName, _class->fullName, 0);
16887 exp->type = 9;
16888 exp->__anon1.member.member = id;
16889 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16890 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16891 else
16892 classExp = MkExpIdentifier(MkIdentifier("class"));
16893 exp->__anon1.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"))))))));
16894 ProcessExpressionType(exp);
16895 return ;
16896 }
16897 break;
16898 }
16899 case 35:
16900 {
16901 struct Type * type = (((void *)0));
16902 const char * typeString = (((void *)0));
16903 char typeStringBuf[1024];
16904
16905 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->__anon1._class->__anon1.registered, containerClass))
16906 {
16907 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16908
16909 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16910 }
16911 else if(exp->__anon1.list)
16912 {
16913 struct Expression * e;
16914
16915 for(e = (*exp->__anon1.list).first; e; e = e->next)
16916 {
16917 ProcessExpressionType(e);
16918 if(e->expType)
16919 {
16920 if(!type)
16921 {
16922 type = e->expType;
16923 type->refCount++;
16924 }
16925 else
16926 {
16927 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16928 {
16929 FreeType(type);
16930 type = e->expType;
16931 e->expType = (((void *)0));
16932 e = (*exp->__anon1.list).first;
16933 ProcessExpressionType(e);
16934 if(e->expType)
16935 {
16936 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16937 {
16938 FreeType(e->expType);
16939 e->expType = (((void *)0));
16940 FreeType(type);
16941 type = (((void *)0));
16942 break;
16943 }
16944 }
16945 }
16946 }
16947 if(e->expType)
16948 {
16949 FreeType(e->expType);
16950 e->expType = (((void *)0));
16951 }
16952 }
16953 }
16954 if(type)
16955 {
16956 typeStringBuf[0] = '\0';
16957 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16958 typeString = typeStringBuf;
16959 FreeType(type);
16960 type = (((void *)0));
16961 }
16962 }
16963 if(typeString)
16964 {
16965 char templateString[1024];
16966 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16967 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16968 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16969 struct Expression * expExt;
16970 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16971
16972 sprintf(templateString, "Container<%s>", typeString);
16973 if(exp->__anon1.list)
16974 {
16975 struct Expression * e;
16976
16977 type = ProcessTypeString(typeString, 0);
16978 while((e = (*exp->__anon1.list).first))
16979 {
16980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16981 e->destType = type;
16982 type->refCount++;
16983 ProcessExpressionType(e);
16984 ListAdd(initializers, MkInitializerAssignment(e));
16985 }
16986 FreeType(type);
16987 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16988 }
16989 DeclareStruct("ecere::com::BuiltInContainer", 0);
16990 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16991 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16992 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16993 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16994 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16995 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16996 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16997 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16998 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16999 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17000
17001 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17002 })));
17003 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17004 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
17005 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17006 exp->expType = ProcessTypeString(templateString, 0);
17007 exp->type = 5;
17008 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17009 ProcessExpressionType(expExt);
17010 }
17011 else
17012 {
17013 exp->expType = ProcessTypeString("Container", 0);
17014 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17015 }
17016 break;
17017 }
17018 }
17019 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17020 {
17021 FreeType(exp->expType);
17022 exp->expType = ReplaceThisClassType(thisClass);
17023 }
17024 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->__anon1.__anon1.members.first && exp->expType->__anon1.__anon1.enumName)
17025 {
17026 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17027
17028 if(symbol)
17029 {
17030 if(exp->expType->kind != 15)
17031 {
17032 struct Type * member;
17033 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17034
17035 FreeType(exp->expType);
17036 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17037 exp->expType->kind = symbol->type->kind;
17038 exp->expType->refCount++;
17039 exp->expType->__anon1.__anon1.enumName = enumName;
17040 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17041 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17042 member->refCount++;
17043 }
17044 else
17045 {
17046 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17047
17048 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17049 {
17050 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17051
17052 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17053 }
17054 }
17055 }
17056 }
17057 yylloc = exp->loc;
17058 if(exp->destType && (exp->destType->kind == 18))
17059 ;
17060 else if(exp->destType && !exp->destType->keepCast)
17061 {
17062 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17063 exp->needTemplateCast = 1;
17064 if(exp->destType->kind == 0)
17065 ;
17066 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17067 {
17068 if(!exp->destType->count || unresolved)
17069 {
17070 if(!exp->expType)
17071 {
17072 yylloc = exp->loc;
17073 if(exp->destType->kind != 14)
17074 {
17075 char type2[1024];
17076
17077 type2[0] = '\0';
17078 if(inCompiler)
17079 {
17080 char expString[10240];
17081
17082 expString[0] = '\0';
17083 PrintType(exp->destType, type2, 0, 1);
17084 if(inCompiler)
17085 {
17086 PrintExpression(exp, expString);
17087 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17088 }
17089 if(unresolved)
17090 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17091 else if(exp->type != 16)
17092 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17093 }
17094 }
17095 else
17096 {
17097 char expString[10240];
17098
17099 expString[0] = '\0';
17100 if(inCompiler)
17101 {
17102 PrintExpression(exp, expString);
17103 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17104 }
17105 if(unresolved)
17106 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17107 else if(exp->type != 16)
17108 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17109 }
17110 }
17111 else
17112 {
17113 char type1[1024];
17114 char type2[1024];
17115
17116 type1[0] = '\0';
17117 type2[0] = '\0';
17118 if(inCompiler)
17119 {
17120 PrintType(exp->expType, type1, 0, 1);
17121 PrintType(exp->destType, type2, 0, 1);
17122 }
17123 if(exp->destType->truth && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && !strcmp(exp->destType->__anon1._class->__anon1.registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type != 1)))
17124 ;
17125 else
17126 {
17127 char expString[10240];
17128
17129 expString[0] = '\0';
17130 if(inCompiler)
17131 {
17132 PrintExpression(exp, expString);
17133 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17134 }
17135 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17136 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17137 FreeType(exp->expType);
17138 exp->destType->refCount++;
17139 exp->expType = exp->destType;
17140 }
17141 }
17142 }
17143 }
17144 }
17145 else if(unresolved)
17146 {
17147 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17148 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name, exp->__anon1.__anon1.identifier->string);
17149 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17150 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17151 }
17152 else if(!exp->expType && exp->type != 16)
17153 {
17154 char expString[10240];
17155
17156 expString[0] = '\0';
17157 if(inCompiler)
17158 {
17159 PrintExpression(exp, expString);
17160 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17161 }
17162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17163 }
17164 if(inCompiler)
17165 ApplyAnyObjectLogic(exp);
17166 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.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)))
17167 {
17168 exp->byReference = 1;
17169 }
17170 yylloc = oldyylloc;
17171 }
17172
17173 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)
17174 {
17175 if(*curMember)
17176 {
17177 *curMember = (*curMember)->next;
17178 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17179 {
17180 *curMember = subMemberStack[--(*subMemberStackPos)];
17181 *curMember = (*curMember)->next;
17182 }
17183 while((*curMember) && (*curMember)->isProperty)
17184 *curMember = (*curMember)->next;
17185 if(subMemberStackPos)
17186 {
17187 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17188 {
17189 subMemberStack[(*subMemberStackPos)++] = *curMember;
17190 *curMember = (*curMember)->members.first;
17191 while(*curMember && (*curMember)->isProperty)
17192 *curMember = (*curMember)->next;
17193 }
17194 }
17195 }
17196 while(!*curMember)
17197 {
17198 if(!*curMember)
17199 {
17200 if(subMemberStackPos && *subMemberStackPos)
17201 {
17202 *curMember = subMemberStack[--(*subMemberStackPos)];
17203 *curMember = (*curMember)->next;
17204 }
17205 else
17206 {
17207 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17208
17209 if(*curClass == _class)
17210 break;
17211 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17212 ;
17213 *curMember = (*curClass)->membersAndProperties.first;
17214 }
17215 while((*curMember) && (*curMember)->isProperty)
17216 *curMember = (*curMember)->next;
17217 if(subMemberStackPos)
17218 {
17219 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17220 {
17221 subMemberStack[(*subMemberStackPos)++] = *curMember;
17222 *curMember = (*curMember)->members.first;
17223 while(*curMember && (*curMember)->isProperty)
17224 *curMember = (*curMember)->next;
17225 }
17226 }
17227 }
17228 }
17229 }
17230
17231 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17232 {
17233 switch(init->type)
17234 {
17235 case 0:
17236 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17237 {
17238 if(init->__anon1.exp && !init->__anon1.exp->destType)
17239 {
17240 FreeType(init->__anon1.exp->destType);
17241 init->__anon1.exp->destType = type;
17242 if(type)
17243 type->refCount++;
17244 }
17245 if(init->__anon1.exp)
17246 {
17247 ProcessExpressionType(init->__anon1.exp);
17248 init->isConstant = init->__anon1.exp->isConstant;
17249 }
17250 break;
17251 }
17252 else
17253 {
17254 struct Expression * exp = init->__anon1.exp;
17255 struct Instantiation * inst = exp->__anon1.instance;
17256 struct MembersInit * members;
17257
17258 init->type = 1;
17259 init->__anon1.list = MkList();
17260 if(inst->members)
17261 {
17262 for(members = (*inst->members).first; members; members = members->next)
17263 {
17264 if(members->type == 0)
17265 {
17266 struct MemberInit * member;
17267
17268 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17269 {
17270 ListAdd(init->__anon1.list, member->initializer);
17271 member->initializer = (((void *)0));
17272 }
17273 }
17274 }
17275 }
17276 FreeExpression(exp);
17277 }
17278 case 1:
17279 {
17280 struct Initializer * i;
17281 struct Type * initializerType = (((void *)0));
17282 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17283 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17284 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17285 int subMemberStackPos = 0;
17286
17287 if(type && type->kind == 12)
17288 initializerType = Dereference(type);
17289 else if(type && (type->kind == 9 || type->kind == 10))
17290 initializerType = type->__anon1.__anon1.members.first;
17291 for(i = (*init->__anon1.list).first; i; i = i->next)
17292 {
17293 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17294 {
17295 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17296 if(curMember)
17297 {
17298 if(!curMember->dataType)
17299 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17300 initializerType = curMember->dataType;
17301 }
17302 }
17303 ProcessInitializer(i, initializerType);
17304 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17305 initializerType = initializerType->next;
17306 if(!i->isConstant)
17307 init->isConstant = 0;
17308 }
17309 if(type && type->kind == 12)
17310 FreeType(initializerType);
17311 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type != 1))
17312 {
17313 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17314 }
17315 break;
17316 }
17317 }
17318 }
17319
17320 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17321
17322 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17323
17324 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17325 {
17326 switch(spec->type)
17327 {
17328 case 0:
17329 {
17330 if(spec->__anon1.specifier == THISCLASS)
17331 {
17332 if(thisClass)
17333 {
17334 spec->type = 1;
17335 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17336 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17337 ProcessSpecifier(spec, declareStruct);
17338 }
17339 }
17340 break;
17341 }
17342 case 1:
17343 {
17344 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17345
17346 if(symbol)
17347 DeclareType(symbol->type, 1, 1);
17348 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17349 DeclareStruct(spec->__anon1.__anon1.name, 0);
17350 break;
17351 }
17352 case 2:
17353 {
17354 struct Enumerator * e;
17355
17356 if(spec->__anon1.__anon2.list)
17357 {
17358 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17359 {
17360 if(e->exp)
17361 ProcessExpressionType(e->exp);
17362 }
17363 }
17364 break;
17365 }
17366 case 3:
17367 case 4:
17368 {
17369 if(spec->__anon1.__anon2.definitions)
17370 {
17371 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17372
17373 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17374 }
17375 break;
17376 }
17377 }
17378 }
17379
17380 static void ProcessDeclarator(struct Declarator * decl)
17381 {
17382 switch(decl->type)
17383 {
17384 case 1:
17385 if(decl->__anon1.identifier->classSym)
17386 {
17387 FreeSpecifier(decl->__anon1.identifier->_class);
17388 decl->__anon1.identifier->_class = (((void *)0));
17389 }
17390 break;
17391 case 3:
17392 if(decl->__anon1.array.exp)
17393 ProcessExpressionType(decl->__anon1.array.exp);
17394 case 0:
17395 case 2:
17396 case 4:
17397 case 5:
17398 case 6:
17399 case 7:
17400 if(decl->declarator)
17401 ProcessDeclarator(decl->declarator);
17402 if(decl->type == 4)
17403 {
17404 struct Identifier * id = GetDeclId(decl);
17405
17406 if(id && id->_class)
17407 {
17408 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17409
17410 if(!decl->__anon1.function.parameters)
17411 decl->__anon1.function.parameters = MkList();
17412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17413 id->_class = (((void *)0));
17414 }
17415 if(decl->__anon1.function.parameters)
17416 {
17417 struct TypeName * param;
17418
17419 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17420 {
17421 if(param->qualifiers && (*param->qualifiers).first)
17422 {
17423 struct Specifier * spec = (*param->qualifiers).first;
17424
17425 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17426 {
17427 struct Declarator * d = param->declarator;
17428 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);
17429
17430 if(d->type != 5)
17431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17432 FreeList(param->qualifiers, FreeSpecifier);
17433 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17434 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17436 param = newParam;
17437 }
17438 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17439 {
17440 struct Declarator * d = param->declarator;
17441
17442 FreeList(param->qualifiers, FreeSpecifier);
17443 param->qualifiers = MkListOne(MkSpecifier(VOID));
17444 if(d->type != 5)
17445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17446 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17447 }
17448 else if(spec->__anon1.specifier == THISCLASS)
17449 {
17450 if(thisClass)
17451 {
17452 spec->type = 1;
17453 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17454 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17455 ProcessSpecifier(spec, 0);
17456 }
17457 }
17458 }
17459 if(param->declarator)
17460 ProcessDeclarator(param->declarator);
17461 }
17462 }
17463 }
17464 break;
17465 }
17466 }
17467
17468 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17469
17470 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17471
17472 static void ProcessDeclaration(struct Declaration * decl)
17473 {
17474 yylloc = decl->loc;
17475 switch(decl->type)
17476 {
17477 case 1:
17478 {
17479 unsigned int declareStruct = 0;
17480
17481 if(decl->__anon1.__anon1.declarators)
17482 {
17483 struct InitDeclarator * d;
17484
17485 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17486 {
17487 struct Type * type, * subType;
17488
17489 ProcessDeclarator(d->declarator);
17490 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17491 if(d->initializer)
17492 {
17493 ProcessInitializer(d->initializer, type);
17494 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17495 {
17496 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17497 {
17498 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17499
17500 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17501 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17502 if(decl->__anon1.__anon1.specifiers)
17503 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17504 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17505 d = (((void *)0));
17506 decl->type = 2;
17507 decl->__anon1.inst = inst;
17508 }
17509 }
17510 }
17511 for(subType = type; subType; )
17512 {
17513 if(subType->kind == 8)
17514 {
17515 declareStruct = 1;
17516 break;
17517 }
17518 else if(subType->kind == 13)
17519 break;
17520 else if(subType->kind == 12)
17521 subType = subType->__anon1.__anon4.arrayType;
17522 else
17523 break;
17524 }
17525 FreeType(type);
17526 if(!d)
17527 break;
17528 }
17529 }
17530 if(decl->__anon1.__anon1.specifiers)
17531 {
17532 struct Specifier * s;
17533
17534 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17535 {
17536 ProcessSpecifier(s, declareStruct);
17537 }
17538 }
17539 break;
17540 }
17541 case 2:
17542 {
17543 ProcessInstantiationType(decl->__anon1.inst);
17544 break;
17545 }
17546 case 0:
17547 {
17548 struct Specifier * spec;
17549 struct Declarator * d;
17550 unsigned int declareStruct = 0;
17551
17552 if(decl->__anon1.__anon1.declarators)
17553 {
17554 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17555 {
17556 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17557 struct Type * subType;
17558
17559 ProcessDeclarator(d);
17560 for(subType = type; subType; )
17561 {
17562 if(subType->kind == 8)
17563 {
17564 declareStruct = 1;
17565 break;
17566 }
17567 else if(subType->kind == 13)
17568 break;
17569 else if(subType->kind == 12)
17570 subType = subType->__anon1.__anon4.arrayType;
17571 else
17572 break;
17573 }
17574 FreeType(type);
17575 }
17576 }
17577 if(decl->__anon1.__anon1.specifiers)
17578 {
17579 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17580 ProcessSpecifier(spec, declareStruct);
17581 }
17582 break;
17583 }
17584 }
17585 }
17586
17587 static struct FunctionDefinition * curFunction;
17588
17589 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17590 {
17591 char propName[1024], propNameM[1024];
17592 char getName[1024], setName[1024];
17593 struct __ecereNameSpace__ecere__sys__OldList * args;
17594
17595 DeclareProperty(prop, setName, getName);
17596 strcpy(propName, "__ecereProp_");
17597 FullClassNameCat(propName, prop->_class->fullName, 0);
17598 strcat(propName, "_");
17599 FullClassNameCat(propName, prop->name, 1);
17600 strcpy(propNameM, "__ecerePropM_");
17601 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17602 strcat(propNameM, "_");
17603 FullClassNameCat(propNameM, prop->name, 1);
17604 if(prop->isWatchable)
17605 {
17606 args = MkList();
17607 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17608 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17609 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17610 args = MkList();
17611 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17612 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17613 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17614 }
17615 {
17616 args = MkList();
17617 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17618 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17619 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17620 args = MkList();
17621 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17622 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17623 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17624 }
17625 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17626 curFunction->propSet->fireWatchersDone = 1;
17627 }
17628
17629 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17630
17631 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17632
17633 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17634
17635 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17636
17637 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17638
17639 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17640
17641 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17642
17643 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17644
17645 static void ProcessStatement(struct Statement * stmt)
17646 {
17647 yylloc = stmt->loc;
17648 switch(stmt->type)
17649 {
17650 case 0:
17651 ProcessStatement(stmt->__anon1.labeled.stmt);
17652 break;
17653 case 1:
17654 if(stmt->__anon1.caseStmt.exp)
17655 {
17656 FreeType(stmt->__anon1.caseStmt.exp->destType);
17657 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17658 if(curSwitchType)
17659 curSwitchType->refCount++;
17660 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17661 ComputeExpression(stmt->__anon1.caseStmt.exp);
17662 }
17663 if(stmt->__anon1.caseStmt.stmt)
17664 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17665 break;
17666 case 2:
17667 {
17668 if(stmt->__anon1.compound.context)
17669 {
17670 struct Declaration * decl;
17671 struct Statement * s;
17672 struct Statement * prevCompound = curCompound;
17673 struct Context * prevContext = curContext;
17674
17675 if(!stmt->__anon1.compound.isSwitch)
17676 curCompound = stmt;
17677 curContext = stmt->__anon1.compound.context;
17678 if(stmt->__anon1.compound.declarations)
17679 {
17680 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17681 ProcessDeclaration(decl);
17682 }
17683 if(stmt->__anon1.compound.statements)
17684 {
17685 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17686 ProcessStatement(s);
17687 }
17688 curContext = prevContext;
17689 curCompound = prevCompound;
17690 }
17691 break;
17692 }
17693 case 3:
17694 {
17695 struct Expression * exp;
17696
17697 if(stmt->__anon1.expressions)
17698 {
17699 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17700 ProcessExpressionType(exp);
17701 }
17702 break;
17703 }
17704 case 4:
17705 {
17706 struct Expression * exp;
17707
17708 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17709 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17710 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17711 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17712 {
17713 ProcessExpressionType(exp);
17714 }
17715 if(stmt->__anon1.ifStmt.stmt)
17716 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17717 if(stmt->__anon1.ifStmt.elseStmt)
17718 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17719 break;
17720 }
17721 case 5:
17722 {
17723 struct Type * oldSwitchType = curSwitchType;
17724
17725 if(stmt->__anon1.switchStmt.exp)
17726 {
17727 struct Expression * exp;
17728
17729 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17730 {
17731 if(!exp->next)
17732 {
17733 ProcessExpressionType(exp);
17734 }
17735 if(!exp->next)
17736 curSwitchType = exp->expType;
17737 }
17738 }
17739 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17740 curSwitchType = oldSwitchType;
17741 break;
17742 }
17743 case 6:
17744 {
17745 if(stmt->__anon1.whileStmt.exp)
17746 {
17747 struct Expression * exp;
17748
17749 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17750 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17751 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17752 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17753 {
17754 ProcessExpressionType(exp);
17755 }
17756 }
17757 if(stmt->__anon1.whileStmt.stmt)
17758 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17759 break;
17760 }
17761 case 7:
17762 {
17763 if(stmt->__anon1.doWhile.exp)
17764 {
17765 struct Expression * exp;
17766
17767 if((*stmt->__anon1.doWhile.exp).last)
17768 {
17769 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17770 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17771 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17772 }
17773 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17774 {
17775 ProcessExpressionType(exp);
17776 }
17777 }
17778 if(stmt->__anon1.doWhile.stmt)
17779 ProcessStatement(stmt->__anon1.doWhile.stmt);
17780 break;
17781 }
17782 case 8:
17783 {
17784 struct Expression * exp;
17785
17786 if(stmt->__anon1.forStmt.init)
17787 ProcessStatement(stmt->__anon1.forStmt.init);
17788 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17789 {
17790 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17791 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17792 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17793 }
17794 if(stmt->__anon1.forStmt.check)
17795 ProcessStatement(stmt->__anon1.forStmt.check);
17796 if(stmt->__anon1.forStmt.increment)
17797 {
17798 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17799 ProcessExpressionType(exp);
17800 }
17801 if(stmt->__anon1.forStmt.stmt)
17802 ProcessStatement(stmt->__anon1.forStmt.stmt);
17803 break;
17804 }
17805 case 18:
17806 {
17807 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17808 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17809 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17810 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17811 char iteratorType[1024];
17812 struct Type * source;
17813 struct Expression * e;
17814 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->__anon1.cast.exp->type == 35));
17815 struct Expression * arrayExp;
17816 const char * typeString = (((void *)0));
17817 int builtinCount = 0;
17818
17819 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17820 {
17821 if(!e->next)
17822 {
17823 FreeType(e->destType);
17824 e->destType = ProcessTypeString("Container", 0);
17825 }
17826 if(!isBuiltin || e->next)
17827 ProcessExpressionType(e);
17828 }
17829 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17830 if(isBuiltin || (source && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, containerClass)))
17831 {
17832 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17833 struct Symbol * symbol;
17834 struct Expression * expIt = (((void *)0));
17835 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17836 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17837 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17838 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17839
17840 stmt->type = 2;
17841 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17842 stmt->__anon1.compound.context->parent = curContext;
17843 curContext = stmt->__anon1.compound.context;
17844 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17845 {
17846 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17847
17848 isCustomAVLTree = 1;
17849 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17850 isMap = 1;
17851 }
17852 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17853 isArray = 1;
17854 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17855 {
17856 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17857
17858 isLinkList = 1;
17859 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17860 }
17861 if(isArray)
17862 {
17863 struct Declarator * decl;
17864 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17865
17866 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17867 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17868 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17869 }
17870 else if(isBuiltin)
17871 {
17872 struct Type * type = (((void *)0));
17873 char typeStringBuf[1024];
17874
17875 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17876 if(((struct Expression *)(*exp).last)->type == 11)
17877 {
17878 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17879
17880 if(typeName)
17881 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17882 }
17883 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->__anon1._class && arrayExp->destType->__anon1._class->__anon1.registered && arrayExp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->__anon1._class->__anon1.registered, containerClass) && arrayExp->destType->__anon1._class->__anon1.registered->templateArgs)
17884 {
17885 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17886
17887 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17888 }
17889 else if(arrayExp->__anon1.list)
17890 {
17891 struct Expression * e;
17892
17893 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17894 {
17895 ProcessExpressionType(e);
17896 if(e->expType)
17897 {
17898 if(!type)
17899 {
17900 type = e->expType;
17901 type->refCount++;
17902 }
17903 else
17904 {
17905 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17906 {
17907 FreeType(type);
17908 type = e->expType;
17909 e->expType = (((void *)0));
17910 e = (*arrayExp->__anon1.list).first;
17911 ProcessExpressionType(e);
17912 if(e->expType)
17913 {
17914 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17915 {
17916 FreeType(e->expType);
17917 e->expType = (((void *)0));
17918 FreeType(type);
17919 type = (((void *)0));
17920 break;
17921 }
17922 }
17923 }
17924 }
17925 if(e->expType)
17926 {
17927 FreeType(e->expType);
17928 e->expType = (((void *)0));
17929 }
17930 }
17931 }
17932 if(type)
17933 {
17934 typeStringBuf[0] = '\0';
17935 PrintType(type, typeStringBuf, 0, 1);
17936 typeString = typeStringBuf;
17937 FreeType(type);
17938 }
17939 }
17940 if(typeString)
17941 {
17942 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17943 struct Declarator * decl;
17944 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17945
17946 if(arrayExp->__anon1.list)
17947 {
17948 struct Expression * e;
17949
17950 builtinCount = (*arrayExp->__anon1.list).count;
17951 type = ProcessTypeString(typeString, 0);
17952 while((e = (*arrayExp->__anon1.list).first))
17953 {
17954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17955 e->destType = type;
17956 type->refCount++;
17957 ProcessExpressionType(e);
17958 ListAdd(initializers, MkInitializerAssignment(e));
17959 }
17960 FreeType(type);
17961 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17962 }
17963 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17964 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17965 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17966 FreeList(exp, FreeExpression);
17967 }
17968 else
17969 {
17970 arrayExp->expType = ProcessTypeString("Container", 0);
17971 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17972 }
17973 }
17974 else if(isLinkList && !isList)
17975 {
17976 struct Declarator * decl;
17977 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17978
17979 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17980 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17981 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17982 }
17983 else if(_class->templateArgs)
17984 {
17985 if(isMap)
17986 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17987 else
17988 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
17989 stmt->__anon1.compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17990 }
17991 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
17992 if(block)
17993 {
17994 switch(block->type)
17995 {
17996 case 2:
17997 if(block->__anon1.compound.context)
17998 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17999 break;
18000 case 4:
18001 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18002 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18003 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18004 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18005 break;
18006 case 5:
18007 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18008 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18009 break;
18010 case 6:
18011 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18012 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18013 break;
18014 case 7:
18015 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18016 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18017 break;
18018 case 8:
18019 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18020 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18021 break;
18022 case 18:
18023 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18024 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18025 break;
18026 }
18027 }
18028 if(filter)
18029 {
18030 block = MkIfStmt(filter, block, (((void *)0)));
18031 }
18032 if(isArray)
18033 {
18034 stmt->__anon1.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));
18035 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18036 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18037 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18038 }
18039 else if(isBuiltin)
18040 {
18041 char count[128];
18042
18043 sprintf(count, "%d", builtinCount);
18044 stmt->__anon1.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));
18045 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18046 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18047 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18048 }
18049 else if(isLinkList && !isList)
18050 {
18051 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18052 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18053
18054 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18055 {
18056 stmt->__anon1.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));
18057 }
18058 else
18059 {
18060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18061 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18062
18063 stmt->__anon1.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));
18064 }
18065 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18066 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18067 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18068 }
18069 else
18070 {
18071 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18072 }
18073 ProcessExpressionType(expIt);
18074 if((*stmt->__anon1.compound.declarations).first)
18075 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18076 if(symbol)
18077 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18078 ProcessStatement(stmt);
18079 curContext = stmt->__anon1.compound.context->parent;
18080 break;
18081 }
18082 else
18083 {
18084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18085 }
18086 break;
18087 }
18088 case 9:
18089 break;
18090 case 10:
18091 break;
18092 case 11:
18093 break;
18094 case 12:
18095 {
18096 struct Expression * exp;
18097
18098 if(stmt->__anon1.expressions)
18099 {
18100 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18101 {
18102 if(!exp->next)
18103 {
18104 if(curFunction && !curFunction->type)
18105 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18106 FreeType(exp->destType);
18107 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18108 if(exp->destType)
18109 exp->destType->refCount++;
18110 }
18111 ProcessExpressionType(exp);
18112 }
18113 }
18114 break;
18115 }
18116 case 14:
18117 {
18118 ProcessDeclaration(stmt->__anon1.decl);
18119 break;
18120 }
18121 case 13:
18122 {
18123 struct AsmField * field;
18124
18125 if(stmt->__anon1.asmStmt.inputFields)
18126 {
18127 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18128 if(field->expression)
18129 ProcessExpressionType(field->expression);
18130 }
18131 if(stmt->__anon1.asmStmt.outputFields)
18132 {
18133 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18134 if(field->expression)
18135 ProcessExpressionType(field->expression);
18136 }
18137 if(stmt->__anon1.asmStmt.clobberedFields)
18138 {
18139 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18140 {
18141 if(field->expression)
18142 ProcessExpressionType(field->expression);
18143 }
18144 }
18145 break;
18146 }
18147 case 17:
18148 {
18149 struct PropertyWatch * propWatch;
18150 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18151 struct Expression * object = stmt->__anon1._watch.object;
18152 struct Expression * watcher = stmt->__anon1._watch.watcher;
18153
18154 if(watcher)
18155 ProcessExpressionType(watcher);
18156 if(object)
18157 ProcessExpressionType(object);
18158 if(inCompiler)
18159 {
18160 if(watcher || thisClass)
18161 {
18162 struct External * external = curExternal;
18163 struct Context * context = curContext;
18164
18165 stmt->type = 3;
18166 stmt->__anon1.expressions = MkList();
18167 curExternal = external->prev;
18168 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18169 {
18170 struct ClassFunction * func;
18171 char watcherName[1024];
18172 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->__anon1._class) ? watcher->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18173 struct External * createdExternal;
18174 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18175
18176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18177 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18178 if(propWatch->deleteWatch)
18179 strcat(watcherName, "_delete");
18180 else
18181 {
18182 struct Identifier * propID;
18183
18184 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18185 {
18186 strcat(watcherName, "_");
18187 strcat(watcherName, propID->string);
18188 }
18189 }
18190 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18191 {
18192 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->__anon1._class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
18193 ProcessClassFunctionBody(func, propWatch->compound);
18194 propWatch->compound = (((void *)0));
18195 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18196 createdExternal->symbol->idCode = external->symbol->idCode;
18197 curExternal = createdExternal;
18198 ProcessFunction(createdExternal->__anon1.function);
18199 {
18200 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18201
18202 externalDecl->__anon1.declaration = decl;
18203 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18204 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18205 }
18206 if(propWatch->deleteWatch)
18207 {
18208 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18209
18210 ListAdd(args, CopyExpression(object));
18211 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18212 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18213 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18214 }
18215 else
18216 {
18217 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18218 struct Identifier * propID;
18219
18220 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18221 {
18222 char propName[1024];
18223 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18224
18225 if(prop)
18226 {
18227 char getName[1024], setName[1024];
18228 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18229
18230 DeclareProperty(prop, setName, getName);
18231 strcpy(propName, "__ecereProp_");
18232 FullClassNameCat(propName, prop->_class->fullName, 0);
18233 strcat(propName, "_");
18234 FullClassNameCat(propName, prop->name, 1);
18235 ListAdd(args, CopyExpression(object));
18236 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18237 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18238 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18239 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18240 }
18241 else
18242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18243 }
18244 }
18245 }
18246 else
18247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18248 }
18249 curExternal = external;
18250 curContext = context;
18251 if(watcher)
18252 FreeExpression(watcher);
18253 if(object)
18254 FreeExpression(object);
18255 FreeList(watches, FreePropertyWatch);
18256 }
18257 else
18258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18259 }
18260 else
18261 {
18262 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18263 {
18264 ProcessStatement(propWatch->compound);
18265 }
18266 }
18267 break;
18268 }
18269 case 15:
18270 {
18271 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18272 struct Expression * object = stmt->__anon1._watch.object;
18273 struct __ecereNameSpace__ecere__com__Class * _class;
18274
18275 if(object)
18276 ProcessExpressionType(object);
18277 if(inCompiler)
18278 {
18279 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18280 if(_class)
18281 {
18282 struct Identifier * propID;
18283
18284 stmt->type = 3;
18285 stmt->__anon1.expressions = MkList();
18286 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18287 {
18288 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18289 }
18290 else if(!watches)
18291 {
18292 }
18293 if(watches)
18294 {
18295 for(propID = (*watches).first; propID; propID = propID->next)
18296 {
18297 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18298
18299 if(prop)
18300 {
18301 CreateFireWatcher(prop, object, stmt);
18302 }
18303 else
18304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18305 }
18306 }
18307 else
18308 {
18309 struct __ecereNameSpace__ecere__com__Property * prop;
18310 struct __ecereNameSpace__ecere__com__Class * base;
18311
18312 for(base = _class; base; base = base->base)
18313 {
18314 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18315 {
18316 if(prop->isProperty && prop->isWatchable)
18317 {
18318 CreateFireWatcher(prop, object, stmt);
18319 }
18320 }
18321 }
18322 }
18323 if(object)
18324 FreeExpression(object);
18325 FreeList(watches, FreeIdentifier);
18326 }
18327 else
18328 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18329 }
18330 break;
18331 }
18332 case 16:
18333 {
18334 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18335 struct Expression * object = stmt->__anon1._watch.object;
18336 struct Expression * watcher = stmt->__anon1._watch.watcher;
18337 struct __ecereNameSpace__ecere__com__Class * _class;
18338
18339 if(object)
18340 ProcessExpressionType(object);
18341 if(watcher)
18342 ProcessExpressionType(watcher);
18343 if(inCompiler)
18344 {
18345 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18346 if(watcher || thisClass)
18347 {
18348 if(_class)
18349 {
18350 struct Identifier * propID;
18351
18352 stmt->type = 3;
18353 stmt->__anon1.expressions = MkList();
18354 if(!watches)
18355 {
18356 struct __ecereNameSpace__ecere__sys__OldList * args;
18357
18358 args = MkList();
18359 ListAdd(args, CopyExpression(object));
18360 ListAdd(args, MkExpConstant("0"));
18361 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18362 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18363 }
18364 else
18365 {
18366 for(propID = (*watches).first; propID; propID = propID->next)
18367 {
18368 char propName[1024];
18369 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18370
18371 if(prop)
18372 {
18373 char getName[1024], setName[1024];
18374 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18375
18376 DeclareProperty(prop, setName, getName);
18377 strcpy(propName, "__ecereProp_");
18378 FullClassNameCat(propName, prop->_class->fullName, 0);
18379 strcat(propName, "_");
18380 FullClassNameCat(propName, prop->name, 1);
18381 ListAdd(args, CopyExpression(object));
18382 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18383 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18384 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18385 }
18386 else
18387 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18388 }
18389 }
18390 if(object)
18391 FreeExpression(object);
18392 if(watcher)
18393 FreeExpression(watcher);
18394 FreeList(watches, FreeIdentifier);
18395 }
18396 else
18397 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18398 }
18399 else
18400 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18401 }
18402 break;
18403 }
18404 }
18405 }
18406
18407 extern struct Expression * QBrackets(struct Expression * exp);
18408
18409 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18410
18411 extern struct Declarator * QMkPtrDecl(const char *  id);
18412
18413 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18414
18415 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18416
18417 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18418
18419 static void ProcessFunction(struct FunctionDefinition * function)
18420 {
18421 struct Identifier * id = GetDeclId(function->declarator);
18422 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18423 struct Type * type = symbol ? symbol->type : (((void *)0));
18424 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18425 struct Context * oldTopContext = topContext;
18426
18427 yylloc = function->loc;
18428 if(type && type->__anon1.__anon2.thisClass)
18429 {
18430 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18431 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18432 char className[1024];
18433 char structName[1024];
18434 struct Declarator * funcDecl;
18435 struct Symbol * thisSymbol;
18436 unsigned int typedObject = 0;
18437
18438 if(_class && !_class->base)
18439 {
18440 _class = currentClass;
18441 if(_class && !_class->symbol)
18442 _class->symbol = FindClass(_class->fullName);
18443 classSym = _class ? _class->symbol : (((void *)0));
18444 typedObject = 1;
18445 }
18446 thisClass = _class;
18447 if(inCompiler && _class)
18448 {
18449 if(type->kind == 11)
18450 {
18451 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18452 {
18453 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18454
18455 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18456 FreeType(param);
18457 }
18458 if(type->classObjectType != 1)
18459 {
18460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18461 symbol->type->__anon1.__anon2.staticMethod = 1;
18462 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18463 symbol->type->extraParam = 0;
18464 }
18465 }
18466 strcpy(className, "__ecereClass_");
18467 FullClassNameCat(className, _class->fullName, 1);
18468 structName[0] = (char)0;
18469 FullClassNameCat(structName, _class->fullName, 0);
18470 funcDecl = GetFuncDecl(function->declarator);
18471 if(funcDecl)
18472 {
18473 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18474 {
18475 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18476
18477 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18478 {
18479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18480 FreeTypeName(param);
18481 }
18482 }
18483 if(!function->propertyNoThis)
18484 {
18485 struct TypeName * thisParam = (((void *)0));
18486
18487 if(type->classObjectType != 1)
18488 {
18489 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18490 if(!funcDecl->__anon1.function.parameters)
18491 funcDecl->__anon1.function.parameters = MkList();
18492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18493 }
18494 if(typedObject)
18495 {
18496 if(type->classObjectType != 1)
18497 {
18498 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18499 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18500 }
18501 thisParam = __extension__ ({
18502 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18503
18504 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18505 });
18506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18507 }
18508 }
18509 }
18510 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18511 {
18512 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18513
18514 funcDecl = GetFuncDecl(initDecl->declarator);
18515 if(funcDecl)
18516 {
18517 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18518 {
18519 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18520
18521 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18522 {
18523 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18524 FreeTypeName(param);
18525 }
18526 }
18527 if(type->classObjectType != 1)
18528 {
18529 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18530 {
18531 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18532
18533 if(!funcDecl->__anon1.function.parameters)
18534 funcDecl->__anon1.function.parameters = MkList();
18535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18536 }
18537 }
18538 }
18539 }
18540 }
18541 if(function->body)
18542 {
18543 if(type->classObjectType != 1)
18544 {
18545 thisSymbol = __extension__ ({
18546 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18547
18548 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18549 });
18550 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18551 if(typedObject && thisSymbol->type)
18552 {
18553 thisSymbol->type->classObjectType = 2;
18554 thisSymbol->type->byReference = type->byReference;
18555 thisSymbol->type->typedByReference = type->byReference;
18556 }
18557 }
18558 }
18559 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18560 {
18561 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18562
18563 {
18564 struct __ecereNameSpace__ecere__com__Class * base;
18565
18566 for(base = _class; base && base->type != 1000; base = base->next)
18567 {
18568 for(member = base->membersAndProperties.first; member; member = member->next)
18569 if(!member->isProperty)
18570 break;
18571 if(member)
18572 break;
18573 }
18574 }
18575 for(member = _class->membersAndProperties.first; member; member = member->next)
18576 if(!member->isProperty)
18577 break;
18578 if(member)
18579 {
18580 char pointerName[1024];
18581 struct Declaration * decl;
18582 struct Initializer * initializer;
18583 struct Expression * exp, * bytePtr;
18584
18585 strcpy(pointerName, "__ecerePointer_");
18586 FullClassNameCat(pointerName, _class->fullName, 0);
18587 {
18588 char className[1024];
18589
18590 strcpy(className, "__ecereClass_");
18591 FullClassNameCat(className, classSym->string, 1);
18592 DeclareClass(classSym, className);
18593 }
18594 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18595 if(_class->fixed)
18596 {
18597 char string[256];
18598
18599 sprintf(string, "%d", _class->offset);
18600 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18601 }
18602 else
18603 {
18604 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18605 }
18606 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18607 exp->expType = __extension__ ({
18608 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18609
18610 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18611 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18612
18613 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18614 }), __ecereInstance2;
18615 });
18616 if(function->body)
18617 {
18618 yylloc = function->body->loc;
18619 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18620 {
18621 struct Context * prevContext = curContext;
18622
18623 curContext = function->body->__anon1.compound.context;
18624 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18625 curContext = prevContext;
18626 }
18627 decl->symbol = (((void *)0));
18628 if(!function->body->__anon1.compound.declarations)
18629 function->body->__anon1.compound.declarations = MkList();
18630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18631 }
18632 }
18633 }
18634 }
18635 else
18636 thisClass = (((void *)0));
18637 if(id)
18638 {
18639 FreeSpecifier(id->_class);
18640 id->_class = (((void *)0));
18641 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18642 {
18643 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18644
18645 id = GetDeclId(initDecl->declarator);
18646 FreeSpecifier(id->_class);
18647 id->_class = (((void *)0));
18648 }
18649 }
18650 if(function->body)
18651 topContext = function->body->__anon1.compound.context;
18652 {
18653 struct FunctionDefinition * oldFunction = curFunction;
18654
18655 curFunction = function;
18656 if(function->body)
18657 ProcessStatement(function->body);
18658 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18659 {
18660 struct Statement * prevCompound = curCompound;
18661 struct Context * prevContext = curContext;
18662 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18663
18664 if(!function->body->__anon1.compound.statements)
18665 function->body->__anon1.compound.statements = MkList();
18666 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18667 curCompound = function->body;
18668 curContext = function->body->__anon1.compound.context;
18669 ProcessStatement(fireWatchers);
18670 curContext = prevContext;
18671 curCompound = prevCompound;
18672 }
18673 curFunction = oldFunction;
18674 }
18675 if(function->declarator)
18676 {
18677 ProcessDeclarator(function->declarator);
18678 }
18679 topContext = oldTopContext;
18680 thisClass = oldThisClass;
18681 }
18682
18683 extern void FreeSymbol(struct Symbol * symbol);
18684
18685 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18686
18687 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18688 {
18689 struct ClassDef * def;
18690 struct External * external = curExternal;
18691 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18692
18693 for(def = definitions->first; def; def = def->next)
18694 {
18695 if(def->type == 0)
18696 {
18697 if(def->__anon1.function->declarator)
18698 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18699 else
18700 curExternal = external;
18701 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18702 }
18703 else if(def->type == 2)
18704 {
18705 if(def->__anon1.decl->type == 2)
18706 {
18707 thisClass = regClass;
18708 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18709 thisClass = (((void *)0));
18710 }
18711 else
18712 {
18713 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18714
18715 if(regClass)
18716 thisClass = regClass;
18717 ProcessDeclaration(def->__anon1.decl);
18718 thisClass = backThisClass;
18719 }
18720 }
18721 else if(def->type == 1 && def->__anon1.defProperties)
18722 {
18723 struct MemberInit * defProperty;
18724 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);
18725
18726 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18727 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18728 {
18729 thisClass = regClass;
18730 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18731 thisClass = (((void *)0));
18732 }
18733 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18734 FreeSymbol(thisSymbol);
18735 }
18736 else if(def->type == 3 && def->__anon1.propertyDef)
18737 {
18738 struct PropertyDef * prop = def->__anon1.propertyDef;
18739
18740 thisClass = regClass;
18741 if(prop->setStmt)
18742 {
18743 if(regClass)
18744 {
18745 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18746
18747 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18748 }
18749 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18750 ProcessStatement(prop->setStmt);
18751 }
18752 if(prop->getStmt)
18753 {
18754 if(regClass)
18755 {
18756 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18757
18758 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18759 }
18760 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18761 ProcessStatement(prop->getStmt);
18762 }
18763 if(prop->issetStmt)
18764 {
18765 if(regClass)
18766 {
18767 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18768
18769 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18770 }
18771 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18772 ProcessStatement(prop->issetStmt);
18773 }
18774 thisClass = (((void *)0));
18775 }
18776 else if(def->type == 4 && def->__anon1.propertyWatch)
18777 {
18778 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18779
18780 thisClass = regClass;
18781 if(propertyWatch->compound)
18782 {
18783 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);
18784
18785 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18786 curExternal = (((void *)0));
18787 ProcessStatement(propertyWatch->compound);
18788 }
18789 thisClass = (((void *)0));
18790 }
18791 }
18792 }
18793
18794 void DeclareFunctionUtil(const char * s)
18795 {
18796 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18797
18798 if(function)
18799 {
18800 char name[1024];
18801
18802 name[0] = (char)0;
18803 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18804 strcpy(name, "__ecereFunction_");
18805 FullClassNameCat(name, s, 0);
18806 DeclareFunction(function, name);
18807 }
18808 }
18809
18810 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18811
18812 void ComputeDataTypes()
18813 {
18814 struct External * external;
18815 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18816 struct External * after = (((void *)0));
18817
18818 currentClass = (((void *)0));
18819 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18820 for(external = (*ast).first; external; external = external->next)
18821 {
18822 if(external->type == 1)
18823 {
18824 struct Declaration * decl = external->__anon1.declaration;
18825
18826 if(decl)
18827 {
18828 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18829
18830 if(decls)
18831 {
18832 struct InitDeclarator * initDecl = (*decls).first;
18833
18834 if(initDecl)
18835 {
18836 struct Declarator * declarator = initDecl->declarator;
18837
18838 if(declarator && declarator->type == 1)
18839 {
18840 struct Identifier * id = declarator->__anon1.identifier;
18841
18842 if(id && id->string)
18843 {
18844 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18845 {
18846 external->symbol->id = -1001, external->symbol->idCode = -1001;
18847 after = external;
18848 }
18849 }
18850 }
18851 }
18852 }
18853 }
18854 }
18855 }
18856 {
18857 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18858
18859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18860 after = e;
18861 }
18862 temp->symbol = __extension__ ({
18863 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18864
18865 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18866 });
18867 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18868 curExternal = temp;
18869 DeclareFunctionUtil("eSystem_New");
18870 DeclareFunctionUtil("eSystem_New0");
18871 DeclareFunctionUtil("eSystem_Renew");
18872 DeclareFunctionUtil("eSystem_Renew0");
18873 DeclareFunctionUtil("eSystem_Delete");
18874 DeclareFunctionUtil("eClass_GetProperty");
18875 DeclareFunctionUtil("eClass_SetProperty");
18876 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18877 DeclareFunctionUtil("eInstance_SetMethod");
18878 DeclareFunctionUtil("eInstance_IncRef");
18879 DeclareFunctionUtil("eInstance_StopWatching");
18880 DeclareFunctionUtil("eInstance_Watch");
18881 DeclareFunctionUtil("eInstance_FireWatchers");
18882 DeclareStruct("ecere::com::Class", 0);
18883 DeclareStruct("ecere::com::Instance", 0);
18884 DeclareStruct("ecere::com::Property", 0);
18885 DeclareStruct("ecere::com::DataMember", 0);
18886 DeclareStruct("ecere::com::Method", 0);
18887 DeclareStruct("ecere::com::SerialBuffer", 0);
18888 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18889 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18890 for(external = (*ast).first; external; external = external->next)
18891 {
18892 afterExternal = curExternal = external;
18893 if(external->type == 0)
18894 {
18895 currentClass = external->__anon1.function->_class;
18896 ProcessFunction(external->__anon1.function);
18897 }
18898 else if(external->type == 1)
18899 {
18900 currentClass = (((void *)0));
18901 if(external->__anon1.declaration)
18902 ProcessDeclaration(external->__anon1.declaration);
18903 }
18904 else if(external->type == 2)
18905 {
18906 struct ClassDefinition * _class = external->__anon1._class;
18907
18908 currentClass = external->symbol->__anon1.registered;
18909 if(_class->definitions)
18910 {
18911 ProcessClass(_class->definitions, _class->symbol);
18912 }
18913 if(inCompiler)
18914 {
18915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18916 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18917 }
18918 }
18919 else if(external->type == 4)
18920 {
18921 thisNameSpace = external->__anon1.id->string;
18922 }
18923 }
18924 currentClass = (((void *)0));
18925 thisNameSpace = (((void *)0));
18926 curExternal = (((void *)0));
18927 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18928 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18929 }
18930
18931 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
18932
18933 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char *  name, const char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18934
18935 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18936
18937 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18938 {
18939 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18940
18941 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18945 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18990 __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);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18994 __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);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19007 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
19008 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19009 __ecereClass_Conversion = class;
19010 __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, bool warnConst)", MatchTypes, module, 1);
19011 __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);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19013 __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);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19036 }
19037
19038 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19039 {
19040
19041 }
19042