ecere: Corrected Linux warning fixes for Windows; compiler/bootstrap: Updated
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 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 = 0x1;
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 = 0x0;
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, 0x0);
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 0x1;
1309 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1310 {
1311 return 0x0;
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 0x1;
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 0x1;
1333 }
1334 }
1335 return 0x1;
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 = 0x1;
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 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1533 return __ecereNameSpace__ecere__sys__CopyString(temp);
1534 }
1535
1536 char * PrintUInt64(uint64 result)
1537 {
1538 char temp[100];
1539
1540 if(result > (((long long)0x7fffffffffffffffLL)))
1541 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1542 else
1543 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1544 return __ecereNameSpace__ecere__sys__CopyString(temp);
1545 }
1546
1547 char * PrintHexUInt(uint64 result)
1548 {
1549 char temp[100];
1550
1551 if(result > (0xffffffff))
1552 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1553 else
1554 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1555 if(result > (0xffffffff))
1556 strcat(temp, "LL");
1557 return __ecereNameSpace__ecere__sys__CopyString(temp);
1558 }
1559
1560 char * PrintHexUInt64(uint64 result)
1561 {
1562 char temp[100];
1563
1564 if(result > (0xffffffff))
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1566 else
1567 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1569 }
1570
1571 char * PrintShort(short result)
1572 {
1573 char temp[100];
1574
1575 sprintf(temp, "%d", (unsigned short)result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1577 }
1578
1579 char * PrintUShort(unsigned short result)
1580 {
1581 char temp[100];
1582
1583 if(result > (unsigned short)32767)
1584 sprintf(temp, "0x%X", (int)result);
1585 else
1586 sprintf(temp, "%d", (int)result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 }
1589
1590 extern int isprint(int c);
1591
1592 char * PrintChar(char result)
1593 {
1594 char temp[100];
1595
1596 if(result > (char)0 && isprint(result))
1597 sprintf(temp, "'%c'", result);
1598 else if(result < (char)0)
1599 sprintf(temp, "%d", (int)result);
1600 else
1601 sprintf(temp, "0x%X", (unsigned char)result);
1602 return __ecereNameSpace__ecere__sys__CopyString(temp);
1603 }
1604
1605 char * PrintUChar(unsigned char result)
1606 {
1607 char temp[100];
1608
1609 sprintf(temp, "0x%X", result);
1610 return __ecereNameSpace__ecere__sys__CopyString(temp);
1611 }
1612
1613 extern char *  strcpy(char * , const char * );
1614
1615 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1616
1617 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1618
1619 extern int (* __ecereProp_float_Get_signBit)(float this);
1620
1621 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1622
1623 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1624
1625 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1626
1627 char * PrintFloat(float result)
1628 {
1629 char temp[350];
1630
1631 if(__ecereProp_float_Get_isInf(result))
1632 {
1633 if(__ecereProp_float_Get_signBit(result))
1634 strcpy(temp, "-inf");
1635 else
1636 strcpy(temp, "inf");
1637 }
1638 else if(__ecereProp_float_Get_isNan(result))
1639 {
1640 if(__ecereProp_float_Get_signBit(result))
1641 strcpy(temp, "-nan");
1642 else
1643 strcpy(temp, "nan");
1644 }
1645 else
1646 sprintf(temp, "%.16ff", result);
1647 return __ecereNameSpace__ecere__sys__CopyString(temp);
1648 }
1649
1650 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1651
1652 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1653
1654 extern int (* __ecereProp_double_Get_signBit)(double this);
1655
1656 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1657
1658 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1659
1660 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1661
1662 char * PrintDouble(double result)
1663 {
1664 char temp[350];
1665
1666 if(__ecereProp_double_Get_isInf(result))
1667 {
1668 if(__ecereProp_double_Get_signBit(result))
1669 strcpy(temp, "-inf");
1670 else
1671 strcpy(temp, "inf");
1672 }
1673 else if(__ecereProp_double_Get_isNan(result))
1674 {
1675 if(__ecereProp_double_Get_signBit(result))
1676 strcpy(temp, "-nan");
1677 else
1678 strcpy(temp, "nan");
1679 }
1680 else
1681 sprintf(temp, "%.16f", result);
1682 return __ecereNameSpace__ecere__sys__CopyString(temp);
1683 }
1684
1685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1686
1687 struct OpTable
1688 {
1689 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1695 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1696 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1697 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1709 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  Not)(struct Expression *, struct Operand *);
1715 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1724 } __attribute__ ((gcc_struct));
1725
1726 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1727
1728 struct Operand
1729 {
1730 int kind;
1731 struct Type * type;
1732 unsigned int ptrSize;
1733 union
1734 {
1735 char c;
1736 unsigned char uc;
1737 short s;
1738 unsigned short us;
1739 int i;
1740 unsigned int ui;
1741 float f;
1742 double d;
1743 long long i64;
1744 uint64 ui64;
1745 } __attribute__ ((gcc_struct)) __anon1;
1746 struct OpTable ops;
1747 } __attribute__ ((gcc_struct));
1748
1749 unsigned int GetOpInt(struct Operand * op2, int * value2)
1750 {
1751 if(op2->kind == 3 && op2->type->isSigned)
1752 *value2 = op2->__anon1.i;
1753 else if(op2->kind == 3)
1754 *value2 = (int)op2->__anon1.ui;
1755 else if(op2->kind == 4 && op2->type->isSigned)
1756 *value2 = (int)op2->__anon1.i64;
1757 else if(op2->kind == 4)
1758 *value2 = (int)op2->__anon1.ui64;
1759 else if(op2->kind == 23 && op2->type->isSigned)
1760 *value2 = (int)op2->__anon1.i64;
1761 else if(op2->kind == 23)
1762 *value2 = (int)op2->__anon1.ui64;
1763 else if(op2->kind == 22 && op2->type->isSigned)
1764 *value2 = (int)op2->__anon1.i64;
1765 else if(op2->kind == 22)
1766 *value2 = (int)op2->__anon1.ui64;
1767 else if(op2->kind == 2 && op2->type->isSigned)
1768 *value2 = (int)op2->__anon1.s;
1769 else if(op2->kind == 2)
1770 *value2 = (int)op2->__anon1.us;
1771 else if(op2->kind == 1 && op2->type->isSigned)
1772 *value2 = (int)op2->__anon1.c;
1773 else if(op2->kind == 24 || op2->kind == 1)
1774 *value2 = (int)op2->__anon1.uc;
1775 else if(op2->kind == 6)
1776 *value2 = (int)op2->__anon1.f;
1777 else if(op2->kind == 7)
1778 *value2 = (int)op2->__anon1.d;
1779 else if(op2->kind == 13)
1780 *value2 = (int)op2->__anon1.ui64;
1781 else
1782 return 0x0;
1783 return 0x1;
1784 }
1785
1786 struct Operand GetOperand(struct Expression * exp);
1787
1788 unsigned int GetInt(struct Expression * exp, int * value2)
1789 {
1790 struct Operand op2 = GetOperand(exp);
1791
1792 return GetOpInt(&op2, value2);
1793 }
1794
1795 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1796 {
1797 if(op2->kind == 3 && op2->type->isSigned)
1798 *value2 = (unsigned int)op2->__anon1.i;
1799 else if(op2->kind == 3)
1800 *value2 = op2->__anon1.ui;
1801 else if(op2->kind == 4 && op2->type->isSigned)
1802 *value2 = (unsigned int)op2->__anon1.i64;
1803 else if(op2->kind == 4)
1804 *value2 = (unsigned int)op2->__anon1.ui64;
1805 else if(op2->kind == 23 && op2->type->isSigned)
1806 *value2 = (unsigned int)op2->__anon1.i64;
1807 else if(op2->kind == 23)
1808 *value2 = (unsigned int)op2->__anon1.ui64;
1809 else if(op2->kind == 22 && op2->type->isSigned)
1810 *value2 = (unsigned int)op2->__anon1.i64;
1811 else if(op2->kind == 22)
1812 *value2 = (unsigned int)op2->__anon1.ui64;
1813 else if(op2->kind == 2 && op2->type->isSigned)
1814 *value2 = (unsigned int)op2->__anon1.s;
1815 else if(op2->kind == 2)
1816 *value2 = (unsigned int)op2->__anon1.us;
1817 else if(op2->kind == 1 && op2->type->isSigned)
1818 *value2 = (unsigned int)op2->__anon1.c;
1819 else if(op2->kind == 24 || op2->kind == 1)
1820 *value2 = (unsigned int)op2->__anon1.uc;
1821 else if(op2->kind == 6)
1822 *value2 = (unsigned int)op2->__anon1.f;
1823 else if(op2->kind == 7)
1824 *value2 = (unsigned int)op2->__anon1.d;
1825 else if(op2->kind == 13)
1826 *value2 = (unsigned int)op2->__anon1.ui64;
1827 else
1828 return 0x0;
1829 return 0x1;
1830 }
1831
1832 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1833 {
1834 struct Operand op2 = GetOperand(exp);
1835
1836 return GetOpUInt(&op2, value2);
1837 }
1838
1839 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1840 {
1841 if(op2->kind == 3 && op2->type->isSigned)
1842 *value2 = (long long)op2->__anon1.i;
1843 else if(op2->kind == 3)
1844 *value2 = (long long)op2->__anon1.ui;
1845 else if(op2->kind == 4 && op2->type->isSigned)
1846 *value2 = op2->__anon1.i64;
1847 else if(op2->kind == 4)
1848 *value2 = (long long)op2->__anon1.ui64;
1849 else if(op2->kind == 23 && op2->type->isSigned)
1850 *value2 = op2->__anon1.i64;
1851 else if(op2->kind == 23)
1852 *value2 = (long long)op2->__anon1.ui64;
1853 else if(op2->kind == 22 && op2->type->isSigned)
1854 *value2 = op2->__anon1.i64;
1855 else if(op2->kind == 22)
1856 *value2 = (long long)op2->__anon1.ui64;
1857 else if(op2->kind == 2 && op2->type->isSigned)
1858 *value2 = (long long)op2->__anon1.s;
1859 else if(op2->kind == 2)
1860 *value2 = (long long)op2->__anon1.us;
1861 else if(op2->kind == 1 && op2->type->isSigned)
1862 *value2 = (long long)op2->__anon1.c;
1863 else if(op2->kind == 24 || op2->kind == 1)
1864 *value2 = (long long)op2->__anon1.uc;
1865 else if(op2->kind == 6)
1866 *value2 = (long long)op2->__anon1.f;
1867 else if(op2->kind == 7)
1868 *value2 = (long long)op2->__anon1.d;
1869 else if(op2->kind == 13)
1870 *value2 = (long long)op2->__anon1.ui64;
1871 else
1872 return 0x0;
1873 return 0x1;
1874 }
1875
1876 unsigned int GetInt64(struct Expression * exp, long long * value2)
1877 {
1878 struct Operand op2 = GetOperand(exp);
1879
1880 return GetOpInt64(&op2, value2);
1881 }
1882
1883 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1884 {
1885 if(op2->kind == 3 && op2->type->isSigned)
1886 *value2 = (uint64)op2->__anon1.i;
1887 else if(op2->kind == 3)
1888 *value2 = (uint64)op2->__anon1.ui;
1889 else if(op2->kind == 4 && op2->type->isSigned)
1890 *value2 = (uint64)op2->__anon1.i64;
1891 else if(op2->kind == 4)
1892 *value2 = op2->__anon1.ui64;
1893 else if(op2->kind == 23 && op2->type->isSigned)
1894 *value2 = (uint64)op2->__anon1.i64;
1895 else if(op2->kind == 23)
1896 *value2 = op2->__anon1.ui64;
1897 else if(op2->kind == 22 && op2->type->isSigned)
1898 *value2 = (uint64)op2->__anon1.i64;
1899 else if(op2->kind == 22)
1900 *value2 = op2->__anon1.ui64;
1901 else if(op2->kind == 2 && op2->type->isSigned)
1902 *value2 = (uint64)op2->__anon1.s;
1903 else if(op2->kind == 2)
1904 *value2 = (uint64)op2->__anon1.us;
1905 else if(op2->kind == 1 && op2->type->isSigned)
1906 *value2 = (uint64)op2->__anon1.c;
1907 else if(op2->kind == 24 || op2->kind == 1)
1908 *value2 = (uint64)op2->__anon1.uc;
1909 else if(op2->kind == 6)
1910 *value2 = (uint64)op2->__anon1.f;
1911 else if(op2->kind == 7)
1912 *value2 = (uint64)op2->__anon1.d;
1913 else if(op2->kind == 13)
1914 *value2 = op2->__anon1.ui64;
1915 else
1916 return 0x0;
1917 return 0x1;
1918 }
1919
1920 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1921 {
1922 struct Operand op2 = GetOperand(exp);
1923
1924 return GetOpUInt64(&op2, value2);
1925 }
1926
1927 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1928 {
1929 if(op2->kind == 3 && op2->type->isSigned)
1930 *value2 = (intptr_t)op2->__anon1.i;
1931 else if(op2->kind == 3)
1932 *value2 = (intptr_t)op2->__anon1.ui;
1933 else if(op2->kind == 4 && op2->type->isSigned)
1934 *value2 = (intptr_t)op2->__anon1.i64;
1935 else if(op2->kind == 4)
1936 *value2 = (intptr_t)op2->__anon1.ui64;
1937 else if(op2->kind == 23 && op2->type->isSigned)
1938 *value2 = (intptr_t)op2->__anon1.i64;
1939 else if(op2->kind == 23)
1940 *value2 = (intptr_t)op2->__anon1.ui64;
1941 else if(op2->kind == 22 && op2->type->isSigned)
1942 *value2 = (intptr_t)op2->__anon1.i64;
1943 else if(op2->kind == 22)
1944 *value2 = (intptr_t)op2->__anon1.ui64;
1945 else if(op2->kind == 2 && op2->type->isSigned)
1946 *value2 = (intptr_t)op2->__anon1.s;
1947 else if(op2->kind == 2)
1948 *value2 = (intptr_t)op2->__anon1.us;
1949 else if(op2->kind == 1 && op2->type->isSigned)
1950 *value2 = (intptr_t)op2->__anon1.c;
1951 else if(op2->kind == 24 || op2->kind == 1)
1952 *value2 = (intptr_t)op2->__anon1.uc;
1953 else if(op2->kind == 6)
1954 *value2 = (intptr_t)op2->__anon1.f;
1955 else if(op2->kind == 7)
1956 *value2 = (intptr_t)op2->__anon1.d;
1957 else if(op2->kind == 13)
1958 *value2 = (intptr_t)op2->__anon1.ui64;
1959 else
1960 return 0x0;
1961 return 0x1;
1962 }
1963
1964 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1965 {
1966 struct Operand op2 = GetOperand(exp);
1967
1968 return GetOpIntPtr(&op2, value2);
1969 }
1970
1971 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1972 {
1973 if(op2->kind == 3 && op2->type->isSigned)
1974 *value2 = (uintptr_t)op2->__anon1.i;
1975 else if(op2->kind == 3)
1976 *value2 = (uintptr_t)op2->__anon1.ui;
1977 else if(op2->kind == 4 && op2->type->isSigned)
1978 *value2 = (uintptr_t)op2->__anon1.i64;
1979 else if(op2->kind == 4)
1980 *value2 = (uintptr_t)op2->__anon1.ui64;
1981 else if(op2->kind == 23 && op2->type->isSigned)
1982 *value2 = (uintptr_t)op2->__anon1.i64;
1983 else if(op2->kind == 23)
1984 *value2 = (uintptr_t)op2->__anon1.ui64;
1985 else if(op2->kind == 22 && op2->type->isSigned)
1986 *value2 = (uintptr_t)op2->__anon1.i64;
1987 else if(op2->kind == 22)
1988 *value2 = (uintptr_t)op2->__anon1.ui64;
1989 else if(op2->kind == 2 && op2->type->isSigned)
1990 *value2 = (uintptr_t)op2->__anon1.s;
1991 else if(op2->kind == 2)
1992 *value2 = (uintptr_t)op2->__anon1.us;
1993 else if(op2->kind == 1 && op2->type->isSigned)
1994 *value2 = (uintptr_t)op2->__anon1.c;
1995 else if(op2->kind == 24 || op2->kind == 1)
1996 *value2 = (uintptr_t)op2->__anon1.uc;
1997 else if(op2->kind == 6)
1998 *value2 = (uintptr_t)op2->__anon1.f;
1999 else if(op2->kind == 7)
2000 *value2 = (uintptr_t)op2->__anon1.d;
2001 else if(op2->kind == 13)
2002 *value2 = (uintptr_t)op2->__anon1.ui64;
2003 else
2004 return 0x0;
2005 return 0x1;
2006 }
2007
2008 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2009 {
2010 struct Operand op2 = GetOperand(exp);
2011
2012 return GetOpUIntPtr(&op2, value2);
2013 }
2014
2015 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2016 {
2017 if(op2->kind == 3 && op2->type->isSigned)
2018 *value2 = (ssize_t)op2->__anon1.i;
2019 else if(op2->kind == 3)
2020 *value2 = (ssize_t)op2->__anon1.ui;
2021 else if(op2->kind == 4 && op2->type->isSigned)
2022 *value2 = (ssize_t)op2->__anon1.i64;
2023 else if(op2->kind == 4)
2024 *value2 = (ssize_t)op2->__anon1.ui64;
2025 else if(op2->kind == 23 && op2->type->isSigned)
2026 *value2 = (ssize_t)op2->__anon1.i64;
2027 else if(op2->kind == 23)
2028 *value2 = (ssize_t)op2->__anon1.ui64;
2029 else if(op2->kind == 22 && op2->type->isSigned)
2030 *value2 = (ssize_t)op2->__anon1.i64;
2031 else if(op2->kind == 22)
2032 *value2 = (ssize_t)op2->__anon1.ui64;
2033 else if(op2->kind == 2 && op2->type->isSigned)
2034 *value2 = (ssize_t)op2->__anon1.s;
2035 else if(op2->kind == 2)
2036 *value2 = (ssize_t)op2->__anon1.us;
2037 else if(op2->kind == 1 && op2->type->isSigned)
2038 *value2 = (ssize_t)op2->__anon1.c;
2039 else if(op2->kind == 24 || op2->kind == 1)
2040 *value2 = (ssize_t)op2->__anon1.uc;
2041 else if(op2->kind == 6)
2042 *value2 = (ssize_t)op2->__anon1.f;
2043 else if(op2->kind == 7)
2044 *value2 = (ssize_t)op2->__anon1.d;
2045 else if(op2->kind == 13)
2046 *value2 = (ssize_t)op2->__anon1.ui64;
2047 else
2048 return 0x0;
2049 return 0x1;
2050 }
2051
2052 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2053 {
2054 struct Operand op2 = GetOperand(exp);
2055
2056 return GetOpIntSize(&op2, value2);
2057 }
2058
2059 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2060 {
2061 if(op2->kind == 3 && op2->type->isSigned)
2062 *value2 = (size_t)op2->__anon1.i;
2063 else if(op2->kind == 3)
2064 *value2 = (size_t)op2->__anon1.ui;
2065 else if(op2->kind == 4 && op2->type->isSigned)
2066 *value2 = (size_t)op2->__anon1.i64;
2067 else if(op2->kind == 4)
2068 *value2 = (size_t)op2->__anon1.ui64;
2069 else if(op2->kind == 23 && op2->type->isSigned)
2070 *value2 = (size_t)op2->__anon1.i64;
2071 else if(op2->kind == 23)
2072 *value2 = (size_t)op2->__anon1.ui64;
2073 else if(op2->kind == 22 && op2->type->isSigned)
2074 *value2 = (size_t)op2->__anon1.i64;
2075 else if(op2->kind == 22)
2076 *value2 = (size_t)op2->__anon1.ui64;
2077 else if(op2->kind == 2 && op2->type->isSigned)
2078 *value2 = (size_t)op2->__anon1.s;
2079 else if(op2->kind == 2)
2080 *value2 = (size_t)op2->__anon1.us;
2081 else if(op2->kind == 1 && op2->type->isSigned)
2082 *value2 = (size_t)op2->__anon1.c;
2083 else if(op2->kind == 24 || op2->kind == 1)
2084 *value2 = (size_t)op2->__anon1.uc;
2085 else if(op2->kind == 6)
2086 *value2 = (size_t)op2->__anon1.f;
2087 else if(op2->kind == 7)
2088 *value2 = (size_t)op2->__anon1.d;
2089 else if(op2->kind == 13)
2090 *value2 = (size_t)op2->__anon1.ui64;
2091 else
2092 return 0x0;
2093 return 0x1;
2094 }
2095
2096 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2097 {
2098 struct Operand op2 = GetOperand(exp);
2099
2100 return GetOpUIntSize(&op2, value2);
2101 }
2102
2103 unsigned int GetOpShort(struct Operand * op2, short * value2)
2104 {
2105 if(op2->kind == 3 && op2->type->isSigned)
2106 *value2 = (short)op2->__anon1.i;
2107 else if(op2->kind == 3)
2108 *value2 = (short)op2->__anon1.ui;
2109 else if(op2->kind == 4 && op2->type->isSigned)
2110 *value2 = (short)op2->__anon1.i64;
2111 else if(op2->kind == 4)
2112 *value2 = (short)op2->__anon1.ui64;
2113 else if(op2->kind == 23 && op2->type->isSigned)
2114 *value2 = (short)op2->__anon1.i64;
2115 else if(op2->kind == 23)
2116 *value2 = (short)op2->__anon1.ui64;
2117 else if(op2->kind == 22 && op2->type->isSigned)
2118 *value2 = (short)op2->__anon1.i64;
2119 else if(op2->kind == 22)
2120 *value2 = (short)op2->__anon1.ui64;
2121 else if(op2->kind == 2 && op2->type->isSigned)
2122 *value2 = op2->__anon1.s;
2123 else if(op2->kind == 2)
2124 *value2 = (short)op2->__anon1.us;
2125 else if(op2->kind == 1 && op2->type->isSigned)
2126 *value2 = (short)op2->__anon1.c;
2127 else if(op2->kind == 24 || op2->kind == 1)
2128 *value2 = (short)op2->__anon1.uc;
2129 else if(op2->kind == 6)
2130 *value2 = (short)op2->__anon1.f;
2131 else if(op2->kind == 7)
2132 *value2 = (short)op2->__anon1.d;
2133 else if(op2->kind == 13)
2134 *value2 = (short)op2->__anon1.ui64;
2135 else
2136 return 0x0;
2137 return 0x1;
2138 }
2139
2140 unsigned int GetShort(struct Expression * exp, short * value2)
2141 {
2142 struct Operand op2 = GetOperand(exp);
2143
2144 return GetOpShort(&op2, value2);
2145 }
2146
2147 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2148 {
2149 if(op2->kind == 3 && op2->type->isSigned)
2150 *value2 = (unsigned short)op2->__anon1.i;
2151 else if(op2->kind == 3)
2152 *value2 = (unsigned short)op2->__anon1.ui;
2153 else if(op2->kind == 4 && op2->type->isSigned)
2154 *value2 = (unsigned short)op2->__anon1.i64;
2155 else if(op2->kind == 4)
2156 *value2 = (unsigned short)op2->__anon1.ui64;
2157 else if(op2->kind == 23 && op2->type->isSigned)
2158 *value2 = (unsigned short)op2->__anon1.i64;
2159 else if(op2->kind == 23)
2160 *value2 = (unsigned short)op2->__anon1.ui64;
2161 else if(op2->kind == 22 && op2->type->isSigned)
2162 *value2 = (unsigned short)op2->__anon1.i64;
2163 else if(op2->kind == 22)
2164 *value2 = (unsigned short)op2->__anon1.ui64;
2165 else if(op2->kind == 2 && op2->type->isSigned)
2166 *value2 = (unsigned short)op2->__anon1.s;
2167 else if(op2->kind == 2)
2168 *value2 = op2->__anon1.us;
2169 else if(op2->kind == 1 && op2->type->isSigned)
2170 *value2 = (unsigned short)op2->__anon1.c;
2171 else if(op2->kind == 24 || op2->kind == 1)
2172 *value2 = (unsigned short)op2->__anon1.uc;
2173 else if(op2->kind == 6)
2174 *value2 = (unsigned short)op2->__anon1.f;
2175 else if(op2->kind == 7)
2176 *value2 = (unsigned short)op2->__anon1.d;
2177 else if(op2->kind == 13)
2178 *value2 = (unsigned short)op2->__anon1.ui64;
2179 else
2180 return 0x0;
2181 return 0x1;
2182 }
2183
2184 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2185 {
2186 struct Operand op2 = GetOperand(exp);
2187
2188 return GetOpUShort(&op2, value2);
2189 }
2190
2191 unsigned int GetOpChar(struct Operand * op2, char * value2)
2192 {
2193 if(op2->kind == 3 && op2->type->isSigned)
2194 *value2 = (char)op2->__anon1.i;
2195 else if(op2->kind == 3)
2196 *value2 = (char)op2->__anon1.ui;
2197 else if(op2->kind == 4 && op2->type->isSigned)
2198 *value2 = (char)op2->__anon1.i64;
2199 else if(op2->kind == 4)
2200 *value2 = (char)op2->__anon1.ui64;
2201 else if(op2->kind == 23 && op2->type->isSigned)
2202 *value2 = (char)op2->__anon1.i64;
2203 else if(op2->kind == 23)
2204 *value2 = (char)op2->__anon1.ui64;
2205 else if(op2->kind == 22 && op2->type->isSigned)
2206 *value2 = (char)op2->__anon1.i64;
2207 else if(op2->kind == 22)
2208 *value2 = (char)op2->__anon1.ui64;
2209 else if(op2->kind == 2 && op2->type->isSigned)
2210 *value2 = (char)op2->__anon1.s;
2211 else if(op2->kind == 2)
2212 *value2 = (char)op2->__anon1.us;
2213 else if(op2->kind == 1 && op2->type->isSigned)
2214 *value2 = op2->__anon1.c;
2215 else if(op2->kind == 24 || op2->kind == 1)
2216 *value2 = (char)op2->__anon1.uc;
2217 else if(op2->kind == 6)
2218 *value2 = (char)op2->__anon1.f;
2219 else if(op2->kind == 7)
2220 *value2 = (char)op2->__anon1.d;
2221 else if(op2->kind == 13)
2222 *value2 = (char)op2->__anon1.ui64;
2223 else
2224 return 0x0;
2225 return 0x1;
2226 }
2227
2228 unsigned int GetChar(struct Expression * exp, char * value2)
2229 {
2230 struct Operand op2 = GetOperand(exp);
2231
2232 return GetOpChar(&op2, value2);
2233 }
2234
2235 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2236 {
2237 if(op2->kind == 3 && op2->type->isSigned)
2238 *value2 = (unsigned char)op2->__anon1.i;
2239 else if(op2->kind == 3)
2240 *value2 = (unsigned char)op2->__anon1.ui;
2241 else if(op2->kind == 4 && op2->type->isSigned)
2242 *value2 = (unsigned char)op2->__anon1.i64;
2243 else if(op2->kind == 4)
2244 *value2 = (unsigned char)op2->__anon1.ui64;
2245 else if(op2->kind == 23 && op2->type->isSigned)
2246 *value2 = (unsigned char)op2->__anon1.i64;
2247 else if(op2->kind == 23)
2248 *value2 = (unsigned char)op2->__anon1.ui64;
2249 else if(op2->kind == 22 && op2->type->isSigned)
2250 *value2 = (unsigned char)op2->__anon1.i64;
2251 else if(op2->kind == 22)
2252 *value2 = (unsigned char)op2->__anon1.ui64;
2253 else if(op2->kind == 2 && op2->type->isSigned)
2254 *value2 = (unsigned char)op2->__anon1.s;
2255 else if(op2->kind == 2)
2256 *value2 = (unsigned char)op2->__anon1.us;
2257 else if(op2->kind == 1 && op2->type->isSigned)
2258 *value2 = (unsigned char)op2->__anon1.c;
2259 else if(op2->kind == 24 || op2->kind == 1)
2260 *value2 = op2->__anon1.uc;
2261 else if(op2->kind == 6)
2262 *value2 = (unsigned char)op2->__anon1.f;
2263 else if(op2->kind == 7)
2264 *value2 = (unsigned char)op2->__anon1.d;
2265 else if(op2->kind == 13)
2266 *value2 = (unsigned char)op2->__anon1.ui64;
2267 else
2268 return 0x0;
2269 return 0x1;
2270 }
2271
2272 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2273 {
2274 struct Operand op2 = GetOperand(exp);
2275
2276 return GetOpUChar(&op2, value2);
2277 }
2278
2279 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2280 {
2281 if(op2->kind == 3 && op2->type->isSigned)
2282 *value2 = (float)(float)op2->__anon1.i;
2283 else if(op2->kind == 3)
2284 *value2 = (float)(float)op2->__anon1.ui;
2285 else if(op2->kind == 4 && op2->type->isSigned)
2286 *value2 = (float)(float)op2->__anon1.i64;
2287 else if(op2->kind == 4)
2288 *value2 = (float)(float)op2->__anon1.ui64;
2289 else if(op2->kind == 23 && op2->type->isSigned)
2290 *value2 = (float)(float)op2->__anon1.i64;
2291 else if(op2->kind == 23)
2292 *value2 = (float)(float)op2->__anon1.ui64;
2293 else if(op2->kind == 22 && op2->type->isSigned)
2294 *value2 = (float)(float)op2->__anon1.i64;
2295 else if(op2->kind == 22)
2296 *value2 = (float)(float)op2->__anon1.ui64;
2297 else if(op2->kind == 2 && op2->type->isSigned)
2298 *value2 = (float)(float)op2->__anon1.s;
2299 else if(op2->kind == 2)
2300 *value2 = (float)(float)op2->__anon1.us;
2301 else if(op2->kind == 1 && op2->type->isSigned)
2302 *value2 = (float)(float)op2->__anon1.c;
2303 else if(op2->kind == 24 || op2->kind == 1)
2304 *value2 = (float)(float)op2->__anon1.uc;
2305 else if(op2->kind == 6)
2306 *value2 = (float)op2->__anon1.f;
2307 else if(op2->kind == 7)
2308 *value2 = (float)op2->__anon1.d;
2309 else if(op2->kind == 13)
2310 *value2 = (float)(float)op2->__anon1.ui64;
2311 else
2312 return 0x0;
2313 return 0x1;
2314 }
2315
2316 unsigned int GetFloat(struct Expression * exp, float * value2)
2317 {
2318 struct Operand op2 = GetOperand(exp);
2319
2320 return GetOpFloat(&op2, value2);
2321 }
2322
2323 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2324 {
2325 if(op2->kind == 3 && op2->type->isSigned)
2326 *value2 = (double)(double)op2->__anon1.i;
2327 else if(op2->kind == 3)
2328 *value2 = (double)(double)op2->__anon1.ui;
2329 else if(op2->kind == 4 && op2->type->isSigned)
2330 *value2 = (double)(double)op2->__anon1.i64;
2331 else if(op2->kind == 4)
2332 *value2 = (double)(double)op2->__anon1.ui64;
2333 else if(op2->kind == 23 && op2->type->isSigned)
2334 *value2 = (double)(double)op2->__anon1.i64;
2335 else if(op2->kind == 23)
2336 *value2 = (double)(double)op2->__anon1.ui64;
2337 else if(op2->kind == 22 && op2->type->isSigned)
2338 *value2 = (double)(double)op2->__anon1.i64;
2339 else if(op2->kind == 22)
2340 *value2 = (double)(double)op2->__anon1.ui64;
2341 else if(op2->kind == 2 && op2->type->isSigned)
2342 *value2 = (double)(double)op2->__anon1.s;
2343 else if(op2->kind == 2)
2344 *value2 = (double)(double)op2->__anon1.us;
2345 else if(op2->kind == 1 && op2->type->isSigned)
2346 *value2 = (double)(double)op2->__anon1.c;
2347 else if(op2->kind == 24 || op2->kind == 1)
2348 *value2 = (double)(double)op2->__anon1.uc;
2349 else if(op2->kind == 6)
2350 *value2 = (double)op2->__anon1.f;
2351 else if(op2->kind == 7)
2352 *value2 = (double)op2->__anon1.d;
2353 else if(op2->kind == 13)
2354 *value2 = (double)(double)op2->__anon1.ui64;
2355 else
2356 return 0x0;
2357 return 0x1;
2358 }
2359
2360 unsigned int GetDouble(struct Expression * exp, double * value2)
2361 {
2362 struct Operand op2 = GetOperand(exp);
2363
2364 return GetOpDouble(&op2, value2);
2365 }
2366
2367 void ComputeExpression(struct Expression * exp);
2368
2369 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2370
2371 extern int targetBits;
2372
2373 int ComputeTypeSize(struct Type * type);
2374
2375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2376
2377 struct __ecereNameSpace__ecere__com__BitMember
2378 {
2379 struct __ecereNameSpace__ecere__com__BitMember * prev;
2380 struct __ecereNameSpace__ecere__com__BitMember * next;
2381 const char *  name;
2382 unsigned int isProperty;
2383 int memberAccess;
2384 int id;
2385 struct __ecereNameSpace__ecere__com__Class * _class;
2386 const char *  dataTypeString;
2387 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2388 struct Type * dataType;
2389 int type;
2390 int size;
2391 int pos;
2392 uint64 mask;
2393 } __attribute__ ((gcc_struct));
2394
2395 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2396
2397 struct __ecereNameSpace__ecere__sys__OldLink
2398 {
2399 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2400 struct __ecereNameSpace__ecere__sys__OldLink * next;
2401 void *  data;
2402 } __attribute__ ((gcc_struct));
2403
2404 void FinishTemplatesContext(struct Context * context);
2405
2406 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2407 {
2408 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2409 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2410
2411 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))
2412 {
2413 int unionMemberOffset = 0;
2414 int bitFields = 0;
2415
2416 if(member)
2417 {
2418 member->memberOffset = 0;
2419 if(targetBits < sizeof(void *) * 8)
2420 member->structAlignment = 0;
2421 }
2422 else if(targetBits < sizeof(void *) * 8)
2423 _class->structAlignment = 0;
2424 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2425 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2426 if(!member && _class->destructionWatchOffset)
2427 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2428 {
2429 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2430
2431 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2432 {
2433 if(!dataMember->isProperty)
2434 {
2435 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2436 {
2437 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2438 }
2439 }
2440 }
2441 }
2442 {
2443 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2444
2445 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2446 {
2447 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2448 {
2449 if(!isMember && _class->type == 2 && dataMember->dataType)
2450 {
2451 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2452 uint64 mask = 0;
2453 int d;
2454
2455 ComputeTypeSize(dataMember->dataType);
2456 if(bitMember->pos == -1)
2457 bitMember->pos = _class->memberOffset;
2458 if(!bitMember->size)
2459 bitMember->size = dataMember->dataType->size * 8;
2460 _class->memberOffset = bitMember->pos + bitMember->size;
2461 for(d = 0; d < bitMember->size; d++)
2462 {
2463 if(d)
2464 mask <<= 1;
2465 mask |= 1;
2466 }
2467 bitMember->mask = mask << bitMember->pos;
2468 }
2469 else if(dataMember->type == 0 && dataMember->dataType)
2470 {
2471 int size;
2472 int alignment = 0;
2473
2474 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)))
2475 ComputeTypeSize(dataMember->dataType);
2476 if(dataMember->dataType->bitFieldCount)
2477 {
2478 bitFields += dataMember->dataType->bitFieldCount;
2479 size = 0;
2480 }
2481 else
2482 {
2483 if(bitFields)
2484 {
2485 int size = (bitFields + 7) / 8;
2486
2487 if(isMember)
2488 {
2489 int __simpleStruct0;
2490
2491 if(alignment)
2492 {
2493 int __simpleStruct0;
2494
2495 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2496 if(member->memberOffset % alignment)
2497 member->memberOffset += alignment - (member->memberOffset % alignment);
2498 }
2499 dataMember->offset = member->memberOffset;
2500 if(member->type == 1)
2501 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2502 else
2503 {
2504 member->memberOffset += size;
2505 }
2506 }
2507 else
2508 {
2509 if(alignment)
2510 {
2511 int __simpleStruct0;
2512
2513 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2514 if(_class->memberOffset % alignment)
2515 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2516 }
2517 dataMember->offset = _class->memberOffset;
2518 _class->memberOffset += size;
2519 }
2520 bitFields = 0;
2521 }
2522 size = dataMember->dataType->size;
2523 alignment = dataMember->dataType->alignment;
2524 }
2525 if(isMember)
2526 {
2527 int __simpleStruct0;
2528
2529 if(alignment)
2530 {
2531 int __simpleStruct0;
2532
2533 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2534 if(member->memberOffset % alignment)
2535 member->memberOffset += alignment - (member->memberOffset % alignment);
2536 }
2537 dataMember->offset = member->memberOffset;
2538 if(member->type == 1)
2539 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2540 else
2541 {
2542 member->memberOffset += size;
2543 }
2544 }
2545 else
2546 {
2547 if(alignment)
2548 {
2549 int __simpleStruct0;
2550
2551 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2552 if(_class->memberOffset % alignment)
2553 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2554 }
2555 dataMember->offset = _class->memberOffset;
2556 _class->memberOffset += size;
2557 }
2558 }
2559 else
2560 {
2561 int alignment;
2562
2563 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2564 alignment = dataMember->structAlignment;
2565 if(isMember)
2566 {
2567 int __simpleStruct0;
2568
2569 if(alignment)
2570 {
2571 int __simpleStruct0;
2572
2573 if(member->memberOffset % alignment)
2574 member->memberOffset += alignment - (member->memberOffset % alignment);
2575 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2576 }
2577 dataMember->offset = member->memberOffset;
2578 if(member->type == 1)
2579 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2580 else
2581 member->memberOffset += dataMember->memberOffset;
2582 }
2583 else
2584 {
2585 if(alignment)
2586 {
2587 int __simpleStruct0;
2588
2589 if(_class->memberOffset % alignment)
2590 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2591 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2592 }
2593 dataMember->offset = _class->memberOffset;
2594 _class->memberOffset += dataMember->memberOffset;
2595 }
2596 }
2597 }
2598 }
2599 if(bitFields)
2600 {
2601 int alignment = 0;
2602 int size = (bitFields + 7) / 8;
2603
2604 if(isMember)
2605 {
2606 int __simpleStruct0;
2607
2608 if(alignment)
2609 {
2610 int __simpleStruct0;
2611
2612 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2613 if(member->memberOffset % alignment)
2614 member->memberOffset += alignment - (member->memberOffset % alignment);
2615 }
2616 if(member->type == 1)
2617 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2618 else
2619 {
2620 member->memberOffset += size;
2621 }
2622 }
2623 else
2624 {
2625 if(alignment)
2626 {
2627 int __simpleStruct0;
2628
2629 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2630 if(_class->memberOffset % alignment)
2631 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2632 }
2633 _class->memberOffset += size;
2634 }
2635 bitFields = 0;
2636 }
2637 }
2638 if(member && member->type == 1)
2639 {
2640 member->memberOffset = unionMemberOffset;
2641 }
2642 if(!isMember)
2643 {
2644 if(_class->type != 2)
2645 {
2646 int extra = 0;
2647
2648 if(_class->structAlignment)
2649 {
2650 if(_class->memberOffset % _class->structAlignment)
2651 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2652 }
2653 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2654 if(!member)
2655 {
2656 struct __ecereNameSpace__ecere__com__Property * prop;
2657
2658 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2659 {
2660 if(prop->isProperty && prop->isWatchable)
2661 {
2662 prop->watcherOffset = _class->structSize;
2663 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2664 }
2665 }
2666 }
2667 {
2668 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2669
2670 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2671 {
2672 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2673
2674 if(deriv->computeSize)
2675 {
2676 deriv->offset = _class->structSize;
2677 deriv->memberOffset = 0;
2678 deriv->structSize = deriv->offset;
2679 ComputeClassMembers(deriv, 0x0);
2680 }
2681 }
2682 }
2683 }
2684 }
2685 }
2686 if(context)
2687 FinishTemplatesContext(context);
2688 }
2689
2690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2691
2692 struct __ecereNameSpace__ecere__com__NameSpace
2693 {
2694 const char *  name;
2695 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2696 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2697 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2698 int depth;
2699 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2700 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2701 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2702 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2703 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2704 } __attribute__ ((gcc_struct));
2705
2706 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2707
2708 struct __ecereNameSpace__ecere__com__Module
2709 {
2710 struct __ecereNameSpace__ecere__com__Instance * application;
2711 struct __ecereNameSpace__ecere__sys__OldList classes;
2712 struct __ecereNameSpace__ecere__sys__OldList defines;
2713 struct __ecereNameSpace__ecere__sys__OldList functions;
2714 struct __ecereNameSpace__ecere__sys__OldList modules;
2715 struct __ecereNameSpace__ecere__com__Instance * prev;
2716 struct __ecereNameSpace__ecere__com__Instance * next;
2717 const char *  name;
2718 void *  library;
2719 void *  Unload;
2720 int importType;
2721 int origImportType;
2722 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2723 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2724 } __attribute__ ((gcc_struct));
2725
2726 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2727 {
2728 struct __ecereNameSpace__ecere__com__Class * _class;
2729 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2730
2731 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2732 ComputeModuleClasses(subModule->data);
2733 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2734 ComputeClassMembers(_class, 0x0);
2735 }
2736
2737 extern unsigned int inCompiler;
2738
2739 extern void Compiler_Error(const char *  format, ...);
2740
2741 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2742
2743 int ComputeTypeSize(struct Type * type)
2744 {
2745 unsigned int size = type ? type->size : 0;
2746
2747 if(!size && type && !type->computing)
2748 {
2749 type->computing = 0x1;
2750 switch(type->kind)
2751 {
2752 case 24:
2753 type->alignment = size = sizeof(char);
2754 break;
2755 case 1:
2756 type->alignment = size = sizeof(char);
2757 break;
2758 case 3:
2759 type->alignment = size = sizeof(int);
2760 break;
2761 case 4:
2762 type->alignment = size = sizeof(long long);
2763 break;
2764 case 22:
2765 type->alignment = size = targetBits / 8;
2766 break;
2767 case 23:
2768 type->alignment = size = targetBits / 8;
2769 break;
2770 case 5:
2771 type->alignment = size = sizeof(long);
2772 break;
2773 case 2:
2774 type->alignment = size = sizeof(short);
2775 break;
2776 case 6:
2777 type->alignment = size = sizeof(float);
2778 break;
2779 case 7:
2780 type->alignment = size = sizeof(double);
2781 break;
2782 case 8:
2783 {
2784 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2785
2786 if(_class && _class->type == 1)
2787 {
2788 ComputeClassMembers(_class, 0x0);
2789 type->alignment = _class->structAlignment;
2790 size = _class->structSize;
2791 if(type->alignment && size % type->alignment)
2792 size += type->alignment - (size % type->alignment);
2793 }
2794 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2795 {
2796 if(!_class->dataType)
2797 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2798 size = type->alignment = ComputeTypeSize(_class->dataType);
2799 }
2800 else
2801 size = type->alignment = targetBits / 8;
2802 break;
2803 }
2804 case 13:
2805 case 19:
2806 size = type->alignment = targetBits / 8;
2807 break;
2808 case 12:
2809 if(type->__anon1.__anon4.arraySizeExp)
2810 {
2811 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2812 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2813 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)))
2814 {
2815 struct Location oldLoc = yylloc;
2816 char expression[10240];
2817
2818 expression[0] = '\0';
2819 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2820 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2821 if(inCompiler)
2822 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2824 yylloc = oldLoc;
2825 }
2826 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2827 }
2828 else if(type->__anon1.__anon4.enumClass)
2829 {
2830 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2831 {
2832 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2833 }
2834 else
2835 type->__anon1.__anon4.arraySize = 0;
2836 }
2837 else
2838 {
2839 type->__anon1.__anon4.arraySize = 0;
2840 }
2841 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2842 if(type->__anon1.type)
2843 type->alignment = type->__anon1.type->alignment;
2844 break;
2845 case 9:
2846 {
2847 struct Type * member;
2848
2849 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2850 {
2851 int __simpleStruct0, __simpleStruct1;
2852 unsigned int addSize = ComputeTypeSize(member);
2853
2854 member->offset = size;
2855 if(member->alignment && size % member->alignment)
2856 member->offset += member->alignment - (size % member->alignment);
2857 size = member->offset;
2858 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2859 size += addSize;
2860 }
2861 if(type->alignment && size % type->alignment)
2862 size += type->alignment - (size % type->alignment);
2863 break;
2864 }
2865 case 10:
2866 {
2867 struct Type * member;
2868
2869 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2870 {
2871 int __simpleStruct0, __simpleStruct1;
2872 unsigned int addSize = ComputeTypeSize(member);
2873
2874 member->offset = size;
2875 if(member->alignment && size % member->alignment)
2876 member->offset += member->alignment - (size % member->alignment);
2877 size = member->offset;
2878 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2879 size = ((size > addSize) ? size : addSize);
2880 }
2881 if(type->alignment && size % type->alignment)
2882 size += type->alignment - (size % type->alignment);
2883 break;
2884 }
2885 case 20:
2886 {
2887 struct TemplateParameter * param = type->__anon1.templateParameter;
2888 struct Type * baseType = ProcessTemplateParameterType(param);
2889
2890 if(baseType)
2891 {
2892 size = ComputeTypeSize(baseType);
2893 type->alignment = baseType->alignment;
2894 }
2895 else
2896 type->alignment = size = sizeof(uint64);
2897 break;
2898 }
2899 case 15:
2900 {
2901 type->alignment = size = sizeof(enum
2902 {
2903 test
2904 });
2905 break;
2906 }
2907 case 21:
2908 {
2909 type->alignment = size = targetBits / 8;
2910 break;
2911 }
2912 }
2913 type->size = size;
2914 type->computing = 0x0;
2915 }
2916 return size;
2917 }
2918
2919 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2920
2921 extern struct Identifier * MkIdentifier(const char *  string);
2922
2923 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2924
2925 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2926
2927 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2928
2929 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2930
2931 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2932
2933 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2934
2935 extern void FreeType(struct Type * type);
2936
2937 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2938
2939 extern struct Specifier * MkSpecifier(int specifier);
2940
2941 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2942
2943 extern struct Expression * MkExpConstant(const char *  string);
2944
2945 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)
2946 {
2947 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2948 unsigned int totalSize = 0;
2949 unsigned int maxSize = 0;
2950 int alignment;
2951 unsigned int size;
2952 struct __ecereNameSpace__ecere__com__DataMember * member;
2953 int anonID = 1;
2954 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2955
2956 if(addedPadding)
2957 *addedPadding = 0x0;
2958 if(!isMember && _class->base)
2959 {
2960 maxSize = _class->structSize;
2961 {
2962 if(_class->type == 1 || _class->type == 5)
2963 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2964 else
2965 {
2966 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2967
2968 if(maxSize > baseSize)
2969 maxSize -= baseSize;
2970 else
2971 maxSize = 0;
2972 }
2973 }
2974 }
2975 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2976 {
2977 if(!member->isProperty)
2978 {
2979 switch(member->type)
2980 {
2981 case 0:
2982 {
2983 if(member->dataTypeString)
2984 {
2985 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2986 struct Declarator * decl;
2987
2988 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2989 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2990 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2991 if(!member->dataType)
2992 member->dataType = ProcessType(specs, decl);
2993 ReplaceThisClassSpecifiers(specs, topClass);
2994 {
2995 struct Type * type = ProcessType(specs, decl);
2996
2997 DeclareType(member->dataType, 0x0, 0x0);
2998 FreeType(type);
2999 }
3000 ComputeTypeSize(member->dataType);
3001 size = member->dataType->size;
3002 alignment = member->dataType->alignment;
3003 if(alignment)
3004 {
3005 if(totalSize % alignment)
3006 totalSize += alignment - (totalSize % alignment);
3007 }
3008 totalSize += size;
3009 }
3010 break;
3011 }
3012 case 1:
3013 case 2:
3014 {
3015 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3016 char id[100];
3017
3018 sprintf(id, "__anon%d", anonID++);
3019 size = 0;
3020 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3021 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3022 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3023 alignment = member->structAlignment;
3024 if(alignment)
3025 {
3026 if(totalSize % alignment)
3027 totalSize += alignment - (totalSize % alignment);
3028 }
3029 totalSize += size;
3030 break;
3031 }
3032 }
3033 }
3034 }
3035 if(retSize)
3036 {
3037 unsigned int __simpleStruct0;
3038
3039 if(topMember && topMember->type == 1)
3040 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3041 else
3042 *retSize += totalSize;
3043 }
3044 else if(totalSize < maxSize && _class->type != 1000)
3045 {
3046 int autoPadding = 0;
3047
3048 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3049 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3050 if(totalSize + autoPadding < maxSize)
3051 {
3052 char sizeString[50];
3053
3054 sprintf(sizeString, "%d", maxSize - totalSize);
3055 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3056 if(addedPadding)
3057 *addedPadding = 0x1;
3058 }
3059 }
3060 if(context)
3061 FinishTemplatesContext(context);
3062 return topMember ? topMember->memberID : _class->memberID;
3063 }
3064
3065 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3066 {
3067 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3068 struct __ecereNameSpace__ecere__com__DataMember * member;
3069 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3070
3071 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3072 DeclareMembers(_class->base, 0x0);
3073 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3074 {
3075 if(!member->isProperty)
3076 {
3077 switch(member->type)
3078 {
3079 case 0:
3080 {
3081 if(!member->dataType && member->dataTypeString)
3082 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3083 if(member->dataType)
3084 DeclareType(member->dataType, 0x0, 0x0);
3085 break;
3086 }
3087 case 1:
3088 case 2:
3089 {
3090 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3091 break;
3092 }
3093 }
3094 }
3095 }
3096 if(context)
3097 FinishTemplatesContext(context);
3098 return topMember ? topMember->memberID : _class->memberID;
3099 }
3100
3101 extern struct Identifier * GetDeclId(struct Declarator * decl);
3102
3103 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3104 {
3105 struct ClassDef * def;
3106 int anonID = 1;
3107
3108 for(def = (*definitions).first; def; def = def->next)
3109 {
3110 if(def->type == 2)
3111 {
3112 struct Declaration * decl = def->__anon1.decl;
3113
3114 if(decl && decl->__anon1.__anon1.specifiers)
3115 {
3116 struct Specifier * spec;
3117 unsigned int isStruct = 0x0;
3118
3119 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3120 {
3121 if(spec->type == 3 || spec->type == 4)
3122 {
3123 if(spec->__anon1.__anon2.definitions)
3124 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3125 isStruct = 0x1;
3126 }
3127 }
3128 if(isStruct)
3129 {
3130 struct Declarator * d = (((void *)0));
3131
3132 if(decl->__anon1.__anon1.declarators)
3133 {
3134 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3135 {
3136 struct Identifier * idDecl = GetDeclId(d);
3137
3138 if(idDecl)
3139 break;
3140 }
3141 }
3142 if(!d)
3143 {
3144 char id[100];
3145
3146 sprintf(id, "__anon%d", anonID++);
3147 if(!decl->__anon1.__anon1.declarators)
3148 decl->__anon1.__anon1.declarators = MkList();
3149 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3150 }
3151 }
3152 }
3153 }
3154 }
3155 }
3156
3157 extern struct Symbol * FindClass(const char *  name);
3158
3159 extern char *  strchr(const char * , int);
3160
3161 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3162
3163 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3164
3165 extern void FreeClassDef(struct ClassDef * def);
3166
3167 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3168
3169 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3170
3171 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3172
3173 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3174
3175 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3176
3177 void DeclareStruct(const char * name, unsigned int skipNoHead)
3178 {
3179 struct External * external = (((void *)0));
3180 struct Symbol * classSym = FindClass(name);
3181
3182 if(!inCompiler || !classSym)
3183 return ;
3184 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3185 return ;
3186 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3187 {
3188 struct Declaration * decl;
3189 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3190 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3191 char structName[1024];
3192 struct Specifier * spec = (((void *)0));
3193
3194 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3195 classSym->declaring++;
3196 if(strchr(classSym->string, '<'))
3197 {
3198 if(classSym->__anon1.registered->templateClass)
3199 {
3200 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3201 classSym->declaring--;
3202 }
3203 return ;
3204 }
3205 DeclareMembers(classSym->__anon1.registered, 0x0);
3206 structName[0] = (char)0;
3207 FullClassNameCat(structName, name, 0x0);
3208 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3209 {
3210 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3211 {
3212 if(spec->type == 3 || spec->type == 4)
3213 break;
3214 }
3215 }
3216 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3217 {
3218 unsigned int addedPadding = 0x0;
3219
3220 classSym->declaredStructSym = 0x1;
3221 declarations = MkList();
3222 AddMembers(declarations, classSym->__anon1.registered, 0x0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3223 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3224 {
3225 FreeList(declarations, FreeClassDef);
3226 declarations = (((void *)0));
3227 }
3228 }
3229 if(skipNoHead || declarations)
3230 {
3231 if(spec)
3232 {
3233 if(declarations)
3234 spec->__anon1.__anon2.definitions = declarations;
3235 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3236 {
3237 if(classSym->__anon2.__anon1.structExternal)
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3240 classSym->id = curExternal->symbol->idCode;
3241 classSym->idCode = curExternal->symbol->idCode;
3242 }
3243 }
3244 else
3245 {
3246 if(!external)
3247 external = MkExternalDeclaration((((void *)0)));
3248 specifiers = MkList();
3249 declarators = MkList();
3250 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3251 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3252 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3253 decl->symbol->__anon2.__anon1.pointerExternal = external;
3254 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3255 {
3256 char className[1024];
3257
3258 strcpy(className, "__ecereClass_");
3259 FullClassNameCat(className, classSym->string, 0x1);
3260 DeclareClass(classSym, className);
3261 external->symbol = classSym;
3262 classSym->__anon2.__anon1.pointerExternal = external;
3263 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3264 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3265 }
3266 else
3267 {
3268 char className[1024];
3269
3270 strcpy(className, "__ecereClass_");
3271 FullClassNameCat(className, classSym->string, 0x1);
3272 classSym->__anon2.__anon1.structExternal = external;
3273 DeclareClass(classSym, className);
3274 external->symbol = classSym;
3275 }
3276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3277 }
3278 }
3279 classSym->declaring--;
3280 }
3281 else
3282 {
3283 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3284 {
3285 struct Specifier * spec;
3286
3287 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3288 {
3289 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3290 }
3291 }
3292 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3293 {
3294 classSym->declaring++;
3295 {
3296 if(classSym->__anon1.registered)
3297 DeclareMembers(classSym->__anon1.registered, 0x0);
3298 }
3299 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3300 {
3301 if(classSym->__anon2.__anon1.structExternal)
3302 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3304 classSym->id = curExternal->symbol->idCode;
3305 classSym->idCode = curExternal->symbol->idCode;
3306 }
3307 classSym->declaring--;
3308 }
3309 }
3310 }
3311
3312 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3313
3314 extern struct ModuleImport * mainModule;
3315
3316 extern struct Specifier * MkSpecifierName(const char *  name);
3317
3318 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3319
3320 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3321
3322 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3323
3324 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3325
3326 extern void FreeDeclarator(struct Declarator * decl);
3327
3328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3329
3330 struct PropertyImport
3331 {
3332 struct PropertyImport * prev;
3333 struct PropertyImport * next;
3334 char *  name;
3335 unsigned int isVirtual;
3336 unsigned int hasSet;
3337 unsigned int hasGet;
3338 } __attribute__ ((gcc_struct));
3339
3340 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3341
3342 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3343 {
3344 struct Symbol * symbol = prop->symbol;
3345
3346 strcpy(setName, "__ecereProp_");
3347 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3348 strcat(setName, "_Set_");
3349 FullClassNameCat(setName, prop->name, 0x1);
3350 strcpy(getName, "__ecereProp_");
3351 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3352 strcat(getName, "_Get_");
3353 FullClassNameCat(getName, prop->name, 0x1);
3354 if(prop->_class->type == 1)
3355 DeclareStruct(prop->_class->fullName, 0x0);
3356 if(!symbol || curExternal->symbol->idCode < symbol->id)
3357 {
3358 unsigned int imported = 0x0;
3359 unsigned int dllImport = 0x0;
3360
3361 if(!symbol || symbol->_import)
3362 {
3363 if(!symbol)
3364 {
3365 struct Symbol * classSym;
3366
3367 if(!prop->_class->symbol)
3368 prop->_class->symbol = FindClass(prop->_class->fullName);
3369 classSym = prop->_class->symbol;
3370 if(classSym && !classSym->_import)
3371 {
3372 struct ModuleImport * module;
3373
3374 if(prop->_class->module)
3375 module = FindModule(prop->_class->module);
3376 else
3377 module = mainModule;
3378 classSym->_import = __extension__ ({
3379 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3380
3381 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3382 });
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3384 }
3385 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3386 symbol->_import = (struct ClassImport *)__extension__ ({
3387 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3388
3389 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3390 });
3391 if(classSym)
3392 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3393 }
3394 imported = 0x1;
3395 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)
3396 dllImport = 0x1;
3397 }
3398 if(!symbol->type)
3399 {
3400 struct Context * context = SetupTemplatesContext(prop->_class);
3401
3402 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3403 FinishTemplatesContext(context);
3404 }
3405 if(prop->Get)
3406 {
3407 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3408 {
3409 struct Declaration * decl;
3410 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3411 struct Declarator * d;
3412 struct __ecereNameSpace__ecere__sys__OldList * params;
3413 struct Specifier * spec;
3414 struct External * external;
3415 struct Declarator * typeDecl;
3416 unsigned int simple = 0x0;
3417
3418 specifiers = MkList();
3419 declarators = MkList();
3420 params = MkList();
3421 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3422 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3423 if(dllImport)
3424 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3425 {
3426 struct Context * context = SetupTemplatesContext(prop->_class);
3427
3428 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3429 FinishTemplatesContext(context);
3430 }
3431 for(spec = (*specifiers).first; spec; spec = spec->next)
3432 {
3433 if(spec->type == 1)
3434 {
3435 if((!typeDecl || typeDecl->type == 1))
3436 {
3437 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3438
3439 symbol->_class = classSym->__anon1.registered;
3440 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3441 {
3442 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3443 simple = 0x1;
3444 }
3445 }
3446 }
3447 }
3448 if(!simple)
3449 d = PlugDeclarator(typeDecl, d);
3450 else
3451 {
3452 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3453 specifiers = MkList();
3454 }
3455 d = MkDeclaratorFunction(d, params);
3456 if(dllImport)
3457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3458 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3460 if(simple)
3461 ListAdd(specifiers, MkSpecifier(VOID));
3462 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3463 decl = MkDeclaration(specifiers, declarators);
3464 external = MkExternalDeclaration(decl);
3465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3466 external->symbol = symbol;
3467 symbol->__anon2.__anon2.externalGet = external;
3468 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3469 if(typeDecl)
3470 FreeDeclarator(typeDecl);
3471 }
3472 else
3473 {
3474 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3475 }
3476 }
3477 if(prop->Set)
3478 {
3479 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3480 {
3481 struct Declaration * decl;
3482 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3483 struct Declarator * d;
3484 struct __ecereNameSpace__ecere__sys__OldList * params;
3485 struct Specifier * spec;
3486 struct External * external;
3487 struct Declarator * typeDecl;
3488
3489 declarators = MkList();
3490 params = MkList();
3491 if(!prop->conversion || prop->_class->type == 1)
3492 {
3493 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3494 }
3495 specifiers = MkList();
3496 {
3497 struct Context * context = SetupTemplatesContext(prop->_class);
3498
3499 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3500 FinishTemplatesContext(context);
3501 }
3502 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3504 ListAdd(params, MkTypeName(specifiers, d));
3505 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3506 if(dllImport)
3507 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3508 d = MkDeclaratorFunction(d, params);
3509 for(spec = (*specifiers).first; spec; spec = spec->next)
3510 {
3511 if(spec->type == 1)
3512 {
3513 if((!typeDecl || typeDecl->type == 1))
3514 {
3515 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3516
3517 symbol->_class = classSym->__anon1.registered;
3518 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3519 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3520 }
3521 }
3522 }
3523 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3524 specifiers = MkList();
3525 if(dllImport)
3526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3527 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3529 if(!prop->conversion || prop->_class->type == 1)
3530 ListAdd(specifiers, MkSpecifier(VOID));
3531 else
3532 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3533 decl = MkDeclaration(specifiers, declarators);
3534 external = MkExternalDeclaration(decl);
3535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3536 external->symbol = symbol;
3537 symbol->__anon2.__anon2.externalSet = external;
3538 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3539 }
3540 else
3541 {
3542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3543 }
3544 }
3545 if(!symbol->__anon2.__anon2.externalPtr)
3546 {
3547 struct Declaration * decl;
3548 struct External * external;
3549 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3550 char propName[1024];
3551
3552 if(imported)
3553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3554 else
3555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3556 ListAdd(specifiers, MkSpecifierName("Property"));
3557 strcpy(propName, "__ecereProp_");
3558 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3559 strcat(propName, "_");
3560 FullClassNameCat(propName, prop->name, 0x1);
3561 {
3562 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3563
3564 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3565 if(!imported)
3566 {
3567 strcpy(propName, "__ecerePropM_");
3568 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3569 strcat(propName, "_");
3570 FullClassNameCat(propName, prop->name, 0x1);
3571 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3572 }
3573 decl = MkDeclaration(specifiers, list);
3574 }
3575 external = MkExternalDeclaration(decl);
3576 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3577 external->symbol = symbol;
3578 symbol->__anon2.__anon2.externalPtr = external;
3579 }
3580 else
3581 {
3582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3583 }
3584 symbol->id = curExternal->symbol->idCode;
3585 }
3586 }
3587
3588 struct Type * Dereference(struct Type * source)
3589 {
3590 struct Type * type = (((void *)0));
3591
3592 if(source)
3593 {
3594 if(source->kind == 13 || source->kind == 12)
3595 {
3596 type = source->__anon1.type;
3597 source->__anon1.type->refCount++;
3598 }
3599 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3600 {
3601 type = __extension__ ({
3602 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3603
3604 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3605 });
3606 }
3607 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3608 {
3609 type = source;
3610 source->refCount++;
3611 }
3612 else
3613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3614 }
3615 return type;
3616 }
3617
3618 static struct Type * Reference(struct Type * source)
3619 {
3620 struct Type * type = (((void *)0));
3621
3622 if(source)
3623 {
3624 type = __extension__ ({
3625 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3626
3627 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3628 });
3629 source->refCount++;
3630 }
3631 return type;
3632 }
3633
3634 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);
3635
3636 extern void *  memcpy(void * , const void * , size_t size);
3637
3638 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3639
3640 extern void FreeExpression(struct Expression * exp);
3641
3642 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3643
3644 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);
3645
3646 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3647
3648 extern struct Type * MkClassType(const char *  name);
3649
3650 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);
3651
3652 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)
3653 {
3654 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3655 unsigned int found = 0x0;
3656 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3657 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3658 unsigned int freeType = 0x0;
3659
3660 yylloc = member->loc;
3661 if(!ident)
3662 {
3663 if(curMember)
3664 {
3665 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3666 if(*curMember)
3667 {
3668 found = 0x1;
3669 dataMember = *curMember;
3670 }
3671 }
3672 }
3673 else
3674 {
3675 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3676 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3677 int _subMemberStackPos = 0;
3678
3679 if(!thisMember)
3680 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3681 if(thisMember)
3682 {
3683 dataMember = thisMember;
3684 if(curMember && thisMember->memberAccess == 1)
3685 {
3686 *curMember = thisMember;
3687 *curClass = thisMember->_class;
3688 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3689 *subMemberStackPos = _subMemberStackPos;
3690 }
3691 found = 0x1;
3692 }
3693 else
3694 {
3695 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3696 if(method && method->type == 1)
3697 found = 0x1;
3698 else
3699 method = (((void *)0));
3700 }
3701 }
3702 if(found)
3703 {
3704 struct Type * type = (((void *)0));
3705
3706 if(dataMember)
3707 {
3708 if(!dataMember->dataType && dataMember->dataTypeString)
3709 {
3710 struct Context * context = SetupTemplatesContext(_class);
3711
3712 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3713 FinishTemplatesContext(context);
3714 }
3715 type = dataMember->dataType;
3716 }
3717 else if(method)
3718 {
3719 if(!method->dataType)
3720 ProcessMethodType(method);
3721 type = method->dataType;
3722 }
3723 if(ident && ident->next)
3724 {
3725 for(ident = ident->next; ident && type; ident = ident->next)
3726 {
3727 if(type->kind == 8)
3728 {
3729 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3730 if(!dataMember)
3731 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3732 if(dataMember)
3733 type = dataMember->dataType;
3734 }
3735 else if(type->kind == 9 || type->kind == 10)
3736 {
3737 struct Type * memberType;
3738
3739 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3740 {
3741 if(!strcmp(memberType->name, ident->string))
3742 {
3743 type = memberType;
3744 break;
3745 }
3746 }
3747 }
3748 }
3749 }
3750 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3751 {
3752 int id = 0;
3753 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3754 struct __ecereNameSpace__ecere__com__Class * sClass;
3755
3756 for(sClass = _class; sClass; sClass = sClass->base)
3757 {
3758 id = 0;
3759 if(sClass->templateClass)
3760 sClass = sClass->templateClass;
3761 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3762 {
3763 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3764 {
3765 for(sClass = sClass->base; sClass; sClass = sClass->base)
3766 {
3767 if(sClass->templateClass)
3768 sClass = sClass->templateClass;
3769 id += sClass->templateParams.count;
3770 }
3771 break;
3772 }
3773 id++;
3774 }
3775 if(curParam)
3776 break;
3777 }
3778 if(curParam)
3779 {
3780 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3781
3782 if(arg.__anon1.__anon1.dataTypeString)
3783 {
3784 unsigned int constant = type->constant;
3785
3786 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
3787 if(type->kind == 8 && constant)
3788 type->constant = 0x1;
3789 else if(type->kind == 13)
3790 {
3791 struct Type * t = type->__anon1.type;
3792
3793 while(t->kind == 13)
3794 t = t->__anon1.type;
3795 if(constant)
3796 t->constant = constant;
3797 }
3798 freeType = 0x1;
3799 if(type && _class->templateClass)
3800 type->passAsTemplate = 0x1;
3801 if(type)
3802 {
3803 }
3804 }
3805 }
3806 }
3807 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3808 {
3809 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3810 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3811 int paramCount = 0;
3812 int lastParam = -1;
3813 char templateString[1024];
3814 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3815
3816 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3817 for(cClass = expClass; cClass; cClass = cClass->base)
3818 {
3819 int p = 0;
3820
3821 if(cClass->templateClass)
3822 cClass = cClass->templateClass;
3823 for(param = cClass->templateParams.first; param; param = param->next)
3824 {
3825 int id = p;
3826 struct __ecereNameSpace__ecere__com__Class * sClass;
3827 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3828
3829 for(sClass = cClass->base; sClass; sClass = sClass->base)
3830 {
3831 if(sClass->templateClass)
3832 sClass = sClass->templateClass;
3833 id += sClass->templateParams.count;
3834 }
3835 arg = expClass->templateArgs[id];
3836 for(sClass = _class; sClass; sClass = sClass->base)
3837 {
3838 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3839 int p = 0;
3840 struct __ecereNameSpace__ecere__com__Class * nextClass;
3841
3842 if(sClass->templateClass)
3843 sClass = sClass->templateClass;
3844 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3845 {
3846 if(nextClass->templateClass)
3847 nextClass = nextClass->templateClass;
3848 p += nextClass->templateParams.count;
3849 }
3850 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3851 {
3852 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3853 {
3854 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3855 {
3856 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3857 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3858 break;
3859 }
3860 }
3861 }
3862 }
3863 {
3864 char argument[256];
3865
3866 argument[0] = '\0';
3867 switch(param->type)
3868 {
3869 case 2:
3870 {
3871 char expString[1024];
3872 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3873 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3874 struct Expression * exp;
3875 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3876
3877 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3878 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3879 ProcessExpressionType(exp);
3880 ComputeExpression(exp);
3881 expString[0] = '\0';
3882 PrintExpression(exp, expString);
3883 strcat(argument, expString);
3884 FreeExpression(exp);
3885 break;
3886 }
3887 case 1:
3888 {
3889 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3890 break;
3891 }
3892 case 0:
3893 {
3894 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3895 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3896 break;
3897 }
3898 }
3899 if(argument[0])
3900 {
3901 if(paramCount)
3902 strcat(templateString, ", ");
3903 if(lastParam != p - 1)
3904 {
3905 strcat(templateString, param->name);
3906 strcat(templateString, " = ");
3907 }
3908 strcat(templateString, argument);
3909 paramCount++;
3910 lastParam = p;
3911 }
3912 p++;
3913 }
3914 }
3915 }
3916 {
3917 int len = strlen(templateString);
3918
3919 if(templateString[len - 1] == '<')
3920 len--;
3921 else
3922 {
3923 if(templateString[len - 1] == '>')
3924 templateString[len++] = ' ';
3925 templateString[len++] = '>';
3926 }
3927 templateString[len++] = '\0';
3928 }
3929 {
3930 struct Context * context = SetupTemplatesContext(_class);
3931
3932 if(freeType)
3933 FreeType(type);
3934 type = ProcessTypeString(templateString, 0x0);
3935 freeType = 0x1;
3936 FinishTemplatesContext(context);
3937 }
3938 }
3939 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3940 {
3941 ProcessExpressionType(member->initializer->__anon1.exp);
3942 if(!member->initializer->__anon1.exp->expType)
3943 {
3944 if(inCompiler)
3945 {
3946 char expString[10240];
3947
3948 expString[0] = '\0';
3949 PrintExpression(member->initializer->__anon1.exp, expString);
3950 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3951 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3952 }
3953 }
3954 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0, 0x1))
3955 {
3956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3957 }
3958 }
3959 else if(member->initializer)
3960 {
3961 ProcessInitializer(member->initializer, type);
3962 }
3963 if(freeType)
3964 FreeType(type);
3965 }
3966 else
3967 {
3968 if(_class && _class->type == 3)
3969 {
3970 if(member->initializer)
3971 {
3972 struct Type * type = MkClassType(_class->fullName);
3973
3974 ProcessInitializer(member->initializer, type);
3975 FreeType(type);
3976 }
3977 }
3978 else
3979 {
3980 if(member->initializer)
3981 {
3982 ProcessInitializer(member->initializer, (((void *)0)));
3983 }
3984 if(ident)
3985 {
3986 if(method)
3987 {
3988 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3989 }
3990 else if(_class)
3991 {
3992 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3993 if(inCompiler)
3994 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3995 }
3996 }
3997 else if(_class)
3998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3999 }
4000 }
4001 }
4002
4003 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);
4004
4005 extern void FreeSpecifier(struct Specifier * spec);
4006
4007 static void ProcessFunction(struct FunctionDefinition * function);
4008
4009 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4010
4011 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4012
4013 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4014
4015 extern void FreeClassFunction(struct ClassFunction * func);
4016
4017 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4018
4019 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4020
4021 void ProcessInstantiationType(struct Instantiation * inst)
4022 {
4023 yylloc = inst->loc;
4024 if(inst->_class)
4025 {
4026 struct MembersInit * members;
4027 struct Symbol * classSym;
4028 struct __ecereNameSpace__ecere__com__Class * _class;
4029
4030 classSym = inst->_class->__anon1.__anon1.symbol;
4031 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4032 if(!_class || _class->type != 5)
4033 DeclareStruct(inst->_class->__anon1.__anon1.name, 0x0);
4034 afterExternal = afterExternal ? afterExternal : curExternal;
4035 if(inst->exp)
4036 ProcessExpressionType(inst->exp);
4037 inst->isConstant = 0x1;
4038 if(inst->members)
4039 {
4040 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4041 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4042 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4043 int subMemberStackPos = 0;
4044
4045 for(members = (*inst->members).first; members; members = members->next)
4046 {
4047 switch(members->type)
4048 {
4049 case 1:
4050 {
4051 char name[1024];
4052 static unsigned int instMethodID = 0;
4053 struct External * external = curExternal;
4054 struct Context * context = curContext;
4055 struct Declarator * declarator = members->__anon1.function->declarator;
4056 struct Identifier * nameID = GetDeclId(declarator);
4057 char * unmangled = nameID ? nameID->string : (((void *)0));
4058 struct Expression * exp;
4059 struct External * createdExternal = (((void *)0));
4060
4061 if(inCompiler)
4062 {
4063 char number[16];
4064
4065 strcpy(name, "__ecereInstMeth_");
4066 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
4067 strcat(name, "_");
4068 strcat(name, nameID->string);
4069 strcat(name, "_");
4070 sprintf(number, "_%08d", instMethodID++);
4071 strcat(name, number);
4072 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4073 }
4074 if(declarator)
4075 {
4076 struct Symbol * symbol = declarator->symbol;
4077 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4078
4079 if(method && method->type == 1)
4080 {
4081 symbol->__anon1.method = method;
4082 ProcessMethodType(method);
4083 if(!symbol->type->__anon1.__anon2.thisClass)
4084 {
4085 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4086 {
4087 if(!currentClass->symbol)
4088 currentClass->symbol = FindClass(currentClass->fullName);
4089 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4090 }
4091 else
4092 {
4093 if(!_class->symbol)
4094 _class->symbol = FindClass(_class->fullName);
4095 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4096 }
4097 }
4098 DeclareType(symbol->type, 0x1, 0x1);
4099 }
4100 else if(classSym)
4101 {
4102 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4103 }
4104 }
4105 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 0x1);
4106 if(nameID)
4107 {
4108 FreeSpecifier(nameID->_class);
4109 nameID->_class = (((void *)0));
4110 }
4111 if(inCompiler)
4112 {
4113 struct External * oldExternal = curExternal;
4114
4115 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4116 {
4117 struct External * externalDecl;
4118
4119 externalDecl = MkExternalDeclaration((((void *)0)));
4120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4121 if(createdExternal->__anon1.function)
4122 {
4123 ProcessFunction(createdExternal->__anon1.function);
4124 {
4125 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4126
4127 externalDecl->__anon1.declaration = decl;
4128 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4129 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4130 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4131 }
4132 }
4133 }
4134 }
4135 else if(declarator)
4136 {
4137 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4138 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4139 }
4140 curExternal = external;
4141 curContext = context;
4142 if(inCompiler)
4143 {
4144 FreeClassFunction(members->__anon1.function);
4145 exp = QMkExpId(name);
4146 members->type = 0;
4147 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4148 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4149 }
4150 break;
4151 }
4152 case 0:
4153 {
4154 if(members->__anon1.dataMembers && classSym)
4155 {
4156 struct MemberInit * member;
4157 struct Location oldyyloc = yylloc;
4158
4159 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4160 {
4161 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4162 if(member->initializer && !member->initializer->isConstant)
4163 inst->isConstant = 0x0;
4164 }
4165 yylloc = oldyyloc;
4166 }
4167 break;
4168 }
4169 }
4170 }
4171 }
4172 }
4173 }
4174
4175 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4176 {
4177 if(inCompiler)
4178 {
4179 if(type->kind == 11)
4180 {
4181 struct Type * param;
4182
4183 if(declareParams)
4184 {
4185 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4186 DeclareType(param, declarePointers, 0x1);
4187 }
4188 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 0x1);
4189 }
4190 else if(type->kind == 13 && declarePointers)
4191 DeclareType(type->__anon1.type, declarePointers, 0x0);
4192 else if(type->kind == 8)
4193 {
4194 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4195 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4196 }
4197 else if(type->kind == 9 || type->kind == 10)
4198 {
4199 struct Type * member;
4200
4201 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4202 DeclareType(member, 0x0, 0x0);
4203 }
4204 else if(type->kind == 12)
4205 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0x0);
4206 }
4207 }
4208
4209 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4210
4211 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4212 {
4213 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4214 int id = 0;
4215 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4216 struct __ecereNameSpace__ecere__com__Class * sClass;
4217
4218 for(sClass = _class; sClass; sClass = sClass->base)
4219 {
4220 id = 0;
4221 if(sClass->templateClass)
4222 sClass = sClass->templateClass;
4223 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4224 {
4225 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4226 {
4227 for(sClass = sClass->base; sClass; sClass = sClass->base)
4228 {
4229 if(sClass->templateClass)
4230 sClass = sClass->templateClass;
4231 id += sClass->templateParams.count;
4232 }
4233 break;
4234 }
4235 id++;
4236 }
4237 if(curParam)
4238 break;
4239 }
4240 if(curParam)
4241 {
4242 arg = &_class->templateArgs[id];
4243 if(arg && param->type == 0)
4244 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4245 }
4246 return arg;
4247 }
4248
4249 extern struct Context * PushContext(void);
4250
4251 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4252
4253 struct TemplatedType
4254 {
4255 uintptr_t key;
4256 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4257 struct __ecereNameSpace__ecere__sys__BTNode * left;
4258 struct __ecereNameSpace__ecere__sys__BTNode * right;
4259 int depth;
4260 struct TemplateParameter * param;
4261 } __attribute__ ((gcc_struct));
4262
4263 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4264
4265 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4266 {
4267 struct Context * context = PushContext();
4268
4269 context->templateTypesOnly = 0x1;
4270 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4271 {
4272 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4273
4274 for(; param; param = param->next)
4275 {
4276 if(param->type == 0 && param->identifier)
4277 {
4278 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4279
4280 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4281 }
4282 }
4283 }
4284 else if(_class)
4285 {
4286 struct __ecereNameSpace__ecere__com__Class * sClass;
4287
4288 for(sClass = _class; sClass; sClass = sClass->base)
4289 {
4290 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4291
4292 for(p = sClass->templateParams.first; p; p = p->next)
4293 {
4294 if(p->type == 0)
4295 {
4296 struct TemplateParameter * param = p->param;
4297 struct TemplatedType * type;
4298
4299 if(!param)
4300 {
4301 p->param = param = __extension__ ({
4302 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4303
4304 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4305 });
4306 }
4307 type = __extension__ ({
4308 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4309
4310 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4311 });
4312 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4313 }
4314 }
4315 }
4316 }
4317 return context;
4318 }
4319
4320 extern void PopContext(struct Context * ctx);
4321
4322 extern void FreeContext(struct Context * context);
4323
4324 void FinishTemplatesContext(struct Context * context)
4325 {
4326 PopContext(context);
4327 FreeContext(context);
4328 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4329 }
4330
4331 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4332 {
4333 if(!method->dataType)
4334 {
4335 struct Context * context = SetupTemplatesContext(method->_class);
4336
4337 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4338 FinishTemplatesContext(context);
4339 if(method->type != 1 && method->dataType)
4340 {
4341 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4342 {
4343 if(!method->_class->symbol)
4344 method->_class->symbol = FindClass(method->_class->fullName);
4345 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4346 }
4347 }
4348 }
4349 }
4350
4351 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4352 {
4353 if(!prop->dataType)
4354 {
4355 struct Context * context = SetupTemplatesContext(prop->_class);
4356
4357 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4358 FinishTemplatesContext(context);
4359 }
4360 }
4361
4362 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4363
4364 extern void FreeTypeName(struct TypeName * typeName);
4365
4366 static void ProcessDeclarator(struct Declarator * decl);
4367
4368 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4369
4370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4371
4372 struct MethodImport
4373 {
4374 struct MethodImport * prev;
4375 struct MethodImport * next;
4376 char *  name;
4377 unsigned int isVirtual;
4378 } __attribute__ ((gcc_struct));
4379
4380 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4381
4382 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4383 {
4384 struct Symbol * symbol = method->symbol;
4385
4386 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4387 {
4388 unsigned int dllImport = 0x0;
4389
4390 if(!method->dataType)
4391 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4392 if(!symbol || symbol->_import || method->type == 1)
4393 {
4394 if(!symbol || method->type == 1)
4395 {
4396 struct Symbol * classSym;
4397
4398 if(!method->_class->symbol)
4399 method->_class->symbol = FindClass(method->_class->fullName);
4400 classSym = method->_class->symbol;
4401 if(!classSym->_import)
4402 {
4403 struct ModuleImport * module;
4404
4405 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4406 module = FindModule(method->_class->module);
4407 else
4408 module = mainModule;
4409 classSym->_import = __extension__ ({
4410 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4411
4412 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4413 });
4414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4415 }
4416 if(!symbol)
4417 {
4418 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4419 }
4420 if(!symbol->_import)
4421 {
4422 symbol->_import = (struct ClassImport *)__extension__ ({
4423 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4424
4425 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4426 });
4427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4428 }
4429 if(!symbol)
4430 {
4431 symbol->type = method->dataType;
4432 if(symbol->type)
4433 symbol->type->refCount++;
4434 }
4435 }
4436 if(!method->dataType->dllExport)
4437 {
4438 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)
4439 dllImport = 0x1;
4440 }
4441 }
4442 if(method->type != 1 && method->dataType)
4443 DeclareType(method->dataType, 0x1, 0x1);
4444 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4445 {
4446 struct Declaration * decl;
4447 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4448 struct Declarator * d;
4449 struct Declarator * funcDecl;
4450 struct External * external;
4451
4452 specifiers = MkList();
4453 declarators = MkList();
4454 if(dllImport)
4455 ListAdd(specifiers, MkSpecifier(EXTERN));
4456 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4457 ListAdd(specifiers, MkSpecifier(STATIC));
4458 if(method->type == 1)
4459 {
4460 ListAdd(specifiers, MkSpecifier(INT));
4461 d = MkDeclaratorIdentifier(MkIdentifier(name));
4462 }
4463 else
4464 {
4465 d = MkDeclaratorIdentifier(MkIdentifier(name));
4466 if(dllImport)
4467 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4468 {
4469 struct Context * context = SetupTemplatesContext(method->_class);
4470
4471 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4472 FinishTemplatesContext(context);
4473 }
4474 funcDecl = GetFuncDecl(d);
4475 if(dllImport)
4476 {
4477 struct Specifier * spec, * next;
4478
4479 for(spec = (*specifiers).first; spec; spec = next)
4480 {
4481 next = spec->next;
4482 if(spec->type == 5)
4483 {
4484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4485 FreeSpecifier(spec);
4486 }
4487 }
4488 }
4489 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4490 {
4491 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4492 {
4493 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4494 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")));
4495 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4496 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4497
4498 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4499 {
4500 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4501
4502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4503 FreeTypeName(param);
4504 }
4505 if(!funcDecl->__anon1.function.parameters)
4506 funcDecl->__anon1.function.parameters = MkList();
4507 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4508 }
4509 }
4510 }
4511 ProcessDeclarator(d);
4512 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4513 decl = MkDeclaration(specifiers, declarators);
4514 ReplaceThisClassSpecifiers(specifiers, method->_class);
4515 if(symbol->__anon2.__anon1.pointerExternal)
4516 {
4517 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4518
4519 {
4520 *functionSymbol = *symbol;
4521 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4522 if(functionSymbol->type)
4523 functionSymbol->type->refCount++;
4524 }
4525 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4526 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4527 }
4528 external = MkExternalDeclaration(decl);
4529 if(curExternal)
4530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4531 external->symbol = symbol;
4532 symbol->__anon2.__anon1.pointerExternal = external;
4533 }
4534 else if(ast)
4535 {
4536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4537 }
4538 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4539 }
4540 }
4541
4542 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4543 {
4544 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4545 {
4546 unsigned int first = 0x1;
4547 int p = 0;
4548 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4549 int lastParam = -1;
4550 char className[1024];
4551
4552 strcpy(className, _class->fullName);
4553 for(param = _class->templateParams.first; param; param = param->next)
4554 {
4555 {
4556 if(first)
4557 strcat(className, "<");
4558 if(!first)
4559 strcat(className, ", ");
4560 if(lastParam + 1 != p)
4561 {
4562 strcat(className, param->name);
4563 strcat(className, " = ");
4564 }
4565 strcat(className, param->name);
4566 first = 0x0;
4567 lastParam = p;
4568 }
4569 p++;
4570 }
4571 if(!first)
4572 {
4573 int len = strlen(className);
4574
4575 if(className[len - 1] == '>')
4576 className[len++] = ' ';
4577 className[len++] = '>';
4578 className[len++] = '\0';
4579 }
4580 return __ecereNameSpace__ecere__sys__CopyString(className);
4581 }
4582 else
4583 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4584 }
4585
4586 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4587 {
4588 struct Type * type;
4589
4590 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4591 {
4592 unsigned int first = 0x1;
4593 int p = 0;
4594 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4595 int lastParam = -1;
4596 char className[1024];
4597
4598 strcpy(className, _class->fullName);
4599 for(param = _class->templateParams.first; param; param = param->next)
4600 {
4601 {
4602 if(first)
4603 strcat(className, "<");
4604 if(!first)
4605 strcat(className, ", ");
4606 if(lastParam + 1 != p)
4607 {
4608 strcat(className, param->name);
4609 strcat(className, " = ");
4610 }
4611 strcat(className, param->name);
4612 first = 0x0;
4613 lastParam = p;
4614 }
4615 p++;
4616 }
4617 if(!first)
4618 {
4619 int len = strlen(className);
4620
4621 if(className[len - 1] == '>')
4622 className[len++] = ' ';
4623 className[len++] = '>';
4624 className[len++] = '\0';
4625 }
4626 type = MkClassType(className);
4627 }
4628 else
4629 {
4630 type = MkClassType(_class->fullName);
4631 }
4632 return type;
4633 }
4634
4635 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4636 {
4637 if(specs != (((void *)0)) && _class)
4638 {
4639 struct Specifier * spec;
4640
4641 for(spec = specs->first; spec; spec = spec->next)
4642 {
4643 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4644 {
4645 spec->type = 1;
4646 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4647 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4648 }
4649 }
4650 }
4651 }
4652
4653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4654
4655 struct __ecereNameSpace__ecere__com__GlobalFunction
4656 {
4657 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4658 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4659 const char *  name;
4660 int (*  function)();
4661 struct __ecereNameSpace__ecere__com__Instance * module;
4662 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4663 const char *  dataTypeString;
4664 struct Type * dataType;
4665 void *  symbol;
4666 } __attribute__ ((gcc_struct));
4667
4668 extern struct Context * globalContext;
4669
4670 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4671
4672 struct FunctionImport
4673 {
4674 struct FunctionImport * prev;
4675 struct FunctionImport * next;
4676 char *  name;
4677 } __attribute__ ((gcc_struct));
4678
4679 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4680 {
4681 struct Symbol * symbol = function->symbol;
4682
4683 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4684 {
4685 unsigned int imported = 0x0;
4686 unsigned int dllImport = 0x0;
4687
4688 if(!function->dataType)
4689 {
4690 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4691 if(!function->dataType->__anon1.__anon2.thisClass)
4692 function->dataType->__anon1.__anon2.staticMethod = 0x1;
4693 }
4694 if(inCompiler)
4695 {
4696 if(!symbol)
4697 {
4698 struct ModuleImport * module = FindModule(function->module);
4699
4700 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4701 if(module->name)
4702 {
4703 if(!function->dataType->dllExport)
4704 {
4705 symbol->_import = (struct ClassImport *)__extension__ ({
4706 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4707
4708 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4709 });
4710 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4711 }
4712 }
4713 {
4714 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4715 if(!symbol->type->__anon1.__anon2.thisClass)
4716 symbol->type->__anon1.__anon2.staticMethod = 0x1;
4717 }
4718 }
4719 imported = symbol->_import ? 0x1 : 0x0;
4720 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4721 dllImport = 0x1;
4722 }
4723 DeclareType(function->dataType, 0x1, 0x1);
4724 if(inCompiler)
4725 {
4726 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4727 {
4728 struct Declaration * decl;
4729 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4730 struct Declarator * d;
4731 struct Declarator * funcDecl;
4732 struct External * external;
4733
4734 specifiers = MkList();
4735 declarators = MkList();
4736 ListAdd(specifiers, MkSpecifier(EXTERN));
4737 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4738 if(dllImport)
4739 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4740 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4741 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4742 {
4743 struct Specifier * spec;
4744
4745 for(spec = (*specifiers).first; spec; spec = spec->next)
4746 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4747 {
4748 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4749 FreeSpecifier(spec);
4750 break;
4751 }
4752 }
4753 funcDecl = GetFuncDecl(d);
4754 if(funcDecl && !funcDecl->__anon1.function.parameters)
4755 {
4756 funcDecl->__anon1.function.parameters = MkList();
4757 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4758 }
4759 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4760 {
4761 struct Context * oldCtx = curContext;
4762
4763 curContext = globalContext;
4764 decl = MkDeclaration(specifiers, declarators);
4765 curContext = oldCtx;
4766 }
4767 if(symbol->__anon2.__anon1.pointerExternal)
4768 {
4769 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4770
4771 {
4772 *functionSymbol = *symbol;
4773 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4774 if(functionSymbol->type)
4775 functionSymbol->type->refCount++;
4776 }
4777 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4778 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4779 }
4780 external = MkExternalDeclaration(decl);
4781 if(curExternal)
4782 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4783 external->symbol = symbol;
4784 symbol->__anon2.__anon1.pointerExternal = external;
4785 }
4786 else
4787 {
4788 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4789 }
4790 if(curExternal)
4791 symbol->id = curExternal->symbol->idCode;
4792 }
4793 }
4794 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4795 }
4796
4797 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4798
4799 struct GlobalData
4800 {
4801 uintptr_t key;
4802 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4803 struct __ecereNameSpace__ecere__sys__BTNode * left;
4804 struct __ecereNameSpace__ecere__sys__BTNode * right;
4805 int depth;
4806 struct __ecereNameSpace__ecere__com__Instance * module;
4807 char *  dataTypeString;
4808 struct Type * dataType;
4809 void *  symbol;
4810 char *  fullName;
4811 } __attribute__ ((gcc_struct));
4812
4813 void DeclareGlobalData(struct GlobalData * data)
4814 {
4815 struct Symbol * symbol = data->symbol;
4816
4817 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4818 {
4819 if(inCompiler)
4820 {
4821 if(!symbol)
4822 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4823 }
4824 if(!data->dataType)
4825 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4826 DeclareType(data->dataType, 0x1, 0x1);
4827 if(inCompiler)
4828 {
4829 if(!symbol->__anon2.__anon1.pointerExternal)
4830 {
4831 struct Declaration * decl;
4832 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4833 struct Declarator * d;
4834 struct External * external;
4835
4836 specifiers = MkList();
4837 declarators = MkList();
4838 ListAdd(specifiers, MkSpecifier(EXTERN));
4839 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4840 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4841 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4842 decl = MkDeclaration(specifiers, declarators);
4843 external = MkExternalDeclaration(decl);
4844 if(curExternal)
4845 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4846 external->symbol = symbol;
4847 symbol->__anon2.__anon1.pointerExternal = external;
4848 }
4849 else
4850 {
4851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4852 }
4853 if(curExternal)
4854 symbol->id = curExternal->symbol->idCode;
4855 }
4856 }
4857 }
4858
4859 struct Conversion
4860 {
4861 struct Conversion * prev, * next;
4862 struct __ecereNameSpace__ecere__com__Property * convert;
4863 unsigned int isGet;
4864 struct Type * resultType;
4865 } __attribute__ ((gcc_struct));
4866
4867 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4868
4869 extern void Compiler_Warning(const char *  format, ...);
4870
4871 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4872 {
4873 unsigned int status = 0x1;
4874
4875 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))
4876 {
4877 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4878 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4879
4880 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4881 {
4882 struct Type * sourceType = source, * destType = dest;
4883
4884 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4885 sourceType = sourceType->__anon1.type;
4886 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4887 destType = destType->__anon1.type;
4888 if(!destType->constant && sourceType->constant)
4889 {
4890 status = 0x0;
4891 if(warn)
4892 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4893 }
4894 }
4895 }
4896 return status;
4897 }
4898
4899 extern void CopyTypeInto(struct Type * type, struct Type * src);
4900
4901 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4902
4903 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)
4904 {
4905 if(source && dest)
4906 {
4907 if(warnConst)
4908 CheckConstCompatibility(source, dest, 0x1);
4909 if(source->kind == 20 && dest->kind != 20)
4910 {
4911 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4912
4913 if(type)
4914 source = type;
4915 }
4916 if(dest->kind == 20 && source->kind != 20)
4917 {
4918 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4919
4920 if(type)
4921 dest = type;
4922 }
4923 if(dest->classObjectType == 2 && dest->kind != 11)
4924 {
4925 if(source->classObjectType != 3)
4926 return 0x1;
4927 else
4928 {
4929 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4930 {
4931 return 0x1;
4932 }
4933 }
4934 }
4935 else
4936 {
4937 if(source->kind != 11 && source->classObjectType == 3)
4938 return 0x1;
4939 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4940 return 0x1;
4941 }
4942 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4943 {
4944 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))
4945 return 0x1;
4946 }
4947 if(dest->kind == 14 && source->kind != 0)
4948 return 0x1;
4949 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))
4950 return 0x1;
4951 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))
4952 return 0x1;
4953 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4954 {
4955 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4956 {
4957 if(conversions != (((void *)0)))
4958 {
4959 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4960 return 0x1;
4961 }
4962 else
4963 {
4964 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4965
4966 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4967 ;
4968 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4969 ;
4970 if(sourceBase == destBase)
4971 return 0x1;
4972 }
4973 }
4974 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))
4975 return 0x1;
4976 else
4977 {
4978 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))
4979 {
4980 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4981 {
4982 return 0x1;
4983 }
4984 }
4985 }
4986 }
4987 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
4988 return 0x1;
4989 if(doConversion)
4990 {
4991 if(source->kind == 8)
4992 {
4993 struct __ecereNameSpace__ecere__com__Class * _class;
4994
4995 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
4996 {
4997 struct __ecereNameSpace__ecere__com__Property * convert;
4998
4999 for(convert = _class->conversions.first; convert; convert = convert->next)
5000 {
5001 if(convert->memberAccess == 1 || _class->module == privateModule)
5002 {
5003 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5004
5005 if(!convert->dataType)
5006 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5007 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")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1, warnConst))
5008 {
5009 if(!conversions && !convert->Get)
5010 return 0x1;
5011 else if(conversions != (((void *)0)))
5012 {
5013 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))
5014 return 0x1;
5015 else
5016 {
5017 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5018
5019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5020 return 0x1;
5021 }
5022 }
5023 }
5024 }
5025 }
5026 }
5027 }
5028 if(dest->kind == 8)
5029 {
5030 struct __ecereNameSpace__ecere__com__Class * _class;
5031
5032 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5033 {
5034 struct __ecereNameSpace__ecere__com__Property * convert;
5035
5036 for(convert = _class->conversions.first; convert; convert = convert->next)
5037 {
5038 if(convert->memberAccess == 1 || _class->module == privateModule)
5039 {
5040 struct Type * constType = (((void *)0));
5041 unsigned int success = 0x0;
5042
5043 if(!convert->dataType)
5044 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5045 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5046 {
5047 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5048
5049 constType = __extension__ ({
5050 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5051
5052 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5053 });
5054 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5055 ptrType->constant = 0x1;
5056 }
5057 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1, warnConst))
5058 {
5059 if(!conversions && !convert->Set)
5060 success = 0x1;
5061 else if(conversions != (((void *)0)))
5062 {
5063 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))
5064 success = 0x1;
5065 else
5066 {
5067 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5068
5069 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5070 success = 0x1;
5071 }
5072 }
5073 }
5074 if(constType)
5075 FreeType(constType);
5076 if(success)
5077 return 0x1;
5078 }
5079 }
5080 }
5081 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5082 {
5083 if(!dest->__anon1._class->__anon1.registered->dataType)
5084 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5085 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5086 {
5087 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0x0, 0x0, warnConst))
5088 {
5089 return 0x1;
5090 }
5091 }
5092 }
5093 }
5094 if(source->kind == 8)
5095 {
5096 struct __ecereNameSpace__ecere__com__Class * _class;
5097
5098 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5099 {
5100 struct __ecereNameSpace__ecere__com__Property * convert;
5101
5102 for(convert = _class->conversions.first; convert; convert = convert->next)
5103 {
5104 if(convert->memberAccess == 1 || _class->module == privateModule)
5105 {
5106 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5107
5108 if(!convert->dataType)
5109 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5110 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, 0x0, 0x1, warnConst))
5111 {
5112 if(!conversions && !convert->Get)
5113 return 0x1;
5114 else if(conversions != (((void *)0)))
5115 {
5116 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))
5117 return 0x1;
5118 else
5119 {
5120 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5121
5122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5123 return 0x1;
5124 }
5125 }
5126 }
5127 }
5128 }
5129 }
5130 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5131 {
5132 if(!source->__anon1._class->__anon1.registered->dataType)
5133 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5134 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5135 {
5136 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, 0x0, 0x0, warnConst))
5137 return 0x1;
5138 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, warnConst))
5139 return 0x1;
5140 }
5141 }
5142 }
5143 }
5144 if(source->kind == 8 || source->kind == 19)
5145 ;
5146 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5147 return 0x1;
5148 else if(dest->kind == 7 && source->kind == 6)
5149 return 0x1;
5150 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5151 return 0x1;
5152 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5153 return 0x1;
5154 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5155 return 0x1;
5156 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5157 return 0x1;
5158 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5159 return 0x1;
5160 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))
5161 return 0x1;
5162 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))
5163 return 0x1;
5164 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)))
5165 {
5166 struct Type * paramSource, * paramDest;
5167
5168 if(dest->kind == 16)
5169 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5170 if(source->kind == 16)
5171 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5172 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5173 dest = dest->__anon1.type;
5174 if(source->kind == 13 && source->__anon1.type->kind == 11)
5175 source = source->__anon1.type;
5176 if(dest->kind == 16)
5177 dest = dest->__anon1.__anon3.method->dataType;
5178 if(source->kind == 16)
5179 source = source->__anon1.__anon3.method->dataType;
5180 paramSource = source->__anon1.__anon2.params.first;
5181 if(paramSource && paramSource->kind == 0)
5182 paramSource = (((void *)0));
5183 paramDest = dest->__anon1.__anon2.params.first;
5184 if(paramDest && paramDest->kind == 0)
5185 paramDest = (((void *)0));
5186 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5187 {
5188 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))))
5189 {
5190 if(paramDest && paramDest->kind == 8)
5191 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5192 else
5193 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5194 return 0x0;
5195 }
5196 paramDest = paramDest->next;
5197 }
5198 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5199 {
5200 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5201 {
5202 if(dest->__anon1.__anon2.thisClass)
5203 {
5204 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5205 {
5206 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5207 return 0x0;
5208 }
5209 }
5210 else
5211 {
5212 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5213 {
5214 if(owningClassDest)
5215 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5216 else
5217 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5218 return 0x0;
5219 }
5220 }
5221 paramSource = paramSource->next;
5222 }
5223 else
5224 {
5225 if(dest->__anon1.__anon2.thisClass)
5226 {
5227 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5228 {
5229 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5230 return 0x0;
5231 }
5232 }
5233 else
5234 {
5235 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5236 {
5237 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5238 return 0x0;
5239 }
5240 }
5241 }
5242 }
5243 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5244 {
5245 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5246 return 0x0;
5247 }
5248 else
5249 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 0x1);
5250 for(; paramDest; paramDest = paramDest->next)
5251 {
5252 if(!paramSource)
5253 {
5254 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5255 return 0x0;
5256 }
5257 {
5258 struct Type * paramDestType = paramDest;
5259 struct Type * paramSourceType = paramSource;
5260 struct Type * type = paramDestType;
5261
5262 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5263 {
5264 int id = 0;
5265 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5266 struct __ecereNameSpace__ecere__com__Class * sClass;
5267
5268 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5269 {
5270 id = 0;
5271 if(sClass->templateClass)
5272 sClass = sClass->templateClass;
5273 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5274 {
5275 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5276 {
5277 for(sClass = sClass->base; sClass; sClass = sClass->base)
5278 {
5279 if(sClass->templateClass)
5280 sClass = sClass->templateClass;
5281 id += sClass->templateParams.count;
5282 }
5283 break;
5284 }
5285 id++;
5286 }
5287 if(curParam)
5288 break;
5289 }
5290 if(curParam)
5291 {
5292 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5293
5294 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
5295 }
5296 }
5297 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst)))
5298 {
5299 char type[1024];
5300
5301 type[0] = (char)0;
5302 PrintType(paramDest, type, 0x0, 0x1);
5303 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5304 if(paramDestType != paramDest)
5305 FreeType(paramDestType);
5306 return 0x0;
5307 }
5308 if(paramDestType != paramDest)
5309 FreeType(paramDestType);
5310 }
5311 paramSource = paramSource->next;
5312 }
5313 if(paramSource)
5314 {
5315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5316 return 0x0;
5317 }
5318 return 0x1;
5319 }
5320 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5321 {
5322 return 0x1;
5323 }
5324 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5325 {
5326 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5327 return 0x1;
5328 }
5329 }
5330 return 0x0;
5331 }
5332
5333 static void FreeConvert(struct Conversion * convert)
5334 {
5335 if(convert->resultType)
5336 FreeType(convert->resultType);
5337 }
5338
5339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5340
5341 struct __ecereNameSpace__ecere__com__BTNamedLink
5342 {
5343 const char *  name;
5344 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5345 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5346 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5347 int depth;
5348 void *  data;
5349 } __attribute__ ((gcc_struct));
5350
5351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5352
5353 struct __ecereNameSpace__ecere__com__EnumClassData
5354 {
5355 struct __ecereNameSpace__ecere__sys__OldList values;
5356 int largest;
5357 } __attribute__ ((gcc_struct));
5358
5359 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5360
5361 struct __ecereNameSpace__ecere__sys__NamedLink
5362 {
5363 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5364 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5365 char *  name;
5366 void *  data;
5367 } __attribute__ ((gcc_struct));
5368
5369 extern void FreeExpContents(struct Expression * exp);
5370
5371 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5372
5373 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5374
5375 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5376
5377 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5378
5379 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5380
5381 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5382 {
5383 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5384
5385 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)))
5386 {
5387 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5388
5389 if(_class->type == 4)
5390 {
5391 struct __ecereNameSpace__ecere__sys__OldList converts =
5392 {
5393 0, 0, 0, 0, 0
5394 };
5395 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5396
5397 type->kind = 8;
5398 if(!_class->symbol)
5399 _class->symbol = FindClass(_class->fullName);
5400 type->__anon1._class = _class->symbol;
5401 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0, 0x0))
5402 {
5403 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5404 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5405
5406 if(enumClass)
5407 {
5408 struct __ecereNameSpace__ecere__com__Class * baseClass;
5409
5410 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5411 {
5412 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5413
5414 for(value = e->values.first; value; value = value->next)
5415 {
5416 if(!strcmp(value->name, string))
5417 break;
5418 }
5419 if(value)
5420 {
5421 FreeExpContents(sourceExp);
5422 FreeType(sourceExp->expType);
5423 sourceExp->isConstant = 0x1;
5424 sourceExp->expType = MkClassType(baseClass->fullName);
5425 {
5426 char constant[256];
5427
5428 sourceExp->type = 2;
5429 if(!strcmp(baseClass->dataTypeString, "int"))
5430 sprintf(constant, "%d", (int)value->data);
5431 else
5432 sprintf(constant, "0x%X", (int)value->data);
5433 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5434 }
5435 while(converts.first)
5436 {
5437 struct Conversion * convert = converts.first;
5438
5439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5441 }
5442 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5443 return 0x1;
5444 }
5445 }
5446 }
5447 }
5448 if(converts.first)
5449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5450 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5451 }
5452 }
5453 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)))
5454 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5455 return 0x1;
5456 return 0x0;
5457 }
5458
5459 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5460
5461 struct __ecereNameSpace__ecere__com__SubModule
5462 {
5463 struct __ecereNameSpace__ecere__com__SubModule * prev;
5464 struct __ecereNameSpace__ecere__com__SubModule * next;
5465 struct __ecereNameSpace__ecere__com__Instance * module;
5466 int importMode;
5467 } __attribute__ ((gcc_struct));
5468
5469 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5470 {
5471 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5472
5473 if(searchFor == searchIn)
5474 return 0x1;
5475 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5476 {
5477 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5478 {
5479 if(ModuleVisibility(subModule->module, searchFor))
5480 return 0x1;
5481 }
5482 }
5483 return 0x0;
5484 }
5485
5486 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5487
5488 struct __ecereNameSpace__ecere__com__Application
5489 {
5490 int argc;
5491 const char * *  argv;
5492 int exitCode;
5493 unsigned int isGUIApp;
5494 struct __ecereNameSpace__ecere__sys__OldList allModules;
5495 char *  parsedCommand;
5496 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5497 } __attribute__ ((gcc_struct));
5498
5499 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5500 {
5501 struct __ecereNameSpace__ecere__com__Instance * module;
5502
5503 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))
5504 return 0x1;
5505 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))
5506 return 0x1;
5507 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))
5508 return 0x1;
5509 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)
5510 {
5511 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5512 return 0x1;
5513 }
5514 return 0x0;
5515 }
5516
5517 extern struct Expression * CopyExpression(struct Expression * exp);
5518
5519 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5520
5521 void ReadString(char *  output, char *  string);
5522
5523 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5524
5525 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5526
5527 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5528
5529 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5530 {
5531 struct Type * source;
5532 struct Type * realDest = dest;
5533 struct Type * backupSourceExpType = (((void *)0));
5534 struct Expression * computedExp = sourceExp;
5535
5536 dest->refCount++;
5537 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)
5538 {
5539 computedExp = CopyExpression(sourceExp);
5540 ComputeExpression(computedExp);
5541 }
5542 source = sourceExp->expType;
5543 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5544 {
5545 if(computedExp != sourceExp)
5546 {
5547 FreeExpression(computedExp);
5548 computedExp = sourceExp;
5549 }
5550 FreeType(dest);
5551 return 0x1;
5552 }
5553 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5554 {
5555 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5556 {
5557 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5558
5559 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5560 ;
5561 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5562 ;
5563 if(sourceBase == destBase)
5564 {
5565 if(computedExp != sourceExp)
5566 {
5567 FreeExpression(computedExp);
5568 computedExp = sourceExp;
5569 }
5570 FreeType(dest);
5571 return 0x1;
5572 }
5573 }
5574 }
5575 if(source)
5576 {
5577 struct __ecereNameSpace__ecere__sys__OldList * specs;
5578 unsigned int flag = 0x0;
5579 long long value = (((int)0x7fffffff));
5580
5581 source->refCount++;
5582 if(computedExp->type == 2)
5583 {
5584 if(source->isSigned)
5585 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5586 else
5587 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5588 }
5589 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5590 {
5591 if(source->isSigned)
5592 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5593 else
5594 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5595 }
5596 if(computedExp != sourceExp)
5597 {
5598 FreeExpression(computedExp);
5599 computedExp = sourceExp;
5600 }
5601 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"))
5602 {
5603 FreeType(source);
5604 source = __extension__ ({
5605 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5606
5607 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5608 });
5609 }
5610 if(dest->kind == 8)
5611 {
5612 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5613
5614 if(_class && _class->type == 3)
5615 {
5616 if(source->kind != 8)
5617 {
5618 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5619 struct Type * tempDest, * tempSource;
5620
5621 for(; _class->base->type != 1000; _class = _class->base)
5622 ;
5623 tempSource = dest;
5624 tempDest = tempType;
5625 tempType->kind = 8;
5626 if(!_class->symbol)
5627 _class->symbol = FindClass(_class->fullName);
5628 tempType->__anon1._class = _class->symbol;
5629 tempType->truth = dest->truth;
5630 if(tempType->__anon1._class)
5631 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5632 backupSourceExpType = sourceExp->expType;
5633 sourceExp->expType = dest;
5634 dest->refCount++;
5635 flag = 0x1;
5636 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5637 }
5638 }
5639 if(_class && _class->type == 2 && source->kind != 8)
5640 {
5641 if(!dest->__anon1._class->__anon1.registered->dataType)
5642 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5643 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5644 {
5645 FreeType(source);
5646 FreeType(sourceExp->expType);
5647 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5648 source->refCount++;
5649 }
5650 }
5651 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5652 {
5653 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5654 struct Declarator * decl;
5655 char string[1024];
5656
5657 ReadString(string, sourceExp->__anon1.__anon2.string);
5658 decl = SpecDeclFromString(string, specs, (((void *)0)));
5659 FreeExpContents(sourceExp);
5660 FreeType(sourceExp->expType);
5661 sourceExp->type = 24;
5662 sourceExp->__anon1._classExp.specifiers = specs;
5663 sourceExp->__anon1._classExp.decl = decl;
5664 sourceExp->expType = dest;
5665 dest->refCount++;
5666 FreeType(source);
5667 FreeType(dest);
5668 if(backupSourceExpType)
5669 FreeType(backupSourceExpType);
5670 return 0x1;
5671 }
5672 }
5673 else if(source->kind == 8)
5674 {
5675 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5676
5677 if(_class && (_class->type == 3 || _class->type == 2))
5678 {
5679 if(dest->kind != 8)
5680 {
5681 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5682 struct Type * tempDest, * tempSource;
5683
5684 if(!source->__anon1._class->__anon1.registered->dataType)
5685 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5686 for(; _class->base->type != 1000; _class = _class->base)
5687 ;
5688 tempDest = source;
5689 tempSource = tempType;
5690 tempType->kind = 8;
5691 tempType->__anon1._class = FindClass(_class->fullName);
5692 tempType->truth = source->truth;
5693 tempType->classObjectType = source->classObjectType;
5694 if(tempType->__anon1._class)
5695 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5696 if(conversions->last)
5697 {
5698 ((struct Conversion *)conversions->last)->resultType = dest;
5699 dest->refCount++;
5700 }
5701 FreeType(sourceExp->expType);
5702 sourceExp->expType = MkClassType(_class->fullName);
5703 sourceExp->expType->truth = source->truth;
5704 sourceExp->expType->classObjectType = source->classObjectType;
5705 if(!sourceExp->destType)
5706 {
5707 FreeType(sourceExp->destType);
5708 sourceExp->destType = sourceExp->expType;
5709 if(sourceExp->expType)
5710 sourceExp->expType->refCount++;
5711 }
5712 if(!_class->dataType)
5713 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5714 FreeType(dest);
5715 dest = MkClassType(source->__anon1._class->string);
5716 dest->truth = source->truth;
5717 dest->classObjectType = source->classObjectType;
5718 FreeType(source);
5719 source = _class->dataType;
5720 source->refCount++;
5721 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5722 }
5723 }
5724 }
5725 if(!flag)
5726 {
5727 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5728 {
5729 FreeType(source);
5730 FreeType(dest);
5731 return 0x1;
5732 }
5733 }
5734 if(dest->kind == 8)
5735 {
5736 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5737 unsigned int fittingValue = 0x0;
5738
5739 if(_class && _class->type == 4)
5740 {
5741 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5742 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5743
5744 if(c && value >= 0 && value <= c->largest)
5745 fittingValue = 0x1;
5746 }
5747 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5748 {
5749 if(_class->type == 0 || _class->type == 5)
5750 {
5751 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5752
5753 *newExp = *sourceExp;
5754 if(sourceExp->destType)
5755 sourceExp->destType->refCount++;
5756 if(sourceExp->expType)
5757 sourceExp->expType->refCount++;
5758 sourceExp->type = 11;
5759 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5760 sourceExp->__anon1.cast.exp = newExp;
5761 FreeType(sourceExp->expType);
5762 sourceExp->expType = (((void *)0));
5763 ProcessExpressionType(sourceExp);
5764 if(!inCompiler)
5765 {
5766 FreeType(sourceExp->expType);
5767 sourceExp->expType = dest;
5768 }
5769 FreeType(source);
5770 if(inCompiler)
5771 FreeType(dest);
5772 if(backupSourceExpType)
5773 FreeType(backupSourceExpType);
5774 return 0x1;
5775 }
5776 if(!_class->dataType)
5777 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5778 FreeType(dest);
5779 dest = _class->dataType;
5780 dest->refCount++;
5781 }
5782 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))
5783 {
5784 specs = MkListOne(MkSpecifier(DOUBLE));
5785 }
5786 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))
5787 {
5788 specs = MkListOne(MkSpecifier(FLOAT));
5789 }
5790 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))
5791 {
5792 specs = MkList();
5793 if(!dest->isSigned)
5794 ListAdd(specs, MkSpecifier(UNSIGNED));
5795 ListAdd(specs, MkSpecifier(INT64));
5796 }
5797 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5798 {
5799 specs = MkList();
5800 if(!dest->isSigned)
5801 ListAdd(specs, MkSpecifier(UNSIGNED));
5802 ListAdd(specs, MkSpecifier(INT));
5803 }
5804 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5805 {
5806 specs = MkList();
5807 if(!dest->isSigned)
5808 ListAdd(specs, MkSpecifier(UNSIGNED));
5809 ListAdd(specs, MkSpecifier(SHORT));
5810 }
5811 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5812 {
5813 specs = MkList();
5814 if(!dest->isSigned)
5815 ListAdd(specs, MkSpecifier(UNSIGNED));
5816 ListAdd(specs, MkSpecifier(CHAR));
5817 }
5818 else
5819 {
5820 FreeType(source);
5821 FreeType(dest);
5822 if(backupSourceExpType)
5823 {
5824 if(sourceExp->expType)
5825 FreeType(sourceExp->expType);
5826 sourceExp->expType = backupSourceExpType;
5827 }
5828 return 0x0;
5829 }
5830 }
5831 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))
5832 {
5833 specs = MkListOne(MkSpecifier(DOUBLE));
5834 }
5835 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))
5836 {
5837 specs = MkListOne(MkSpecifier(FLOAT));
5838 }
5839 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5840 {
5841 specs = MkList();
5842 ListAdd(specs, MkSpecifier(BOOL));
5843 }
5844 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)))
5845 {
5846 specs = MkList();
5847 if(!dest->isSigned)
5848 ListAdd(specs, MkSpecifier(UNSIGNED));
5849 ListAdd(specs, MkSpecifier(CHAR));
5850 }
5851 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)))))
5852 {
5853 specs = MkList();
5854 if(!dest->isSigned)
5855 ListAdd(specs, MkSpecifier(UNSIGNED));
5856 ListAdd(specs, MkSpecifier(SHORT));
5857 }
5858 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5859 {
5860 specs = MkList();
5861 if(!dest->isSigned)
5862 ListAdd(specs, MkSpecifier(UNSIGNED));
5863 ListAdd(specs, MkSpecifier(INT));
5864 }
5865 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5866 {
5867 specs = MkList();
5868 if(!dest->isSigned)
5869 ListAdd(specs, MkSpecifier(UNSIGNED));
5870 ListAdd(specs, MkSpecifier(INT64));
5871 }
5872 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5873 {
5874 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5875 }
5876 else
5877 {
5878 FreeType(source);
5879 FreeType(dest);
5880 if(backupSourceExpType)
5881 {
5882 if(sourceExp->expType)
5883 FreeType(sourceExp->expType);
5884 sourceExp->expType = backupSourceExpType;
5885 }
5886 return 0x0;
5887 }
5888 if(!flag && !sourceExp->opDestType)
5889 {
5890 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5891
5892 *newExp = *sourceExp;
5893 newExp->prev = (((void *)0));
5894 newExp->next = (((void *)0));
5895 if(sourceExp->destType)
5896 sourceExp->destType->refCount++;
5897 if(sourceExp->expType)
5898 sourceExp->expType->refCount++;
5899 sourceExp->type = 11;
5900 if(realDest->kind == 8)
5901 {
5902 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5903 FreeList(specs, FreeSpecifier);
5904 }
5905 else
5906 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5907 if(newExp->type == 4)
5908 {
5909 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5910 }
5911 else
5912 sourceExp->__anon1.cast.exp = newExp;
5913 FreeType(sourceExp->expType);
5914 sourceExp->expType = (((void *)0));
5915 ProcessExpressionType(sourceExp);
5916 }
5917 else
5918 FreeList(specs, FreeSpecifier);
5919 FreeType(dest);
5920 FreeType(source);
5921 if(backupSourceExpType)
5922 FreeType(backupSourceExpType);
5923 return 0x1;
5924 }
5925 else
5926 {
5927 if(computedExp != sourceExp)
5928 {
5929 FreeExpression(computedExp);
5930 computedExp = sourceExp;
5931 }
5932 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5933 sourceExp = (*sourceExp->__anon1.list).last;
5934 if(sourceExp->type == 0)
5935 {
5936 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5937
5938 if(dest->kind == 8)
5939 {
5940 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5941 {
5942 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5943 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5944
5945 if(enumClass)
5946 {
5947 for(; _class && _class->type == 4; _class = _class->base)
5948 {
5949 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5950 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5951
5952 for(value = e->values.first; value; value = value->next)
5953 {
5954 if(!strcmp(value->name, id->string))
5955 break;
5956 }
5957 if(value)
5958 {
5959 FreeExpContents(sourceExp);
5960 FreeType(sourceExp->expType);
5961 sourceExp->isConstant = 0x1;
5962 sourceExp->expType = MkClassType(_class->fullName);
5963 {
5964 char constant[256];
5965
5966 sourceExp->type = 2;
5967 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5968 sprintf(constant, "%d", (int)value->data);
5969 else
5970 sprintf(constant, "0x%X", (int)value->data);
5971 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5972 }
5973 FreeType(dest);
5974 return 0x1;
5975 }
5976 }
5977 }
5978 }
5979 }
5980 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5981 {
5982 FreeType(dest);
5983 return 0x1;
5984 }
5985 }
5986 FreeType(dest);
5987 }
5988 return 0x0;
5989 }
5990
5991 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5992 {
5993 int value2 = op2->__anon1.i;
5994
5995 exp->type = 2;
5996 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
5997 if(!exp->expType)
5998 {
5999 exp->expType = op1->type;
6000 if(op1->type)
6001 op1->type->refCount++;
6002 }
6003 return 0x1;
6004 }
6005
6006 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6007 {
6008 unsigned int value2 = op2->__anon1.ui;
6009
6010 exp->type = 2;
6011 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6012 if(!exp->expType)
6013 {
6014 exp->expType = op1->type;
6015 if(op1->type)
6016 op1->type->refCount++;
6017 }
6018 return 0x1;
6019 }
6020
6021 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6022 {
6023 long long value2 = op2->__anon1.i64;
6024
6025 exp->type = 2;
6026 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6027 if(!exp->expType)
6028 {
6029 exp->expType = op1->type;
6030 if(op1->type)
6031 op1->type->refCount++;
6032 }
6033 return 0x1;
6034 }
6035
6036 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6037 {
6038 uint64 value2 = op2->__anon1.ui64;
6039
6040 exp->type = 2;
6041 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6042 if(!exp->expType)
6043 {
6044 exp->expType = op1->type;
6045 if(op1->type)
6046 op1->type->refCount++;
6047 }
6048 return 0x1;
6049 }
6050
6051 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6052 {
6053 short value2 = op2->__anon1.s;
6054
6055 exp->type = 2;
6056 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6057 if(!exp->expType)
6058 {
6059 exp->expType = op1->type;
6060 if(op1->type)
6061 op1->type->refCount++;
6062 }
6063 return 0x1;
6064 }
6065
6066 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6067 {
6068 unsigned short value2 = op2->__anon1.us;
6069
6070 exp->type = 2;
6071 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6072 if(!exp->expType)
6073 {
6074 exp->expType = op1->type;
6075 if(op1->type)
6076 op1->type->refCount++;
6077 }
6078 return 0x1;
6079 }
6080
6081 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6082 {
6083 char value2 = op2->__anon1.c;
6084
6085 exp->type = 2;
6086 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6087 if(!exp->expType)
6088 {
6089 exp->expType = op1->type;
6090 if(op1->type)
6091 op1->type->refCount++;
6092 }
6093 return 0x1;
6094 }
6095
6096 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6097 {
6098 unsigned char value2 = op2->__anon1.uc;
6099
6100 exp->type = 2;
6101 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6102 if(!exp->expType)
6103 {
6104 exp->expType = op1->type;
6105 if(op1->type)
6106 op1->type->refCount++;
6107 }
6108 return 0x1;
6109 }
6110
6111 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6112 {
6113 float value2 = op2->__anon1.f;
6114
6115 exp->type = 2;
6116 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6117 if(!exp->expType)
6118 {
6119 exp->expType = op1->type;
6120 if(op1->type)
6121 op1->type->refCount++;
6122 }
6123 return 0x1;
6124 }
6125
6126 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6127 {
6128 double value2 = op2->__anon1.d;
6129
6130 exp->type = 2;
6131 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6132 if(!exp->expType)
6133 {
6134 exp->expType = op1->type;
6135 if(op1->type)
6136 op1->type->refCount++;
6137 }
6138 return 0x1;
6139 }
6140
6141 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6142 {
6143 int value2 = op2->__anon1.i;
6144
6145 exp->type = 2;
6146 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6147 if(!exp->expType)
6148 {
6149 exp->expType = op1->type;
6150 if(op1->type)
6151 op1->type->refCount++;
6152 }
6153 return 0x1;
6154 }
6155
6156 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6157 {
6158 unsigned int value2 = op2->__anon1.ui;
6159
6160 exp->type = 2;
6161 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6162 if(!exp->expType)
6163 {
6164 exp->expType = op1->type;
6165 if(op1->type)
6166 op1->type->refCount++;
6167 }
6168 return 0x1;
6169 }
6170
6171 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6172 {
6173 long long value2 = op2->__anon1.i64;
6174
6175 exp->type = 2;
6176 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6177 if(!exp->expType)
6178 {
6179 exp->expType = op1->type;
6180 if(op1->type)
6181 op1->type->refCount++;
6182 }
6183 return 0x1;
6184 }
6185
6186 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6187 {
6188 uint64 value2 = op2->__anon1.ui64;
6189
6190 exp->type = 2;
6191 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6192 if(!exp->expType)
6193 {
6194 exp->expType = op1->type;
6195 if(op1->type)
6196 op1->type->refCount++;
6197 }
6198 return 0x1;
6199 }
6200
6201 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6202 {
6203 short value2 = op2->__anon1.s;
6204
6205 exp->type = 2;
6206 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6207 if(!exp->expType)
6208 {
6209 exp->expType = op1->type;
6210 if(op1->type)
6211 op1->type->refCount++;
6212 }
6213 return 0x1;
6214 }
6215
6216 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6217 {
6218 unsigned short value2 = op2->__anon1.us;
6219
6220 exp->type = 2;
6221 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6222 if(!exp->expType)
6223 {
6224 exp->expType = op1->type;
6225 if(op1->type)
6226 op1->type->refCount++;
6227 }
6228 return 0x1;
6229 }
6230
6231 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6232 {
6233 char value2 = op2->__anon1.c;
6234
6235 exp->type = 2;
6236 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6237 if(!exp->expType)
6238 {
6239 exp->expType = op1->type;
6240 if(op1->type)
6241 op1->type->refCount++;
6242 }
6243 return 0x1;
6244 }
6245
6246 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6247 {
6248 unsigned char value2 = op2->__anon1.uc;
6249
6250 exp->type = 2;
6251 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6252 if(!exp->expType)
6253 {
6254 exp->expType = op1->type;
6255 if(op1->type)
6256 op1->type->refCount++;
6257 }
6258 return 0x1;
6259 }
6260
6261 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6262 {
6263 float value2 = op2->__anon1.f;
6264
6265 exp->type = 2;
6266 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6267 if(!exp->expType)
6268 {
6269 exp->expType = op1->type;
6270 if(op1->type)
6271 op1->type->refCount++;
6272 }
6273 return 0x1;
6274 }
6275
6276 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6277 {
6278 double value2 = op2->__anon1.d;
6279
6280 exp->type = 2;
6281 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6282 if(!exp->expType)
6283 {
6284 exp->expType = op1->type;
6285 if(op1->type)
6286 op1->type->refCount++;
6287 }
6288 return 0x1;
6289 }
6290
6291 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6292 {
6293 int value2 = op2->__anon1.i;
6294
6295 exp->type = 2;
6296 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6297 if(!exp->expType)
6298 {
6299 exp->expType = op1->type;
6300 if(op1->type)
6301 op1->type->refCount++;
6302 }
6303 return 0x1;
6304 }
6305
6306 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6307 {
6308 unsigned int value2 = op2->__anon1.ui;
6309
6310 exp->type = 2;
6311 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6312 if(!exp->expType)
6313 {
6314 exp->expType = op1->type;
6315 if(op1->type)
6316 op1->type->refCount++;
6317 }
6318 return 0x1;
6319 }
6320
6321 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6322 {
6323 long long value2 = op2->__anon1.i64;
6324
6325 exp->type = 2;
6326 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6327 if(!exp->expType)
6328 {
6329 exp->expType = op1->type;
6330 if(op1->type)
6331 op1->type->refCount++;
6332 }
6333 return 0x1;
6334 }
6335
6336 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6337 {
6338 uint64 value2 = op2->__anon1.ui64;
6339
6340 exp->type = 2;
6341 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6342 if(!exp->expType)
6343 {
6344 exp->expType = op1->type;
6345 if(op1->type)
6346 op1->type->refCount++;
6347 }
6348 return 0x1;
6349 }
6350
6351 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6352 {
6353 short value2 = op2->__anon1.s;
6354
6355 exp->type = 2;
6356 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6357 if(!exp->expType)
6358 {
6359 exp->expType = op1->type;
6360 if(op1->type)
6361 op1->type->refCount++;
6362 }
6363 return 0x1;
6364 }
6365
6366 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6367 {
6368 unsigned short value2 = op2->__anon1.us;
6369
6370 exp->type = 2;
6371 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6372 if(!exp->expType)
6373 {
6374 exp->expType = op1->type;
6375 if(op1->type)
6376 op1->type->refCount++;
6377 }
6378 return 0x1;
6379 }
6380
6381 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6382 {
6383 char value2 = op2->__anon1.c;
6384
6385 exp->type = 2;
6386 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6387 if(!exp->expType)
6388 {
6389 exp->expType = op1->type;
6390 if(op1->type)
6391 op1->type->refCount++;
6392 }
6393 return 0x1;
6394 }
6395
6396 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6397 {
6398 unsigned char value2 = op2->__anon1.uc;
6399
6400 exp->type = 2;
6401 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6402 if(!exp->expType)
6403 {
6404 exp->expType = op1->type;
6405 if(op1->type)
6406 op1->type->refCount++;
6407 }
6408 return 0x1;
6409 }
6410
6411 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6412 {
6413 float value2 = op2->__anon1.f;
6414
6415 exp->type = 2;
6416 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6417 if(!exp->expType)
6418 {
6419 exp->expType = op1->type;
6420 if(op1->type)
6421 op1->type->refCount++;
6422 }
6423 return 0x1;
6424 }
6425
6426 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6427 {
6428 double value2 = op2->__anon1.d;
6429
6430 exp->type = 2;
6431 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6432 if(!exp->expType)
6433 {
6434 exp->expType = op1->type;
6435 if(op1->type)
6436 op1->type->refCount++;
6437 }
6438 return 0x1;
6439 }
6440
6441 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6442 {
6443 int value2 = op2->__anon1.i;
6444
6445 exp->type = 2;
6446 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6447 if(!exp->expType)
6448 {
6449 exp->expType = op1->type;
6450 if(op1->type)
6451 op1->type->refCount++;
6452 }
6453 return 0x1;
6454 }
6455
6456 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6457 {
6458 unsigned int value2 = op2->__anon1.ui;
6459
6460 exp->type = 2;
6461 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6462 if(!exp->expType)
6463 {
6464 exp->expType = op1->type;
6465 if(op1->type)
6466 op1->type->refCount++;
6467 }
6468 return 0x1;
6469 }
6470
6471 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6472 {
6473 long long value2 = op2->__anon1.i64;
6474
6475 exp->type = 2;
6476 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6477 if(!exp->expType)
6478 {
6479 exp->expType = op1->type;
6480 if(op1->type)
6481 op1->type->refCount++;
6482 }
6483 return 0x1;
6484 }
6485
6486 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6487 {
6488 uint64 value2 = op2->__anon1.ui64;
6489
6490 exp->type = 2;
6491 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6492 if(!exp->expType)
6493 {
6494 exp->expType = op1->type;
6495 if(op1->type)
6496 op1->type->refCount++;
6497 }
6498 return 0x1;
6499 }
6500
6501 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6502 {
6503 short value2 = op2->__anon1.s;
6504
6505 exp->type = 2;
6506 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6507 if(!exp->expType)
6508 {
6509 exp->expType = op1->type;
6510 if(op1->type)
6511 op1->type->refCount++;
6512 }
6513 return 0x1;
6514 }
6515
6516 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6517 {
6518 unsigned short value2 = op2->__anon1.us;
6519
6520 exp->type = 2;
6521 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6522 if(!exp->expType)
6523 {
6524 exp->expType = op1->type;
6525 if(op1->type)
6526 op1->type->refCount++;
6527 }
6528 return 0x1;
6529 }
6530
6531 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6532 {
6533 char value2 = op2->__anon1.c;
6534
6535 exp->type = 2;
6536 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6537 if(!exp->expType)
6538 {
6539 exp->expType = op1->type;
6540 if(op1->type)
6541 op1->type->refCount++;
6542 }
6543 return 0x1;
6544 }
6545
6546 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6547 {
6548 unsigned char value2 = op2->__anon1.uc;
6549
6550 exp->type = 2;
6551 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6552 if(!exp->expType)
6553 {
6554 exp->expType = op1->type;
6555 if(op1->type)
6556 op1->type->refCount++;
6557 }
6558 return 0x1;
6559 }
6560
6561 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6562 {
6563 float value2 = op2->__anon1.f;
6564
6565 exp->type = 2;
6566 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6567 if(!exp->expType)
6568 {
6569 exp->expType = op1->type;
6570 if(op1->type)
6571 op1->type->refCount++;
6572 }
6573 return 0x1;
6574 }
6575
6576 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6577 {
6578 double value2 = op2->__anon1.d;
6579
6580 exp->type = 2;
6581 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6582 if(!exp->expType)
6583 {
6584 exp->expType = op1->type;
6585 if(op1->type)
6586 op1->type->refCount++;
6587 }
6588 return 0x1;
6589 }
6590
6591 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6592 {
6593 int value2 = op2->__anon1.i;
6594
6595 exp->type = 2;
6596 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6597 if(!exp->expType)
6598 {
6599 exp->expType = op1->type;
6600 if(op1->type)
6601 op1->type->refCount++;
6602 }
6603 return 0x1;
6604 }
6605
6606 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6607 {
6608 unsigned int value2 = op2->__anon1.ui;
6609
6610 exp->type = 2;
6611 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6612 if(!exp->expType)
6613 {
6614 exp->expType = op1->type;
6615 if(op1->type)
6616 op1->type->refCount++;
6617 }
6618 return 0x1;
6619 }
6620
6621 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6622 {
6623 long long value2 = op2->__anon1.i64;
6624
6625 exp->type = 2;
6626 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6627 if(!exp->expType)
6628 {
6629 exp->expType = op1->type;
6630 if(op1->type)
6631 op1->type->refCount++;
6632 }
6633 return 0x1;
6634 }
6635
6636 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6637 {
6638 uint64 value2 = op2->__anon1.ui64;
6639
6640 exp->type = 2;
6641 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6642 if(!exp->expType)
6643 {
6644 exp->expType = op1->type;
6645 if(op1->type)
6646 op1->type->refCount++;
6647 }
6648 return 0x1;
6649 }
6650
6651 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6652 {
6653 short value2 = op2->__anon1.s;
6654
6655 exp->type = 2;
6656 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6657 if(!exp->expType)
6658 {
6659 exp->expType = op1->type;
6660 if(op1->type)
6661 op1->type->refCount++;
6662 }
6663 return 0x1;
6664 }
6665
6666 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6667 {
6668 unsigned short value2 = op2->__anon1.us;
6669
6670 exp->type = 2;
6671 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6672 if(!exp->expType)
6673 {
6674 exp->expType = op1->type;
6675 if(op1->type)
6676 op1->type->refCount++;
6677 }
6678 return 0x1;
6679 }
6680
6681 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6682 {
6683 char value2 = op2->__anon1.c;
6684
6685 exp->type = 2;
6686 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6687 if(!exp->expType)
6688 {
6689 exp->expType = op1->type;
6690 if(op1->type)
6691 op1->type->refCount++;
6692 }
6693 return 0x1;
6694 }
6695
6696 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6697 {
6698 unsigned char value2 = op2->__anon1.uc;
6699
6700 exp->type = 2;
6701 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6702 if(!exp->expType)
6703 {
6704 exp->expType = op1->type;
6705 if(op1->type)
6706 op1->type->refCount++;
6707 }
6708 return 0x1;
6709 }
6710
6711 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6712 {
6713 exp->type = 2;
6714 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6715 if(!exp->expType)
6716 {
6717 exp->expType = op1->type;
6718 if(op1->type)
6719 op1->type->refCount++;
6720 }
6721 return 0x1;
6722 }
6723
6724 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6725 {
6726 exp->type = 2;
6727 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6728 if(!exp->expType)
6729 {
6730 exp->expType = op1->type;
6731 if(op1->type)
6732 op1->type->refCount++;
6733 }
6734 return 0x1;
6735 }
6736
6737 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6738 {
6739 exp->type = 2;
6740 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6741 if(!exp->expType)
6742 {
6743 exp->expType = op1->type;
6744 if(op1->type)
6745 op1->type->refCount++;
6746 }
6747 return 0x1;
6748 }
6749
6750 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6751 {
6752 exp->type = 2;
6753 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 0x1;
6761 }
6762
6763 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6764 {
6765 exp->type = 2;
6766 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6767 if(!exp->expType)
6768 {
6769 exp->expType = op1->type;
6770 if(op1->type)
6771 op1->type->refCount++;
6772 }
6773 return 0x1;
6774 }
6775
6776 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6777 {
6778 exp->type = 2;
6779 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6780 if(!exp->expType)
6781 {
6782 exp->expType = op1->type;
6783 if(op1->type)
6784 op1->type->refCount++;
6785 }
6786 return 0x1;
6787 }
6788
6789 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6790 {
6791 exp->type = 2;
6792 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6793 if(!exp->expType)
6794 {
6795 exp->expType = op1->type;
6796 if(op1->type)
6797 op1->type->refCount++;
6798 }
6799 return 0x1;
6800 }
6801
6802 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6803 {
6804 exp->type = 2;
6805 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6806 if(!exp->expType)
6807 {
6808 exp->expType = op1->type;
6809 if(op1->type)
6810 op1->type->refCount++;
6811 }
6812 return 0x1;
6813 }
6814
6815 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6816 {
6817 exp->type = 2;
6818 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6819 if(!exp->expType)
6820 {
6821 exp->expType = op1->type;
6822 if(op1->type)
6823 op1->type->refCount++;
6824 }
6825 return 0x1;
6826 }
6827
6828 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6829 {
6830 exp->type = 2;
6831 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6832 if(!exp->expType)
6833 {
6834 exp->expType = op1->type;
6835 if(op1->type)
6836 op1->type->refCount++;
6837 }
6838 return 0x1;
6839 }
6840
6841 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6842 {
6843 exp->type = 2;
6844 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6845 if(!exp->expType)
6846 {
6847 exp->expType = op1->type;
6848 if(op1->type)
6849 op1->type->refCount++;
6850 }
6851 return 0x1;
6852 }
6853
6854 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6855 {
6856 exp->type = 2;
6857 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6858 if(!exp->expType)
6859 {
6860 exp->expType = op1->type;
6861 if(op1->type)
6862 op1->type->refCount++;
6863 }
6864 return 0x1;
6865 }
6866
6867 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6868 {
6869 exp->type = 2;
6870 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6871 if(!exp->expType)
6872 {
6873 exp->expType = op1->type;
6874 if(op1->type)
6875 op1->type->refCount++;
6876 }
6877 return 0x1;
6878 }
6879
6880 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6881 {
6882 exp->type = 2;
6883 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6884 if(!exp->expType)
6885 {
6886 exp->expType = op1->type;
6887 if(op1->type)
6888 op1->type->refCount++;
6889 }
6890 return 0x1;
6891 }
6892
6893 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6894 {
6895 exp->type = 2;
6896 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6897 if(!exp->expType)
6898 {
6899 exp->expType = op1->type;
6900 if(op1->type)
6901 op1->type->refCount++;
6902 }
6903 return 0x1;
6904 }
6905
6906 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6907 {
6908 exp->type = 2;
6909 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6910 if(!exp->expType)
6911 {
6912 exp->expType = op1->type;
6913 if(op1->type)
6914 op1->type->refCount++;
6915 }
6916 return 0x1;
6917 }
6918
6919 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6920 {
6921 exp->type = 2;
6922 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6923 if(!exp->expType)
6924 {
6925 exp->expType = op1->type;
6926 if(op1->type)
6927 op1->type->refCount++;
6928 }
6929 return 0x1;
6930 }
6931
6932 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6933 {
6934 exp->type = 2;
6935 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6936 if(!exp->expType)
6937 {
6938 exp->expType = op1->type;
6939 if(op1->type)
6940 op1->type->refCount++;
6941 }
6942 return 0x1;
6943 }
6944
6945 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6946 {
6947 exp->type = 2;
6948 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6949 if(!exp->expType)
6950 {
6951 exp->expType = op1->type;
6952 if(op1->type)
6953 op1->type->refCount++;
6954 }
6955 return 0x1;
6956 }
6957
6958 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6959 {
6960 exp->type = 2;
6961 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6962 if(!exp->expType)
6963 {
6964 exp->expType = op1->type;
6965 if(op1->type)
6966 op1->type->refCount++;
6967 }
6968 return 0x1;
6969 }
6970
6971 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6972 {
6973 exp->type = 2;
6974 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6975 if(!exp->expType)
6976 {
6977 exp->expType = op1->type;
6978 if(op1->type)
6979 op1->type->refCount++;
6980 }
6981 return 0x1;
6982 }
6983
6984 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6985 {
6986 exp->type = 2;
6987 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6988 if(!exp->expType)
6989 {
6990 exp->expType = op1->type;
6991 if(op1->type)
6992 op1->type->refCount++;
6993 }
6994 return 0x1;
6995 }
6996
6997 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6998 {
6999 exp->type = 2;
7000 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7001 if(!exp->expType)
7002 {
7003 exp->expType = op1->type;
7004 if(op1->type)
7005 op1->type->refCount++;
7006 }
7007 return 0x1;
7008 }
7009
7010 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7011 {
7012 exp->type = 2;
7013 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7014 if(!exp->expType)
7015 {
7016 exp->expType = op1->type;
7017 if(op1->type)
7018 op1->type->refCount++;
7019 }
7020 return 0x1;
7021 }
7022
7023 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7024 {
7025 exp->type = 2;
7026 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7027 if(!exp->expType)
7028 {
7029 exp->expType = op1->type;
7030 if(op1->type)
7031 op1->type->refCount++;
7032 }
7033 return 0x1;
7034 }
7035
7036 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7037 {
7038 exp->type = 2;
7039 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7040 if(!exp->expType)
7041 {
7042 exp->expType = op1->type;
7043 if(op1->type)
7044 op1->type->refCount++;
7045 }
7046 return 0x1;
7047 }
7048
7049 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7050 {
7051 exp->type = 2;
7052 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7053 if(!exp->expType)
7054 {
7055 exp->expType = op1->type;
7056 if(op1->type)
7057 op1->type->refCount++;
7058 }
7059 return 0x1;
7060 }
7061
7062 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7063 {
7064 exp->type = 2;
7065 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7066 if(!exp->expType)
7067 {
7068 exp->expType = op1->type;
7069 if(op1->type)
7070 op1->type->refCount++;
7071 }
7072 return 0x1;
7073 }
7074
7075 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7076 {
7077 exp->type = 2;
7078 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7079 if(!exp->expType)
7080 {
7081 exp->expType = op1->type;
7082 if(op1->type)
7083 op1->type->refCount++;
7084 }
7085 return 0x1;
7086 }
7087
7088 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7089 {
7090 exp->type = 2;
7091 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7092 if(!exp->expType)
7093 {
7094 exp->expType = op1->type;
7095 if(op1->type)
7096 op1->type->refCount++;
7097 }
7098 return 0x1;
7099 }
7100
7101 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7102 {
7103 int value2 = op2->__anon1.i;
7104
7105 exp->type = 2;
7106 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 0x1;
7114 }
7115
7116 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7117 {
7118 unsigned int value2 = op2->__anon1.ui;
7119
7120 exp->type = 2;
7121 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7122 if(!exp->expType)
7123 {
7124 exp->expType = op1->type;
7125 if(op1->type)
7126 op1->type->refCount++;
7127 }
7128 return 0x1;
7129 }
7130
7131 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7132 {
7133 long long value2 = op2->__anon1.i64;
7134
7135 exp->type = 2;
7136 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7137 if(!exp->expType)
7138 {
7139 exp->expType = op1->type;
7140 if(op1->type)
7141 op1->type->refCount++;
7142 }
7143 return 0x1;
7144 }
7145
7146 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7147 {
7148 uint64 value2 = op2->__anon1.ui64;
7149
7150 exp->type = 2;
7151 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7152 if(!exp->expType)
7153 {
7154 exp->expType = op1->type;
7155 if(op1->type)
7156 op1->type->refCount++;
7157 }
7158 return 0x1;
7159 }
7160
7161 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7162 {
7163 short value2 = op2->__anon1.s;
7164
7165 exp->type = 2;
7166 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7167 if(!exp->expType)
7168 {
7169 exp->expType = op1->type;
7170 if(op1->type)
7171 op1->type->refCount++;
7172 }
7173 return 0x1;
7174 }
7175
7176 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7177 {
7178 unsigned short value2 = op2->__anon1.us;
7179
7180 exp->type = 2;
7181 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7182 if(!exp->expType)
7183 {
7184 exp->expType = op1->type;
7185 if(op1->type)
7186 op1->type->refCount++;
7187 }
7188 return 0x1;
7189 }
7190
7191 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7192 {
7193 char value2 = op2->__anon1.c;
7194
7195 exp->type = 2;
7196 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7197 if(!exp->expType)
7198 {
7199 exp->expType = op1->type;
7200 if(op1->type)
7201 op1->type->refCount++;
7202 }
7203 return 0x1;
7204 }
7205
7206 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7207 {
7208 unsigned char value2 = op2->__anon1.uc;
7209
7210 exp->type = 2;
7211 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7212 if(!exp->expType)
7213 {
7214 exp->expType = op1->type;
7215 if(op1->type)
7216 op1->type->refCount++;
7217 }
7218 return 0x1;
7219 }
7220
7221 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7222 {
7223 float value2 = op2->__anon1.f;
7224
7225 exp->type = 2;
7226 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7227 if(!exp->expType)
7228 {
7229 exp->expType = op1->type;
7230 if(op1->type)
7231 op1->type->refCount++;
7232 }
7233 return 0x1;
7234 }
7235
7236 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7237 {
7238 double value2 = op2->__anon1.d;
7239
7240 exp->type = 2;
7241 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7242 if(!exp->expType)
7243 {
7244 exp->expType = op1->type;
7245 if(op1->type)
7246 op1->type->refCount++;
7247 }
7248 return 0x1;
7249 }
7250
7251 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7252 {
7253 int value2 = op2->__anon1.i;
7254
7255 exp->type = 2;
7256 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7257 if(!exp->expType)
7258 {
7259 exp->expType = op1->type;
7260 if(op1->type)
7261 op1->type->refCount++;
7262 }
7263 return 0x1;
7264 }
7265
7266 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7267 {
7268 unsigned int value2 = op2->__anon1.ui;
7269
7270 exp->type = 2;
7271 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7272 if(!exp->expType)
7273 {
7274 exp->expType = op1->type;
7275 if(op1->type)
7276 op1->type->refCount++;
7277 }
7278 return 0x1;
7279 }
7280
7281 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7282 {
7283 long long value2 = op2->__anon1.i64;
7284
7285 exp->type = 2;
7286 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7287 if(!exp->expType)
7288 {
7289 exp->expType = op1->type;
7290 if(op1->type)
7291 op1->type->refCount++;
7292 }
7293 return 0x1;
7294 }
7295
7296 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7297 {
7298 uint64 value2 = op2->__anon1.ui64;
7299
7300 exp->type = 2;
7301 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7302 if(!exp->expType)
7303 {
7304 exp->expType = op1->type;
7305 if(op1->type)
7306 op1->type->refCount++;
7307 }
7308 return 0x1;
7309 }
7310
7311 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7312 {
7313 short value2 = op2->__anon1.s;
7314
7315 exp->type = 2;
7316 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7317 if(!exp->expType)
7318 {
7319 exp->expType = op1->type;
7320 if(op1->type)
7321 op1->type->refCount++;
7322 }
7323 return 0x1;
7324 }
7325
7326 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7327 {
7328 unsigned short value2 = op2->__anon1.us;
7329
7330 exp->type = 2;
7331 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7332 if(!exp->expType)
7333 {
7334 exp->expType = op1->type;
7335 if(op1->type)
7336 op1->type->refCount++;
7337 }
7338 return 0x1;
7339 }
7340
7341 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7342 {
7343 char value2 = op2->__anon1.c;
7344
7345 exp->type = 2;
7346 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7347 if(!exp->expType)
7348 {
7349 exp->expType = op1->type;
7350 if(op1->type)
7351 op1->type->refCount++;
7352 }
7353 return 0x1;
7354 }
7355
7356 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7357 {
7358 unsigned char value2 = op2->__anon1.uc;
7359
7360 exp->type = 2;
7361 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7362 if(!exp->expType)
7363 {
7364 exp->expType = op1->type;
7365 if(op1->type)
7366 op1->type->refCount++;
7367 }
7368 return 0x1;
7369 }
7370
7371 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7372 {
7373 float value2 = op2->__anon1.f;
7374
7375 exp->type = 2;
7376 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7377 if(!exp->expType)
7378 {
7379 exp->expType = op1->type;
7380 if(op1->type)
7381 op1->type->refCount++;
7382 }
7383 return 0x1;
7384 }
7385
7386 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7387 {
7388 double value2 = op2->__anon1.d;
7389
7390 exp->type = 2;
7391 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7392 if(!exp->expType)
7393 {
7394 exp->expType = op1->type;
7395 if(op1->type)
7396 op1->type->refCount++;
7397 }
7398 return 0x1;
7399 }
7400
7401 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7402 {
7403 int value2 = op2->__anon1.i;
7404
7405 exp->type = 2;
7406 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7407 if(!exp->expType)
7408 {
7409 exp->expType = op1->type;
7410 if(op1->type)
7411 op1->type->refCount++;
7412 }
7413 return 0x1;
7414 }
7415
7416 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7417 {
7418 unsigned int value2 = op2->__anon1.ui;
7419
7420 exp->type = 2;
7421 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7422 if(!exp->expType)
7423 {
7424 exp->expType = op1->type;
7425 if(op1->type)
7426 op1->type->refCount++;
7427 }
7428 return 0x1;
7429 }
7430
7431 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7432 {
7433 long long value2 = op2->__anon1.i64;
7434
7435 exp->type = 2;
7436 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7437 if(!exp->expType)
7438 {
7439 exp->expType = op1->type;
7440 if(op1->type)
7441 op1->type->refCount++;
7442 }
7443 return 0x1;
7444 }
7445
7446 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7447 {
7448 uint64 value2 = op2->__anon1.ui64;
7449
7450 exp->type = 2;
7451 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7452 if(!exp->expType)
7453 {
7454 exp->expType = op1->type;
7455 if(op1->type)
7456 op1->type->refCount++;
7457 }
7458 return 0x1;
7459 }
7460
7461 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7462 {
7463 short value2 = op2->__anon1.s;
7464
7465 exp->type = 2;
7466 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7467 if(!exp->expType)
7468 {
7469 exp->expType = op1->type;
7470 if(op1->type)
7471 op1->type->refCount++;
7472 }
7473 return 0x1;
7474 }
7475
7476 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7477 {
7478 unsigned short value2 = op2->__anon1.us;
7479
7480 exp->type = 2;
7481 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7482 if(!exp->expType)
7483 {
7484 exp->expType = op1->type;
7485 if(op1->type)
7486 op1->type->refCount++;
7487 }
7488 return 0x1;
7489 }
7490
7491 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7492 {
7493 char value2 = op2->__anon1.c;
7494
7495 exp->type = 2;
7496 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7497 if(!exp->expType)
7498 {
7499 exp->expType = op1->type;
7500 if(op1->type)
7501 op1->type->refCount++;
7502 }
7503 return 0x1;
7504 }
7505
7506 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7507 {
7508 unsigned char value2 = op2->__anon1.uc;
7509
7510 exp->type = 2;
7511 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7512 if(!exp->expType)
7513 {
7514 exp->expType = op1->type;
7515 if(op1->type)
7516 op1->type->refCount++;
7517 }
7518 return 0x1;
7519 }
7520
7521 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7522 {
7523 float value2 = op2->__anon1.f;
7524
7525 exp->type = 2;
7526 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7527 if(!exp->expType)
7528 {
7529 exp->expType = op1->type;
7530 if(op1->type)
7531 op1->type->refCount++;
7532 }
7533 return 0x1;
7534 }
7535
7536 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7537 {
7538 double value2 = op2->__anon1.d;
7539
7540 exp->type = 2;
7541 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7542 if(!exp->expType)
7543 {
7544 exp->expType = op1->type;
7545 if(op1->type)
7546 op1->type->refCount++;
7547 }
7548 return 0x1;
7549 }
7550
7551 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7552 {
7553 int value2 = op2->__anon1.i;
7554
7555 exp->type = 2;
7556 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7557 if(!exp->expType)
7558 {
7559 exp->expType = op1->type;
7560 if(op1->type)
7561 op1->type->refCount++;
7562 }
7563 return 0x1;
7564 }
7565
7566 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7567 {
7568 unsigned int value2 = op2->__anon1.ui;
7569
7570 exp->type = 2;
7571 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7572 if(!exp->expType)
7573 {
7574 exp->expType = op1->type;
7575 if(op1->type)
7576 op1->type->refCount++;
7577 }
7578 return 0x1;
7579 }
7580
7581 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7582 {
7583 long long value2 = op2->__anon1.i64;
7584
7585 exp->type = 2;
7586 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7587 if(!exp->expType)
7588 {
7589 exp->expType = op1->type;
7590 if(op1->type)
7591 op1->type->refCount++;
7592 }
7593 return 0x1;
7594 }
7595
7596 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7597 {
7598 uint64 value2 = op2->__anon1.ui64;
7599
7600 exp->type = 2;
7601 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7602 if(!exp->expType)
7603 {
7604 exp->expType = op1->type;
7605 if(op1->type)
7606 op1->type->refCount++;
7607 }
7608 return 0x1;
7609 }
7610
7611 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7612 {
7613 short value2 = op2->__anon1.s;
7614
7615 exp->type = 2;
7616 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7617 if(!exp->expType)
7618 {
7619 exp->expType = op1->type;
7620 if(op1->type)
7621 op1->type->refCount++;
7622 }
7623 return 0x1;
7624 }
7625
7626 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7627 {
7628 unsigned short value2 = op2->__anon1.us;
7629
7630 exp->type = 2;
7631 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7632 if(!exp->expType)
7633 {
7634 exp->expType = op1->type;
7635 if(op1->type)
7636 op1->type->refCount++;
7637 }
7638 return 0x1;
7639 }
7640
7641 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7642 {
7643 char value2 = op2->__anon1.c;
7644
7645 exp->type = 2;
7646 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7647 if(!exp->expType)
7648 {
7649 exp->expType = op1->type;
7650 if(op1->type)
7651 op1->type->refCount++;
7652 }
7653 return 0x1;
7654 }
7655
7656 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7657 {
7658 unsigned char value2 = op2->__anon1.uc;
7659
7660 exp->type = 2;
7661 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7662 if(!exp->expType)
7663 {
7664 exp->expType = op1->type;
7665 if(op1->type)
7666 op1->type->refCount++;
7667 }
7668 return 0x1;
7669 }
7670
7671 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7672 {
7673 float value2 = op2->__anon1.f;
7674
7675 exp->type = 2;
7676 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7677 if(!exp->expType)
7678 {
7679 exp->expType = op1->type;
7680 if(op1->type)
7681 op1->type->refCount++;
7682 }
7683 return 0x1;
7684 }
7685
7686 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7687 {
7688 double value2 = op2->__anon1.d;
7689
7690 exp->type = 2;
7691 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7692 if(!exp->expType)
7693 {
7694 exp->expType = op1->type;
7695 if(op1->type)
7696 op1->type->refCount++;
7697 }
7698 return 0x1;
7699 }
7700
7701 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7702 {
7703 int value2 = op2->__anon1.i;
7704
7705 exp->type = 2;
7706 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7707 if(!exp->expType)
7708 {
7709 exp->expType = op1->type;
7710 if(op1->type)
7711 op1->type->refCount++;
7712 }
7713 return 0x1;
7714 }
7715
7716 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7717 {
7718 unsigned int value2 = op2->__anon1.ui;
7719
7720 exp->type = 2;
7721 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7722 if(!exp->expType)
7723 {
7724 exp->expType = op1->type;
7725 if(op1->type)
7726 op1->type->refCount++;
7727 }
7728 return 0x1;
7729 }
7730
7731 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7732 {
7733 long long value2 = op2->__anon1.i64;
7734
7735 exp->type = 2;
7736 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7737 if(!exp->expType)
7738 {
7739 exp->expType = op1->type;
7740 if(op1->type)
7741 op1->type->refCount++;
7742 }
7743 return 0x1;
7744 }
7745
7746 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7747 {
7748 uint64 value2 = op2->__anon1.ui64;
7749
7750 exp->type = 2;
7751 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7752 if(!exp->expType)
7753 {
7754 exp->expType = op1->type;
7755 if(op1->type)
7756 op1->type->refCount++;
7757 }
7758 return 0x1;
7759 }
7760
7761 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7762 {
7763 short value2 = op2->__anon1.s;
7764
7765 exp->type = 2;
7766 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7767 if(!exp->expType)
7768 {
7769 exp->expType = op1->type;
7770 if(op1->type)
7771 op1->type->refCount++;
7772 }
7773 return 0x1;
7774 }
7775
7776 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7777 {
7778 unsigned short value2 = op2->__anon1.us;
7779
7780 exp->type = 2;
7781 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7782 if(!exp->expType)
7783 {
7784 exp->expType = op1->type;
7785 if(op1->type)
7786 op1->type->refCount++;
7787 }
7788 return 0x1;
7789 }
7790
7791 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7792 {
7793 char value2 = op2->__anon1.c;
7794
7795 exp->type = 2;
7796 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7797 if(!exp->expType)
7798 {
7799 exp->expType = op1->type;
7800 if(op1->type)
7801 op1->type->refCount++;
7802 }
7803 return 0x1;
7804 }
7805
7806 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7807 {
7808 unsigned char value2 = op2->__anon1.uc;
7809
7810 exp->type = 2;
7811 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7812 if(!exp->expType)
7813 {
7814 exp->expType = op1->type;
7815 if(op1->type)
7816 op1->type->refCount++;
7817 }
7818 return 0x1;
7819 }
7820
7821 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7822 {
7823 float value2 = op2->__anon1.f;
7824
7825 exp->type = 2;
7826 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7827 if(!exp->expType)
7828 {
7829 exp->expType = op1->type;
7830 if(op1->type)
7831 op1->type->refCount++;
7832 }
7833 return 0x1;
7834 }
7835
7836 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7837 {
7838 double value2 = op2->__anon1.d;
7839
7840 exp->type = 2;
7841 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7842 if(!exp->expType)
7843 {
7844 exp->expType = op1->type;
7845 if(op1->type)
7846 op1->type->refCount++;
7847 }
7848 return 0x1;
7849 }
7850
7851 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7852 {
7853 int value2 = op2->__anon1.i;
7854
7855 exp->type = 2;
7856 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7857 if(!exp->expType)
7858 {
7859 exp->expType = op1->type;
7860 if(op1->type)
7861 op1->type->refCount++;
7862 }
7863 return 0x1;
7864 }
7865
7866 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7867 {
7868 unsigned int value2 = op2->__anon1.ui;
7869
7870 exp->type = 2;
7871 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7872 if(!exp->expType)
7873 {
7874 exp->expType = op1->type;
7875 if(op1->type)
7876 op1->type->refCount++;
7877 }
7878 return 0x1;
7879 }
7880
7881 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7882 {
7883 long long value2 = op2->__anon1.i64;
7884
7885 exp->type = 2;
7886 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7887 if(!exp->expType)
7888 {
7889 exp->expType = op1->type;
7890 if(op1->type)
7891 op1->type->refCount++;
7892 }
7893 return 0x1;
7894 }
7895
7896 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7897 {
7898 uint64 value2 = op2->__anon1.ui64;
7899
7900 exp->type = 2;
7901 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7902 if(!exp->expType)
7903 {
7904 exp->expType = op1->type;
7905 if(op1->type)
7906 op1->type->refCount++;
7907 }
7908 return 0x1;
7909 }
7910
7911 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7912 {
7913 short value2 = op2->__anon1.s;
7914
7915 exp->type = 2;
7916 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7917 if(!exp->expType)
7918 {
7919 exp->expType = op1->type;
7920 if(op1->type)
7921 op1->type->refCount++;
7922 }
7923 return 0x1;
7924 }
7925
7926 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7927 {
7928 unsigned short value2 = op2->__anon1.us;
7929
7930 exp->type = 2;
7931 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7932 if(!exp->expType)
7933 {
7934 exp->expType = op1->type;
7935 if(op1->type)
7936 op1->type->refCount++;
7937 }
7938 return 0x1;
7939 }
7940
7941 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7942 {
7943 char value2 = op2->__anon1.c;
7944
7945 exp->type = 2;
7946 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7947 if(!exp->expType)
7948 {
7949 exp->expType = op1->type;
7950 if(op1->type)
7951 op1->type->refCount++;
7952 }
7953 return 0x1;
7954 }
7955
7956 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7957 {
7958 unsigned char value2 = op2->__anon1.uc;
7959
7960 exp->type = 2;
7961 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7962 if(!exp->expType)
7963 {
7964 exp->expType = op1->type;
7965 if(op1->type)
7966 op1->type->refCount++;
7967 }
7968 return 0x1;
7969 }
7970
7971 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7972 {
7973 int value2 = op2->__anon1.i;
7974
7975 exp->type = 2;
7976 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7977 if(!exp->expType)
7978 {
7979 exp->expType = op1->type;
7980 if(op1->type)
7981 op1->type->refCount++;
7982 }
7983 return 0x1;
7984 }
7985
7986 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7987 {
7988 unsigned int value2 = op2->__anon1.ui;
7989
7990 exp->type = 2;
7991 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
7992 if(!exp->expType)
7993 {
7994 exp->expType = op1->type;
7995 if(op1->type)
7996 op1->type->refCount++;
7997 }
7998 return 0x1;
7999 }
8000
8001 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8002 {
8003 long long value2 = op2->__anon1.i64;
8004
8005 exp->type = 2;
8006 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8007 if(!exp->expType)
8008 {
8009 exp->expType = op1->type;
8010 if(op1->type)
8011 op1->type->refCount++;
8012 }
8013 return 0x1;
8014 }
8015
8016 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8017 {
8018 uint64 value2 = op2->__anon1.ui64;
8019
8020 exp->type = 2;
8021 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8022 if(!exp->expType)
8023 {
8024 exp->expType = op1->type;
8025 if(op1->type)
8026 op1->type->refCount++;
8027 }
8028 return 0x1;
8029 }
8030
8031 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 {
8033 short value2 = op2->__anon1.s;
8034
8035 exp->type = 2;
8036 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8037 if(!exp->expType)
8038 {
8039 exp->expType = op1->type;
8040 if(op1->type)
8041 op1->type->refCount++;
8042 }
8043 return 0x1;
8044 }
8045
8046 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 {
8048 unsigned short value2 = op2->__anon1.us;
8049
8050 exp->type = 2;
8051 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8052 if(!exp->expType)
8053 {
8054 exp->expType = op1->type;
8055 if(op1->type)
8056 op1->type->refCount++;
8057 }
8058 return 0x1;
8059 }
8060
8061 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 {
8063 char value2 = op2->__anon1.c;
8064
8065 exp->type = 2;
8066 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8067 if(!exp->expType)
8068 {
8069 exp->expType = op1->type;
8070 if(op1->type)
8071 op1->type->refCount++;
8072 }
8073 return 0x1;
8074 }
8075
8076 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 {
8078 unsigned char value2 = op2->__anon1.uc;
8079
8080 exp->type = 2;
8081 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8082 if(!exp->expType)
8083 {
8084 exp->expType = op1->type;
8085 if(op1->type)
8086 op1->type->refCount++;
8087 }
8088 return 0x1;
8089 }
8090
8091 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 {
8093 int value2 = op2->__anon1.i;
8094
8095 exp->type = 2;
8096 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8097 if(!exp->expType)
8098 {
8099 exp->expType = op1->type;
8100 if(op1->type)
8101 op1->type->refCount++;
8102 }
8103 return 0x1;
8104 }
8105
8106 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 {
8108 unsigned int value2 = op2->__anon1.ui;
8109
8110 exp->type = 2;
8111 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8112 if(!exp->expType)
8113 {
8114 exp->expType = op1->type;
8115 if(op1->type)
8116 op1->type->refCount++;
8117 }
8118 return 0x1;
8119 }
8120
8121 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 {
8123 long long value2 = op2->__anon1.i64;
8124
8125 exp->type = 2;
8126 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8127 if(!exp->expType)
8128 {
8129 exp->expType = op1->type;
8130 if(op1->type)
8131 op1->type->refCount++;
8132 }
8133 return 0x1;
8134 }
8135
8136 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 {
8138 uint64 value2 = op2->__anon1.ui64;
8139
8140 exp->type = 2;
8141 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8142 if(!exp->expType)
8143 {
8144 exp->expType = op1->type;
8145 if(op1->type)
8146 op1->type->refCount++;
8147 }
8148 return 0x1;
8149 }
8150
8151 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 {
8153 short value2 = op2->__anon1.s;
8154
8155 exp->type = 2;
8156 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8157 if(!exp->expType)
8158 {
8159 exp->expType = op1->type;
8160 if(op1->type)
8161 op1->type->refCount++;
8162 }
8163 return 0x1;
8164 }
8165
8166 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 {
8168 unsigned short value2 = op2->__anon1.us;
8169
8170 exp->type = 2;
8171 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8172 if(!exp->expType)
8173 {
8174 exp->expType = op1->type;
8175 if(op1->type)
8176 op1->type->refCount++;
8177 }
8178 return 0x1;
8179 }
8180
8181 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8182 {
8183 char value2 = op2->__anon1.c;
8184
8185 exp->type = 2;
8186 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8187 if(!exp->expType)
8188 {
8189 exp->expType = op1->type;
8190 if(op1->type)
8191 op1->type->refCount++;
8192 }
8193 return 0x1;
8194 }
8195
8196 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8197 {
8198 unsigned char value2 = op2->__anon1.uc;
8199
8200 exp->type = 2;
8201 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8202 if(!exp->expType)
8203 {
8204 exp->expType = op1->type;
8205 if(op1->type)
8206 op1->type->refCount++;
8207 }
8208 return 0x1;
8209 }
8210
8211 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8212 {
8213 int value2 = op2->__anon1.i;
8214
8215 exp->type = 2;
8216 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8217 if(!exp->expType)
8218 {
8219 exp->expType = op1->type;
8220 if(op1->type)
8221 op1->type->refCount++;
8222 }
8223 return 0x1;
8224 }
8225
8226 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8227 {
8228 unsigned int value2 = op2->__anon1.ui;
8229
8230 exp->type = 2;
8231 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8232 if(!exp->expType)
8233 {
8234 exp->expType = op1->type;
8235 if(op1->type)
8236 op1->type->refCount++;
8237 }
8238 return 0x1;
8239 }
8240
8241 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8242 {
8243 long long value2 = op2->__anon1.i64;
8244
8245 exp->type = 2;
8246 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8247 if(!exp->expType)
8248 {
8249 exp->expType = op1->type;
8250 if(op1->type)
8251 op1->type->refCount++;
8252 }
8253 return 0x1;
8254 }
8255
8256 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8257 {
8258 uint64 value2 = op2->__anon1.ui64;
8259
8260 exp->type = 2;
8261 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8262 if(!exp->expType)
8263 {
8264 exp->expType = op1->type;
8265 if(op1->type)
8266 op1->type->refCount++;
8267 }
8268 return 0x1;
8269 }
8270
8271 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8272 {
8273 short value2 = op2->__anon1.s;
8274
8275 exp->type = 2;
8276 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8277 if(!exp->expType)
8278 {
8279 exp->expType = op1->type;
8280 if(op1->type)
8281 op1->type->refCount++;
8282 }
8283 return 0x1;
8284 }
8285
8286 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8287 {
8288 unsigned short value2 = op2->__anon1.us;
8289
8290 exp->type = 2;
8291 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8292 if(!exp->expType)
8293 {
8294 exp->expType = op1->type;
8295 if(op1->type)
8296 op1->type->refCount++;
8297 }
8298 return 0x1;
8299 }
8300
8301 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8302 {
8303 char value2 = op2->__anon1.c;
8304
8305 exp->type = 2;
8306 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8307 if(!exp->expType)
8308 {
8309 exp->expType = op1->type;
8310 if(op1->type)
8311 op1->type->refCount++;
8312 }
8313 return 0x1;
8314 }
8315
8316 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8317 {
8318 unsigned char value2 = op2->__anon1.uc;
8319
8320 exp->type = 2;
8321 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8322 if(!exp->expType)
8323 {
8324 exp->expType = op1->type;
8325 if(op1->type)
8326 op1->type->refCount++;
8327 }
8328 return 0x1;
8329 }
8330
8331 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8332 {
8333 int value2 = op2->__anon1.i;
8334
8335 exp->type = 2;
8336 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8337 if(!exp->expType)
8338 {
8339 exp->expType = op1->type;
8340 if(op1->type)
8341 op1->type->refCount++;
8342 }
8343 return 0x1;
8344 }
8345
8346 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8347 {
8348 unsigned int value2 = op2->__anon1.ui;
8349
8350 exp->type = 2;
8351 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8352 if(!exp->expType)
8353 {
8354 exp->expType = op1->type;
8355 if(op1->type)
8356 op1->type->refCount++;
8357 }
8358 return 0x1;
8359 }
8360
8361 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8362 {
8363 long long value2 = op2->__anon1.i64;
8364
8365 exp->type = 2;
8366 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8367 if(!exp->expType)
8368 {
8369 exp->expType = op1->type;
8370 if(op1->type)
8371 op1->type->refCount++;
8372 }
8373 return 0x1;
8374 }
8375
8376 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8377 {
8378 uint64 value2 = op2->__anon1.ui64;
8379
8380 exp->type = 2;
8381 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8382 if(!exp->expType)
8383 {
8384 exp->expType = op1->type;
8385 if(op1->type)
8386 op1->type->refCount++;
8387 }
8388 return 0x1;
8389 }
8390
8391 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8392 {
8393 short value2 = op2->__anon1.s;
8394
8395 exp->type = 2;
8396 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8397 if(!exp->expType)
8398 {
8399 exp->expType = op1->type;
8400 if(op1->type)
8401 op1->type->refCount++;
8402 }
8403 return 0x1;
8404 }
8405
8406 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8407 {
8408 unsigned short value2 = op2->__anon1.us;
8409
8410 exp->type = 2;
8411 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8412 if(!exp->expType)
8413 {
8414 exp->expType = op1->type;
8415 if(op1->type)
8416 op1->type->refCount++;
8417 }
8418 return 0x1;
8419 }
8420
8421 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8422 {
8423 char value2 = op2->__anon1.c;
8424
8425 exp->type = 2;
8426 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8427 if(!exp->expType)
8428 {
8429 exp->expType = op1->type;
8430 if(op1->type)
8431 op1->type->refCount++;
8432 }
8433 return 0x1;
8434 }
8435
8436 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8437 {
8438 unsigned char value2 = op2->__anon1.uc;
8439
8440 exp->type = 2;
8441 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8442 if(!exp->expType)
8443 {
8444 exp->expType = op1->type;
8445 if(op1->type)
8446 op1->type->refCount++;
8447 }
8448 return 0x1;
8449 }
8450
8451 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8452 {
8453 int value2 = op2->__anon1.i;
8454
8455 exp->type = 2;
8456 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8457 if(!exp->expType)
8458 {
8459 exp->expType = op1->type;
8460 if(op1->type)
8461 op1->type->refCount++;
8462 }
8463 return 0x1;
8464 }
8465
8466 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8467 {
8468 unsigned int value2 = op2->__anon1.ui;
8469
8470 exp->type = 2;
8471 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8472 if(!exp->expType)
8473 {
8474 exp->expType = op1->type;
8475 if(op1->type)
8476 op1->type->refCount++;
8477 }
8478 return 0x1;
8479 }
8480
8481 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8482 {
8483 long long value2 = op2->__anon1.i64;
8484
8485 exp->type = 2;
8486 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8487 if(!exp->expType)
8488 {
8489 exp->expType = op1->type;
8490 if(op1->type)
8491 op1->type->refCount++;
8492 }
8493 return 0x1;
8494 }
8495
8496 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8497 {
8498 uint64 value2 = op2->__anon1.ui64;
8499
8500 exp->type = 2;
8501 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8502 if(!exp->expType)
8503 {
8504 exp->expType = op1->type;
8505 if(op1->type)
8506 op1->type->refCount++;
8507 }
8508 return 0x1;
8509 }
8510
8511 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8512 {
8513 short value2 = op2->__anon1.s;
8514
8515 exp->type = 2;
8516 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8517 if(!exp->expType)
8518 {
8519 exp->expType = op1->type;
8520 if(op1->type)
8521 op1->type->refCount++;
8522 }
8523 return 0x1;
8524 }
8525
8526 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8527 {
8528 unsigned short value2 = op2->__anon1.us;
8529
8530 exp->type = 2;
8531 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8532 if(!exp->expType)
8533 {
8534 exp->expType = op1->type;
8535 if(op1->type)
8536 op1->type->refCount++;
8537 }
8538 return 0x1;
8539 }
8540
8541 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8542 {
8543 char value2 = op2->__anon1.c;
8544
8545 exp->type = 2;
8546 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8547 if(!exp->expType)
8548 {
8549 exp->expType = op1->type;
8550 if(op1->type)
8551 op1->type->refCount++;
8552 }
8553 return 0x1;
8554 }
8555
8556 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8557 {
8558 unsigned char value2 = op2->__anon1.uc;
8559
8560 exp->type = 2;
8561 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8562 if(!exp->expType)
8563 {
8564 exp->expType = op1->type;
8565 if(op1->type)
8566 op1->type->refCount++;
8567 }
8568 return 0x1;
8569 }
8570
8571 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8572 {
8573 exp->type = 2;
8574 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8575 if(!exp->expType)
8576 {
8577 exp->expType = op1->type;
8578 if(op1->type)
8579 op1->type->refCount++;
8580 }
8581 return 0x1;
8582 }
8583
8584 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8585 {
8586 exp->type = 2;
8587 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8588 if(!exp->expType)
8589 {
8590 exp->expType = op1->type;
8591 if(op1->type)
8592 op1->type->refCount++;
8593 }
8594 return 0x1;
8595 }
8596
8597 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8598 {
8599 exp->type = 2;
8600 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8601 if(!exp->expType)
8602 {
8603 exp->expType = op1->type;
8604 if(op1->type)
8605 op1->type->refCount++;
8606 }
8607 return 0x1;
8608 }
8609
8610 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8611 {
8612 exp->type = 2;
8613 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8614 if(!exp->expType)
8615 {
8616 exp->expType = op1->type;
8617 if(op1->type)
8618 op1->type->refCount++;
8619 }
8620 return 0x1;
8621 }
8622
8623 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8624 {
8625 exp->type = 2;
8626 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8627 if(!exp->expType)
8628 {
8629 exp->expType = op1->type;
8630 if(op1->type)
8631 op1->type->refCount++;
8632 }
8633 return 0x1;
8634 }
8635
8636 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8637 {
8638 exp->type = 2;
8639 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8640 if(!exp->expType)
8641 {
8642 exp->expType = op1->type;
8643 if(op1->type)
8644 op1->type->refCount++;
8645 }
8646 return 0x1;
8647 }
8648
8649 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8650 {
8651 exp->type = 2;
8652 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8653 if(!exp->expType)
8654 {
8655 exp->expType = op1->type;
8656 if(op1->type)
8657 op1->type->refCount++;
8658 }
8659 return 0x1;
8660 }
8661
8662 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8663 {
8664 exp->type = 2;
8665 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8666 if(!exp->expType)
8667 {
8668 exp->expType = op1->type;
8669 if(op1->type)
8670 op1->type->refCount++;
8671 }
8672 return 0x1;
8673 }
8674
8675 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8676 {
8677 int value2 = op2->__anon1.i;
8678
8679 exp->type = 2;
8680 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8681 if(!exp->expType)
8682 {
8683 exp->expType = op1->type;
8684 if(op1->type)
8685 op1->type->refCount++;
8686 }
8687 return 0x1;
8688 }
8689
8690 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8691 {
8692 unsigned int value2 = op2->__anon1.ui;
8693
8694 exp->type = 2;
8695 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8696 if(!exp->expType)
8697 {
8698 exp->expType = op1->type;
8699 if(op1->type)
8700 op1->type->refCount++;
8701 }
8702 return 0x1;
8703 }
8704
8705 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8706 {
8707 long long value2 = op2->__anon1.i64;
8708
8709 exp->type = 2;
8710 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8711 if(!exp->expType)
8712 {
8713 exp->expType = op1->type;
8714 if(op1->type)
8715 op1->type->refCount++;
8716 }
8717 return 0x1;
8718 }
8719
8720 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8721 {
8722 uint64 value2 = op2->__anon1.ui64;
8723
8724 exp->type = 2;
8725 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8726 if(!exp->expType)
8727 {
8728 exp->expType = op1->type;
8729 if(op1->type)
8730 op1->type->refCount++;
8731 }
8732 return 0x1;
8733 }
8734
8735 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8736 {
8737 short value2 = op2->__anon1.s;
8738
8739 exp->type = 2;
8740 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8741 if(!exp->expType)
8742 {
8743 exp->expType = op1->type;
8744 if(op1->type)
8745 op1->type->refCount++;
8746 }
8747 return 0x1;
8748 }
8749
8750 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8751 {
8752 unsigned short value2 = op2->__anon1.us;
8753
8754 exp->type = 2;
8755 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8756 if(!exp->expType)
8757 {
8758 exp->expType = op1->type;
8759 if(op1->type)
8760 op1->type->refCount++;
8761 }
8762 return 0x1;
8763 }
8764
8765 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8766 {
8767 char value2 = op2->__anon1.c;
8768
8769 exp->type = 2;
8770 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8771 if(!exp->expType)
8772 {
8773 exp->expType = op1->type;
8774 if(op1->type)
8775 op1->type->refCount++;
8776 }
8777 return 0x1;
8778 }
8779
8780 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8781 {
8782 unsigned char value2 = op2->__anon1.uc;
8783
8784 exp->type = 2;
8785 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8786 if(!exp->expType)
8787 {
8788 exp->expType = op1->type;
8789 if(op1->type)
8790 op1->type->refCount++;
8791 }
8792 return 0x1;
8793 }
8794
8795 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8796 {
8797 int value2 = op2->__anon1.i;
8798
8799 exp->type = 2;
8800 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8801 if(!exp->expType)
8802 {
8803 exp->expType = op1->type;
8804 if(op1->type)
8805 op1->type->refCount++;
8806 }
8807 return 0x1;
8808 }
8809
8810 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8811 {
8812 unsigned int value2 = op2->__anon1.ui;
8813
8814 exp->type = 2;
8815 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8816 if(!exp->expType)
8817 {
8818 exp->expType = op1->type;
8819 if(op1->type)
8820 op1->type->refCount++;
8821 }
8822 return 0x1;
8823 }
8824
8825 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8826 {
8827 long long value2 = op2->__anon1.i64;
8828
8829 exp->type = 2;
8830 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8831 if(!exp->expType)
8832 {
8833 exp->expType = op1->type;
8834 if(op1->type)
8835 op1->type->refCount++;
8836 }
8837 return 0x1;
8838 }
8839
8840 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8841 {
8842 uint64 value2 = op2->__anon1.ui64;
8843
8844 exp->type = 2;
8845 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8846 if(!exp->expType)
8847 {
8848 exp->expType = op1->type;
8849 if(op1->type)
8850 op1->type->refCount++;
8851 }
8852 return 0x1;
8853 }
8854
8855 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8856 {
8857 short value2 = op2->__anon1.s;
8858
8859 exp->type = 2;
8860 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8861 if(!exp->expType)
8862 {
8863 exp->expType = op1->type;
8864 if(op1->type)
8865 op1->type->refCount++;
8866 }
8867 return 0x1;
8868 }
8869
8870 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8871 {
8872 unsigned short value2 = op2->__anon1.us;
8873
8874 exp->type = 2;
8875 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8876 if(!exp->expType)
8877 {
8878 exp->expType = op1->type;
8879 if(op1->type)
8880 op1->type->refCount++;
8881 }
8882 return 0x1;
8883 }
8884
8885 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8886 {
8887 char value2 = op2->__anon1.c;
8888
8889 exp->type = 2;
8890 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8891 if(!exp->expType)
8892 {
8893 exp->expType = op1->type;
8894 if(op1->type)
8895 op1->type->refCount++;
8896 }
8897 return 0x1;
8898 }
8899
8900 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8901 {
8902 unsigned char value2 = op2->__anon1.uc;
8903
8904 exp->type = 2;
8905 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8906 if(!exp->expType)
8907 {
8908 exp->expType = op1->type;
8909 if(op1->type)
8910 op1->type->refCount++;
8911 }
8912 return 0x1;
8913 }
8914
8915 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8916 {
8917 int value2 = op2->__anon1.i;
8918
8919 exp->type = 2;
8920 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8921 if(!exp->expType)
8922 {
8923 exp->expType = op1->type;
8924 if(op1->type)
8925 op1->type->refCount++;
8926 }
8927 return 0x1;
8928 }
8929
8930 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8931 {
8932 unsigned int value2 = op2->__anon1.ui;
8933
8934 exp->type = 2;
8935 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8936 if(!exp->expType)
8937 {
8938 exp->expType = op1->type;
8939 if(op1->type)
8940 op1->type->refCount++;
8941 }
8942 return 0x1;
8943 }
8944
8945 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8946 {
8947 long long value2 = op2->__anon1.i64;
8948
8949 exp->type = 2;
8950 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8951 if(!exp->expType)
8952 {
8953 exp->expType = op1->type;
8954 if(op1->type)
8955 op1->type->refCount++;
8956 }
8957 return 0x1;
8958 }
8959
8960 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8961 {
8962 uint64 value2 = op2->__anon1.ui64;
8963
8964 exp->type = 2;
8965 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8966 if(!exp->expType)
8967 {
8968 exp->expType = op1->type;
8969 if(op1->type)
8970 op1->type->refCount++;
8971 }
8972 return 0x1;
8973 }
8974
8975 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8976 {
8977 short value2 = op2->__anon1.s;
8978
8979 exp->type = 2;
8980 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8981 if(!exp->expType)
8982 {
8983 exp->expType = op1->type;
8984 if(op1->type)
8985 op1->type->refCount++;
8986 }
8987 return 0x1;
8988 }
8989
8990 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8991 {
8992 unsigned short value2 = op2->__anon1.us;
8993
8994 exp->type = 2;
8995 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
8996 if(!exp->expType)
8997 {
8998 exp->expType = op1->type;
8999 if(op1->type)
9000 op1->type->refCount++;
9001 }
9002 return 0x1;
9003 }
9004
9005 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9006 {
9007 char value2 = op2->__anon1.c;
9008
9009 exp->type = 2;
9010 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9011 if(!exp->expType)
9012 {
9013 exp->expType = op1->type;
9014 if(op1->type)
9015 op1->type->refCount++;
9016 }
9017 return 0x1;
9018 }
9019
9020 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9021 {
9022 unsigned char value2 = op2->__anon1.uc;
9023
9024 exp->type = 2;
9025 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9026 if(!exp->expType)
9027 {
9028 exp->expType = op1->type;
9029 if(op1->type)
9030 op1->type->refCount++;
9031 }
9032 return 0x1;
9033 }
9034
9035 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9036 {
9037 int value2 = op2->__anon1.i;
9038
9039 exp->type = 2;
9040 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9041 if(!exp->expType)
9042 {
9043 exp->expType = op1->type;
9044 if(op1->type)
9045 op1->type->refCount++;
9046 }
9047 return 0x1;
9048 }
9049
9050 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9051 {
9052 unsigned int value2 = op2->__anon1.ui;
9053
9054 exp->type = 2;
9055 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9056 if(!exp->expType)
9057 {
9058 exp->expType = op1->type;
9059 if(op1->type)
9060 op1->type->refCount++;
9061 }
9062 return 0x1;
9063 }
9064
9065 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9066 {
9067 long long value2 = op2->__anon1.i64;
9068
9069 exp->type = 2;
9070 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9071 if(!exp->expType)
9072 {
9073 exp->expType = op1->type;
9074 if(op1->type)
9075 op1->type->refCount++;
9076 }
9077 return 0x1;
9078 }
9079
9080 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9081 {
9082 uint64 value2 = op2->__anon1.ui64;
9083
9084 exp->type = 2;
9085 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9086 if(!exp->expType)
9087 {
9088 exp->expType = op1->type;
9089 if(op1->type)
9090 op1->type->refCount++;
9091 }
9092 return 0x1;
9093 }
9094
9095 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9096 {
9097 short value2 = op2->__anon1.s;
9098
9099 exp->type = 2;
9100 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9101 if(!exp->expType)
9102 {
9103 exp->expType = op1->type;
9104 if(op1->type)
9105 op1->type->refCount++;
9106 }
9107 return 0x1;
9108 }
9109
9110 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9111 {
9112 unsigned short value2 = op2->__anon1.us;
9113
9114 exp->type = 2;
9115 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9116 if(!exp->expType)
9117 {
9118 exp->expType = op1->type;
9119 if(op1->type)
9120 op1->type->refCount++;
9121 }
9122 return 0x1;
9123 }
9124
9125 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9126 {
9127 char value2 = op2->__anon1.c;
9128
9129 exp->type = 2;
9130 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9131 if(!exp->expType)
9132 {
9133 exp->expType = op1->type;
9134 if(op1->type)
9135 op1->type->refCount++;
9136 }
9137 return 0x1;
9138 }
9139
9140 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9141 {
9142 unsigned char value2 = op2->__anon1.uc;
9143
9144 exp->type = 2;
9145 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9146 if(!exp->expType)
9147 {
9148 exp->expType = op1->type;
9149 if(op1->type)
9150 op1->type->refCount++;
9151 }
9152 return 0x1;
9153 }
9154
9155 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9156 {
9157 int value2 = op2->__anon1.i;
9158
9159 exp->type = 2;
9160 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9161 if(!exp->expType)
9162 {
9163 exp->expType = op1->type;
9164 if(op1->type)
9165 op1->type->refCount++;
9166 }
9167 return 0x1;
9168 }
9169
9170 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9171 {
9172 unsigned int value2 = op2->__anon1.ui;
9173
9174 exp->type = 2;
9175 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9176 if(!exp->expType)
9177 {
9178 exp->expType = op1->type;
9179 if(op1->type)
9180 op1->type->refCount++;
9181 }
9182 return 0x1;
9183 }
9184
9185 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9186 {
9187 long long value2 = op2->__anon1.i64;
9188
9189 exp->type = 2;
9190 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9191 if(!exp->expType)
9192 {
9193 exp->expType = op1->type;
9194 if(op1->type)
9195 op1->type->refCount++;
9196 }
9197 return 0x1;
9198 }
9199
9200 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9201 {
9202 uint64 value2 = op2->__anon1.ui64;
9203
9204 exp->type = 2;
9205 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9206 if(!exp->expType)
9207 {
9208 exp->expType = op1->type;
9209 if(op1->type)
9210 op1->type->refCount++;
9211 }
9212 return 0x1;
9213 }
9214
9215 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9216 {
9217 short value2 = op2->__anon1.s;
9218
9219 exp->type = 2;
9220 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9221 if(!exp->expType)
9222 {
9223 exp->expType = op1->type;
9224 if(op1->type)
9225 op1->type->refCount++;
9226 }
9227 return 0x1;
9228 }
9229
9230 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9231 {
9232 unsigned short value2 = op2->__anon1.us;
9233
9234 exp->type = 2;
9235 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9236 if(!exp->expType)
9237 {
9238 exp->expType = op1->type;
9239 if(op1->type)
9240 op1->type->refCount++;
9241 }
9242 return 0x1;
9243 }
9244
9245 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9246 {
9247 char value2 = op2->__anon1.c;
9248
9249 exp->type = 2;
9250 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9251 if(!exp->expType)
9252 {
9253 exp->expType = op1->type;
9254 if(op1->type)
9255 op1->type->refCount++;
9256 }
9257 return 0x1;
9258 }
9259
9260 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9261 {
9262 unsigned char value2 = op2->__anon1.uc;
9263
9264 exp->type = 2;
9265 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9266 if(!exp->expType)
9267 {
9268 exp->expType = op1->type;
9269 if(op1->type)
9270 op1->type->refCount++;
9271 }
9272 return 0x1;
9273 }
9274
9275 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9276 {
9277 exp->type = 2;
9278 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9279 if(!exp->expType)
9280 {
9281 exp->expType = op1->type;
9282 if(op1->type)
9283 op1->type->refCount++;
9284 }
9285 return 0x1;
9286 }
9287
9288 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9289 {
9290 exp->type = 2;
9291 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9292 if(!exp->expType)
9293 {
9294 exp->expType = op1->type;
9295 if(op1->type)
9296 op1->type->refCount++;
9297 }
9298 return 0x1;
9299 }
9300
9301 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9302 {
9303 exp->type = 2;
9304 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9305 if(!exp->expType)
9306 {
9307 exp->expType = op1->type;
9308 if(op1->type)
9309 op1->type->refCount++;
9310 }
9311 return 0x1;
9312 }
9313
9314 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9315 {
9316 exp->type = 2;
9317 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9318 if(!exp->expType)
9319 {
9320 exp->expType = op1->type;
9321 if(op1->type)
9322 op1->type->refCount++;
9323 }
9324 return 0x1;
9325 }
9326
9327 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9328 {
9329 exp->type = 2;
9330 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9331 if(!exp->expType)
9332 {
9333 exp->expType = op1->type;
9334 if(op1->type)
9335 op1->type->refCount++;
9336 }
9337 return 0x1;
9338 }
9339
9340 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9341 {
9342 exp->type = 2;
9343 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9344 if(!exp->expType)
9345 {
9346 exp->expType = op1->type;
9347 if(op1->type)
9348 op1->type->refCount++;
9349 }
9350 return 0x1;
9351 }
9352
9353 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9354 {
9355 exp->type = 2;
9356 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9357 if(!exp->expType)
9358 {
9359 exp->expType = op1->type;
9360 if(op1->type)
9361 op1->type->refCount++;
9362 }
9363 return 0x1;
9364 }
9365
9366 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9367 {
9368 exp->type = 2;
9369 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9370 if(!exp->expType)
9371 {
9372 exp->expType = op1->type;
9373 if(op1->type)
9374 op1->type->refCount++;
9375 }
9376 return 0x1;
9377 }
9378
9379 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9380 {
9381 int value2 = op2->__anon1.i;
9382
9383 exp->type = 2;
9384 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9385 if(!exp->expType)
9386 {
9387 exp->expType = op1->type;
9388 if(op1->type)
9389 op1->type->refCount++;
9390 }
9391 return 0x1;
9392 }
9393
9394 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9395 {
9396 unsigned int value2 = op2->__anon1.ui;
9397
9398 exp->type = 2;
9399 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9400 if(!exp->expType)
9401 {
9402 exp->expType = op1->type;
9403 if(op1->type)
9404 op1->type->refCount++;
9405 }
9406 return 0x1;
9407 }
9408
9409 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9410 {
9411 long long value2 = op2->__anon1.i64;
9412
9413 exp->type = 2;
9414 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9415 if(!exp->expType)
9416 {
9417 exp->expType = op1->type;
9418 if(op1->type)
9419 op1->type->refCount++;
9420 }
9421 return 0x1;
9422 }
9423
9424 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9425 {
9426 uint64 value2 = op2->__anon1.ui64;
9427
9428 exp->type = 2;
9429 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9430 if(!exp->expType)
9431 {
9432 exp->expType = op1->type;
9433 if(op1->type)
9434 op1->type->refCount++;
9435 }
9436 return 0x1;
9437 }
9438
9439 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9440 {
9441 short value2 = op2->__anon1.s;
9442
9443 exp->type = 2;
9444 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9445 if(!exp->expType)
9446 {
9447 exp->expType = op1->type;
9448 if(op1->type)
9449 op1->type->refCount++;
9450 }
9451 return 0x1;
9452 }
9453
9454 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9455 {
9456 unsigned short value2 = op2->__anon1.us;
9457
9458 exp->type = 2;
9459 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9460 if(!exp->expType)
9461 {
9462 exp->expType = op1->type;
9463 if(op1->type)
9464 op1->type->refCount++;
9465 }
9466 return 0x1;
9467 }
9468
9469 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9470 {
9471 char value2 = op2->__anon1.c;
9472
9473 exp->type = 2;
9474 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9475 if(!exp->expType)
9476 {
9477 exp->expType = op1->type;
9478 if(op1->type)
9479 op1->type->refCount++;
9480 }
9481 return 0x1;
9482 }
9483
9484 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9485 {
9486 unsigned char value2 = op2->__anon1.uc;
9487
9488 exp->type = 2;
9489 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9490 if(!exp->expType)
9491 {
9492 exp->expType = op1->type;
9493 if(op1->type)
9494 op1->type->refCount++;
9495 }
9496 return 0x1;
9497 }
9498
9499 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9500 {
9501 float value2 = op2->__anon1.f;
9502
9503 exp->type = 2;
9504 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9505 if(!exp->expType)
9506 {
9507 exp->expType = op1->type;
9508 if(op1->type)
9509 op1->type->refCount++;
9510 }
9511 return 0x1;
9512 }
9513
9514 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9515 {
9516 double value2 = op2->__anon1.d;
9517
9518 exp->type = 2;
9519 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9520 if(!exp->expType)
9521 {
9522 exp->expType = op1->type;
9523 if(op1->type)
9524 op1->type->refCount++;
9525 }
9526 return 0x1;
9527 }
9528
9529 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9530 {
9531 int value2 = op2->__anon1.i;
9532
9533 exp->type = 2;
9534 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9535 if(!exp->expType)
9536 {
9537 exp->expType = op1->type;
9538 if(op1->type)
9539 op1->type->refCount++;
9540 }
9541 return 0x1;
9542 }
9543
9544 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9545 {
9546 unsigned int value2 = op2->__anon1.ui;
9547
9548 exp->type = 2;
9549 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9550 if(!exp->expType)
9551 {
9552 exp->expType = op1->type;
9553 if(op1->type)
9554 op1->type->refCount++;
9555 }
9556 return 0x1;
9557 }
9558
9559 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9560 {
9561 long long value2 = op2->__anon1.i64;
9562
9563 exp->type = 2;
9564 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9565 if(!exp->expType)
9566 {
9567 exp->expType = op1->type;
9568 if(op1->type)
9569 op1->type->refCount++;
9570 }
9571 return 0x1;
9572 }
9573
9574 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9575 {
9576 uint64 value2 = op2->__anon1.ui64;
9577
9578 exp->type = 2;
9579 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9580 if(!exp->expType)
9581 {
9582 exp->expType = op1->type;
9583 if(op1->type)
9584 op1->type->refCount++;
9585 }
9586 return 0x1;
9587 }
9588
9589 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9590 {
9591 short value2 = op2->__anon1.s;
9592
9593 exp->type = 2;
9594 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9595 if(!exp->expType)
9596 {
9597 exp->expType = op1->type;
9598 if(op1->type)
9599 op1->type->refCount++;
9600 }
9601 return 0x1;
9602 }
9603
9604 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9605 {
9606 unsigned short value2 = op2->__anon1.us;
9607
9608 exp->type = 2;
9609 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9610 if(!exp->expType)
9611 {
9612 exp->expType = op1->type;
9613 if(op1->type)
9614 op1->type->refCount++;
9615 }
9616 return 0x1;
9617 }
9618
9619 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9620 {
9621 char value2 = op2->__anon1.c;
9622
9623 exp->type = 2;
9624 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9625 if(!exp->expType)
9626 {
9627 exp->expType = op1->type;
9628 if(op1->type)
9629 op1->type->refCount++;
9630 }
9631 return 0x1;
9632 }
9633
9634 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9635 {
9636 unsigned char value2 = op2->__anon1.uc;
9637
9638 exp->type = 2;
9639 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9640 if(!exp->expType)
9641 {
9642 exp->expType = op1->type;
9643 if(op1->type)
9644 op1->type->refCount++;
9645 }
9646 return 0x1;
9647 }
9648
9649 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9650 {
9651 float value2 = op2->__anon1.f;
9652
9653 exp->type = 2;
9654 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9655 if(!exp->expType)
9656 {
9657 exp->expType = op1->type;
9658 if(op1->type)
9659 op1->type->refCount++;
9660 }
9661 return 0x1;
9662 }
9663
9664 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9665 {
9666 double value2 = op2->__anon1.d;
9667
9668 exp->type = 2;
9669 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9670 if(!exp->expType)
9671 {
9672 exp->expType = op1->type;
9673 if(op1->type)
9674 op1->type->refCount++;
9675 }
9676 return 0x1;
9677 }
9678
9679 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9680 {
9681 int value2 = op2->__anon1.i;
9682
9683 exp->type = 2;
9684 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9685 if(!exp->expType)
9686 {
9687 exp->expType = op1->type;
9688 if(op1->type)
9689 op1->type->refCount++;
9690 }
9691 return 0x1;
9692 }
9693
9694 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9695 {
9696 unsigned int value2 = op2->__anon1.ui;
9697
9698 exp->type = 2;
9699 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9700 if(!exp->expType)
9701 {
9702 exp->expType = op1->type;
9703 if(op1->type)
9704 op1->type->refCount++;
9705 }
9706 return 0x1;
9707 }
9708
9709 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9710 {
9711 long long value2 = op2->__anon1.i64;
9712
9713 exp->type = 2;
9714 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9715 if(!exp->expType)
9716 {
9717 exp->expType = op1->type;
9718 if(op1->type)
9719 op1->type->refCount++;
9720 }
9721 return 0x1;
9722 }
9723
9724 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9725 {
9726 uint64 value2 = op2->__anon1.ui64;
9727
9728 exp->type = 2;
9729 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9730 if(!exp->expType)
9731 {
9732 exp->expType = op1->type;
9733 if(op1->type)
9734 op1->type->refCount++;
9735 }
9736 return 0x1;
9737 }
9738
9739 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9740 {
9741 short value2 = op2->__anon1.s;
9742
9743 exp->type = 2;
9744 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9745 if(!exp->expType)
9746 {
9747 exp->expType = op1->type;
9748 if(op1->type)
9749 op1->type->refCount++;
9750 }
9751 return 0x1;
9752 }
9753
9754 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9755 {
9756 unsigned short value2 = op2->__anon1.us;
9757
9758 exp->type = 2;
9759 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9760 if(!exp->expType)
9761 {
9762 exp->expType = op1->type;
9763 if(op1->type)
9764 op1->type->refCount++;
9765 }
9766 return 0x1;
9767 }
9768
9769 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9770 {
9771 char value2 = op2->__anon1.c;
9772
9773 exp->type = 2;
9774 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9775 if(!exp->expType)
9776 {
9777 exp->expType = op1->type;
9778 if(op1->type)
9779 op1->type->refCount++;
9780 }
9781 return 0x1;
9782 }
9783
9784 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9785 {
9786 unsigned char value2 = op2->__anon1.uc;
9787
9788 exp->type = 2;
9789 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9790 if(!exp->expType)
9791 {
9792 exp->expType = op1->type;
9793 if(op1->type)
9794 op1->type->refCount++;
9795 }
9796 return 0x1;
9797 }
9798
9799 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9800 {
9801 float value2 = op2->__anon1.f;
9802
9803 exp->type = 2;
9804 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9805 if(!exp->expType)
9806 {
9807 exp->expType = op1->type;
9808 if(op1->type)
9809 op1->type->refCount++;
9810 }
9811 return 0x1;
9812 }
9813
9814 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9815 {
9816 double value2 = op2->__anon1.d;
9817
9818 exp->type = 2;
9819 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9820 if(!exp->expType)
9821 {
9822 exp->expType = op1->type;
9823 if(op1->type)
9824 op1->type->refCount++;
9825 }
9826 return 0x1;
9827 }
9828
9829 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9830 {
9831 int value2 = op2->__anon1.i;
9832
9833 exp->type = 2;
9834 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9835 if(!exp->expType)
9836 {
9837 exp->expType = op1->type;
9838 if(op1->type)
9839 op1->type->refCount++;
9840 }
9841 return 0x1;
9842 }
9843
9844 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9845 {
9846 unsigned int value2 = op2->__anon1.ui;
9847
9848 exp->type = 2;
9849 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9850 if(!exp->expType)
9851 {
9852 exp->expType = op1->type;
9853 if(op1->type)
9854 op1->type->refCount++;
9855 }
9856 return 0x1;
9857 }
9858
9859 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9860 {
9861 long long value2 = op2->__anon1.i64;
9862
9863 exp->type = 2;
9864 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9865 if(!exp->expType)
9866 {
9867 exp->expType = op1->type;
9868 if(op1->type)
9869 op1->type->refCount++;
9870 }
9871 return 0x1;
9872 }
9873
9874 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9875 {
9876 uint64 value2 = op2->__anon1.ui64;
9877
9878 exp->type = 2;
9879 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9880 if(!exp->expType)
9881 {
9882 exp->expType = op1->type;
9883 if(op1->type)
9884 op1->type->refCount++;
9885 }
9886 return 0x1;
9887 }
9888
9889 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9890 {
9891 short value2 = op2->__anon1.s;
9892
9893 exp->type = 2;
9894 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9895 if(!exp->expType)
9896 {
9897 exp->expType = op1->type;
9898 if(op1->type)
9899 op1->type->refCount++;
9900 }
9901 return 0x1;
9902 }
9903
9904 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9905 {
9906 unsigned short value2 = op2->__anon1.us;
9907
9908 exp->type = 2;
9909 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9910 if(!exp->expType)
9911 {
9912 exp->expType = op1->type;
9913 if(op1->type)
9914 op1->type->refCount++;
9915 }
9916 return 0x1;
9917 }
9918
9919 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9920 {
9921 char value2 = op2->__anon1.c;
9922
9923 exp->type = 2;
9924 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9925 if(!exp->expType)
9926 {
9927 exp->expType = op1->type;
9928 if(op1->type)
9929 op1->type->refCount++;
9930 }
9931 return 0x1;
9932 }
9933
9934 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9935 {
9936 unsigned char value2 = op2->__anon1.uc;
9937
9938 exp->type = 2;
9939 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9940 if(!exp->expType)
9941 {
9942 exp->expType = op1->type;
9943 if(op1->type)
9944 op1->type->refCount++;
9945 }
9946 return 0x1;
9947 }
9948
9949 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9950 {
9951 float value2 = op2->__anon1.f;
9952
9953 exp->type = 2;
9954 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9955 if(!exp->expType)
9956 {
9957 exp->expType = op1->type;
9958 if(op1->type)
9959 op1->type->refCount++;
9960 }
9961 return 0x1;
9962 }
9963
9964 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9965 {
9966 double value2 = op2->__anon1.d;
9967
9968 exp->type = 2;
9969 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9970 if(!exp->expType)
9971 {
9972 exp->expType = op1->type;
9973 if(op1->type)
9974 op1->type->refCount++;
9975 }
9976 return 0x1;
9977 }
9978
9979 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9980 {
9981 int value2 = op2->__anon1.i;
9982
9983 exp->type = 2;
9984 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
9985 if(!exp->expType)
9986 {
9987 exp->expType = op1->type;
9988 if(op1->type)
9989 op1->type->refCount++;
9990 }
9991 return 0x1;
9992 }
9993
9994 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9995 {
9996 unsigned int value2 = op2->__anon1.ui;
9997
9998 exp->type = 2;
9999 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10000 if(!exp->expType)
10001 {
10002 exp->expType = op1->type;
10003 if(op1->type)
10004 op1->type->refCount++;
10005 }
10006 return 0x1;
10007 }
10008
10009 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10010 {
10011 long long value2 = op2->__anon1.i64;
10012
10013 exp->type = 2;
10014 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10015 if(!exp->expType)
10016 {
10017 exp->expType = op1->type;
10018 if(op1->type)
10019 op1->type->refCount++;
10020 }
10021 return 0x1;
10022 }
10023
10024 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10025 {
10026 uint64 value2 = op2->__anon1.ui64;
10027
10028 exp->type = 2;
10029 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10030 if(!exp->expType)
10031 {
10032 exp->expType = op1->type;
10033 if(op1->type)
10034 op1->type->refCount++;
10035 }
10036 return 0x1;
10037 }
10038
10039 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10040 {
10041 short value2 = op2->__anon1.s;
10042
10043 exp->type = 2;
10044 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10045 if(!exp->expType)
10046 {
10047 exp->expType = op1->type;
10048 if(op1->type)
10049 op1->type->refCount++;
10050 }
10051 return 0x1;
10052 }
10053
10054 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10055 {
10056 unsigned short value2 = op2->__anon1.us;
10057
10058 exp->type = 2;
10059 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10060 if(!exp->expType)
10061 {
10062 exp->expType = op1->type;
10063 if(op1->type)
10064 op1->type->refCount++;
10065 }
10066 return 0x1;
10067 }
10068
10069 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10070 {
10071 char value2 = op2->__anon1.c;
10072
10073 exp->type = 2;
10074 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10075 if(!exp->expType)
10076 {
10077 exp->expType = op1->type;
10078 if(op1->type)
10079 op1->type->refCount++;
10080 }
10081 return 0x1;
10082 }
10083
10084 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10085 {
10086 unsigned char value2 = op2->__anon1.uc;
10087
10088 exp->type = 2;
10089 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10090 if(!exp->expType)
10091 {
10092 exp->expType = op1->type;
10093 if(op1->type)
10094 op1->type->refCount++;
10095 }
10096 return 0x1;
10097 }
10098
10099 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10100 {
10101 float value2 = op2->__anon1.f;
10102
10103 exp->type = 2;
10104 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10105 if(!exp->expType)
10106 {
10107 exp->expType = op1->type;
10108 if(op1->type)
10109 op1->type->refCount++;
10110 }
10111 return 0x1;
10112 }
10113
10114 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10115 {
10116 double value2 = op2->__anon1.d;
10117
10118 exp->type = 2;
10119 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10120 if(!exp->expType)
10121 {
10122 exp->expType = op1->type;
10123 if(op1->type)
10124 op1->type->refCount++;
10125 }
10126 return 0x1;
10127 }
10128
10129 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10130 {
10131 int value2 = op2->__anon1.i;
10132
10133 exp->type = 2;
10134 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10135 if(!exp->expType)
10136 {
10137 exp->expType = op1->type;
10138 if(op1->type)
10139 op1->type->refCount++;
10140 }
10141 return 0x1;
10142 }
10143
10144 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10145 {
10146 unsigned int value2 = op2->__anon1.ui;
10147
10148 exp->type = 2;
10149 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10150 if(!exp->expType)
10151 {
10152 exp->expType = op1->type;
10153 if(op1->type)
10154 op1->type->refCount++;
10155 }
10156 return 0x1;
10157 }
10158
10159 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10160 {
10161 long long value2 = op2->__anon1.i64;
10162
10163 exp->type = 2;
10164 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10165 if(!exp->expType)
10166 {
10167 exp->expType = op1->type;
10168 if(op1->type)
10169 op1->type->refCount++;
10170 }
10171 return 0x1;
10172 }
10173
10174 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10175 {
10176 uint64 value2 = op2->__anon1.ui64;
10177
10178 exp->type = 2;
10179 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10180 if(!exp->expType)
10181 {
10182 exp->expType = op1->type;
10183 if(op1->type)
10184 op1->type->refCount++;
10185 }
10186 return 0x1;
10187 }
10188
10189 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10190 {
10191 short value2 = op2->__anon1.s;
10192
10193 exp->type = 2;
10194 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10195 if(!exp->expType)
10196 {
10197 exp->expType = op1->type;
10198 if(op1->type)
10199 op1->type->refCount++;
10200 }
10201 return 0x1;
10202 }
10203
10204 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10205 {
10206 unsigned short value2 = op2->__anon1.us;
10207
10208 exp->type = 2;
10209 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10210 if(!exp->expType)
10211 {
10212 exp->expType = op1->type;
10213 if(op1->type)
10214 op1->type->refCount++;
10215 }
10216 return 0x1;
10217 }
10218
10219 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10220 {
10221 char value2 = op2->__anon1.c;
10222
10223 exp->type = 2;
10224 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10225 if(!exp->expType)
10226 {
10227 exp->expType = op1->type;
10228 if(op1->type)
10229 op1->type->refCount++;
10230 }
10231 return 0x1;
10232 }
10233
10234 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10235 {
10236 unsigned char value2 = op2->__anon1.uc;
10237
10238 exp->type = 2;
10239 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10240 if(!exp->expType)
10241 {
10242 exp->expType = op1->type;
10243 if(op1->type)
10244 op1->type->refCount++;
10245 }
10246 return 0x1;
10247 }
10248
10249 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10250 {
10251 float value2 = op2->__anon1.f;
10252
10253 exp->type = 2;
10254 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10255 if(!exp->expType)
10256 {
10257 exp->expType = op1->type;
10258 if(op1->type)
10259 op1->type->refCount++;
10260 }
10261 return 0x1;
10262 }
10263
10264 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10265 {
10266 double value2 = op2->__anon1.d;
10267
10268 exp->type = 2;
10269 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10270 if(!exp->expType)
10271 {
10272 exp->expType = op1->type;
10273 if(op1->type)
10274 op1->type->refCount++;
10275 }
10276 return 0x1;
10277 }
10278
10279 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10280 {
10281 int value2 = op2->__anon1.i;
10282
10283 exp->type = 2;
10284 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10285 if(!exp->expType)
10286 {
10287 exp->expType = op1->type;
10288 if(op1->type)
10289 op1->type->refCount++;
10290 }
10291 return 0x1;
10292 }
10293
10294 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10295 {
10296 unsigned int value2 = op2->__anon1.ui;
10297
10298 exp->type = 2;
10299 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10300 if(!exp->expType)
10301 {
10302 exp->expType = op1->type;
10303 if(op1->type)
10304 op1->type->refCount++;
10305 }
10306 return 0x1;
10307 }
10308
10309 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10310 {
10311 long long value2 = op2->__anon1.i64;
10312
10313 exp->type = 2;
10314 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10315 if(!exp->expType)
10316 {
10317 exp->expType = op1->type;
10318 if(op1->type)
10319 op1->type->refCount++;
10320 }
10321 return 0x1;
10322 }
10323
10324 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10325 {
10326 uint64 value2 = op2->__anon1.ui64;
10327
10328 exp->type = 2;
10329 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10330 if(!exp->expType)
10331 {
10332 exp->expType = op1->type;
10333 if(op1->type)
10334 op1->type->refCount++;
10335 }
10336 return 0x1;
10337 }
10338
10339 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10340 {
10341 short value2 = op2->__anon1.s;
10342
10343 exp->type = 2;
10344 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10345 if(!exp->expType)
10346 {
10347 exp->expType = op1->type;
10348 if(op1->type)
10349 op1->type->refCount++;
10350 }
10351 return 0x1;
10352 }
10353
10354 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10355 {
10356 unsigned short value2 = op2->__anon1.us;
10357
10358 exp->type = 2;
10359 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10360 if(!exp->expType)
10361 {
10362 exp->expType = op1->type;
10363 if(op1->type)
10364 op1->type->refCount++;
10365 }
10366 return 0x1;
10367 }
10368
10369 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10370 {
10371 char value2 = op2->__anon1.c;
10372
10373 exp->type = 2;
10374 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10375 if(!exp->expType)
10376 {
10377 exp->expType = op1->type;
10378 if(op1->type)
10379 op1->type->refCount++;
10380 }
10381 return 0x1;
10382 }
10383
10384 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10385 {
10386 unsigned char value2 = op2->__anon1.uc;
10387
10388 exp->type = 2;
10389 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10390 if(!exp->expType)
10391 {
10392 exp->expType = op1->type;
10393 if(op1->type)
10394 op1->type->refCount++;
10395 }
10396 return 0x1;
10397 }
10398
10399 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10400 {
10401 float value2 = op2->__anon1.f;
10402
10403 exp->type = 2;
10404 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10405 if(!exp->expType)
10406 {
10407 exp->expType = op1->type;
10408 if(op1->type)
10409 op1->type->refCount++;
10410 }
10411 return 0x1;
10412 }
10413
10414 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10415 {
10416 double value2 = op2->__anon1.d;
10417
10418 exp->type = 2;
10419 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10420 if(!exp->expType)
10421 {
10422 exp->expType = op1->type;
10423 if(op1->type)
10424 op1->type->refCount++;
10425 }
10426 return 0x1;
10427 }
10428
10429 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10430 {
10431 int value2 = op2->__anon1.i;
10432
10433 exp->type = 2;
10434 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10435 if(!exp->expType)
10436 {
10437 exp->expType = op1->type;
10438 if(op1->type)
10439 op1->type->refCount++;
10440 }
10441 return 0x1;
10442 }
10443
10444 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10445 {
10446 unsigned int value2 = op2->__anon1.ui;
10447
10448 exp->type = 2;
10449 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10450 if(!exp->expType)
10451 {
10452 exp->expType = op1->type;
10453 if(op1->type)
10454 op1->type->refCount++;
10455 }
10456 return 0x1;
10457 }
10458
10459 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10460 {
10461 long long value2 = op2->__anon1.i64;
10462
10463 exp->type = 2;
10464 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10465 if(!exp->expType)
10466 {
10467 exp->expType = op1->type;
10468 if(op1->type)
10469 op1->type->refCount++;
10470 }
10471 return 0x1;
10472 }
10473
10474 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10475 {
10476 uint64 value2 = op2->__anon1.ui64;
10477
10478 exp->type = 2;
10479 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10480 if(!exp->expType)
10481 {
10482 exp->expType = op1->type;
10483 if(op1->type)
10484 op1->type->refCount++;
10485 }
10486 return 0x1;
10487 }
10488
10489 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10490 {
10491 short value2 = op2->__anon1.s;
10492
10493 exp->type = 2;
10494 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10495 if(!exp->expType)
10496 {
10497 exp->expType = op1->type;
10498 if(op1->type)
10499 op1->type->refCount++;
10500 }
10501 return 0x1;
10502 }
10503
10504 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10505 {
10506 unsigned short value2 = op2->__anon1.us;
10507
10508 exp->type = 2;
10509 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10510 if(!exp->expType)
10511 {
10512 exp->expType = op1->type;
10513 if(op1->type)
10514 op1->type->refCount++;
10515 }
10516 return 0x1;
10517 }
10518
10519 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10520 {
10521 char value2 = op2->__anon1.c;
10522
10523 exp->type = 2;
10524 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10525 if(!exp->expType)
10526 {
10527 exp->expType = op1->type;
10528 if(op1->type)
10529 op1->type->refCount++;
10530 }
10531 return 0x1;
10532 }
10533
10534 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10535 {
10536 unsigned char value2 = op2->__anon1.uc;
10537
10538 exp->type = 2;
10539 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10540 if(!exp->expType)
10541 {
10542 exp->expType = op1->type;
10543 if(op1->type)
10544 op1->type->refCount++;
10545 }
10546 return 0x1;
10547 }
10548
10549 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10550 {
10551 float value2 = op2->__anon1.f;
10552
10553 exp->type = 2;
10554 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10555 if(!exp->expType)
10556 {
10557 exp->expType = op1->type;
10558 if(op1->type)
10559 op1->type->refCount++;
10560 }
10561 return 0x1;
10562 }
10563
10564 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10565 {
10566 double value2 = op2->__anon1.d;
10567
10568 exp->type = 2;
10569 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10570 if(!exp->expType)
10571 {
10572 exp->expType = op1->type;
10573 if(op1->type)
10574 op1->type->refCount++;
10575 }
10576 return 0x1;
10577 }
10578
10579 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10580 {
10581 exp->type = 2;
10582 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10583 if(!exp->expType)
10584 {
10585 exp->expType = op1->type;
10586 if(op1->type)
10587 op1->type->refCount++;
10588 }
10589 return 0x1;
10590 }
10591
10592 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10593 {
10594 exp->type = 2;
10595 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10596 if(!exp->expType)
10597 {
10598 exp->expType = op1->type;
10599 if(op1->type)
10600 op1->type->refCount++;
10601 }
10602 return 0x1;
10603 }
10604
10605 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10606 {
10607 exp->type = 2;
10608 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10609 if(!exp->expType)
10610 {
10611 exp->expType = op1->type;
10612 if(op1->type)
10613 op1->type->refCount++;
10614 }
10615 return 0x1;
10616 }
10617
10618 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10619 {
10620 exp->type = 2;
10621 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10622 if(!exp->expType)
10623 {
10624 exp->expType = op1->type;
10625 if(op1->type)
10626 op1->type->refCount++;
10627 }
10628 return 0x1;
10629 }
10630
10631 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10632 {
10633 exp->type = 2;
10634 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10635 if(!exp->expType)
10636 {
10637 exp->expType = op1->type;
10638 if(op1->type)
10639 op1->type->refCount++;
10640 }
10641 return 0x1;
10642 }
10643
10644 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10645 {
10646 exp->type = 2;
10647 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10648 if(!exp->expType)
10649 {
10650 exp->expType = op1->type;
10651 if(op1->type)
10652 op1->type->refCount++;
10653 }
10654 return 0x1;
10655 }
10656
10657 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10658 {
10659 exp->type = 2;
10660 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10661 if(!exp->expType)
10662 {
10663 exp->expType = op1->type;
10664 if(op1->type)
10665 op1->type->refCount++;
10666 }
10667 return 0x1;
10668 }
10669
10670 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10671 {
10672 exp->type = 2;
10673 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10674 if(!exp->expType)
10675 {
10676 exp->expType = op1->type;
10677 if(op1->type)
10678 op1->type->refCount++;
10679 }
10680 return 0x1;
10681 }
10682
10683 struct OpTable intOps =
10684 {
10685 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
10686 };
10687
10688 struct OpTable uintOps =
10689 {
10690 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
10691 };
10692
10693 struct OpTable int64Ops =
10694 {
10695 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
10696 };
10697
10698 struct OpTable uint64Ops =
10699 {
10700 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
10701 };
10702
10703 struct OpTable shortOps =
10704 {
10705 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
10706 };
10707
10708 struct OpTable ushortOps =
10709 {
10710 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
10711 };
10712
10713 struct OpTable floatOps =
10714 {
10715 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
10716 };
10717
10718 struct OpTable doubleOps =
10719 {
10720 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
10721 };
10722
10723 struct OpTable charOps =
10724 {
10725 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
10726 };
10727
10728 struct OpTable ucharOps =
10729 {
10730 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
10731 };
10732
10733 void ReadString(char * output, char * string)
10734 {
10735 int len = strlen(string);
10736 int c, d = 0;
10737 unsigned int quoted = 0x0, escaped = 0x0;
10738
10739 for(c = 0; c < len; c++)
10740 {
10741 char ch = string[c];
10742
10743 if(escaped)
10744 {
10745 switch(ch)
10746 {
10747 case 'n':
10748 output[d] = '\n';
10749 break;
10750 case 't':
10751 output[d] = '\t';
10752 break;
10753 case 'a':
10754 output[d] = '\a';
10755 break;
10756 case 'b':
10757 output[d] = '\b';
10758 break;
10759 case 'f':
10760 output[d] = '\f';
10761 break;
10762 case 'r':
10763 output[d] = '\r';
10764 break;
10765 case 'v':
10766 output[d] = '\v';
10767 break;
10768 case '\\':
10769 output[d] = '\\';
10770 break;
10771 case '\"':
10772 output[d] = '\"';
10773 break;
10774 case '\'':
10775 output[d] = '\'';
10776 break;
10777 default:
10778 output[d] = ch;
10779 }
10780 d++;
10781 escaped = 0x0;
10782 }
10783 else
10784 {
10785 if(ch == '\"')
10786 quoted ^= 0x1;
10787 else if(quoted)
10788 {
10789 if(ch == '\\')
10790 escaped = 0x1;
10791 else
10792 output[d++] = ch;
10793 }
10794 }
10795 }
10796 output[d] = '\0';
10797 }
10798
10799 int UnescapeString(char * d, char * s, int len)
10800 {
10801 int j = 0, k = 0;
10802 char ch;
10803
10804 while(j < len && (ch = s[j]))
10805 {
10806 switch(ch)
10807 {
10808 case '\\':
10809 switch((ch = s[++j]))
10810 {
10811 case 'n':
10812 d[k] = '\n';
10813 break;
10814 case 't':
10815 d[k] = '\t';
10816 break;
10817 case 'a':
10818 d[k] = '\a';
10819 break;
10820 case 'b':
10821 d[k] = '\b';
10822 break;
10823 case 'f':
10824 d[k] = '\f';
10825 break;
10826 case 'r':
10827 d[k] = '\r';
10828 break;
10829 case 'v':
10830 d[k] = '\v';
10831 break;
10832 case '\\':
10833 d[k] = '\\';
10834 break;
10835 case '\"':
10836 d[k] = '\"';
10837 break;
10838 case '\'':
10839 d[k] = '\'';
10840 break;
10841 default:
10842 d[k] = '\\';
10843 d[k] = ch;
10844 }
10845 break;
10846 default:
10847 d[k] = ch;
10848 }
10849 j++, k++;
10850 }
10851 d[k] = '\0';
10852 return k;
10853 }
10854
10855 char * OffsetEscapedString(char * s, int len, int offset)
10856 {
10857 char ch;
10858 int j = 0, k = 0;
10859
10860 while(j < len && k < offset && (ch = s[j]))
10861 {
10862 if(ch == '\\')
10863 ++j;
10864 j++, k++;
10865 }
10866 return (k == offset) ? s + j : (((void *)0));
10867 }
10868
10869 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10870
10871 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10872
10873 extern double strtod(const char * , char * * );
10874
10875 extern float (* __ecereMethod_float_inf)(void);
10876
10877 extern float (* __ecereMethod_float_nan)(void);
10878
10879 extern double (* __ecereMethod_double_inf)(void);
10880
10881 extern double (* __ecereMethod_double_nan)(void);
10882
10883 struct Operand GetOperand(struct Expression * exp)
10884 {
10885 struct Operand op =
10886 {
10887 0, 0, 0,
10888 .__anon1 = {
10889 .c = 0
10890 },
10891 {
10892 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10893 }
10894 };
10895 struct Type * type = exp->expType;
10896
10897 if(type)
10898 {
10899 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))
10900 {
10901 if(!type->__anon1._class->__anon1.registered->dataType)
10902 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
10903 type = type->__anon1._class->__anon1.registered->dataType;
10904 }
10905 if(exp->type == 3 && op.kind == 13)
10906 {
10907 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10908 op.kind = 13;
10909 op.ops = uint64Ops;
10910 }
10911 else if(exp->isConstant && exp->type == 2)
10912 {
10913 op.kind = type->kind;
10914 op.type = exp->expType;
10915 switch(op.kind)
10916 {
10917 case 24:
10918 case 1:
10919 {
10920 if(exp->__anon1.__anon1.constant[0] == '\'')
10921 {
10922 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10923 op.ops = charOps;
10924 }
10925 else if(type->isSigned)
10926 {
10927 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10928 op.ops = charOps;
10929 }
10930 else
10931 {
10932 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10933 op.ops = ucharOps;
10934 }
10935 break;
10936 }
10937 case 2:
10938 if(type->isSigned)
10939 {
10940 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10941 op.ops = shortOps;
10942 }
10943 else
10944 {
10945 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10946 op.ops = ushortOps;
10947 }
10948 break;
10949 case 3:
10950 case 5:
10951 if(type->isSigned)
10952 {
10953 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10954 op.ops = intOps;
10955 }
10956 else
10957 {
10958 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10959 op.ops = uintOps;
10960 }
10961 op.kind = 3;
10962 break;
10963 case 4:
10964 if(type->isSigned)
10965 {
10966 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10967 op.ops = int64Ops;
10968 }
10969 else
10970 {
10971 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10972 op.ops = uint64Ops;
10973 }
10974 op.kind = 4;
10975 break;
10976 case 22:
10977 if(type->isSigned)
10978 {
10979 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10980 op.ops = int64Ops;
10981 }
10982 else
10983 {
10984 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10985 op.ops = uint64Ops;
10986 }
10987 op.kind = 4;
10988 break;
10989 case 23:
10990 if(type->isSigned)
10991 {
10992 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10993 op.ops = int64Ops;
10994 }
10995 else
10996 {
10997 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10998 op.ops = uint64Ops;
10999 }
11000 op.kind = 4;
11001 break;
11002 case 6:
11003 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11004 op.__anon1.f = __ecereMethod_float_inf();
11005 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11006 op.__anon1.f = -__ecereMethod_float_inf();
11007 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11008 op.__anon1.f = __ecereMethod_float_nan();
11009 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11010 op.__anon1.f = -__ecereMethod_float_nan();
11011 else
11012 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11013 op.ops = floatOps;
11014 break;
11015 case 7:
11016 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11017 op.__anon1.d = __ecereMethod_double_inf();
11018 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11019 op.__anon1.d = -__ecereMethod_double_inf();
11020 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11021 op.__anon1.d = __ecereMethod_double_nan();
11022 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11023 op.__anon1.d = -__ecereMethod_double_nan();
11024 else
11025 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11026 op.ops = doubleOps;
11027 break;
11028 case 12:
11029 case 13:
11030 case 8:
11031 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11032 op.kind = 13;
11033 op.ops = uint64Ops;
11034 break;
11035 }
11036 }
11037 }
11038 return op;
11039 }
11040
11041 int __ecereVMethodID_class_OnGetString;
11042
11043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11044
11045 static __attribute__((unused)) void UnusedFunction()
11046 {
11047 int a;
11048
11049 ((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);
11050 }
11051
11052 extern int __ecereVMethodID_class_OnGetString;
11053
11054 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11055 {
11056 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11057
11058 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11059 {
11060 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11061 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11062 else
11063 {
11064 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11065 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11066 struct Type * type;
11067 void * ptr = inst->data + dataMember->offset + offset;
11068 char * result = (((void *)0));
11069
11070 exp->loc = member->loc = inst->loc;
11071 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11072 if(!dataMember->dataType)
11073 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11074 type = dataMember->dataType;
11075 if(type->kind == 8)
11076 {
11077 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11078
11079 if(_class->type == 4)
11080 {
11081 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11082
11083 if(enumClass)
11084 {
11085 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11086 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11087
11088 for(item = e->values.first; item; item = item->next)
11089 {
11090 if((int)item->data == *(int *)ptr)
11091 {
11092 result = item->name;
11093 break;
11094 }
11095 }
11096 if(result)
11097 {
11098 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11099 exp->type = 0;
11100 exp->destType = MkClassType(_class->fullName);
11101 ProcessExpressionType(exp);
11102 }
11103 }
11104 }
11105 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11106 {
11107 if(!_class->dataType)
11108 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11109 type = _class->dataType;
11110 }
11111 }
11112 if(!result)
11113 {
11114 switch(type->kind)
11115 {
11116 case 6:
11117 {
11118 FreeExpContents(exp);
11119 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11120 exp->type = 2;
11121 break;
11122 }
11123 case 7:
11124 {
11125 FreeExpContents(exp);
11126 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11127 exp->type = 2;
11128 break;
11129 }
11130 case 3:
11131 {
11132 FreeExpContents(exp);
11133 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11134 exp->type = 2;
11135 break;
11136 }
11137 case 4:
11138 {
11139 FreeExpContents(exp);
11140 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11141 exp->type = 2;
11142 break;
11143 }
11144 case 22:
11145 {
11146 FreeExpContents(exp);
11147 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11148 exp->type = 2;
11149 break;
11150 }
11151 case 23:
11152 {
11153 FreeExpContents(exp);
11154 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11155 exp->type = 2;
11156 break;
11157 }
11158 default:
11159 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11160 }
11161 }
11162 ListAdd(memberList, member);
11163 }
11164 if(parentDataMember->type == 1)
11165 break;
11166 }
11167 }
11168
11169 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11170
11171 void PopulateInstance(struct Instantiation * inst)
11172 {
11173 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11174 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11175 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11176 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11177
11178 if(!inst->members)
11179 inst->members = MkListOne(MkMembersInitList(memberList));
11180 else
11181 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11182 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11183 {
11184 if(!dataMember->isProperty)
11185 {
11186 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11187 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11188 else
11189 {
11190 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11191 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11192 struct Type * type;
11193 void * ptr = inst->data + dataMember->offset;
11194 char * result = (((void *)0));
11195
11196 exp->loc = member->loc = inst->loc;
11197 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11198 if(!dataMember->dataType)
11199 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11200 type = dataMember->dataType;
11201 if(type->kind == 8)
11202 {
11203 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11204
11205 if(_class->type == 4)
11206 {
11207 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11208
11209 if(enumClass)
11210 {
11211 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11212 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11213
11214 for(item = e->values.first; item; item = item->next)
11215 {
11216 if((int)item->data == *(int *)ptr)
11217 {
11218 result = item->name;
11219 break;
11220 }
11221 }
11222 }
11223 if(result)
11224 {
11225 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11226 exp->type = 0;
11227 exp->destType = MkClassType(_class->fullName);
11228 ProcessExpressionType(exp);
11229 }
11230 }
11231 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11232 {
11233 if(!_class->dataType)
11234 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11235 type = _class->dataType;
11236 }
11237 }
11238 if(!result)
11239 {
11240 switch(type->kind)
11241 {
11242 case 6:
11243 {
11244 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11245 exp->type = 2;
11246 break;
11247 }
11248 case 7:
11249 {
11250 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11251 exp->type = 2;
11252 break;
11253 }
11254 case 3:
11255 {
11256 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11257 exp->type = 2;
11258 break;
11259 }
11260 case 4:
11261 {
11262 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11263 exp->type = 2;
11264 break;
11265 }
11266 case 22:
11267 {
11268 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11269 exp->type = 2;
11270 break;
11271 }
11272 default:
11273 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11274 }
11275 }
11276 ListAdd(memberList, member);
11277 }
11278 }
11279 }
11280 }
11281
11282 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);
11283
11284 extern void FreeInstance(struct Instantiation * inst);
11285
11286 void ComputeInstantiation(struct Expression * exp)
11287 {
11288 struct Instantiation * inst = exp->__anon1.instance;
11289 struct MembersInit * members;
11290 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11291 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11292 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11293 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11294 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11295 int subMemberStackPos = 0;
11296 uint64 bits = 0;
11297
11298 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11299 {
11300 if(inst->data)
11301 return ;
11302 if(_class->type == 0 || _class->type == 5)
11303 {
11304 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11305 if(_class->type == 0)
11306 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11307 }
11308 else
11309 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11310 }
11311 if(inst->members)
11312 {
11313 for(members = (*inst->members).first; members; members = members->next)
11314 {
11315 switch(members->type)
11316 {
11317 case 0:
11318 {
11319 if(members->__anon1.dataMembers)
11320 {
11321 struct MemberInit * member;
11322
11323 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11324 {
11325 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11326 unsigned int found = 0x0;
11327 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11328 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11329 unsigned int dataMemberOffset;
11330
11331 if(!ident)
11332 {
11333 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11334 if(curMember)
11335 {
11336 if(curMember->isProperty)
11337 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11338 else
11339 {
11340 dataMember = curMember;
11341 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11342 if(_class->type == 0)
11343 dataMemberOffset += _class->base->structSize;
11344 }
11345 found = 0x1;
11346 }
11347 }
11348 else
11349 {
11350 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11351 if(prop)
11352 {
11353 found = 0x1;
11354 if(prop->memberAccess == 1)
11355 {
11356 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11357 curClass = prop->_class;
11358 }
11359 }
11360 else
11361 {
11362 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11363 int _subMemberStackPos = 0;
11364
11365 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11366 if(dataMember)
11367 {
11368 found = 0x1;
11369 if(dataMember->memberAccess == 1)
11370 {
11371 curMember = dataMember;
11372 curClass = dataMember->_class;
11373 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11374 subMemberStackPos = _subMemberStackPos;
11375 }
11376 }
11377 }
11378 }
11379 if(found && member->initializer && member->initializer->type == 0)
11380 {
11381 struct Expression * value = member->initializer->__anon1.exp;
11382 struct Type * type = (((void *)0));
11383 unsigned int deepMember = 0x0;
11384
11385 if(prop)
11386 {
11387 type = prop->dataType;
11388 }
11389 else if(dataMember)
11390 {
11391 if(!dataMember->dataType)
11392 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11393 type = dataMember->dataType;
11394 }
11395 if(ident && ident->next)
11396 {
11397 deepMember = 0x1;
11398 for(ident = ident->next; ident && type; ident = ident->next)
11399 {
11400 if(type->kind == 8)
11401 {
11402 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11403 if(prop)
11404 type = prop->dataType;
11405 else
11406 {
11407 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11408 if(dataMember)
11409 type = dataMember->dataType;
11410 }
11411 }
11412 else if(type->kind == 9 || type->kind == 10)
11413 {
11414 struct Type * memberType;
11415
11416 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11417 {
11418 if(!strcmp(memberType->name, ident->string))
11419 {
11420 type = memberType;
11421 break;
11422 }
11423 }
11424 }
11425 }
11426 }
11427 if(value)
11428 {
11429 FreeType(value->destType);
11430 value->destType = type;
11431 if(type)
11432 type->refCount++;
11433 ComputeExpression(value);
11434 }
11435 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11436 {
11437 if(type->kind == 8)
11438 {
11439 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11440
11441 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11442 {
11443 if(!_class->dataType)
11444 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11445 type = _class->dataType;
11446 }
11447 }
11448 if(dataMember)
11449 {
11450 void * ptr = inst->data + dataMemberOffset;
11451
11452 if(value->type == 2)
11453 {
11454 switch(type->kind)
11455 {
11456 case 3:
11457 {
11458 GetInt(value, (int *)ptr);
11459 break;
11460 }
11461 case 4:
11462 {
11463 GetInt64(value, (long long *)ptr);
11464 break;
11465 }
11466 case 22:
11467 {
11468 GetIntPtr(value, (intptr_t *)ptr);
11469 break;
11470 }
11471 case 23:
11472 {
11473 GetIntSize(value, (ssize_t *)ptr);
11474 break;
11475 }
11476 case 6:
11477 {
11478 GetFloat(value, (float *)ptr);
11479 break;
11480 }
11481 case 7:
11482 {
11483 GetDouble(value, (double *)ptr);
11484 break;
11485 }
11486 }
11487 }
11488 else if(value->type == 1)
11489 {
11490 if(type->kind == 8)
11491 {
11492 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11493
11494 if(_class->type == 1)
11495 {
11496 ComputeTypeSize(type);
11497 if(value->__anon1.instance->data)
11498 memcpy(ptr, value->__anon1.instance->data, type->size);
11499 }
11500 }
11501 }
11502 }
11503 else if(prop)
11504 {
11505 if(value->type == 1 && value->__anon1.instance->data)
11506 {
11507 if(type->kind == 8)
11508 {
11509 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11510
11511 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)))
11512 {
11513 void (* Set)(void *, void *) = (void *)prop->Set;
11514
11515 Set(inst->data, value->__anon1.instance->data);
11516 PopulateInstance(inst);
11517 }
11518 }
11519 }
11520 else if(value->type == 2)
11521 {
11522 switch(type->kind)
11523 {
11524 case 7:
11525 {
11526 void (* Set)(void *, double) = (void *)prop->Set;
11527
11528 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11529 break;
11530 }
11531 case 6:
11532 {
11533 void (* Set)(void *, float) = (void *)prop->Set;
11534
11535 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11536 break;
11537 }
11538 case 3:
11539 {
11540 void (* Set)(void *, int) = (void *)prop->Set;
11541
11542 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11543 break;
11544 }
11545 case 4:
11546 {
11547 void (* Set)(void *, long long) = (void *)prop->Set;
11548
11549 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11550 break;
11551 }
11552 case 22:
11553 {
11554 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11555
11556 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11557 break;
11558 }
11559 case 23:
11560 {
11561 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11562
11563 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11564 break;
11565 }
11566 }
11567 }
11568 else if(value->type == 3)
11569 {
11570 char temp[1024];
11571
11572 ReadString(temp, value->__anon1.__anon2.string);
11573 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11574 }
11575 }
11576 }
11577 else if(!deepMember && type && _class->type == 3)
11578 {
11579 if(prop)
11580 {
11581 if(value->type == 2)
11582 {
11583 if(type->kind == 8)
11584 {
11585 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11586
11587 if(_class->type == 3)
11588 {
11589 if(!_class->dataType)
11590 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11591 type = _class->dataType;
11592 }
11593 }
11594 switch(type->kind)
11595 {
11596 case 6:
11597 {
11598 float fValue;
11599 float (* Set)(float) = (void *)prop->Set;
11600
11601 GetFloat(member->initializer->__anon1.exp, &fValue);
11602 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11603 exp->type = 2;
11604 break;
11605 }
11606 case 7:
11607 {
11608 double dValue;
11609 double (* Set)(double) = (void *)prop->Set;
11610
11611 GetDouble(member->initializer->__anon1.exp, &dValue);
11612 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11613 exp->type = 2;
11614 break;
11615 }
11616 }
11617 }
11618 }
11619 }
11620 else if(!deepMember && type && _class->type == 2)
11621 {
11622 if(prop)
11623 {
11624 if(value->type == 1 && value->__anon1.instance->data)
11625 {
11626 unsigned int (* Set)(void *) = (void *)prop->Set;
11627
11628 bits = Set(value->__anon1.instance->data);
11629 }
11630 else if(value->type == 2)
11631 {
11632 }
11633 }
11634 else if(dataMember)
11635 {
11636 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11637 struct Type * type;
11638 uint64 part;
11639
11640 bits = (bits & ~bitMember->mask);
11641 if(!bitMember->dataType)
11642 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11643 type = bitMember->dataType;
11644 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11645 {
11646 if(!type->__anon1._class->__anon1.registered->dataType)
11647 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
11648 type = type->__anon1._class->__anon1.registered->dataType;
11649 }
11650 switch(type->kind)
11651 {
11652 case 24:
11653 case 1:
11654 {
11655 unsigned char v;
11656
11657 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11658 part = (uint64)v;
11659 break;
11660 }
11661 case 2:
11662 {
11663 unsigned short v;
11664
11665 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11666 part = (uint64)v;
11667 break;
11668 }
11669 case 3:
11670 case 5:
11671 {
11672 unsigned int v;
11673
11674 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11675 part = (uint64)v;
11676 break;
11677 }
11678 case 4:
11679 {
11680 uint64 v;
11681
11682 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11683 part = v;
11684 break;
11685 }
11686 case 22:
11687 {
11688 uintptr_t v;
11689
11690 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11691 part = (uint64)v;
11692 break;
11693 }
11694 case 23:
11695 {
11696 size_t v;
11697
11698 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11699 part = (uint64)v;
11700 break;
11701 }
11702 }
11703 bits |= part << bitMember->pos;
11704 }
11705 }
11706 }
11707 else
11708 {
11709 if(_class && _class->type == 3)
11710 {
11711 ComputeExpression(member->initializer->__anon1.exp);
11712 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11713 exp->type = 2;
11714 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11715 }
11716 }
11717 }
11718 }
11719 break;
11720 }
11721 }
11722 }
11723 }
11724 if(_class && _class->type == 2)
11725 {
11726 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11727 exp->type = 2;
11728 }
11729 if(exp->type != 1)
11730 {
11731 FreeInstance(inst);
11732 }
11733 }
11734
11735 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11736 {
11737 unsigned int result = 0x0;
11738
11739 switch(kind)
11740 {
11741 case 2:
11742 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11743 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11744 break;
11745 case 3:
11746 case 5:
11747 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11748 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11749 break;
11750 case 4:
11751 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)
11752 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11753 break;
11754 case 6:
11755 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)
11756 result = GetOpFloat(op, &op->__anon1.f);
11757 break;
11758 case 7:
11759 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)
11760 result = GetOpDouble(op, &op->__anon1.d);
11761 break;
11762 case 13:
11763 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)
11764 result = GetOpUInt64(op, &op->__anon1.ui64);
11765 break;
11766 case 15:
11767 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)
11768 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11769 break;
11770 case 22:
11771 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11772 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11773 break;
11774 case 23:
11775 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11776 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11777 break;
11778 }
11779 return result;
11780 }
11781
11782 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11783 {
11784 if(exp->__anon1.op.op == SIZEOF)
11785 {
11786 FreeExpContents(exp);
11787 exp->type = 2;
11788 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11789 }
11790 else
11791 {
11792 if(!exp->__anon1.op.exp1)
11793 {
11794 switch(exp->__anon1.op.op)
11795 {
11796 case '+':
11797 {
11798 struct Expression * exp2 = exp->__anon1.op.exp2;
11799
11800 exp->__anon1.op.exp2 = (((void *)0));
11801 FreeExpContents(exp);
11802 FreeType(exp->expType);
11803 FreeType(exp->destType);
11804 *exp = *exp2;
11805 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11806 break;
11807 }
11808 case '-':
11809 if(op1->ops.Neg)
11810 {
11811 FreeExpContents(exp);
11812 op1->ops.Neg(exp, op1);
11813 }
11814 break;
11815 case '~':
11816 if(op1->ops.BitNot)
11817 {
11818 FreeExpContents(exp);
11819 op1->ops.BitNot(exp, op1);
11820 }
11821 break;
11822 case '!':
11823 if(op1->ops.Not)
11824 {
11825 FreeExpContents(exp);
11826 op1->ops.Not(exp, op1);
11827 }
11828 break;
11829 }
11830 }
11831 else
11832 {
11833 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11834 {
11835 if(Promote(op2, op1->kind, op1->type->isSigned))
11836 op2->kind = op1->kind, op2->ops = op1->ops;
11837 else if(Promote(op1, op2->kind, op2->type->isSigned))
11838 op1->kind = op2->kind, op1->ops = op2->ops;
11839 }
11840 switch(exp->__anon1.op.op)
11841 {
11842 case '+':
11843 if(op1->ops.Add)
11844 {
11845 FreeExpContents(exp);
11846 op1->ops.Add(exp, op1, op2);
11847 }
11848 break;
11849 case '-':
11850 if(op1->ops.Sub)
11851 {
11852 FreeExpContents(exp);
11853 op1->ops.Sub(exp, op1, op2);
11854 }
11855 break;
11856 case '*':
11857 if(op1->ops.Mul)
11858 {
11859 FreeExpContents(exp);
11860 op1->ops.Mul(exp, op1, op2);
11861 }
11862 break;
11863 case '/':
11864 if(op1->ops.Div)
11865 {
11866 FreeExpContents(exp);
11867 op1->ops.Div(exp, op1, op2);
11868 }
11869 break;
11870 case '%':
11871 if(op1->ops.Mod)
11872 {
11873 FreeExpContents(exp);
11874 op1->ops.Mod(exp, op1, op2);
11875 }
11876 break;
11877 case '&':
11878 if(exp->__anon1.op.exp2)
11879 {
11880 if(op1->ops.BitAnd)
11881 {
11882 FreeExpContents(exp);
11883 op1->ops.BitAnd(exp, op1, op2);
11884 }
11885 }
11886 break;
11887 case '|':
11888 if(op1->ops.BitOr)
11889 {
11890 FreeExpContents(exp);
11891 op1->ops.BitOr(exp, op1, op2);
11892 }
11893 break;
11894 case '^':
11895 if(op1->ops.BitXor)
11896 {
11897 FreeExpContents(exp);
11898 op1->ops.BitXor(exp, op1, op2);
11899 }
11900 break;
11901 case LEFT_OP:
11902 if(op1->ops.LShift)
11903 {
11904 FreeExpContents(exp);
11905 op1->ops.LShift(exp, op1, op2);
11906 }
11907 break;
11908 case RIGHT_OP:
11909 if(op1->ops.RShift)
11910 {
11911 FreeExpContents(exp);
11912 op1->ops.RShift(exp, op1, op2);
11913 }
11914 break;
11915 case EQ_OP:
11916 if(op1->ops.Equ)
11917 {
11918 FreeExpContents(exp);
11919 op1->ops.Equ(exp, op1, op2);
11920 }
11921 break;
11922 case NE_OP:
11923 if(op1->ops.Nqu)
11924 {
11925 FreeExpContents(exp);
11926 op1->ops.Nqu(exp, op1, op2);
11927 }
11928 break;
11929 case AND_OP:
11930 if(op1->ops.And)
11931 {
11932 FreeExpContents(exp);
11933 op1->ops.And(exp, op1, op2);
11934 }
11935 break;
11936 case OR_OP:
11937 if(op1->ops.Or)
11938 {
11939 FreeExpContents(exp);
11940 op1->ops.Or(exp, op1, op2);
11941 }
11942 break;
11943 case '>':
11944 if(op1->ops.Grt)
11945 {
11946 FreeExpContents(exp);
11947 op1->ops.Grt(exp, op1, op2);
11948 }
11949 break;
11950 case '<':
11951 if(op1->ops.Sma)
11952 {
11953 FreeExpContents(exp);
11954 op1->ops.Sma(exp, op1, op2);
11955 }
11956 break;
11957 case GE_OP:
11958 if(op1->ops.GrtEqu)
11959 {
11960 FreeExpContents(exp);
11961 op1->ops.GrtEqu(exp, op1, op2);
11962 }
11963 break;
11964 case LE_OP:
11965 if(op1->ops.SmaEqu)
11966 {
11967 FreeExpContents(exp);
11968 op1->ops.SmaEqu(exp, op1, op2);
11969 }
11970 break;
11971 }
11972 }
11973 }
11974 }
11975
11976 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11977
11978 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11979
11980 void ComputeExpression(struct Expression * exp)
11981 {
11982 char expString[10240];
11983
11984 expString[0] = '\0';
11985 switch(exp->type)
11986 {
11987 case 1:
11988 {
11989 ComputeInstantiation(exp);
11990 break;
11991 }
11992 case 4:
11993 {
11994 struct Expression * exp1, * exp2 = (((void *)0));
11995 struct Operand op1 =
11996 {
11997 0, 0, 0,
11998 .__anon1 = {
11999 .c = 0
12000 },
12001 {
12002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12003 }
12004 };
12005 struct Operand op2 =
12006 {
12007 0, 0, 0,
12008 .__anon1 = {
12009 .c = 0
12010 },
12011 {
12012 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12013 }
12014 };
12015
12016 if(exp->__anon1.op.exp2)
12017 {
12018 struct Expression * e = exp->__anon1.op.exp2;
12019
12020 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12021 {
12022 if(e->type == 5 || e->type == 32 || e->type == 23)
12023 {
12024 if(e->type == 23)
12025 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12026 else
12027 e = (*e->__anon1.list).last;
12028 }
12029 }
12030 if(exp->__anon1.op.op == 261 && e && e->expType)
12031 {
12032 if(e->type == 3 && e->__anon1.__anon2.string)
12033 {
12034 char * string = e->__anon1.__anon2.string;
12035 int len = strlen(string);
12036 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12037
12038 len = UnescapeString(tmp, string + 1, len - 2);
12039 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12040 FreeExpContents(exp);
12041 exp->type = 2;
12042 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12043 }
12044 else
12045 {
12046 struct Type * type = e->expType;
12047
12048 type->refCount++;
12049 FreeExpContents(exp);
12050 exp->type = 2;
12051 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12052 FreeType(type);
12053 }
12054 break;
12055 }
12056 else
12057 ComputeExpression(exp->__anon1.op.exp2);
12058 }
12059 if(exp->__anon1.op.exp1)
12060 {
12061 ComputeExpression(exp->__anon1.op.exp1);
12062 exp1 = exp->__anon1.op.exp1;
12063 exp2 = exp->__anon1.op.exp2;
12064 op1 = GetOperand(exp1);
12065 if(op1.type)
12066 op1.type->refCount++;
12067 if(exp2)
12068 {
12069 op2 = GetOperand(exp2);
12070 if(op2.type)
12071 op2.type->refCount++;
12072 }
12073 }
12074 else
12075 {
12076 exp1 = exp->__anon1.op.exp2;
12077 op1 = GetOperand(exp1);
12078 if(op1.type)
12079 op1.type->refCount++;
12080 }
12081 CallOperator(exp, exp1, exp2, &op1, &op2);
12082 if(op1.type)
12083 FreeType(op1.type);
12084 if(op2.type)
12085 FreeType(op2.type);
12086 break;
12087 }
12088 case 5:
12089 case 32:
12090 {
12091 struct Expression * e, * n;
12092
12093 for(e = (*exp->__anon1.list).first; e; e = n)
12094 {
12095 n = e->next;
12096 if(!n)
12097 {
12098 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12099 struct Expression * prev = exp->prev;
12100 struct Expression * next = exp->next;
12101
12102 ComputeExpression(e);
12103 FreeType(exp->expType);
12104 FreeType(exp->destType);
12105 *exp = *e;
12106 exp->prev = prev;
12107 exp->next = next;
12108 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12109 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12110 }
12111 else
12112 {
12113 FreeExpression(e);
12114 }
12115 }
12116 break;
12117 }
12118 case 8:
12119 {
12120 struct Expression * memberExp = exp->__anon1.member.exp;
12121 struct Identifier * memberID = exp->__anon1.member.member;
12122 struct Type * type;
12123
12124 ComputeExpression(exp->__anon1.member.exp);
12125 type = exp->__anon1.member.exp->expType;
12126 if(type)
12127 {
12128 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)));
12129 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12130 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12131 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12132
12133 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12134 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12135 if(!_class)
12136 {
12137 char string[256];
12138 struct Symbol * classSym;
12139
12140 string[0] = '\0';
12141 PrintTypeNoConst(type, string, 0x0, 0x1);
12142 classSym = FindClass(string);
12143 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12144 }
12145 if(exp->__anon1.member.member)
12146 {
12147 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12148 if(!prop)
12149 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12150 }
12151 if(!prop && !member && _class && exp->__anon1.member.member)
12152 {
12153 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12154
12155 convertTo = _class;
12156 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12157 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12158 }
12159 if(prop)
12160 {
12161 if(prop->compiled)
12162 {
12163 struct Type * type = prop->dataType;
12164
12165 if(_class->type == 3)
12166 {
12167 if(type->kind == 8)
12168 {
12169 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12170
12171 if(_class->type == 3)
12172 {
12173 if(!_class->dataType)
12174 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12175 type = _class->dataType;
12176 }
12177 }
12178 switch(type->kind)
12179 {
12180 case 6:
12181 {
12182 float value;
12183 float (* Get)(float) = (void *)prop->Get;
12184
12185 GetFloat(exp->__anon1.member.exp, &value);
12186 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12187 exp->type = 2;
12188 break;
12189 }
12190 case 7:
12191 {
12192 double value;
12193 double (* Get)(double);
12194
12195 GetDouble(exp->__anon1.member.exp, &value);
12196 if(convertTo)
12197 Get = (void *)prop->Set;
12198 else
12199 Get = (void *)prop->Get;
12200 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12201 exp->type = 2;
12202 break;
12203 }
12204 }
12205 }
12206 else
12207 {
12208 if(convertTo)
12209 {
12210 struct Expression * value = exp->__anon1.member.exp;
12211 struct Type * type;
12212
12213 if(!prop->dataType)
12214 ProcessPropertyType(prop);
12215 type = prop->dataType;
12216 if(!type)
12217 {
12218 }
12219 else if(_class->type == 1)
12220 {
12221 switch(type->kind)
12222 {
12223 case 8:
12224 {
12225 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12226
12227 if(propertyClass->type == 1 && value->type == 1)
12228 {
12229 void (* Set)(void *, void *) = (void *)prop->Set;
12230
12231 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12232 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12233 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12234 exp->__anon1.instance->loc = exp->loc;
12235 exp->type = 1;
12236 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12237 PopulateInstance(exp->__anon1.instance);
12238 }
12239 break;
12240 }
12241 case 3:
12242 {
12243 int intValue;
12244 void (* Set)(void *, int) = (void *)prop->Set;
12245
12246 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12247 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12248 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12249 exp->__anon1.instance->loc = exp->loc;
12250 exp->type = 1;
12251 GetInt(value, &intValue);
12252 Set(exp->__anon1.instance->data, intValue);
12253 PopulateInstance(exp->__anon1.instance);
12254 break;
12255 }
12256 case 4:
12257 {
12258 long long intValue;
12259 void (* Set)(void *, long long) = (void *)prop->Set;
12260
12261 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12262 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12263 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12264 exp->__anon1.instance->loc = exp->loc;
12265 exp->type = 1;
12266 GetInt64(value, &intValue);
12267 Set(exp->__anon1.instance->data, intValue);
12268 PopulateInstance(exp->__anon1.instance);
12269 break;
12270 }
12271 case 22:
12272 {
12273 intptr_t intValue;
12274 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12275
12276 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12277 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12278 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12279 exp->__anon1.instance->loc = exp->loc;
12280 exp->type = 1;
12281 GetIntPtr(value, &intValue);
12282 Set(exp->__anon1.instance->data, intValue);
12283 PopulateInstance(exp->__anon1.instance);
12284 break;
12285 }
12286 case 23:
12287 {
12288 ssize_t intValue;
12289 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12290
12291 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12292 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12293 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12294 exp->__anon1.instance->loc = exp->loc;
12295 exp->type = 1;
12296 GetIntSize(value, &intValue);
12297 Set(exp->__anon1.instance->data, intValue);
12298 PopulateInstance(exp->__anon1.instance);
12299 break;
12300 }
12301 case 6:
12302 {
12303 float floatValue;
12304 void (* Set)(void *, float) = (void *)prop->Set;
12305
12306 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12307 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12308 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12309 exp->__anon1.instance->loc = exp->loc;
12310 exp->type = 1;
12311 GetFloat(value, &floatValue);
12312 Set(exp->__anon1.instance->data, floatValue);
12313 PopulateInstance(exp->__anon1.instance);
12314 break;
12315 }
12316 case 7:
12317 {
12318 double doubleValue;
12319 void (* Set)(void *, double) = (void *)prop->Set;
12320
12321 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12322 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12323 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12324 exp->__anon1.instance->loc = exp->loc;
12325 exp->type = 1;
12326 GetDouble(value, &doubleValue);
12327 Set(exp->__anon1.instance->data, doubleValue);
12328 PopulateInstance(exp->__anon1.instance);
12329 break;
12330 }
12331 }
12332 }
12333 else if(_class->type == 2)
12334 {
12335 switch(type->kind)
12336 {
12337 case 8:
12338 {
12339 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12340
12341 if(propertyClass->type == 1 && value->__anon1.instance->data)
12342 {
12343 unsigned int (* Set)(void *) = (void *)prop->Set;
12344 unsigned int bits = Set(value->__anon1.instance->data);
12345
12346 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12347 exp->type = 2;
12348 break;
12349 }
12350 else if(_class->type == 2)
12351 {
12352 unsigned int value;
12353 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12354 unsigned int bits;
12355
12356 GetUInt(exp->__anon1.member.exp, &value);
12357 bits = Set(value);
12358 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12359 exp->type = 2;
12360 }
12361 }
12362 }
12363 }
12364 }
12365 else
12366 {
12367 if(_class->type == 2)
12368 {
12369 unsigned int value;
12370
12371 GetUInt(exp->__anon1.member.exp, &value);
12372 switch(type->kind)
12373 {
12374 case 8:
12375 {
12376 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12377
12378 if(_class->type == 1)
12379 {
12380 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12381
12382 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12383 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12384 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12385 exp->__anon1.instance->loc = exp->loc;
12386 exp->type = 1;
12387 Get(value, exp->__anon1.instance->data);
12388 PopulateInstance(exp->__anon1.instance);
12389 }
12390 else if(_class->type == 2)
12391 {
12392 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12393 uint64 bits = Get(value);
12394
12395 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12396 exp->type = 2;
12397 }
12398 break;
12399 }
12400 }
12401 }
12402 else if(_class->type == 1)
12403 {
12404 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12405
12406 switch(type->kind)
12407 {
12408 case 8:
12409 {
12410 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12411
12412 if(_class->type == 1 && value)
12413 {
12414 void (* Get)(void *, void *) = (void *)prop->Get;
12415
12416 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12417 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12418 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12419 exp->__anon1.instance->loc = exp->loc;
12420 exp->type = 1;
12421 Get(value, exp->__anon1.instance->data);
12422 PopulateInstance(exp->__anon1.instance);
12423 }
12424 break;
12425 }
12426 }
12427 }
12428 }
12429 }
12430 }
12431 else
12432 {
12433 exp->isConstant = 0x0;
12434 }
12435 }
12436 else if(member)
12437 {
12438 }
12439 }
12440 if(exp->type != 8)
12441 {
12442 FreeExpression(memberExp);
12443 FreeIdentifier(memberID);
12444 }
12445 break;
12446 }
12447 case 10:
12448 {
12449 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12450
12451 FreeExpContents(exp);
12452 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12453 exp->type = 2;
12454 FreeType(type);
12455 break;
12456 }
12457 case 15:
12458 {
12459 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12460
12461 if(classSym && classSym->__anon1.registered)
12462 {
12463 if(classSym->__anon1.registered->fixed)
12464 {
12465 FreeSpecifier(exp->__anon1._class);
12466 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12467 exp->type = 2;
12468 }
12469 else
12470 {
12471 char className[1024];
12472
12473 strcpy(className, "__ecereClass_");
12474 FullClassNameCat(className, classSym->string, 0x1);
12475 DeclareClass(classSym, className);
12476 FreeExpContents(exp);
12477 exp->type = 9;
12478 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12479 exp->__anon1.member.member = MkIdentifier("structSize");
12480 }
12481 }
12482 break;
12483 }
12484 case 11:
12485 {
12486 struct Type * type;
12487 struct Expression * e = exp;
12488
12489 if(exp->type == 11)
12490 {
12491 if(exp->__anon1.cast.exp)
12492 ComputeExpression(exp->__anon1.cast.exp);
12493 e = exp->__anon1.cast.exp;
12494 }
12495 if(e && exp->expType)
12496 {
12497 type = exp->expType;
12498 if(type->kind == 8)
12499 {
12500 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12501
12502 if(_class && (_class->type == 3 || _class->type == 2))
12503 {
12504 if(!_class->dataType)
12505 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12506 type = _class->dataType;
12507 }
12508 }
12509 switch(type->kind)
12510 {
12511 case 24:
12512 case 1:
12513 if(type->isSigned)
12514 {
12515 char value = (char)0;
12516
12517 if(GetChar(e, &value))
12518 {
12519 FreeExpContents(exp);
12520 exp->__anon1.__anon1.constant = PrintChar(value);
12521 exp->type = 2;
12522 }
12523 }
12524 else
12525 {
12526 unsigned char value = (unsigned char)0;
12527
12528 if(GetUChar(e, &value))
12529 {
12530 FreeExpContents(exp);
12531 exp->__anon1.__anon1.constant = PrintUChar(value);
12532 exp->type = 2;
12533 }
12534 }
12535 break;
12536 case 2:
12537 if(type->isSigned)
12538 {
12539 short value = (short)0;
12540
12541 if(GetShort(e, &value))
12542 {
12543 FreeExpContents(exp);
12544 exp->__anon1.__anon1.constant = PrintShort(value);
12545 exp->type = 2;
12546 }
12547 }
12548 else
12549 {
12550 unsigned short value = (unsigned short)0;
12551
12552 if(GetUShort(e, &value))
12553 {
12554 FreeExpContents(exp);
12555 exp->__anon1.__anon1.constant = PrintUShort(value);
12556 exp->type = 2;
12557 }
12558 }
12559 break;
12560 case 3:
12561 if(type->isSigned)
12562 {
12563 int value = 0;
12564
12565 if(GetInt(e, &value))
12566 {
12567 FreeExpContents(exp);
12568 exp->__anon1.__anon1.constant = PrintInt(value);
12569 exp->type = 2;
12570 }
12571 }
12572 else
12573 {
12574 unsigned int value = 0;
12575
12576 if(GetUInt(e, &value))
12577 {
12578 FreeExpContents(exp);
12579 exp->__anon1.__anon1.constant = PrintUInt(value);
12580 exp->type = 2;
12581 }
12582 }
12583 break;
12584 case 4:
12585 if(type->isSigned)
12586 {
12587 long long value = 0;
12588
12589 if(GetInt64(e, &value))
12590 {
12591 FreeExpContents(exp);
12592 exp->__anon1.__anon1.constant = PrintInt64(value);
12593 exp->type = 2;
12594 }
12595 }
12596 else
12597 {
12598 uint64 value = 0;
12599
12600 if(GetUInt64(e, &value))
12601 {
12602 FreeExpContents(exp);
12603 exp->__anon1.__anon1.constant = PrintUInt64(value);
12604 exp->type = 2;
12605 }
12606 }
12607 break;
12608 case 22:
12609 if(type->isSigned)
12610 {
12611 intptr_t value = 0;
12612
12613 if(GetIntPtr(e, &value))
12614 {
12615 FreeExpContents(exp);
12616 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12617 exp->type = 2;
12618 }
12619 }
12620 else
12621 {
12622 uintptr_t value = 0;
12623
12624 if(GetUIntPtr(e, &value))
12625 {
12626 FreeExpContents(exp);
12627 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12628 exp->type = 2;
12629 }
12630 }
12631 break;
12632 case 23:
12633 if(type->isSigned)
12634 {
12635 ssize_t value = 0;
12636
12637 if(GetIntSize(e, &value))
12638 {
12639 FreeExpContents(exp);
12640 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12641 exp->type = 2;
12642 }
12643 }
12644 else
12645 {
12646 size_t value = 0;
12647
12648 if(GetUIntSize(e, &value))
12649 {
12650 FreeExpContents(exp);
12651 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12652 exp->type = 2;
12653 }
12654 }
12655 break;
12656 case 6:
12657 {
12658 float value = 0;
12659
12660 if(GetFloat(e, &value))
12661 {
12662 FreeExpContents(exp);
12663 exp->__anon1.__anon1.constant = PrintFloat(value);
12664 exp->type = 2;
12665 }
12666 break;
12667 }
12668 case 7:
12669 {
12670 double value = 0;
12671
12672 if(GetDouble(e, &value))
12673 {
12674 FreeExpContents(exp);
12675 exp->__anon1.__anon1.constant = PrintDouble(value);
12676 exp->type = 2;
12677 }
12678 break;
12679 }
12680 }
12681 }
12682 break;
12683 }
12684 case 12:
12685 {
12686 struct Operand op1 =
12687 {
12688 0, 0, 0,
12689 .__anon1 = {
12690 .c = 0
12691 },
12692 {
12693 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12694 }
12695 };
12696 struct Operand op2 =
12697 {
12698 0, 0, 0,
12699 .__anon1 = {
12700 .c = 0
12701 },
12702 {
12703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12704 }
12705 };
12706 struct Operand op3 =
12707 {
12708 0, 0, 0,
12709 .__anon1 = {
12710 .c = 0
12711 },
12712 {
12713 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12714 }
12715 };
12716
12717 if(exp->__anon1.cond.exp)
12718 ComputeExpression((*exp->__anon1.cond.exp).last);
12719 if(exp->__anon1.cond.elseExp)
12720 ComputeExpression(exp->__anon1.cond.elseExp);
12721 if(exp->__anon1.cond.cond)
12722 ComputeExpression(exp->__anon1.cond.cond);
12723 op1 = GetOperand(exp->__anon1.cond.cond);
12724 if(op1.type)
12725 op1.type->refCount++;
12726 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12727 if(op2.type)
12728 op2.type->refCount++;
12729 op3 = GetOperand(exp->__anon1.cond.elseExp);
12730 if(op3.type)
12731 op3.type->refCount++;
12732 if(op1.ops.Cond)
12733 {
12734 FreeExpContents(exp);
12735 op1.ops.Cond(exp, &op1, &op2, &op3);
12736 }
12737 if(op1.type)
12738 FreeType(op1.type);
12739 if(op2.type)
12740 FreeType(op2.type);
12741 if(op3.type)
12742 FreeType(op3.type);
12743 break;
12744 }
12745 }
12746 }
12747
12748 void ApplyAnyObjectLogic(struct Expression * e);
12749
12750 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12751 {
12752 unsigned int result = 0x1;
12753
12754 if(destType)
12755 {
12756 struct __ecereNameSpace__ecere__sys__OldList converts =
12757 {
12758 0, 0, 0, 0, 0
12759 };
12760 struct Conversion * convert;
12761
12762 if(destType->kind == 0)
12763 return 0x0;
12764 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12765 result = 0x0;
12766 if(converts.count)
12767 {
12768 for(convert = converts.first; convert; convert = convert->next)
12769 {
12770 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12771
12772 if(!empty)
12773 {
12774 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12775 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12776
12777 *newExp = *exp;
12778 newExp->prev = (((void *)0));
12779 newExp->next = (((void *)0));
12780 newExp->destType = (((void *)0));
12781 if(convert->isGet)
12782 {
12783 exp->type = 8;
12784 exp->addedThis = 0x1;
12785 exp->__anon1.member.exp = newExp;
12786 FreeType(exp->__anon1.member.exp->expType);
12787 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12788 exp->__anon1.member.exp->expType->classObjectType = objectType;
12789 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12790 exp->__anon1.member.memberType = 1;
12791 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12792 exp->needCast = 0x1;
12793 if(exp->expType)
12794 exp->expType->refCount++;
12795 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12796 }
12797 else
12798 {
12799 {
12800 exp->type = 8;
12801 exp->addedThis = 0x1;
12802 exp->__anon1.member.exp = newExp;
12803 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)
12804 {
12805 newExp->byReference = 0x1;
12806 }
12807 FreeType(exp->__anon1.member.exp->expType);
12808 exp->__anon1.member.exp->expType = (((void *)0));
12809 if(convert->convert->dataType)
12810 {
12811 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12812 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12813 exp->__anon1.member.exp->expType->refCount = 1;
12814 exp->__anon1.member.exp->expType->classObjectType = objectType;
12815 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12816 }
12817 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12818 exp->__anon1.member.memberType = 4;
12819 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12820 exp->needCast = 0x1;
12821 if(convert->resultType)
12822 convert->resultType->refCount++;
12823 }
12824 }
12825 }
12826 else
12827 {
12828 FreeType(exp->expType);
12829 if(convert->isGet)
12830 {
12831 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12832 if(exp->destType->casted)
12833 exp->needCast = 0x1;
12834 if(exp->expType)
12835 exp->expType->refCount++;
12836 }
12837 else
12838 {
12839 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12840 if(exp->destType->casted)
12841 exp->needCast = 0x1;
12842 if(convert->resultType)
12843 convert->resultType->refCount++;
12844 }
12845 }
12846 }
12847 if(exp->isConstant && inCompiler)
12848 ComputeExpression(exp);
12849 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12850 }
12851 if(!result && exp->expType && converts.count)
12852 {
12853 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
12854 }
12855 if(!result && exp->expType && exp->destType)
12856 {
12857 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))
12858 result = 0x1;
12859 }
12860 }
12861 return result;
12862 }
12863
12864 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12865
12866 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12867
12868 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12869
12870 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12871
12872 void CheckTemplateTypes(struct Expression * exp)
12873 {
12874 struct Expression * nbExp = GetNonBracketsExp(exp);
12875
12876 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12877 {
12878 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12879 struct Context * context;
12880
12881 *newExp = *exp;
12882 if(exp->destType)
12883 exp->destType->refCount++;
12884 if(exp->expType)
12885 exp->expType->refCount++;
12886 newExp->prev = (((void *)0));
12887 newExp->next = (((void *)0));
12888 switch(exp->expType->kind)
12889 {
12890 case 7:
12891 if(exp->destType->classObjectType)
12892 {
12893 if(exp->destType)
12894 exp->destType->refCount--;
12895 if(exp->expType)
12896 exp->expType->refCount--;
12897 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12898 }
12899 else
12900 {
12901 struct __ecereNameSpace__ecere__sys__OldList * specs;
12902 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12903 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12904
12905 context = PushContext();
12906 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12907 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12908 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12909 exp->type = 23;
12910 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12911 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12912 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12913 exp->__anon1.compound->__anon1.compound.context = context;
12914 PopContext(context);
12915 }
12916 break;
12917 default:
12918 exp->type = 11;
12919 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12920 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12921 exp->needCast = 0x1;
12922 break;
12923 }
12924 }
12925 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12926 {
12927 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12928 struct Context * context;
12929
12930 *newExp = *exp;
12931 if(exp->destType)
12932 exp->destType->refCount++;
12933 if(exp->expType)
12934 exp->expType->refCount++;
12935 newExp->prev = (((void *)0));
12936 newExp->next = (((void *)0));
12937 switch(exp->expType->kind)
12938 {
12939 case 7:
12940 if(exp->destType->classObjectType)
12941 {
12942 if(exp->destType)
12943 exp->destType->refCount--;
12944 if(exp->expType)
12945 exp->expType->refCount--;
12946 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12947 }
12948 else
12949 {
12950 struct __ecereNameSpace__ecere__sys__OldList * specs;
12951 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12952 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12953
12954 context = PushContext();
12955 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12956 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12957 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12958 exp->type = 23;
12959 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12960 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12961 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12962 exp->__anon1.compound->__anon1.compound.context = context;
12963 PopContext(context);
12964 }
12965 break;
12966 case 8:
12967 {
12968 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12969 {
12970 exp->type = 5;
12971 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)));
12972 ProcessExpressionType((*exp->__anon1.list).first);
12973 break;
12974 }
12975 else
12976 {
12977 exp->type = 5;
12978 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12979 exp->needTemplateCast = 2;
12980 newExp->needCast = 0x1;
12981 newExp->needTemplateCast = 2;
12982 ProcessExpressionType((*exp->__anon1.list).first);
12983 break;
12984 }
12985 }
12986 default:
12987 {
12988 if(exp->expType->kind == 20)
12989 {
12990 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
12991
12992 if(type)
12993 {
12994 FreeType(exp->destType);
12995 FreeType(exp->expType);
12996 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12997 break;
12998 }
12999 }
13000 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13001 {
13002 exp->type = 4;
13003 exp->__anon1.op.op = '*';
13004 exp->__anon1.op.exp1 = (((void *)0));
13005 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13006 }
13007 else
13008 {
13009 char typeString[1024];
13010 struct Declarator * decl;
13011 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13012
13013 typeString[0] = '\0';
13014 PrintType(exp->expType, typeString, 0x0, 0x0);
13015 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13016 exp->type = 11;
13017 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13018 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13019 exp->__anon1.cast.exp->needCast = 0x1;
13020 }
13021 break;
13022 }
13023 }
13024 }
13025 }
13026
13027 extern int strncmp(const char * , const char * , size_t n);
13028
13029 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13030
13031 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13032 {
13033 int nsLen = strlen(nameSpace);
13034 struct Symbol * symbol;
13035
13036 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)))
13037 {
13038 char * s = symbol->string;
13039
13040 if(!strncmp(s, nameSpace, nsLen))
13041 {
13042 int c;
13043 char * namePart;
13044
13045 for(c = strlen(s) - 1; c >= 0; c--)
13046 if(s[c] == ':')
13047 break;
13048 namePart = s + c + 1;
13049 if(!strcmp(namePart, name))
13050 {
13051 return symbol;
13052 }
13053 }
13054 else
13055 break;
13056 }
13057 return (((void *)0));
13058 }
13059
13060 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13061 {
13062 int c;
13063 char nameSpace[1024];
13064 const char * namePart;
13065 unsigned int gotColon = 0x0;
13066
13067 nameSpace[0] = '\0';
13068 for(c = strlen(name) - 1; c >= 0; c--)
13069 if(name[c] == ':')
13070 {
13071 gotColon = 0x1;
13072 break;
13073 }
13074 namePart = name + c + 1;
13075 while(c >= 0 && name[c] == ':')
13076 c--;
13077 if(c >= 0)
13078 {
13079 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13080
13081 if(symbol)
13082 return symbol;
13083 memcpy(nameSpace, name, c + 1);
13084 nameSpace[c + 1] = (char)0;
13085 return ScanWithNameSpace(tree, nameSpace, namePart);
13086 }
13087 else if(gotColon)
13088 {
13089 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13090
13091 return symbol;
13092 }
13093 else
13094 {
13095 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13096
13097 if(symbol)
13098 return symbol;
13099 return ScanWithNameSpace(tree, "", namePart);
13100 }
13101 return (((void *)0));
13102 }
13103
13104 static void ProcessDeclaration(struct Declaration * decl);
13105
13106 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13107 {
13108 struct Context * ctx;
13109 struct Symbol * symbol = (((void *)0));
13110
13111 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13112 {
13113 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13114 {
13115 symbol = (((void *)0));
13116 if(thisNameSpace)
13117 {
13118 char curName[1024];
13119
13120 strcpy(curName, thisNameSpace);
13121 strcat(curName, "::");
13122 strcat(curName, name);
13123 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13124 }
13125 if(!symbol)
13126 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13127 }
13128 else
13129 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13130 if(symbol || ctx == endContext)
13131 break;
13132 }
13133 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13134 {
13135 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13136 {
13137 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13138 struct Context * tmpContext = curContext;
13139
13140 curContext = (((void *)0));
13141 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13142 curContext = tmpContext;
13143 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13144 DeclareType(symbol->type, 0x1, 0x1);
13145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13146 symbol->id = curExternal->symbol->idCode;
13147 }
13148 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13149 {
13150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13151 symbol->id = curExternal->symbol->idCode;
13152 }
13153 }
13154 return symbol;
13155 }
13156
13157 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13158 {
13159 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13160 ListAdd(specs, MkSpecifier(UNSIGNED));
13161 switch(type->kind)
13162 {
13163 case 8:
13164 {
13165 if(type->__anon1._class->__anon1.registered)
13166 {
13167 if(!type->__anon1._class->__anon1.registered->dataType)
13168 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
13169 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13170 }
13171 break;
13172 }
13173 case 7:
13174 ListAdd(specs, MkSpecifier(DOUBLE));
13175 break;
13176 case 6:
13177 ListAdd(specs, MkSpecifier(FLOAT));
13178 break;
13179 case 1:
13180 ListAdd(specs, MkSpecifier(CHAR));
13181 break;
13182 case 24:
13183 ListAdd(specs, MkSpecifier(_BOOL));
13184 break;
13185 case 2:
13186 ListAdd(specs, MkSpecifier(SHORT));
13187 break;
13188 case 4:
13189 ListAdd(specs, MkSpecifier(INT64));
13190 break;
13191 case 22:
13192 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13193 break;
13194 case 23:
13195 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13196 break;
13197 case 3:
13198 default:
13199 ListAdd(specs, MkSpecifier(INT));
13200 break;
13201 }
13202 }
13203
13204 static void PrintArraySize(struct Type * arrayType, char * string)
13205 {
13206 char size[256];
13207
13208 size[0] = '\0';
13209 strcat(size, "[");
13210 if(arrayType->__anon1.__anon4.enumClass)
13211 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13212 else if(arrayType->__anon1.__anon4.arraySizeExp)
13213 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13214 strcat(size, "]");
13215 strcat(string, size);
13216 }
13217
13218 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13219 {
13220 if(type)
13221 {
13222 if(printConst && type->constant)
13223 strcat(string, "const ");
13224 switch(type->kind)
13225 {
13226 case 8:
13227 {
13228 struct Symbol * c = type->__anon1._class;
13229
13230 if(type->classObjectType == 2)
13231 strcat(string, "typed_object");
13232 else if(type->classObjectType == 3)
13233 strcat(string, "any_object");
13234 else
13235 {
13236 if(c && c->string)
13237 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13238 }
13239 if(type->byReference)
13240 strcat(string, " &");
13241 break;
13242 }
13243 case 0:
13244 strcat(string, "void");
13245 break;
13246 case 3:
13247 strcat(string, type->isSigned ? "int" : "uint");
13248 break;
13249 case 4:
13250 strcat(string, type->isSigned ? "int64" : "uint64");
13251 break;
13252 case 22:
13253 strcat(string, type->isSigned ? "intptr" : "uintptr");
13254 break;
13255 case 23:
13256 strcat(string, type->isSigned ? "intsize" : "uintsize");
13257 break;
13258 case 1:
13259 strcat(string, type->isSigned ? "char" : "byte");
13260 break;
13261 case 24:
13262 strcat(string, "_Bool");
13263 break;
13264 case 2:
13265 strcat(string, type->isSigned ? "short" : "uint16");
13266 break;
13267 case 6:
13268 strcat(string, "float");
13269 break;
13270 case 7:
13271 strcat(string, "double");
13272 break;
13273 case 9:
13274 if(type->__anon1.__anon1.enumName)
13275 {
13276 strcat(string, "struct ");
13277 strcat(string, type->__anon1.__anon1.enumName);
13278 }
13279 else if(type->typeName)
13280 strcat(string, type->typeName);
13281 else
13282 {
13283 struct Type * member;
13284
13285 strcat(string, "struct { ");
13286 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13287 {
13288 PrintType(member, string, 0x1, fullName);
13289 strcat(string, "; ");
13290 }
13291 strcat(string, "}");
13292 }
13293 break;
13294 case 10:
13295 if(type->__anon1.__anon1.enumName)
13296 {
13297 strcat(string, "union ");
13298 strcat(string, type->__anon1.__anon1.enumName);
13299 }
13300 else if(type->typeName)
13301 strcat(string, type->typeName);
13302 else
13303 {
13304 strcat(string, "union ");
13305 strcat(string, "(unnamed)");
13306 }
13307 break;
13308 case 15:
13309 if(type->__anon1.__anon1.enumName)
13310 {
13311 strcat(string, "enum ");
13312 strcat(string, type->__anon1.__anon1.enumName);
13313 }
13314 else if(type->typeName)
13315 strcat(string, type->typeName);
13316 else
13317 strcat(string, "int");
13318 break;
13319 case 14:
13320 strcat(string, "...");
13321 break;
13322 case 19:
13323 strcat(string, "subclass(");
13324 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13325 strcat(string, ")");
13326 break;
13327 case 20:
13328 strcat(string, type->__anon1.templateParameter->identifier->string);
13329 break;
13330 case 21:
13331 strcat(string, "thisclass");
13332 break;
13333 case 17:
13334 strcat(string, "__builtin_va_list");
13335 break;
13336 }
13337 }
13338 }
13339
13340 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13341
13342 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13343 {
13344 if(type->name && type->name[0])
13345 {
13346 if(fullName)
13347 strcat(string, type->name);
13348 else
13349 {
13350 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13351
13352 if(name)
13353 name += 2;
13354 else
13355 name = type->name;
13356 strcat(string, name);
13357 }
13358 }
13359 }
13360
13361 static void PrintAttribs(struct Type * type, char * string)
13362 {
13363 if(type)
13364 {
13365 if(type->dllExport)
13366 strcat(string, "dllexport ");
13367 if(type->attrStdcall)
13368 strcat(string, "stdcall ");
13369 }
13370 }
13371
13372 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13373 {
13374 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13375 {
13376 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13377 PrintAttribs(type, string);
13378 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13379 strcat(string, " const");
13380 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13381 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13382 strcat(string, " (");
13383 if(type->kind == 13)
13384 {
13385 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13386 PrintAttribs(type->__anon1.type, string);
13387 }
13388 if(type->kind == 13)
13389 {
13390 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13391 strcat(string, "*");
13392 else
13393 strcat(string, " *");
13394 }
13395 if(printConst && type->constant && type->kind == 13)
13396 strcat(string, " const");
13397 }
13398 else
13399 PrintTypeSpecs(type, string, fullName, printConst);
13400 }
13401
13402 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13403 {
13404 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13405 strcat(string, ")");
13406 if(type->kind == 12)
13407 PrintArraySize(type, string);
13408 else if(type->kind == 11)
13409 {
13410 struct Type * param;
13411
13412 strcat(string, "(");
13413 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13414 {
13415 PrintType(param, string, 0x1, fullName);
13416 if(param->next)
13417 strcat(string, ", ");
13418 }
13419 strcat(string, ")");
13420 }
13421 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13422 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13423 }
13424
13425 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13426 {
13427 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13428 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13429 strcat(string, " ");
13430 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13431 {
13432 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13433
13434 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13435 {
13436 if(type->classObjectType == 1)
13437 strcat(string, "class");
13438 else
13439 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13440 }
13441 else if(_class && _class->string)
13442 {
13443 char * s = _class->string;
13444
13445 if(fullName)
13446 strcat(string, s);
13447 else
13448 {
13449 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13450
13451 if(name)
13452 name += 2;
13453 else
13454 name = s;
13455 strcat(string, name);
13456 }
13457 }
13458 strcat(string, "::");
13459 }
13460 if(printName && type->name)
13461 PrintName(type, string, fullName);
13462 PostPrintType(type, string, fullName);
13463 if(type->bitFieldCount)
13464 {
13465 char count[100];
13466
13467 sprintf(count, ":%d", type->bitFieldCount);
13468 strcat(string, count);
13469 }
13470 }
13471
13472 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13473 {
13474 _PrintType(type, string, printName, fullName, 0x1);
13475 }
13476
13477 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13478 {
13479 _PrintType(type, string, printName, fullName, 0x0);
13480 }
13481
13482 static struct Type * FindMember(struct Type * type, char * string)
13483 {
13484 struct Type * memberType;
13485
13486 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13487 {
13488 if(!memberType->name)
13489 {
13490 struct Type * subType = FindMember(memberType, string);
13491
13492 if(subType)
13493 return subType;
13494 }
13495 else if(!strcmp(memberType->name, string))
13496 return memberType;
13497 }
13498 return (((void *)0));
13499 }
13500
13501 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13502 {
13503 struct Type * memberType;
13504
13505 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13506 {
13507 if(!memberType->name)
13508 {
13509 struct Type * subType = FindMember(memberType, string);
13510
13511 if(subType)
13512 {
13513 *offset += memberType->offset;
13514 return subType;
13515 }
13516 }
13517 else if(!strcmp(memberType->name, string))
13518 {
13519 *offset += memberType->offset;
13520 return memberType;
13521 }
13522 }
13523 return (((void *)0));
13524 }
13525
13526 extern unsigned int parseError;
13527
13528 unsigned int GetParseError()
13529 {
13530 return parseError;
13531 }
13532
13533 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13534
13535 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13536
13537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13538
13539 struct Expression * ParseExpressionString(char * expression)
13540 {
13541 parseError = 0x0;
13542 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13543 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13544 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13545
13546 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13547 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13548 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13549 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13550
13551 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13552 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13553 echoOn = 0x0;
13554 parsedExpression = (((void *)0));
13555 resetScanner();
13556 expression_yyparse();
13557 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13558 return parsedExpression;
13559 }
13560
13561 extern char *  QMkString(const char *  source);
13562
13563 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13564 {
13565 struct Identifier * id = exp->__anon1.__anon1.identifier;
13566 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13567 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13568 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13569 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13570
13571 if(_class && _class->type == 4)
13572 {
13573 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13574 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13575
13576 if(enumClass)
13577 {
13578 struct __ecereNameSpace__ecere__com__Class * baseClass;
13579
13580 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13581 {
13582 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13583
13584 for(value = e->values.first; value; value = value->next)
13585 {
13586 if(!strcmp(value->name, id->string))
13587 break;
13588 }
13589 if(value)
13590 {
13591 char constant[256];
13592
13593 FreeExpContents(exp);
13594 exp->type = 2;
13595 exp->isConstant = 0x1;
13596 if(!strcmp(baseClass->dataTypeString, "int"))
13597 sprintf(constant, "%d", (int)value->data);
13598 else
13599 sprintf(constant, "0x%X", (int)value->data);
13600 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13601 exp->expType = MkClassType(baseClass->fullName);
13602 break;
13603 }
13604 }
13605 }
13606 if(value)
13607 return 0x1;
13608 }
13609 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13610 {
13611 ProcessMethodType(method);
13612 exp->expType = __extension__ ({
13613 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13614
13615 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13616 });
13617 return 0x1;
13618 }
13619 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13620 {
13621 if(!prop->dataType)
13622 ProcessPropertyType(prop);
13623 exp->expType = prop->dataType;
13624 if(prop->dataType)
13625 prop->dataType->refCount++;
13626 return 0x1;
13627 }
13628 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13629 {
13630 if(!member->dataType)
13631 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13632 exp->expType = member->dataType;
13633 if(member->dataType)
13634 member->dataType->refCount++;
13635 return 0x1;
13636 }
13637 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13638 {
13639 if(!classProp->dataType)
13640 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13641 if(classProp->constant)
13642 {
13643 FreeExpContents(exp);
13644 exp->isConstant = 0x1;
13645 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13646 {
13647 exp->type = 3;
13648 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13649 }
13650 else
13651 {
13652 char constant[256];
13653
13654 exp->type = 2;
13655 sprintf(constant, "%d", (int)classProp->Get(_class));
13656 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13657 }
13658 }
13659 else
13660 {
13661 }
13662 exp->expType = classProp->dataType;
13663 if(classProp->dataType)
13664 classProp->dataType->refCount++;
13665 return 0x1;
13666 }
13667 return 0x0;
13668 }
13669
13670 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13671 {
13672 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13673 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13674 struct __ecereNameSpace__ecere__com__NameSpace * child;
13675
13676 if(!data)
13677 {
13678 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)))
13679 {
13680 data = ScanGlobalData(child, name);
13681 if(data)
13682 break;
13683 }
13684 }
13685 return data;
13686 }
13687
13688 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13689
13690 extern char *  strncpy(char * , const char * , size_t n);
13691
13692 static struct GlobalData * FindGlobalData(char * name)
13693 {
13694 int start = 0, c;
13695 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13696
13697 nameSpace = globalData;
13698 for(c = 0; name[c]; c++)
13699 {
13700 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13701 {
13702 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13703 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13704
13705 strncpy(spaceName, name + start, c - start);
13706 spaceName[c - start] = '\0';
13707 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13708 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13709 if(!newSpace)
13710 return (((void *)0));
13711 nameSpace = newSpace;
13712 if(name[c] == ':')
13713 c++;
13714 start = c + 1;
13715 }
13716 }
13717 if(c - start)
13718 {
13719 return ScanGlobalData(nameSpace, name + start);
13720 }
13721 return (((void *)0));
13722 }
13723
13724 static int definedExpStackPos;
13725
13726 static void * definedExpStack[512];
13727
13728 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13729 {
13730 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13731
13732 FreeExpContents(checkedExp);
13733 FreeType(checkedExp->expType);
13734 FreeType(checkedExp->destType);
13735 *checkedExp = *newExp;
13736 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13737 checkedExp->prev = prev;
13738 checkedExp->next = next;
13739 }
13740
13741 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13742
13743 extern int printf(const char * , ...);
13744
13745 void __ecereMethod_Expression_Clear();
13746
13747 void ApplyAnyObjectLogic(struct Expression * e)
13748 {
13749 struct Type * destType = e->destType;
13750
13751 if(destType && (destType->classObjectType == 3))
13752 {
13753 if(e && e->expType)
13754 {
13755 struct Type * type = e->expType;
13756 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13757
13758 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13759 {
13760 _class = type->__anon1._class->__anon1.registered;
13761 }
13762 else if(type->kind == 19)
13763 {
13764 _class = FindClass("ecere::com::Class")->__anon1.registered;
13765 }
13766 else
13767 {
13768 char string[1024] = "";
13769 struct Symbol * classSym;
13770
13771 PrintTypeNoConst(type, string, 0x0, 0x1);
13772 classSym = FindClass(string);
13773 if(classSym)
13774 _class = classSym->__anon1.registered;
13775 }
13776 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)))
13777 {
13778 if(!_class || strcmp(_class->fullName, "char *"))
13779 {
13780 struct Expression * checkedExp = e, * newExp;
13781
13782 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13783 {
13784 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13785 {
13786 if(checkedExp->type == 23)
13787 {
13788 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13789 }
13790 else
13791 checkedExp = (*checkedExp->__anon1.list).last;
13792 }
13793 else if(checkedExp->type == 11)
13794 checkedExp = checkedExp->__anon1.cast.exp;
13795 }
13796 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13797 {
13798 newExp = checkedExp->__anon1.op.exp2;
13799 checkedExp->__anon1.op.exp2 = (((void *)0));
13800 FreeExpContents(checkedExp);
13801 if(e->expType && e->expType->passAsTemplate)
13802 {
13803 char size[100];
13804
13805 ComputeTypeSize(e->expType);
13806 sprintf(size, "%d", e->expType->size);
13807 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))))));
13808 }
13809 ReplaceExpContents(checkedExp, newExp);
13810 e->byReference = 0x1;
13811 }
13812 else if(!e->byReference || (_class && _class->type == 5))
13813 {
13814 struct Expression * checkedExp;
13815
13816 {
13817 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;
13818
13819 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13820 {
13821 struct Context * context = PushContext();
13822 struct Declarator * decl;
13823 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13824 char typeString[1024];
13825 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13826
13827 typeString[0] = '\0';
13828 *newExp = *e;
13829 newExp->prev = (((void *)0));
13830 newExp->next = (((void *)0));
13831 newExp->expType = (((void *)0));
13832 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13833 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13834 newExp->destType = ProcessType(specs, decl);
13835 curContext = context;
13836 if(curCompound)
13837 {
13838 char name[100];
13839 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13840
13841 e->type = 23;
13842 sprintf(name, "__internalValue%03X", internalValueCounter++);
13843 if(!curCompound->__anon1.compound.declarations)
13844 curCompound->__anon1.compound.declarations = MkList();
13845 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13846 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13847 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13848 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13849 }
13850 else
13851 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13852 {
13853 struct Type * type = e->destType;
13854
13855 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13856 CopyTypeInto(e->destType, type);
13857 e->destType->refCount = 1;
13858 e->destType->classObjectType = 0;
13859 FreeType(type);
13860 }
13861 e->__anon1.compound->__anon1.compound.context = context;
13862 PopContext(context);
13863 curContext = context->parent;
13864 }
13865 }
13866 checkedExp = e;
13867 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13868 {
13869 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13870 {
13871 if(checkedExp->type == 23)
13872 {
13873 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13874 }
13875 else
13876 checkedExp = (*checkedExp->__anon1.list).last;
13877 }
13878 else if(checkedExp->type == 11)
13879 checkedExp = checkedExp->__anon1.cast.exp;
13880 }
13881 {
13882 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13883
13884 *operand = *checkedExp;
13885 checkedExp->destType = (((void *)0));
13886 checkedExp->expType = (((void *)0));
13887 __ecereMethod_Expression_Clear(checkedExp);
13888 checkedExp->type = 4;
13889 checkedExp->__anon1.op.op = '&';
13890 checkedExp->__anon1.op.exp1 = (((void *)0));
13891 checkedExp->__anon1.op.exp2 = operand;
13892 }
13893 }
13894 }
13895 }
13896 }
13897 }
13898 {
13899 }
13900 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))))
13901 {
13902 if(e->expType->classObjectType && destType && destType->classObjectType)
13903 {
13904 return ;
13905 }
13906 else
13907 {
13908 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13909
13910 *thisExp = *e;
13911 thisExp->prev = (((void *)0));
13912 thisExp->next = (((void *)0));
13913 __ecereMethod_Expression_Clear(e);
13914 e->type = 5;
13915 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13916 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13917 ((struct Expression *)(*e->__anon1.list).first)->byReference = 0x1;
13918 {
13919 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13920 CopyTypeInto(e->expType, thisExp->expType);
13921 e->expType->byReference = 0x0;
13922 e->expType->refCount = 1;
13923 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))
13924 {
13925 e->expType->classObjectType = 0;
13926 }
13927 }
13928 }
13929 }
13930 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13931 {
13932 if(destType->kind == 14)
13933 {
13934 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13935 }
13936 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))
13937 {
13938 unsigned int byReference = e->expType->byReference;
13939 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13940 struct Declarator * decl;
13941 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13942 char typeString[1024];
13943 struct Type * type;
13944 int backupClassObjectType;
13945 unsigned int backupByReference;
13946
13947 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13948 type = e->expType;
13949 else
13950 type = destType;
13951 backupClassObjectType = type->classObjectType;
13952 backupByReference = type->byReference;
13953 type->classObjectType = 0;
13954 type->byReference = 0x0;
13955 typeString[0] = '\0';
13956 PrintType(type, typeString, 0x0, 0x1);
13957 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13958 type->classObjectType = backupClassObjectType;
13959 type->byReference = backupByReference;
13960 *thisExp = *e;
13961 thisExp->prev = (((void *)0));
13962 thisExp->next = (((void *)0));
13963 __ecereMethod_Expression_Clear(e);
13964 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)))
13965 {
13966 e->type = 4;
13967 e->__anon1.op.op = '*';
13968 e->__anon1.op.exp1 = (((void *)0));
13969 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13970 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13971 CopyTypeInto(e->expType, type);
13972 e->expType->byReference = 0x0;
13973 e->expType->refCount = 1;
13974 }
13975 else
13976 {
13977 e->type = 11;
13978 e->__anon1.cast.typeName = MkTypeName(specs, decl);
13979 e->__anon1.cast.exp = thisExp;
13980 e->byReference = 0x1;
13981 e->expType = type;
13982 type->refCount++;
13983 }
13984 e->destType = destType;
13985 destType->refCount++;
13986 }
13987 }
13988 }
13989
13990 void ApplyLocation(struct Expression * exp, struct Location * loc)
13991 {
13992 exp->loc = *loc;
13993 switch(exp->type)
13994 {
13995 case 4:
13996 if(exp->__anon1.op.exp1)
13997 ApplyLocation(exp->__anon1.op.exp1, loc);
13998 if(exp->__anon1.op.exp2)
13999 ApplyLocation(exp->__anon1.op.exp2, loc);
14000 break;
14001 case 5:
14002 if(exp->__anon1.list)
14003 {
14004 struct Expression * e;
14005
14006 for(e = (*exp->__anon1.list).first; e; e = e->next)
14007 ApplyLocation(e, loc);
14008 }
14009 break;
14010 case 6:
14011 if(exp->__anon1.index.index)
14012 {
14013 struct Expression * e;
14014
14015 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14016 ApplyLocation(e, loc);
14017 }
14018 if(exp->__anon1.index.exp)
14019 ApplyLocation(exp->__anon1.index.exp, loc);
14020 break;
14021 case 7:
14022 if(exp->__anon1.call.arguments)
14023 {
14024 struct Expression * arg;
14025
14026 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14027 ApplyLocation(arg, loc);
14028 }
14029 if(exp->__anon1.call.exp)
14030 ApplyLocation(exp->__anon1.call.exp, loc);
14031 break;
14032 case 8:
14033 case 9:
14034 if(exp->__anon1.member.exp)
14035 ApplyLocation(exp->__anon1.member.exp, loc);
14036 break;
14037 case 11:
14038 if(exp->__anon1.cast.exp)
14039 ApplyLocation(exp->__anon1.cast.exp, loc);
14040 break;
14041 case 12:
14042 if(exp->__anon1.cond.exp)
14043 {
14044 struct Expression * e;
14045
14046 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14047 ApplyLocation(e, loc);
14048 }
14049 if(exp->__anon1.cond.cond)
14050 ApplyLocation(exp->__anon1.cond.cond, loc);
14051 if(exp->__anon1.cond.elseExp)
14052 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14053 break;
14054 case 34:
14055 if(exp->__anon1.vaArg.exp)
14056 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14057 break;
14058 default:
14059 break;
14060 }
14061 }
14062
14063 extern char *  strstr(const char * , const char * );
14064
14065 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14066
14067 struct __ecereNameSpace__ecere__com__DefinedExpression
14068 {
14069 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14070 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14071 const char *  name;
14072 const char *  value;
14073 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14074 } __attribute__ ((gcc_struct));
14075
14076 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14077
14078 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14079
14080 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14081
14082 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14083
14084 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14085
14086 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14087
14088 static void ProcessStatement(struct Statement * stmt);
14089
14090 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14091
14092 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14093
14094 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14095
14096 extern const char *  sourceFile;
14097
14098 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14099
14100 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
14101
14102 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14103
14104 void ProcessExpressionType(struct Expression * exp)
14105 {
14106 unsigned int unresolved = 0x0;
14107 struct Location oldyylloc = yylloc;
14108 unsigned int notByReference = 0x0;
14109
14110 if(!exp || exp->expType)
14111 return ;
14112 yylloc = exp->loc;
14113 switch(exp->type)
14114 {
14115 case 0:
14116 {
14117 struct Identifier * id = exp->__anon1.__anon1.identifier;
14118
14119 if(!id || !topContext)
14120 return ;
14121 if(id->_class && id->_class->__anon1.__anon1.name)
14122 {
14123 id->classSym = id->_class->__anon1.__anon1.symbol;
14124 }
14125 if(strstr(id->string, "__ecereClass") == id->string)
14126 {
14127 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
14128 break;
14129 }
14130 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14131 {
14132 ReplaceClassMembers(exp, thisClass);
14133 if(exp->type != 0)
14134 {
14135 ProcessExpressionType(exp);
14136 break;
14137 }
14138 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0x0))
14139 break;
14140 }
14141 else
14142 {
14143 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14144
14145 if(!symbol)
14146 {
14147 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0, 0x0))
14148 break;
14149 else
14150 {
14151 if(thisClass)
14152 {
14153 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14154 if(exp->type != 0)
14155 {
14156 ProcessExpressionType(exp);
14157 break;
14158 }
14159 }
14160 else if(currentClass && !id->_class)
14161 {
14162 if(ResolveIdWithClass(exp, currentClass, 0x1))
14163 break;
14164 }
14165 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14166 }
14167 }
14168 if(symbol)
14169 {
14170 struct Type * type = symbol->type;
14171 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14172
14173 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14174 {
14175 struct Context * context = SetupTemplatesContext(_class);
14176
14177 type = ReplaceThisClassType(_class);
14178 FinishTemplatesContext(context);
14179 if(type)
14180 type->refCount = 0;
14181 }
14182 FreeSpecifier(id->_class);
14183 id->_class = (((void *)0));
14184 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14185 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14186 id->classSym = (((void *)0));
14187 exp->expType = type;
14188 if(type)
14189 type->refCount++;
14190 if(type && (type->kind == 15))
14191 exp->isConstant = 0x1;
14192 if(symbol->isParam || !strcmp(id->string, "this"))
14193 {
14194 if(_class && _class->type == 1 && !type->declaredWithStruct)
14195 exp->byReference = 0x1;
14196 }
14197 if(symbol->isIterator)
14198 {
14199 if(symbol->isIterator == 3)
14200 {
14201 exp->type = 5;
14202 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14203 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14204 exp->expType = (((void *)0));
14205 ProcessExpressionType(exp);
14206 }
14207 else if(symbol->isIterator != 4)
14208 {
14209 exp->type = 8;
14210 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14211 exp->__anon1.member.exp->expType = exp->expType;
14212 exp->__anon1.member.member = MkIdentifier("data");
14213 exp->expType = (((void *)0));
14214 ProcessExpressionType(exp);
14215 }
14216 }
14217 break;
14218 }
14219 else
14220 {
14221 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14222
14223 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14224 {
14225 char name[1024];
14226
14227 strcpy(name, thisNameSpace);
14228 strcat(name, "::");
14229 strcat(name, id->string);
14230 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14231 }
14232 if(!definedExp)
14233 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14234 if(definedExp)
14235 {
14236 int c;
14237
14238 for(c = 0; c < definedExpStackPos; c++)
14239 if(definedExpStack[c] == definedExp)
14240 break;
14241 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14242 {
14243 struct Location backupYylloc = yylloc;
14244 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14245
14246 definedExpStack[definedExpStackPos++] = definedExp;
14247 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14248 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14249 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14250
14251 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14252 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14253 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14254 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14255
14256 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14257 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14258 echoOn = 0x0;
14259 parsedExpression = (((void *)0));
14260 resetScanner();
14261 expression_yyparse();
14262 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14263 if(backInput)
14264 fileInput = backInput;
14265 yylloc = backupYylloc;
14266 if(parsedExpression)
14267 {
14268 FreeIdentifier(id);
14269 exp->type = 5;
14270 exp->__anon1.list = MkListOne(parsedExpression);
14271 ApplyLocation(parsedExpression, &yylloc);
14272 ProcessExpressionType(exp);
14273 definedExpStackPos--;
14274 return ;
14275 }
14276 definedExpStackPos--;
14277 }
14278 else
14279 {
14280 if(inCompiler)
14281 {
14282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14283 }
14284 }
14285 }
14286 else
14287 {
14288 struct GlobalData * data = (((void *)0));
14289
14290 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14291 {
14292 char name[1024];
14293
14294 strcpy(name, thisNameSpace);
14295 strcat(name, "::");
14296 strcat(name, id->string);
14297 data = FindGlobalData(name);
14298 }
14299 if(!data)
14300 data = FindGlobalData(id->string);
14301 if(data)
14302 {
14303 DeclareGlobalData(data);
14304 exp->expType = data->dataType;
14305 if(data->dataType)
14306 data->dataType->refCount++;
14307 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14308 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14309 FreeSpecifier(id->_class);
14310 id->_class = (((void *)0));
14311 break;
14312 }
14313 else
14314 {
14315 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14316
14317 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14318 {
14319 char name[1024];
14320
14321 strcpy(name, thisNameSpace);
14322 strcat(name, "::");
14323 strcat(name, id->string);
14324 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14325 }
14326 if(!function)
14327 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14328 if(function)
14329 {
14330 char name[1024];
14331
14332 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14333 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14334 name[0] = (char)0;
14335 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14336 strcpy(name, "__ecereFunction_");
14337 FullClassNameCat(name, id->string, 0x0);
14338 if(DeclareFunction(function, name))
14339 {
14340 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14341 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14342 }
14343 exp->expType = function->dataType;
14344 if(function->dataType)
14345 function->dataType->refCount++;
14346 FreeSpecifier(id->_class);
14347 id->_class = (((void *)0));
14348 break;
14349 }
14350 }
14351 }
14352 }
14353 }
14354 unresolved = 0x1;
14355 break;
14356 }
14357 case 1:
14358 {
14359 if(!exp->__anon1.instance->_class)
14360 {
14361 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14362 {
14363 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14364 }
14365 }
14366 ProcessInstantiationType(exp->__anon1.instance);
14367 exp->isConstant = exp->__anon1.instance->isConstant;
14368 if(exp->__anon1.instance->_class)
14369 {
14370 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14371 }
14372 break;
14373 }
14374 case 2:
14375 {
14376 if(!exp->expType)
14377 {
14378 char * constant = exp->__anon1.__anon1.constant;
14379 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14380
14381 exp->expType = type;
14382 if(constant[0] == '\'')
14383 {
14384 if((int)((unsigned char *)constant)[1] > 127)
14385 {
14386 int nb;
14387 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14388
14389 if(nb < 2)
14390 ch = constant[1];
14391 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14392 exp->__anon1.__anon1.constant = PrintUInt(ch);
14393 type->kind = 8;
14394 type->__anon1._class = FindClass("unichar");
14395 type->isSigned = 0x0;
14396 }
14397 else
14398 {
14399 type->kind = 1;
14400 type->isSigned = 0x1;
14401 }
14402 }
14403 else
14404 {
14405 char * dot = strchr(constant, '.');
14406 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14407 char * exponent;
14408
14409 if(isHex)
14410 {
14411 exponent = strchr(constant, 'p');
14412 if(!exponent)
14413 exponent = strchr(constant, 'P');
14414 }
14415 else
14416 {
14417 exponent = strchr(constant, 'e');
14418 if(!exponent)
14419 exponent = strchr(constant, 'E');
14420 }
14421 if(dot || exponent)
14422 {
14423 if(strchr(constant, 'f') || strchr(constant, 'F'))
14424 type->kind = 6;
14425 else
14426 type->kind = 7;
14427 type->isSigned = 0x1;
14428 }
14429 else
14430 {
14431 unsigned int isSigned = constant[0] == '-';
14432 char * endP = (((void *)0));
14433 long long i64 = strtoll(constant, &endP, 0);
14434 uint64 ui64 = strtoull(constant, &endP, 0);
14435 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14436
14437 if(isSigned)
14438 {
14439 if(i64 < (((int)0x80000000)))
14440 is64Bit = 0x1;
14441 }
14442 else
14443 {
14444 if(ui64 > (((int)0x7fffffff)))
14445 {
14446 if(ui64 > (0xffffffff))
14447 {
14448 is64Bit = 0x1;
14449 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14450 isSigned = 0x1;
14451 }
14452 }
14453 else if(constant[0] != '0' || !constant[1])
14454 isSigned = 0x1;
14455 }
14456 type->kind = is64Bit ? 4 : 3;
14457 type->isSigned = isSigned;
14458 }
14459 }
14460 exp->isConstant = 0x1;
14461 if(exp->destType && exp->destType->kind == 7)
14462 type->kind = 7;
14463 else if(exp->destType && exp->destType->kind == 6)
14464 type->kind = 6;
14465 else if(exp->destType && exp->destType->kind == 4)
14466 type->kind = 4;
14467 }
14468 break;
14469 }
14470 case 3:
14471 {
14472 exp->isConstant = 0x1;
14473 exp->expType = __extension__ ({
14474 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14475
14476 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14477 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14478
14479 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14480 }), __ecereInstance2;
14481 });
14482 break;
14483 }
14484 case 13:
14485 case 26:
14486 ProcessExpressionType(exp->__anon1._new.size);
14487 exp->expType = __extension__ ({
14488 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14489
14490 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14491 });
14492 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14493 break;
14494 case 14:
14495 case 27:
14496 ProcessExpressionType(exp->__anon1._renew.size);
14497 ProcessExpressionType(exp->__anon1._renew.exp);
14498 exp->expType = __extension__ ({
14499 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14500
14501 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14502 });
14503 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14504 break;
14505 case 4:
14506 {
14507 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14508 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14509 unsigned int useDestType = 0x0, useSideType = 0x0;
14510 struct Location oldyylloc = yylloc;
14511 unsigned int useSideUnit = 0x0;
14512 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14513 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14514
14515 switch(exp->__anon1.op.op)
14516 {
14517 case '=':
14518 case MUL_ASSIGN:
14519 case DIV_ASSIGN:
14520 case MOD_ASSIGN:
14521 case ADD_ASSIGN:
14522 case SUB_ASSIGN:
14523 case LEFT_ASSIGN:
14524 case RIGHT_ASSIGN:
14525 case AND_ASSIGN:
14526 case XOR_ASSIGN:
14527 case OR_ASSIGN:
14528 assign = 0x1;
14529 break;
14530 case '!':
14531 break;
14532 case AND_OP:
14533 case OR_OP:
14534 boolOps = 0x1;
14535 boolResult = 0x1;
14536 break;
14537 case EQ_OP:
14538 case '<':
14539 case '>':
14540 case LE_OP:
14541 case GE_OP:
14542 case NE_OP:
14543 boolResult = 0x1;
14544 useSideType = 0x1;
14545 break;
14546 case '+':
14547 case '-':
14548 useSideUnit = 0x1;
14549 useSideType = 0x1;
14550 useDestType = 0x1;
14551 break;
14552 case LEFT_OP:
14553 case RIGHT_OP:
14554 useSideType = 0x1;
14555 useDestType = 0x1;
14556 break;
14557 case '|':
14558 case '^':
14559 useSideType = 0x1;
14560 useDestType = 0x1;
14561 break;
14562 case '/':
14563 case '%':
14564 useSideType = 0x1;
14565 useDestType = 0x1;
14566 break;
14567 case '&':
14568 case '*':
14569 if(exp->__anon1.op.exp1)
14570 {
14571 useSideType = 0x1;
14572 useDestType = 0x1;
14573 }
14574 break;
14575 }
14576 if(exp->__anon1.op.op == '&')
14577 {
14578 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14579 {
14580 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14581 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14582
14583 if(symbol && symbol->isIterator == 2)
14584 {
14585 exp->type = 8;
14586 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14587 exp->__anon1.member.member = MkIdentifier("key");
14588 exp->expType = (((void *)0));
14589 exp->__anon1.op.exp2->expType = symbol->type;
14590 symbol->type->refCount++;
14591 ProcessExpressionType(exp);
14592 FreeType(dummy);
14593 break;
14594 }
14595 }
14596 }
14597 if(exp->__anon1.op.exp1)
14598 {
14599 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14600 useDestType = 0x0;
14601 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14602 {
14603 if(exp->__anon1.op.exp1->destType)
14604 FreeType(exp->__anon1.op.exp1->destType);
14605 exp->__anon1.op.exp1->destType = exp->destType;
14606 exp->__anon1.op.exp1->opDestType = 0x1;
14607 if(exp->destType)
14608 exp->destType->refCount++;
14609 }
14610 else if(!assign)
14611 {
14612 if(exp->__anon1.op.exp1->destType)
14613 FreeType(exp->__anon1.op.exp1->destType);
14614 exp->__anon1.op.exp1->destType = dummy;
14615 dummy->refCount++;
14616 }
14617 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14618 exp->__anon1.op.exp1->destType->count++;
14619 ProcessExpressionType(exp->__anon1.op.exp1);
14620 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14621 exp->__anon1.op.exp1->destType->count--;
14622 exp->__anon1.op.exp1->opDestType = 0x0;
14623 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)
14624 {
14625 exp->__anon1.op.exp2 = MkExpConstant("1");
14626 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14627 assign = 0x1;
14628 }
14629 if(exp->__anon1.op.exp1->destType == dummy)
14630 {
14631 FreeType(dummy);
14632 exp->__anon1.op.exp1->destType = (((void *)0));
14633 }
14634 type1 = exp->__anon1.op.exp1->expType;
14635 }
14636 if(exp->__anon1.op.exp2)
14637 {
14638 char expString[10240];
14639
14640 expString[0] = '\0';
14641 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14642 {
14643 if(exp->__anon1.op.exp1)
14644 {
14645 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14646 if(exp->__anon1.op.exp1->expType)
14647 exp->__anon1.op.exp1->expType->refCount++;
14648 }
14649 else
14650 {
14651 exp->__anon1.op.exp2->destType = exp->destType;
14652 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14653 exp->__anon1.op.exp2->opDestType = 0x1;
14654 if(exp->destType)
14655 exp->destType->refCount++;
14656 }
14657 if(type1)
14658 type1->refCount++;
14659 exp->expType = type1;
14660 }
14661 else if(assign)
14662 {
14663 if(inCompiler)
14664 PrintExpression(exp->__anon1.op.exp2, expString);
14665 if(type1 && type1->kind == 13)
14666 {
14667 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)
14668 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14669 else if(exp->__anon1.op.op == '=')
14670 {
14671 if(exp->__anon1.op.exp2->destType)
14672 FreeType(exp->__anon1.op.exp2->destType);
14673 exp->__anon1.op.exp2->destType = type1;
14674 if(type1)
14675 type1->refCount++;
14676 }
14677 }
14678 else
14679 {
14680 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)
14681 ;
14682 else
14683 {
14684 if(exp->__anon1.op.exp2->destType)
14685 FreeType(exp->__anon1.op.exp2->destType);
14686 exp->__anon1.op.exp2->destType = type1;
14687 if(type1)
14688 type1->refCount++;
14689 }
14690 }
14691 if(type1)
14692 type1->refCount++;
14693 exp->expType = type1;
14694 }
14695 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14696 {
14697 if(exp->__anon1.op.exp2->destType)
14698 FreeType(exp->__anon1.op.exp2->destType);
14699 exp->__anon1.op.exp2->destType = exp->destType;
14700 if(exp->__anon1.op.op != '&')
14701 exp->__anon1.op.exp2->opDestType = 0x1;
14702 if(exp->destType)
14703 exp->destType->refCount++;
14704 }
14705 else
14706 {
14707 if(exp->__anon1.op.exp2->destType)
14708 FreeType(exp->__anon1.op.exp2->destType);
14709 exp->__anon1.op.exp2->destType = dummy;
14710 dummy->refCount++;
14711 }
14712 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))
14713 {
14714 FreeType(exp->__anon1.op.exp2->destType);
14715 exp->__anon1.op.exp2->destType = type1;
14716 type1->refCount++;
14717 }
14718 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14719 exp->__anon1.op.exp2->destType->count++;
14720 if(exp->__anon1.op.op == SIZEOF)
14721 {
14722 struct Expression * e = exp->__anon1.op.exp2;
14723
14724 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14725 {
14726 if(e->type == 5 || e->type == 32 || e->type == 23)
14727 {
14728 if(e->type == 23)
14729 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14730 else
14731 e = (*e->__anon1.list).last;
14732 }
14733 }
14734 if(e->type == 11 && e->__anon1.cast.exp)
14735 e->__anon1.cast.exp->needCast = 0x1;
14736 }
14737 ProcessExpressionType(exp->__anon1.op.exp2);
14738 exp->__anon1.op.exp2->opDestType = 0x0;
14739 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14740 exp->__anon1.op.exp2->destType->count--;
14741 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14742 {
14743 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)
14744 {
14745 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14746 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14747 }
14748 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)))
14749 {
14750 if(exp->__anon1.op.op == ADD_ASSIGN)
14751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14752 }
14753 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))
14754 {
14755 if(exp->__anon1.op.op == ADD_ASSIGN)
14756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14757 }
14758 else if(inCompiler)
14759 {
14760 char type1String[1024];
14761 char type2String[1024];
14762
14763 type1String[0] = '\0';
14764 type2String[0] = '\0';
14765 PrintType(exp->__anon1.op.exp2->expType, type1String, 0x0, 0x1);
14766 PrintType(type1, type2String, 0x0, 0x1);
14767 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14768 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14769 }
14770 }
14771 if(exp->__anon1.op.exp2->destType == dummy)
14772 {
14773 FreeType(dummy);
14774 exp->__anon1.op.exp2->destType = (((void *)0));
14775 }
14776 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14777 {
14778 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14779 type2->refCount = 1;
14780 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14781 type2->isSigned = 0x1;
14782 }
14783 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))
14784 {
14785 type2 = __extension__ ({
14786 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14787
14788 __ecereInstance1->kind = 3, __ecereInstance1;
14789 });
14790 type2->refCount = 1;
14791 type2->isSigned = 0x1;
14792 }
14793 else
14794 {
14795 type2 = exp->__anon1.op.exp2->expType;
14796 if(type2)
14797 type2->refCount++;
14798 }
14799 }
14800 dummy->kind = 0;
14801 if(exp->__anon1.op.op == SIZEOF)
14802 {
14803 exp->expType = __extension__ ({
14804 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14805
14806 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14807 });
14808 exp->isConstant = 0x1;
14809 }
14810 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14811 {
14812 exp->expType = Dereference(type2);
14813 if(type2 && type2->kind == 8)
14814 notByReference = 0x1;
14815 }
14816 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14817 exp->expType = Reference(type2);
14818 else if(!assign)
14819 {
14820 if(boolOps)
14821 {
14822 if(exp->__anon1.op.exp1)
14823 {
14824 if(exp->__anon1.op.exp1->destType)
14825 FreeType(exp->__anon1.op.exp1->destType);
14826 exp->__anon1.op.exp1->destType = MkClassType("bool");
14827 exp->__anon1.op.exp1->destType->truth = 0x1;
14828 if(!exp->__anon1.op.exp1->expType)
14829 ProcessExpressionType(exp->__anon1.op.exp1);
14830 else
14831 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
14832 FreeType(exp->__anon1.op.exp1->expType);
14833 exp->__anon1.op.exp1->expType = MkClassType("bool");
14834 exp->__anon1.op.exp1->expType->truth = 0x1;
14835 }
14836 if(exp->__anon1.op.exp2)
14837 {
14838 if(exp->__anon1.op.exp2->destType)
14839 FreeType(exp->__anon1.op.exp2->destType);
14840 exp->__anon1.op.exp2->destType = MkClassType("bool");
14841 exp->__anon1.op.exp2->destType->truth = 0x1;
14842 if(!exp->__anon1.op.exp2->expType)
14843 ProcessExpressionType(exp->__anon1.op.exp2);
14844 else
14845 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
14846 FreeType(exp->__anon1.op.exp2->expType);
14847 exp->__anon1.op.exp2->expType = MkClassType("bool");
14848 exp->__anon1.op.exp2->expType->truth = 0x1;
14849 }
14850 }
14851 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")))))
14852 {
14853 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"))))
14854 {
14855 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)))
14856 {
14857 struct Type * intType;
14858
14859 if(!type1->__anon1._class->__anon1.registered->dataType)
14860 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14861 if(!type2->__anon1._class->__anon1.registered->dataType)
14862 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14863 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14864 if(exp->__anon1.op.exp1->destType)
14865 FreeType(exp->__anon1.op.exp1->destType);
14866 if(exp->__anon1.op.exp2->destType)
14867 FreeType(exp->__anon1.op.exp2->destType);
14868 exp->__anon1.op.exp1->destType = intType;
14869 exp->__anon1.op.exp2->destType = intType;
14870 intType->refCount++;
14871 }
14872 else
14873 {
14874 if(exp->__anon1.op.exp2->destType)
14875 FreeType(exp->__anon1.op.exp2->destType);
14876 exp->__anon1.op.exp2->destType = type1;
14877 type1->refCount++;
14878 if(exp->__anon1.op.exp1->destType)
14879 FreeType(exp->__anon1.op.exp1->destType);
14880 exp->__anon1.op.exp1->destType = type2;
14881 type2->refCount++;
14882 }
14883 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)
14884 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);
14885 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14886 {
14887 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14888
14889 if(argExp)
14890 {
14891 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14892
14893 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14894 ProcessExpressionType(exp->__anon1.op.exp1);
14895 if(type2->kind != 13)
14896 {
14897 ProcessExpressionType(classExp);
14898 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14899 if(!exp->__anon1.op.exp2->expType)
14900 {
14901 if(type2)
14902 FreeType(type2);
14903 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0x0);
14904 type2->refCount++;
14905 }
14906 ProcessExpressionType(exp->__anon1.op.exp2);
14907 }
14908 }
14909 }
14910 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)))
14911 {
14912 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14914 exp->expType = type1;
14915 if(type1)
14916 type1->refCount++;
14917 }
14918 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)))
14919 {
14920 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14922 exp->expType = type2;
14923 if(type2)
14924 type2->refCount++;
14925 }
14926 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))
14927 {
14928 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14929 }
14930 else
14931 {
14932 unsigned int success = 0x0;
14933
14934 if(type1->kind == 13 && type2->kind == 13)
14935 {
14936 if(exp->__anon1.op.op == '+')
14937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14938 else if(exp->__anon1.op.op == '-')
14939 {
14940 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, 0x0))
14941 {
14942 exp->expType = __extension__ ({
14943 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14944
14945 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14946 });
14947 success = 0x1;
14948 if(type1->__anon1.type->kind == 20)
14949 {
14950 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14951
14952 if(argExp)
14953 {
14954 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14955
14956 ProcessExpressionType(classExp);
14957 exp->type = 5;
14958 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"))));
14959 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
14960 FreeType(dummy);
14961 return ;
14962 }
14963 }
14964 }
14965 }
14966 }
14967 if(!success && exp->__anon1.op.exp1->type == 2)
14968 {
14969 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
14970 {
14971 if(exp->expType)
14972 FreeType(exp->expType);
14973 exp->expType = exp->__anon1.op.exp1->destType;
14974 if(exp->__anon1.op.exp1->destType)
14975 exp->__anon1.op.exp1->destType->refCount++;
14976 success = 0x1;
14977 }
14978 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14979 {
14980 if(exp->expType)
14981 FreeType(exp->expType);
14982 exp->expType = exp->__anon1.op.exp2->destType;
14983 if(exp->__anon1.op.exp2->destType)
14984 exp->__anon1.op.exp2->destType->refCount++;
14985 success = 0x1;
14986 }
14987 }
14988 else if(!success)
14989 {
14990 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14991 {
14992 if(exp->expType)
14993 FreeType(exp->expType);
14994 exp->expType = exp->__anon1.op.exp2->destType;
14995 if(exp->__anon1.op.exp2->destType)
14996 exp->__anon1.op.exp2->destType->refCount++;
14997 success = 0x1;
14998 }
14999 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15000 {
15001 if(exp->expType)
15002 FreeType(exp->expType);
15003 exp->expType = exp->__anon1.op.exp1->destType;
15004 if(exp->__anon1.op.exp1->destType)
15005 exp->__anon1.op.exp1->destType->refCount++;
15006 success = 0x1;
15007 }
15008 }
15009 if(!success)
15010 {
15011 char expString1[10240];
15012 char expString2[10240];
15013 char type1[1024];
15014 char type2[1024];
15015
15016 expString1[0] = '\0';
15017 expString2[0] = '\0';
15018 type1[0] = '\0';
15019 type2[0] = '\0';
15020 if(inCompiler)
15021 {
15022 PrintExpression(exp->__anon1.op.exp1, expString1);
15023 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15024 PrintExpression(exp->__anon1.op.exp2, expString2);
15025 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15026 PrintType(exp->__anon1.op.exp1->expType, type1, 0x0, 0x1);
15027 PrintType(exp->__anon1.op.exp2->expType, type2, 0x0, 0x1);
15028 }
15029 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15030 }
15031 }
15032 }
15033 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)
15034 {
15035 if(exp->__anon1.op.exp1->destType)
15036 FreeType(exp->__anon1.op.exp1->destType);
15037 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15038 if(type2->__anon1._class->__anon1.registered->dataType)
15039 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15040 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15041 exp->expType = type2;
15042 if(type2)
15043 type2->refCount++;
15044 }
15045 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)
15046 {
15047 if(exp->__anon1.op.exp2->destType)
15048 FreeType(exp->__anon1.op.exp2->destType);
15049 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15050 if(type1->__anon1._class->__anon1.registered->dataType)
15051 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15052 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15053 exp->expType = type1;
15054 if(type1)
15055 type1->refCount++;
15056 }
15057 else if(type1)
15058 {
15059 unsigned int valid = 0x0;
15060
15061 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15062 {
15063 if(exp->__anon1.op.exp2->destType)
15064 FreeType(exp->__anon1.op.exp2->destType);
15065 if(!type1->__anon1._class->__anon1.registered->dataType)
15066 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15067 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15068 exp->__anon1.op.exp2->destType->refCount++;
15069 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15070 if(type2)
15071 FreeType(type2);
15072 type2 = exp->__anon1.op.exp2->destType;
15073 if(type2)
15074 type2->refCount++;
15075 exp->expType = type2;
15076 type2->refCount++;
15077 }
15078 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15079 {
15080 if(exp->__anon1.op.exp1->destType)
15081 FreeType(exp->__anon1.op.exp1->destType);
15082 if(!type2->__anon1._class->__anon1.registered->dataType)
15083 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15084 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15085 exp->__anon1.op.exp1->destType->refCount++;
15086 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15087 type1 = exp->__anon1.op.exp1->destType;
15088 exp->expType = type1;
15089 type1->refCount++;
15090 }
15091 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15092 {
15093 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15094 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15095
15096 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15097 {
15098 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15099 {
15100 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15101 {
15102 if(exp->expType)
15103 FreeType(exp->expType);
15104 exp->expType = exp->__anon1.op.exp2->expType;
15105 if(exp->__anon1.op.exp2->expType)
15106 exp->__anon1.op.exp2->expType->refCount++;
15107 valid = 0x1;
15108 }
15109 }
15110 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15111 {
15112 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15113 {
15114 if(exp->expType)
15115 FreeType(exp->expType);
15116 exp->expType = exp->__anon1.op.exp1->expType;
15117 if(exp->__anon1.op.exp1->expType)
15118 exp->__anon1.op.exp1->expType->refCount++;
15119 valid = 0x1;
15120 }
15121 }
15122 }
15123 else
15124 {
15125 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15126 {
15127 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15128 {
15129 if(exp->expType)
15130 FreeType(exp->expType);
15131 exp->expType = exp->__anon1.op.exp1->expType;
15132 if(exp->__anon1.op.exp1->expType)
15133 exp->__anon1.op.exp1->expType->refCount++;
15134 valid = 0x1;
15135 }
15136 }
15137 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15138 {
15139 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15140 {
15141 if(exp->expType)
15142 FreeType(exp->expType);
15143 exp->expType = exp->__anon1.op.exp2->expType;
15144 if(exp->__anon1.op.exp2->expType)
15145 exp->__anon1.op.exp2->expType->refCount++;
15146 valid = 0x1;
15147 }
15148 }
15149 }
15150 }
15151 if(!valid)
15152 {
15153 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))
15154 {
15155 if(exp->__anon1.op.exp1->destType)
15156 FreeType(exp->__anon1.op.exp1->destType);
15157 exp->__anon1.op.exp1->destType = type2;
15158 type2->refCount++;
15159 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15160 {
15161 if(exp->expType)
15162 FreeType(exp->expType);
15163 exp->expType = exp->__anon1.op.exp1->destType;
15164 if(exp->__anon1.op.exp1->destType)
15165 exp->__anon1.op.exp1->destType->refCount++;
15166 }
15167 }
15168 else
15169 {
15170 if(exp->__anon1.op.exp2->destType)
15171 FreeType(exp->__anon1.op.exp2->destType);
15172 exp->__anon1.op.exp2->destType = type1;
15173 type1->refCount++;
15174 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
15175 {
15176 if(exp->expType)
15177 FreeType(exp->expType);
15178 exp->expType = exp->__anon1.op.exp2->destType;
15179 if(exp->__anon1.op.exp2->destType)
15180 exp->__anon1.op.exp2->destType->refCount++;
15181 }
15182 else if(type1 && type2)
15183 {
15184 char expString1[10240];
15185 char expString2[10240];
15186 char type1String[1024];
15187 char type2String[1024];
15188
15189 expString1[0] = '\0';
15190 expString2[0] = '\0';
15191 type1String[0] = '\0';
15192 type2String[0] = '\0';
15193 if(inCompiler)
15194 {
15195 PrintExpression(exp->__anon1.op.exp1, expString1);
15196 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15197 PrintExpression(exp->__anon1.op.exp2, expString2);
15198 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15199 PrintType(exp->__anon1.op.exp1->expType, type1String, 0x0, 0x1);
15200 PrintType(exp->__anon1.op.exp2->expType, type2String, 0x0, 0x1);
15201 }
15202 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15203 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15204 {
15205 exp->expType = exp->__anon1.op.exp1->expType;
15206 if(exp->__anon1.op.exp1->expType)
15207 exp->__anon1.op.exp1->expType->refCount++;
15208 }
15209 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15210 {
15211 exp->expType = exp->__anon1.op.exp2->expType;
15212 if(exp->__anon1.op.exp2->expType)
15213 exp->__anon1.op.exp2->expType->refCount++;
15214 }
15215 }
15216 }
15217 }
15218 }
15219 else if(type2)
15220 {
15221 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15222 {
15223 struct Type * oldType = exp->__anon1.op.exp1->expType;
15224
15225 exp->__anon1.op.exp1->expType = (((void *)0));
15226 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15227 FreeType(oldType);
15228 else
15229 exp->__anon1.op.exp1->expType = oldType;
15230 }
15231 if(exp->__anon1.op.exp1->destType)
15232 FreeType(exp->__anon1.op.exp1->destType);
15233 exp->__anon1.op.exp1->destType = type2;
15234 type2->refCount++;
15235 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15236 {
15237 if(exp->expType)
15238 FreeType(exp->expType);
15239 exp->expType = exp->__anon1.op.exp1->destType;
15240 if(exp->__anon1.op.exp1->destType)
15241 exp->__anon1.op.exp1->destType->refCount++;
15242 }
15243 }
15244 }
15245 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15246 {
15247 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15248 {
15249 if(exp->__anon1.op.exp1->destType)
15250 FreeType(exp->__anon1.op.exp1->destType);
15251 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15252 if(type2->__anon1._class->__anon1.registered->dataType)
15253 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15254 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15255 }
15256 if(exp->__anon1.op.op == '!')
15257 {
15258 exp->expType = MkClassType("bool");
15259 exp->expType->truth = 0x1;
15260 }
15261 else
15262 {
15263 exp->expType = type2;
15264 if(type2)
15265 type2->refCount++;
15266 }
15267 }
15268 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15269 {
15270 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15271 {
15272 if(exp->__anon1.op.exp2->destType)
15273 FreeType(exp->__anon1.op.exp2->destType);
15274 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15275 if(type1->__anon1._class->__anon1.registered->dataType)
15276 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15277 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15278 }
15279 exp->expType = type1;
15280 if(type1)
15281 type1->refCount++;
15282 }
15283 }
15284 yylloc = exp->loc;
15285 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15286 {
15287 char expString[10000];
15288
15289 expString[0] = '\0';
15290 if(inCompiler)
15291 {
15292 PrintExpression(exp->__anon1.op.exp1, expString);
15293 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15294 }
15295 if(expString[0])
15296 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15297 }
15298 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15299 {
15300 char expString[10240];
15301
15302 expString[0] = '\0';
15303 if(inCompiler)
15304 {
15305 PrintExpression(exp->__anon1.op.exp2, expString);
15306 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15307 }
15308 if(expString[0])
15309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15310 }
15311 if(boolResult)
15312 {
15313 FreeType(exp->expType);
15314 exp->expType = MkClassType("bool");
15315 exp->expType->truth = 0x1;
15316 }
15317 if(exp->__anon1.op.op != SIZEOF)
15318 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15319 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15320 {
15321 DeclareType(exp->__anon1.op.exp2->expType, 0x0, 0x0);
15322 }
15323 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15325 yylloc = oldyylloc;
15326 FreeType(dummy);
15327 if(type2)
15328 FreeType(type2);
15329 break;
15330 }
15331 case 5:
15332 case 32:
15333 {
15334 struct Expression * e;
15335
15336 exp->isConstant = 0x1;
15337 for(e = (*exp->__anon1.list).first; e; e = e->next)
15338 {
15339 unsigned int inced = 0x0;
15340
15341 if(!e->next)
15342 {
15343 FreeType(e->destType);
15344 e->opDestType = exp->opDestType;
15345 e->destType = exp->destType;
15346 if(e->destType)
15347 {
15348 exp->destType->refCount++;
15349 e->destType->count++;
15350 inced = 0x1;
15351 }
15352 }
15353 ProcessExpressionType(e);
15354 if(inced)
15355 exp->destType->count--;
15356 if(!exp->expType && !e->next)
15357 {
15358 exp->expType = e->expType;
15359 if(e->expType)
15360 e->expType->refCount++;
15361 }
15362 if(!e->isConstant)
15363 exp->isConstant = 0x0;
15364 }
15365 e = (*exp->__anon1.list).first;
15366 if(!e->next && e->type == 8)
15367 {
15368 struct Expression * next = exp->next, * prev = exp->prev;
15369
15370 FreeType(exp->expType);
15371 FreeType(exp->destType);
15372 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15373 *exp = *e;
15374 exp->prev = prev;
15375 exp->next = next;
15376 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15377 ProcessExpressionType(exp);
15378 }
15379 break;
15380 }
15381 case 6:
15382 {
15383 struct Expression * e;
15384
15385 exp->isConstant = 0x1;
15386 ProcessExpressionType(exp->__anon1.index.exp);
15387 if(!exp->__anon1.index.exp->isConstant)
15388 exp->isConstant = 0x0;
15389 if(exp->__anon1.index.exp->expType)
15390 {
15391 struct Type * source = exp->__anon1.index.exp->expType;
15392
15393 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15394 {
15395 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15396 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15397
15398 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15399 {
15400 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0x0);
15401 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15402 {
15403 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0x0);
15404
15405 if(type->kind == 8)
15406 type->constant = 0x1;
15407 else if(type->kind == 13)
15408 {
15409 struct Type * t = type;
15410
15411 while(t->kind == 13)
15412 t = t->__anon1.type;
15413 t->constant = 0x1;
15414 }
15415 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15416 }
15417 }
15418 }
15419 }
15420 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15421 {
15422 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15423 {
15424 if(e->destType)
15425 FreeType(e->destType);
15426 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15427 }
15428 ProcessExpressionType(e);
15429 if(!e->next)
15430 {
15431 }
15432 if(!e->isConstant)
15433 exp->isConstant = 0x0;
15434 }
15435 if(!exp->expType)
15436 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15437 if(exp->expType)
15438 DeclareType(exp->expType, 0x0, 0x0);
15439 break;
15440 }
15441 case 7:
15442 {
15443 struct Expression * e;
15444 struct Type * functionType;
15445 struct Type * methodType = (((void *)0));
15446 char name[1024];
15447
15448 name[0] = '\0';
15449 if(inCompiler)
15450 {
15451 PrintExpression(exp->__anon1.call.exp, name);
15452 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15453 {
15454 PrintExpression(exp->__anon1.call.exp, name);
15455 }
15456 }
15457 if(exp->__anon1.call.exp->type == 0)
15458 {
15459 struct Expression * idExp = exp->__anon1.call.exp;
15460 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15461
15462 if(!strcmp(id->string, "__builtin_frame_address"))
15463 {
15464 exp->expType = ProcessTypeString("void *", 0x1);
15465 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15466 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15467 break;
15468 }
15469 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15470 {
15471 exp->expType = ProcessTypeString("int", 0x1);
15472 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15473 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15474 break;
15475 }
15476 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15477 {
15478 struct Expression * a = (((void *)0));
15479 struct Expression * b = (((void *)0));
15480 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15481
15482 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15483 {
15484 a = (*exp->__anon1.call.arguments).first;
15485 b = (*exp->__anon1.call.arguments).last;
15486 tempExp1 = a;
15487 tempExp2 = b;
15488 }
15489 else if((*exp->__anon1.call.arguments).count == 1)
15490 {
15491 a = (*exp->__anon1.call.arguments).first;
15492 tempExp1 = a;
15493 }
15494 if(a)
15495 {
15496 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15497 idExp->__anon1.__anon1.identifier = (((void *)0));
15498 FreeExpContents(exp);
15499 ProcessExpressionType(a);
15500 if(b)
15501 ProcessExpressionType(b);
15502 exp->type = 5;
15503 exp->__anon1.list = MkList();
15504 if(a->expType && (!b || b->expType))
15505 {
15506 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15507 {
15508 if(inCompiler)
15509 {
15510 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15511 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15512 struct Declaration * decl;
15513 char temp1[1024], temp2[1024];
15514
15515 GetTypeSpecs(a->expType, specs);
15516 if(a && !a->isConstant && a->type != 0)
15517 {
15518 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15519 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15520 tempExp1 = QMkExpId(temp1);
15521 tempExp1->expType = a->expType;
15522 if(a->expType)
15523 a->expType->refCount++;
15524 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15525 }
15526 if(b && !b->isConstant && b->type != 0)
15527 {
15528 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15529 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15530 tempExp2 = QMkExpId(temp2);
15531 tempExp2->expType = b->expType;
15532 if(b->expType)
15533 b->expType->refCount++;
15534 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15535 }
15536 decl = MkDeclaration(specs, decls);
15537 if(!curCompound->__anon1.compound.declarations)
15538 curCompound->__anon1.compound.declarations = MkList();
15539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15540 }
15541 }
15542 }
15543 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15544 {
15545 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15546
15547 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15548 exp->expType = a->expType;
15549 if(a->expType)
15550 a->expType->refCount++;
15551 }
15552 else if(!strcmp(id->string, "Abs"))
15553 {
15554 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15555 exp->expType = a->expType;
15556 if(a->expType)
15557 a->expType->refCount++;
15558 }
15559 else if(!strcmp(id->string, "Sgn"))
15560 {
15561 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"))))));
15562 exp->expType = ProcessTypeString("int", 0x0);
15563 }
15564 FreeExpression(tempExp1);
15565 if(tempExp2)
15566 FreeExpression(tempExp2);
15567 FreeIdentifier(id);
15568 break;
15569 }
15570 }
15571 }
15572 {
15573 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15574
15575 if(!exp->__anon1.call.exp->destType)
15576 {
15577 exp->__anon1.call.exp->destType = dummy;
15578 dummy->refCount++;
15579 }
15580 ProcessExpressionType(exp->__anon1.call.exp);
15581 if(exp->__anon1.call.exp->destType == dummy)
15582 {
15583 FreeType(dummy);
15584 exp->__anon1.call.exp->destType = (((void *)0));
15585 }
15586 FreeType(dummy);
15587 }
15588 functionType = exp->__anon1.call.exp->expType;
15589 if(functionType && functionType->kind == 16)
15590 {
15591 methodType = functionType;
15592 functionType = methodType->__anon1.__anon3.method->dataType;
15593 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15594 {
15595 char typeString[1024];
15596
15597 typeString[0] = '\0';
15598 {
15599 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15600
15601 functionType->__anon1.__anon2.thisClass = (((void *)0));
15602 PrintType(functionType, typeString, 0x1, 0x1);
15603 functionType->__anon1.__anon2.thisClass = back;
15604 }
15605 if(strstr(typeString, "thisclass"))
15606 {
15607 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15608 struct Declarator * decl;
15609
15610 {
15611 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15612
15613 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15614 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))
15615 thisClassParams = 0x0;
15616 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15617 {
15618 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15619
15620 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15621 ProcessDeclarator(decl);
15622 thisClass = backupThisClass;
15623 }
15624 thisClassParams = 0x1;
15625 functionType = ProcessType(specs, decl);
15626 functionType->refCount = 0;
15627 FinishTemplatesContext(context);
15628 }
15629 FreeList(specs, FreeSpecifier);
15630 FreeDeclarator(decl);
15631 }
15632 }
15633 }
15634 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15635 {
15636 struct Type * type = functionType->__anon1.type;
15637
15638 if(!functionType->refCount)
15639 {
15640 functionType->__anon1.type = (((void *)0));
15641 FreeType(functionType);
15642 }
15643 functionType = type;
15644 }
15645 if(functionType && functionType->kind != 11)
15646 {
15647 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15648 }
15649 else if(functionType)
15650 {
15651 unsigned int emptyParams = 0x0, noParams = 0x0;
15652 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15653 struct Type * type = functionType->__anon1.__anon2.params.first;
15654 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15655 int extra = 0;
15656 struct Location oldyylloc = yylloc;
15657
15658 if(!type)
15659 emptyParams = 0x1;
15660 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15661 {
15662 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15663 e = e->next;
15664 }
15665 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15666 {
15667 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)
15668 {
15669 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15670 if(e)
15671 {
15672 e->destType = type;
15673 e = e->next;
15674 type = functionType->__anon1.__anon2.params.first;
15675 }
15676 else
15677 type->refCount = 0;
15678 }
15679 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15680 {
15681 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15682 type->byReference = functionType->byReference;
15683 type->typedByReference = functionType->typedByReference;
15684 if(e)
15685 {
15686 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15687 e = e->next;
15688 e->destType = type;
15689 e = e->next;
15690 type = functionType->__anon1.__anon2.params.first;
15691 }
15692 else
15693 type->refCount = 0;
15694 }
15695 }
15696 if(type && type->kind == 0)
15697 {
15698 noParams = 0x1;
15699 if(!type->refCount)
15700 FreeType(type);
15701 type = (((void *)0));
15702 }
15703 for(; e; e = e->next)
15704 {
15705 if(!type && !emptyParams)
15706 {
15707 yylloc = e->loc;
15708 if(methodType && methodType->__anon1.__anon3.methodClass)
15709 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);
15710 else
15711 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);
15712 break;
15713 }
15714 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15715 {
15716 struct Type * templatedType = (((void *)0));
15717 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15718 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15719 int id = 0;
15720
15721 if(_class && _class->templateArgs)
15722 {
15723 struct __ecereNameSpace__ecere__com__Class * sClass;
15724
15725 for(sClass = _class; sClass; sClass = sClass->base)
15726 {
15727 if(sClass->templateClass)
15728 sClass = sClass->templateClass;
15729 id = 0;
15730 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15731 {
15732 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15733 {
15734 struct __ecereNameSpace__ecere__com__Class * nextClass;
15735
15736 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15737 {
15738 if(nextClass->templateClass)
15739 nextClass = nextClass->templateClass;
15740 id += nextClass->templateParams.count;
15741 }
15742 break;
15743 }
15744 id++;
15745 }
15746 if(curParam)
15747 break;
15748 }
15749 }
15750 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15751 {
15752 unsigned int constant = type->constant;
15753 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15754
15755 {
15756 struct Context * context = SetupTemplatesContext(_class);
15757
15758 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
15759 FinishTemplatesContext(context);
15760 }
15761 if(templatedType->kind == 8 && constant)
15762 templatedType->constant = 0x1;
15763 else if(templatedType->kind == 13)
15764 {
15765 struct Type * t = templatedType->__anon1.type;
15766
15767 while(t->kind == 13)
15768 t = t->__anon1.type;
15769 if(constant)
15770 t->constant = constant;
15771 }
15772 e->destType = templatedType;
15773 if(templatedType)
15774 {
15775 templatedType->passAsTemplate = 0x1;
15776 }
15777 }
15778 else
15779 {
15780 e->destType = type;
15781 if(type)
15782 type->refCount++;
15783 }
15784 }
15785 else
15786 {
15787 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15788 {
15789 e->destType = type->prev;
15790 e->destType->refCount++;
15791 }
15792 else
15793 {
15794 e->destType = type;
15795 if(type)
15796 type->refCount++;
15797 }
15798 }
15799 if(type && type->kind != 14)
15800 {
15801 struct Type * next = type->next;
15802
15803 if(!type->refCount)
15804 FreeType(type);
15805 type = next;
15806 }
15807 }
15808 if(type && type->kind != 14)
15809 {
15810 if(methodType && methodType->__anon1.__anon3.methodClass)
15811 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);
15812 else
15813 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);
15814 }
15815 yylloc = oldyylloc;
15816 if(type && !type->refCount)
15817 FreeType(type);
15818 }
15819 else
15820 {
15821 functionType = __extension__ ({
15822 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15823
15824 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15825 });
15826 if(exp->__anon1.call.exp->type == 0)
15827 {
15828 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15829
15830 if(inCompiler)
15831 {
15832 struct Symbol * symbol;
15833 struct Location oldyylloc = yylloc;
15834
15835 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15836 if(strstr(string, "__builtin_") == string)
15837 {
15838 if(exp->destType)
15839 {
15840 functionType->__anon1.__anon2.returnType = exp->destType;
15841 exp->destType->refCount++;
15842 }
15843 }
15844 else
15845 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15846 symbol = __extension__ ({
15847 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15848
15849 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15850 });
15851 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15852 if(strstr(symbol->string, "::"))
15853 globalContext->hasNameSpace = 0x1;
15854 yylloc = oldyylloc;
15855 }
15856 }
15857 else if(exp->__anon1.call.exp->type == 8)
15858 {
15859 }
15860 else
15861 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15862 if(!functionType->__anon1.__anon2.returnType)
15863 {
15864 functionType->__anon1.__anon2.returnType = __extension__ ({
15865 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15866
15867 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15868 });
15869 }
15870 }
15871 if(functionType && functionType->kind == 11)
15872 {
15873 exp->expType = functionType->__anon1.__anon2.returnType;
15874 if(functionType->__anon1.__anon2.returnType)
15875 functionType->__anon1.__anon2.returnType->refCount++;
15876 if(!functionType->refCount)
15877 FreeType(functionType);
15878 }
15879 if(exp->__anon1.call.arguments)
15880 {
15881 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15882 ProcessExpressionType(e);
15883 }
15884 break;
15885 }
15886 case 8:
15887 {
15888 struct Type * type;
15889 struct Location oldyylloc = yylloc;
15890 unsigned int thisPtr;
15891 struct Expression * checkExp = exp->__anon1.member.exp;
15892
15893 while(checkExp)
15894 {
15895 if(checkExp->type == 11)
15896 checkExp = checkExp->__anon1.cast.exp;
15897 else if(checkExp->type == 5)
15898 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15899 else
15900 break;
15901 }
15902 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15903 exp->thisPtr = thisPtr;
15904 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15905 {
15906 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15907 }
15908 ProcessExpressionType(exp->__anon1.member.exp);
15909 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)
15910 {
15911 exp->isConstant = 0x0;
15912 }
15913 else
15914 exp->isConstant = exp->__anon1.member.exp->isConstant;
15915 type = exp->__anon1.member.exp->expType;
15916 yylloc = exp->loc;
15917 if(type && (type->kind == 20))
15918 {
15919 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15920 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15921
15922 if(_class)
15923 {
15924 for(param = _class->templateParams.first; param; param = param->next)
15925 {
15926 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15927 break;
15928 }
15929 }
15930 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15931 {
15932 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15933
15934 if(argExp)
15935 {
15936 struct Expression * expMember = exp->__anon1.member.exp;
15937 struct Declarator * decl;
15938 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15939 char thisClassTypeString[1024];
15940
15941 FreeIdentifier(exp->__anon1.member.member);
15942 ProcessExpressionType(argExp);
15943 {
15944 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15945
15946 if(colon)
15947 {
15948 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15949 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15950 }
15951 else
15952 strcpy(thisClassTypeString, _class->fullName);
15953 }
15954 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15955 exp->expType = ProcessType(specs, decl);
15956 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
15957 {
15958 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
15959 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15960 int paramCount = 0;
15961 int lastParam = -1;
15962 char templateString[1024];
15963 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15964
15965 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15966 for(cClass = expClass; cClass; cClass = cClass->base)
15967 {
15968 int p = 0;
15969
15970 for(param = cClass->templateParams.first; param; param = param->next)
15971 {
15972 int id = p;
15973 struct __ecereNameSpace__ecere__com__Class * sClass;
15974 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15975
15976 for(sClass = cClass->base; sClass; sClass = sClass->base)
15977 id += sClass->templateParams.count;
15978 arg = expClass->templateArgs[id];
15979 for(sClass = _class; sClass; sClass = sClass->base)
15980 {
15981 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15982 int p = 0;
15983 struct __ecereNameSpace__ecere__com__Class * nextClass;
15984
15985 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15986 p += nextClass->templateParams.count;
15987 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15988 {
15989 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
15990 {
15991 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
15992 {
15993 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
15994 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
15995 break;
15996 }
15997 }
15998 }
15999 }
16000 {
16001 char argument[256];
16002
16003 argument[0] = '\0';
16004 switch(param->type)
16005 {
16006 case 2:
16007 {
16008 char expString[1024];
16009 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16010 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16011 struct Expression * exp;
16012 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16013
16014 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16015 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16016 ProcessExpressionType(exp);
16017 ComputeExpression(exp);
16018 expString[0] = '\0';
16019 PrintExpression(exp, expString);
16020 strcat(argument, expString);
16021 FreeExpression(exp);
16022 break;
16023 }
16024 case 1:
16025 {
16026 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16027 break;
16028 }
16029 case 0:
16030 {
16031 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16032 {
16033 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16034 strcat(argument, thisClassTypeString);
16035 else
16036 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16037 }
16038 break;
16039 }
16040 }
16041 if(argument[0])
16042 {
16043 if(paramCount)
16044 strcat(templateString, ", ");
16045 if(lastParam != p - 1)
16046 {
16047 strcat(templateString, param->name);
16048 strcat(templateString, " = ");
16049 }
16050 strcat(templateString, argument);
16051 paramCount++;
16052 lastParam = p;
16053 }
16054 p++;
16055 }
16056 }
16057 }
16058 {
16059 int len = strlen(templateString);
16060
16061 if(templateString[len - 1] == '>')
16062 templateString[len++] = ' ';
16063 templateString[len++] = '>';
16064 templateString[len++] = '\0';
16065 }
16066 {
16067 struct Context * context = SetupTemplatesContext(_class);
16068
16069 FreeType(exp->expType);
16070 exp->expType = ProcessTypeString(templateString, 0x0);
16071 FinishTemplatesContext(context);
16072 }
16073 }
16074 exp->type = 5;
16075 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")))))))));
16076 }
16077 }
16078 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16079 {
16080 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16081 }
16082 }
16083 if(type && (type->kind == 20))
16084 ;
16085 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)))
16086 {
16087 struct Identifier * id = exp->__anon1.member.member;
16088 int typeKind = type->kind;
16089 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));
16090
16091 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16092 {
16093 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16094 typeKind = 8;
16095 }
16096 if(id)
16097 {
16098 if(typeKind == 3 || typeKind == 15)
16099 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16100 else if(!_class)
16101 {
16102 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16103 {
16104 _class = type->__anon1._class->__anon1.registered;
16105 }
16106 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16107 {
16108 _class = FindClass("char *")->__anon1.registered;
16109 }
16110 else if(type->kind == 13)
16111 {
16112 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16113 FreeType(exp->expType);
16114 exp->expType = ProcessTypeString("uintptr", 0x0);
16115 exp->byReference = 0x1;
16116 }
16117 else
16118 {
16119 char string[1024] = "";
16120 struct Symbol * classSym;
16121
16122 PrintTypeNoConst(type, string, 0x0, 0x1);
16123 classSym = FindClass(string);
16124 if(classSym)
16125 _class = classSym->__anon1.registered;
16126 }
16127 }
16128 }
16129 if(_class && id)
16130 {
16131 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16132 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16133 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16134 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16135 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16136
16137 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16138 exp->__anon1.member.memberType = 1;
16139 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16140 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16141 if(typeKind != 19)
16142 {
16143 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16144 {
16145 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16146 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16147 {
16148 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16149 if(prop)
16150 member = (((void *)0));
16151 }
16152 if(!member && !prop)
16153 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16154 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16155 exp->__anon1.member.thisPtr = 0x1;
16156 }
16157 else
16158 {
16159 unsigned int useMemberForNonConst = 0x0;
16160
16161 if(!id->classSym)
16162 {
16163 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16164 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);
16165 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16166 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16167 }
16168 if((!prop || useMemberForNonConst) && !member)
16169 {
16170 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16171 if(!method)
16172 {
16173 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16174 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);
16175 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16176 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16177 }
16178 }
16179 if(member && prop)
16180 {
16181 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16182 prop = (((void *)0));
16183 else
16184 member = (((void *)0));
16185 }
16186 }
16187 }
16188 if(!prop && !member && !method)
16189 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16190 if(!prop && !member && !method)
16191 {
16192 if(typeKind == 19)
16193 {
16194 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16195 if(classProp)
16196 {
16197 exp->__anon1.member.memberType = 5;
16198 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
16199 }
16200 else
16201 {
16202 char structName[1024];
16203 struct Identifier * id = exp->__anon1.member.member;
16204 struct Expression * classExp = exp->__anon1.member.exp;
16205
16206 type->refCount++;
16207 FreeType(classExp->expType);
16208 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
16209 strcpy(structName, "__ecereClassData_");
16210 FullClassNameCat(structName, type->__anon1._class->string, 0x0);
16211 exp->type = 9;
16212 exp->__anon1.member.member = id;
16213 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"))))))));
16214 FreeType(type);
16215 ProcessExpressionType(exp);
16216 return ;
16217 }
16218 }
16219 else
16220 {
16221 struct Symbol * classSym = FindClass(id->string);
16222
16223 if(classSym)
16224 {
16225 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16226
16227 if(convertClass)
16228 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16229 }
16230 }
16231 }
16232 if(!exp->__anon1.member.exp->destType)
16233 {
16234 if(method && !method->_class->symbol)
16235 method->_class->symbol = FindClass(method->_class->fullName);
16236 exp->__anon1.member.exp->destType = __extension__ ({
16237 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16238
16239 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16240 });
16241 }
16242 if(prop)
16243 {
16244 exp->__anon1.member.memberType = 1;
16245 if(!prop->dataType)
16246 ProcessPropertyType(prop);
16247 exp->expType = prop->dataType;
16248 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16249 {
16250 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16251
16252 CopyTypeInto(type, exp->expType);
16253 type->refCount = 1;
16254 type->constant = 0x1;
16255 exp->expType = type;
16256 }
16257 else if(prop->dataType)
16258 prop->dataType->refCount++;
16259 }
16260 else if(member)
16261 {
16262 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16263 {
16264 FreeExpContents(exp);
16265 exp->type = 0;
16266 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16267 ProcessExpressionType(exp);
16268 return ;
16269 }
16270 exp->__anon1.member.memberType = 3;
16271 DeclareStruct(_class->fullName, 0x0);
16272 if(!member->dataType)
16273 {
16274 struct Context * context = SetupTemplatesContext(_class);
16275
16276 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16277 FinishTemplatesContext(context);
16278 }
16279 exp->expType = member->dataType;
16280 if(member->dataType)
16281 member->dataType->refCount++;
16282 }
16283 else if(revConvert)
16284 {
16285 exp->__anon1.member.memberType = 4;
16286 exp->expType = MkClassType(revConvert->_class->fullName);
16287 }
16288 else if(method)
16289 {
16290 {
16291 exp->__anon1.member.memberType = 2;
16292 }
16293 if(!method->dataType)
16294 ProcessMethodType(method);
16295 exp->expType = __extension__ ({
16296 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16297
16298 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16299 });
16300 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16301 exp->expType->__anon1.__anon3.usedClass = _class;
16302 }
16303 else if(!classProp)
16304 {
16305 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16306 {
16307 FreeExpContents(exp);
16308 exp->type = 0;
16309 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16310 FreeType(exp->expType);
16311 exp->expType = MkClassType("ecere::com::Class");
16312 return ;
16313 }
16314 yylloc = exp->__anon1.member.member->loc;
16315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16316 if(inCompiler)
16317 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16318 }
16319 if(_class && exp->expType)
16320 {
16321 struct __ecereNameSpace__ecere__com__Class * tClass;
16322
16323 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16324 while(tClass && !tClass->templateClass)
16325 tClass = tClass->base;
16326 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16327 {
16328 int id = 0;
16329 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16330 struct __ecereNameSpace__ecere__com__Class * sClass;
16331
16332 for(sClass = tClass; sClass; sClass = sClass->base)
16333 {
16334 id = 0;
16335 if(sClass->templateClass)
16336 sClass = sClass->templateClass;
16337 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16338 {
16339 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16340 {
16341 for(sClass = sClass->base; sClass; sClass = sClass->base)
16342 id += sClass->templateParams.count;
16343 break;
16344 }
16345 id++;
16346 }
16347 if(curParam)
16348 break;
16349 }
16350 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16351 {
16352 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16353 struct Context * context = SetupTemplatesContext(tClass);
16354 unsigned int constant = exp->expType->constant;
16355
16356 FreeType(exp->expType);
16357 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16358 if(exp->expType->kind == 8 && constant)
16359 exp->expType->constant = 0x1;
16360 else if(exp->expType->kind == 13)
16361 {
16362 struct Type * t = exp->expType->__anon1.type;
16363
16364 while(t->kind == 13)
16365 t = t->__anon1.type;
16366 if(constant)
16367 t->constant = constant;
16368 }
16369 if(exp->expType)
16370 {
16371 if(exp->expType->kind == 21)
16372 {
16373 FreeType(exp->expType);
16374 exp->expType = ReplaceThisClassType(_class);
16375 }
16376 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16377 exp->expType->passAsTemplate = 0x1;
16378 if(!exp->destType)
16379 {
16380 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16381 if(exp->destType->kind == 8 && constant)
16382 exp->destType->constant = 0x1;
16383 else if(exp->destType->kind == 13)
16384 {
16385 struct Type * t = exp->destType->__anon1.type;
16386
16387 while(t->kind == 13)
16388 t = t->__anon1.type;
16389 if(constant)
16390 t->constant = constant;
16391 }
16392 if(exp->destType->kind == 21)
16393 {
16394 FreeType(exp->destType);
16395 exp->destType = ReplaceThisClassType(_class);
16396 }
16397 }
16398 }
16399 FinishTemplatesContext(context);
16400 }
16401 }
16402 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)
16403 {
16404 int id = 0;
16405 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16406 struct __ecereNameSpace__ecere__com__Class * sClass;
16407
16408 for(sClass = tClass; sClass; sClass = sClass->base)
16409 {
16410 id = 0;
16411 if(sClass->templateClass)
16412 sClass = sClass->templateClass;
16413 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16414 {
16415 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16416 {
16417 for(sClass = sClass->base; sClass; sClass = sClass->base)
16418 id += sClass->templateParams.count;
16419 break;
16420 }
16421 id++;
16422 }
16423 if(curParam)
16424 break;
16425 }
16426 if(curParam)
16427 {
16428 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16429 struct Context * context = SetupTemplatesContext(tClass);
16430 struct Type * basicType;
16431
16432 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16433 if(basicType)
16434 {
16435 if(basicType->kind == 21)
16436 {
16437 FreeType(basicType);
16438 basicType = ReplaceThisClassType(_class);
16439 }
16440 FreeType(exp->expType);
16441 exp->expType = __extension__ ({
16442 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16443
16444 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16445 });
16446 if(!exp->destType)
16447 {
16448 exp->destType = exp->expType;
16449 exp->destType->refCount++;
16450 }
16451 {
16452 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16454 struct Declarator * decl;
16455
16456 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16457 *newExp = *exp;
16458 if(exp->destType)
16459 exp->destType->refCount++;
16460 if(exp->expType)
16461 exp->expType->refCount++;
16462 exp->type = 11;
16463 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16464 exp->__anon1.cast.exp = newExp;
16465 }
16466 }
16467 FinishTemplatesContext(context);
16468 }
16469 }
16470 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16471 {
16472 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16473
16474 if(expClass)
16475 {
16476 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16477 int p = 0;
16478 int paramCount = 0;
16479 int lastParam = -1;
16480 char templateString[1024];
16481 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16482
16483 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16484 while(cClass != expClass)
16485 {
16486 struct __ecereNameSpace__ecere__com__Class * sClass;
16487
16488 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16489 ;
16490 cClass = sClass;
16491 for(param = cClass->templateParams.first; param; param = param->next)
16492 {
16493 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16494 int cp = 0;
16495 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16496 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16497
16498 while(cClassCur != tClass && !paramCur)
16499 {
16500 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16501
16502 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16503 ;
16504 cClassCur = sClassCur;
16505 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16506 {
16507 if(!strcmp(paramCur->name, param->name))
16508 {
16509 break;
16510 }
16511 cp++;
16512 }
16513 }
16514 if(paramCur && paramCur->type == 0)
16515 arg = tClass->templateArgs[cp];
16516 else
16517 arg = expClass->templateArgs[p];
16518 {
16519 char argument[256];
16520
16521 argument[0] = '\0';
16522 switch(param->type)
16523 {
16524 case 2:
16525 {
16526 char expString[1024];
16527 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16528 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16529 struct Expression * exp;
16530 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16531
16532 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16533 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16534 ProcessExpressionType(exp);
16535 ComputeExpression(exp);
16536 expString[0] = '\0';
16537 PrintExpression(exp, expString);
16538 strcat(argument, expString);
16539 FreeExpression(exp);
16540 break;
16541 }
16542 case 1:
16543 {
16544 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16545 break;
16546 }
16547 case 0:
16548 {
16549 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16550 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16551 break;
16552 }
16553 }
16554 if(argument[0])
16555 {
16556 if(paramCount)
16557 strcat(templateString, ", ");
16558 if(lastParam != p - 1)
16559 {
16560 strcat(templateString, param->name);
16561 strcat(templateString, " = ");
16562 }
16563 strcat(templateString, argument);
16564 paramCount++;
16565 lastParam = p;
16566 }
16567 }
16568 p++;
16569 }
16570 }
16571 {
16572 int len = strlen(templateString);
16573
16574 if(templateString[len - 1] == '>')
16575 templateString[len++] = ' ';
16576 templateString[len++] = '>';
16577 templateString[len++] = '\0';
16578 }
16579 FreeType(exp->expType);
16580 {
16581 struct Context * context = SetupTemplatesContext(tClass);
16582
16583 exp->expType = ProcessTypeString(templateString, 0x0);
16584 FinishTemplatesContext(context);
16585 }
16586 }
16587 }
16588 }
16589 }
16590 else
16591 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)");
16592 }
16593 else if(type && (type->kind == 9 || type->kind == 10))
16594 {
16595 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16596
16597 if(memberType)
16598 {
16599 exp->expType = memberType;
16600 if(memberType)
16601 memberType->refCount++;
16602 }
16603 }
16604 else
16605 {
16606 char expString[10240];
16607
16608 expString[0] = '\0';
16609 if(inCompiler)
16610 {
16611 PrintExpression(exp, expString);
16612 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16613 }
16614 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16615 }
16616 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16617 {
16618 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16619 {
16620 struct Identifier * id = exp->__anon1.member.member;
16621 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));
16622
16623 if(_class)
16624 {
16625 FreeType(exp->expType);
16626 exp->expType = ReplaceThisClassType(_class);
16627 }
16628 }
16629 }
16630 yylloc = oldyylloc;
16631 break;
16632 }
16633 case 9:
16634 {
16635 struct Type * destType = exp->destType;
16636
16637 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16638 {
16639 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16640 }
16641 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16642 exp->type = 8;
16643 if(destType)
16644 destType->count++;
16645 ProcessExpressionType(exp);
16646 if(destType)
16647 destType->count--;
16648 break;
16649 }
16650 case 15:
16651 {
16652 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16653
16654 if(classSym && classSym->__anon1.registered)
16655 {
16656 if(classSym->__anon1.registered->type == 5)
16657 {
16658 char name[1024];
16659
16660 name[0] = '\0';
16661 DeclareStruct(classSym->string, 0x0);
16662 FreeSpecifier(exp->__anon1._class);
16663 exp->type = 10;
16664 FullClassNameCat(name, classSym->string, 0x0);
16665 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16666 }
16667 else
16668 {
16669 if(classSym->__anon1.registered->fixed)
16670 {
16671 FreeSpecifier(exp->__anon1._class);
16672 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16673 exp->type = 2;
16674 }
16675 else
16676 {
16677 char className[1024];
16678
16679 strcpy(className, "__ecereClass_");
16680 FullClassNameCat(className, classSym->string, 0x1);
16681 DeclareClass(classSym, className);
16682 FreeExpContents(exp);
16683 exp->type = 9;
16684 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16685 exp->__anon1.member.member = MkIdentifier("structSize");
16686 }
16687 }
16688 }
16689 exp->expType = __extension__ ({
16690 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16691
16692 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16693 });
16694 break;
16695 }
16696 case 10:
16697 {
16698 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16699
16700 exp->expType = __extension__ ({
16701 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16702
16703 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16704 });
16705 exp->isConstant = 0x1;
16706 DeclareType(type, 0x0, 0x0);
16707 FreeType(type);
16708 break;
16709 }
16710 case 11:
16711 {
16712 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16713
16714 type->count = 1;
16715 FreeType(exp->__anon1.cast.exp->destType);
16716 exp->__anon1.cast.exp->destType = type;
16717 type->refCount++;
16718 type->casted = 0x1;
16719 ProcessExpressionType(exp->__anon1.cast.exp);
16720 type->casted = 0x0;
16721 type->count = 0;
16722 exp->expType = type;
16723 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16724 {
16725 void * prev = exp->prev, * next = exp->next;
16726 struct Type * expType = exp->__anon1.cast.exp->destType;
16727 struct Expression * castExp = exp->__anon1.cast.exp;
16728 struct Type * destType = exp->destType;
16729
16730 if(expType)
16731 expType->refCount++;
16732 FreeType(exp->expType);
16733 FreeTypeName(exp->__anon1.cast.typeName);
16734 *exp = *castExp;
16735 FreeType(exp->expType);
16736 FreeType(exp->destType);
16737 exp->expType = expType;
16738 exp->destType = destType;
16739 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16740 exp->prev = prev;
16741 exp->next = next;
16742 }
16743 else
16744 {
16745 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16746 }
16747 break;
16748 }
16749 case 33:
16750 {
16751 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16752
16753 exp->expType = type;
16754 break;
16755 }
16756 case 34:
16757 {
16758 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16759
16760 ProcessExpressionType(exp->__anon1.vaArg.exp);
16761 exp->expType = type;
16762 break;
16763 }
16764 case 12:
16765 {
16766 struct Expression * e;
16767
16768 exp->isConstant = 0x1;
16769 FreeType(exp->__anon1.cond.cond->destType);
16770 exp->__anon1.cond.cond->destType = MkClassType("bool");
16771 exp->__anon1.cond.cond->destType->truth = 0x1;
16772 ProcessExpressionType(exp->__anon1.cond.cond);
16773 if(!exp->__anon1.cond.cond->isConstant)
16774 exp->isConstant = 0x0;
16775 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16776 {
16777 if(!e->next)
16778 {
16779 FreeType(e->destType);
16780 e->destType = exp->destType;
16781 if(e->destType)
16782 e->destType->refCount++;
16783 }
16784 ProcessExpressionType(e);
16785 if(!e->next)
16786 {
16787 exp->expType = e->expType;
16788 if(e->expType)
16789 e->expType->refCount++;
16790 }
16791 if(!e->isConstant)
16792 exp->isConstant = 0x0;
16793 }
16794 FreeType(exp->__anon1.cond.elseExp->destType);
16795 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16796 if(exp->__anon1.cond.elseExp->destType)
16797 exp->__anon1.cond.elseExp->destType->refCount++;
16798 ProcessExpressionType(exp->__anon1.cond.elseExp);
16799 if(!exp->__anon1.cond.elseExp->isConstant)
16800 exp->isConstant = 0x0;
16801 break;
16802 }
16803 case 23:
16804 {
16805 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16806 {
16807 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16808
16809 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16810 {
16811 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16812 if(exp->destType)
16813 exp->destType->refCount++;
16814 }
16815 ProcessStatement(exp->__anon1.compound);
16816 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16817 if(exp->expType)
16818 exp->expType->refCount++;
16819 }
16820 break;
16821 }
16822 case 24:
16823 {
16824 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16825
16826 if(spec && spec->type == 1)
16827 {
16828 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16829 exp->expType->kind = 19;
16830 exp->byReference = 0x1;
16831 }
16832 else
16833 {
16834 exp->expType = MkClassType("ecere::com::Class");
16835 exp->byReference = 0x1;
16836 }
16837 break;
16838 }
16839 case 25:
16840 {
16841 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16842
16843 if(_class)
16844 {
16845 struct Identifier * id = exp->__anon1.classData.id;
16846 char structName[1024];
16847 struct Expression * classExp;
16848
16849 strcpy(structName, "__ecereClassData_");
16850 FullClassNameCat(structName, _class->fullName, 0x0);
16851 exp->type = 9;
16852 exp->__anon1.member.member = id;
16853 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0x0, 0x0))
16854 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16855 else
16856 classExp = MkExpIdentifier(MkIdentifier("class"));
16857 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"))))))));
16858 ProcessExpressionType(exp);
16859 return ;
16860 }
16861 break;
16862 }
16863 case 35:
16864 {
16865 struct Type * type = (((void *)0));
16866 const char * typeString = (((void *)0));
16867 char typeStringBuf[1024];
16868
16869 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))
16870 {
16871 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16872
16873 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16874 }
16875 else if(exp->__anon1.list)
16876 {
16877 struct Expression * e;
16878
16879 for(e = (*exp->__anon1.list).first; e; e = e->next)
16880 {
16881 ProcessExpressionType(e);
16882 if(e->expType)
16883 {
16884 if(!type)
16885 {
16886 type = e->expType;
16887 type->refCount++;
16888 }
16889 else
16890 {
16891 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16892 {
16893 FreeType(type);
16894 type = e->expType;
16895 e->expType = (((void *)0));
16896 e = (*exp->__anon1.list).first;
16897 ProcessExpressionType(e);
16898 if(e->expType)
16899 {
16900 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16901 {
16902 FreeType(e->expType);
16903 e->expType = (((void *)0));
16904 FreeType(type);
16905 type = (((void *)0));
16906 break;
16907 }
16908 }
16909 }
16910 }
16911 if(e->expType)
16912 {
16913 FreeType(e->expType);
16914 e->expType = (((void *)0));
16915 }
16916 }
16917 }
16918 if(type)
16919 {
16920 typeStringBuf[0] = '\0';
16921 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16922 typeString = typeStringBuf;
16923 FreeType(type);
16924 type = (((void *)0));
16925 }
16926 }
16927 if(typeString)
16928 {
16929 char templateString[1024];
16930 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16931 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16932 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16933 struct Expression * expExt;
16934 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16935
16936 sprintf(templateString, "Container<%s>", typeString);
16937 if(exp->__anon1.list)
16938 {
16939 struct Expression * e;
16940
16941 type = ProcessTypeString(typeString, 0x0);
16942 while((e = (*exp->__anon1.list).first))
16943 {
16944 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16945 e->destType = type;
16946 type->refCount++;
16947 ProcessExpressionType(e);
16948 ListAdd(initializers, MkInitializerAssignment(e));
16949 }
16950 FreeType(type);
16951 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16952 }
16953 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16954 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16955 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16956 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16957 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16958 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16959 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16960 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16961 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16962 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16963 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16964
16965 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16966 })));
16967 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16968 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16969 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16970 exp->expType = ProcessTypeString(templateString, 0x0);
16971 exp->type = 5;
16972 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16973 ProcessExpressionType(expExt);
16974 }
16975 else
16976 {
16977 exp->expType = ProcessTypeString("Container", 0x0);
16978 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16979 }
16980 break;
16981 }
16982 }
16983 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16984 {
16985 FreeType(exp->expType);
16986 exp->expType = ReplaceThisClassType(thisClass);
16987 }
16988 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)
16989 {
16990 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 0x1, 0x0);
16991
16992 if(symbol)
16993 {
16994 if(exp->expType->kind != 15)
16995 {
16996 struct Type * member;
16997 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
16998
16999 FreeType(exp->expType);
17000 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17001 exp->expType->kind = symbol->type->kind;
17002 exp->expType->refCount++;
17003 exp->expType->__anon1.__anon1.enumName = enumName;
17004 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17005 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17006 member->refCount++;
17007 }
17008 else
17009 {
17010 struct __ecereNameSpace__ecere__sys__NamedLink * member;
17011
17012 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17013 {
17014 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17015
17016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17017 }
17018 }
17019 }
17020 }
17021 yylloc = exp->loc;
17022 if(exp->destType && (exp->destType->kind == 18))
17023 ;
17024 else if(exp->destType && !exp->destType->keepCast)
17025 {
17026 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17027 exp->needTemplateCast = 1;
17028 if(exp->destType->kind == 0)
17029 ;
17030 else if(!CheckExpressionType(exp, exp->destType, 0x0, !exp->destType->casted))
17031 {
17032 if(!exp->destType->count || unresolved)
17033 {
17034 if(!exp->expType)
17035 {
17036 yylloc = exp->loc;
17037 if(exp->destType->kind != 14)
17038 {
17039 char type2[1024];
17040
17041 type2[0] = '\0';
17042 if(inCompiler)
17043 {
17044 char expString[10240];
17045
17046 expString[0] = '\0';
17047 PrintType(exp->destType, type2, 0x0, 0x1);
17048 if(inCompiler)
17049 {
17050 PrintExpression(exp, expString);
17051 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17052 }
17053 if(unresolved)
17054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17055 else if(exp->type != 16)
17056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17057 }
17058 }
17059 else
17060 {
17061 char expString[10240];
17062
17063 expString[0] = '\0';
17064 if(inCompiler)
17065 {
17066 PrintExpression(exp, expString);
17067 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17068 }
17069 if(unresolved)
17070 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17071 else if(exp->type != 16)
17072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17073 }
17074 }
17075 else
17076 {
17077 char type1[1024];
17078 char type2[1024];
17079
17080 type1[0] = '\0';
17081 type2[0] = '\0';
17082 if(inCompiler)
17083 {
17084 PrintType(exp->expType, type1, 0x0, 0x1);
17085 PrintType(exp->destType, type2, 0x0, 0x1);
17086 }
17087 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)))
17088 ;
17089 else
17090 {
17091 char expString[10240];
17092
17093 expString[0] = '\0';
17094 if(inCompiler)
17095 {
17096 PrintExpression(exp, expString);
17097 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17098 }
17099 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17100 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17101 FreeType(exp->expType);
17102 exp->destType->refCount++;
17103 exp->expType = exp->destType;
17104 }
17105 }
17106 }
17107 }
17108 }
17109 else if(unresolved)
17110 {
17111 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17112 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);
17113 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17115 }
17116 else if(!exp->expType && exp->type != 16)
17117 {
17118 char expString[10240];
17119
17120 expString[0] = '\0';
17121 if(inCompiler)
17122 {
17123 PrintExpression(exp, expString);
17124 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17125 }
17126 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17127 }
17128 if(inCompiler)
17129 ApplyAnyObjectLogic(exp);
17130 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)))
17131 {
17132 exp->byReference = 0x1;
17133 }
17134 yylloc = oldyylloc;
17135 }
17136
17137 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)
17138 {
17139 if(*curMember)
17140 {
17141 *curMember = (*curMember)->next;
17142 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17143 {
17144 *curMember = subMemberStack[--(*subMemberStackPos)];
17145 *curMember = (*curMember)->next;
17146 }
17147 while((*curMember) && (*curMember)->isProperty)
17148 *curMember = (*curMember)->next;
17149 if(subMemberStackPos)
17150 {
17151 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17152 {
17153 subMemberStack[(*subMemberStackPos)++] = *curMember;
17154 *curMember = (*curMember)->members.first;
17155 while(*curMember && (*curMember)->isProperty)
17156 *curMember = (*curMember)->next;
17157 }
17158 }
17159 }
17160 while(!*curMember)
17161 {
17162 if(!*curMember)
17163 {
17164 if(subMemberStackPos && *subMemberStackPos)
17165 {
17166 *curMember = subMemberStack[--(*subMemberStackPos)];
17167 *curMember = (*curMember)->next;
17168 }
17169 else
17170 {
17171 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17172
17173 if(*curClass == _class)
17174 break;
17175 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17176 ;
17177 *curMember = (*curClass)->membersAndProperties.first;
17178 }
17179 while((*curMember) && (*curMember)->isProperty)
17180 *curMember = (*curMember)->next;
17181 if(subMemberStackPos)
17182 {
17183 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17184 {
17185 subMemberStack[(*subMemberStackPos)++] = *curMember;
17186 *curMember = (*curMember)->members.first;
17187 while(*curMember && (*curMember)->isProperty)
17188 *curMember = (*curMember)->next;
17189 }
17190 }
17191 }
17192 }
17193 }
17194
17195 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17196 {
17197 switch(init->type)
17198 {
17199 case 0:
17200 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17201 {
17202 if(init->__anon1.exp && !init->__anon1.exp->destType)
17203 {
17204 FreeType(init->__anon1.exp->destType);
17205 init->__anon1.exp->destType = type;
17206 if(type)
17207 type->refCount++;
17208 }
17209 if(init->__anon1.exp)
17210 {
17211 ProcessExpressionType(init->__anon1.exp);
17212 init->isConstant = init->__anon1.exp->isConstant;
17213 }
17214 break;
17215 }
17216 else
17217 {
17218 struct Expression * exp = init->__anon1.exp;
17219 struct Instantiation * inst = exp->__anon1.instance;
17220 struct MembersInit * members;
17221
17222 init->type = 1;
17223 init->__anon1.list = MkList();
17224 if(inst->members)
17225 {
17226 for(members = (*inst->members).first; members; members = members->next)
17227 {
17228 if(members->type == 0)
17229 {
17230 struct MemberInit * member;
17231
17232 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17233 {
17234 ListAdd(init->__anon1.list, member->initializer);
17235 member->initializer = (((void *)0));
17236 }
17237 }
17238 }
17239 }
17240 FreeExpression(exp);
17241 }
17242 case 1:
17243 {
17244 struct Initializer * i;
17245 struct Type * initializerType = (((void *)0));
17246 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17247 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17248 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17249 int subMemberStackPos = 0;
17250
17251 if(type && type->kind == 12)
17252 initializerType = Dereference(type);
17253 else if(type && (type->kind == 9 || type->kind == 10))
17254 initializerType = type->__anon1.__anon1.members.first;
17255 for(i = (*init->__anon1.list).first; i; i = i->next)
17256 {
17257 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17258 {
17259 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17260 if(curMember)
17261 {
17262 if(!curMember->dataType)
17263 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
17264 initializerType = curMember->dataType;
17265 }
17266 }
17267 ProcessInitializer(i, initializerType);
17268 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17269 initializerType = initializerType->next;
17270 if(!i->isConstant)
17271 init->isConstant = 0x0;
17272 }
17273 if(type && type->kind == 12)
17274 FreeType(initializerType);
17275 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))
17276 {
17277 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17278 }
17279 break;
17280 }
17281 }
17282 }
17283
17284 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17285
17286 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17287
17288 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17289 {
17290 switch(spec->type)
17291 {
17292 case 0:
17293 {
17294 if(spec->__anon1.specifier == THISCLASS)
17295 {
17296 if(thisClass)
17297 {
17298 spec->type = 1;
17299 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17300 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17301 ProcessSpecifier(spec, declareStruct);
17302 }
17303 }
17304 break;
17305 }
17306 case 1:
17307 {
17308 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17309
17310 if(symbol)
17311 DeclareType(symbol->type, 0x1, 0x1);
17312 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17313 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
17314 break;
17315 }
17316 case 2:
17317 {
17318 struct Enumerator * e;
17319
17320 if(spec->__anon1.__anon2.list)
17321 {
17322 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17323 {
17324 if(e->exp)
17325 ProcessExpressionType(e->exp);
17326 }
17327 }
17328 break;
17329 }
17330 case 3:
17331 case 4:
17332 {
17333 if(spec->__anon1.__anon2.definitions)
17334 {
17335 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17336
17337 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17338 }
17339 break;
17340 }
17341 }
17342 }
17343
17344 static void ProcessDeclarator(struct Declarator * decl)
17345 {
17346 switch(decl->type)
17347 {
17348 case 1:
17349 if(decl->__anon1.identifier->classSym)
17350 {
17351 FreeSpecifier(decl->__anon1.identifier->_class);
17352 decl->__anon1.identifier->_class = (((void *)0));
17353 }
17354 break;
17355 case 3:
17356 if(decl->__anon1.array.exp)
17357 ProcessExpressionType(decl->__anon1.array.exp);
17358 case 0:
17359 case 2:
17360 case 4:
17361 case 5:
17362 case 6:
17363 case 7:
17364 if(decl->declarator)
17365 ProcessDeclarator(decl->declarator);
17366 if(decl->type == 4)
17367 {
17368 struct Identifier * id = GetDeclId(decl);
17369
17370 if(id && id->_class)
17371 {
17372 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17373
17374 if(!decl->__anon1.function.parameters)
17375 decl->__anon1.function.parameters = MkList();
17376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17377 id->_class = (((void *)0));
17378 }
17379 if(decl->__anon1.function.parameters)
17380 {
17381 struct TypeName * param;
17382
17383 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17384 {
17385 if(param->qualifiers && (*param->qualifiers).first)
17386 {
17387 struct Specifier * spec = (*param->qualifiers).first;
17388
17389 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17390 {
17391 struct Declarator * d = param->declarator;
17392 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);
17393
17394 if(d->type != 5)
17395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17396 FreeList(param->qualifiers, FreeSpecifier);
17397 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17398 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17400 param = newParam;
17401 }
17402 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17403 {
17404 struct Declarator * d = param->declarator;
17405
17406 FreeList(param->qualifiers, FreeSpecifier);
17407 param->qualifiers = MkListOne(MkSpecifier(VOID));
17408 if(d->type != 5)
17409 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17410 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17411 }
17412 else if(spec->__anon1.specifier == THISCLASS)
17413 {
17414 if(thisClass)
17415 {
17416 spec->type = 1;
17417 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17418 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17419 ProcessSpecifier(spec, 0x0);
17420 }
17421 }
17422 }
17423 if(param->declarator)
17424 ProcessDeclarator(param->declarator);
17425 }
17426 }
17427 }
17428 break;
17429 }
17430 }
17431
17432 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17433
17434 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17435
17436 static void ProcessDeclaration(struct Declaration * decl)
17437 {
17438 yylloc = decl->loc;
17439 switch(decl->type)
17440 {
17441 case 1:
17442 {
17443 unsigned int declareStruct = 0x0;
17444
17445 if(decl->__anon1.__anon1.declarators)
17446 {
17447 struct InitDeclarator * d;
17448
17449 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17450 {
17451 struct Type * type, * subType;
17452
17453 ProcessDeclarator(d->declarator);
17454 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17455 if(d->initializer)
17456 {
17457 ProcessInitializer(d->initializer, type);
17458 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17459 {
17460 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17461 {
17462 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17463
17464 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17465 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17466 if(decl->__anon1.__anon1.specifiers)
17467 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17468 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17469 d = (((void *)0));
17470 decl->type = 2;
17471 decl->__anon1.inst = inst;
17472 }
17473 }
17474 }
17475 for(subType = type; subType; )
17476 {
17477 if(subType->kind == 8)
17478 {
17479 declareStruct = 0x1;
17480 break;
17481 }
17482 else if(subType->kind == 13)
17483 break;
17484 else if(subType->kind == 12)
17485 subType = subType->__anon1.__anon4.arrayType;
17486 else
17487 break;
17488 }
17489 FreeType(type);
17490 if(!d)
17491 break;
17492 }
17493 }
17494 if(decl->__anon1.__anon1.specifiers)
17495 {
17496 struct Specifier * s;
17497
17498 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17499 {
17500 ProcessSpecifier(s, declareStruct);
17501 }
17502 }
17503 break;
17504 }
17505 case 2:
17506 {
17507 ProcessInstantiationType(decl->__anon1.inst);
17508 break;
17509 }
17510 case 0:
17511 {
17512 struct Specifier * spec;
17513 struct Declarator * d;
17514 unsigned int declareStruct = 0x0;
17515
17516 if(decl->__anon1.__anon1.declarators)
17517 {
17518 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17519 {
17520 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17521 struct Type * subType;
17522
17523 ProcessDeclarator(d);
17524 for(subType = type; subType; )
17525 {
17526 if(subType->kind == 8)
17527 {
17528 declareStruct = 0x1;
17529 break;
17530 }
17531 else if(subType->kind == 13)
17532 break;
17533 else if(subType->kind == 12)
17534 subType = subType->__anon1.__anon4.arrayType;
17535 else
17536 break;
17537 }
17538 FreeType(type);
17539 }
17540 }
17541 if(decl->__anon1.__anon1.specifiers)
17542 {
17543 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17544 ProcessSpecifier(spec, declareStruct);
17545 }
17546 break;
17547 }
17548 }
17549 }
17550
17551 static struct FunctionDefinition * curFunction;
17552
17553 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17554 {
17555 char propName[1024], propNameM[1024];
17556 char getName[1024], setName[1024];
17557 struct __ecereNameSpace__ecere__sys__OldList * args;
17558
17559 DeclareProperty(prop, setName, getName);
17560 strcpy(propName, "__ecereProp_");
17561 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17562 strcat(propName, "_");
17563 FullClassNameCat(propName, prop->name, 0x1);
17564 strcpy(propNameM, "__ecerePropM_");
17565 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17566 strcat(propNameM, "_");
17567 FullClassNameCat(propNameM, prop->name, 0x1);
17568 if(prop->isWatchable)
17569 {
17570 args = MkList();
17571 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17572 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17573 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17574 args = MkList();
17575 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17576 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17577 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17578 }
17579 {
17580 args = MkList();
17581 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17582 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17583 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17584 args = MkList();
17585 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17586 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17587 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17588 }
17589 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17590 curFunction->propSet->fireWatchersDone = 0x1;
17591 }
17592
17593 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17594
17595 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17596
17597 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17598
17599 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17600
17601 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17602
17603 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17604
17605 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17606
17607 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17608
17609 static void ProcessStatement(struct Statement * stmt)
17610 {
17611 yylloc = stmt->loc;
17612 switch(stmt->type)
17613 {
17614 case 0:
17615 ProcessStatement(stmt->__anon1.labeled.stmt);
17616 break;
17617 case 1:
17618 if(stmt->__anon1.caseStmt.exp)
17619 {
17620 FreeType(stmt->__anon1.caseStmt.exp->destType);
17621 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17622 if(curSwitchType)
17623 curSwitchType->refCount++;
17624 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17625 ComputeExpression(stmt->__anon1.caseStmt.exp);
17626 }
17627 if(stmt->__anon1.caseStmt.stmt)
17628 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17629 break;
17630 case 2:
17631 {
17632 if(stmt->__anon1.compound.context)
17633 {
17634 struct Declaration * decl;
17635 struct Statement * s;
17636 struct Statement * prevCompound = curCompound;
17637 struct Context * prevContext = curContext;
17638
17639 if(!stmt->__anon1.compound.isSwitch)
17640 curCompound = stmt;
17641 curContext = stmt->__anon1.compound.context;
17642 if(stmt->__anon1.compound.declarations)
17643 {
17644 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17645 ProcessDeclaration(decl);
17646 }
17647 if(stmt->__anon1.compound.statements)
17648 {
17649 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17650 ProcessStatement(s);
17651 }
17652 curContext = prevContext;
17653 curCompound = prevCompound;
17654 }
17655 break;
17656 }
17657 case 3:
17658 {
17659 struct Expression * exp;
17660
17661 if(stmt->__anon1.expressions)
17662 {
17663 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17664 ProcessExpressionType(exp);
17665 }
17666 break;
17667 }
17668 case 4:
17669 {
17670 struct Expression * exp;
17671
17672 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17673 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17674 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 0x1;
17675 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17676 {
17677 ProcessExpressionType(exp);
17678 }
17679 if(stmt->__anon1.ifStmt.stmt)
17680 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17681 if(stmt->__anon1.ifStmt.elseStmt)
17682 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17683 break;
17684 }
17685 case 5:
17686 {
17687 struct Type * oldSwitchType = curSwitchType;
17688
17689 if(stmt->__anon1.switchStmt.exp)
17690 {
17691 struct Expression * exp;
17692
17693 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17694 {
17695 if(!exp->next)
17696 {
17697 ProcessExpressionType(exp);
17698 }
17699 if(!exp->next)
17700 curSwitchType = exp->expType;
17701 }
17702 }
17703 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17704 curSwitchType = oldSwitchType;
17705 break;
17706 }
17707 case 6:
17708 {
17709 if(stmt->__anon1.whileStmt.exp)
17710 {
17711 struct Expression * exp;
17712
17713 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17714 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17715 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 0x1;
17716 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17717 {
17718 ProcessExpressionType(exp);
17719 }
17720 }
17721 if(stmt->__anon1.whileStmt.stmt)
17722 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17723 break;
17724 }
17725 case 7:
17726 {
17727 if(stmt->__anon1.doWhile.exp)
17728 {
17729 struct Expression * exp;
17730
17731 if((*stmt->__anon1.doWhile.exp).last)
17732 {
17733 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17734 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17735 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 0x1;
17736 }
17737 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17738 {
17739 ProcessExpressionType(exp);
17740 }
17741 }
17742 if(stmt->__anon1.doWhile.stmt)
17743 ProcessStatement(stmt->__anon1.doWhile.stmt);
17744 break;
17745 }
17746 case 8:
17747 {
17748 struct Expression * exp;
17749
17750 if(stmt->__anon1.forStmt.init)
17751 ProcessStatement(stmt->__anon1.forStmt.init);
17752 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17753 {
17754 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17755 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17756 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 0x1;
17757 }
17758 if(stmt->__anon1.forStmt.check)
17759 ProcessStatement(stmt->__anon1.forStmt.check);
17760 if(stmt->__anon1.forStmt.increment)
17761 {
17762 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17763 ProcessExpressionType(exp);
17764 }
17765 if(stmt->__anon1.forStmt.stmt)
17766 ProcessStatement(stmt->__anon1.forStmt.stmt);
17767 break;
17768 }
17769 case 18:
17770 {
17771 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17772 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17773 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17774 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17775 char iteratorType[1024];
17776 struct Type * source;
17777 struct Expression * e;
17778 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));
17779 struct Expression * arrayExp;
17780 const char * typeString = (((void *)0));
17781 int builtinCount = 0;
17782
17783 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17784 {
17785 if(!e->next)
17786 {
17787 FreeType(e->destType);
17788 e->destType = ProcessTypeString("Container", 0x0);
17789 }
17790 if(!isBuiltin || e->next)
17791 ProcessExpressionType(e);
17792 }
17793 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17794 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)))
17795 {
17796 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17797 struct Symbol * symbol;
17798 struct Expression * expIt = (((void *)0));
17799 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17800 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17801 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17802 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17803
17804 stmt->type = 2;
17805 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17806 stmt->__anon1.compound.context->parent = curContext;
17807 curContext = stmt->__anon1.compound.context;
17808 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17809 {
17810 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17811
17812 isCustomAVLTree = 0x1;
17813 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17814 isMap = 0x1;
17815 }
17816 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17817 isArray = 0x1;
17818 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17819 {
17820 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17821
17822 isLinkList = 0x1;
17823 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17824 }
17825 if(isArray)
17826 {
17827 struct Declarator * decl;
17828 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17829
17830 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17831 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17832 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17833 }
17834 else if(isBuiltin)
17835 {
17836 struct Type * type = (((void *)0));
17837 char typeStringBuf[1024];
17838
17839 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17840 if(((struct Expression *)(*exp).last)->type == 11)
17841 {
17842 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17843
17844 if(typeName)
17845 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17846 }
17847 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)
17848 {
17849 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17850
17851 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17852 }
17853 else if(arrayExp->__anon1.list)
17854 {
17855 struct Expression * e;
17856
17857 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17858 {
17859 ProcessExpressionType(e);
17860 if(e->expType)
17861 {
17862 if(!type)
17863 {
17864 type = e->expType;
17865 type->refCount++;
17866 }
17867 else
17868 {
17869 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17870 {
17871 FreeType(type);
17872 type = e->expType;
17873 e->expType = (((void *)0));
17874 e = (*arrayExp->__anon1.list).first;
17875 ProcessExpressionType(e);
17876 if(e->expType)
17877 {
17878 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17879 {
17880 FreeType(e->expType);
17881 e->expType = (((void *)0));
17882 FreeType(type);
17883 type = (((void *)0));
17884 break;
17885 }
17886 }
17887 }
17888 }
17889 if(e->expType)
17890 {
17891 FreeType(e->expType);
17892 e->expType = (((void *)0));
17893 }
17894 }
17895 }
17896 if(type)
17897 {
17898 typeStringBuf[0] = '\0';
17899 PrintType(type, typeStringBuf, 0x0, 0x1);
17900 typeString = typeStringBuf;
17901 FreeType(type);
17902 }
17903 }
17904 if(typeString)
17905 {
17906 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17907 struct Declarator * decl;
17908 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17909
17910 if(arrayExp->__anon1.list)
17911 {
17912 struct Expression * e;
17913
17914 builtinCount = (*arrayExp->__anon1.list).count;
17915 type = ProcessTypeString(typeString, 0x0);
17916 while((e = (*arrayExp->__anon1.list).first))
17917 {
17918 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17919 e->destType = type;
17920 type->refCount++;
17921 ProcessExpressionType(e);
17922 ListAdd(initializers, MkInitializerAssignment(e));
17923 }
17924 FreeType(type);
17925 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17926 }
17927 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17928 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17929 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17930 FreeList(exp, FreeExpression);
17931 }
17932 else
17933 {
17934 arrayExp->expType = ProcessTypeString("Container", 0x0);
17935 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17936 }
17937 }
17938 else if(isLinkList && !isList)
17939 {
17940 struct Declarator * decl;
17941 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17942
17943 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17944 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17945 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17946 }
17947 else if(_class->templateArgs)
17948 {
17949 if(isMap)
17950 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17951 else
17952 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
17953 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)))))))));
17954 }
17955 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17956 if(block)
17957 {
17958 switch(block->type)
17959 {
17960 case 2:
17961 if(block->__anon1.compound.context)
17962 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17963 break;
17964 case 4:
17965 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
17966 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17967 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
17968 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17969 break;
17970 case 5:
17971 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
17972 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17973 break;
17974 case 6:
17975 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
17976 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17977 break;
17978 case 7:
17979 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
17980 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17981 break;
17982 case 8:
17983 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
17984 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17985 break;
17986 case 18:
17987 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
17988 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17989 break;
17990 }
17991 }
17992 if(filter)
17993 {
17994 block = MkIfStmt(filter, block, (((void *)0)));
17995 }
17996 if(isArray)
17997 {
17998 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));
17999 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18000 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18001 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18002 }
18003 else if(isBuiltin)
18004 {
18005 char count[128];
18006
18007 sprintf(count, "%d", builtinCount);
18008 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));
18009 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18010 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18011 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18012 }
18013 else if(isLinkList && !isList)
18014 {
18015 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18016 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18017
18018 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18019 {
18020 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));
18021 }
18022 else
18023 {
18024 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18025 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18026
18027 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));
18028 }
18029 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18030 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18031 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18032 }
18033 else
18034 {
18035 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18036 }
18037 ProcessExpressionType(expIt);
18038 if((*stmt->__anon1.compound.declarations).first)
18039 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18040 if(symbol)
18041 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18042 ProcessStatement(stmt);
18043 curContext = stmt->__anon1.compound.context->parent;
18044 break;
18045 }
18046 else
18047 {
18048 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18049 }
18050 break;
18051 }
18052 case 9:
18053 break;
18054 case 10:
18055 break;
18056 case 11:
18057 break;
18058 case 12:
18059 {
18060 struct Expression * exp;
18061
18062 if(stmt->__anon1.expressions)
18063 {
18064 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18065 {
18066 if(!exp->next)
18067 {
18068 if(curFunction && !curFunction->type)
18069 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18070 FreeType(exp->destType);
18071 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18072 if(exp->destType)
18073 exp->destType->refCount++;
18074 }
18075 ProcessExpressionType(exp);
18076 }
18077 }
18078 break;
18079 }
18080 case 14:
18081 {
18082 ProcessDeclaration(stmt->__anon1.decl);
18083 break;
18084 }
18085 case 13:
18086 {
18087 struct AsmField * field;
18088
18089 if(stmt->__anon1.asmStmt.inputFields)
18090 {
18091 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18092 if(field->expression)
18093 ProcessExpressionType(field->expression);
18094 }
18095 if(stmt->__anon1.asmStmt.outputFields)
18096 {
18097 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18098 if(field->expression)
18099 ProcessExpressionType(field->expression);
18100 }
18101 if(stmt->__anon1.asmStmt.clobberedFields)
18102 {
18103 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18104 {
18105 if(field->expression)
18106 ProcessExpressionType(field->expression);
18107 }
18108 }
18109 break;
18110 }
18111 case 17:
18112 {
18113 struct PropertyWatch * propWatch;
18114 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18115 struct Expression * object = stmt->__anon1._watch.object;
18116 struct Expression * watcher = stmt->__anon1._watch.watcher;
18117
18118 if(watcher)
18119 ProcessExpressionType(watcher);
18120 if(object)
18121 ProcessExpressionType(object);
18122 if(inCompiler)
18123 {
18124 if(watcher || thisClass)
18125 {
18126 struct External * external = curExternal;
18127 struct Context * context = curContext;
18128
18129 stmt->type = 3;
18130 stmt->__anon1.expressions = MkList();
18131 curExternal = external->prev;
18132 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18133 {
18134 struct ClassFunction * func;
18135 char watcherName[1024];
18136 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;
18137 struct External * createdExternal;
18138 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18139
18140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18141 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18142 if(propWatch->deleteWatch)
18143 strcat(watcherName, "_delete");
18144 else
18145 {
18146 struct Identifier * propID;
18147
18148 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18149 {
18150 strcat(watcherName, "_");
18151 strcat(watcherName, propID->string);
18152 }
18153 }
18154 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18155 {
18156 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)));
18157 ProcessClassFunctionBody(func, propWatch->compound);
18158 propWatch->compound = (((void *)0));
18159 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
18160 createdExternal->symbol->idCode = external->symbol->idCode;
18161 curExternal = createdExternal;
18162 ProcessFunction(createdExternal->__anon1.function);
18163 {
18164 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18165
18166 externalDecl->__anon1.declaration = decl;
18167 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18168 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18169 }
18170 if(propWatch->deleteWatch)
18171 {
18172 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18173
18174 ListAdd(args, CopyExpression(object));
18175 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18176 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18177 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18178 }
18179 else
18180 {
18181 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18182 struct Identifier * propID;
18183
18184 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18185 {
18186 char propName[1024];
18187 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18188
18189 if(prop)
18190 {
18191 char getName[1024], setName[1024];
18192 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18193
18194 DeclareProperty(prop, setName, getName);
18195 strcpy(propName, "__ecereProp_");
18196 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18197 strcat(propName, "_");
18198 FullClassNameCat(propName, prop->name, 0x1);
18199 ListAdd(args, CopyExpression(object));
18200 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18201 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18202 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18203 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18204 }
18205 else
18206 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18207 }
18208 }
18209 }
18210 else
18211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18212 }
18213 curExternal = external;
18214 curContext = context;
18215 if(watcher)
18216 FreeExpression(watcher);
18217 if(object)
18218 FreeExpression(object);
18219 FreeList(watches, FreePropertyWatch);
18220 }
18221 else
18222 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18223 }
18224 else
18225 {
18226 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18227 {
18228 ProcessStatement(propWatch->compound);
18229 }
18230 }
18231 break;
18232 }
18233 case 15:
18234 {
18235 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18236 struct Expression * object = stmt->__anon1._watch.object;
18237 struct __ecereNameSpace__ecere__com__Class * _class;
18238
18239 if(object)
18240 ProcessExpressionType(object);
18241 if(inCompiler)
18242 {
18243 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18244 if(_class)
18245 {
18246 struct Identifier * propID;
18247
18248 stmt->type = 3;
18249 stmt->__anon1.expressions = MkList();
18250 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18251 {
18252 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18253 }
18254 else if(!watches)
18255 {
18256 }
18257 if(watches)
18258 {
18259 for(propID = (*watches).first; propID; propID = propID->next)
18260 {
18261 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18262
18263 if(prop)
18264 {
18265 CreateFireWatcher(prop, object, stmt);
18266 }
18267 else
18268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18269 }
18270 }
18271 else
18272 {
18273 struct __ecereNameSpace__ecere__com__Property * prop;
18274 struct __ecereNameSpace__ecere__com__Class * base;
18275
18276 for(base = _class; base; base = base->base)
18277 {
18278 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18279 {
18280 if(prop->isProperty && prop->isWatchable)
18281 {
18282 CreateFireWatcher(prop, object, stmt);
18283 }
18284 }
18285 }
18286 }
18287 if(object)
18288 FreeExpression(object);
18289 FreeList(watches, FreeIdentifier);
18290 }
18291 else
18292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18293 }
18294 break;
18295 }
18296 case 16:
18297 {
18298 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18299 struct Expression * object = stmt->__anon1._watch.object;
18300 struct Expression * watcher = stmt->__anon1._watch.watcher;
18301 struct __ecereNameSpace__ecere__com__Class * _class;
18302
18303 if(object)
18304 ProcessExpressionType(object);
18305 if(watcher)
18306 ProcessExpressionType(watcher);
18307 if(inCompiler)
18308 {
18309 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18310 if(watcher || thisClass)
18311 {
18312 if(_class)
18313 {
18314 struct Identifier * propID;
18315
18316 stmt->type = 3;
18317 stmt->__anon1.expressions = MkList();
18318 if(!watches)
18319 {
18320 struct __ecereNameSpace__ecere__sys__OldList * args;
18321
18322 args = MkList();
18323 ListAdd(args, CopyExpression(object));
18324 ListAdd(args, MkExpConstant("0"));
18325 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18326 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18327 }
18328 else
18329 {
18330 for(propID = (*watches).first; propID; propID = propID->next)
18331 {
18332 char propName[1024];
18333 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18334
18335 if(prop)
18336 {
18337 char getName[1024], setName[1024];
18338 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18339
18340 DeclareProperty(prop, setName, getName);
18341 strcpy(propName, "__ecereProp_");
18342 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18343 strcat(propName, "_");
18344 FullClassNameCat(propName, prop->name, 0x1);
18345 ListAdd(args, CopyExpression(object));
18346 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18347 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18348 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18349 }
18350 else
18351 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18352 }
18353 }
18354 if(object)
18355 FreeExpression(object);
18356 if(watcher)
18357 FreeExpression(watcher);
18358 FreeList(watches, FreeIdentifier);
18359 }
18360 else
18361 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18362 }
18363 else
18364 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18365 }
18366 break;
18367 }
18368 }
18369 }
18370
18371 extern struct Expression * QBrackets(struct Expression * exp);
18372
18373 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18374
18375 extern struct Declarator * QMkPtrDecl(const char *  id);
18376
18377 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18378
18379 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18380
18381 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18382
18383 static void ProcessFunction(struct FunctionDefinition * function)
18384 {
18385 struct Identifier * id = GetDeclId(function->declarator);
18386 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18387 struct Type * type = symbol ? symbol->type : (((void *)0));
18388 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18389 struct Context * oldTopContext = topContext;
18390
18391 yylloc = function->loc;
18392 if(type && type->__anon1.__anon2.thisClass)
18393 {
18394 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18395 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18396 char className[1024];
18397 char structName[1024];
18398 struct Declarator * funcDecl;
18399 struct Symbol * thisSymbol;
18400 unsigned int typedObject = 0x0;
18401
18402 if(_class && !_class->base)
18403 {
18404 _class = currentClass;
18405 if(_class && !_class->symbol)
18406 _class->symbol = FindClass(_class->fullName);
18407 classSym = _class ? _class->symbol : (((void *)0));
18408 typedObject = 0x1;
18409 }
18410 thisClass = _class;
18411 if(inCompiler && _class)
18412 {
18413 if(type->kind == 11)
18414 {
18415 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18416 {
18417 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18418
18419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18420 FreeType(param);
18421 }
18422 if(type->classObjectType != 1)
18423 {
18424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18425 symbol->type->__anon1.__anon2.staticMethod = 0x1;
18426 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18427 symbol->type->extraParam = 0x0;
18428 }
18429 }
18430 strcpy(className, "__ecereClass_");
18431 FullClassNameCat(className, _class->fullName, 0x1);
18432 structName[0] = (char)0;
18433 FullClassNameCat(structName, _class->fullName, 0x0);
18434 funcDecl = GetFuncDecl(function->declarator);
18435 if(funcDecl)
18436 {
18437 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18438 {
18439 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18440
18441 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18442 {
18443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18444 FreeTypeName(param);
18445 }
18446 }
18447 if(!function->propertyNoThis)
18448 {
18449 struct TypeName * thisParam;
18450
18451 if(type->classObjectType != 1)
18452 {
18453 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18454 if(!funcDecl->__anon1.function.parameters)
18455 funcDecl->__anon1.function.parameters = MkList();
18456 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18457 }
18458 if(typedObject)
18459 {
18460 if(type->classObjectType != 1)
18461 {
18462 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18463 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18464 }
18465 thisParam = __extension__ ({
18466 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18467
18468 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18469 });
18470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18471 }
18472 }
18473 }
18474 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18475 {
18476 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18477
18478 funcDecl = GetFuncDecl(initDecl->declarator);
18479 if(funcDecl)
18480 {
18481 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18482 {
18483 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18484
18485 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18486 {
18487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18488 FreeTypeName(param);
18489 }
18490 }
18491 if(type->classObjectType != 1)
18492 {
18493 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18494 {
18495 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18496
18497 if(!funcDecl->__anon1.function.parameters)
18498 funcDecl->__anon1.function.parameters = MkList();
18499 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18500 }
18501 }
18502 }
18503 }
18504 }
18505 if(function->body)
18506 {
18507 if(type->classObjectType != 1)
18508 {
18509 thisSymbol = __extension__ ({
18510 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18511
18512 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18513 });
18514 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18515 if(typedObject && thisSymbol->type)
18516 {
18517 thisSymbol->type->classObjectType = 2;
18518 thisSymbol->type->byReference = type->byReference;
18519 thisSymbol->type->typedByReference = type->byReference;
18520 }
18521 }
18522 }
18523 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18524 {
18525 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18526
18527 {
18528 struct __ecereNameSpace__ecere__com__Class * base;
18529
18530 for(base = _class; base && base->type != 1000; base = base->next)
18531 {
18532 for(member = base->membersAndProperties.first; member; member = member->next)
18533 if(!member->isProperty)
18534 break;
18535 if(member)
18536 break;
18537 }
18538 }
18539 for(member = _class->membersAndProperties.first; member; member = member->next)
18540 if(!member->isProperty)
18541 break;
18542 if(member)
18543 {
18544 char pointerName[1024];
18545 struct Declaration * decl;
18546 struct Initializer * initializer;
18547 struct Expression * exp, * bytePtr;
18548
18549 strcpy(pointerName, "__ecerePointer_");
18550 FullClassNameCat(pointerName, _class->fullName, 0x0);
18551 {
18552 char className[1024];
18553
18554 strcpy(className, "__ecereClass_");
18555 FullClassNameCat(className, classSym->string, 0x1);
18556 DeclareClass(classSym, className);
18557 }
18558 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18559 if(_class->fixed)
18560 {
18561 char string[256];
18562
18563 sprintf(string, "%d", _class->offset);
18564 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18565 }
18566 else
18567 {
18568 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18569 }
18570 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18571 exp->expType = __extension__ ({
18572 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18573
18574 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18575 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18576
18577 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18578 }), __ecereInstance2;
18579 });
18580 if(function->body)
18581 {
18582 yylloc = function->body->loc;
18583 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18584 {
18585 struct Context * prevContext = curContext;
18586
18587 curContext = function->body->__anon1.compound.context;
18588 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18589 curContext = prevContext;
18590 }
18591 decl->symbol = (((void *)0));
18592 if(!function->body->__anon1.compound.declarations)
18593 function->body->__anon1.compound.declarations = MkList();
18594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18595 }
18596 }
18597 }
18598 }
18599 else
18600 thisClass = (((void *)0));
18601 if(id)
18602 {
18603 FreeSpecifier(id->_class);
18604 id->_class = (((void *)0));
18605 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18606 {
18607 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18608
18609 id = GetDeclId(initDecl->declarator);
18610 FreeSpecifier(id->_class);
18611 id->_class = (((void *)0));
18612 }
18613 }
18614 if(function->body)
18615 topContext = function->body->__anon1.compound.context;
18616 {
18617 struct FunctionDefinition * oldFunction = curFunction;
18618
18619 curFunction = function;
18620 if(function->body)
18621 ProcessStatement(function->body);
18622 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18623 {
18624 struct Statement * prevCompound = curCompound;
18625 struct Context * prevContext = curContext;
18626 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18627
18628 if(!function->body->__anon1.compound.statements)
18629 function->body->__anon1.compound.statements = MkList();
18630 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18631 curCompound = function->body;
18632 curContext = function->body->__anon1.compound.context;
18633 ProcessStatement(fireWatchers);
18634 curContext = prevContext;
18635 curCompound = prevCompound;
18636 }
18637 curFunction = oldFunction;
18638 }
18639 if(function->declarator)
18640 {
18641 ProcessDeclarator(function->declarator);
18642 }
18643 topContext = oldTopContext;
18644 thisClass = oldThisClass;
18645 }
18646
18647 extern void FreeSymbol(struct Symbol * symbol);
18648
18649 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18650
18651 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18652 {
18653 struct ClassDef * def;
18654 struct External * external = curExternal;
18655 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18656
18657 for(def = definitions->first; def; def = def->next)
18658 {
18659 if(def->type == 0)
18660 {
18661 if(def->__anon1.function->declarator)
18662 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18663 else
18664 curExternal = external;
18665 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18666 }
18667 else if(def->type == 2)
18668 {
18669 if(def->__anon1.decl->type == 2)
18670 {
18671 thisClass = regClass;
18672 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18673 thisClass = (((void *)0));
18674 }
18675 else
18676 {
18677 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18678
18679 if(regClass)
18680 thisClass = regClass;
18681 ProcessDeclaration(def->__anon1.decl);
18682 thisClass = backThisClass;
18683 }
18684 }
18685 else if(def->type == 1 && def->__anon1.defProperties)
18686 {
18687 struct MemberInit * defProperty;
18688 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);
18689
18690 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18691 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18692 {
18693 thisClass = regClass;
18694 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18695 thisClass = (((void *)0));
18696 }
18697 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18698 FreeSymbol(thisSymbol);
18699 }
18700 else if(def->type == 3 && def->__anon1.propertyDef)
18701 {
18702 struct PropertyDef * prop = def->__anon1.propertyDef;
18703
18704 thisClass = regClass;
18705 if(prop->setStmt)
18706 {
18707 if(regClass)
18708 {
18709 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18710
18711 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18712 }
18713 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18714 ProcessStatement(prop->setStmt);
18715 }
18716 if(prop->getStmt)
18717 {
18718 if(regClass)
18719 {
18720 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18721
18722 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18723 }
18724 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18725 ProcessStatement(prop->getStmt);
18726 }
18727 if(prop->issetStmt)
18728 {
18729 if(regClass)
18730 {
18731 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18732
18733 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18734 }
18735 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18736 ProcessStatement(prop->issetStmt);
18737 }
18738 thisClass = (((void *)0));
18739 }
18740 else if(def->type == 4 && def->__anon1.propertyWatch)
18741 {
18742 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18743
18744 thisClass = regClass;
18745 if(propertyWatch->compound)
18746 {
18747 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);
18748
18749 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18750 curExternal = (((void *)0));
18751 ProcessStatement(propertyWatch->compound);
18752 }
18753 thisClass = (((void *)0));
18754 }
18755 }
18756 }
18757
18758 void DeclareFunctionUtil(const char * s)
18759 {
18760 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18761
18762 if(function)
18763 {
18764 char name[1024];
18765
18766 name[0] = (char)0;
18767 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18768 strcpy(name, "__ecereFunction_");
18769 FullClassNameCat(name, s, 0x0);
18770 DeclareFunction(function, name);
18771 }
18772 }
18773
18774 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18775
18776 void ComputeDataTypes()
18777 {
18778 struct External * external;
18779 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18780 struct External * after = (((void *)0));
18781
18782 currentClass = (((void *)0));
18783 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18784 for(external = (*ast).first; external; external = external->next)
18785 {
18786 if(external->type == 1)
18787 {
18788 struct Declaration * decl = external->__anon1.declaration;
18789
18790 if(decl)
18791 {
18792 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18793
18794 if(decls)
18795 {
18796 struct InitDeclarator * initDecl = (*decls).first;
18797
18798 if(initDecl)
18799 {
18800 struct Declarator * declarator = initDecl->declarator;
18801
18802 if(declarator && declarator->type == 1)
18803 {
18804 struct Identifier * id = declarator->__anon1.identifier;
18805
18806 if(id && id->string)
18807 {
18808 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18809 {
18810 external->symbol->id = -1001, external->symbol->idCode = -1001;
18811 after = external;
18812 }
18813 }
18814 }
18815 }
18816 }
18817 }
18818 }
18819 }
18820 {
18821 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18822
18823 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18824 after = e;
18825 }
18826 temp->symbol = __extension__ ({
18827 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18828
18829 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18830 });
18831 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18832 curExternal = temp;
18833 DeclareFunctionUtil("eSystem_New");
18834 DeclareFunctionUtil("eSystem_New0");
18835 DeclareFunctionUtil("eSystem_Renew");
18836 DeclareFunctionUtil("eSystem_Renew0");
18837 DeclareFunctionUtil("eSystem_Delete");
18838 DeclareFunctionUtil("eClass_GetProperty");
18839 DeclareFunctionUtil("eClass_SetProperty");
18840 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18841 DeclareFunctionUtil("eInstance_SetMethod");
18842 DeclareFunctionUtil("eInstance_IncRef");
18843 DeclareFunctionUtil("eInstance_StopWatching");
18844 DeclareFunctionUtil("eInstance_Watch");
18845 DeclareFunctionUtil("eInstance_FireWatchers");
18846 DeclareStruct("ecere::com::Class", 0x0);
18847 DeclareStruct("ecere::com::Instance", 0x0);
18848 DeclareStruct("ecere::com::Property", 0x0);
18849 DeclareStruct("ecere::com::DataMember", 0x0);
18850 DeclareStruct("ecere::com::Method", 0x0);
18851 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18852 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18853 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18854 for(external = (*ast).first; external; external = external->next)
18855 {
18856 afterExternal = curExternal = external;
18857 if(external->type == 0)
18858 {
18859 currentClass = external->__anon1.function->_class;
18860 ProcessFunction(external->__anon1.function);
18861 }
18862 else if(external->type == 1)
18863 {
18864 currentClass = (((void *)0));
18865 if(external->__anon1.declaration)
18866 ProcessDeclaration(external->__anon1.declaration);
18867 }
18868 else if(external->type == 2)
18869 {
18870 struct ClassDefinition * _class = external->__anon1._class;
18871
18872 currentClass = external->symbol->__anon1.registered;
18873 if(_class->definitions)
18874 {
18875 ProcessClass(_class->definitions, _class->symbol);
18876 }
18877 if(inCompiler)
18878 {
18879 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18880 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18881 }
18882 }
18883 else if(external->type == 4)
18884 {
18885 thisNameSpace = external->__anon1.id->string;
18886 }
18887 }
18888 currentClass = (((void *)0));
18889 thisNameSpace = (((void *)0));
18890 curExternal = (((void *)0));
18891 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18892 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18893 }
18894
18895 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);
18896
18897 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);
18898
18899 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18900
18901 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18902 {
18903 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18904
18905 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18906 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18907 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18908 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18909 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18910 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18911 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18912 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18913 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18914 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18915 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18916 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18917 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18918 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18919 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18920 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18921 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18922 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18923 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18924 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18925 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18926 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18927 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18928 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18929 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18930 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18931 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18932 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18933 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18934 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18935 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18936 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18937 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18938 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18939 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18940 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18941 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18945 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18954 __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);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18958 __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);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18971 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18972 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18973 __ecereClass_Conversion = class;
18974 __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);
18975 __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);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18977 __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);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19000 }
19001
19002 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19003 {
19004
19005 }
19006