compiler/libec: Added warning on deleting const qualified object
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
52
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
54
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
56
57 struct __ecereNameSpace__ecere__sys__BTNode;
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
60
61 struct __ecereNameSpace__ecere__sys__BinaryTree
62 {
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
64 int count;
65 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (*  FreeKey)(void *  key);
67 } __attribute__ ((gcc_struct));
68
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
70
71 struct __ecereNameSpace__ecere__sys__OldList
72 {
73 void *  first;
74 void *  last;
75 int count;
76 unsigned int offset;
77 unsigned int circ;
78 } __attribute__ ((gcc_struct));
79
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
81
82 struct __ecereNameSpace__ecere__com__Method
83 {
84 const char *  name;
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
88 int depth;
89 int (*  function)();
90 int vid;
91 int type;
92 struct __ecereNameSpace__ecere__com__Class * _class;
93 void *  symbol;
94 const char *  dataTypeString;
95 struct Type * dataType;
96 int memberAccess;
97 } __attribute__ ((gcc_struct));
98
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
100
101 struct __ecereNameSpace__ecere__com__Property
102 {
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
105 const char *  name;
106 unsigned int isProperty;
107 int memberAccess;
108 int id;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 const char *  dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (*  Set)(void * , int);
114 int (*  Get)(void * );
115 unsigned int (*  IsSet)(void * );
116 void *  data;
117 void *  symbol;
118 int vid;
119 unsigned int conversion;
120 unsigned int watcherOffset;
121 const char *  category;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
126
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128
129 struct CodePosition
130 {
131 int line;
132 int charPos;
133 int pos;
134 int included;
135 } __attribute__ ((gcc_struct));
136
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138
139 struct Location
140 {
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
144
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146
147 struct Attrib;
148
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
150
151 struct ExtDecl
152 {
153 struct Location loc;
154 int type;
155 union
156 {
157 char * s;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct)) __anon1;
160 } __attribute__ ((gcc_struct));
161
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
163
164 struct ClassDefinition
165 {
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
168 struct Location loc;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
175 int endid;
176 int declMode;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
179
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181
182 struct Context
183 {
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 int nextID;
190 int simpleID;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
196
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198
199 struct Instantiation
200 {
201 struct Instantiation * prev;
202 struct Instantiation * next;
203 struct Location loc;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList *  members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char *  data;
211 struct Location nameLoc;
212 struct Location insideLoc;
213 unsigned int built;
214 } __attribute__ ((gcc_struct));
215
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217
218 struct Declaration
219 {
220 struct Declaration * prev;
221 struct Declaration * next;
222 struct Location loc;
223 int type;
224 union
225 {
226 struct
227 {
228 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
230 } __attribute__ ((gcc_struct)) __anon1;
231 struct Instantiation * inst;
232 struct
233 {
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct)) __anon2;
237 } __attribute__ ((gcc_struct)) __anon1;
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
240 int declMode;
241 } __attribute__ ((gcc_struct));
242
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244
245 struct Statement
246 {
247 struct Statement * prev;
248 struct Statement * next;
249 struct Location loc;
250 int type;
251 union
252 {
253 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
254 struct
255 {
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
259 struct
260 {
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
264 struct
265 {
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
271 struct
272 {
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
277 struct
278 {
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
282 struct
283 {
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
287 struct
288 {
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
292 struct
293 {
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
299 struct
300 {
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct
304 {
305 struct Specifier * spec;
306 char * statements;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
311 struct
312 {
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
317 struct
318 {
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct)) __anon1;
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329
330 struct TypeName
331 {
332 struct TypeName * prev;
333 struct TypeName * next;
334 struct Location loc;
335 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
336 struct Declarator * declarator;
337 int classObjectType;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
340
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342
343 struct Initializer
344 {
345 struct Initializer * prev;
346 struct Initializer * next;
347 struct Location loc;
348 int type;
349 union
350 {
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList *  list;
353 } __attribute__ ((gcc_struct)) __anon1;
354 unsigned int isConstant;
355 struct Identifier * id;
356 } __attribute__ ((gcc_struct));
357
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
359
360 struct __ecereNameSpace__ecere__com__DataValue
361 {
362 union
363 {
364 char c;
365 unsigned char uc;
366 short s;
367 unsigned short us;
368 int i;
369 unsigned int ui;
370 void *  p;
371 float f;
372 double d;
373 long long i64;
374 uint64 ui64;
375 } __attribute__ ((gcc_struct)) __anon1;
376 } __attribute__ ((gcc_struct));
377
378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
379
380 struct Expression
381 {
382 struct Expression * prev;
383 struct Expression * next;
384 struct Location loc;
385 int type;
386 union
387 {
388 struct
389 {
390 char *  constant;
391 struct Identifier * identifier;
392 } __attribute__ ((gcc_struct)) __anon1;
393 struct Statement * compound;
394 struct Instantiation * instance;
395 struct
396 {
397 char *  string;
398 unsigned int intlString;
399 } __attribute__ ((gcc_struct)) __anon2;
400 struct __ecereNameSpace__ecere__sys__OldList *  list;
401 struct
402 {
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
406 struct
407 {
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
410 struct
411 {
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
416 struct
417 {
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
421 struct
422 {
423 struct Expression * exp;
424 struct Identifier * member;
425 int memberType;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
428 struct
429 {
430 int op;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
436 struct
437 {
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
441 struct
442 {
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
447 struct
448 {
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
452 struct
453 {
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
458 struct
459 {
460 char * table;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
463 struct
464 {
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
468 struct
469 {
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
473 struct
474 {
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct)) __anon1;
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
481 uint64 address;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
485 unsigned int usage;
486 int tempCount;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 unsigned int needTemplateCast;
494 } __attribute__ ((gcc_struct));
495
496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
497
498 struct TemplateDatatype
499 {
500 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
501 struct Declarator * decl;
502 } __attribute__ ((gcc_struct));
503
504 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
505
506 struct TemplateArgument;
507
508 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
509
510 struct TemplateParameter
511 {
512 struct TemplateParameter * prev;
513 struct TemplateParameter * next;
514 struct Location loc;
515 int type;
516 struct Identifier * identifier;
517 union
518 {
519 struct TemplateDatatype * dataType;
520 int memberType;
521 } __attribute__ ((gcc_struct)) __anon1;
522 struct TemplateArgument * defaultArgument;
523 const char *  dataTypeString;
524 struct Type * baseType;
525 } __attribute__ ((gcc_struct));
526
527 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
528
529 struct Specifier
530 {
531 struct Specifier * prev;
532 struct Specifier * next;
533 struct Location loc;
534 int type;
535 union
536 {
537 int specifier;
538 struct
539 {
540 struct ExtDecl * extDecl;
541 char *  name;
542 struct Symbol * symbol;
543 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
544 } __attribute__ ((gcc_struct)) __anon1;
545 struct
546 {
547 struct Identifier * id;
548 struct __ecereNameSpace__ecere__sys__OldList *  list;
549 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
550 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
551 unsigned int addNameSpace;
552 struct Context * ctx;
553 struct ExtDecl * extDeclStruct;
554 } __attribute__ ((gcc_struct)) __anon2;
555 struct Expression * expression;
556 struct Specifier * _class;
557 struct TemplateParameter * templateParameter;
558 } __attribute__ ((gcc_struct)) __anon1;
559 } __attribute__ ((gcc_struct));
560
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
562
563 struct Identifier
564 {
565 struct Identifier * prev;
566 struct Identifier * next;
567 struct Location loc;
568 struct Symbol * classSym;
569 struct Specifier * _class;
570 char *  string;
571 struct Identifier * badID;
572 } __attribute__ ((gcc_struct));
573
574 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
575
576 struct Pointer;
577
578 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
579
580 struct Declarator
581 {
582 struct Declarator * prev;
583 struct Declarator * next;
584 struct Location loc;
585 int type;
586 struct Symbol * symbol;
587 struct Declarator * declarator;
588 union
589 {
590 struct Identifier * identifier;
591 struct
592 {
593 struct Expression * exp;
594 struct Expression * posExp;
595 struct Attrib * attrib;
596 } __attribute__ ((gcc_struct)) structDecl;
597 struct
598 {
599 struct Expression * exp;
600 struct Specifier * enumClass;
601 } __attribute__ ((gcc_struct)) array;
602 struct
603 {
604 struct __ecereNameSpace__ecere__sys__OldList * parameters;
605 } __attribute__ ((gcc_struct)) function;
606 struct
607 {
608 struct Pointer * pointer;
609 } __attribute__ ((gcc_struct)) pointer;
610 struct
611 {
612 struct ExtDecl * extended;
613 } __attribute__ ((gcc_struct)) extended;
614 } __attribute__ ((gcc_struct)) __anon1;
615 } __attribute__ ((gcc_struct));
616
617 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
618
619 struct FunctionDefinition
620 {
621 struct FunctionDefinition * prev;
622 struct FunctionDefinition * next;
623 struct Location loc;
624 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
625 struct Declarator * declarator;
626 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
627 struct Statement * body;
628 struct __ecereNameSpace__ecere__com__Class * _class;
629 struct __ecereNameSpace__ecere__sys__OldList attached;
630 int declMode;
631 struct Type * type;
632 struct Symbol * propSet;
633 int tempCount;
634 unsigned int propertyNoThis;
635 } __attribute__ ((gcc_struct));
636
637 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
638
639 struct DBTableDef;
640
641 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
642
643 struct External
644 {
645 struct External * prev;
646 struct External * next;
647 struct Location loc;
648 int type;
649 struct Symbol * symbol;
650 union
651 {
652 struct FunctionDefinition * function;
653 struct ClassDefinition * _class;
654 struct Declaration * declaration;
655 char *  importString;
656 struct Identifier * id;
657 struct DBTableDef * table;
658 } __attribute__ ((gcc_struct)) __anon1;
659 int importType;
660 } __attribute__ ((gcc_struct));
661
662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
663
664 struct ModuleImport
665 {
666 struct ModuleImport * prev;
667 struct ModuleImport * next;
668 char *  name;
669 struct __ecereNameSpace__ecere__sys__OldList classes;
670 struct __ecereNameSpace__ecere__sys__OldList functions;
671 int importType;
672 int importAccess;
673 } __attribute__ ((gcc_struct));
674
675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
676
677 struct ClassImport
678 {
679 struct ClassImport * prev;
680 struct ClassImport * next;
681 char *  name;
682 struct __ecereNameSpace__ecere__sys__OldList methods;
683 struct __ecereNameSpace__ecere__sys__OldList properties;
684 unsigned int itself;
685 int isRemote;
686 } __attribute__ ((gcc_struct));
687
688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
689
690 struct Symbol
691 {
692 char *  string;
693 struct Symbol * parent;
694 struct Symbol * left;
695 struct Symbol * right;
696 int depth;
697 struct Type * type;
698 union
699 {
700 struct __ecereNameSpace__ecere__com__Method * method;
701 struct __ecereNameSpace__ecere__com__Property * _property;
702 struct __ecereNameSpace__ecere__com__Class * registered;
703 } __attribute__ ((gcc_struct)) __anon1;
704 int id;
705 int idCode;
706 union
707 {
708 struct
709 {
710 struct External * pointerExternal;
711 struct External * structExternal;
712 } __attribute__ ((gcc_struct)) __anon1;
713 struct
714 {
715 struct External * externalGet;
716 struct External * externalSet;
717 struct External * externalPtr;
718 struct External * externalIsSet;
719 } __attribute__ ((gcc_struct)) __anon2;
720 struct
721 {
722 struct External * methodExternal;
723 struct External * methodCodeExternal;
724 } __attribute__ ((gcc_struct)) __anon3;
725 } __attribute__ ((gcc_struct)) __anon2;
726 unsigned int imported;
727 unsigned int declaredStructSym;
728 struct __ecereNameSpace__ecere__com__Class * _class;
729 unsigned int declaredStruct;
730 unsigned int needConstructor;
731 unsigned int needDestructor;
732 char *  constructorName;
733 char *  structName;
734 char *  className;
735 char *  destructorName;
736 struct ModuleImport * module;
737 struct ClassImport * _import;
738 struct Location nameLoc;
739 unsigned int isParam;
740 unsigned int isRemote;
741 unsigned int isStruct;
742 unsigned int fireWatchersDone;
743 int declaring;
744 unsigned int classData;
745 unsigned int isStatic;
746 char *  shortName;
747 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
748 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
749 struct Context * ctx;
750 int isIterator;
751 struct Expression * propCategory;
752 } __attribute__ ((gcc_struct));
753
754 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
755
756 struct Type
757 {
758 struct Type * prev;
759 struct Type * next;
760 int refCount;
761 union
762 {
763 struct Symbol * _class;
764 struct
765 {
766 struct __ecereNameSpace__ecere__sys__OldList members;
767 char *  enumName;
768 } __attribute__ ((gcc_struct)) __anon1;
769 struct
770 {
771 struct Type * returnType;
772 struct __ecereNameSpace__ecere__sys__OldList params;
773 struct Symbol * thisClass;
774 unsigned int staticMethod;
775 struct TemplateParameter * thisClassTemplate;
776 } __attribute__ ((gcc_struct)) __anon2;
777 struct
778 {
779 struct __ecereNameSpace__ecere__com__Method * method;
780 struct __ecereNameSpace__ecere__com__Class * methodClass;
781 struct __ecereNameSpace__ecere__com__Class * usedClass;
782 } __attribute__ ((gcc_struct)) __anon3;
783 struct
784 {
785 struct Type * arrayType;
786 int arraySize;
787 struct Expression * arraySizeExp;
788 unsigned int freeExp;
789 struct Symbol * enumClass;
790 } __attribute__ ((gcc_struct)) __anon4;
791 struct Type * type;
792 struct TemplateParameter * templateParameter;
793 } __attribute__ ((gcc_struct)) __anon1;
794 int kind;
795 unsigned int size;
796 char *  name;
797 char *  typeName;
798 int classObjectType;
799 int alignment;
800 unsigned int offset;
801 int bitFieldCount;
802 int count;
803 unsigned int isSigned : 1;
804 unsigned int constant : 1;
805 unsigned int truth : 1;
806 unsigned int byReference : 1;
807 unsigned int extraParam : 1;
808 unsigned int directClassAccess : 1;
809 unsigned int computing : 1;
810 unsigned int keepCast : 1;
811 unsigned int passAsTemplate : 1;
812 unsigned int dllExport : 1;
813 unsigned int attrStdcall : 1;
814 unsigned int declaredWithStruct : 1;
815 unsigned int typedByReference : 1;
816 unsigned int casted : 1;
817 } __attribute__ ((gcc_struct));
818
819 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
820
821 struct __ecereNameSpace__ecere__com__Class
822 {
823 struct __ecereNameSpace__ecere__com__Class * prev;
824 struct __ecereNameSpace__ecere__com__Class * next;
825 const char *  name;
826 int offset;
827 int structSize;
828 int (* *  _vTbl)();
829 int vTblSize;
830 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
831 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
832 int offsetClass;
833 int sizeClass;
834 struct __ecereNameSpace__ecere__com__Class * base;
835 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
836 struct __ecereNameSpace__ecere__sys__BinaryTree members;
837 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
838 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
839 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
840 struct __ecereNameSpace__ecere__sys__OldList derivatives;
841 int memberID;
842 int startMemberID;
843 int type;
844 struct __ecereNameSpace__ecere__com__Instance * module;
845 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
846 const char *  dataTypeString;
847 struct Type * dataType;
848 int typeSize;
849 int defaultAlignment;
850 void (*  Initialize)();
851 int memberOffset;
852 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
853 const char *  designerClass;
854 unsigned int noExpansion;
855 const char *  defaultProperty;
856 unsigned int comRedefinition;
857 int count;
858 int isRemote;
859 unsigned int internalDecl;
860 void *  data;
861 unsigned int computeSize;
862 int structAlignment;
863 int destructionWatchOffset;
864 unsigned int fixed;
865 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
866 int inheritanceAccess;
867 const char *  fullName;
868 void *  symbol;
869 struct __ecereNameSpace__ecere__sys__OldList conversions;
870 struct __ecereNameSpace__ecere__sys__OldList templateParams;
871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
872 struct __ecereNameSpace__ecere__com__Class * templateClass;
873 struct __ecereNameSpace__ecere__sys__OldList templatized;
874 int numParams;
875 unsigned int isInstanceClass;
876 unsigned int byValueSystemClass;
877 } __attribute__ ((gcc_struct));
878
879 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
880
881 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
882
883 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
884
885 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
886
887 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
888
889 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);
890
891 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
892
893 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
894
895 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
896
897 struct __ecereNameSpace__ecere__com__Instance
898 {
899 int (* *  _vTbl)();
900 struct __ecereNameSpace__ecere__com__Class * _class;
901 int _refCount;
902 } __attribute__ ((gcc_struct));
903
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
905
906 struct __ecereNameSpace__ecere__com__DataMember
907 {
908 struct __ecereNameSpace__ecere__com__DataMember * prev;
909 struct __ecereNameSpace__ecere__com__DataMember * next;
910 const char *  name;
911 unsigned int isProperty;
912 int memberAccess;
913 int id;
914 struct __ecereNameSpace__ecere__com__Class * _class;
915 const char *  dataTypeString;
916 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
917 struct Type * dataType;
918 int type;
919 int offset;
920 int memberID;
921 struct __ecereNameSpace__ecere__sys__OldList members;
922 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
923 int memberOffset;
924 int structAlignment;
925 } __attribute__ ((gcc_struct));
926
927 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
928
929 struct __ecereNameSpace__ecere__com__SerialBuffer
930 {
931 unsigned char *  _buffer;
932 unsigned int count;
933 unsigned int _size;
934 unsigned int pos;
935 } __attribute__ ((gcc_struct));
936
937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
938
939 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
940 {
941 union
942 {
943 struct
944 {
945 const char *  dataTypeString;
946 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
947 } __attribute__ ((gcc_struct)) __anon1;
948 struct __ecereNameSpace__ecere__com__DataValue expression;
949 struct
950 {
951 const char *  memberString;
952 union
953 {
954 struct __ecereNameSpace__ecere__com__DataMember * member;
955 struct __ecereNameSpace__ecere__com__Property * prop;
956 struct __ecereNameSpace__ecere__com__Method * method;
957 } __attribute__ ((gcc_struct)) __anon1;
958 } __attribute__ ((gcc_struct)) __anon2;
959 } __attribute__ ((gcc_struct)) __anon1;
960 } __attribute__ ((gcc_struct));
961
962 void exit(int status);
963
964 void * calloc(size_t nmemb, size_t size);
965
966 void free(void * ptr);
967
968 void * malloc(size_t size);
969
970 void * realloc(void * ptr, size_t size);
971
972 long int strtol(const char * nptr, char ** endptr, int base);
973
974 long long int strtoll(const char * nptr, char ** endptr, int base);
975
976 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
977
978 enum yytokentype
979 {
980 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
981 };
982
983 typedef union YYSTYPE
984 {
985 int specifierType;
986 int i;
987 int declMode;
988 struct Identifier * id;
989 struct Expression * exp;
990 struct Specifier * specifier;
991 struct __ecereNameSpace__ecere__sys__OldList * list;
992 struct Enumerator * enumerator;
993 struct Declarator * declarator;
994 struct Pointer * pointer;
995 struct Initializer * initializer;
996 struct InitDeclarator * initDeclarator;
997 struct TypeName * typeName;
998 struct Declaration * declaration;
999 struct Statement * stmt;
1000 struct FunctionDefinition * function;
1001 struct External * external;
1002 struct Context * context;
1003 struct AsmField * asmField;
1004 struct Attrib * attrib;
1005 struct ExtDecl * extDecl;
1006 struct Attribute * attribute;
1007 struct Instantiation * instance;
1008 struct MembersInit * membersInit;
1009 struct MemberInit * memberInit;
1010 struct ClassFunction * classFunction;
1011 struct ClassDefinition * _class;
1012 struct ClassDef * classDef;
1013 struct PropertyDef * prop;
1014 char * string;
1015 struct Symbol * symbol;
1016 struct PropertyWatch * propertyWatch;
1017 struct TemplateParameter * templateParameter;
1018 struct TemplateArgument * templateArgument;
1019 struct TemplateDatatype * templateDatatype;
1020 struct DBTableEntry * dbtableEntry;
1021 struct DBIndexItem * dbindexItem;
1022 struct DBTableDef * dbtableDef;
1023 } __attribute__ ((gcc_struct)) YYSTYPE;
1024
1025 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1026
1027 struct Enumerator
1028 {
1029 struct Enumerator * prev;
1030 struct Enumerator * next;
1031 struct Location loc;
1032 struct Identifier * id;
1033 struct Expression * exp;
1034 } __attribute__ ((gcc_struct));
1035
1036 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1037
1038 struct InitDeclarator
1039 {
1040 struct InitDeclarator * prev;
1041 struct InitDeclarator * next;
1042 struct Location loc;
1043 struct Declarator * declarator;
1044 struct Initializer * initializer;
1045 } __attribute__ ((gcc_struct));
1046
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1048
1049 struct AsmField
1050 {
1051 struct AsmField * prev;
1052 struct AsmField * next;
1053 struct Location loc;
1054 char *  command;
1055 struct Expression * expression;
1056 struct Identifier * symbolic;
1057 } __attribute__ ((gcc_struct));
1058
1059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1060
1061 struct Attribute;
1062
1063 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1064
1065 struct ClassFunction
1066 {
1067 struct ClassFunction * prev;
1068 struct ClassFunction * next;
1069 struct Location loc;
1070 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1071 struct Declarator * declarator;
1072 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1073 struct Statement * body;
1074 struct __ecereNameSpace__ecere__com__Class * _class;
1075 struct __ecereNameSpace__ecere__sys__OldList attached;
1076 int declMode;
1077 struct Type * type;
1078 struct Symbol * propSet;
1079 unsigned int isVirtual;
1080 unsigned int isConstructor;
1081 unsigned int isDestructor;
1082 unsigned int dontMangle;
1083 int id;
1084 int idCode;
1085 } __attribute__ ((gcc_struct));
1086
1087 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1088
1089 struct MembersInit
1090 {
1091 struct MembersInit * prev;
1092 struct MembersInit * next;
1093 struct Location loc;
1094 int type;
1095 union
1096 {
1097 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1098 struct ClassFunction * function;
1099 } __attribute__ ((gcc_struct)) __anon1;
1100 } __attribute__ ((gcc_struct));
1101
1102 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1103
1104 struct MemberInit
1105 {
1106 struct MemberInit * prev;
1107 struct MemberInit * next;
1108 struct Location loc;
1109 struct Location realLoc;
1110 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1111 struct Initializer * initializer;
1112 unsigned int used;
1113 unsigned int variable;
1114 unsigned int takeOutExp;
1115 } __attribute__ ((gcc_struct));
1116
1117 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1118
1119 struct PropertyDef
1120 {
1121 struct PropertyDef * prev;
1122 struct PropertyDef * next;
1123 struct Location loc;
1124 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1125 struct Declarator * declarator;
1126 struct Identifier * id;
1127 struct Statement * getStmt;
1128 struct Statement * setStmt;
1129 struct Statement * issetStmt;
1130 struct Symbol * symbol;
1131 struct Expression * category;
1132 struct
1133 {
1134 unsigned int conversion : 1;
1135 unsigned int isWatchable : 1;
1136 unsigned int isDBProp : 1;
1137 } __attribute__ ((gcc_struct)) __anon1;
1138 } __attribute__ ((gcc_struct));
1139
1140 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1141
1142 struct PropertyWatch
1143 {
1144 struct PropertyWatch * prev;
1145 struct PropertyWatch * next;
1146 struct Location loc;
1147 struct Statement * compound;
1148 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1149 unsigned int deleteWatch;
1150 } __attribute__ ((gcc_struct));
1151
1152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1153
1154 struct ClassDef
1155 {
1156 struct ClassDef * prev;
1157 struct ClassDef * next;
1158 struct Location loc;
1159 int type;
1160 union
1161 {
1162 struct Declaration * decl;
1163 struct ClassFunction * function;
1164 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1165 struct PropertyDef * propertyDef;
1166 struct PropertyWatch * propertyWatch;
1167 char *  designer;
1168 struct Identifier * defaultProperty;
1169 struct
1170 {
1171 struct Identifier * id;
1172 struct Initializer * initializer;
1173 } __attribute__ ((gcc_struct)) __anon1;
1174 } __attribute__ ((gcc_struct)) __anon1;
1175 int memberAccess;
1176 void *  object;
1177 } __attribute__ ((gcc_struct));
1178
1179 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1180
1181 struct DBTableEntry;
1182
1183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1184
1185 struct DBIndexItem;
1186
1187 extern YYSTYPE yylval;
1188
1189 extern struct Location yylloc;
1190
1191 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1192
1193 extern int returnCode;
1194
1195 extern struct Expression * parsedExpression;
1196
1197 extern unsigned int yydebug;
1198
1199 void SetYydebug(unsigned int b)
1200 {
1201 yydebug = b;
1202 }
1203
1204 extern unsigned int echoOn;
1205
1206 void resetScanner();
1207
1208 int propWatcherID;
1209
1210 int expression_yyparse();
1211
1212 static struct Statement * curCompound;
1213
1214 struct External * curExternal, * afterExternal;
1215
1216 static struct Type * curSwitchType;
1217
1218 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1219
1220 struct __ecereNameSpace__ecere__com__Class * thisClass;
1221
1222 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1223 {
1224 thisClass = c;
1225 }
1226
1227 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1228 {
1229 return thisClass;
1230 }
1231
1232 static char * thisNameSpace;
1233
1234 struct __ecereNameSpace__ecere__com__Class * containerClass;
1235
1236 unsigned int thisClassParams = 0x1;
1237
1238 unsigned int internalValueCounter;
1239
1240 extern unsigned int outputLineNumbers;
1241
1242 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1243
1244 extern size_t strlen(const char * );
1245
1246 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1247
1248 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1249
1250 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1251
1252 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1253
1254 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1255
1256 void PrintExpression(struct Expression * exp, char * string)
1257 {
1258 {
1259 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1260 int count;
1261 unsigned int backOutputLineNumbers = outputLineNumbers;
1262
1263 outputLineNumbers = 0x0;
1264 if(exp)
1265 OutputExpression(exp, f);
1266 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1267 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1268
1269 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1270 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1271 count = strlen(string);
1272 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1273 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1274
1275 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1276 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1277 string[count] = '\0';
1278 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1279 outputLineNumbers = backOutputLineNumbers;
1280 }
1281 }
1282
1283 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1284
1285 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1286
1287 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1288 {
1289 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1290 {
1291 if(!param->baseType)
1292 {
1293 if(param->dataTypeString)
1294 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1295 else
1296 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1297 }
1298 return param->baseType;
1299 }
1300 return (((void *)0));
1301 }
1302
1303 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1304 {
1305 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1306 return 0x1;
1307 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1308 {
1309 return 0x0;
1310 }
1311 if(type1->kind == type2->kind)
1312 {
1313 switch(type1->kind)
1314 {
1315 case 24:
1316 case 1:
1317 case 2:
1318 case 3:
1319 case 4:
1320 case 22:
1321 case 23:
1322 if(type1->passAsTemplate && !type2->passAsTemplate)
1323 return 0x1;
1324 return type1->isSigned != type2->isSigned;
1325 case 8:
1326 return type1->__anon1._class != type2->__anon1._class;
1327 case 13:
1328 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1329 default:
1330 return 0x1;
1331 }
1332 }
1333 return 0x1;
1334 }
1335
1336 extern int strcmp(const char * , const char * );
1337
1338 extern struct Context * curContext;
1339
1340 extern struct Context * topContext;
1341
1342 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1343
1344 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);
1345
1346 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1347
1348 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);
1349
1350 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);
1351
1352 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1353
1354 struct __ecereNameSpace__ecere__com__ClassProperty
1355 {
1356 const char *  name;
1357 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1358 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1359 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1360 int depth;
1361 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1362 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1363 const char *  dataTypeString;
1364 struct Type * dataType;
1365 unsigned int constant;
1366 } __attribute__ ((gcc_struct));
1367
1368 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1369
1370 extern struct Expression * QMkExpId(const char *  id);
1371
1372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1373
1374 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1375 {
1376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1377 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1378 const char *  name;
1379 int type;
1380 union
1381 {
1382 const char *  dataTypeString;
1383 int memberType;
1384 } __attribute__ ((gcc_struct)) __anon1;
1385 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1386 void *  param;
1387 } __attribute__ ((gcc_struct));
1388
1389 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1390
1391 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1392
1393 extern void FreeIdentifier(struct Identifier * id);
1394
1395 void ProcessExpressionType(struct Expression * exp);
1396
1397 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1398
1399 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1400
1401 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1402
1403 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1404
1405 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1406
1407 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1408
1409 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1410
1411 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1412
1413 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1414 {
1415 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1416 {
1417 struct Identifier * id = exp->__anon1.__anon1.identifier;
1418 struct Context * ctx;
1419 struct Symbol * symbol = (((void *)0));
1420
1421 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1422 {
1423 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1424 {
1425 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1426 if(symbol)
1427 break;
1428 }
1429 }
1430 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))))
1431 {
1432 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1433 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1434 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1435 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1436
1437 if(!prop)
1438 {
1439 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1440 }
1441 if(!prop && !method)
1442 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1443 if(!prop && !method && !member)
1444 {
1445 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1446 }
1447 if(prop || method || member || classProp)
1448 {
1449 exp->type = 8;
1450 exp->__anon1.member.member = id;
1451 exp->__anon1.member.memberType = 0;
1452 exp->__anon1.member.exp = QMkExpId("this");
1453 exp->addedThis = 0x1;
1454 }
1455 else if(_class && _class->templateParams.first)
1456 {
1457 struct __ecereNameSpace__ecere__com__Class * sClass;
1458
1459 for(sClass = _class; sClass; sClass = sClass->base)
1460 {
1461 if(sClass->templateParams.first)
1462 {
1463 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1464
1465 for(param = sClass->templateParams.first; param; param = param->next)
1466 {
1467 if(param->type == 2 && !strcmp(param->name, id->string))
1468 {
1469 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1470
1471 if(argExp)
1472 {
1473 struct Declarator * decl;
1474 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1475
1476 FreeIdentifier(exp->__anon1.member.member);
1477 ProcessExpressionType(argExp);
1478 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1479 exp->expType = ProcessType(specs, decl);
1480 exp->type = 5;
1481 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1482 }
1483 }
1484 }
1485 }
1486 }
1487 }
1488 }
1489 }
1490 }
1491
1492 extern int sprintf(char * , const char * , ...);
1493
1494 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1495
1496 extern char *  strcat(char * , const char * );
1497
1498 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1499
1500 char * PrintInt(long long result)
1501 {
1502 char temp[100];
1503
1504 if(result > (((int)0x7fffffff)))
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1506 else
1507 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1508 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1509 strcat(temp, "LL");
1510 return __ecereNameSpace__ecere__sys__CopyString(temp);
1511 }
1512
1513 char * PrintUInt(uint64 result)
1514 {
1515 char temp[100];
1516
1517 if(result > (0xffffffff))
1518 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1519 else if(result > (((int)0x7fffffff)))
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1521 else
1522 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1523 return __ecereNameSpace__ecere__sys__CopyString(temp);
1524 }
1525
1526 char * PrintInt64(long long result)
1527 {
1528 char temp[100];
1529
1530 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1531 return __ecereNameSpace__ecere__sys__CopyString(temp);
1532 }
1533
1534 char * PrintUInt64(uint64 result)
1535 {
1536 char temp[100];
1537
1538 if(result > (((long long)0x7fffffffffffffffLL)))
1539 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1540 else
1541 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1542 return __ecereNameSpace__ecere__sys__CopyString(temp);
1543 }
1544
1545 char * PrintHexUInt(uint64 result)
1546 {
1547 char temp[100];
1548
1549 if(result > (0xffffffff))
1550 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1551 else
1552 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1553 if(result > (0xffffffff))
1554 strcat(temp, "LL");
1555 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 }
1557
1558 char * PrintHexUInt64(uint64 result)
1559 {
1560 char temp[100];
1561
1562 if(result > (0xffffffff))
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1564 else
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1566 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 }
1568
1569 char * PrintShort(short result)
1570 {
1571 char temp[100];
1572
1573 sprintf(temp, "%d", (unsigned short)result);
1574 return __ecereNameSpace__ecere__sys__CopyString(temp);
1575 }
1576
1577 char * PrintUShort(unsigned short result)
1578 {
1579 char temp[100];
1580
1581 if(result > (unsigned short)32767)
1582 sprintf(temp, "0x%X", (int)result);
1583 else
1584 sprintf(temp, "%d", (int)result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 }
1587
1588 extern int isprint(int c);
1589
1590 char * PrintChar(char result)
1591 {
1592 char temp[100];
1593
1594 if(result > (char)0 && isprint(result))
1595 sprintf(temp, "'%c'", result);
1596 else if(result < (char)0)
1597 sprintf(temp, "%d", (int)result);
1598 else
1599 sprintf(temp, "0x%X", (unsigned char)result);
1600 return __ecereNameSpace__ecere__sys__CopyString(temp);
1601 }
1602
1603 char * PrintUChar(unsigned char result)
1604 {
1605 char temp[100];
1606
1607 sprintf(temp, "0x%X", result);
1608 return __ecereNameSpace__ecere__sys__CopyString(temp);
1609 }
1610
1611 extern char *  strcpy(char * , const char * );
1612
1613 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1614
1615 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1616
1617 extern int (* __ecereProp_float_Get_signBit)(float this);
1618
1619 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1620
1621 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1622
1623 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1624
1625 char * PrintFloat(float result)
1626 {
1627 char temp[350];
1628
1629 if(__ecereProp_float_Get_isInf(result))
1630 {
1631 if(__ecereProp_float_Get_signBit(result))
1632 strcpy(temp, "-inf");
1633 else
1634 strcpy(temp, "inf");
1635 }
1636 else if(__ecereProp_float_Get_isNan(result))
1637 {
1638 if(__ecereProp_float_Get_signBit(result))
1639 strcpy(temp, "-nan");
1640 else
1641 strcpy(temp, "nan");
1642 }
1643 else
1644 sprintf(temp, "%.16ff", result);
1645 return __ecereNameSpace__ecere__sys__CopyString(temp);
1646 }
1647
1648 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1649
1650 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1651
1652 extern int (* __ecereProp_double_Get_signBit)(double this);
1653
1654 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1655
1656 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1657
1658 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1659
1660 char * PrintDouble(double result)
1661 {
1662 char temp[350];
1663
1664 if(__ecereProp_double_Get_isInf(result))
1665 {
1666 if(__ecereProp_double_Get_signBit(result))
1667 strcpy(temp, "-inf");
1668 else
1669 strcpy(temp, "inf");
1670 }
1671 else if(__ecereProp_double_Get_isNan(result))
1672 {
1673 if(__ecereProp_double_Get_signBit(result))
1674 strcpy(temp, "-nan");
1675 else
1676 strcpy(temp, "nan");
1677 }
1678 else
1679 sprintf(temp, "%.16f", result);
1680 return __ecereNameSpace__ecere__sys__CopyString(temp);
1681 }
1682
1683 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1684
1685 struct OpTable
1686 {
1687 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1693 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1694 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1695 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1707 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  Not)(struct Expression *, struct Operand *);
1713 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1722 } __attribute__ ((gcc_struct));
1723
1724 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1725
1726 struct Operand
1727 {
1728 int kind;
1729 struct Type * type;
1730 unsigned int ptrSize;
1731 union
1732 {
1733 char c;
1734 unsigned char uc;
1735 short s;
1736 unsigned short us;
1737 int i;
1738 unsigned int ui;
1739 float f;
1740 double d;
1741 long long i64;
1742 uint64 ui64;
1743 } __attribute__ ((gcc_struct)) __anon1;
1744 struct OpTable ops;
1745 } __attribute__ ((gcc_struct));
1746
1747 unsigned int GetOpInt(struct Operand * op2, int * value2)
1748 {
1749 if(op2->kind == 3 && op2->type->isSigned)
1750 *value2 = op2->__anon1.i;
1751 else if(op2->kind == 3)
1752 *value2 = (int)op2->__anon1.ui;
1753 else if(op2->kind == 4 && op2->type->isSigned)
1754 *value2 = (int)op2->__anon1.i64;
1755 else if(op2->kind == 4)
1756 *value2 = (int)op2->__anon1.ui64;
1757 else if(op2->kind == 23 && op2->type->isSigned)
1758 *value2 = (int)op2->__anon1.i64;
1759 else if(op2->kind == 23)
1760 *value2 = (int)op2->__anon1.ui64;
1761 else if(op2->kind == 22 && op2->type->isSigned)
1762 *value2 = (int)op2->__anon1.i64;
1763 else if(op2->kind == 22)
1764 *value2 = (int)op2->__anon1.ui64;
1765 else if(op2->kind == 2 && op2->type->isSigned)
1766 *value2 = (int)op2->__anon1.s;
1767 else if(op2->kind == 2)
1768 *value2 = (int)op2->__anon1.us;
1769 else if(op2->kind == 1 && op2->type->isSigned)
1770 *value2 = (int)op2->__anon1.c;
1771 else if(op2->kind == 24 || op2->kind == 1)
1772 *value2 = (int)op2->__anon1.uc;
1773 else if(op2->kind == 6)
1774 *value2 = (int)op2->__anon1.f;
1775 else if(op2->kind == 7)
1776 *value2 = (int)op2->__anon1.d;
1777 else if(op2->kind == 13)
1778 *value2 = (int)op2->__anon1.ui64;
1779 else
1780 return 0x0;
1781 return 0x1;
1782 }
1783
1784 struct Operand GetOperand(struct Expression * exp);
1785
1786 unsigned int GetInt(struct Expression * exp, int * value2)
1787 {
1788 struct Operand op2 = GetOperand(exp);
1789
1790 return GetOpInt(&op2, value2);
1791 }
1792
1793 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1794 {
1795 if(op2->kind == 3 && op2->type->isSigned)
1796 *value2 = (unsigned int)op2->__anon1.i;
1797 else if(op2->kind == 3)
1798 *value2 = op2->__anon1.ui;
1799 else if(op2->kind == 4 && op2->type->isSigned)
1800 *value2 = (unsigned int)op2->__anon1.i64;
1801 else if(op2->kind == 4)
1802 *value2 = (unsigned int)op2->__anon1.ui64;
1803 else if(op2->kind == 23 && op2->type->isSigned)
1804 *value2 = (unsigned int)op2->__anon1.i64;
1805 else if(op2->kind == 23)
1806 *value2 = (unsigned int)op2->__anon1.ui64;
1807 else if(op2->kind == 22 && op2->type->isSigned)
1808 *value2 = (unsigned int)op2->__anon1.i64;
1809 else if(op2->kind == 22)
1810 *value2 = (unsigned int)op2->__anon1.ui64;
1811 else if(op2->kind == 2 && op2->type->isSigned)
1812 *value2 = (unsigned int)op2->__anon1.s;
1813 else if(op2->kind == 2)
1814 *value2 = (unsigned int)op2->__anon1.us;
1815 else if(op2->kind == 1 && op2->type->isSigned)
1816 *value2 = (unsigned int)op2->__anon1.c;
1817 else if(op2->kind == 24 || op2->kind == 1)
1818 *value2 = (unsigned int)op2->__anon1.uc;
1819 else if(op2->kind == 6)
1820 *value2 = (unsigned int)op2->__anon1.f;
1821 else if(op2->kind == 7)
1822 *value2 = (unsigned int)op2->__anon1.d;
1823 else if(op2->kind == 13)
1824 *value2 = (unsigned int)op2->__anon1.ui64;
1825 else
1826 return 0x0;
1827 return 0x1;
1828 }
1829
1830 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1831 {
1832 struct Operand op2 = GetOperand(exp);
1833
1834 return GetOpUInt(&op2, value2);
1835 }
1836
1837 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1838 {
1839 if(op2->kind == 3 && op2->type->isSigned)
1840 *value2 = (long long)op2->__anon1.i;
1841 else if(op2->kind == 3)
1842 *value2 = (long long)op2->__anon1.ui;
1843 else if(op2->kind == 4 && op2->type->isSigned)
1844 *value2 = op2->__anon1.i64;
1845 else if(op2->kind == 4)
1846 *value2 = (long long)op2->__anon1.ui64;
1847 else if(op2->kind == 23 && op2->type->isSigned)
1848 *value2 = op2->__anon1.i64;
1849 else if(op2->kind == 23)
1850 *value2 = (long long)op2->__anon1.ui64;
1851 else if(op2->kind == 22 && op2->type->isSigned)
1852 *value2 = op2->__anon1.i64;
1853 else if(op2->kind == 22)
1854 *value2 = (long long)op2->__anon1.ui64;
1855 else if(op2->kind == 2 && op2->type->isSigned)
1856 *value2 = (long long)op2->__anon1.s;
1857 else if(op2->kind == 2)
1858 *value2 = (long long)op2->__anon1.us;
1859 else if(op2->kind == 1 && op2->type->isSigned)
1860 *value2 = (long long)op2->__anon1.c;
1861 else if(op2->kind == 24 || op2->kind == 1)
1862 *value2 = (long long)op2->__anon1.uc;
1863 else if(op2->kind == 6)
1864 *value2 = (long long)op2->__anon1.f;
1865 else if(op2->kind == 7)
1866 *value2 = (long long)op2->__anon1.d;
1867 else if(op2->kind == 13)
1868 *value2 = (long long)op2->__anon1.ui64;
1869 else
1870 return 0x0;
1871 return 0x1;
1872 }
1873
1874 unsigned int GetInt64(struct Expression * exp, long long * value2)
1875 {
1876 struct Operand op2 = GetOperand(exp);
1877
1878 return GetOpInt64(&op2, value2);
1879 }
1880
1881 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1882 {
1883 if(op2->kind == 3 && op2->type->isSigned)
1884 *value2 = (uint64)op2->__anon1.i;
1885 else if(op2->kind == 3)
1886 *value2 = (uint64)op2->__anon1.ui;
1887 else if(op2->kind == 4 && op2->type->isSigned)
1888 *value2 = (uint64)op2->__anon1.i64;
1889 else if(op2->kind == 4)
1890 *value2 = op2->__anon1.ui64;
1891 else if(op2->kind == 23 && op2->type->isSigned)
1892 *value2 = (uint64)op2->__anon1.i64;
1893 else if(op2->kind == 23)
1894 *value2 = op2->__anon1.ui64;
1895 else if(op2->kind == 22 && op2->type->isSigned)
1896 *value2 = (uint64)op2->__anon1.i64;
1897 else if(op2->kind == 22)
1898 *value2 = op2->__anon1.ui64;
1899 else if(op2->kind == 2 && op2->type->isSigned)
1900 *value2 = (uint64)op2->__anon1.s;
1901 else if(op2->kind == 2)
1902 *value2 = (uint64)op2->__anon1.us;
1903 else if(op2->kind == 1 && op2->type->isSigned)
1904 *value2 = (uint64)op2->__anon1.c;
1905 else if(op2->kind == 24 || op2->kind == 1)
1906 *value2 = (uint64)op2->__anon1.uc;
1907 else if(op2->kind == 6)
1908 *value2 = (uint64)op2->__anon1.f;
1909 else if(op2->kind == 7)
1910 *value2 = (uint64)op2->__anon1.d;
1911 else if(op2->kind == 13)
1912 *value2 = op2->__anon1.ui64;
1913 else
1914 return 0x0;
1915 return 0x1;
1916 }
1917
1918 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1919 {
1920 struct Operand op2 = GetOperand(exp);
1921
1922 return GetOpUInt64(&op2, value2);
1923 }
1924
1925 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1926 {
1927 if(op2->kind == 3 && op2->type->isSigned)
1928 *value2 = (intptr_t)op2->__anon1.i;
1929 else if(op2->kind == 3)
1930 *value2 = (intptr_t)op2->__anon1.ui;
1931 else if(op2->kind == 4 && op2->type->isSigned)
1932 *value2 = (intptr_t)op2->__anon1.i64;
1933 else if(op2->kind == 4)
1934 *value2 = (intptr_t)op2->__anon1.ui64;
1935 else if(op2->kind == 23 && op2->type->isSigned)
1936 *value2 = (intptr_t)op2->__anon1.i64;
1937 else if(op2->kind == 23)
1938 *value2 = (intptr_t)op2->__anon1.ui64;
1939 else if(op2->kind == 22 && op2->type->isSigned)
1940 *value2 = (intptr_t)op2->__anon1.i64;
1941 else if(op2->kind == 22)
1942 *value2 = (intptr_t)op2->__anon1.ui64;
1943 else if(op2->kind == 2 && op2->type->isSigned)
1944 *value2 = (intptr_t)op2->__anon1.s;
1945 else if(op2->kind == 2)
1946 *value2 = (intptr_t)op2->__anon1.us;
1947 else if(op2->kind == 1 && op2->type->isSigned)
1948 *value2 = (intptr_t)op2->__anon1.c;
1949 else if(op2->kind == 24 || op2->kind == 1)
1950 *value2 = (intptr_t)op2->__anon1.uc;
1951 else if(op2->kind == 6)
1952 *value2 = (intptr_t)op2->__anon1.f;
1953 else if(op2->kind == 7)
1954 *value2 = (intptr_t)op2->__anon1.d;
1955 else if(op2->kind == 13)
1956 *value2 = (intptr_t)op2->__anon1.ui64;
1957 else
1958 return 0x0;
1959 return 0x1;
1960 }
1961
1962 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1963 {
1964 struct Operand op2 = GetOperand(exp);
1965
1966 return GetOpIntPtr(&op2, value2);
1967 }
1968
1969 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1970 {
1971 if(op2->kind == 3 && op2->type->isSigned)
1972 *value2 = (uintptr_t)op2->__anon1.i;
1973 else if(op2->kind == 3)
1974 *value2 = (uintptr_t)op2->__anon1.ui;
1975 else if(op2->kind == 4 && op2->type->isSigned)
1976 *value2 = (uintptr_t)op2->__anon1.i64;
1977 else if(op2->kind == 4)
1978 *value2 = (uintptr_t)op2->__anon1.ui64;
1979 else if(op2->kind == 23 && op2->type->isSigned)
1980 *value2 = (uintptr_t)op2->__anon1.i64;
1981 else if(op2->kind == 23)
1982 *value2 = (uintptr_t)op2->__anon1.ui64;
1983 else if(op2->kind == 22 && op2->type->isSigned)
1984 *value2 = (uintptr_t)op2->__anon1.i64;
1985 else if(op2->kind == 22)
1986 *value2 = (uintptr_t)op2->__anon1.ui64;
1987 else if(op2->kind == 2 && op2->type->isSigned)
1988 *value2 = (uintptr_t)op2->__anon1.s;
1989 else if(op2->kind == 2)
1990 *value2 = (uintptr_t)op2->__anon1.us;
1991 else if(op2->kind == 1 && op2->type->isSigned)
1992 *value2 = (uintptr_t)op2->__anon1.c;
1993 else if(op2->kind == 24 || op2->kind == 1)
1994 *value2 = (uintptr_t)op2->__anon1.uc;
1995 else if(op2->kind == 6)
1996 *value2 = (uintptr_t)op2->__anon1.f;
1997 else if(op2->kind == 7)
1998 *value2 = (uintptr_t)op2->__anon1.d;
1999 else if(op2->kind == 13)
2000 *value2 = (uintptr_t)op2->__anon1.ui64;
2001 else
2002 return 0x0;
2003 return 0x1;
2004 }
2005
2006 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2007 {
2008 struct Operand op2 = GetOperand(exp);
2009
2010 return GetOpUIntPtr(&op2, value2);
2011 }
2012
2013 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2014 {
2015 if(op2->kind == 3 && op2->type->isSigned)
2016 *value2 = (ssize_t)op2->__anon1.i;
2017 else if(op2->kind == 3)
2018 *value2 = (ssize_t)op2->__anon1.ui;
2019 else if(op2->kind == 4 && op2->type->isSigned)
2020 *value2 = (ssize_t)op2->__anon1.i64;
2021 else if(op2->kind == 4)
2022 *value2 = (ssize_t)op2->__anon1.ui64;
2023 else if(op2->kind == 23 && op2->type->isSigned)
2024 *value2 = (ssize_t)op2->__anon1.i64;
2025 else if(op2->kind == 23)
2026 *value2 = (ssize_t)op2->__anon1.ui64;
2027 else if(op2->kind == 22 && op2->type->isSigned)
2028 *value2 = (ssize_t)op2->__anon1.i64;
2029 else if(op2->kind == 22)
2030 *value2 = (ssize_t)op2->__anon1.ui64;
2031 else if(op2->kind == 2 && op2->type->isSigned)
2032 *value2 = (ssize_t)op2->__anon1.s;
2033 else if(op2->kind == 2)
2034 *value2 = (ssize_t)op2->__anon1.us;
2035 else if(op2->kind == 1 && op2->type->isSigned)
2036 *value2 = (ssize_t)op2->__anon1.c;
2037 else if(op2->kind == 24 || op2->kind == 1)
2038 *value2 = (ssize_t)op2->__anon1.uc;
2039 else if(op2->kind == 6)
2040 *value2 = (ssize_t)op2->__anon1.f;
2041 else if(op2->kind == 7)
2042 *value2 = (ssize_t)op2->__anon1.d;
2043 else if(op2->kind == 13)
2044 *value2 = (ssize_t)op2->__anon1.ui64;
2045 else
2046 return 0x0;
2047 return 0x1;
2048 }
2049
2050 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2051 {
2052 struct Operand op2 = GetOperand(exp);
2053
2054 return GetOpIntSize(&op2, value2);
2055 }
2056
2057 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2058 {
2059 if(op2->kind == 3 && op2->type->isSigned)
2060 *value2 = (size_t)op2->__anon1.i;
2061 else if(op2->kind == 3)
2062 *value2 = (size_t)op2->__anon1.ui;
2063 else if(op2->kind == 4 && op2->type->isSigned)
2064 *value2 = (size_t)op2->__anon1.i64;
2065 else if(op2->kind == 4)
2066 *value2 = (size_t)op2->__anon1.ui64;
2067 else if(op2->kind == 23 && op2->type->isSigned)
2068 *value2 = (size_t)op2->__anon1.i64;
2069 else if(op2->kind == 23)
2070 *value2 = (size_t)op2->__anon1.ui64;
2071 else if(op2->kind == 22 && op2->type->isSigned)
2072 *value2 = (size_t)op2->__anon1.i64;
2073 else if(op2->kind == 22)
2074 *value2 = (size_t)op2->__anon1.ui64;
2075 else if(op2->kind == 2 && op2->type->isSigned)
2076 *value2 = (size_t)op2->__anon1.s;
2077 else if(op2->kind == 2)
2078 *value2 = (size_t)op2->__anon1.us;
2079 else if(op2->kind == 1 && op2->type->isSigned)
2080 *value2 = (size_t)op2->__anon1.c;
2081 else if(op2->kind == 24 || op2->kind == 1)
2082 *value2 = (size_t)op2->__anon1.uc;
2083 else if(op2->kind == 6)
2084 *value2 = (size_t)op2->__anon1.f;
2085 else if(op2->kind == 7)
2086 *value2 = (size_t)op2->__anon1.d;
2087 else if(op2->kind == 13)
2088 *value2 = (size_t)op2->__anon1.ui64;
2089 else
2090 return 0x0;
2091 return 0x1;
2092 }
2093
2094 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2095 {
2096 struct Operand op2 = GetOperand(exp);
2097
2098 return GetOpUIntSize(&op2, value2);
2099 }
2100
2101 unsigned int GetOpShort(struct Operand * op2, short * value2)
2102 {
2103 if(op2->kind == 3 && op2->type->isSigned)
2104 *value2 = (short)op2->__anon1.i;
2105 else if(op2->kind == 3)
2106 *value2 = (short)op2->__anon1.ui;
2107 else if(op2->kind == 4 && op2->type->isSigned)
2108 *value2 = (short)op2->__anon1.i64;
2109 else if(op2->kind == 4)
2110 *value2 = (short)op2->__anon1.ui64;
2111 else if(op2->kind == 23 && op2->type->isSigned)
2112 *value2 = (short)op2->__anon1.i64;
2113 else if(op2->kind == 23)
2114 *value2 = (short)op2->__anon1.ui64;
2115 else if(op2->kind == 22 && op2->type->isSigned)
2116 *value2 = (short)op2->__anon1.i64;
2117 else if(op2->kind == 22)
2118 *value2 = (short)op2->__anon1.ui64;
2119 else if(op2->kind == 2 && op2->type->isSigned)
2120 *value2 = op2->__anon1.s;
2121 else if(op2->kind == 2)
2122 *value2 = (short)op2->__anon1.us;
2123 else if(op2->kind == 1 && op2->type->isSigned)
2124 *value2 = (short)op2->__anon1.c;
2125 else if(op2->kind == 24 || op2->kind == 1)
2126 *value2 = (short)op2->__anon1.uc;
2127 else if(op2->kind == 6)
2128 *value2 = (short)op2->__anon1.f;
2129 else if(op2->kind == 7)
2130 *value2 = (short)op2->__anon1.d;
2131 else if(op2->kind == 13)
2132 *value2 = (short)op2->__anon1.ui64;
2133 else
2134 return 0x0;
2135 return 0x1;
2136 }
2137
2138 unsigned int GetShort(struct Expression * exp, short * value2)
2139 {
2140 struct Operand op2 = GetOperand(exp);
2141
2142 return GetOpShort(&op2, value2);
2143 }
2144
2145 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2146 {
2147 if(op2->kind == 3 && op2->type->isSigned)
2148 *value2 = (unsigned short)op2->__anon1.i;
2149 else if(op2->kind == 3)
2150 *value2 = (unsigned short)op2->__anon1.ui;
2151 else if(op2->kind == 4 && op2->type->isSigned)
2152 *value2 = (unsigned short)op2->__anon1.i64;
2153 else if(op2->kind == 4)
2154 *value2 = (unsigned short)op2->__anon1.ui64;
2155 else if(op2->kind == 23 && op2->type->isSigned)
2156 *value2 = (unsigned short)op2->__anon1.i64;
2157 else if(op2->kind == 23)
2158 *value2 = (unsigned short)op2->__anon1.ui64;
2159 else if(op2->kind == 22 && op2->type->isSigned)
2160 *value2 = (unsigned short)op2->__anon1.i64;
2161 else if(op2->kind == 22)
2162 *value2 = (unsigned short)op2->__anon1.ui64;
2163 else if(op2->kind == 2 && op2->type->isSigned)
2164 *value2 = (unsigned short)op2->__anon1.s;
2165 else if(op2->kind == 2)
2166 *value2 = op2->__anon1.us;
2167 else if(op2->kind == 1 && op2->type->isSigned)
2168 *value2 = (unsigned short)op2->__anon1.c;
2169 else if(op2->kind == 24 || op2->kind == 1)
2170 *value2 = (unsigned short)op2->__anon1.uc;
2171 else if(op2->kind == 6)
2172 *value2 = (unsigned short)op2->__anon1.f;
2173 else if(op2->kind == 7)
2174 *value2 = (unsigned short)op2->__anon1.d;
2175 else if(op2->kind == 13)
2176 *value2 = (unsigned short)op2->__anon1.ui64;
2177 else
2178 return 0x0;
2179 return 0x1;
2180 }
2181
2182 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2183 {
2184 struct Operand op2 = GetOperand(exp);
2185
2186 return GetOpUShort(&op2, value2);
2187 }
2188
2189 unsigned int GetOpChar(struct Operand * op2, char * value2)
2190 {
2191 if(op2->kind == 3 && op2->type->isSigned)
2192 *value2 = (char)op2->__anon1.i;
2193 else if(op2->kind == 3)
2194 *value2 = (char)op2->__anon1.ui;
2195 else if(op2->kind == 4 && op2->type->isSigned)
2196 *value2 = (char)op2->__anon1.i64;
2197 else if(op2->kind == 4)
2198 *value2 = (char)op2->__anon1.ui64;
2199 else if(op2->kind == 23 && op2->type->isSigned)
2200 *value2 = (char)op2->__anon1.i64;
2201 else if(op2->kind == 23)
2202 *value2 = (char)op2->__anon1.ui64;
2203 else if(op2->kind == 22 && op2->type->isSigned)
2204 *value2 = (char)op2->__anon1.i64;
2205 else if(op2->kind == 22)
2206 *value2 = (char)op2->__anon1.ui64;
2207 else if(op2->kind == 2 && op2->type->isSigned)
2208 *value2 = (char)op2->__anon1.s;
2209 else if(op2->kind == 2)
2210 *value2 = (char)op2->__anon1.us;
2211 else if(op2->kind == 1 && op2->type->isSigned)
2212 *value2 = op2->__anon1.c;
2213 else if(op2->kind == 24 || op2->kind == 1)
2214 *value2 = (char)op2->__anon1.uc;
2215 else if(op2->kind == 6)
2216 *value2 = (char)op2->__anon1.f;
2217 else if(op2->kind == 7)
2218 *value2 = (char)op2->__anon1.d;
2219 else if(op2->kind == 13)
2220 *value2 = (char)op2->__anon1.ui64;
2221 else
2222 return 0x0;
2223 return 0x1;
2224 }
2225
2226 unsigned int GetChar(struct Expression * exp, char * value2)
2227 {
2228 struct Operand op2 = GetOperand(exp);
2229
2230 return GetOpChar(&op2, value2);
2231 }
2232
2233 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2234 {
2235 if(op2->kind == 3 && op2->type->isSigned)
2236 *value2 = (unsigned char)op2->__anon1.i;
2237 else if(op2->kind == 3)
2238 *value2 = (unsigned char)op2->__anon1.ui;
2239 else if(op2->kind == 4 && op2->type->isSigned)
2240 *value2 = (unsigned char)op2->__anon1.i64;
2241 else if(op2->kind == 4)
2242 *value2 = (unsigned char)op2->__anon1.ui64;
2243 else if(op2->kind == 23 && op2->type->isSigned)
2244 *value2 = (unsigned char)op2->__anon1.i64;
2245 else if(op2->kind == 23)
2246 *value2 = (unsigned char)op2->__anon1.ui64;
2247 else if(op2->kind == 22 && op2->type->isSigned)
2248 *value2 = (unsigned char)op2->__anon1.i64;
2249 else if(op2->kind == 22)
2250 *value2 = (unsigned char)op2->__anon1.ui64;
2251 else if(op2->kind == 2 && op2->type->isSigned)
2252 *value2 = (unsigned char)op2->__anon1.s;
2253 else if(op2->kind == 2)
2254 *value2 = (unsigned char)op2->__anon1.us;
2255 else if(op2->kind == 1 && op2->type->isSigned)
2256 *value2 = (unsigned char)op2->__anon1.c;
2257 else if(op2->kind == 24 || op2->kind == 1)
2258 *value2 = op2->__anon1.uc;
2259 else if(op2->kind == 6)
2260 *value2 = (unsigned char)op2->__anon1.f;
2261 else if(op2->kind == 7)
2262 *value2 = (unsigned char)op2->__anon1.d;
2263 else if(op2->kind == 13)
2264 *value2 = (unsigned char)op2->__anon1.ui64;
2265 else
2266 return 0x0;
2267 return 0x1;
2268 }
2269
2270 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2271 {
2272 struct Operand op2 = GetOperand(exp);
2273
2274 return GetOpUChar(&op2, value2);
2275 }
2276
2277 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2278 {
2279 if(op2->kind == 3 && op2->type->isSigned)
2280 *value2 = (float)(float)op2->__anon1.i;
2281 else if(op2->kind == 3)
2282 *value2 = (float)(float)op2->__anon1.ui;
2283 else if(op2->kind == 4 && op2->type->isSigned)
2284 *value2 = (float)(float)op2->__anon1.i64;
2285 else if(op2->kind == 4)
2286 *value2 = (float)(float)op2->__anon1.ui64;
2287 else if(op2->kind == 23 && op2->type->isSigned)
2288 *value2 = (float)(float)op2->__anon1.i64;
2289 else if(op2->kind == 23)
2290 *value2 = (float)(float)op2->__anon1.ui64;
2291 else if(op2->kind == 22 && op2->type->isSigned)
2292 *value2 = (float)(float)op2->__anon1.i64;
2293 else if(op2->kind == 22)
2294 *value2 = (float)(float)op2->__anon1.ui64;
2295 else if(op2->kind == 2 && op2->type->isSigned)
2296 *value2 = (float)(float)op2->__anon1.s;
2297 else if(op2->kind == 2)
2298 *value2 = (float)(float)op2->__anon1.us;
2299 else if(op2->kind == 1 && op2->type->isSigned)
2300 *value2 = (float)(float)op2->__anon1.c;
2301 else if(op2->kind == 24 || op2->kind == 1)
2302 *value2 = (float)(float)op2->__anon1.uc;
2303 else if(op2->kind == 6)
2304 *value2 = (float)op2->__anon1.f;
2305 else if(op2->kind == 7)
2306 *value2 = (float)op2->__anon1.d;
2307 else if(op2->kind == 13)
2308 *value2 = (float)(float)op2->__anon1.ui64;
2309 else
2310 return 0x0;
2311 return 0x1;
2312 }
2313
2314 unsigned int GetFloat(struct Expression * exp, float * value2)
2315 {
2316 struct Operand op2 = GetOperand(exp);
2317
2318 return GetOpFloat(&op2, value2);
2319 }
2320
2321 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2322 {
2323 if(op2->kind == 3 && op2->type->isSigned)
2324 *value2 = (double)(double)op2->__anon1.i;
2325 else if(op2->kind == 3)
2326 *value2 = (double)(double)op2->__anon1.ui;
2327 else if(op2->kind == 4 && op2->type->isSigned)
2328 *value2 = (double)(double)op2->__anon1.i64;
2329 else if(op2->kind == 4)
2330 *value2 = (double)(double)op2->__anon1.ui64;
2331 else if(op2->kind == 23 && op2->type->isSigned)
2332 *value2 = (double)(double)op2->__anon1.i64;
2333 else if(op2->kind == 23)
2334 *value2 = (double)(double)op2->__anon1.ui64;
2335 else if(op2->kind == 22 && op2->type->isSigned)
2336 *value2 = (double)(double)op2->__anon1.i64;
2337 else if(op2->kind == 22)
2338 *value2 = (double)(double)op2->__anon1.ui64;
2339 else if(op2->kind == 2 && op2->type->isSigned)
2340 *value2 = (double)(double)op2->__anon1.s;
2341 else if(op2->kind == 2)
2342 *value2 = (double)(double)op2->__anon1.us;
2343 else if(op2->kind == 1 && op2->type->isSigned)
2344 *value2 = (double)(double)op2->__anon1.c;
2345 else if(op2->kind == 24 || op2->kind == 1)
2346 *value2 = (double)(double)op2->__anon1.uc;
2347 else if(op2->kind == 6)
2348 *value2 = (double)op2->__anon1.f;
2349 else if(op2->kind == 7)
2350 *value2 = (double)op2->__anon1.d;
2351 else if(op2->kind == 13)
2352 *value2 = (double)(double)op2->__anon1.ui64;
2353 else
2354 return 0x0;
2355 return 0x1;
2356 }
2357
2358 unsigned int GetDouble(struct Expression * exp, double * value2)
2359 {
2360 struct Operand op2 = GetOperand(exp);
2361
2362 return GetOpDouble(&op2, value2);
2363 }
2364
2365 void ComputeExpression(struct Expression * exp);
2366
2367 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2368
2369 extern int targetBits;
2370
2371 int ComputeTypeSize(struct Type * type);
2372
2373 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2374
2375 struct __ecereNameSpace__ecere__com__BitMember
2376 {
2377 struct __ecereNameSpace__ecere__com__BitMember * prev;
2378 struct __ecereNameSpace__ecere__com__BitMember * next;
2379 const char *  name;
2380 unsigned int isProperty;
2381 int memberAccess;
2382 int id;
2383 struct __ecereNameSpace__ecere__com__Class * _class;
2384 const char *  dataTypeString;
2385 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2386 struct Type * dataType;
2387 int type;
2388 int size;
2389 int pos;
2390 uint64 mask;
2391 } __attribute__ ((gcc_struct));
2392
2393 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2394
2395 struct __ecereNameSpace__ecere__sys__OldLink
2396 {
2397 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2398 struct __ecereNameSpace__ecere__sys__OldLink * next;
2399 void *  data;
2400 } __attribute__ ((gcc_struct));
2401
2402 void FinishTemplatesContext(struct Context * context);
2403
2404 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2405 {
2406 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2407 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2408
2409 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))
2410 {
2411 int unionMemberOffset = 0;
2412 int bitFields = 0;
2413
2414 if(member)
2415 {
2416 member->memberOffset = 0;
2417 if(targetBits < sizeof(void *) * 8)
2418 member->structAlignment = 0;
2419 }
2420 else if(targetBits < sizeof(void *) * 8)
2421 _class->structAlignment = 0;
2422 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2423 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2424 if(!member && _class->destructionWatchOffset)
2425 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2426 {
2427 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2428
2429 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2430 {
2431 if(!dataMember->isProperty)
2432 {
2433 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2434 {
2435 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2436 }
2437 }
2438 }
2439 }
2440 {
2441 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2442
2443 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2444 {
2445 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2446 {
2447 if(!isMember && _class->type == 2 && dataMember->dataType)
2448 {
2449 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2450 uint64 mask = 0;
2451 int d;
2452
2453 ComputeTypeSize(dataMember->dataType);
2454 if(bitMember->pos == -1)
2455 bitMember->pos = _class->memberOffset;
2456 if(!bitMember->size)
2457 bitMember->size = dataMember->dataType->size * 8;
2458 _class->memberOffset = bitMember->pos + bitMember->size;
2459 for(d = 0; d < bitMember->size; d++)
2460 {
2461 if(d)
2462 mask <<= 1;
2463 mask |= 1;
2464 }
2465 bitMember->mask = mask << bitMember->pos;
2466 }
2467 else if(dataMember->type == 0 && dataMember->dataType)
2468 {
2469 int size;
2470 int alignment = 0;
2471
2472 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)))
2473 ComputeTypeSize(dataMember->dataType);
2474 if(dataMember->dataType->bitFieldCount)
2475 {
2476 bitFields += dataMember->dataType->bitFieldCount;
2477 size = 0;
2478 }
2479 else
2480 {
2481 if(bitFields)
2482 {
2483 int size = (bitFields + 7) / 8;
2484
2485 if(isMember)
2486 {
2487 int __simpleStruct0;
2488
2489 if(alignment)
2490 {
2491 int __simpleStruct0;
2492
2493 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2494 if(member->memberOffset % alignment)
2495 member->memberOffset += alignment - (member->memberOffset % alignment);
2496 }
2497 dataMember->offset = member->memberOffset;
2498 if(member->type == 1)
2499 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2500 else
2501 {
2502 member->memberOffset += size;
2503 }
2504 }
2505 else
2506 {
2507 if(alignment)
2508 {
2509 int __simpleStruct0;
2510
2511 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2512 if(_class->memberOffset % alignment)
2513 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2514 }
2515 dataMember->offset = _class->memberOffset;
2516 _class->memberOffset += size;
2517 }
2518 bitFields = 0;
2519 }
2520 size = dataMember->dataType->size;
2521 alignment = dataMember->dataType->alignment;
2522 }
2523 if(isMember)
2524 {
2525 int __simpleStruct0;
2526
2527 if(alignment)
2528 {
2529 int __simpleStruct0;
2530
2531 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2532 if(member->memberOffset % alignment)
2533 member->memberOffset += alignment - (member->memberOffset % alignment);
2534 }
2535 dataMember->offset = member->memberOffset;
2536 if(member->type == 1)
2537 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2538 else
2539 {
2540 member->memberOffset += size;
2541 }
2542 }
2543 else
2544 {
2545 if(alignment)
2546 {
2547 int __simpleStruct0;
2548
2549 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2550 if(_class->memberOffset % alignment)
2551 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2552 }
2553 dataMember->offset = _class->memberOffset;
2554 _class->memberOffset += size;
2555 }
2556 }
2557 else
2558 {
2559 int alignment;
2560
2561 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2562 alignment = dataMember->structAlignment;
2563 if(isMember)
2564 {
2565 int __simpleStruct0;
2566
2567 if(alignment)
2568 {
2569 int __simpleStruct0;
2570
2571 if(member->memberOffset % alignment)
2572 member->memberOffset += alignment - (member->memberOffset % alignment);
2573 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2574 }
2575 dataMember->offset = member->memberOffset;
2576 if(member->type == 1)
2577 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2578 else
2579 member->memberOffset += dataMember->memberOffset;
2580 }
2581 else
2582 {
2583 if(alignment)
2584 {
2585 int __simpleStruct0;
2586
2587 if(_class->memberOffset % alignment)
2588 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2589 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2590 }
2591 dataMember->offset = _class->memberOffset;
2592 _class->memberOffset += dataMember->memberOffset;
2593 }
2594 }
2595 }
2596 }
2597 if(bitFields)
2598 {
2599 int alignment = 0;
2600 int size = (bitFields + 7) / 8;
2601
2602 if(isMember)
2603 {
2604 int __simpleStruct0;
2605
2606 if(alignment)
2607 {
2608 int __simpleStruct0;
2609
2610 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2611 if(member->memberOffset % alignment)
2612 member->memberOffset += alignment - (member->memberOffset % alignment);
2613 }
2614 if(member->type == 1)
2615 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2616 else
2617 {
2618 member->memberOffset += size;
2619 }
2620 }
2621 else
2622 {
2623 if(alignment)
2624 {
2625 int __simpleStruct0;
2626
2627 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2628 if(_class->memberOffset % alignment)
2629 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2630 }
2631 _class->memberOffset += size;
2632 }
2633 bitFields = 0;
2634 }
2635 }
2636 if(member && member->type == 1)
2637 {
2638 member->memberOffset = unionMemberOffset;
2639 }
2640 if(!isMember)
2641 {
2642 if(_class->type != 2)
2643 {
2644 int extra = 0;
2645
2646 if(_class->structAlignment)
2647 {
2648 if(_class->memberOffset % _class->structAlignment)
2649 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2650 }
2651 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2652 if(!member)
2653 {
2654 struct __ecereNameSpace__ecere__com__Property * prop;
2655
2656 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2657 {
2658 if(prop->isProperty && prop->isWatchable)
2659 {
2660 prop->watcherOffset = _class->structSize;
2661 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2662 }
2663 }
2664 }
2665 {
2666 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2667
2668 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2669 {
2670 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2671
2672 if(deriv->computeSize)
2673 {
2674 deriv->offset = _class->structSize;
2675 deriv->memberOffset = 0;
2676 deriv->structSize = deriv->offset;
2677 ComputeClassMembers(deriv, 0x0);
2678 }
2679 }
2680 }
2681 }
2682 }
2683 }
2684 if(context)
2685 FinishTemplatesContext(context);
2686 }
2687
2688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2689
2690 struct __ecereNameSpace__ecere__com__NameSpace
2691 {
2692 const char *  name;
2693 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2694 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2695 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2696 int depth;
2697 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2698 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2699 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2700 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2701 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2702 } __attribute__ ((gcc_struct));
2703
2704 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2705
2706 struct __ecereNameSpace__ecere__com__Module
2707 {
2708 struct __ecereNameSpace__ecere__com__Instance * application;
2709 struct __ecereNameSpace__ecere__sys__OldList classes;
2710 struct __ecereNameSpace__ecere__sys__OldList defines;
2711 struct __ecereNameSpace__ecere__sys__OldList functions;
2712 struct __ecereNameSpace__ecere__sys__OldList modules;
2713 struct __ecereNameSpace__ecere__com__Instance * prev;
2714 struct __ecereNameSpace__ecere__com__Instance * next;
2715 const char *  name;
2716 void *  library;
2717 void *  Unload;
2718 int importType;
2719 int origImportType;
2720 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2721 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2722 } __attribute__ ((gcc_struct));
2723
2724 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2725 {
2726 struct __ecereNameSpace__ecere__com__Class * _class;
2727 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2728
2729 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2730 ComputeModuleClasses(subModule->data);
2731 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2732 ComputeClassMembers(_class, 0x0);
2733 }
2734
2735 extern unsigned int inCompiler;
2736
2737 extern void Compiler_Error(const char *  format, ...);
2738
2739 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2740
2741 int ComputeTypeSize(struct Type * type)
2742 {
2743 unsigned int size = type ? type->size : 0;
2744
2745 if(!size && type && !type->computing)
2746 {
2747 type->computing = 0x1;
2748 switch(type->kind)
2749 {
2750 case 24:
2751 type->alignment = size = sizeof(char);
2752 break;
2753 case 1:
2754 type->alignment = size = sizeof(char);
2755 break;
2756 case 3:
2757 type->alignment = size = sizeof(int);
2758 break;
2759 case 4:
2760 type->alignment = size = sizeof(long long);
2761 break;
2762 case 22:
2763 type->alignment = size = targetBits / 8;
2764 break;
2765 case 23:
2766 type->alignment = size = targetBits / 8;
2767 break;
2768 case 5:
2769 type->alignment = size = sizeof(long);
2770 break;
2771 case 2:
2772 type->alignment = size = sizeof(short);
2773 break;
2774 case 6:
2775 type->alignment = size = sizeof(float);
2776 break;
2777 case 7:
2778 type->alignment = size = sizeof(double);
2779 break;
2780 case 8:
2781 {
2782 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2783
2784 if(_class && _class->type == 1)
2785 {
2786 ComputeClassMembers(_class, 0x0);
2787 type->alignment = _class->structAlignment;
2788 size = _class->structSize;
2789 if(type->alignment && size % type->alignment)
2790 size += type->alignment - (size % type->alignment);
2791 }
2792 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2793 {
2794 if(!_class->dataType)
2795 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2796 size = type->alignment = ComputeTypeSize(_class->dataType);
2797 }
2798 else
2799 size = type->alignment = targetBits / 8;
2800 break;
2801 }
2802 case 13:
2803 case 19:
2804 size = type->alignment = targetBits / 8;
2805 break;
2806 case 12:
2807 if(type->__anon1.__anon4.arraySizeExp)
2808 {
2809 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2810 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2811 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)))
2812 {
2813 struct Location oldLoc = yylloc;
2814 char expression[10240];
2815
2816 expression[0] = '\0';
2817 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2818 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2819 if(inCompiler)
2820 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2821 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2822 yylloc = oldLoc;
2823 }
2824 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2825 }
2826 else if(type->__anon1.__anon4.enumClass)
2827 {
2828 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2829 {
2830 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2831 }
2832 else
2833 type->__anon1.__anon4.arraySize = 0;
2834 }
2835 else
2836 {
2837 type->__anon1.__anon4.arraySize = 0;
2838 }
2839 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2840 if(type->__anon1.type)
2841 type->alignment = type->__anon1.type->alignment;
2842 break;
2843 case 9:
2844 {
2845 struct Type * member;
2846
2847 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2848 {
2849 int __simpleStruct0, __simpleStruct1;
2850 unsigned int addSize = ComputeTypeSize(member);
2851
2852 member->offset = size;
2853 if(member->alignment && size % member->alignment)
2854 member->offset += member->alignment - (size % member->alignment);
2855 size = member->offset;
2856 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2857 size += addSize;
2858 }
2859 if(type->alignment && size % type->alignment)
2860 size += type->alignment - (size % type->alignment);
2861 break;
2862 }
2863 case 10:
2864 {
2865 struct Type * member;
2866
2867 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2868 {
2869 int __simpleStruct0, __simpleStruct1;
2870 unsigned int addSize = ComputeTypeSize(member);
2871
2872 member->offset = size;
2873 if(member->alignment && size % member->alignment)
2874 member->offset += member->alignment - (size % member->alignment);
2875 size = member->offset;
2876 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2877 size = ((size > addSize) ? size : addSize);
2878 }
2879 if(type->alignment && size % type->alignment)
2880 size += type->alignment - (size % type->alignment);
2881 break;
2882 }
2883 case 20:
2884 {
2885 struct TemplateParameter * param = type->__anon1.templateParameter;
2886 struct Type * baseType = ProcessTemplateParameterType(param);
2887
2888 if(baseType)
2889 {
2890 size = ComputeTypeSize(baseType);
2891 type->alignment = baseType->alignment;
2892 }
2893 else
2894 type->alignment = size = sizeof(uint64);
2895 break;
2896 }
2897 case 15:
2898 {
2899 type->alignment = size = sizeof(enum
2900 {
2901 test
2902 });
2903 break;
2904 }
2905 case 21:
2906 {
2907 type->alignment = size = targetBits / 8;
2908 break;
2909 }
2910 }
2911 type->size = size;
2912 type->computing = 0x0;
2913 }
2914 return size;
2915 }
2916
2917 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2918
2919 extern struct Identifier * MkIdentifier(const char *  string);
2920
2921 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2922
2923 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2924
2925 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2926
2927 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2928
2929 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2930
2931 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2932
2933 extern void FreeType(struct Type * type);
2934
2935 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2936
2937 extern struct Specifier * MkSpecifier(int specifier);
2938
2939 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2940
2941 extern struct Expression * MkExpConstant(const char *  string);
2942
2943 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)
2944 {
2945 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2946 unsigned int totalSize = 0;
2947 unsigned int maxSize = 0;
2948 int alignment;
2949 unsigned int size;
2950 struct __ecereNameSpace__ecere__com__DataMember * member;
2951 int anonID = 1;
2952 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2953
2954 if(addedPadding)
2955 *addedPadding = 0x0;
2956 if(!isMember && _class->base)
2957 {
2958 maxSize = _class->structSize;
2959 {
2960 if(_class->type == 1 || _class->type == 5)
2961 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2962 else
2963 {
2964 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2965
2966 if(maxSize > baseSize)
2967 maxSize -= baseSize;
2968 else
2969 maxSize = 0;
2970 }
2971 }
2972 }
2973 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2974 {
2975 if(!member->isProperty)
2976 {
2977 switch(member->type)
2978 {
2979 case 0:
2980 {
2981 if(member->dataTypeString)
2982 {
2983 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2984 struct Declarator * decl;
2985
2986 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2987 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2988 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2989 if(!member->dataType)
2990 member->dataType = ProcessType(specs, decl);
2991 ReplaceThisClassSpecifiers(specs, topClass);
2992 {
2993 struct Type * type = ProcessType(specs, decl);
2994
2995 DeclareType(member->dataType, 0x0, 0x0);
2996 FreeType(type);
2997 }
2998 ComputeTypeSize(member->dataType);
2999 size = member->dataType->size;
3000 alignment = member->dataType->alignment;
3001 if(alignment)
3002 {
3003 if(totalSize % alignment)
3004 totalSize += alignment - (totalSize % alignment);
3005 }
3006 totalSize += size;
3007 }
3008 break;
3009 }
3010 case 1:
3011 case 2:
3012 {
3013 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3014 char id[100];
3015
3016 sprintf(id, "__anon%d", anonID++);
3017 size = 0;
3018 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3019 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3020 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3021 alignment = member->structAlignment;
3022 if(alignment)
3023 {
3024 if(totalSize % alignment)
3025 totalSize += alignment - (totalSize % alignment);
3026 }
3027 totalSize += size;
3028 break;
3029 }
3030 }
3031 }
3032 }
3033 if(retSize)
3034 {
3035 unsigned int __simpleStruct0;
3036
3037 if(topMember && topMember->type == 1)
3038 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3039 else
3040 *retSize += totalSize;
3041 }
3042 else if(totalSize < maxSize && _class->type != 1000)
3043 {
3044 int autoPadding = 0;
3045
3046 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3047 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3048 if(totalSize + autoPadding < maxSize)
3049 {
3050 char sizeString[50];
3051
3052 sprintf(sizeString, "%d", maxSize - totalSize);
3053 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3054 if(addedPadding)
3055 *addedPadding = 0x1;
3056 }
3057 }
3058 if(context)
3059 FinishTemplatesContext(context);
3060 return topMember ? topMember->memberID : _class->memberID;
3061 }
3062
3063 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3064 {
3065 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3066 struct __ecereNameSpace__ecere__com__DataMember * member;
3067 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3068
3069 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3070 DeclareMembers(_class->base, 0x0);
3071 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3072 {
3073 if(!member->isProperty)
3074 {
3075 switch(member->type)
3076 {
3077 case 0:
3078 {
3079 if(!member->dataType && member->dataTypeString)
3080 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3081 if(member->dataType)
3082 DeclareType(member->dataType, 0x0, 0x0);
3083 break;
3084 }
3085 case 1:
3086 case 2:
3087 {
3088 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3089 break;
3090 }
3091 }
3092 }
3093 }
3094 if(context)
3095 FinishTemplatesContext(context);
3096 return topMember ? topMember->memberID : _class->memberID;
3097 }
3098
3099 extern struct Identifier * GetDeclId(struct Declarator * decl);
3100
3101 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3102 {
3103 struct ClassDef * def;
3104 int anonID = 1;
3105
3106 for(def = (*definitions).first; def; def = def->next)
3107 {
3108 if(def->type == 2)
3109 {
3110 struct Declaration * decl = def->__anon1.decl;
3111
3112 if(decl && decl->__anon1.__anon1.specifiers)
3113 {
3114 struct Specifier * spec;
3115 unsigned int isStruct = 0x0;
3116
3117 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3118 {
3119 if(spec->type == 3 || spec->type == 4)
3120 {
3121 if(spec->__anon1.__anon2.definitions)
3122 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3123 isStruct = 0x1;
3124 }
3125 }
3126 if(isStruct)
3127 {
3128 struct Declarator * d = (((void *)0));
3129
3130 if(decl->__anon1.__anon1.declarators)
3131 {
3132 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3133 {
3134 struct Identifier * idDecl = GetDeclId(d);
3135
3136 if(idDecl)
3137 break;
3138 }
3139 }
3140 if(!d)
3141 {
3142 char id[100];
3143
3144 sprintf(id, "__anon%d", anonID++);
3145 if(!decl->__anon1.__anon1.declarators)
3146 decl->__anon1.__anon1.declarators = MkList();
3147 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3148 }
3149 }
3150 }
3151 }
3152 }
3153 }
3154
3155 extern struct Symbol * FindClass(const char *  name);
3156
3157 extern char *  strchr(const char * , int);
3158
3159 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3160
3161 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3162
3163 extern void FreeClassDef(struct ClassDef * def);
3164
3165 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3166
3167 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3168
3169 extern void MangleClassName(char *  className);
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 MangleClassName(className);
3261 DeclareClass(classSym, className);
3262 external->symbol = classSym;
3263 classSym->__anon2.__anon1.pointerExternal = external;
3264 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3265 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3266 }
3267 else
3268 {
3269 char className[1024];
3270
3271 strcpy(className, "__ecereClass_");
3272 FullClassNameCat(className, classSym->string, 0x1);
3273 MangleClassName(className);
3274 classSym->__anon2.__anon1.structExternal = external;
3275 DeclareClass(classSym, className);
3276 external->symbol = classSym;
3277 }
3278 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3279 }
3280 }
3281 classSym->declaring--;
3282 }
3283 else
3284 {
3285 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3286 {
3287 struct Specifier * spec;
3288
3289 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3290 {
3291 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3292 }
3293 }
3294 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3295 {
3296 classSym->declaring++;
3297 {
3298 if(classSym->__anon1.registered)
3299 DeclareMembers(classSym->__anon1.registered, 0x0);
3300 }
3301 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3302 {
3303 if(classSym->__anon2.__anon1.structExternal)
3304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3306 classSym->id = curExternal->symbol->idCode;
3307 classSym->idCode = curExternal->symbol->idCode;
3308 }
3309 classSym->declaring--;
3310 }
3311 }
3312 }
3313
3314 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3315
3316 extern struct ModuleImport * mainModule;
3317
3318 extern struct Specifier * MkSpecifierName(const char *  name);
3319
3320 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3321
3322 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3323
3324 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3325
3326 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3327
3328 extern void FreeDeclarator(struct Declarator * decl);
3329
3330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3331
3332 struct PropertyImport
3333 {
3334 struct PropertyImport * prev;
3335 struct PropertyImport * next;
3336 char *  name;
3337 unsigned int isVirtual;
3338 unsigned int hasSet;
3339 unsigned int hasGet;
3340 } __attribute__ ((gcc_struct));
3341
3342 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3343
3344 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3345 {
3346 struct Symbol * symbol = prop->symbol;
3347
3348 strcpy(setName, "__ecereProp_");
3349 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3350 strcat(setName, "_Set_");
3351 FullClassNameCat(setName, prop->name, 0x1);
3352 MangleClassName(setName);
3353 strcpy(getName, "__ecereProp_");
3354 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3355 strcat(getName, "_Get_");
3356 FullClassNameCat(getName, prop->name, 0x1);
3357 MangleClassName(getName);
3358 if(prop->_class->type == 1)
3359 DeclareStruct(prop->_class->fullName, 0x0);
3360 if(!symbol || curExternal->symbol->idCode < symbol->id)
3361 {
3362 unsigned int imported = 0x0;
3363 unsigned int dllImport = 0x0;
3364
3365 if(!symbol || symbol->_import)
3366 {
3367 if(!symbol)
3368 {
3369 struct Symbol * classSym;
3370
3371 if(!prop->_class->symbol)
3372 prop->_class->symbol = FindClass(prop->_class->fullName);
3373 classSym = prop->_class->symbol;
3374 if(classSym && !classSym->_import)
3375 {
3376 struct ModuleImport * module;
3377
3378 if(prop->_class->module)
3379 module = FindModule(prop->_class->module);
3380 else
3381 module = mainModule;
3382 classSym->_import = __extension__ ({
3383 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3384
3385 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3386 });
3387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3388 }
3389 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3390 symbol->_import = (struct ClassImport *)__extension__ ({
3391 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3392
3393 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3394 });
3395 if(classSym)
3396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3397 }
3398 imported = 0x1;
3399 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)
3400 dllImport = 0x1;
3401 }
3402 if(!symbol->type)
3403 {
3404 struct Context * context = SetupTemplatesContext(prop->_class);
3405
3406 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3407 FinishTemplatesContext(context);
3408 }
3409 if(prop->Get)
3410 {
3411 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3412 {
3413 struct Declaration * decl;
3414 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3415 struct Declarator * d;
3416 struct __ecereNameSpace__ecere__sys__OldList * params;
3417 struct Specifier * spec;
3418 struct External * external;
3419 struct Declarator * typeDecl;
3420 unsigned int simple = 0x0;
3421
3422 specifiers = MkList();
3423 declarators = MkList();
3424 params = MkList();
3425 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3426 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3427 if(dllImport)
3428 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3429 {
3430 struct Context * context = SetupTemplatesContext(prop->_class);
3431
3432 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3433 FinishTemplatesContext(context);
3434 }
3435 for(spec = (*specifiers).first; spec; spec = spec->next)
3436 {
3437 if(spec->type == 1)
3438 {
3439 if((!typeDecl || typeDecl->type == 1))
3440 {
3441 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3442
3443 symbol->_class = classSym->__anon1.registered;
3444 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3445 {
3446 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3447 simple = 0x1;
3448 }
3449 }
3450 }
3451 }
3452 if(!simple)
3453 d = PlugDeclarator(typeDecl, d);
3454 else
3455 {
3456 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3457 specifiers = MkList();
3458 }
3459 d = MkDeclaratorFunction(d, params);
3460 if(dllImport)
3461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3462 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3464 if(simple)
3465 ListAdd(specifiers, MkSpecifier(VOID));
3466 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3467 decl = MkDeclaration(specifiers, declarators);
3468 external = MkExternalDeclaration(decl);
3469 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3470 external->symbol = symbol;
3471 symbol->__anon2.__anon2.externalGet = external;
3472 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3473 if(typeDecl)
3474 FreeDeclarator(typeDecl);
3475 }
3476 else
3477 {
3478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3479 }
3480 }
3481 if(prop->Set)
3482 {
3483 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3484 {
3485 struct Declaration * decl;
3486 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3487 struct Declarator * d;
3488 struct __ecereNameSpace__ecere__sys__OldList * params;
3489 struct Specifier * spec;
3490 struct External * external;
3491 struct Declarator * typeDecl;
3492
3493 declarators = MkList();
3494 params = MkList();
3495 if(!prop->conversion || prop->_class->type == 1)
3496 {
3497 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3498 }
3499 specifiers = MkList();
3500 {
3501 struct Context * context = SetupTemplatesContext(prop->_class);
3502
3503 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3504 FinishTemplatesContext(context);
3505 }
3506 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3507 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3508 ListAdd(params, MkTypeName(specifiers, d));
3509 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3510 if(dllImport)
3511 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3512 d = MkDeclaratorFunction(d, params);
3513 for(spec = (*specifiers).first; spec; spec = spec->next)
3514 {
3515 if(spec->type == 1)
3516 {
3517 if((!typeDecl || typeDecl->type == 1))
3518 {
3519 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3520
3521 symbol->_class = classSym->__anon1.registered;
3522 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3523 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3524 }
3525 }
3526 }
3527 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3528 specifiers = MkList();
3529 if(dllImport)
3530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3531 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3533 if(!prop->conversion || prop->_class->type == 1)
3534 ListAdd(specifiers, MkSpecifier(VOID));
3535 else
3536 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3537 decl = MkDeclaration(specifiers, declarators);
3538 external = MkExternalDeclaration(decl);
3539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3540 external->symbol = symbol;
3541 symbol->__anon2.__anon2.externalSet = external;
3542 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3543 }
3544 else
3545 {
3546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3547 }
3548 }
3549 if(!symbol->__anon2.__anon2.externalPtr)
3550 {
3551 struct Declaration * decl;
3552 struct External * external;
3553 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3554 char propName[1024];
3555
3556 if(imported)
3557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3558 else
3559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3560 ListAdd(specifiers, MkSpecifierName("Property"));
3561 strcpy(propName, "__ecereProp_");
3562 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3563 strcat(propName, "_");
3564 FullClassNameCat(propName, prop->name, 0x1);
3565 MangleClassName(propName);
3566 {
3567 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3568
3569 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3570 if(!imported)
3571 {
3572 strcpy(propName, "__ecerePropM_");
3573 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3574 strcat(propName, "_");
3575 FullClassNameCat(propName, prop->name, 0x1);
3576 MangleClassName(propName);
3577 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3578 }
3579 decl = MkDeclaration(specifiers, list);
3580 }
3581 external = MkExternalDeclaration(decl);
3582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3583 external->symbol = symbol;
3584 symbol->__anon2.__anon2.externalPtr = external;
3585 }
3586 else
3587 {
3588 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3589 }
3590 symbol->id = curExternal->symbol->idCode;
3591 }
3592 }
3593
3594 struct Type * Dereference(struct Type * source)
3595 {
3596 struct Type * type = (((void *)0));
3597
3598 if(source)
3599 {
3600 if(source->kind == 13 || source->kind == 12)
3601 {
3602 type = source->__anon1.type;
3603 source->__anon1.type->refCount++;
3604 }
3605 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3606 {
3607 type = __extension__ ({
3608 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3609
3610 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3611 });
3612 }
3613 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3614 {
3615 type = source;
3616 source->refCount++;
3617 }
3618 else
3619 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3620 }
3621 return type;
3622 }
3623
3624 static struct Type * Reference(struct Type * source)
3625 {
3626 struct Type * type = (((void *)0));
3627
3628 if(source)
3629 {
3630 type = __extension__ ({
3631 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3632
3633 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3634 });
3635 source->refCount++;
3636 }
3637 return type;
3638 }
3639
3640 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);
3641
3642 extern void *  memcpy(void * , const void * , size_t size);
3643
3644 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3645
3646 extern void FreeExpression(struct Expression * exp);
3647
3648 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3649
3650 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);
3651
3652 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3653
3654 extern struct Type * MkClassType(const char *  name);
3655
3656 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);
3657
3658 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)
3659 {
3660 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3661 unsigned int found = 0x0;
3662 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3663 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3664 unsigned int freeType = 0x0;
3665
3666 yylloc = member->loc;
3667 if(!ident)
3668 {
3669 if(curMember)
3670 {
3671 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3672 if(*curMember)
3673 {
3674 found = 0x1;
3675 dataMember = *curMember;
3676 }
3677 }
3678 }
3679 else
3680 {
3681 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3682 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3683 int _subMemberStackPos = 0;
3684
3685 if(!thisMember)
3686 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3687 if(thisMember)
3688 {
3689 dataMember = thisMember;
3690 if(curMember && thisMember->memberAccess == 1)
3691 {
3692 *curMember = thisMember;
3693 *curClass = thisMember->_class;
3694 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3695 *subMemberStackPos = _subMemberStackPos;
3696 }
3697 found = 0x1;
3698 }
3699 else
3700 {
3701 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3702 if(method && method->type == 1)
3703 found = 0x1;
3704 else
3705 method = (((void *)0));
3706 }
3707 }
3708 if(found)
3709 {
3710 struct Type * type = (((void *)0));
3711
3712 if(dataMember)
3713 {
3714 if(!dataMember->dataType && dataMember->dataTypeString)
3715 {
3716 struct Context * context = SetupTemplatesContext(_class);
3717
3718 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3719 FinishTemplatesContext(context);
3720 }
3721 type = dataMember->dataType;
3722 }
3723 else if(method)
3724 {
3725 if(!method->dataType)
3726 ProcessMethodType(method);
3727 type = method->dataType;
3728 }
3729 if(ident && ident->next)
3730 {
3731 for(ident = ident->next; ident && type; ident = ident->next)
3732 {
3733 if(type->kind == 8)
3734 {
3735 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3736 if(!dataMember)
3737 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3738 if(dataMember)
3739 type = dataMember->dataType;
3740 }
3741 else if(type->kind == 9 || type->kind == 10)
3742 {
3743 struct Type * memberType;
3744
3745 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3746 {
3747 if(!strcmp(memberType->name, ident->string))
3748 {
3749 type = memberType;
3750 break;
3751 }
3752 }
3753 }
3754 }
3755 }
3756 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3757 {
3758 int id = 0;
3759 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3760 struct __ecereNameSpace__ecere__com__Class * sClass;
3761
3762 for(sClass = _class; sClass; sClass = sClass->base)
3763 {
3764 id = 0;
3765 if(sClass->templateClass)
3766 sClass = sClass->templateClass;
3767 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3768 {
3769 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3770 {
3771 for(sClass = sClass->base; sClass; sClass = sClass->base)
3772 {
3773 if(sClass->templateClass)
3774 sClass = sClass->templateClass;
3775 id += sClass->templateParams.count;
3776 }
3777 break;
3778 }
3779 id++;
3780 }
3781 if(curParam)
3782 break;
3783 }
3784 if(curParam)
3785 {
3786 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3787
3788 if(arg.__anon1.__anon1.dataTypeString)
3789 {
3790 unsigned int constant = type->constant;
3791
3792 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
3793 if(type->kind == 8 && constant)
3794 type->constant = 0x1;
3795 else if(type->kind == 13)
3796 {
3797 struct Type * t = type->__anon1.type;
3798
3799 while(t->kind == 13)
3800 t = t->__anon1.type;
3801 if(constant)
3802 t->constant = constant;
3803 }
3804 freeType = 0x1;
3805 if(type && _class->templateClass)
3806 type->passAsTemplate = 0x1;
3807 if(type)
3808 {
3809 }
3810 }
3811 }
3812 }
3813 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3814 {
3815 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3816 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3817 int c;
3818 int paramCount = 0;
3819 int lastParam = -1;
3820 char templateString[1024];
3821 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3822
3823 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3824 for(cClass = expClass; cClass; cClass = cClass->base)
3825 {
3826 int p = 0;
3827
3828 if(cClass->templateClass)
3829 cClass = cClass->templateClass;
3830 for(param = cClass->templateParams.first; param; param = param->next)
3831 {
3832 int id = p;
3833 struct __ecereNameSpace__ecere__com__Class * sClass;
3834 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3835
3836 for(sClass = cClass->base; sClass; sClass = sClass->base)
3837 {
3838 if(sClass->templateClass)
3839 sClass = sClass->templateClass;
3840 id += sClass->templateParams.count;
3841 }
3842 arg = expClass->templateArgs[id];
3843 for(sClass = _class; sClass; sClass = sClass->base)
3844 {
3845 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3846 int p = 0;
3847 struct __ecereNameSpace__ecere__com__Class * nextClass;
3848
3849 if(sClass->templateClass)
3850 sClass = sClass->templateClass;
3851 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3852 {
3853 if(nextClass->templateClass)
3854 nextClass = nextClass->templateClass;
3855 p += nextClass->templateParams.count;
3856 }
3857 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3858 {
3859 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3860 {
3861 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3862 {
3863 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3864 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3865 break;
3866 }
3867 }
3868 }
3869 }
3870 {
3871 char argument[256];
3872
3873 argument[0] = '\0';
3874 switch(param->type)
3875 {
3876 case 2:
3877 {
3878 char expString[1024];
3879 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3880 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3881 struct Expression * exp;
3882 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3883
3884 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3885 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3886 ProcessExpressionType(exp);
3887 ComputeExpression(exp);
3888 expString[0] = '\0';
3889 PrintExpression(exp, expString);
3890 strcat(argument, expString);
3891 FreeExpression(exp);
3892 break;
3893 }
3894 case 1:
3895 {
3896 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3897 break;
3898 }
3899 case 0:
3900 {
3901 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3902 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3903 break;
3904 }
3905 }
3906 if(argument[0])
3907 {
3908 if(paramCount)
3909 strcat(templateString, ", ");
3910 if(lastParam != p - 1)
3911 {
3912 strcat(templateString, param->name);
3913 strcat(templateString, " = ");
3914 }
3915 strcat(templateString, argument);
3916 paramCount++;
3917 lastParam = p;
3918 }
3919 p++;
3920 }
3921 }
3922 }
3923 {
3924 int len = strlen(templateString);
3925
3926 if(templateString[len - 1] == '<')
3927 len--;
3928 else
3929 {
3930 if(templateString[len - 1] == '>')
3931 templateString[len++] = ' ';
3932 templateString[len++] = '>';
3933 }
3934 templateString[len++] = '\0';
3935 }
3936 {
3937 struct Context * context = SetupTemplatesContext(_class);
3938
3939 if(freeType)
3940 FreeType(type);
3941 type = ProcessTypeString(templateString, 0x0);
3942 freeType = 0x1;
3943 FinishTemplatesContext(context);
3944 }
3945 }
3946 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3947 {
3948 ProcessExpressionType(member->initializer->__anon1.exp);
3949 if(!member->initializer->__anon1.exp->expType)
3950 {
3951 if(inCompiler)
3952 {
3953 char expString[10240];
3954
3955 expString[0] = '\0';
3956 PrintExpression(member->initializer->__anon1.exp, expString);
3957 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3958 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3959 }
3960 }
3961 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0, 0x1))
3962 {
3963 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3964 }
3965 }
3966 else if(member->initializer)
3967 {
3968 ProcessInitializer(member->initializer, type);
3969 }
3970 if(freeType)
3971 FreeType(type);
3972 }
3973 else
3974 {
3975 if(_class && _class->type == 3)
3976 {
3977 if(member->initializer)
3978 {
3979 struct Type * type = MkClassType(_class->fullName);
3980
3981 ProcessInitializer(member->initializer, type);
3982 FreeType(type);
3983 }
3984 }
3985 else
3986 {
3987 if(member->initializer)
3988 {
3989 ProcessInitializer(member->initializer, (((void *)0)));
3990 }
3991 if(ident)
3992 {
3993 if(method)
3994 {
3995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3996 }
3997 else if(_class)
3998 {
3999 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4000 if(inCompiler)
4001 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4002 }
4003 }
4004 else if(_class)
4005 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4006 }
4007 }
4008 }
4009
4010 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);
4011
4012 extern void FreeSpecifier(struct Specifier * spec);
4013
4014 static void ProcessFunction(struct FunctionDefinition * function);
4015
4016 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4017
4018 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4019
4020 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4021
4022 extern void FreeClassFunction(struct ClassFunction * func);
4023
4024 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4025
4026 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4027
4028 void ProcessInstantiationType(struct Instantiation * inst)
4029 {
4030 yylloc = inst->loc;
4031 if(inst->_class)
4032 {
4033 struct MembersInit * members;
4034 struct Symbol * classSym;
4035 struct __ecereNameSpace__ecere__com__Class * _class;
4036
4037 classSym = inst->_class->__anon1.__anon1.symbol;
4038 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4039 if(!_class || _class->type != 5)
4040 DeclareStruct(inst->_class->__anon1.__anon1.name, 0x0);
4041 afterExternal = afterExternal ? afterExternal : curExternal;
4042 if(inst->exp)
4043 ProcessExpressionType(inst->exp);
4044 inst->isConstant = 0x1;
4045 if(inst->members)
4046 {
4047 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4048 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4049 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4050 int subMemberStackPos = 0;
4051
4052 for(members = (*inst->members).first; members; members = members->next)
4053 {
4054 switch(members->type)
4055 {
4056 case 1:
4057 {
4058 char name[1024];
4059 static unsigned int instMethodID = 0;
4060 struct External * external = curExternal;
4061 struct Context * context = curContext;
4062 struct Declarator * declarator = members->__anon1.function->declarator;
4063 struct Identifier * nameID = GetDeclId(declarator);
4064 char * unmangled = nameID ? nameID->string : (((void *)0));
4065 struct Expression * exp;
4066 struct External * createdExternal = (((void *)0));
4067
4068 if(inCompiler)
4069 {
4070 char number[16];
4071
4072 strcpy(name, "__ecereInstMeth_");
4073 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
4074 strcat(name, "_");
4075 strcat(name, nameID->string);
4076 strcat(name, "_");
4077 sprintf(number, "_%08d", instMethodID++);
4078 strcat(name, number);
4079 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4080 }
4081 if(declarator)
4082 {
4083 struct Symbol * symbol = declarator->symbol;
4084 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4085
4086 if(method && method->type == 1)
4087 {
4088 symbol->__anon1.method = method;
4089 ProcessMethodType(method);
4090 if(!symbol->type->__anon1.__anon2.thisClass)
4091 {
4092 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4093 {
4094 if(!currentClass->symbol)
4095 currentClass->symbol = FindClass(currentClass->fullName);
4096 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4097 }
4098 else
4099 {
4100 if(!_class->symbol)
4101 _class->symbol = FindClass(_class->fullName);
4102 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4103 }
4104 }
4105 DeclareType(symbol->type, 0x1, 0x1);
4106 }
4107 else if(classSym)
4108 {
4109 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4110 }
4111 }
4112 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 0x1);
4113 if(nameID)
4114 {
4115 FreeSpecifier(nameID->_class);
4116 nameID->_class = (((void *)0));
4117 }
4118 if(inCompiler)
4119 {
4120 struct External * oldExternal = curExternal;
4121
4122 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4123 {
4124 struct External * externalDecl;
4125
4126 externalDecl = MkExternalDeclaration((((void *)0)));
4127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4128 if(createdExternal->__anon1.function)
4129 {
4130 ProcessFunction(createdExternal->__anon1.function);
4131 {
4132 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4133
4134 externalDecl->__anon1.declaration = decl;
4135 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4136 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4137 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4138 }
4139 }
4140 }
4141 }
4142 else if(declarator)
4143 {
4144 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4145 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4146 }
4147 curExternal = external;
4148 curContext = context;
4149 if(inCompiler)
4150 {
4151 FreeClassFunction(members->__anon1.function);
4152 exp = QMkExpId(name);
4153 members->type = 0;
4154 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4155 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4156 }
4157 break;
4158 }
4159 case 0:
4160 {
4161 if(members->__anon1.dataMembers && classSym)
4162 {
4163 struct MemberInit * member;
4164 struct Location oldyyloc = yylloc;
4165
4166 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4167 {
4168 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4169 if(member->initializer && !member->initializer->isConstant)
4170 inst->isConstant = 0x0;
4171 }
4172 yylloc = oldyyloc;
4173 }
4174 break;
4175 }
4176 }
4177 }
4178 }
4179 }
4180 }
4181
4182 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4183 {
4184 if(inCompiler)
4185 {
4186 if(type->kind == 11)
4187 {
4188 struct Type * param;
4189
4190 if(declareParams)
4191 {
4192 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4193 DeclareType(param, declarePointers, 0x1);
4194 }
4195 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 0x1);
4196 }
4197 else if(type->kind == 13 && declarePointers)
4198 DeclareType(type->__anon1.type, declarePointers, 0x0);
4199 else if(type->kind == 8)
4200 {
4201 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4202 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4203 }
4204 else if(type->kind == 9 || type->kind == 10)
4205 {
4206 struct Type * member;
4207
4208 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4209 DeclareType(member, 0x0, 0x0);
4210 }
4211 else if(type->kind == 12)
4212 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0x0);
4213 }
4214 }
4215
4216 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4217
4218 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4219 {
4220 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4221 int id = 0;
4222 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4223 struct __ecereNameSpace__ecere__com__Class * sClass;
4224
4225 for(sClass = _class; sClass; sClass = sClass->base)
4226 {
4227 id = 0;
4228 if(sClass->templateClass)
4229 sClass = sClass->templateClass;
4230 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4231 {
4232 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4233 {
4234 for(sClass = sClass->base; sClass; sClass = sClass->base)
4235 {
4236 if(sClass->templateClass)
4237 sClass = sClass->templateClass;
4238 id += sClass->templateParams.count;
4239 }
4240 break;
4241 }
4242 id++;
4243 }
4244 if(curParam)
4245 break;
4246 }
4247 if(curParam)
4248 {
4249 arg = &_class->templateArgs[id];
4250 if(arg && param->type == 0)
4251 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4252 }
4253 return arg;
4254 }
4255
4256 extern struct Context * PushContext(void);
4257
4258 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4259
4260 struct TemplatedType
4261 {
4262 uintptr_t key;
4263 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4264 struct __ecereNameSpace__ecere__sys__BTNode * left;
4265 struct __ecereNameSpace__ecere__sys__BTNode * right;
4266 int depth;
4267 struct TemplateParameter * param;
4268 } __attribute__ ((gcc_struct));
4269
4270 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4271
4272 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4273 {
4274 struct Context * context = PushContext();
4275
4276 context->templateTypesOnly = 0x1;
4277 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4278 {
4279 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4280
4281 for(; param; param = param->next)
4282 {
4283 if(param->type == 0 && param->identifier)
4284 {
4285 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4286
4287 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4288 }
4289 }
4290 }
4291 else if(_class)
4292 {
4293 struct __ecereNameSpace__ecere__com__Class * sClass;
4294
4295 for(sClass = _class; sClass; sClass = sClass->base)
4296 {
4297 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4298
4299 for(p = sClass->templateParams.first; p; p = p->next)
4300 {
4301 if(p->type == 0)
4302 {
4303 struct TemplateParameter * param = p->param;
4304 struct TemplatedType * type;
4305
4306 if(!param)
4307 {
4308 p->param = param = __extension__ ({
4309 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4310
4311 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4312 });
4313 }
4314 type = __extension__ ({
4315 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4316
4317 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4318 });
4319 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4320 }
4321 }
4322 }
4323 }
4324 return context;
4325 }
4326
4327 extern void PopContext(struct Context * ctx);
4328
4329 extern void FreeContext(struct Context * context);
4330
4331 void FinishTemplatesContext(struct Context * context)
4332 {
4333 PopContext(context);
4334 FreeContext(context);
4335 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4336 }
4337
4338 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4339 {
4340 if(!method->dataType)
4341 {
4342 struct Context * context = SetupTemplatesContext(method->_class);
4343
4344 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4345 FinishTemplatesContext(context);
4346 if(method->type != 1 && method->dataType)
4347 {
4348 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4349 {
4350 if(!method->_class->symbol)
4351 method->_class->symbol = FindClass(method->_class->fullName);
4352 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4353 }
4354 }
4355 }
4356 }
4357
4358 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4359 {
4360 if(!prop->dataType)
4361 {
4362 struct Context * context = SetupTemplatesContext(prop->_class);
4363
4364 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4365 FinishTemplatesContext(context);
4366 }
4367 }
4368
4369 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4370
4371 extern void FreeTypeName(struct TypeName * typeName);
4372
4373 static void ProcessDeclarator(struct Declarator * decl);
4374
4375 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4376
4377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4378
4379 struct MethodImport
4380 {
4381 struct MethodImport * prev;
4382 struct MethodImport * next;
4383 char *  name;
4384 unsigned int isVirtual;
4385 } __attribute__ ((gcc_struct));
4386
4387 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4388
4389 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4390 {
4391 struct Symbol * symbol = method->symbol;
4392
4393 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4394 {
4395 unsigned int imported = 0x0;
4396 unsigned int dllImport = 0x0;
4397
4398 if(!method->dataType)
4399 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4400 if(!symbol || symbol->_import || method->type == 1)
4401 {
4402 if(!symbol || method->type == 1)
4403 {
4404 struct Symbol * classSym;
4405
4406 if(!method->_class->symbol)
4407 method->_class->symbol = FindClass(method->_class->fullName);
4408 classSym = method->_class->symbol;
4409 if(!classSym->_import)
4410 {
4411 struct ModuleImport * module;
4412
4413 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4414 module = FindModule(method->_class->module);
4415 else
4416 module = mainModule;
4417 classSym->_import = __extension__ ({
4418 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4419
4420 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4421 });
4422 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4423 }
4424 if(!symbol)
4425 {
4426 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4427 }
4428 if(!symbol->_import)
4429 {
4430 symbol->_import = (struct ClassImport *)__extension__ ({
4431 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4432
4433 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4434 });
4435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4436 }
4437 if(!symbol)
4438 {
4439 symbol->type = method->dataType;
4440 if(symbol->type)
4441 symbol->type->refCount++;
4442 }
4443 }
4444 if(!method->dataType->dllExport)
4445 {
4446 imported = 0x1;
4447 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)
4448 dllImport = 0x1;
4449 }
4450 }
4451 if(method->type != 1 && method->dataType)
4452 DeclareType(method->dataType, 0x1, 0x1);
4453 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4454 {
4455 struct Declaration * decl;
4456 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4457 struct Declarator * d;
4458 struct Declarator * funcDecl;
4459 struct External * external;
4460
4461 specifiers = MkList();
4462 declarators = MkList();
4463 if(dllImport)
4464 ListAdd(specifiers, MkSpecifier(EXTERN));
4465 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4466 ListAdd(specifiers, MkSpecifier(STATIC));
4467 if(method->type == 1)
4468 {
4469 ListAdd(specifiers, MkSpecifier(INT));
4470 d = MkDeclaratorIdentifier(MkIdentifier(name));
4471 }
4472 else
4473 {
4474 d = MkDeclaratorIdentifier(MkIdentifier(name));
4475 if(dllImport)
4476 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4477 {
4478 struct Context * context = SetupTemplatesContext(method->_class);
4479
4480 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4481 FinishTemplatesContext(context);
4482 }
4483 funcDecl = GetFuncDecl(d);
4484 if(dllImport)
4485 {
4486 struct Specifier * spec, * next;
4487
4488 for(spec = (*specifiers).first; spec; spec = next)
4489 {
4490 next = spec->next;
4491 if(spec->type == 5)
4492 {
4493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4494 FreeSpecifier(spec);
4495 }
4496 }
4497 }
4498 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4499 {
4500 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4501 {
4502 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4503 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")));
4504 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4505 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4506
4507 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4508 {
4509 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4510
4511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4512 FreeTypeName(param);
4513 }
4514 if(!funcDecl->__anon1.function.parameters)
4515 funcDecl->__anon1.function.parameters = MkList();
4516 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4517 }
4518 }
4519 }
4520 ProcessDeclarator(d);
4521 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4522 decl = MkDeclaration(specifiers, declarators);
4523 ReplaceThisClassSpecifiers(specifiers, method->_class);
4524 if(symbol->__anon2.__anon1.pointerExternal)
4525 {
4526 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4527
4528 {
4529 *functionSymbol = *symbol;
4530 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4531 if(functionSymbol->type)
4532 functionSymbol->type->refCount++;
4533 }
4534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4535 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4536 }
4537 external = MkExternalDeclaration(decl);
4538 if(curExternal)
4539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4540 external->symbol = symbol;
4541 symbol->__anon2.__anon1.pointerExternal = external;
4542 }
4543 else if(ast)
4544 {
4545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4546 }
4547 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4548 }
4549 }
4550
4551 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4552 {
4553 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4554 {
4555 unsigned int first = 0x1;
4556 int p = 0;
4557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4558 int lastParam = -1;
4559 char className[1024];
4560
4561 strcpy(className, _class->fullName);
4562 for(param = _class->templateParams.first; param; param = param->next)
4563 {
4564 {
4565 if(first)
4566 strcat(className, "<");
4567 if(!first)
4568 strcat(className, ", ");
4569 if(lastParam + 1 != p)
4570 {
4571 strcat(className, param->name);
4572 strcat(className, " = ");
4573 }
4574 strcat(className, param->name);
4575 first = 0x0;
4576 lastParam = p;
4577 }
4578 p++;
4579 }
4580 if(!first)
4581 {
4582 int len = strlen(className);
4583
4584 if(className[len - 1] == '>')
4585 className[len++] = ' ';
4586 className[len++] = '>';
4587 className[len++] = '\0';
4588 }
4589 return __ecereNameSpace__ecere__sys__CopyString(className);
4590 }
4591 else
4592 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4593 }
4594
4595 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4596 {
4597 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4598 {
4599 unsigned int first = 0x1;
4600 int p = 0;
4601 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4602 int lastParam = -1;
4603 char className[1024];
4604
4605 strcpy(className, _class->fullName);
4606 for(param = _class->templateParams.first; param; param = param->next)
4607 {
4608 {
4609 if(first)
4610 strcat(className, "<");
4611 if(!first)
4612 strcat(className, ", ");
4613 if(lastParam + 1 != p)
4614 {
4615 strcat(className, param->name);
4616 strcat(className, " = ");
4617 }
4618 strcat(className, param->name);
4619 first = 0x0;
4620 lastParam = p;
4621 }
4622 p++;
4623 }
4624 if(!first)
4625 {
4626 int len = strlen(className);
4627
4628 if(className[len - 1] == '>')
4629 className[len++] = ' ';
4630 className[len++] = '>';
4631 className[len++] = '\0';
4632 }
4633 return MkClassType(className);
4634 }
4635 else
4636 {
4637 return MkClassType(_class->fullName);
4638 }
4639 }
4640
4641 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4642 {
4643 if(specs != (((void *)0)) && _class)
4644 {
4645 struct Specifier * spec;
4646
4647 for(spec = specs->first; spec; spec = spec->next)
4648 {
4649 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4650 {
4651 spec->type = 1;
4652 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4653 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4654 }
4655 }
4656 }
4657 }
4658
4659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4660
4661 struct __ecereNameSpace__ecere__com__GlobalFunction
4662 {
4663 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4664 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4665 const char *  name;
4666 int (*  function)();
4667 struct __ecereNameSpace__ecere__com__Instance * module;
4668 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4669 const char *  dataTypeString;
4670 struct Type * dataType;
4671 void *  symbol;
4672 } __attribute__ ((gcc_struct));
4673
4674 extern struct Context * globalContext;
4675
4676 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4677
4678 struct FunctionImport
4679 {
4680 struct FunctionImport * prev;
4681 struct FunctionImport * next;
4682 char *  name;
4683 } __attribute__ ((gcc_struct));
4684
4685 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4686 {
4687 struct Symbol * symbol = function->symbol;
4688
4689 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4690 {
4691 unsigned int imported = 0x0;
4692 unsigned int dllImport = 0x0;
4693
4694 if(!function->dataType)
4695 {
4696 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4697 if(!function->dataType->__anon1.__anon2.thisClass)
4698 function->dataType->__anon1.__anon2.staticMethod = 0x1;
4699 }
4700 if(inCompiler)
4701 {
4702 if(!symbol)
4703 {
4704 struct ModuleImport * module = FindModule(function->module);
4705
4706 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4707 if(module->name)
4708 {
4709 if(!function->dataType->dllExport)
4710 {
4711 symbol->_import = (struct ClassImport *)__extension__ ({
4712 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4713
4714 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4715 });
4716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4717 }
4718 }
4719 {
4720 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4721 if(!symbol->type->__anon1.__anon2.thisClass)
4722 symbol->type->__anon1.__anon2.staticMethod = 0x1;
4723 }
4724 }
4725 imported = symbol->_import ? 0x1 : 0x0;
4726 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4727 dllImport = 0x1;
4728 }
4729 DeclareType(function->dataType, 0x1, 0x1);
4730 if(inCompiler)
4731 {
4732 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4733 {
4734 struct Declaration * decl;
4735 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4736 struct Declarator * d;
4737 struct Declarator * funcDecl;
4738 struct External * external;
4739
4740 specifiers = MkList();
4741 declarators = MkList();
4742 ListAdd(specifiers, MkSpecifier(EXTERN));
4743 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4744 if(dllImport)
4745 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4746 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4747 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4748 {
4749 struct Specifier * spec;
4750
4751 for(spec = (*specifiers).first; spec; spec = spec->next)
4752 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4753 {
4754 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4755 FreeSpecifier(spec);
4756 break;
4757 }
4758 }
4759 funcDecl = GetFuncDecl(d);
4760 if(funcDecl && !funcDecl->__anon1.function.parameters)
4761 {
4762 funcDecl->__anon1.function.parameters = MkList();
4763 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4764 }
4765 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4766 {
4767 struct Context * oldCtx = curContext;
4768
4769 curContext = globalContext;
4770 decl = MkDeclaration(specifiers, declarators);
4771 curContext = oldCtx;
4772 }
4773 if(symbol->__anon2.__anon1.pointerExternal)
4774 {
4775 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4776
4777 {
4778 *functionSymbol = *symbol;
4779 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4780 if(functionSymbol->type)
4781 functionSymbol->type->refCount++;
4782 }
4783 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4784 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4785 }
4786 external = MkExternalDeclaration(decl);
4787 if(curExternal)
4788 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4789 external->symbol = symbol;
4790 symbol->__anon2.__anon1.pointerExternal = external;
4791 }
4792 else
4793 {
4794 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4795 }
4796 if(curExternal)
4797 symbol->id = curExternal->symbol->idCode;
4798 }
4799 }
4800 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4801 }
4802
4803 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4804
4805 struct GlobalData
4806 {
4807 uintptr_t key;
4808 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4809 struct __ecereNameSpace__ecere__sys__BTNode * left;
4810 struct __ecereNameSpace__ecere__sys__BTNode * right;
4811 int depth;
4812 struct __ecereNameSpace__ecere__com__Instance * module;
4813 char *  dataTypeString;
4814 struct Type * dataType;
4815 void *  symbol;
4816 char *  fullName;
4817 } __attribute__ ((gcc_struct));
4818
4819 void DeclareGlobalData(struct GlobalData * data)
4820 {
4821 struct Symbol * symbol = data->symbol;
4822
4823 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4824 {
4825 if(inCompiler)
4826 {
4827 if(!symbol)
4828 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4829 }
4830 if(!data->dataType)
4831 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4832 DeclareType(data->dataType, 0x1, 0x1);
4833 if(inCompiler)
4834 {
4835 if(!symbol->__anon2.__anon1.pointerExternal)
4836 {
4837 struct Declaration * decl;
4838 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4839 struct Declarator * d;
4840 struct External * external;
4841
4842 specifiers = MkList();
4843 declarators = MkList();
4844 ListAdd(specifiers, MkSpecifier(EXTERN));
4845 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4846 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4847 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4848 decl = MkDeclaration(specifiers, declarators);
4849 external = MkExternalDeclaration(decl);
4850 if(curExternal)
4851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4852 external->symbol = symbol;
4853 symbol->__anon2.__anon1.pointerExternal = external;
4854 }
4855 else
4856 {
4857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4858 }
4859 if(curExternal)
4860 symbol->id = curExternal->symbol->idCode;
4861 }
4862 }
4863 }
4864
4865 struct Conversion
4866 {
4867 struct Conversion * prev, * next;
4868 struct __ecereNameSpace__ecere__com__Property * convert;
4869 unsigned int isGet;
4870 struct Type * resultType;
4871 } __attribute__ ((gcc_struct));
4872
4873 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4874
4875 extern void Compiler_Warning(const char *  format, ...);
4876
4877 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4878 {
4879 unsigned int status = 0x1;
4880
4881 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))
4882 {
4883 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4884 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4885
4886 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4887 {
4888 struct Type * sourceType = source, * destType = dest;
4889
4890 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4891 sourceType = sourceType->__anon1.type;
4892 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4893 destType = destType->__anon1.type;
4894 if(!destType->constant && sourceType->constant)
4895 {
4896 status = 0x0;
4897 if(warn)
4898 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4899 }
4900 }
4901 }
4902 return status;
4903 }
4904
4905 extern void CopyTypeInto(struct Type * type, struct Type * src);
4906
4907 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4908
4909 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)
4910 {
4911 if(source && dest)
4912 {
4913 if(warnConst)
4914 CheckConstCompatibility(source, dest, 0x1);
4915 if(source->kind == 20 && dest->kind != 20)
4916 {
4917 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4918
4919 if(type)
4920 source = type;
4921 }
4922 if(dest->kind == 20 && source->kind != 20)
4923 {
4924 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4925
4926 if(type)
4927 dest = type;
4928 }
4929 if(dest->classObjectType == 2 && dest->kind != 11)
4930 {
4931 if(source->classObjectType != 3)
4932 return 0x1;
4933 else
4934 {
4935 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4936 {
4937 return 0x1;
4938 }
4939 }
4940 }
4941 else
4942 {
4943 if(source->kind != 11 && source->classObjectType == 3)
4944 return 0x1;
4945 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4946 return 0x1;
4947 }
4948 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4949 {
4950 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))
4951 return 0x1;
4952 }
4953 if(dest->kind == 14 && source->kind != 0)
4954 return 0x1;
4955 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))
4956 return 0x1;
4957 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))
4958 return 0x1;
4959 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4960 {
4961 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4962 {
4963 if(conversions != (((void *)0)))
4964 {
4965 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4966 return 0x1;
4967 }
4968 else
4969 {
4970 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4971
4972 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4973 ;
4974 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4975 ;
4976 if(sourceBase == destBase)
4977 return 0x1;
4978 }
4979 }
4980 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))
4981 return 0x1;
4982 else
4983 {
4984 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))
4985 {
4986 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4987 {
4988 return 0x1;
4989 }
4990 }
4991 }
4992 }
4993 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
4994 return 0x1;
4995 if(doConversion)
4996 {
4997 if(source->kind == 8)
4998 {
4999 struct __ecereNameSpace__ecere__com__Class * _class;
5000
5001 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5002 {
5003 struct __ecereNameSpace__ecere__com__Property * convert;
5004
5005 for(convert = _class->conversions.first; convert; convert = convert->next)
5006 {
5007 if(convert->memberAccess == 1 || _class->module == privateModule)
5008 {
5009 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5010
5011 if(!convert->dataType)
5012 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5013 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))
5014 {
5015 if(!conversions && !convert->Get)
5016 return 0x1;
5017 else if(conversions != (((void *)0)))
5018 {
5019 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))
5020 return 0x1;
5021 else
5022 {
5023 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5024
5025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5026 return 0x1;
5027 }
5028 }
5029 }
5030 }
5031 }
5032 }
5033 }
5034 if(dest->kind == 8)
5035 {
5036 struct __ecereNameSpace__ecere__com__Class * _class;
5037
5038 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5039 {
5040 struct __ecereNameSpace__ecere__com__Property * convert;
5041
5042 for(convert = _class->conversions.first; convert; convert = convert->next)
5043 {
5044 if(convert->memberAccess == 1 || _class->module == privateModule)
5045 {
5046 struct Type * constType = (((void *)0));
5047 unsigned int success = 0x0;
5048
5049 if(!convert->dataType)
5050 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5051 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5052 {
5053 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5054
5055 constType = __extension__ ({
5056 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5057
5058 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5059 });
5060 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5061 ptrType->constant = 0x1;
5062 }
5063 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1, warnConst))
5064 {
5065 if(!conversions && !convert->Set)
5066 success = 0x1;
5067 else if(conversions != (((void *)0)))
5068 {
5069 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))
5070 success = 0x1;
5071 else
5072 {
5073 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5074
5075 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5076 success = 0x1;
5077 }
5078 }
5079 }
5080 if(constType)
5081 FreeType(constType);
5082 if(success)
5083 return 0x1;
5084 }
5085 }
5086 }
5087 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5088 {
5089 if(!dest->__anon1._class->__anon1.registered->dataType)
5090 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5091 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5092 {
5093 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))
5094 {
5095 return 0x1;
5096 }
5097 }
5098 }
5099 }
5100 if(source->kind == 8)
5101 {
5102 struct __ecereNameSpace__ecere__com__Class * _class;
5103
5104 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5105 {
5106 struct __ecereNameSpace__ecere__com__Property * convert;
5107
5108 for(convert = _class->conversions.first; convert; convert = convert->next)
5109 {
5110 if(convert->memberAccess == 1 || _class->module == privateModule)
5111 {
5112 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5113
5114 if(!convert->dataType)
5115 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5116 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))
5117 {
5118 if(!conversions && !convert->Get)
5119 return 0x1;
5120 else if(conversions != (((void *)0)))
5121 {
5122 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))
5123 return 0x1;
5124 else
5125 {
5126 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5127
5128 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5129 return 0x1;
5130 }
5131 }
5132 }
5133 }
5134 }
5135 }
5136 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5137 {
5138 if(!source->__anon1._class->__anon1.registered->dataType)
5139 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5140 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5141 {
5142 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))
5143 return 0x1;
5144 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, warnConst))
5145 return 0x1;
5146 }
5147 }
5148 }
5149 }
5150 if(source->kind == 8 || source->kind == 19)
5151 ;
5152 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5153 return 0x1;
5154 else if(dest->kind == 7 && source->kind == 6)
5155 return 0x1;
5156 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5157 return 0x1;
5158 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5159 return 0x1;
5160 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5161 return 0x1;
5162 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5163 return 0x1;
5164 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5165 return 0x1;
5166 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))
5167 return 0x1;
5168 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))
5169 return 0x1;
5170 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)))
5171 {
5172 struct Type * paramSource, * paramDest;
5173
5174 if(dest->kind == 16)
5175 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5176 if(source->kind == 16)
5177 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5178 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5179 dest = dest->__anon1.type;
5180 if(source->kind == 13 && source->__anon1.type->kind == 11)
5181 source = source->__anon1.type;
5182 if(dest->kind == 16)
5183 dest = dest->__anon1.__anon3.method->dataType;
5184 if(source->kind == 16)
5185 source = source->__anon1.__anon3.method->dataType;
5186 paramSource = source->__anon1.__anon2.params.first;
5187 if(paramSource && paramSource->kind == 0)
5188 paramSource = (((void *)0));
5189 paramDest = dest->__anon1.__anon2.params.first;
5190 if(paramDest && paramDest->kind == 0)
5191 paramDest = (((void *)0));
5192 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5193 {
5194 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))))
5195 {
5196 if(paramDest && paramDest->kind == 8)
5197 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5198 else
5199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5200 return 0x0;
5201 }
5202 paramDest = paramDest->next;
5203 }
5204 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5205 {
5206 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5207 {
5208 if(dest->__anon1.__anon2.thisClass)
5209 {
5210 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5211 {
5212 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5213 return 0x0;
5214 }
5215 }
5216 else
5217 {
5218 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5219 {
5220 if(owningClassDest)
5221 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5222 else
5223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5224 return 0x0;
5225 }
5226 }
5227 paramSource = paramSource->next;
5228 }
5229 else
5230 {
5231 if(dest->__anon1.__anon2.thisClass)
5232 {
5233 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5234 {
5235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5236 return 0x0;
5237 }
5238 }
5239 else
5240 {
5241 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5242 {
5243 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5244 return 0x0;
5245 }
5246 }
5247 }
5248 }
5249 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5250 {
5251 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5252 return 0x0;
5253 }
5254 else
5255 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 0x1);
5256 for(; paramDest; paramDest = paramDest->next)
5257 {
5258 if(!paramSource)
5259 {
5260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5261 return 0x0;
5262 }
5263 {
5264 struct Type * paramDestType = paramDest;
5265 struct Type * paramSourceType = paramSource;
5266 struct Type * type = paramDestType;
5267
5268 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5269 {
5270 int id = 0;
5271 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5272 struct __ecereNameSpace__ecere__com__Class * sClass;
5273
5274 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5275 {
5276 id = 0;
5277 if(sClass->templateClass)
5278 sClass = sClass->templateClass;
5279 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5280 {
5281 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5282 {
5283 for(sClass = sClass->base; sClass; sClass = sClass->base)
5284 {
5285 if(sClass->templateClass)
5286 sClass = sClass->templateClass;
5287 id += sClass->templateParams.count;
5288 }
5289 break;
5290 }
5291 id++;
5292 }
5293 if(curParam)
5294 break;
5295 }
5296 if(curParam)
5297 {
5298 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5299
5300 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
5301 }
5302 }
5303 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)))
5304 {
5305 char type[1024];
5306
5307 type[0] = (char)0;
5308 PrintType(paramDest, type, 0x0, 0x1);
5309 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5310 if(paramDestType != paramDest)
5311 FreeType(paramDestType);
5312 return 0x0;
5313 }
5314 if(paramDestType != paramDest)
5315 FreeType(paramDestType);
5316 }
5317 paramSource = paramSource->next;
5318 }
5319 if(paramSource)
5320 {
5321 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5322 return 0x0;
5323 }
5324 return 0x1;
5325 }
5326 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5327 {
5328 return 0x1;
5329 }
5330 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5331 {
5332 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5333 return 0x1;
5334 }
5335 }
5336 return 0x0;
5337 }
5338
5339 static void FreeConvert(struct Conversion * convert)
5340 {
5341 if(convert->resultType)
5342 FreeType(convert->resultType);
5343 }
5344
5345 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5346
5347 struct __ecereNameSpace__ecere__com__BTNamedLink
5348 {
5349 const char *  name;
5350 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5351 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5352 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5353 int depth;
5354 void *  data;
5355 } __attribute__ ((gcc_struct));
5356
5357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5358
5359 struct __ecereNameSpace__ecere__com__EnumClassData
5360 {
5361 struct __ecereNameSpace__ecere__sys__OldList values;
5362 int largest;
5363 } __attribute__ ((gcc_struct));
5364
5365 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5366
5367 struct __ecereNameSpace__ecere__sys__NamedLink
5368 {
5369 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5370 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5371 char *  name;
5372 void *  data;
5373 } __attribute__ ((gcc_struct));
5374
5375 extern void FreeExpContents(struct Expression * exp);
5376
5377 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5378
5379 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5380
5381 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5382
5383 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5384
5385 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5386
5387 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5388 {
5389 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5390
5391 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)))
5392 {
5393 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5394
5395 if(_class->type == 4)
5396 {
5397 struct __ecereNameSpace__ecere__sys__OldList converts =
5398 {
5399 0, 0, 0, 0, 0
5400 };
5401 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5402
5403 type->kind = 8;
5404 if(!_class->symbol)
5405 _class->symbol = FindClass(_class->fullName);
5406 type->__anon1._class = _class->symbol;
5407 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0, 0x0))
5408 {
5409 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5410 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5411
5412 if(enumClass)
5413 {
5414 struct __ecereNameSpace__ecere__com__Class * baseClass;
5415
5416 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5417 {
5418 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5419
5420 for(value = e->values.first; value; value = value->next)
5421 {
5422 if(!strcmp(value->name, string))
5423 break;
5424 }
5425 if(value)
5426 {
5427 FreeExpContents(sourceExp);
5428 FreeType(sourceExp->expType);
5429 sourceExp->isConstant = 0x1;
5430 sourceExp->expType = MkClassType(baseClass->fullName);
5431 {
5432 char constant[256];
5433
5434 sourceExp->type = 2;
5435 if(!strcmp(baseClass->dataTypeString, "int"))
5436 sprintf(constant, "%d", (int)value->data);
5437 else
5438 sprintf(constant, "0x%X", (int)value->data);
5439 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5440 }
5441 while(converts.first)
5442 {
5443 struct Conversion * convert = converts.first;
5444
5445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5447 }
5448 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5449 return 0x1;
5450 }
5451 }
5452 }
5453 }
5454 if(converts.first)
5455 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5456 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5457 }
5458 }
5459 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)))
5460 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5461 return 0x1;
5462 return 0x0;
5463 }
5464
5465 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5466
5467 struct __ecereNameSpace__ecere__com__SubModule
5468 {
5469 struct __ecereNameSpace__ecere__com__SubModule * prev;
5470 struct __ecereNameSpace__ecere__com__SubModule * next;
5471 struct __ecereNameSpace__ecere__com__Instance * module;
5472 int importMode;
5473 } __attribute__ ((gcc_struct));
5474
5475 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5476 {
5477 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5478
5479 if(searchFor == searchIn)
5480 return 0x1;
5481 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5482 {
5483 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5484 {
5485 if(ModuleVisibility(subModule->module, searchFor))
5486 return 0x1;
5487 }
5488 }
5489 return 0x0;
5490 }
5491
5492 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5493
5494 struct __ecereNameSpace__ecere__com__Application
5495 {
5496 int argc;
5497 const char * *  argv;
5498 int exitCode;
5499 unsigned int isGUIApp;
5500 struct __ecereNameSpace__ecere__sys__OldList allModules;
5501 char *  parsedCommand;
5502 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5503 } __attribute__ ((gcc_struct));
5504
5505 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5506 {
5507 struct __ecereNameSpace__ecere__com__Instance * module;
5508
5509 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))
5510 return 0x1;
5511 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))
5512 return 0x1;
5513 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))
5514 return 0x1;
5515 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)
5516 {
5517 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5518 return 0x1;
5519 }
5520 return 0x0;
5521 }
5522
5523 extern struct Expression * CopyExpression(struct Expression * exp);
5524
5525 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5526
5527 void ReadString(char *  output, char *  string);
5528
5529 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5530
5531 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5532
5533 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5534
5535 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5536 {
5537 struct Type * source;
5538 struct Type * realDest = dest;
5539 struct Type * backupSourceExpType = (((void *)0));
5540 struct Expression * computedExp = sourceExp;
5541
5542 dest->refCount++;
5543 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)
5544 {
5545 computedExp = CopyExpression(sourceExp);
5546 ComputeExpression(computedExp);
5547 }
5548 source = sourceExp->expType;
5549 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5550 {
5551 if(computedExp != sourceExp)
5552 {
5553 FreeExpression(computedExp);
5554 computedExp = sourceExp;
5555 }
5556 FreeType(dest);
5557 return 0x1;
5558 }
5559 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5560 {
5561 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5562 {
5563 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5564
5565 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5566 ;
5567 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5568 ;
5569 if(sourceBase == destBase)
5570 {
5571 if(computedExp != sourceExp)
5572 {
5573 FreeExpression(computedExp);
5574 computedExp = sourceExp;
5575 }
5576 FreeType(dest);
5577 return 0x1;
5578 }
5579 }
5580 }
5581 if(source)
5582 {
5583 struct __ecereNameSpace__ecere__sys__OldList * specs;
5584 unsigned int flag = 0x0;
5585 long long value = (((int)0x7fffffff));
5586
5587 source->refCount++;
5588 if(computedExp->type == 2)
5589 {
5590 if(source->isSigned)
5591 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5592 else
5593 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5594 }
5595 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5596 {
5597 if(source->isSigned)
5598 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5599 else
5600 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5601 }
5602 if(computedExp != sourceExp)
5603 {
5604 FreeExpression(computedExp);
5605 computedExp = sourceExp;
5606 }
5607 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"))
5608 {
5609 FreeType(source);
5610 source = __extension__ ({
5611 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5612
5613 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5614 });
5615 }
5616 if(dest->kind == 8)
5617 {
5618 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5619
5620 if(_class && _class->type == 3)
5621 {
5622 if(source->kind != 8)
5623 {
5624 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5625 struct Type * tempDest, * tempSource;
5626
5627 for(; _class->base->type != 1000; _class = _class->base)
5628 ;
5629 tempSource = dest;
5630 tempDest = tempType;
5631 tempType->kind = 8;
5632 if(!_class->symbol)
5633 _class->symbol = FindClass(_class->fullName);
5634 tempType->__anon1._class = _class->symbol;
5635 tempType->truth = dest->truth;
5636 if(tempType->__anon1._class)
5637 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5638 backupSourceExpType = sourceExp->expType;
5639 sourceExp->expType = dest;
5640 dest->refCount++;
5641 flag = 0x1;
5642 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5643 }
5644 }
5645 if(_class && _class->type == 2 && source->kind != 8)
5646 {
5647 if(!dest->__anon1._class->__anon1.registered->dataType)
5648 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5649 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5650 {
5651 FreeType(source);
5652 FreeType(sourceExp->expType);
5653 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5654 source->refCount++;
5655 }
5656 }
5657 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5658 {
5659 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5660 struct Declarator * decl;
5661 char string[1024];
5662
5663 ReadString(string, sourceExp->__anon1.__anon2.string);
5664 decl = SpecDeclFromString(string, specs, (((void *)0)));
5665 FreeExpContents(sourceExp);
5666 FreeType(sourceExp->expType);
5667 sourceExp->type = 24;
5668 sourceExp->__anon1._classExp.specifiers = specs;
5669 sourceExp->__anon1._classExp.decl = decl;
5670 sourceExp->expType = dest;
5671 dest->refCount++;
5672 FreeType(source);
5673 FreeType(dest);
5674 if(backupSourceExpType)
5675 FreeType(backupSourceExpType);
5676 return 0x1;
5677 }
5678 }
5679 else if(source->kind == 8)
5680 {
5681 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5682
5683 if(_class && (_class->type == 3 || _class->type == 2))
5684 {
5685 if(dest->kind != 8)
5686 {
5687 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5688 struct Type * tempDest, * tempSource;
5689
5690 if(!source->__anon1._class->__anon1.registered->dataType)
5691 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5692 for(; _class->base->type != 1000; _class = _class->base)
5693 ;
5694 tempDest = source;
5695 tempSource = tempType;
5696 tempType->kind = 8;
5697 tempType->__anon1._class = FindClass(_class->fullName);
5698 tempType->truth = source->truth;
5699 tempType->classObjectType = source->classObjectType;
5700 if(tempType->__anon1._class)
5701 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5702 if(conversions->last)
5703 {
5704 ((struct Conversion *)conversions->last)->resultType = dest;
5705 dest->refCount++;
5706 }
5707 FreeType(sourceExp->expType);
5708 sourceExp->expType = MkClassType(_class->fullName);
5709 sourceExp->expType->truth = source->truth;
5710 sourceExp->expType->classObjectType = source->classObjectType;
5711 if(!sourceExp->destType)
5712 {
5713 FreeType(sourceExp->destType);
5714 sourceExp->destType = sourceExp->expType;
5715 if(sourceExp->expType)
5716 sourceExp->expType->refCount++;
5717 }
5718 if(!_class->dataType)
5719 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5720 FreeType(dest);
5721 dest = MkClassType(source->__anon1._class->string);
5722 dest->truth = source->truth;
5723 dest->classObjectType = source->classObjectType;
5724 FreeType(source);
5725 source = _class->dataType;
5726 source->refCount++;
5727 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5728 }
5729 }
5730 }
5731 if(!flag)
5732 {
5733 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5734 {
5735 FreeType(source);
5736 FreeType(dest);
5737 return 0x1;
5738 }
5739 }
5740 if(dest->kind == 8)
5741 {
5742 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5743 unsigned int fittingValue = 0x0;
5744
5745 if(_class && _class->type == 4)
5746 {
5747 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5748 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5749
5750 if(c && value >= 0 && value <= c->largest)
5751 fittingValue = 0x1;
5752 }
5753 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5754 {
5755 if(_class->type == 0 || _class->type == 5)
5756 {
5757 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5758
5759 *newExp = *sourceExp;
5760 if(sourceExp->destType)
5761 sourceExp->destType->refCount++;
5762 if(sourceExp->expType)
5763 sourceExp->expType->refCount++;
5764 sourceExp->type = 11;
5765 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5766 sourceExp->__anon1.cast.exp = newExp;
5767 FreeType(sourceExp->expType);
5768 sourceExp->expType = (((void *)0));
5769 ProcessExpressionType(sourceExp);
5770 if(!inCompiler)
5771 {
5772 FreeType(sourceExp->expType);
5773 sourceExp->expType = dest;
5774 }
5775 FreeType(source);
5776 if(inCompiler)
5777 FreeType(dest);
5778 if(backupSourceExpType)
5779 FreeType(backupSourceExpType);
5780 return 0x1;
5781 }
5782 if(!_class->dataType)
5783 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5784 FreeType(dest);
5785 dest = _class->dataType;
5786 dest->refCount++;
5787 }
5788 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))
5789 {
5790 specs = MkListOne(MkSpecifier(DOUBLE));
5791 }
5792 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))
5793 {
5794 specs = MkListOne(MkSpecifier(FLOAT));
5795 }
5796 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))
5797 {
5798 specs = MkList();
5799 if(!dest->isSigned)
5800 ListAdd(specs, MkSpecifier(UNSIGNED));
5801 ListAdd(specs, MkSpecifier(INT64));
5802 }
5803 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5804 {
5805 specs = MkList();
5806 if(!dest->isSigned)
5807 ListAdd(specs, MkSpecifier(UNSIGNED));
5808 ListAdd(specs, MkSpecifier(INT));
5809 }
5810 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5811 {
5812 specs = MkList();
5813 if(!dest->isSigned)
5814 ListAdd(specs, MkSpecifier(UNSIGNED));
5815 ListAdd(specs, MkSpecifier(SHORT));
5816 }
5817 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5818 {
5819 specs = MkList();
5820 if(!dest->isSigned)
5821 ListAdd(specs, MkSpecifier(UNSIGNED));
5822 ListAdd(specs, MkSpecifier(CHAR));
5823 }
5824 else
5825 {
5826 FreeType(source);
5827 FreeType(dest);
5828 if(backupSourceExpType)
5829 {
5830 if(sourceExp->expType)
5831 FreeType(sourceExp->expType);
5832 sourceExp->expType = backupSourceExpType;
5833 }
5834 return 0x0;
5835 }
5836 }
5837 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))
5838 {
5839 specs = MkListOne(MkSpecifier(DOUBLE));
5840 }
5841 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))
5842 {
5843 specs = MkListOne(MkSpecifier(FLOAT));
5844 }
5845 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5846 {
5847 specs = MkList();
5848 ListAdd(specs, MkSpecifier(BOOL));
5849 }
5850 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)))
5851 {
5852 specs = MkList();
5853 if(!dest->isSigned)
5854 ListAdd(specs, MkSpecifier(UNSIGNED));
5855 ListAdd(specs, MkSpecifier(CHAR));
5856 }
5857 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)))))
5858 {
5859 specs = MkList();
5860 if(!dest->isSigned)
5861 ListAdd(specs, MkSpecifier(UNSIGNED));
5862 ListAdd(specs, MkSpecifier(SHORT));
5863 }
5864 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5865 {
5866 specs = MkList();
5867 if(!dest->isSigned)
5868 ListAdd(specs, MkSpecifier(UNSIGNED));
5869 ListAdd(specs, MkSpecifier(INT));
5870 }
5871 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5872 {
5873 specs = MkList();
5874 if(!dest->isSigned)
5875 ListAdd(specs, MkSpecifier(UNSIGNED));
5876 ListAdd(specs, MkSpecifier(INT64));
5877 }
5878 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5879 {
5880 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5881 }
5882 else
5883 {
5884 FreeType(source);
5885 FreeType(dest);
5886 if(backupSourceExpType)
5887 {
5888 if(sourceExp->expType)
5889 FreeType(sourceExp->expType);
5890 sourceExp->expType = backupSourceExpType;
5891 }
5892 return 0x0;
5893 }
5894 if(!flag && !sourceExp->opDestType)
5895 {
5896 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5897
5898 *newExp = *sourceExp;
5899 newExp->prev = (((void *)0));
5900 newExp->next = (((void *)0));
5901 if(sourceExp->destType)
5902 sourceExp->destType->refCount++;
5903 if(sourceExp->expType)
5904 sourceExp->expType->refCount++;
5905 sourceExp->type = 11;
5906 if(realDest->kind == 8)
5907 {
5908 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5909 FreeList(specs, FreeSpecifier);
5910 }
5911 else
5912 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5913 if(newExp->type == 4)
5914 {
5915 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5916 }
5917 else
5918 sourceExp->__anon1.cast.exp = newExp;
5919 FreeType(sourceExp->expType);
5920 sourceExp->expType = (((void *)0));
5921 ProcessExpressionType(sourceExp);
5922 }
5923 else
5924 FreeList(specs, FreeSpecifier);
5925 FreeType(dest);
5926 FreeType(source);
5927 if(backupSourceExpType)
5928 FreeType(backupSourceExpType);
5929 return 0x1;
5930 }
5931 else
5932 {
5933 if(computedExp != sourceExp)
5934 {
5935 FreeExpression(computedExp);
5936 computedExp = sourceExp;
5937 }
5938 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5939 sourceExp = (*sourceExp->__anon1.list).last;
5940 if(sourceExp->type == 0)
5941 {
5942 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5943
5944 if(dest->kind == 8)
5945 {
5946 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5947 {
5948 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5949 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5950
5951 if(enumClass)
5952 {
5953 for(; _class && _class->type == 4; _class = _class->base)
5954 {
5955 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5956 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5957
5958 for(value = e->values.first; value; value = value->next)
5959 {
5960 if(!strcmp(value->name, id->string))
5961 break;
5962 }
5963 if(value)
5964 {
5965 FreeExpContents(sourceExp);
5966 FreeType(sourceExp->expType);
5967 sourceExp->isConstant = 0x1;
5968 sourceExp->expType = MkClassType(_class->fullName);
5969 {
5970 char constant[256];
5971
5972 sourceExp->type = 2;
5973 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5974 sprintf(constant, "%d", (int)value->data);
5975 else
5976 sprintf(constant, "0x%X", (int)value->data);
5977 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5978 }
5979 FreeType(dest);
5980 return 0x1;
5981 }
5982 }
5983 }
5984 }
5985 }
5986 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5987 {
5988 FreeType(dest);
5989 return 0x1;
5990 }
5991 }
5992 FreeType(dest);
5993 }
5994 return 0x0;
5995 }
5996
5997 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5998 {
5999 int value2 = op2->__anon1.i;
6000
6001 exp->type = 2;
6002 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6003 if(!exp->expType)
6004 {
6005 exp->expType = op1->type;
6006 if(op1->type)
6007 op1->type->refCount++;
6008 }
6009 return 0x1;
6010 }
6011
6012 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6013 {
6014 unsigned int value2 = op2->__anon1.ui;
6015
6016 exp->type = 2;
6017 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6018 if(!exp->expType)
6019 {
6020 exp->expType = op1->type;
6021 if(op1->type)
6022 op1->type->refCount++;
6023 }
6024 return 0x1;
6025 }
6026
6027 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6028 {
6029 long long value2 = op2->__anon1.i64;
6030
6031 exp->type = 2;
6032 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6033 if(!exp->expType)
6034 {
6035 exp->expType = op1->type;
6036 if(op1->type)
6037 op1->type->refCount++;
6038 }
6039 return 0x1;
6040 }
6041
6042 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6043 {
6044 uint64 value2 = op2->__anon1.ui64;
6045
6046 exp->type = 2;
6047 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6048 if(!exp->expType)
6049 {
6050 exp->expType = op1->type;
6051 if(op1->type)
6052 op1->type->refCount++;
6053 }
6054 return 0x1;
6055 }
6056
6057 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6058 {
6059 short value2 = op2->__anon1.s;
6060
6061 exp->type = 2;
6062 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6063 if(!exp->expType)
6064 {
6065 exp->expType = op1->type;
6066 if(op1->type)
6067 op1->type->refCount++;
6068 }
6069 return 0x1;
6070 }
6071
6072 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6073 {
6074 unsigned short value2 = op2->__anon1.us;
6075
6076 exp->type = 2;
6077 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6078 if(!exp->expType)
6079 {
6080 exp->expType = op1->type;
6081 if(op1->type)
6082 op1->type->refCount++;
6083 }
6084 return 0x1;
6085 }
6086
6087 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6088 {
6089 char value2 = op2->__anon1.c;
6090
6091 exp->type = 2;
6092 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6093 if(!exp->expType)
6094 {
6095 exp->expType = op1->type;
6096 if(op1->type)
6097 op1->type->refCount++;
6098 }
6099 return 0x1;
6100 }
6101
6102 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6103 {
6104 unsigned char value2 = op2->__anon1.uc;
6105
6106 exp->type = 2;
6107 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6108 if(!exp->expType)
6109 {
6110 exp->expType = op1->type;
6111 if(op1->type)
6112 op1->type->refCount++;
6113 }
6114 return 0x1;
6115 }
6116
6117 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6118 {
6119 float value2 = op2->__anon1.f;
6120
6121 exp->type = 2;
6122 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6123 if(!exp->expType)
6124 {
6125 exp->expType = op1->type;
6126 if(op1->type)
6127 op1->type->refCount++;
6128 }
6129 return 0x1;
6130 }
6131
6132 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6133 {
6134 double value2 = op2->__anon1.d;
6135
6136 exp->type = 2;
6137 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6138 if(!exp->expType)
6139 {
6140 exp->expType = op1->type;
6141 if(op1->type)
6142 op1->type->refCount++;
6143 }
6144 return 0x1;
6145 }
6146
6147 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6148 {
6149 int value2 = op2->__anon1.i;
6150
6151 exp->type = 2;
6152 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6153 if(!exp->expType)
6154 {
6155 exp->expType = op1->type;
6156 if(op1->type)
6157 op1->type->refCount++;
6158 }
6159 return 0x1;
6160 }
6161
6162 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6163 {
6164 unsigned int value2 = op2->__anon1.ui;
6165
6166 exp->type = 2;
6167 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6168 if(!exp->expType)
6169 {
6170 exp->expType = op1->type;
6171 if(op1->type)
6172 op1->type->refCount++;
6173 }
6174 return 0x1;
6175 }
6176
6177 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6178 {
6179 long long value2 = op2->__anon1.i64;
6180
6181 exp->type = 2;
6182 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6183 if(!exp->expType)
6184 {
6185 exp->expType = op1->type;
6186 if(op1->type)
6187 op1->type->refCount++;
6188 }
6189 return 0x1;
6190 }
6191
6192 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6193 {
6194 uint64 value2 = op2->__anon1.ui64;
6195
6196 exp->type = 2;
6197 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6198 if(!exp->expType)
6199 {
6200 exp->expType = op1->type;
6201 if(op1->type)
6202 op1->type->refCount++;
6203 }
6204 return 0x1;
6205 }
6206
6207 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6208 {
6209 short value2 = op2->__anon1.s;
6210
6211 exp->type = 2;
6212 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6213 if(!exp->expType)
6214 {
6215 exp->expType = op1->type;
6216 if(op1->type)
6217 op1->type->refCount++;
6218 }
6219 return 0x1;
6220 }
6221
6222 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6223 {
6224 unsigned short value2 = op2->__anon1.us;
6225
6226 exp->type = 2;
6227 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6228 if(!exp->expType)
6229 {
6230 exp->expType = op1->type;
6231 if(op1->type)
6232 op1->type->refCount++;
6233 }
6234 return 0x1;
6235 }
6236
6237 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6238 {
6239 char value2 = op2->__anon1.c;
6240
6241 exp->type = 2;
6242 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6243 if(!exp->expType)
6244 {
6245 exp->expType = op1->type;
6246 if(op1->type)
6247 op1->type->refCount++;
6248 }
6249 return 0x1;
6250 }
6251
6252 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6253 {
6254 unsigned char value2 = op2->__anon1.uc;
6255
6256 exp->type = 2;
6257 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6258 if(!exp->expType)
6259 {
6260 exp->expType = op1->type;
6261 if(op1->type)
6262 op1->type->refCount++;
6263 }
6264 return 0x1;
6265 }
6266
6267 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6268 {
6269 float value2 = op2->__anon1.f;
6270
6271 exp->type = 2;
6272 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6273 if(!exp->expType)
6274 {
6275 exp->expType = op1->type;
6276 if(op1->type)
6277 op1->type->refCount++;
6278 }
6279 return 0x1;
6280 }
6281
6282 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6283 {
6284 double value2 = op2->__anon1.d;
6285
6286 exp->type = 2;
6287 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6288 if(!exp->expType)
6289 {
6290 exp->expType = op1->type;
6291 if(op1->type)
6292 op1->type->refCount++;
6293 }
6294 return 0x1;
6295 }
6296
6297 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6298 {
6299 int value2 = op2->__anon1.i;
6300
6301 exp->type = 2;
6302 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6303 if(!exp->expType)
6304 {
6305 exp->expType = op1->type;
6306 if(op1->type)
6307 op1->type->refCount++;
6308 }
6309 return 0x1;
6310 }
6311
6312 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6313 {
6314 unsigned int value2 = op2->__anon1.ui;
6315
6316 exp->type = 2;
6317 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6318 if(!exp->expType)
6319 {
6320 exp->expType = op1->type;
6321 if(op1->type)
6322 op1->type->refCount++;
6323 }
6324 return 0x1;
6325 }
6326
6327 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6328 {
6329 long long value2 = op2->__anon1.i64;
6330
6331 exp->type = 2;
6332 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6333 if(!exp->expType)
6334 {
6335 exp->expType = op1->type;
6336 if(op1->type)
6337 op1->type->refCount++;
6338 }
6339 return 0x1;
6340 }
6341
6342 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6343 {
6344 uint64 value2 = op2->__anon1.ui64;
6345
6346 exp->type = 2;
6347 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6348 if(!exp->expType)
6349 {
6350 exp->expType = op1->type;
6351 if(op1->type)
6352 op1->type->refCount++;
6353 }
6354 return 0x1;
6355 }
6356
6357 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6358 {
6359 short value2 = op2->__anon1.s;
6360
6361 exp->type = 2;
6362 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6363 if(!exp->expType)
6364 {
6365 exp->expType = op1->type;
6366 if(op1->type)
6367 op1->type->refCount++;
6368 }
6369 return 0x1;
6370 }
6371
6372 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6373 {
6374 unsigned short value2 = op2->__anon1.us;
6375
6376 exp->type = 2;
6377 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6378 if(!exp->expType)
6379 {
6380 exp->expType = op1->type;
6381 if(op1->type)
6382 op1->type->refCount++;
6383 }
6384 return 0x1;
6385 }
6386
6387 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6388 {
6389 char value2 = op2->__anon1.c;
6390
6391 exp->type = 2;
6392 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6393 if(!exp->expType)
6394 {
6395 exp->expType = op1->type;
6396 if(op1->type)
6397 op1->type->refCount++;
6398 }
6399 return 0x1;
6400 }
6401
6402 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6403 {
6404 unsigned char value2 = op2->__anon1.uc;
6405
6406 exp->type = 2;
6407 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6408 if(!exp->expType)
6409 {
6410 exp->expType = op1->type;
6411 if(op1->type)
6412 op1->type->refCount++;
6413 }
6414 return 0x1;
6415 }
6416
6417 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6418 {
6419 float value2 = op2->__anon1.f;
6420
6421 exp->type = 2;
6422 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6423 if(!exp->expType)
6424 {
6425 exp->expType = op1->type;
6426 if(op1->type)
6427 op1->type->refCount++;
6428 }
6429 return 0x1;
6430 }
6431
6432 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6433 {
6434 double value2 = op2->__anon1.d;
6435
6436 exp->type = 2;
6437 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6438 if(!exp->expType)
6439 {
6440 exp->expType = op1->type;
6441 if(op1->type)
6442 op1->type->refCount++;
6443 }
6444 return 0x1;
6445 }
6446
6447 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6448 {
6449 int value2 = op2->__anon1.i;
6450
6451 exp->type = 2;
6452 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6453 if(!exp->expType)
6454 {
6455 exp->expType = op1->type;
6456 if(op1->type)
6457 op1->type->refCount++;
6458 }
6459 return 0x1;
6460 }
6461
6462 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6463 {
6464 unsigned int value2 = op2->__anon1.ui;
6465
6466 exp->type = 2;
6467 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6468 if(!exp->expType)
6469 {
6470 exp->expType = op1->type;
6471 if(op1->type)
6472 op1->type->refCount++;
6473 }
6474 return 0x1;
6475 }
6476
6477 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6478 {
6479 long long value2 = op2->__anon1.i64;
6480
6481 exp->type = 2;
6482 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6483 if(!exp->expType)
6484 {
6485 exp->expType = op1->type;
6486 if(op1->type)
6487 op1->type->refCount++;
6488 }
6489 return 0x1;
6490 }
6491
6492 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6493 {
6494 uint64 value2 = op2->__anon1.ui64;
6495
6496 exp->type = 2;
6497 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6498 if(!exp->expType)
6499 {
6500 exp->expType = op1->type;
6501 if(op1->type)
6502 op1->type->refCount++;
6503 }
6504 return 0x1;
6505 }
6506
6507 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6508 {
6509 short value2 = op2->__anon1.s;
6510
6511 exp->type = 2;
6512 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6513 if(!exp->expType)
6514 {
6515 exp->expType = op1->type;
6516 if(op1->type)
6517 op1->type->refCount++;
6518 }
6519 return 0x1;
6520 }
6521
6522 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6523 {
6524 unsigned short value2 = op2->__anon1.us;
6525
6526 exp->type = 2;
6527 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6528 if(!exp->expType)
6529 {
6530 exp->expType = op1->type;
6531 if(op1->type)
6532 op1->type->refCount++;
6533 }
6534 return 0x1;
6535 }
6536
6537 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6538 {
6539 char value2 = op2->__anon1.c;
6540
6541 exp->type = 2;
6542 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6543 if(!exp->expType)
6544 {
6545 exp->expType = op1->type;
6546 if(op1->type)
6547 op1->type->refCount++;
6548 }
6549 return 0x1;
6550 }
6551
6552 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6553 {
6554 unsigned char value2 = op2->__anon1.uc;
6555
6556 exp->type = 2;
6557 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6558 if(!exp->expType)
6559 {
6560 exp->expType = op1->type;
6561 if(op1->type)
6562 op1->type->refCount++;
6563 }
6564 return 0x1;
6565 }
6566
6567 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6568 {
6569 float value2 = op2->__anon1.f;
6570
6571 exp->type = 2;
6572 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6573 if(!exp->expType)
6574 {
6575 exp->expType = op1->type;
6576 if(op1->type)
6577 op1->type->refCount++;
6578 }
6579 return 0x1;
6580 }
6581
6582 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6583 {
6584 double value2 = op2->__anon1.d;
6585
6586 exp->type = 2;
6587 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6588 if(!exp->expType)
6589 {
6590 exp->expType = op1->type;
6591 if(op1->type)
6592 op1->type->refCount++;
6593 }
6594 return 0x1;
6595 }
6596
6597 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6598 {
6599 int value2 = op2->__anon1.i;
6600
6601 exp->type = 2;
6602 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6603 if(!exp->expType)
6604 {
6605 exp->expType = op1->type;
6606 if(op1->type)
6607 op1->type->refCount++;
6608 }
6609 return 0x1;
6610 }
6611
6612 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6613 {
6614 unsigned int value2 = op2->__anon1.ui;
6615
6616 exp->type = 2;
6617 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6618 if(!exp->expType)
6619 {
6620 exp->expType = op1->type;
6621 if(op1->type)
6622 op1->type->refCount++;
6623 }
6624 return 0x1;
6625 }
6626
6627 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6628 {
6629 long long value2 = op2->__anon1.i64;
6630
6631 exp->type = 2;
6632 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6633 if(!exp->expType)
6634 {
6635 exp->expType = op1->type;
6636 if(op1->type)
6637 op1->type->refCount++;
6638 }
6639 return 0x1;
6640 }
6641
6642 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6643 {
6644 uint64 value2 = op2->__anon1.ui64;
6645
6646 exp->type = 2;
6647 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6648 if(!exp->expType)
6649 {
6650 exp->expType = op1->type;
6651 if(op1->type)
6652 op1->type->refCount++;
6653 }
6654 return 0x1;
6655 }
6656
6657 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6658 {
6659 short value2 = op2->__anon1.s;
6660
6661 exp->type = 2;
6662 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6663 if(!exp->expType)
6664 {
6665 exp->expType = op1->type;
6666 if(op1->type)
6667 op1->type->refCount++;
6668 }
6669 return 0x1;
6670 }
6671
6672 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6673 {
6674 unsigned short value2 = op2->__anon1.us;
6675
6676 exp->type = 2;
6677 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6678 if(!exp->expType)
6679 {
6680 exp->expType = op1->type;
6681 if(op1->type)
6682 op1->type->refCount++;
6683 }
6684 return 0x1;
6685 }
6686
6687 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6688 {
6689 char value2 = op2->__anon1.c;
6690
6691 exp->type = 2;
6692 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6693 if(!exp->expType)
6694 {
6695 exp->expType = op1->type;
6696 if(op1->type)
6697 op1->type->refCount++;
6698 }
6699 return 0x1;
6700 }
6701
6702 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6703 {
6704 unsigned char value2 = op2->__anon1.uc;
6705
6706 exp->type = 2;
6707 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6708 if(!exp->expType)
6709 {
6710 exp->expType = op1->type;
6711 if(op1->type)
6712 op1->type->refCount++;
6713 }
6714 return 0x1;
6715 }
6716
6717 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6718 {
6719 exp->type = 2;
6720 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6721 if(!exp->expType)
6722 {
6723 exp->expType = op1->type;
6724 if(op1->type)
6725 op1->type->refCount++;
6726 }
6727 return 0x1;
6728 }
6729
6730 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6731 {
6732 exp->type = 2;
6733 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6734 if(!exp->expType)
6735 {
6736 exp->expType = op1->type;
6737 if(op1->type)
6738 op1->type->refCount++;
6739 }
6740 return 0x1;
6741 }
6742
6743 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6744 {
6745 exp->type = 2;
6746 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6747 if(!exp->expType)
6748 {
6749 exp->expType = op1->type;
6750 if(op1->type)
6751 op1->type->refCount++;
6752 }
6753 return 0x1;
6754 }
6755
6756 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6757 {
6758 exp->type = 2;
6759 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6760 if(!exp->expType)
6761 {
6762 exp->expType = op1->type;
6763 if(op1->type)
6764 op1->type->refCount++;
6765 }
6766 return 0x1;
6767 }
6768
6769 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6770 {
6771 exp->type = 2;
6772 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6773 if(!exp->expType)
6774 {
6775 exp->expType = op1->type;
6776 if(op1->type)
6777 op1->type->refCount++;
6778 }
6779 return 0x1;
6780 }
6781
6782 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6783 {
6784 exp->type = 2;
6785 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6786 if(!exp->expType)
6787 {
6788 exp->expType = op1->type;
6789 if(op1->type)
6790 op1->type->refCount++;
6791 }
6792 return 0x1;
6793 }
6794
6795 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6796 {
6797 exp->type = 2;
6798 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6799 if(!exp->expType)
6800 {
6801 exp->expType = op1->type;
6802 if(op1->type)
6803 op1->type->refCount++;
6804 }
6805 return 0x1;
6806 }
6807
6808 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6809 {
6810 exp->type = 2;
6811 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6812 if(!exp->expType)
6813 {
6814 exp->expType = op1->type;
6815 if(op1->type)
6816 op1->type->refCount++;
6817 }
6818 return 0x1;
6819 }
6820
6821 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6822 {
6823 exp->type = 2;
6824 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6825 if(!exp->expType)
6826 {
6827 exp->expType = op1->type;
6828 if(op1->type)
6829 op1->type->refCount++;
6830 }
6831 return 0x1;
6832 }
6833
6834 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6835 {
6836 exp->type = 2;
6837 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6838 if(!exp->expType)
6839 {
6840 exp->expType = op1->type;
6841 if(op1->type)
6842 op1->type->refCount++;
6843 }
6844 return 0x1;
6845 }
6846
6847 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6848 {
6849 exp->type = 2;
6850 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6851 if(!exp->expType)
6852 {
6853 exp->expType = op1->type;
6854 if(op1->type)
6855 op1->type->refCount++;
6856 }
6857 return 0x1;
6858 }
6859
6860 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6861 {
6862 exp->type = 2;
6863 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6864 if(!exp->expType)
6865 {
6866 exp->expType = op1->type;
6867 if(op1->type)
6868 op1->type->refCount++;
6869 }
6870 return 0x1;
6871 }
6872
6873 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6874 {
6875 exp->type = 2;
6876 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6877 if(!exp->expType)
6878 {
6879 exp->expType = op1->type;
6880 if(op1->type)
6881 op1->type->refCount++;
6882 }
6883 return 0x1;
6884 }
6885
6886 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6887 {
6888 exp->type = 2;
6889 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6890 if(!exp->expType)
6891 {
6892 exp->expType = op1->type;
6893 if(op1->type)
6894 op1->type->refCount++;
6895 }
6896 return 0x1;
6897 }
6898
6899 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6900 {
6901 exp->type = 2;
6902 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6903 if(!exp->expType)
6904 {
6905 exp->expType = op1->type;
6906 if(op1->type)
6907 op1->type->refCount++;
6908 }
6909 return 0x1;
6910 }
6911
6912 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6913 {
6914 exp->type = 2;
6915 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6916 if(!exp->expType)
6917 {
6918 exp->expType = op1->type;
6919 if(op1->type)
6920 op1->type->refCount++;
6921 }
6922 return 0x1;
6923 }
6924
6925 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6926 {
6927 exp->type = 2;
6928 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6929 if(!exp->expType)
6930 {
6931 exp->expType = op1->type;
6932 if(op1->type)
6933 op1->type->refCount++;
6934 }
6935 return 0x1;
6936 }
6937
6938 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6939 {
6940 exp->type = 2;
6941 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6942 if(!exp->expType)
6943 {
6944 exp->expType = op1->type;
6945 if(op1->type)
6946 op1->type->refCount++;
6947 }
6948 return 0x1;
6949 }
6950
6951 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6952 {
6953 exp->type = 2;
6954 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6955 if(!exp->expType)
6956 {
6957 exp->expType = op1->type;
6958 if(op1->type)
6959 op1->type->refCount++;
6960 }
6961 return 0x1;
6962 }
6963
6964 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6965 {
6966 exp->type = 2;
6967 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6968 if(!exp->expType)
6969 {
6970 exp->expType = op1->type;
6971 if(op1->type)
6972 op1->type->refCount++;
6973 }
6974 return 0x1;
6975 }
6976
6977 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6978 {
6979 exp->type = 2;
6980 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 0x1;
6988 }
6989
6990 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6991 {
6992 exp->type = 2;
6993 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 0x1;
7001 }
7002
7003 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7004 {
7005 exp->type = 2;
7006 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7007 if(!exp->expType)
7008 {
7009 exp->expType = op1->type;
7010 if(op1->type)
7011 op1->type->refCount++;
7012 }
7013 return 0x1;
7014 }
7015
7016 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7017 {
7018 exp->type = 2;
7019 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7020 if(!exp->expType)
7021 {
7022 exp->expType = op1->type;
7023 if(op1->type)
7024 op1->type->refCount++;
7025 }
7026 return 0x1;
7027 }
7028
7029 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7030 {
7031 exp->type = 2;
7032 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7033 if(!exp->expType)
7034 {
7035 exp->expType = op1->type;
7036 if(op1->type)
7037 op1->type->refCount++;
7038 }
7039 return 0x1;
7040 }
7041
7042 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7043 {
7044 exp->type = 2;
7045 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7046 if(!exp->expType)
7047 {
7048 exp->expType = op1->type;
7049 if(op1->type)
7050 op1->type->refCount++;
7051 }
7052 return 0x1;
7053 }
7054
7055 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7056 {
7057 exp->type = 2;
7058 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7059 if(!exp->expType)
7060 {
7061 exp->expType = op1->type;
7062 if(op1->type)
7063 op1->type->refCount++;
7064 }
7065 return 0x1;
7066 }
7067
7068 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7069 {
7070 exp->type = 2;
7071 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7072 if(!exp->expType)
7073 {
7074 exp->expType = op1->type;
7075 if(op1->type)
7076 op1->type->refCount++;
7077 }
7078 return 0x1;
7079 }
7080
7081 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7082 {
7083 exp->type = 2;
7084 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7085 if(!exp->expType)
7086 {
7087 exp->expType = op1->type;
7088 if(op1->type)
7089 op1->type->refCount++;
7090 }
7091 return 0x1;
7092 }
7093
7094 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7095 {
7096 exp->type = 2;
7097 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7098 if(!exp->expType)
7099 {
7100 exp->expType = op1->type;
7101 if(op1->type)
7102 op1->type->refCount++;
7103 }
7104 return 0x1;
7105 }
7106
7107 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 {
7109 int value2 = op2->__anon1.i;
7110
7111 exp->type = 2;
7112 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7113 if(!exp->expType)
7114 {
7115 exp->expType = op1->type;
7116 if(op1->type)
7117 op1->type->refCount++;
7118 }
7119 return 0x1;
7120 }
7121
7122 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 {
7124 unsigned int value2 = op2->__anon1.ui;
7125
7126 exp->type = 2;
7127 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7128 if(!exp->expType)
7129 {
7130 exp->expType = op1->type;
7131 if(op1->type)
7132 op1->type->refCount++;
7133 }
7134 return 0x1;
7135 }
7136
7137 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 {
7139 long long value2 = op2->__anon1.i64;
7140
7141 exp->type = 2;
7142 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7143 if(!exp->expType)
7144 {
7145 exp->expType = op1->type;
7146 if(op1->type)
7147 op1->type->refCount++;
7148 }
7149 return 0x1;
7150 }
7151
7152 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 {
7154 uint64 value2 = op2->__anon1.ui64;
7155
7156 exp->type = 2;
7157 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7158 if(!exp->expType)
7159 {
7160 exp->expType = op1->type;
7161 if(op1->type)
7162 op1->type->refCount++;
7163 }
7164 return 0x1;
7165 }
7166
7167 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 {
7169 short value2 = op2->__anon1.s;
7170
7171 exp->type = 2;
7172 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7173 if(!exp->expType)
7174 {
7175 exp->expType = op1->type;
7176 if(op1->type)
7177 op1->type->refCount++;
7178 }
7179 return 0x1;
7180 }
7181
7182 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 {
7184 unsigned short value2 = op2->__anon1.us;
7185
7186 exp->type = 2;
7187 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7188 if(!exp->expType)
7189 {
7190 exp->expType = op1->type;
7191 if(op1->type)
7192 op1->type->refCount++;
7193 }
7194 return 0x1;
7195 }
7196
7197 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 {
7199 char value2 = op2->__anon1.c;
7200
7201 exp->type = 2;
7202 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7203 if(!exp->expType)
7204 {
7205 exp->expType = op1->type;
7206 if(op1->type)
7207 op1->type->refCount++;
7208 }
7209 return 0x1;
7210 }
7211
7212 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 {
7214 unsigned char value2 = op2->__anon1.uc;
7215
7216 exp->type = 2;
7217 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7218 if(!exp->expType)
7219 {
7220 exp->expType = op1->type;
7221 if(op1->type)
7222 op1->type->refCount++;
7223 }
7224 return 0x1;
7225 }
7226
7227 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 {
7229 float value2 = op2->__anon1.f;
7230
7231 exp->type = 2;
7232 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7233 if(!exp->expType)
7234 {
7235 exp->expType = op1->type;
7236 if(op1->type)
7237 op1->type->refCount++;
7238 }
7239 return 0x1;
7240 }
7241
7242 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 {
7244 double value2 = op2->__anon1.d;
7245
7246 exp->type = 2;
7247 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7248 if(!exp->expType)
7249 {
7250 exp->expType = op1->type;
7251 if(op1->type)
7252 op1->type->refCount++;
7253 }
7254 return 0x1;
7255 }
7256
7257 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 {
7259 int value2 = op2->__anon1.i;
7260
7261 exp->type = 2;
7262 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7263 if(!exp->expType)
7264 {
7265 exp->expType = op1->type;
7266 if(op1->type)
7267 op1->type->refCount++;
7268 }
7269 return 0x1;
7270 }
7271
7272 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 {
7274 unsigned int value2 = op2->__anon1.ui;
7275
7276 exp->type = 2;
7277 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7278 if(!exp->expType)
7279 {
7280 exp->expType = op1->type;
7281 if(op1->type)
7282 op1->type->refCount++;
7283 }
7284 return 0x1;
7285 }
7286
7287 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 {
7289 long long value2 = op2->__anon1.i64;
7290
7291 exp->type = 2;
7292 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7293 if(!exp->expType)
7294 {
7295 exp->expType = op1->type;
7296 if(op1->type)
7297 op1->type->refCount++;
7298 }
7299 return 0x1;
7300 }
7301
7302 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 {
7304 uint64 value2 = op2->__anon1.ui64;
7305
7306 exp->type = 2;
7307 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7308 if(!exp->expType)
7309 {
7310 exp->expType = op1->type;
7311 if(op1->type)
7312 op1->type->refCount++;
7313 }
7314 return 0x1;
7315 }
7316
7317 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 {
7319 short value2 = op2->__anon1.s;
7320
7321 exp->type = 2;
7322 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7323 if(!exp->expType)
7324 {
7325 exp->expType = op1->type;
7326 if(op1->type)
7327 op1->type->refCount++;
7328 }
7329 return 0x1;
7330 }
7331
7332 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 {
7334 unsigned short value2 = op2->__anon1.us;
7335
7336 exp->type = 2;
7337 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7338 if(!exp->expType)
7339 {
7340 exp->expType = op1->type;
7341 if(op1->type)
7342 op1->type->refCount++;
7343 }
7344 return 0x1;
7345 }
7346
7347 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7348 {
7349 char value2 = op2->__anon1.c;
7350
7351 exp->type = 2;
7352 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7353 if(!exp->expType)
7354 {
7355 exp->expType = op1->type;
7356 if(op1->type)
7357 op1->type->refCount++;
7358 }
7359 return 0x1;
7360 }
7361
7362 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7363 {
7364 unsigned char value2 = op2->__anon1.uc;
7365
7366 exp->type = 2;
7367 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7368 if(!exp->expType)
7369 {
7370 exp->expType = op1->type;
7371 if(op1->type)
7372 op1->type->refCount++;
7373 }
7374 return 0x1;
7375 }
7376
7377 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7378 {
7379 float value2 = op2->__anon1.f;
7380
7381 exp->type = 2;
7382 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7383 if(!exp->expType)
7384 {
7385 exp->expType = op1->type;
7386 if(op1->type)
7387 op1->type->refCount++;
7388 }
7389 return 0x1;
7390 }
7391
7392 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7393 {
7394 double value2 = op2->__anon1.d;
7395
7396 exp->type = 2;
7397 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7398 if(!exp->expType)
7399 {
7400 exp->expType = op1->type;
7401 if(op1->type)
7402 op1->type->refCount++;
7403 }
7404 return 0x1;
7405 }
7406
7407 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7408 {
7409 int value2 = op2->__anon1.i;
7410
7411 exp->type = 2;
7412 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7413 if(!exp->expType)
7414 {
7415 exp->expType = op1->type;
7416 if(op1->type)
7417 op1->type->refCount++;
7418 }
7419 return 0x1;
7420 }
7421
7422 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7423 {
7424 unsigned int value2 = op2->__anon1.ui;
7425
7426 exp->type = 2;
7427 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7428 if(!exp->expType)
7429 {
7430 exp->expType = op1->type;
7431 if(op1->type)
7432 op1->type->refCount++;
7433 }
7434 return 0x1;
7435 }
7436
7437 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7438 {
7439 long long value2 = op2->__anon1.i64;
7440
7441 exp->type = 2;
7442 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7443 if(!exp->expType)
7444 {
7445 exp->expType = op1->type;
7446 if(op1->type)
7447 op1->type->refCount++;
7448 }
7449 return 0x1;
7450 }
7451
7452 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7453 {
7454 uint64 value2 = op2->__anon1.ui64;
7455
7456 exp->type = 2;
7457 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7458 if(!exp->expType)
7459 {
7460 exp->expType = op1->type;
7461 if(op1->type)
7462 op1->type->refCount++;
7463 }
7464 return 0x1;
7465 }
7466
7467 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7468 {
7469 short value2 = op2->__anon1.s;
7470
7471 exp->type = 2;
7472 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7473 if(!exp->expType)
7474 {
7475 exp->expType = op1->type;
7476 if(op1->type)
7477 op1->type->refCount++;
7478 }
7479 return 0x1;
7480 }
7481
7482 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7483 {
7484 unsigned short value2 = op2->__anon1.us;
7485
7486 exp->type = 2;
7487 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7488 if(!exp->expType)
7489 {
7490 exp->expType = op1->type;
7491 if(op1->type)
7492 op1->type->refCount++;
7493 }
7494 return 0x1;
7495 }
7496
7497 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7498 {
7499 char value2 = op2->__anon1.c;
7500
7501 exp->type = 2;
7502 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7503 if(!exp->expType)
7504 {
7505 exp->expType = op1->type;
7506 if(op1->type)
7507 op1->type->refCount++;
7508 }
7509 return 0x1;
7510 }
7511
7512 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7513 {
7514 unsigned char value2 = op2->__anon1.uc;
7515
7516 exp->type = 2;
7517 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7518 if(!exp->expType)
7519 {
7520 exp->expType = op1->type;
7521 if(op1->type)
7522 op1->type->refCount++;
7523 }
7524 return 0x1;
7525 }
7526
7527 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7528 {
7529 float value2 = op2->__anon1.f;
7530
7531 exp->type = 2;
7532 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7533 if(!exp->expType)
7534 {
7535 exp->expType = op1->type;
7536 if(op1->type)
7537 op1->type->refCount++;
7538 }
7539 return 0x1;
7540 }
7541
7542 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7543 {
7544 double value2 = op2->__anon1.d;
7545
7546 exp->type = 2;
7547 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7548 if(!exp->expType)
7549 {
7550 exp->expType = op1->type;
7551 if(op1->type)
7552 op1->type->refCount++;
7553 }
7554 return 0x1;
7555 }
7556
7557 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7558 {
7559 int value2 = op2->__anon1.i;
7560
7561 exp->type = 2;
7562 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7563 if(!exp->expType)
7564 {
7565 exp->expType = op1->type;
7566 if(op1->type)
7567 op1->type->refCount++;
7568 }
7569 return 0x1;
7570 }
7571
7572 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7573 {
7574 unsigned int value2 = op2->__anon1.ui;
7575
7576 exp->type = 2;
7577 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7578 if(!exp->expType)
7579 {
7580 exp->expType = op1->type;
7581 if(op1->type)
7582 op1->type->refCount++;
7583 }
7584 return 0x1;
7585 }
7586
7587 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7588 {
7589 long long value2 = op2->__anon1.i64;
7590
7591 exp->type = 2;
7592 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7593 if(!exp->expType)
7594 {
7595 exp->expType = op1->type;
7596 if(op1->type)
7597 op1->type->refCount++;
7598 }
7599 return 0x1;
7600 }
7601
7602 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7603 {
7604 uint64 value2 = op2->__anon1.ui64;
7605
7606 exp->type = 2;
7607 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7608 if(!exp->expType)
7609 {
7610 exp->expType = op1->type;
7611 if(op1->type)
7612 op1->type->refCount++;
7613 }
7614 return 0x1;
7615 }
7616
7617 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7618 {
7619 short value2 = op2->__anon1.s;
7620
7621 exp->type = 2;
7622 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7623 if(!exp->expType)
7624 {
7625 exp->expType = op1->type;
7626 if(op1->type)
7627 op1->type->refCount++;
7628 }
7629 return 0x1;
7630 }
7631
7632 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7633 {
7634 unsigned short value2 = op2->__anon1.us;
7635
7636 exp->type = 2;
7637 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7638 if(!exp->expType)
7639 {
7640 exp->expType = op1->type;
7641 if(op1->type)
7642 op1->type->refCount++;
7643 }
7644 return 0x1;
7645 }
7646
7647 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7648 {
7649 char value2 = op2->__anon1.c;
7650
7651 exp->type = 2;
7652 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7653 if(!exp->expType)
7654 {
7655 exp->expType = op1->type;
7656 if(op1->type)
7657 op1->type->refCount++;
7658 }
7659 return 0x1;
7660 }
7661
7662 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7663 {
7664 unsigned char value2 = op2->__anon1.uc;
7665
7666 exp->type = 2;
7667 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7668 if(!exp->expType)
7669 {
7670 exp->expType = op1->type;
7671 if(op1->type)
7672 op1->type->refCount++;
7673 }
7674 return 0x1;
7675 }
7676
7677 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7678 {
7679 float value2 = op2->__anon1.f;
7680
7681 exp->type = 2;
7682 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7683 if(!exp->expType)
7684 {
7685 exp->expType = op1->type;
7686 if(op1->type)
7687 op1->type->refCount++;
7688 }
7689 return 0x1;
7690 }
7691
7692 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7693 {
7694 double value2 = op2->__anon1.d;
7695
7696 exp->type = 2;
7697 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7698 if(!exp->expType)
7699 {
7700 exp->expType = op1->type;
7701 if(op1->type)
7702 op1->type->refCount++;
7703 }
7704 return 0x1;
7705 }
7706
7707 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7708 {
7709 int value2 = op2->__anon1.i;
7710
7711 exp->type = 2;
7712 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7713 if(!exp->expType)
7714 {
7715 exp->expType = op1->type;
7716 if(op1->type)
7717 op1->type->refCount++;
7718 }
7719 return 0x1;
7720 }
7721
7722 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7723 {
7724 unsigned int value2 = op2->__anon1.ui;
7725
7726 exp->type = 2;
7727 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7728 if(!exp->expType)
7729 {
7730 exp->expType = op1->type;
7731 if(op1->type)
7732 op1->type->refCount++;
7733 }
7734 return 0x1;
7735 }
7736
7737 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7738 {
7739 long long value2 = op2->__anon1.i64;
7740
7741 exp->type = 2;
7742 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7743 if(!exp->expType)
7744 {
7745 exp->expType = op1->type;
7746 if(op1->type)
7747 op1->type->refCount++;
7748 }
7749 return 0x1;
7750 }
7751
7752 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7753 {
7754 uint64 value2 = op2->__anon1.ui64;
7755
7756 exp->type = 2;
7757 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7758 if(!exp->expType)
7759 {
7760 exp->expType = op1->type;
7761 if(op1->type)
7762 op1->type->refCount++;
7763 }
7764 return 0x1;
7765 }
7766
7767 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7768 {
7769 short value2 = op2->__anon1.s;
7770
7771 exp->type = 2;
7772 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7773 if(!exp->expType)
7774 {
7775 exp->expType = op1->type;
7776 if(op1->type)
7777 op1->type->refCount++;
7778 }
7779 return 0x1;
7780 }
7781
7782 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7783 {
7784 unsigned short value2 = op2->__anon1.us;
7785
7786 exp->type = 2;
7787 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7788 if(!exp->expType)
7789 {
7790 exp->expType = op1->type;
7791 if(op1->type)
7792 op1->type->refCount++;
7793 }
7794 return 0x1;
7795 }
7796
7797 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7798 {
7799 char value2 = op2->__anon1.c;
7800
7801 exp->type = 2;
7802 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7803 if(!exp->expType)
7804 {
7805 exp->expType = op1->type;
7806 if(op1->type)
7807 op1->type->refCount++;
7808 }
7809 return 0x1;
7810 }
7811
7812 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7813 {
7814 unsigned char value2 = op2->__anon1.uc;
7815
7816 exp->type = 2;
7817 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7818 if(!exp->expType)
7819 {
7820 exp->expType = op1->type;
7821 if(op1->type)
7822 op1->type->refCount++;
7823 }
7824 return 0x1;
7825 }
7826
7827 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7828 {
7829 float value2 = op2->__anon1.f;
7830
7831 exp->type = 2;
7832 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7833 if(!exp->expType)
7834 {
7835 exp->expType = op1->type;
7836 if(op1->type)
7837 op1->type->refCount++;
7838 }
7839 return 0x1;
7840 }
7841
7842 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7843 {
7844 double value2 = op2->__anon1.d;
7845
7846 exp->type = 2;
7847 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7848 if(!exp->expType)
7849 {
7850 exp->expType = op1->type;
7851 if(op1->type)
7852 op1->type->refCount++;
7853 }
7854 return 0x1;
7855 }
7856
7857 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7858 {
7859 int value2 = op2->__anon1.i;
7860
7861 exp->type = 2;
7862 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7863 if(!exp->expType)
7864 {
7865 exp->expType = op1->type;
7866 if(op1->type)
7867 op1->type->refCount++;
7868 }
7869 return 0x1;
7870 }
7871
7872 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7873 {
7874 unsigned int value2 = op2->__anon1.ui;
7875
7876 exp->type = 2;
7877 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7878 if(!exp->expType)
7879 {
7880 exp->expType = op1->type;
7881 if(op1->type)
7882 op1->type->refCount++;
7883 }
7884 return 0x1;
7885 }
7886
7887 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7888 {
7889 long long value2 = op2->__anon1.i64;
7890
7891 exp->type = 2;
7892 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7893 if(!exp->expType)
7894 {
7895 exp->expType = op1->type;
7896 if(op1->type)
7897 op1->type->refCount++;
7898 }
7899 return 0x1;
7900 }
7901
7902 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7903 {
7904 uint64 value2 = op2->__anon1.ui64;
7905
7906 exp->type = 2;
7907 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7908 if(!exp->expType)
7909 {
7910 exp->expType = op1->type;
7911 if(op1->type)
7912 op1->type->refCount++;
7913 }
7914 return 0x1;
7915 }
7916
7917 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7918 {
7919 short value2 = op2->__anon1.s;
7920
7921 exp->type = 2;
7922 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7923 if(!exp->expType)
7924 {
7925 exp->expType = op1->type;
7926 if(op1->type)
7927 op1->type->refCount++;
7928 }
7929 return 0x1;
7930 }
7931
7932 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7933 {
7934 unsigned short value2 = op2->__anon1.us;
7935
7936 exp->type = 2;
7937 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7938 if(!exp->expType)
7939 {
7940 exp->expType = op1->type;
7941 if(op1->type)
7942 op1->type->refCount++;
7943 }
7944 return 0x1;
7945 }
7946
7947 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7948 {
7949 char value2 = op2->__anon1.c;
7950
7951 exp->type = 2;
7952 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7953 if(!exp->expType)
7954 {
7955 exp->expType = op1->type;
7956 if(op1->type)
7957 op1->type->refCount++;
7958 }
7959 return 0x1;
7960 }
7961
7962 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7963 {
7964 unsigned char value2 = op2->__anon1.uc;
7965
7966 exp->type = 2;
7967 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7968 if(!exp->expType)
7969 {
7970 exp->expType = op1->type;
7971 if(op1->type)
7972 op1->type->refCount++;
7973 }
7974 return 0x1;
7975 }
7976
7977 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7978 {
7979 int value2 = op2->__anon1.i;
7980
7981 exp->type = 2;
7982 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7983 if(!exp->expType)
7984 {
7985 exp->expType = op1->type;
7986 if(op1->type)
7987 op1->type->refCount++;
7988 }
7989 return 0x1;
7990 }
7991
7992 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7993 {
7994 unsigned int value2 = op2->__anon1.ui;
7995
7996 exp->type = 2;
7997 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
7998 if(!exp->expType)
7999 {
8000 exp->expType = op1->type;
8001 if(op1->type)
8002 op1->type->refCount++;
8003 }
8004 return 0x1;
8005 }
8006
8007 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8008 {
8009 long long value2 = op2->__anon1.i64;
8010
8011 exp->type = 2;
8012 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8013 if(!exp->expType)
8014 {
8015 exp->expType = op1->type;
8016 if(op1->type)
8017 op1->type->refCount++;
8018 }
8019 return 0x1;
8020 }
8021
8022 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8023 {
8024 uint64 value2 = op2->__anon1.ui64;
8025
8026 exp->type = 2;
8027 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8028 if(!exp->expType)
8029 {
8030 exp->expType = op1->type;
8031 if(op1->type)
8032 op1->type->refCount++;
8033 }
8034 return 0x1;
8035 }
8036
8037 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8038 {
8039 short value2 = op2->__anon1.s;
8040
8041 exp->type = 2;
8042 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8043 if(!exp->expType)
8044 {
8045 exp->expType = op1->type;
8046 if(op1->type)
8047 op1->type->refCount++;
8048 }
8049 return 0x1;
8050 }
8051
8052 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8053 {
8054 unsigned short value2 = op2->__anon1.us;
8055
8056 exp->type = 2;
8057 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8058 if(!exp->expType)
8059 {
8060 exp->expType = op1->type;
8061 if(op1->type)
8062 op1->type->refCount++;
8063 }
8064 return 0x1;
8065 }
8066
8067 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8068 {
8069 char value2 = op2->__anon1.c;
8070
8071 exp->type = 2;
8072 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8073 if(!exp->expType)
8074 {
8075 exp->expType = op1->type;
8076 if(op1->type)
8077 op1->type->refCount++;
8078 }
8079 return 0x1;
8080 }
8081
8082 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8083 {
8084 unsigned char value2 = op2->__anon1.uc;
8085
8086 exp->type = 2;
8087 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8088 if(!exp->expType)
8089 {
8090 exp->expType = op1->type;
8091 if(op1->type)
8092 op1->type->refCount++;
8093 }
8094 return 0x1;
8095 }
8096
8097 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8098 {
8099 int value2 = op2->__anon1.i;
8100
8101 exp->type = 2;
8102 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8103 if(!exp->expType)
8104 {
8105 exp->expType = op1->type;
8106 if(op1->type)
8107 op1->type->refCount++;
8108 }
8109 return 0x1;
8110 }
8111
8112 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8113 {
8114 unsigned int value2 = op2->__anon1.ui;
8115
8116 exp->type = 2;
8117 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8118 if(!exp->expType)
8119 {
8120 exp->expType = op1->type;
8121 if(op1->type)
8122 op1->type->refCount++;
8123 }
8124 return 0x1;
8125 }
8126
8127 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8128 {
8129 long long value2 = op2->__anon1.i64;
8130
8131 exp->type = 2;
8132 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8133 if(!exp->expType)
8134 {
8135 exp->expType = op1->type;
8136 if(op1->type)
8137 op1->type->refCount++;
8138 }
8139 return 0x1;
8140 }
8141
8142 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8143 {
8144 uint64 value2 = op2->__anon1.ui64;
8145
8146 exp->type = 2;
8147 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8148 if(!exp->expType)
8149 {
8150 exp->expType = op1->type;
8151 if(op1->type)
8152 op1->type->refCount++;
8153 }
8154 return 0x1;
8155 }
8156
8157 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8158 {
8159 short value2 = op2->__anon1.s;
8160
8161 exp->type = 2;
8162 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8163 if(!exp->expType)
8164 {
8165 exp->expType = op1->type;
8166 if(op1->type)
8167 op1->type->refCount++;
8168 }
8169 return 0x1;
8170 }
8171
8172 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8173 {
8174 unsigned short value2 = op2->__anon1.us;
8175
8176 exp->type = 2;
8177 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8178 if(!exp->expType)
8179 {
8180 exp->expType = op1->type;
8181 if(op1->type)
8182 op1->type->refCount++;
8183 }
8184 return 0x1;
8185 }
8186
8187 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8188 {
8189 char value2 = op2->__anon1.c;
8190
8191 exp->type = 2;
8192 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8193 if(!exp->expType)
8194 {
8195 exp->expType = op1->type;
8196 if(op1->type)
8197 op1->type->refCount++;
8198 }
8199 return 0x1;
8200 }
8201
8202 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8203 {
8204 unsigned char value2 = op2->__anon1.uc;
8205
8206 exp->type = 2;
8207 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8208 if(!exp->expType)
8209 {
8210 exp->expType = op1->type;
8211 if(op1->type)
8212 op1->type->refCount++;
8213 }
8214 return 0x1;
8215 }
8216
8217 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8218 {
8219 int value2 = op2->__anon1.i;
8220
8221 exp->type = 2;
8222 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8223 if(!exp->expType)
8224 {
8225 exp->expType = op1->type;
8226 if(op1->type)
8227 op1->type->refCount++;
8228 }
8229 return 0x1;
8230 }
8231
8232 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8233 {
8234 unsigned int value2 = op2->__anon1.ui;
8235
8236 exp->type = 2;
8237 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8238 if(!exp->expType)
8239 {
8240 exp->expType = op1->type;
8241 if(op1->type)
8242 op1->type->refCount++;
8243 }
8244 return 0x1;
8245 }
8246
8247 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8248 {
8249 long long value2 = op2->__anon1.i64;
8250
8251 exp->type = 2;
8252 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8253 if(!exp->expType)
8254 {
8255 exp->expType = op1->type;
8256 if(op1->type)
8257 op1->type->refCount++;
8258 }
8259 return 0x1;
8260 }
8261
8262 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8263 {
8264 uint64 value2 = op2->__anon1.ui64;
8265
8266 exp->type = 2;
8267 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8268 if(!exp->expType)
8269 {
8270 exp->expType = op1->type;
8271 if(op1->type)
8272 op1->type->refCount++;
8273 }
8274 return 0x1;
8275 }
8276
8277 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8278 {
8279 short value2 = op2->__anon1.s;
8280
8281 exp->type = 2;
8282 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8283 if(!exp->expType)
8284 {
8285 exp->expType = op1->type;
8286 if(op1->type)
8287 op1->type->refCount++;
8288 }
8289 return 0x1;
8290 }
8291
8292 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8293 {
8294 unsigned short value2 = op2->__anon1.us;
8295
8296 exp->type = 2;
8297 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8298 if(!exp->expType)
8299 {
8300 exp->expType = op1->type;
8301 if(op1->type)
8302 op1->type->refCount++;
8303 }
8304 return 0x1;
8305 }
8306
8307 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8308 {
8309 char value2 = op2->__anon1.c;
8310
8311 exp->type = 2;
8312 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8313 if(!exp->expType)
8314 {
8315 exp->expType = op1->type;
8316 if(op1->type)
8317 op1->type->refCount++;
8318 }
8319 return 0x1;
8320 }
8321
8322 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8323 {
8324 unsigned char value2 = op2->__anon1.uc;
8325
8326 exp->type = 2;
8327 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8328 if(!exp->expType)
8329 {
8330 exp->expType = op1->type;
8331 if(op1->type)
8332 op1->type->refCount++;
8333 }
8334 return 0x1;
8335 }
8336
8337 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8338 {
8339 int value2 = op2->__anon1.i;
8340
8341 exp->type = 2;
8342 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8343 if(!exp->expType)
8344 {
8345 exp->expType = op1->type;
8346 if(op1->type)
8347 op1->type->refCount++;
8348 }
8349 return 0x1;
8350 }
8351
8352 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8353 {
8354 unsigned int value2 = op2->__anon1.ui;
8355
8356 exp->type = 2;
8357 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8358 if(!exp->expType)
8359 {
8360 exp->expType = op1->type;
8361 if(op1->type)
8362 op1->type->refCount++;
8363 }
8364 return 0x1;
8365 }
8366
8367 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8368 {
8369 long long value2 = op2->__anon1.i64;
8370
8371 exp->type = 2;
8372 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8373 if(!exp->expType)
8374 {
8375 exp->expType = op1->type;
8376 if(op1->type)
8377 op1->type->refCount++;
8378 }
8379 return 0x1;
8380 }
8381
8382 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8383 {
8384 uint64 value2 = op2->__anon1.ui64;
8385
8386 exp->type = 2;
8387 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8388 if(!exp->expType)
8389 {
8390 exp->expType = op1->type;
8391 if(op1->type)
8392 op1->type->refCount++;
8393 }
8394 return 0x1;
8395 }
8396
8397 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8398 {
8399 short value2 = op2->__anon1.s;
8400
8401 exp->type = 2;
8402 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8403 if(!exp->expType)
8404 {
8405 exp->expType = op1->type;
8406 if(op1->type)
8407 op1->type->refCount++;
8408 }
8409 return 0x1;
8410 }
8411
8412 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8413 {
8414 unsigned short value2 = op2->__anon1.us;
8415
8416 exp->type = 2;
8417 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8418 if(!exp->expType)
8419 {
8420 exp->expType = op1->type;
8421 if(op1->type)
8422 op1->type->refCount++;
8423 }
8424 return 0x1;
8425 }
8426
8427 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8428 {
8429 char value2 = op2->__anon1.c;
8430
8431 exp->type = 2;
8432 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8433 if(!exp->expType)
8434 {
8435 exp->expType = op1->type;
8436 if(op1->type)
8437 op1->type->refCount++;
8438 }
8439 return 0x1;
8440 }
8441
8442 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8443 {
8444 unsigned char value2 = op2->__anon1.uc;
8445
8446 exp->type = 2;
8447 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8448 if(!exp->expType)
8449 {
8450 exp->expType = op1->type;
8451 if(op1->type)
8452 op1->type->refCount++;
8453 }
8454 return 0x1;
8455 }
8456
8457 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8458 {
8459 int value2 = op2->__anon1.i;
8460
8461 exp->type = 2;
8462 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8463 if(!exp->expType)
8464 {
8465 exp->expType = op1->type;
8466 if(op1->type)
8467 op1->type->refCount++;
8468 }
8469 return 0x1;
8470 }
8471
8472 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8473 {
8474 unsigned int value2 = op2->__anon1.ui;
8475
8476 exp->type = 2;
8477 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8478 if(!exp->expType)
8479 {
8480 exp->expType = op1->type;
8481 if(op1->type)
8482 op1->type->refCount++;
8483 }
8484 return 0x1;
8485 }
8486
8487 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8488 {
8489 long long value2 = op2->__anon1.i64;
8490
8491 exp->type = 2;
8492 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8493 if(!exp->expType)
8494 {
8495 exp->expType = op1->type;
8496 if(op1->type)
8497 op1->type->refCount++;
8498 }
8499 return 0x1;
8500 }
8501
8502 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8503 {
8504 uint64 value2 = op2->__anon1.ui64;
8505
8506 exp->type = 2;
8507 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8508 if(!exp->expType)
8509 {
8510 exp->expType = op1->type;
8511 if(op1->type)
8512 op1->type->refCount++;
8513 }
8514 return 0x1;
8515 }
8516
8517 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8518 {
8519 short value2 = op2->__anon1.s;
8520
8521 exp->type = 2;
8522 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8523 if(!exp->expType)
8524 {
8525 exp->expType = op1->type;
8526 if(op1->type)
8527 op1->type->refCount++;
8528 }
8529 return 0x1;
8530 }
8531
8532 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8533 {
8534 unsigned short value2 = op2->__anon1.us;
8535
8536 exp->type = 2;
8537 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8538 if(!exp->expType)
8539 {
8540 exp->expType = op1->type;
8541 if(op1->type)
8542 op1->type->refCount++;
8543 }
8544 return 0x1;
8545 }
8546
8547 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8548 {
8549 char value2 = op2->__anon1.c;
8550
8551 exp->type = 2;
8552 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8553 if(!exp->expType)
8554 {
8555 exp->expType = op1->type;
8556 if(op1->type)
8557 op1->type->refCount++;
8558 }
8559 return 0x1;
8560 }
8561
8562 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8563 {
8564 unsigned char value2 = op2->__anon1.uc;
8565
8566 exp->type = 2;
8567 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8568 if(!exp->expType)
8569 {
8570 exp->expType = op1->type;
8571 if(op1->type)
8572 op1->type->refCount++;
8573 }
8574 return 0x1;
8575 }
8576
8577 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8578 {
8579 exp->type = 2;
8580 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8581 if(!exp->expType)
8582 {
8583 exp->expType = op1->type;
8584 if(op1->type)
8585 op1->type->refCount++;
8586 }
8587 return 0x1;
8588 }
8589
8590 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8591 {
8592 exp->type = 2;
8593 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8594 if(!exp->expType)
8595 {
8596 exp->expType = op1->type;
8597 if(op1->type)
8598 op1->type->refCount++;
8599 }
8600 return 0x1;
8601 }
8602
8603 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8604 {
8605 exp->type = 2;
8606 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8607 if(!exp->expType)
8608 {
8609 exp->expType = op1->type;
8610 if(op1->type)
8611 op1->type->refCount++;
8612 }
8613 return 0x1;
8614 }
8615
8616 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8617 {
8618 exp->type = 2;
8619 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8620 if(!exp->expType)
8621 {
8622 exp->expType = op1->type;
8623 if(op1->type)
8624 op1->type->refCount++;
8625 }
8626 return 0x1;
8627 }
8628
8629 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8630 {
8631 exp->type = 2;
8632 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8633 if(!exp->expType)
8634 {
8635 exp->expType = op1->type;
8636 if(op1->type)
8637 op1->type->refCount++;
8638 }
8639 return 0x1;
8640 }
8641
8642 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8643 {
8644 exp->type = 2;
8645 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8646 if(!exp->expType)
8647 {
8648 exp->expType = op1->type;
8649 if(op1->type)
8650 op1->type->refCount++;
8651 }
8652 return 0x1;
8653 }
8654
8655 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8656 {
8657 exp->type = 2;
8658 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8659 if(!exp->expType)
8660 {
8661 exp->expType = op1->type;
8662 if(op1->type)
8663 op1->type->refCount++;
8664 }
8665 return 0x1;
8666 }
8667
8668 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8669 {
8670 exp->type = 2;
8671 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8672 if(!exp->expType)
8673 {
8674 exp->expType = op1->type;
8675 if(op1->type)
8676 op1->type->refCount++;
8677 }
8678 return 0x1;
8679 }
8680
8681 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8682 {
8683 int value2 = op2->__anon1.i;
8684
8685 exp->type = 2;
8686 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8687 if(!exp->expType)
8688 {
8689 exp->expType = op1->type;
8690 if(op1->type)
8691 op1->type->refCount++;
8692 }
8693 return 0x1;
8694 }
8695
8696 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8697 {
8698 unsigned int value2 = op2->__anon1.ui;
8699
8700 exp->type = 2;
8701 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8702 if(!exp->expType)
8703 {
8704 exp->expType = op1->type;
8705 if(op1->type)
8706 op1->type->refCount++;
8707 }
8708 return 0x1;
8709 }
8710
8711 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8712 {
8713 long long value2 = op2->__anon1.i64;
8714
8715 exp->type = 2;
8716 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8717 if(!exp->expType)
8718 {
8719 exp->expType = op1->type;
8720 if(op1->type)
8721 op1->type->refCount++;
8722 }
8723 return 0x1;
8724 }
8725
8726 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8727 {
8728 uint64 value2 = op2->__anon1.ui64;
8729
8730 exp->type = 2;
8731 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8732 if(!exp->expType)
8733 {
8734 exp->expType = op1->type;
8735 if(op1->type)
8736 op1->type->refCount++;
8737 }
8738 return 0x1;
8739 }
8740
8741 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8742 {
8743 short value2 = op2->__anon1.s;
8744
8745 exp->type = 2;
8746 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8747 if(!exp->expType)
8748 {
8749 exp->expType = op1->type;
8750 if(op1->type)
8751 op1->type->refCount++;
8752 }
8753 return 0x1;
8754 }
8755
8756 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8757 {
8758 unsigned short value2 = op2->__anon1.us;
8759
8760 exp->type = 2;
8761 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8762 if(!exp->expType)
8763 {
8764 exp->expType = op1->type;
8765 if(op1->type)
8766 op1->type->refCount++;
8767 }
8768 return 0x1;
8769 }
8770
8771 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8772 {
8773 char value2 = op2->__anon1.c;
8774
8775 exp->type = 2;
8776 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8777 if(!exp->expType)
8778 {
8779 exp->expType = op1->type;
8780 if(op1->type)
8781 op1->type->refCount++;
8782 }
8783 return 0x1;
8784 }
8785
8786 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8787 {
8788 unsigned char value2 = op2->__anon1.uc;
8789
8790 exp->type = 2;
8791 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8792 if(!exp->expType)
8793 {
8794 exp->expType = op1->type;
8795 if(op1->type)
8796 op1->type->refCount++;
8797 }
8798 return 0x1;
8799 }
8800
8801 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8802 {
8803 int value2 = op2->__anon1.i;
8804
8805 exp->type = 2;
8806 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8807 if(!exp->expType)
8808 {
8809 exp->expType = op1->type;
8810 if(op1->type)
8811 op1->type->refCount++;
8812 }
8813 return 0x1;
8814 }
8815
8816 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8817 {
8818 unsigned int value2 = op2->__anon1.ui;
8819
8820 exp->type = 2;
8821 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8822 if(!exp->expType)
8823 {
8824 exp->expType = op1->type;
8825 if(op1->type)
8826 op1->type->refCount++;
8827 }
8828 return 0x1;
8829 }
8830
8831 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8832 {
8833 long long value2 = op2->__anon1.i64;
8834
8835 exp->type = 2;
8836 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8837 if(!exp->expType)
8838 {
8839 exp->expType = op1->type;
8840 if(op1->type)
8841 op1->type->refCount++;
8842 }
8843 return 0x1;
8844 }
8845
8846 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8847 {
8848 uint64 value2 = op2->__anon1.ui64;
8849
8850 exp->type = 2;
8851 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8852 if(!exp->expType)
8853 {
8854 exp->expType = op1->type;
8855 if(op1->type)
8856 op1->type->refCount++;
8857 }
8858 return 0x1;
8859 }
8860
8861 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8862 {
8863 short value2 = op2->__anon1.s;
8864
8865 exp->type = 2;
8866 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8867 if(!exp->expType)
8868 {
8869 exp->expType = op1->type;
8870 if(op1->type)
8871 op1->type->refCount++;
8872 }
8873 return 0x1;
8874 }
8875
8876 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8877 {
8878 unsigned short value2 = op2->__anon1.us;
8879
8880 exp->type = 2;
8881 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8882 if(!exp->expType)
8883 {
8884 exp->expType = op1->type;
8885 if(op1->type)
8886 op1->type->refCount++;
8887 }
8888 return 0x1;
8889 }
8890
8891 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8892 {
8893 char value2 = op2->__anon1.c;
8894
8895 exp->type = 2;
8896 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8897 if(!exp->expType)
8898 {
8899 exp->expType = op1->type;
8900 if(op1->type)
8901 op1->type->refCount++;
8902 }
8903 return 0x1;
8904 }
8905
8906 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8907 {
8908 unsigned char value2 = op2->__anon1.uc;
8909
8910 exp->type = 2;
8911 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8912 if(!exp->expType)
8913 {
8914 exp->expType = op1->type;
8915 if(op1->type)
8916 op1->type->refCount++;
8917 }
8918 return 0x1;
8919 }
8920
8921 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8922 {
8923 int value2 = op2->__anon1.i;
8924
8925 exp->type = 2;
8926 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8927 if(!exp->expType)
8928 {
8929 exp->expType = op1->type;
8930 if(op1->type)
8931 op1->type->refCount++;
8932 }
8933 return 0x1;
8934 }
8935
8936 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8937 {
8938 unsigned int value2 = op2->__anon1.ui;
8939
8940 exp->type = 2;
8941 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8942 if(!exp->expType)
8943 {
8944 exp->expType = op1->type;
8945 if(op1->type)
8946 op1->type->refCount++;
8947 }
8948 return 0x1;
8949 }
8950
8951 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8952 {
8953 long long value2 = op2->__anon1.i64;
8954
8955 exp->type = 2;
8956 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8957 if(!exp->expType)
8958 {
8959 exp->expType = op1->type;
8960 if(op1->type)
8961 op1->type->refCount++;
8962 }
8963 return 0x1;
8964 }
8965
8966 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8967 {
8968 uint64 value2 = op2->__anon1.ui64;
8969
8970 exp->type = 2;
8971 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8972 if(!exp->expType)
8973 {
8974 exp->expType = op1->type;
8975 if(op1->type)
8976 op1->type->refCount++;
8977 }
8978 return 0x1;
8979 }
8980
8981 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8982 {
8983 short value2 = op2->__anon1.s;
8984
8985 exp->type = 2;
8986 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8987 if(!exp->expType)
8988 {
8989 exp->expType = op1->type;
8990 if(op1->type)
8991 op1->type->refCount++;
8992 }
8993 return 0x1;
8994 }
8995
8996 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8997 {
8998 unsigned short value2 = op2->__anon1.us;
8999
9000 exp->type = 2;
9001 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9002 if(!exp->expType)
9003 {
9004 exp->expType = op1->type;
9005 if(op1->type)
9006 op1->type->refCount++;
9007 }
9008 return 0x1;
9009 }
9010
9011 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9012 {
9013 char value2 = op2->__anon1.c;
9014
9015 exp->type = 2;
9016 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9017 if(!exp->expType)
9018 {
9019 exp->expType = op1->type;
9020 if(op1->type)
9021 op1->type->refCount++;
9022 }
9023 return 0x1;
9024 }
9025
9026 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9027 {
9028 unsigned char value2 = op2->__anon1.uc;
9029
9030 exp->type = 2;
9031 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9032 if(!exp->expType)
9033 {
9034 exp->expType = op1->type;
9035 if(op1->type)
9036 op1->type->refCount++;
9037 }
9038 return 0x1;
9039 }
9040
9041 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9042 {
9043 int value2 = op2->__anon1.i;
9044
9045 exp->type = 2;
9046 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9047 if(!exp->expType)
9048 {
9049 exp->expType = op1->type;
9050 if(op1->type)
9051 op1->type->refCount++;
9052 }
9053 return 0x1;
9054 }
9055
9056 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9057 {
9058 unsigned int value2 = op2->__anon1.ui;
9059
9060 exp->type = 2;
9061 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9062 if(!exp->expType)
9063 {
9064 exp->expType = op1->type;
9065 if(op1->type)
9066 op1->type->refCount++;
9067 }
9068 return 0x1;
9069 }
9070
9071 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9072 {
9073 long long value2 = op2->__anon1.i64;
9074
9075 exp->type = 2;
9076 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9077 if(!exp->expType)
9078 {
9079 exp->expType = op1->type;
9080 if(op1->type)
9081 op1->type->refCount++;
9082 }
9083 return 0x1;
9084 }
9085
9086 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9087 {
9088 uint64 value2 = op2->__anon1.ui64;
9089
9090 exp->type = 2;
9091 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9092 if(!exp->expType)
9093 {
9094 exp->expType = op1->type;
9095 if(op1->type)
9096 op1->type->refCount++;
9097 }
9098 return 0x1;
9099 }
9100
9101 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9102 {
9103 short value2 = op2->__anon1.s;
9104
9105 exp->type = 2;
9106 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9107 if(!exp->expType)
9108 {
9109 exp->expType = op1->type;
9110 if(op1->type)
9111 op1->type->refCount++;
9112 }
9113 return 0x1;
9114 }
9115
9116 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9117 {
9118 unsigned short value2 = op2->__anon1.us;
9119
9120 exp->type = 2;
9121 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9122 if(!exp->expType)
9123 {
9124 exp->expType = op1->type;
9125 if(op1->type)
9126 op1->type->refCount++;
9127 }
9128 return 0x1;
9129 }
9130
9131 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9132 {
9133 char value2 = op2->__anon1.c;
9134
9135 exp->type = 2;
9136 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9137 if(!exp->expType)
9138 {
9139 exp->expType = op1->type;
9140 if(op1->type)
9141 op1->type->refCount++;
9142 }
9143 return 0x1;
9144 }
9145
9146 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9147 {
9148 unsigned char value2 = op2->__anon1.uc;
9149
9150 exp->type = 2;
9151 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9152 if(!exp->expType)
9153 {
9154 exp->expType = op1->type;
9155 if(op1->type)
9156 op1->type->refCount++;
9157 }
9158 return 0x1;
9159 }
9160
9161 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9162 {
9163 int value2 = op2->__anon1.i;
9164
9165 exp->type = 2;
9166 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9167 if(!exp->expType)
9168 {
9169 exp->expType = op1->type;
9170 if(op1->type)
9171 op1->type->refCount++;
9172 }
9173 return 0x1;
9174 }
9175
9176 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9177 {
9178 unsigned int value2 = op2->__anon1.ui;
9179
9180 exp->type = 2;
9181 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9182 if(!exp->expType)
9183 {
9184 exp->expType = op1->type;
9185 if(op1->type)
9186 op1->type->refCount++;
9187 }
9188 return 0x1;
9189 }
9190
9191 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9192 {
9193 long long value2 = op2->__anon1.i64;
9194
9195 exp->type = 2;
9196 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9197 if(!exp->expType)
9198 {
9199 exp->expType = op1->type;
9200 if(op1->type)
9201 op1->type->refCount++;
9202 }
9203 return 0x1;
9204 }
9205
9206 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9207 {
9208 uint64 value2 = op2->__anon1.ui64;
9209
9210 exp->type = 2;
9211 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9212 if(!exp->expType)
9213 {
9214 exp->expType = op1->type;
9215 if(op1->type)
9216 op1->type->refCount++;
9217 }
9218 return 0x1;
9219 }
9220
9221 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9222 {
9223 short value2 = op2->__anon1.s;
9224
9225 exp->type = 2;
9226 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9227 if(!exp->expType)
9228 {
9229 exp->expType = op1->type;
9230 if(op1->type)
9231 op1->type->refCount++;
9232 }
9233 return 0x1;
9234 }
9235
9236 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9237 {
9238 unsigned short value2 = op2->__anon1.us;
9239
9240 exp->type = 2;
9241 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9242 if(!exp->expType)
9243 {
9244 exp->expType = op1->type;
9245 if(op1->type)
9246 op1->type->refCount++;
9247 }
9248 return 0x1;
9249 }
9250
9251 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9252 {
9253 char value2 = op2->__anon1.c;
9254
9255 exp->type = 2;
9256 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9257 if(!exp->expType)
9258 {
9259 exp->expType = op1->type;
9260 if(op1->type)
9261 op1->type->refCount++;
9262 }
9263 return 0x1;
9264 }
9265
9266 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9267 {
9268 unsigned char value2 = op2->__anon1.uc;
9269
9270 exp->type = 2;
9271 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9272 if(!exp->expType)
9273 {
9274 exp->expType = op1->type;
9275 if(op1->type)
9276 op1->type->refCount++;
9277 }
9278 return 0x1;
9279 }
9280
9281 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9282 {
9283 exp->type = 2;
9284 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9285 if(!exp->expType)
9286 {
9287 exp->expType = op1->type;
9288 if(op1->type)
9289 op1->type->refCount++;
9290 }
9291 return 0x1;
9292 }
9293
9294 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9295 {
9296 exp->type = 2;
9297 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9298 if(!exp->expType)
9299 {
9300 exp->expType = op1->type;
9301 if(op1->type)
9302 op1->type->refCount++;
9303 }
9304 return 0x1;
9305 }
9306
9307 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9308 {
9309 exp->type = 2;
9310 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9311 if(!exp->expType)
9312 {
9313 exp->expType = op1->type;
9314 if(op1->type)
9315 op1->type->refCount++;
9316 }
9317 return 0x1;
9318 }
9319
9320 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9321 {
9322 exp->type = 2;
9323 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9324 if(!exp->expType)
9325 {
9326 exp->expType = op1->type;
9327 if(op1->type)
9328 op1->type->refCount++;
9329 }
9330 return 0x1;
9331 }
9332
9333 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9334 {
9335 exp->type = 2;
9336 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9337 if(!exp->expType)
9338 {
9339 exp->expType = op1->type;
9340 if(op1->type)
9341 op1->type->refCount++;
9342 }
9343 return 0x1;
9344 }
9345
9346 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9347 {
9348 exp->type = 2;
9349 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9350 if(!exp->expType)
9351 {
9352 exp->expType = op1->type;
9353 if(op1->type)
9354 op1->type->refCount++;
9355 }
9356 return 0x1;
9357 }
9358
9359 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9360 {
9361 exp->type = 2;
9362 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9363 if(!exp->expType)
9364 {
9365 exp->expType = op1->type;
9366 if(op1->type)
9367 op1->type->refCount++;
9368 }
9369 return 0x1;
9370 }
9371
9372 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9373 {
9374 exp->type = 2;
9375 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9376 if(!exp->expType)
9377 {
9378 exp->expType = op1->type;
9379 if(op1->type)
9380 op1->type->refCount++;
9381 }
9382 return 0x1;
9383 }
9384
9385 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9386 {
9387 int value2 = op2->__anon1.i;
9388
9389 exp->type = 2;
9390 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9391 if(!exp->expType)
9392 {
9393 exp->expType = op1->type;
9394 if(op1->type)
9395 op1->type->refCount++;
9396 }
9397 return 0x1;
9398 }
9399
9400 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9401 {
9402 unsigned int value2 = op2->__anon1.ui;
9403
9404 exp->type = 2;
9405 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9406 if(!exp->expType)
9407 {
9408 exp->expType = op1->type;
9409 if(op1->type)
9410 op1->type->refCount++;
9411 }
9412 return 0x1;
9413 }
9414
9415 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9416 {
9417 long long value2 = op2->__anon1.i64;
9418
9419 exp->type = 2;
9420 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9421 if(!exp->expType)
9422 {
9423 exp->expType = op1->type;
9424 if(op1->type)
9425 op1->type->refCount++;
9426 }
9427 return 0x1;
9428 }
9429
9430 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9431 {
9432 uint64 value2 = op2->__anon1.ui64;
9433
9434 exp->type = 2;
9435 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9436 if(!exp->expType)
9437 {
9438 exp->expType = op1->type;
9439 if(op1->type)
9440 op1->type->refCount++;
9441 }
9442 return 0x1;
9443 }
9444
9445 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9446 {
9447 short value2 = op2->__anon1.s;
9448
9449 exp->type = 2;
9450 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9451 if(!exp->expType)
9452 {
9453 exp->expType = op1->type;
9454 if(op1->type)
9455 op1->type->refCount++;
9456 }
9457 return 0x1;
9458 }
9459
9460 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9461 {
9462 unsigned short value2 = op2->__anon1.us;
9463
9464 exp->type = 2;
9465 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9466 if(!exp->expType)
9467 {
9468 exp->expType = op1->type;
9469 if(op1->type)
9470 op1->type->refCount++;
9471 }
9472 return 0x1;
9473 }
9474
9475 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9476 {
9477 char value2 = op2->__anon1.c;
9478
9479 exp->type = 2;
9480 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9481 if(!exp->expType)
9482 {
9483 exp->expType = op1->type;
9484 if(op1->type)
9485 op1->type->refCount++;
9486 }
9487 return 0x1;
9488 }
9489
9490 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9491 {
9492 unsigned char value2 = op2->__anon1.uc;
9493
9494 exp->type = 2;
9495 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9496 if(!exp->expType)
9497 {
9498 exp->expType = op1->type;
9499 if(op1->type)
9500 op1->type->refCount++;
9501 }
9502 return 0x1;
9503 }
9504
9505 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9506 {
9507 float value2 = op2->__anon1.f;
9508
9509 exp->type = 2;
9510 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9511 if(!exp->expType)
9512 {
9513 exp->expType = op1->type;
9514 if(op1->type)
9515 op1->type->refCount++;
9516 }
9517 return 0x1;
9518 }
9519
9520 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9521 {
9522 double value2 = op2->__anon1.d;
9523
9524 exp->type = 2;
9525 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9526 if(!exp->expType)
9527 {
9528 exp->expType = op1->type;
9529 if(op1->type)
9530 op1->type->refCount++;
9531 }
9532 return 0x1;
9533 }
9534
9535 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9536 {
9537 int value2 = op2->__anon1.i;
9538
9539 exp->type = 2;
9540 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9541 if(!exp->expType)
9542 {
9543 exp->expType = op1->type;
9544 if(op1->type)
9545 op1->type->refCount++;
9546 }
9547 return 0x1;
9548 }
9549
9550 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9551 {
9552 unsigned int value2 = op2->__anon1.ui;
9553
9554 exp->type = 2;
9555 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9556 if(!exp->expType)
9557 {
9558 exp->expType = op1->type;
9559 if(op1->type)
9560 op1->type->refCount++;
9561 }
9562 return 0x1;
9563 }
9564
9565 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9566 {
9567 long long value2 = op2->__anon1.i64;
9568
9569 exp->type = 2;
9570 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9571 if(!exp->expType)
9572 {
9573 exp->expType = op1->type;
9574 if(op1->type)
9575 op1->type->refCount++;
9576 }
9577 return 0x1;
9578 }
9579
9580 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9581 {
9582 uint64 value2 = op2->__anon1.ui64;
9583
9584 exp->type = 2;
9585 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9586 if(!exp->expType)
9587 {
9588 exp->expType = op1->type;
9589 if(op1->type)
9590 op1->type->refCount++;
9591 }
9592 return 0x1;
9593 }
9594
9595 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9596 {
9597 short value2 = op2->__anon1.s;
9598
9599 exp->type = 2;
9600 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9601 if(!exp->expType)
9602 {
9603 exp->expType = op1->type;
9604 if(op1->type)
9605 op1->type->refCount++;
9606 }
9607 return 0x1;
9608 }
9609
9610 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9611 {
9612 unsigned short value2 = op2->__anon1.us;
9613
9614 exp->type = 2;
9615 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9616 if(!exp->expType)
9617 {
9618 exp->expType = op1->type;
9619 if(op1->type)
9620 op1->type->refCount++;
9621 }
9622 return 0x1;
9623 }
9624
9625 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9626 {
9627 char value2 = op2->__anon1.c;
9628
9629 exp->type = 2;
9630 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9631 if(!exp->expType)
9632 {
9633 exp->expType = op1->type;
9634 if(op1->type)
9635 op1->type->refCount++;
9636 }
9637 return 0x1;
9638 }
9639
9640 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9641 {
9642 unsigned char value2 = op2->__anon1.uc;
9643
9644 exp->type = 2;
9645 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9646 if(!exp->expType)
9647 {
9648 exp->expType = op1->type;
9649 if(op1->type)
9650 op1->type->refCount++;
9651 }
9652 return 0x1;
9653 }
9654
9655 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9656 {
9657 float value2 = op2->__anon1.f;
9658
9659 exp->type = 2;
9660 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9661 if(!exp->expType)
9662 {
9663 exp->expType = op1->type;
9664 if(op1->type)
9665 op1->type->refCount++;
9666 }
9667 return 0x1;
9668 }
9669
9670 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9671 {
9672 double value2 = op2->__anon1.d;
9673
9674 exp->type = 2;
9675 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9676 if(!exp->expType)
9677 {
9678 exp->expType = op1->type;
9679 if(op1->type)
9680 op1->type->refCount++;
9681 }
9682 return 0x1;
9683 }
9684
9685 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9686 {
9687 int value2 = op2->__anon1.i;
9688
9689 exp->type = 2;
9690 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9691 if(!exp->expType)
9692 {
9693 exp->expType = op1->type;
9694 if(op1->type)
9695 op1->type->refCount++;
9696 }
9697 return 0x1;
9698 }
9699
9700 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9701 {
9702 unsigned int value2 = op2->__anon1.ui;
9703
9704 exp->type = 2;
9705 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9706 if(!exp->expType)
9707 {
9708 exp->expType = op1->type;
9709 if(op1->type)
9710 op1->type->refCount++;
9711 }
9712 return 0x1;
9713 }
9714
9715 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9716 {
9717 long long value2 = op2->__anon1.i64;
9718
9719 exp->type = 2;
9720 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9721 if(!exp->expType)
9722 {
9723 exp->expType = op1->type;
9724 if(op1->type)
9725 op1->type->refCount++;
9726 }
9727 return 0x1;
9728 }
9729
9730 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9731 {
9732 uint64 value2 = op2->__anon1.ui64;
9733
9734 exp->type = 2;
9735 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9736 if(!exp->expType)
9737 {
9738 exp->expType = op1->type;
9739 if(op1->type)
9740 op1->type->refCount++;
9741 }
9742 return 0x1;
9743 }
9744
9745 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9746 {
9747 short value2 = op2->__anon1.s;
9748
9749 exp->type = 2;
9750 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9751 if(!exp->expType)
9752 {
9753 exp->expType = op1->type;
9754 if(op1->type)
9755 op1->type->refCount++;
9756 }
9757 return 0x1;
9758 }
9759
9760 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9761 {
9762 unsigned short value2 = op2->__anon1.us;
9763
9764 exp->type = 2;
9765 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9766 if(!exp->expType)
9767 {
9768 exp->expType = op1->type;
9769 if(op1->type)
9770 op1->type->refCount++;
9771 }
9772 return 0x1;
9773 }
9774
9775 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9776 {
9777 char value2 = op2->__anon1.c;
9778
9779 exp->type = 2;
9780 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9781 if(!exp->expType)
9782 {
9783 exp->expType = op1->type;
9784 if(op1->type)
9785 op1->type->refCount++;
9786 }
9787 return 0x1;
9788 }
9789
9790 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9791 {
9792 unsigned char value2 = op2->__anon1.uc;
9793
9794 exp->type = 2;
9795 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9796 if(!exp->expType)
9797 {
9798 exp->expType = op1->type;
9799 if(op1->type)
9800 op1->type->refCount++;
9801 }
9802 return 0x1;
9803 }
9804
9805 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9806 {
9807 float value2 = op2->__anon1.f;
9808
9809 exp->type = 2;
9810 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9811 if(!exp->expType)
9812 {
9813 exp->expType = op1->type;
9814 if(op1->type)
9815 op1->type->refCount++;
9816 }
9817 return 0x1;
9818 }
9819
9820 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9821 {
9822 double value2 = op2->__anon1.d;
9823
9824 exp->type = 2;
9825 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9826 if(!exp->expType)
9827 {
9828 exp->expType = op1->type;
9829 if(op1->type)
9830 op1->type->refCount++;
9831 }
9832 return 0x1;
9833 }
9834
9835 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9836 {
9837 int value2 = op2->__anon1.i;
9838
9839 exp->type = 2;
9840 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9841 if(!exp->expType)
9842 {
9843 exp->expType = op1->type;
9844 if(op1->type)
9845 op1->type->refCount++;
9846 }
9847 return 0x1;
9848 }
9849
9850 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9851 {
9852 unsigned int value2 = op2->__anon1.ui;
9853
9854 exp->type = 2;
9855 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9856 if(!exp->expType)
9857 {
9858 exp->expType = op1->type;
9859 if(op1->type)
9860 op1->type->refCount++;
9861 }
9862 return 0x1;
9863 }
9864
9865 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9866 {
9867 long long value2 = op2->__anon1.i64;
9868
9869 exp->type = 2;
9870 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9871 if(!exp->expType)
9872 {
9873 exp->expType = op1->type;
9874 if(op1->type)
9875 op1->type->refCount++;
9876 }
9877 return 0x1;
9878 }
9879
9880 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9881 {
9882 uint64 value2 = op2->__anon1.ui64;
9883
9884 exp->type = 2;
9885 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9886 if(!exp->expType)
9887 {
9888 exp->expType = op1->type;
9889 if(op1->type)
9890 op1->type->refCount++;
9891 }
9892 return 0x1;
9893 }
9894
9895 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9896 {
9897 short value2 = op2->__anon1.s;
9898
9899 exp->type = 2;
9900 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9901 if(!exp->expType)
9902 {
9903 exp->expType = op1->type;
9904 if(op1->type)
9905 op1->type->refCount++;
9906 }
9907 return 0x1;
9908 }
9909
9910 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9911 {
9912 unsigned short value2 = op2->__anon1.us;
9913
9914 exp->type = 2;
9915 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9916 if(!exp->expType)
9917 {
9918 exp->expType = op1->type;
9919 if(op1->type)
9920 op1->type->refCount++;
9921 }
9922 return 0x1;
9923 }
9924
9925 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9926 {
9927 char value2 = op2->__anon1.c;
9928
9929 exp->type = 2;
9930 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9931 if(!exp->expType)
9932 {
9933 exp->expType = op1->type;
9934 if(op1->type)
9935 op1->type->refCount++;
9936 }
9937 return 0x1;
9938 }
9939
9940 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9941 {
9942 unsigned char value2 = op2->__anon1.uc;
9943
9944 exp->type = 2;
9945 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9946 if(!exp->expType)
9947 {
9948 exp->expType = op1->type;
9949 if(op1->type)
9950 op1->type->refCount++;
9951 }
9952 return 0x1;
9953 }
9954
9955 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9956 {
9957 float value2 = op2->__anon1.f;
9958
9959 exp->type = 2;
9960 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9961 if(!exp->expType)
9962 {
9963 exp->expType = op1->type;
9964 if(op1->type)
9965 op1->type->refCount++;
9966 }
9967 return 0x1;
9968 }
9969
9970 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9971 {
9972 double value2 = op2->__anon1.d;
9973
9974 exp->type = 2;
9975 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9976 if(!exp->expType)
9977 {
9978 exp->expType = op1->type;
9979 if(op1->type)
9980 op1->type->refCount++;
9981 }
9982 return 0x1;
9983 }
9984
9985 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9986 {
9987 int value2 = op2->__anon1.i;
9988
9989 exp->type = 2;
9990 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
9991 if(!exp->expType)
9992 {
9993 exp->expType = op1->type;
9994 if(op1->type)
9995 op1->type->refCount++;
9996 }
9997 return 0x1;
9998 }
9999
10000 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10001 {
10002 unsigned int value2 = op2->__anon1.ui;
10003
10004 exp->type = 2;
10005 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10006 if(!exp->expType)
10007 {
10008 exp->expType = op1->type;
10009 if(op1->type)
10010 op1->type->refCount++;
10011 }
10012 return 0x1;
10013 }
10014
10015 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10016 {
10017 long long value2 = op2->__anon1.i64;
10018
10019 exp->type = 2;
10020 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10021 if(!exp->expType)
10022 {
10023 exp->expType = op1->type;
10024 if(op1->type)
10025 op1->type->refCount++;
10026 }
10027 return 0x1;
10028 }
10029
10030 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10031 {
10032 uint64 value2 = op2->__anon1.ui64;
10033
10034 exp->type = 2;
10035 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10036 if(!exp->expType)
10037 {
10038 exp->expType = op1->type;
10039 if(op1->type)
10040 op1->type->refCount++;
10041 }
10042 return 0x1;
10043 }
10044
10045 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10046 {
10047 short value2 = op2->__anon1.s;
10048
10049 exp->type = 2;
10050 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10051 if(!exp->expType)
10052 {
10053 exp->expType = op1->type;
10054 if(op1->type)
10055 op1->type->refCount++;
10056 }
10057 return 0x1;
10058 }
10059
10060 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10061 {
10062 unsigned short value2 = op2->__anon1.us;
10063
10064 exp->type = 2;
10065 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10066 if(!exp->expType)
10067 {
10068 exp->expType = op1->type;
10069 if(op1->type)
10070 op1->type->refCount++;
10071 }
10072 return 0x1;
10073 }
10074
10075 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10076 {
10077 char value2 = op2->__anon1.c;
10078
10079 exp->type = 2;
10080 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10081 if(!exp->expType)
10082 {
10083 exp->expType = op1->type;
10084 if(op1->type)
10085 op1->type->refCount++;
10086 }
10087 return 0x1;
10088 }
10089
10090 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10091 {
10092 unsigned char value2 = op2->__anon1.uc;
10093
10094 exp->type = 2;
10095 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10096 if(!exp->expType)
10097 {
10098 exp->expType = op1->type;
10099 if(op1->type)
10100 op1->type->refCount++;
10101 }
10102 return 0x1;
10103 }
10104
10105 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10106 {
10107 float value2 = op2->__anon1.f;
10108
10109 exp->type = 2;
10110 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10111 if(!exp->expType)
10112 {
10113 exp->expType = op1->type;
10114 if(op1->type)
10115 op1->type->refCount++;
10116 }
10117 return 0x1;
10118 }
10119
10120 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10121 {
10122 double value2 = op2->__anon1.d;
10123
10124 exp->type = 2;
10125 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10126 if(!exp->expType)
10127 {
10128 exp->expType = op1->type;
10129 if(op1->type)
10130 op1->type->refCount++;
10131 }
10132 return 0x1;
10133 }
10134
10135 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10136 {
10137 int value2 = op2->__anon1.i;
10138
10139 exp->type = 2;
10140 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10141 if(!exp->expType)
10142 {
10143 exp->expType = op1->type;
10144 if(op1->type)
10145 op1->type->refCount++;
10146 }
10147 return 0x1;
10148 }
10149
10150 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10151 {
10152 unsigned int value2 = op2->__anon1.ui;
10153
10154 exp->type = 2;
10155 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10156 if(!exp->expType)
10157 {
10158 exp->expType = op1->type;
10159 if(op1->type)
10160 op1->type->refCount++;
10161 }
10162 return 0x1;
10163 }
10164
10165 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10166 {
10167 long long value2 = op2->__anon1.i64;
10168
10169 exp->type = 2;
10170 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10171 if(!exp->expType)
10172 {
10173 exp->expType = op1->type;
10174 if(op1->type)
10175 op1->type->refCount++;
10176 }
10177 return 0x1;
10178 }
10179
10180 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10181 {
10182 uint64 value2 = op2->__anon1.ui64;
10183
10184 exp->type = 2;
10185 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10186 if(!exp->expType)
10187 {
10188 exp->expType = op1->type;
10189 if(op1->type)
10190 op1->type->refCount++;
10191 }
10192 return 0x1;
10193 }
10194
10195 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10196 {
10197 short value2 = op2->__anon1.s;
10198
10199 exp->type = 2;
10200 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10201 if(!exp->expType)
10202 {
10203 exp->expType = op1->type;
10204 if(op1->type)
10205 op1->type->refCount++;
10206 }
10207 return 0x1;
10208 }
10209
10210 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10211 {
10212 unsigned short value2 = op2->__anon1.us;
10213
10214 exp->type = 2;
10215 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10216 if(!exp->expType)
10217 {
10218 exp->expType = op1->type;
10219 if(op1->type)
10220 op1->type->refCount++;
10221 }
10222 return 0x1;
10223 }
10224
10225 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10226 {
10227 char value2 = op2->__anon1.c;
10228
10229 exp->type = 2;
10230 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10231 if(!exp->expType)
10232 {
10233 exp->expType = op1->type;
10234 if(op1->type)
10235 op1->type->refCount++;
10236 }
10237 return 0x1;
10238 }
10239
10240 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10241 {
10242 unsigned char value2 = op2->__anon1.uc;
10243
10244 exp->type = 2;
10245 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10246 if(!exp->expType)
10247 {
10248 exp->expType = op1->type;
10249 if(op1->type)
10250 op1->type->refCount++;
10251 }
10252 return 0x1;
10253 }
10254
10255 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10256 {
10257 float value2 = op2->__anon1.f;
10258
10259 exp->type = 2;
10260 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10261 if(!exp->expType)
10262 {
10263 exp->expType = op1->type;
10264 if(op1->type)
10265 op1->type->refCount++;
10266 }
10267 return 0x1;
10268 }
10269
10270 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10271 {
10272 double value2 = op2->__anon1.d;
10273
10274 exp->type = 2;
10275 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10276 if(!exp->expType)
10277 {
10278 exp->expType = op1->type;
10279 if(op1->type)
10280 op1->type->refCount++;
10281 }
10282 return 0x1;
10283 }
10284
10285 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10286 {
10287 int value2 = op2->__anon1.i;
10288
10289 exp->type = 2;
10290 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10291 if(!exp->expType)
10292 {
10293 exp->expType = op1->type;
10294 if(op1->type)
10295 op1->type->refCount++;
10296 }
10297 return 0x1;
10298 }
10299
10300 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10301 {
10302 unsigned int value2 = op2->__anon1.ui;
10303
10304 exp->type = 2;
10305 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10306 if(!exp->expType)
10307 {
10308 exp->expType = op1->type;
10309 if(op1->type)
10310 op1->type->refCount++;
10311 }
10312 return 0x1;
10313 }
10314
10315 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10316 {
10317 long long value2 = op2->__anon1.i64;
10318
10319 exp->type = 2;
10320 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10321 if(!exp->expType)
10322 {
10323 exp->expType = op1->type;
10324 if(op1->type)
10325 op1->type->refCount++;
10326 }
10327 return 0x1;
10328 }
10329
10330 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10331 {
10332 uint64 value2 = op2->__anon1.ui64;
10333
10334 exp->type = 2;
10335 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10336 if(!exp->expType)
10337 {
10338 exp->expType = op1->type;
10339 if(op1->type)
10340 op1->type->refCount++;
10341 }
10342 return 0x1;
10343 }
10344
10345 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10346 {
10347 short value2 = op2->__anon1.s;
10348
10349 exp->type = 2;
10350 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10351 if(!exp->expType)
10352 {
10353 exp->expType = op1->type;
10354 if(op1->type)
10355 op1->type->refCount++;
10356 }
10357 return 0x1;
10358 }
10359
10360 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10361 {
10362 unsigned short value2 = op2->__anon1.us;
10363
10364 exp->type = 2;
10365 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10366 if(!exp->expType)
10367 {
10368 exp->expType = op1->type;
10369 if(op1->type)
10370 op1->type->refCount++;
10371 }
10372 return 0x1;
10373 }
10374
10375 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10376 {
10377 char value2 = op2->__anon1.c;
10378
10379 exp->type = 2;
10380 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10381 if(!exp->expType)
10382 {
10383 exp->expType = op1->type;
10384 if(op1->type)
10385 op1->type->refCount++;
10386 }
10387 return 0x1;
10388 }
10389
10390 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10391 {
10392 unsigned char value2 = op2->__anon1.uc;
10393
10394 exp->type = 2;
10395 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10396 if(!exp->expType)
10397 {
10398 exp->expType = op1->type;
10399 if(op1->type)
10400 op1->type->refCount++;
10401 }
10402 return 0x1;
10403 }
10404
10405 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10406 {
10407 float value2 = op2->__anon1.f;
10408
10409 exp->type = 2;
10410 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10411 if(!exp->expType)
10412 {
10413 exp->expType = op1->type;
10414 if(op1->type)
10415 op1->type->refCount++;
10416 }
10417 return 0x1;
10418 }
10419
10420 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10421 {
10422 double value2 = op2->__anon1.d;
10423
10424 exp->type = 2;
10425 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10426 if(!exp->expType)
10427 {
10428 exp->expType = op1->type;
10429 if(op1->type)
10430 op1->type->refCount++;
10431 }
10432 return 0x1;
10433 }
10434
10435 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10436 {
10437 int value2 = op2->__anon1.i;
10438
10439 exp->type = 2;
10440 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10441 if(!exp->expType)
10442 {
10443 exp->expType = op1->type;
10444 if(op1->type)
10445 op1->type->refCount++;
10446 }
10447 return 0x1;
10448 }
10449
10450 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10451 {
10452 unsigned int value2 = op2->__anon1.ui;
10453
10454 exp->type = 2;
10455 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10456 if(!exp->expType)
10457 {
10458 exp->expType = op1->type;
10459 if(op1->type)
10460 op1->type->refCount++;
10461 }
10462 return 0x1;
10463 }
10464
10465 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10466 {
10467 long long value2 = op2->__anon1.i64;
10468
10469 exp->type = 2;
10470 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10471 if(!exp->expType)
10472 {
10473 exp->expType = op1->type;
10474 if(op1->type)
10475 op1->type->refCount++;
10476 }
10477 return 0x1;
10478 }
10479
10480 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10481 {
10482 uint64 value2 = op2->__anon1.ui64;
10483
10484 exp->type = 2;
10485 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10486 if(!exp->expType)
10487 {
10488 exp->expType = op1->type;
10489 if(op1->type)
10490 op1->type->refCount++;
10491 }
10492 return 0x1;
10493 }
10494
10495 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10496 {
10497 short value2 = op2->__anon1.s;
10498
10499 exp->type = 2;
10500 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10501 if(!exp->expType)
10502 {
10503 exp->expType = op1->type;
10504 if(op1->type)
10505 op1->type->refCount++;
10506 }
10507 return 0x1;
10508 }
10509
10510 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10511 {
10512 unsigned short value2 = op2->__anon1.us;
10513
10514 exp->type = 2;
10515 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10516 if(!exp->expType)
10517 {
10518 exp->expType = op1->type;
10519 if(op1->type)
10520 op1->type->refCount++;
10521 }
10522 return 0x1;
10523 }
10524
10525 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10526 {
10527 char value2 = op2->__anon1.c;
10528
10529 exp->type = 2;
10530 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10531 if(!exp->expType)
10532 {
10533 exp->expType = op1->type;
10534 if(op1->type)
10535 op1->type->refCount++;
10536 }
10537 return 0x1;
10538 }
10539
10540 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10541 {
10542 unsigned char value2 = op2->__anon1.uc;
10543
10544 exp->type = 2;
10545 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10546 if(!exp->expType)
10547 {
10548 exp->expType = op1->type;
10549 if(op1->type)
10550 op1->type->refCount++;
10551 }
10552 return 0x1;
10553 }
10554
10555 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10556 {
10557 float value2 = op2->__anon1.f;
10558
10559 exp->type = 2;
10560 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10561 if(!exp->expType)
10562 {
10563 exp->expType = op1->type;
10564 if(op1->type)
10565 op1->type->refCount++;
10566 }
10567 return 0x1;
10568 }
10569
10570 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10571 {
10572 double value2 = op2->__anon1.d;
10573
10574 exp->type = 2;
10575 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10576 if(!exp->expType)
10577 {
10578 exp->expType = op1->type;
10579 if(op1->type)
10580 op1->type->refCount++;
10581 }
10582 return 0x1;
10583 }
10584
10585 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10586 {
10587 exp->type = 2;
10588 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10589 if(!exp->expType)
10590 {
10591 exp->expType = op1->type;
10592 if(op1->type)
10593 op1->type->refCount++;
10594 }
10595 return 0x1;
10596 }
10597
10598 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10599 {
10600 exp->type = 2;
10601 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10602 if(!exp->expType)
10603 {
10604 exp->expType = op1->type;
10605 if(op1->type)
10606 op1->type->refCount++;
10607 }
10608 return 0x1;
10609 }
10610
10611 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10612 {
10613 exp->type = 2;
10614 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10615 if(!exp->expType)
10616 {
10617 exp->expType = op1->type;
10618 if(op1->type)
10619 op1->type->refCount++;
10620 }
10621 return 0x1;
10622 }
10623
10624 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10625 {
10626 exp->type = 2;
10627 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10628 if(!exp->expType)
10629 {
10630 exp->expType = op1->type;
10631 if(op1->type)
10632 op1->type->refCount++;
10633 }
10634 return 0x1;
10635 }
10636
10637 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10638 {
10639 exp->type = 2;
10640 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10641 if(!exp->expType)
10642 {
10643 exp->expType = op1->type;
10644 if(op1->type)
10645 op1->type->refCount++;
10646 }
10647 return 0x1;
10648 }
10649
10650 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10651 {
10652 exp->type = 2;
10653 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10654 if(!exp->expType)
10655 {
10656 exp->expType = op1->type;
10657 if(op1->type)
10658 op1->type->refCount++;
10659 }
10660 return 0x1;
10661 }
10662
10663 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10664 {
10665 exp->type = 2;
10666 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10667 if(!exp->expType)
10668 {
10669 exp->expType = op1->type;
10670 if(op1->type)
10671 op1->type->refCount++;
10672 }
10673 return 0x1;
10674 }
10675
10676 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10677 {
10678 exp->type = 2;
10679 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10680 if(!exp->expType)
10681 {
10682 exp->expType = op1->type;
10683 if(op1->type)
10684 op1->type->refCount++;
10685 }
10686 return 0x1;
10687 }
10688
10689 struct OpTable intOps =
10690 {
10691 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
10692 };
10693
10694 struct OpTable uintOps =
10695 {
10696 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
10697 };
10698
10699 struct OpTable int64Ops =
10700 {
10701 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
10702 };
10703
10704 struct OpTable uint64Ops =
10705 {
10706 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
10707 };
10708
10709 struct OpTable shortOps =
10710 {
10711 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
10712 };
10713
10714 struct OpTable ushortOps =
10715 {
10716 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
10717 };
10718
10719 struct OpTable floatOps =
10720 {
10721 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
10722 };
10723
10724 struct OpTable doubleOps =
10725 {
10726 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
10727 };
10728
10729 struct OpTable charOps =
10730 {
10731 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
10732 };
10733
10734 struct OpTable ucharOps =
10735 {
10736 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
10737 };
10738
10739 void ReadString(char * output, char * string)
10740 {
10741 int len = strlen(string);
10742 int c, d = 0;
10743 unsigned int quoted = 0x0, escaped = 0x0;
10744
10745 for(c = 0; c < len; c++)
10746 {
10747 char ch = string[c];
10748
10749 if(escaped)
10750 {
10751 switch(ch)
10752 {
10753 case 'n':
10754 output[d] = '\n';
10755 break;
10756 case 't':
10757 output[d] = '\t';
10758 break;
10759 case 'a':
10760 output[d] = '\a';
10761 break;
10762 case 'b':
10763 output[d] = '\b';
10764 break;
10765 case 'f':
10766 output[d] = '\f';
10767 break;
10768 case 'r':
10769 output[d] = '\r';
10770 break;
10771 case 'v':
10772 output[d] = '\v';
10773 break;
10774 case '\\':
10775 output[d] = '\\';
10776 break;
10777 case '\"':
10778 output[d] = '\"';
10779 break;
10780 case '\'':
10781 output[d] = '\'';
10782 break;
10783 default:
10784 output[d] = ch;
10785 }
10786 d++;
10787 escaped = 0x0;
10788 }
10789 else
10790 {
10791 if(ch == '\"')
10792 quoted ^= 0x1;
10793 else if(quoted)
10794 {
10795 if(ch == '\\')
10796 escaped = 0x1;
10797 else
10798 output[d++] = ch;
10799 }
10800 }
10801 }
10802 output[d] = '\0';
10803 }
10804
10805 int UnescapeString(char * d, char * s, int len)
10806 {
10807 int j = 0, k = 0;
10808 char ch;
10809
10810 while(j < len && (ch = s[j]))
10811 {
10812 switch(ch)
10813 {
10814 case '\\':
10815 switch((ch = s[++j]))
10816 {
10817 case 'n':
10818 d[k] = '\n';
10819 break;
10820 case 't':
10821 d[k] = '\t';
10822 break;
10823 case 'a':
10824 d[k] = '\a';
10825 break;
10826 case 'b':
10827 d[k] = '\b';
10828 break;
10829 case 'f':
10830 d[k] = '\f';
10831 break;
10832 case 'r':
10833 d[k] = '\r';
10834 break;
10835 case 'v':
10836 d[k] = '\v';
10837 break;
10838 case '\\':
10839 d[k] = '\\';
10840 break;
10841 case '\"':
10842 d[k] = '\"';
10843 break;
10844 case '\'':
10845 d[k] = '\'';
10846 break;
10847 default:
10848 d[k] = '\\';
10849 d[k] = ch;
10850 }
10851 break;
10852 default:
10853 d[k] = ch;
10854 }
10855 j++, k++;
10856 }
10857 d[k] = '\0';
10858 return k;
10859 }
10860
10861 char * OffsetEscapedString(char * s, int len, int offset)
10862 {
10863 char ch;
10864 int j = 0, k = 0;
10865
10866 while(j < len && k < offset && (ch = s[j]))
10867 {
10868 if(ch == '\\')
10869 ++j;
10870 j++, k++;
10871 }
10872 return (k == offset) ? s + j : (((void *)0));
10873 }
10874
10875 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10876
10877 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10878
10879 extern double strtod(const char * , char * * );
10880
10881 extern float (* __ecereMethod_float_inf)(void);
10882
10883 extern float (* __ecereMethod_float_nan)(void);
10884
10885 extern double (* __ecereMethod_double_inf)(void);
10886
10887 extern double (* __ecereMethod_double_nan)(void);
10888
10889 struct Operand GetOperand(struct Expression * exp)
10890 {
10891 struct Operand op =
10892 {
10893 0, 0, 0,
10894 .__anon1 = {
10895 .c = 0
10896 },
10897 {
10898 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10899 }
10900 };
10901 struct Type * type = exp->expType;
10902
10903 if(type)
10904 {
10905 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))
10906 {
10907 if(!type->__anon1._class->__anon1.registered->dataType)
10908 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
10909 type = type->__anon1._class->__anon1.registered->dataType;
10910 }
10911 if(exp->type == 3 && op.kind == 13)
10912 {
10913 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10914 op.kind = 13;
10915 op.ops = uint64Ops;
10916 }
10917 else if(exp->isConstant && exp->type == 2)
10918 {
10919 op.kind = type->kind;
10920 op.type = exp->expType;
10921 switch(op.kind)
10922 {
10923 case 24:
10924 case 1:
10925 {
10926 if(exp->__anon1.__anon1.constant[0] == '\'')
10927 {
10928 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10929 op.ops = charOps;
10930 }
10931 else if(type->isSigned)
10932 {
10933 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10934 op.ops = charOps;
10935 }
10936 else
10937 {
10938 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10939 op.ops = ucharOps;
10940 }
10941 break;
10942 }
10943 case 2:
10944 if(type->isSigned)
10945 {
10946 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10947 op.ops = shortOps;
10948 }
10949 else
10950 {
10951 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10952 op.ops = ushortOps;
10953 }
10954 break;
10955 case 3:
10956 case 5:
10957 if(type->isSigned)
10958 {
10959 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10960 op.ops = intOps;
10961 }
10962 else
10963 {
10964 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10965 op.ops = uintOps;
10966 }
10967 op.kind = 3;
10968 break;
10969 case 4:
10970 if(type->isSigned)
10971 {
10972 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10973 op.ops = int64Ops;
10974 }
10975 else
10976 {
10977 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10978 op.ops = uint64Ops;
10979 }
10980 op.kind = 4;
10981 break;
10982 case 22:
10983 if(type->isSigned)
10984 {
10985 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10986 op.ops = int64Ops;
10987 }
10988 else
10989 {
10990 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10991 op.ops = uint64Ops;
10992 }
10993 op.kind = 4;
10994 break;
10995 case 23:
10996 if(type->isSigned)
10997 {
10998 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10999 op.ops = int64Ops;
11000 }
11001 else
11002 {
11003 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11004 op.ops = uint64Ops;
11005 }
11006 op.kind = 4;
11007 break;
11008 case 6:
11009 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11010 op.__anon1.f = __ecereMethod_float_inf();
11011 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11012 op.__anon1.f = -__ecereMethod_float_inf();
11013 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11014 op.__anon1.f = __ecereMethod_float_nan();
11015 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11016 op.__anon1.f = -__ecereMethod_float_nan();
11017 else
11018 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11019 op.ops = floatOps;
11020 break;
11021 case 7:
11022 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11023 op.__anon1.d = __ecereMethod_double_inf();
11024 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11025 op.__anon1.d = -__ecereMethod_double_inf();
11026 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11027 op.__anon1.d = __ecereMethod_double_nan();
11028 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11029 op.__anon1.d = -__ecereMethod_double_nan();
11030 else
11031 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11032 op.ops = doubleOps;
11033 break;
11034 case 12:
11035 case 13:
11036 case 8:
11037 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11038 op.kind = 13;
11039 op.ops = uint64Ops;
11040 break;
11041 }
11042 }
11043 }
11044 return op;
11045 }
11046
11047 int __ecereVMethodID_class_OnGetString;
11048
11049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11050
11051 static __attribute__((unused)) void UnusedFunction()
11052 {
11053 int a;
11054
11055 ((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);
11056 }
11057
11058 extern int __ecereVMethodID_class_OnGetString;
11059
11060 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11061 {
11062 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11063
11064 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11065 {
11066 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11067 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11068 else
11069 {
11070 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11071 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11072 struct Type * type;
11073 void * ptr = inst->data + dataMember->offset + offset;
11074 char * result = (((void *)0));
11075
11076 exp->loc = member->loc = inst->loc;
11077 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11078 if(!dataMember->dataType)
11079 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11080 type = dataMember->dataType;
11081 if(type->kind == 8)
11082 {
11083 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11084
11085 if(_class->type == 4)
11086 {
11087 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11088
11089 if(enumClass)
11090 {
11091 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11092 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11093
11094 for(item = e->values.first; item; item = item->next)
11095 {
11096 if((int)item->data == *(int *)ptr)
11097 {
11098 result = item->name;
11099 break;
11100 }
11101 }
11102 if(result)
11103 {
11104 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11105 exp->type = 0;
11106 exp->destType = MkClassType(_class->fullName);
11107 ProcessExpressionType(exp);
11108 }
11109 }
11110 }
11111 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11112 {
11113 if(!_class->dataType)
11114 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11115 type = _class->dataType;
11116 }
11117 }
11118 if(!result)
11119 {
11120 switch(type->kind)
11121 {
11122 case 6:
11123 {
11124 FreeExpContents(exp);
11125 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11126 exp->type = 2;
11127 break;
11128 }
11129 case 7:
11130 {
11131 FreeExpContents(exp);
11132 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11133 exp->type = 2;
11134 break;
11135 }
11136 case 3:
11137 {
11138 FreeExpContents(exp);
11139 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11140 exp->type = 2;
11141 break;
11142 }
11143 case 4:
11144 {
11145 FreeExpContents(exp);
11146 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11147 exp->type = 2;
11148 break;
11149 }
11150 case 22:
11151 {
11152 FreeExpContents(exp);
11153 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11154 exp->type = 2;
11155 break;
11156 }
11157 case 23:
11158 {
11159 FreeExpContents(exp);
11160 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11161 exp->type = 2;
11162 break;
11163 }
11164 default:
11165 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11166 }
11167 }
11168 ListAdd(memberList, member);
11169 }
11170 if(parentDataMember->type == 1)
11171 break;
11172 }
11173 }
11174
11175 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11176
11177 void PopulateInstance(struct Instantiation * inst)
11178 {
11179 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11180 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11181 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11182 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11183
11184 if(!inst->members)
11185 inst->members = MkListOne(MkMembersInitList(memberList));
11186 else
11187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11188 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11189 {
11190 if(!dataMember->isProperty)
11191 {
11192 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11193 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11194 else
11195 {
11196 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11197 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11198 struct Type * type;
11199 void * ptr = inst->data + dataMember->offset;
11200 char * result = (((void *)0));
11201
11202 exp->loc = member->loc = inst->loc;
11203 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11204 if(!dataMember->dataType)
11205 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11206 type = dataMember->dataType;
11207 if(type->kind == 8)
11208 {
11209 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11210
11211 if(_class->type == 4)
11212 {
11213 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11214
11215 if(enumClass)
11216 {
11217 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11218 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11219
11220 for(item = e->values.first; item; item = item->next)
11221 {
11222 if((int)item->data == *(int *)ptr)
11223 {
11224 result = item->name;
11225 break;
11226 }
11227 }
11228 }
11229 if(result)
11230 {
11231 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11232 exp->type = 0;
11233 exp->destType = MkClassType(_class->fullName);
11234 ProcessExpressionType(exp);
11235 }
11236 }
11237 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11238 {
11239 if(!_class->dataType)
11240 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11241 type = _class->dataType;
11242 }
11243 }
11244 if(!result)
11245 {
11246 switch(type->kind)
11247 {
11248 case 6:
11249 {
11250 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11251 exp->type = 2;
11252 break;
11253 }
11254 case 7:
11255 {
11256 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11257 exp->type = 2;
11258 break;
11259 }
11260 case 3:
11261 {
11262 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11263 exp->type = 2;
11264 break;
11265 }
11266 case 4:
11267 {
11268 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11269 exp->type = 2;
11270 break;
11271 }
11272 case 22:
11273 {
11274 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11275 exp->type = 2;
11276 break;
11277 }
11278 default:
11279 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11280 }
11281 }
11282 ListAdd(memberList, member);
11283 }
11284 }
11285 }
11286 }
11287
11288 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);
11289
11290 extern void FreeInstance(struct Instantiation * inst);
11291
11292 void ComputeInstantiation(struct Expression * exp)
11293 {
11294 struct Instantiation * inst = exp->__anon1.instance;
11295 struct MembersInit * members;
11296 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11297 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11298 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11299 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11300 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11301 int subMemberStackPos = 0;
11302 uint64 bits = 0;
11303
11304 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11305 {
11306 if(inst->data)
11307 return ;
11308 if(_class->type == 0 || _class->type == 5)
11309 {
11310 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11311 if(_class->type == 0)
11312 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11313 }
11314 else
11315 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11316 }
11317 if(inst->members)
11318 {
11319 for(members = (*inst->members).first; members; members = members->next)
11320 {
11321 switch(members->type)
11322 {
11323 case 0:
11324 {
11325 if(members->__anon1.dataMembers)
11326 {
11327 struct MemberInit * member;
11328
11329 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11330 {
11331 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11332 unsigned int found = 0x0;
11333 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11334 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11335 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11336 unsigned int dataMemberOffset;
11337
11338 if(!ident)
11339 {
11340 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11341 if(curMember)
11342 {
11343 if(curMember->isProperty)
11344 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11345 else
11346 {
11347 dataMember = curMember;
11348 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11349 if(_class->type == 0)
11350 dataMemberOffset += _class->base->structSize;
11351 }
11352 found = 0x1;
11353 }
11354 }
11355 else
11356 {
11357 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11358 if(prop)
11359 {
11360 found = 0x1;
11361 if(prop->memberAccess == 1)
11362 {
11363 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11364 curClass = prop->_class;
11365 }
11366 }
11367 else
11368 {
11369 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11370 int _subMemberStackPos = 0;
11371
11372 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11373 if(dataMember)
11374 {
11375 found = 0x1;
11376 if(dataMember->memberAccess == 1)
11377 {
11378 curMember = dataMember;
11379 curClass = dataMember->_class;
11380 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11381 subMemberStackPos = _subMemberStackPos;
11382 }
11383 }
11384 }
11385 }
11386 if(found && member->initializer && member->initializer->type == 0)
11387 {
11388 struct Expression * value = member->initializer->__anon1.exp;
11389 struct Type * type = (((void *)0));
11390 unsigned int deepMember = 0x0;
11391
11392 if(prop)
11393 {
11394 type = prop->dataType;
11395 }
11396 else if(dataMember)
11397 {
11398 if(!dataMember->dataType)
11399 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11400 type = dataMember->dataType;
11401 }
11402 if(ident && ident->next)
11403 {
11404 deepMember = 0x1;
11405 for(ident = ident->next; ident && type; ident = ident->next)
11406 {
11407 if(type->kind == 8)
11408 {
11409 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11410 if(prop)
11411 type = prop->dataType;
11412 else
11413 {
11414 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11415 if(dataMember)
11416 type = dataMember->dataType;
11417 }
11418 }
11419 else if(type->kind == 9 || type->kind == 10)
11420 {
11421 struct Type * memberType;
11422
11423 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11424 {
11425 if(!strcmp(memberType->name, ident->string))
11426 {
11427 type = memberType;
11428 break;
11429 }
11430 }
11431 }
11432 }
11433 }
11434 if(value)
11435 {
11436 FreeType(value->destType);
11437 value->destType = type;
11438 if(type)
11439 type->refCount++;
11440 ComputeExpression(value);
11441 }
11442 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11443 {
11444 if(type->kind == 8)
11445 {
11446 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11447
11448 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11449 {
11450 if(!_class->dataType)
11451 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11452 type = _class->dataType;
11453 }
11454 }
11455 if(dataMember)
11456 {
11457 void * ptr = inst->data + dataMemberOffset;
11458
11459 if(value->type == 2)
11460 {
11461 switch(type->kind)
11462 {
11463 case 3:
11464 {
11465 GetInt(value, (int *)ptr);
11466 break;
11467 }
11468 case 4:
11469 {
11470 GetInt64(value, (long long *)ptr);
11471 break;
11472 }
11473 case 22:
11474 {
11475 GetIntPtr(value, (intptr_t *)ptr);
11476 break;
11477 }
11478 case 23:
11479 {
11480 GetIntSize(value, (ssize_t *)ptr);
11481 break;
11482 }
11483 case 6:
11484 {
11485 GetFloat(value, (float *)ptr);
11486 break;
11487 }
11488 case 7:
11489 {
11490 GetDouble(value, (double *)ptr);
11491 break;
11492 }
11493 }
11494 }
11495 else if(value->type == 1)
11496 {
11497 if(type->kind == 8)
11498 {
11499 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11500
11501 if(_class->type == 1)
11502 {
11503 ComputeTypeSize(type);
11504 if(value->__anon1.instance->data)
11505 memcpy(ptr, value->__anon1.instance->data, type->size);
11506 }
11507 }
11508 }
11509 }
11510 else if(prop)
11511 {
11512 if(value->type == 1 && value->__anon1.instance->data)
11513 {
11514 if(type->kind == 8)
11515 {
11516 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11517
11518 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)))
11519 {
11520 void (* Set)(void *, void *) = (void *)prop->Set;
11521
11522 Set(inst->data, value->__anon1.instance->data);
11523 PopulateInstance(inst);
11524 }
11525 }
11526 }
11527 else if(value->type == 2)
11528 {
11529 switch(type->kind)
11530 {
11531 case 7:
11532 {
11533 void (* Set)(void *, double) = (void *)prop->Set;
11534
11535 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11536 break;
11537 }
11538 case 6:
11539 {
11540 void (* Set)(void *, float) = (void *)prop->Set;
11541
11542 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11543 break;
11544 }
11545 case 3:
11546 {
11547 void (* Set)(void *, int) = (void *)prop->Set;
11548
11549 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11550 break;
11551 }
11552 case 4:
11553 {
11554 void (* Set)(void *, long long) = (void *)prop->Set;
11555
11556 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11557 break;
11558 }
11559 case 22:
11560 {
11561 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11562
11563 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11564 break;
11565 }
11566 case 23:
11567 {
11568 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11569
11570 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11571 break;
11572 }
11573 }
11574 }
11575 else if(value->type == 3)
11576 {
11577 char temp[1024];
11578
11579 ReadString(temp, value->__anon1.__anon2.string);
11580 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11581 }
11582 }
11583 }
11584 else if(!deepMember && type && _class->type == 3)
11585 {
11586 if(prop)
11587 {
11588 if(value->type == 2)
11589 {
11590 if(type->kind == 8)
11591 {
11592 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11593
11594 if(_class->type == 3)
11595 {
11596 if(!_class->dataType)
11597 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11598 type = _class->dataType;
11599 }
11600 }
11601 switch(type->kind)
11602 {
11603 case 6:
11604 {
11605 float fValue;
11606 float (* Set)(float) = (void *)prop->Set;
11607
11608 GetFloat(member->initializer->__anon1.exp, &fValue);
11609 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11610 exp->type = 2;
11611 break;
11612 }
11613 case 7:
11614 {
11615 double dValue;
11616 double (* Set)(double) = (void *)prop->Set;
11617
11618 GetDouble(member->initializer->__anon1.exp, &dValue);
11619 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11620 exp->type = 2;
11621 break;
11622 }
11623 }
11624 }
11625 }
11626 }
11627 else if(!deepMember && type && _class->type == 2)
11628 {
11629 if(prop)
11630 {
11631 if(value->type == 1 && value->__anon1.instance->data)
11632 {
11633 unsigned int (* Set)(void *) = (void *)prop->Set;
11634
11635 bits = Set(value->__anon1.instance->data);
11636 }
11637 else if(value->type == 2)
11638 {
11639 }
11640 }
11641 else if(dataMember)
11642 {
11643 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11644 struct Type * type;
11645 uint64 part;
11646
11647 bits = (bits & ~bitMember->mask);
11648 if(!bitMember->dataType)
11649 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11650 type = bitMember->dataType;
11651 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11652 {
11653 if(!type->__anon1._class->__anon1.registered->dataType)
11654 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
11655 type = type->__anon1._class->__anon1.registered->dataType;
11656 }
11657 switch(type->kind)
11658 {
11659 case 24:
11660 case 1:
11661 {
11662 unsigned char v;
11663
11664 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11665 part = (uint64)v;
11666 break;
11667 }
11668 case 2:
11669 {
11670 unsigned short v;
11671
11672 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11673 part = (uint64)v;
11674 break;
11675 }
11676 case 3:
11677 case 5:
11678 {
11679 unsigned int v;
11680
11681 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11682 part = (uint64)v;
11683 break;
11684 }
11685 case 4:
11686 {
11687 uint64 v;
11688
11689 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11690 part = v;
11691 break;
11692 }
11693 case 22:
11694 {
11695 uintptr_t v;
11696
11697 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11698 part = (uint64)v;
11699 break;
11700 }
11701 case 23:
11702 {
11703 size_t v;
11704
11705 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11706 part = (uint64)v;
11707 break;
11708 }
11709 }
11710 bits |= part << bitMember->pos;
11711 }
11712 }
11713 }
11714 else
11715 {
11716 if(_class && _class->type == 3)
11717 {
11718 ComputeExpression(member->initializer->__anon1.exp);
11719 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11720 exp->type = 2;
11721 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11722 }
11723 }
11724 }
11725 }
11726 break;
11727 }
11728 }
11729 }
11730 }
11731 if(_class && _class->type == 2)
11732 {
11733 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11734 exp->type = 2;
11735 }
11736 if(exp->type != 1)
11737 {
11738 FreeInstance(inst);
11739 }
11740 }
11741
11742 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11743 {
11744 unsigned int result = 0x0;
11745
11746 switch(kind)
11747 {
11748 case 2:
11749 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11750 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11751 break;
11752 case 3:
11753 case 5:
11754 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11755 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11756 break;
11757 case 4:
11758 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)
11759 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11760 break;
11761 case 6:
11762 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)
11763 result = GetOpFloat(op, &op->__anon1.f);
11764 break;
11765 case 7:
11766 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)
11767 result = GetOpDouble(op, &op->__anon1.d);
11768 break;
11769 case 13:
11770 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)
11771 result = GetOpUIntPtr(op, &op->__anon1.ui64);
11772 break;
11773 case 15:
11774 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)
11775 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11776 break;
11777 case 22:
11778 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11779 result = isSigned ? GetOpIntPtr(op, &op->__anon1.i64) : GetOpUIntPtr(op, &op->__anon1.i64);
11780 break;
11781 case 23:
11782 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11783 result = isSigned ? GetOpIntSize(op, &op->__anon1.ui64) : GetOpUIntSize(op, &op->__anon1.ui64);
11784 break;
11785 }
11786 return result;
11787 }
11788
11789 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11790 {
11791 if(exp->__anon1.op.op == SIZEOF)
11792 {
11793 FreeExpContents(exp);
11794 exp->type = 2;
11795 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11796 }
11797 else
11798 {
11799 if(!exp->__anon1.op.exp1)
11800 {
11801 switch(exp->__anon1.op.op)
11802 {
11803 case '+':
11804 {
11805 struct Expression * exp2 = exp->__anon1.op.exp2;
11806
11807 exp->__anon1.op.exp2 = (((void *)0));
11808 FreeExpContents(exp);
11809 FreeType(exp->expType);
11810 FreeType(exp->destType);
11811 *exp = *exp2;
11812 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11813 break;
11814 }
11815 case '-':
11816 if(op1->ops.Neg)
11817 {
11818 FreeExpContents(exp);
11819 op1->ops.Neg(exp, op1);
11820 }
11821 break;
11822 case '~':
11823 if(op1->ops.BitNot)
11824 {
11825 FreeExpContents(exp);
11826 op1->ops.BitNot(exp, op1);
11827 }
11828 break;
11829 case '!':
11830 if(op1->ops.Not)
11831 {
11832 FreeExpContents(exp);
11833 op1->ops.Not(exp, op1);
11834 }
11835 break;
11836 }
11837 }
11838 else
11839 {
11840 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11841 {
11842 if(Promote(op2, op1->kind, op1->type->isSigned))
11843 op2->kind = op1->kind, op2->ops = op1->ops;
11844 else if(Promote(op1, op2->kind, op2->type->isSigned))
11845 op1->kind = op2->kind, op1->ops = op2->ops;
11846 }
11847 switch(exp->__anon1.op.op)
11848 {
11849 case '+':
11850 if(op1->ops.Add)
11851 {
11852 FreeExpContents(exp);
11853 op1->ops.Add(exp, op1, op2);
11854 }
11855 break;
11856 case '-':
11857 if(op1->ops.Sub)
11858 {
11859 FreeExpContents(exp);
11860 op1->ops.Sub(exp, op1, op2);
11861 }
11862 break;
11863 case '*':
11864 if(op1->ops.Mul)
11865 {
11866 FreeExpContents(exp);
11867 op1->ops.Mul(exp, op1, op2);
11868 }
11869 break;
11870 case '/':
11871 if(op1->ops.Div)
11872 {
11873 FreeExpContents(exp);
11874 op1->ops.Div(exp, op1, op2);
11875 }
11876 break;
11877 case '%':
11878 if(op1->ops.Mod)
11879 {
11880 FreeExpContents(exp);
11881 op1->ops.Mod(exp, op1, op2);
11882 }
11883 break;
11884 case '&':
11885 if(exp->__anon1.op.exp2)
11886 {
11887 if(op1->ops.BitAnd)
11888 {
11889 FreeExpContents(exp);
11890 op1->ops.BitAnd(exp, op1, op2);
11891 }
11892 }
11893 break;
11894 case '|':
11895 if(op1->ops.BitOr)
11896 {
11897 FreeExpContents(exp);
11898 op1->ops.BitOr(exp, op1, op2);
11899 }
11900 break;
11901 case '^':
11902 if(op1->ops.BitXor)
11903 {
11904 FreeExpContents(exp);
11905 op1->ops.BitXor(exp, op1, op2);
11906 }
11907 break;
11908 case LEFT_OP:
11909 if(op1->ops.LShift)
11910 {
11911 FreeExpContents(exp);
11912 op1->ops.LShift(exp, op1, op2);
11913 }
11914 break;
11915 case RIGHT_OP:
11916 if(op1->ops.RShift)
11917 {
11918 FreeExpContents(exp);
11919 op1->ops.RShift(exp, op1, op2);
11920 }
11921 break;
11922 case EQ_OP:
11923 if(op1->ops.Equ)
11924 {
11925 FreeExpContents(exp);
11926 op1->ops.Equ(exp, op1, op2);
11927 }
11928 break;
11929 case NE_OP:
11930 if(op1->ops.Nqu)
11931 {
11932 FreeExpContents(exp);
11933 op1->ops.Nqu(exp, op1, op2);
11934 }
11935 break;
11936 case AND_OP:
11937 if(op1->ops.And)
11938 {
11939 FreeExpContents(exp);
11940 op1->ops.And(exp, op1, op2);
11941 }
11942 break;
11943 case OR_OP:
11944 if(op1->ops.Or)
11945 {
11946 FreeExpContents(exp);
11947 op1->ops.Or(exp, op1, op2);
11948 }
11949 break;
11950 case '>':
11951 if(op1->ops.Grt)
11952 {
11953 FreeExpContents(exp);
11954 op1->ops.Grt(exp, op1, op2);
11955 }
11956 break;
11957 case '<':
11958 if(op1->ops.Sma)
11959 {
11960 FreeExpContents(exp);
11961 op1->ops.Sma(exp, op1, op2);
11962 }
11963 break;
11964 case GE_OP:
11965 if(op1->ops.GrtEqu)
11966 {
11967 FreeExpContents(exp);
11968 op1->ops.GrtEqu(exp, op1, op2);
11969 }
11970 break;
11971 case LE_OP:
11972 if(op1->ops.SmaEqu)
11973 {
11974 FreeExpContents(exp);
11975 op1->ops.SmaEqu(exp, op1, op2);
11976 }
11977 break;
11978 }
11979 }
11980 }
11981 }
11982
11983 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11984
11985 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11986
11987 void ComputeExpression(struct Expression * exp)
11988 {
11989 char expString[10240];
11990
11991 expString[0] = '\0';
11992 switch(exp->type)
11993 {
11994 case 1:
11995 {
11996 ComputeInstantiation(exp);
11997 break;
11998 }
11999 case 4:
12000 {
12001 struct Expression * exp1, * exp2 = (((void *)0));
12002 struct Operand op1 =
12003 {
12004 0, 0, 0,
12005 .__anon1 = {
12006 .c = 0
12007 },
12008 {
12009 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12010 }
12011 };
12012 struct Operand op2 =
12013 {
12014 0, 0, 0,
12015 .__anon1 = {
12016 .c = 0
12017 },
12018 {
12019 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12020 }
12021 };
12022
12023 if(exp->__anon1.op.exp2)
12024 {
12025 struct Expression * e = exp->__anon1.op.exp2;
12026
12027 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12028 {
12029 if(e->type == 5 || e->type == 32 || e->type == 23)
12030 {
12031 if(e->type == 23)
12032 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12033 else
12034 e = (*e->__anon1.list).last;
12035 }
12036 }
12037 if(exp->__anon1.op.op == 261 && e && e->expType)
12038 {
12039 if(e->type == 3 && e->__anon1.__anon2.string)
12040 {
12041 char * string = e->__anon1.__anon2.string;
12042 int len = strlen(string);
12043 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12044
12045 len = UnescapeString(tmp, string + 1, len - 2);
12046 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12047 FreeExpContents(exp);
12048 exp->type = 2;
12049 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12050 }
12051 else
12052 {
12053 struct Type * type = e->expType;
12054
12055 type->refCount++;
12056 FreeExpContents(exp);
12057 exp->type = 2;
12058 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12059 FreeType(type);
12060 }
12061 break;
12062 }
12063 else
12064 ComputeExpression(exp->__anon1.op.exp2);
12065 }
12066 if(exp->__anon1.op.exp1)
12067 {
12068 ComputeExpression(exp->__anon1.op.exp1);
12069 exp1 = exp->__anon1.op.exp1;
12070 exp2 = exp->__anon1.op.exp2;
12071 op1 = GetOperand(exp1);
12072 if(op1.type)
12073 op1.type->refCount++;
12074 if(exp2)
12075 {
12076 op2 = GetOperand(exp2);
12077 if(op2.type)
12078 op2.type->refCount++;
12079 }
12080 }
12081 else
12082 {
12083 exp1 = exp->__anon1.op.exp2;
12084 op1 = GetOperand(exp1);
12085 if(op1.type)
12086 op1.type->refCount++;
12087 }
12088 CallOperator(exp, exp1, exp2, &op1, &op2);
12089 if(op1.type)
12090 FreeType(op1.type);
12091 if(op2.type)
12092 FreeType(op2.type);
12093 break;
12094 }
12095 case 5:
12096 case 32:
12097 {
12098 struct Expression * e, * n;
12099
12100 for(e = (*exp->__anon1.list).first; e; e = n)
12101 {
12102 n = e->next;
12103 if(!n)
12104 {
12105 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12106 struct Expression * prev = exp->prev;
12107 struct Expression * next = exp->next;
12108
12109 ComputeExpression(e);
12110 FreeType(exp->expType);
12111 FreeType(exp->destType);
12112 *exp = *e;
12113 exp->prev = prev;
12114 exp->next = next;
12115 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12116 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12117 }
12118 else
12119 {
12120 FreeExpression(e);
12121 }
12122 }
12123 break;
12124 }
12125 case 8:
12126 {
12127 struct Expression * memberExp = exp->__anon1.member.exp;
12128 struct Identifier * memberID = exp->__anon1.member.member;
12129 struct Type * type;
12130
12131 ComputeExpression(exp->__anon1.member.exp);
12132 type = exp->__anon1.member.exp->expType;
12133 if(type)
12134 {
12135 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)));
12136 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12137 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12138 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12139
12140 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12141 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12142 if(!_class)
12143 {
12144 char string[256];
12145 struct Symbol * classSym;
12146
12147 string[0] = '\0';
12148 PrintTypeNoConst(type, string, 0x0, 0x1);
12149 classSym = FindClass(string);
12150 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12151 }
12152 if(exp->__anon1.member.member)
12153 {
12154 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12155 if(!prop)
12156 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12157 }
12158 if(!prop && !member && _class && exp->__anon1.member.member)
12159 {
12160 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12161
12162 convertTo = _class;
12163 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12164 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12165 }
12166 if(prop)
12167 {
12168 if(prop->compiled)
12169 {
12170 struct Type * type = prop->dataType;
12171
12172 if(_class->type == 3)
12173 {
12174 if(type->kind == 8)
12175 {
12176 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12177
12178 if(_class->type == 3)
12179 {
12180 if(!_class->dataType)
12181 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12182 type = _class->dataType;
12183 }
12184 }
12185 switch(type->kind)
12186 {
12187 case 6:
12188 {
12189 float value;
12190 float (* Get)(float) = (void *)prop->Get;
12191
12192 GetFloat(exp->__anon1.member.exp, &value);
12193 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12194 exp->type = 2;
12195 break;
12196 }
12197 case 7:
12198 {
12199 double value;
12200 double (* Get)(double);
12201
12202 GetDouble(exp->__anon1.member.exp, &value);
12203 if(convertTo)
12204 Get = (void *)prop->Set;
12205 else
12206 Get = (void *)prop->Get;
12207 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12208 exp->type = 2;
12209 break;
12210 }
12211 }
12212 }
12213 else
12214 {
12215 if(convertTo)
12216 {
12217 struct Expression * value = exp->__anon1.member.exp;
12218 struct Type * type;
12219
12220 if(!prop->dataType)
12221 ProcessPropertyType(prop);
12222 type = prop->dataType;
12223 if(!type)
12224 {
12225 }
12226 else if(_class->type == 1)
12227 {
12228 switch(type->kind)
12229 {
12230 case 8:
12231 {
12232 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12233
12234 if(propertyClass->type == 1 && value->type == 1)
12235 {
12236 void (* Set)(void *, void *) = (void *)prop->Set;
12237
12238 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12239 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12240 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12241 exp->__anon1.instance->loc = exp->loc;
12242 exp->type = 1;
12243 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12244 PopulateInstance(exp->__anon1.instance);
12245 }
12246 break;
12247 }
12248 case 3:
12249 {
12250 int intValue;
12251 void (* Set)(void *, int) = (void *)prop->Set;
12252
12253 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12254 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12255 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12256 exp->__anon1.instance->loc = exp->loc;
12257 exp->type = 1;
12258 GetInt(value, &intValue);
12259 Set(exp->__anon1.instance->data, intValue);
12260 PopulateInstance(exp->__anon1.instance);
12261 break;
12262 }
12263 case 4:
12264 {
12265 long long intValue;
12266 void (* Set)(void *, long long) = (void *)prop->Set;
12267
12268 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12269 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12270 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12271 exp->__anon1.instance->loc = exp->loc;
12272 exp->type = 1;
12273 GetInt64(value, &intValue);
12274 Set(exp->__anon1.instance->data, intValue);
12275 PopulateInstance(exp->__anon1.instance);
12276 break;
12277 }
12278 case 22:
12279 {
12280 intptr_t intValue;
12281 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12282
12283 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12284 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12285 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12286 exp->__anon1.instance->loc = exp->loc;
12287 exp->type = 1;
12288 GetIntPtr(value, &intValue);
12289 Set(exp->__anon1.instance->data, intValue);
12290 PopulateInstance(exp->__anon1.instance);
12291 break;
12292 }
12293 case 23:
12294 {
12295 ssize_t intValue;
12296 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12297
12298 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12299 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12300 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12301 exp->__anon1.instance->loc = exp->loc;
12302 exp->type = 1;
12303 GetIntSize(value, &intValue);
12304 Set(exp->__anon1.instance->data, intValue);
12305 PopulateInstance(exp->__anon1.instance);
12306 break;
12307 }
12308 case 6:
12309 {
12310 float floatValue;
12311 void (* Set)(void *, float) = (void *)prop->Set;
12312
12313 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12314 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12315 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12316 exp->__anon1.instance->loc = exp->loc;
12317 exp->type = 1;
12318 GetFloat(value, &floatValue);
12319 Set(exp->__anon1.instance->data, floatValue);
12320 PopulateInstance(exp->__anon1.instance);
12321 break;
12322 }
12323 case 7:
12324 {
12325 double doubleValue;
12326 void (* Set)(void *, double) = (void *)prop->Set;
12327
12328 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12329 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12330 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12331 exp->__anon1.instance->loc = exp->loc;
12332 exp->type = 1;
12333 GetDouble(value, &doubleValue);
12334 Set(exp->__anon1.instance->data, doubleValue);
12335 PopulateInstance(exp->__anon1.instance);
12336 break;
12337 }
12338 }
12339 }
12340 else if(_class->type == 2)
12341 {
12342 switch(type->kind)
12343 {
12344 case 8:
12345 {
12346 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12347
12348 if(propertyClass->type == 1 && value->__anon1.instance->data)
12349 {
12350 unsigned int (* Set)(void *) = (void *)prop->Set;
12351 unsigned int bits = Set(value->__anon1.instance->data);
12352
12353 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12354 exp->type = 2;
12355 break;
12356 }
12357 else if(_class->type == 2)
12358 {
12359 unsigned int value;
12360 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12361 unsigned int bits;
12362
12363 GetUInt(exp->__anon1.member.exp, &value);
12364 bits = Set(value);
12365 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12366 exp->type = 2;
12367 }
12368 }
12369 }
12370 }
12371 }
12372 else
12373 {
12374 if(_class->type == 2)
12375 {
12376 unsigned int value;
12377
12378 GetUInt(exp->__anon1.member.exp, &value);
12379 switch(type->kind)
12380 {
12381 case 8:
12382 {
12383 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12384
12385 if(_class->type == 1)
12386 {
12387 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12388
12389 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12390 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12391 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12392 exp->__anon1.instance->loc = exp->loc;
12393 exp->type = 1;
12394 Get(value, exp->__anon1.instance->data);
12395 PopulateInstance(exp->__anon1.instance);
12396 }
12397 else if(_class->type == 2)
12398 {
12399 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12400 uint64 bits = Get(value);
12401
12402 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12403 exp->type = 2;
12404 }
12405 break;
12406 }
12407 }
12408 }
12409 else if(_class->type == 1)
12410 {
12411 char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12412
12413 switch(type->kind)
12414 {
12415 case 8:
12416 {
12417 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12418
12419 if(_class->type == 1 && value)
12420 {
12421 void (* Get)(void *, void *) = (void *)prop->Get;
12422
12423 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12424 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12425 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12426 exp->__anon1.instance->loc = exp->loc;
12427 exp->type = 1;
12428 Get(value, exp->__anon1.instance->data);
12429 PopulateInstance(exp->__anon1.instance);
12430 }
12431 break;
12432 }
12433 }
12434 }
12435 }
12436 }
12437 }
12438 else
12439 {
12440 exp->isConstant = 0x0;
12441 }
12442 }
12443 else if(member)
12444 {
12445 }
12446 }
12447 if(exp->type != 8)
12448 {
12449 FreeExpression(memberExp);
12450 FreeIdentifier(memberID);
12451 }
12452 break;
12453 }
12454 case 10:
12455 {
12456 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12457
12458 FreeExpContents(exp);
12459 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12460 exp->type = 2;
12461 FreeType(type);
12462 break;
12463 }
12464 case 15:
12465 {
12466 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12467
12468 if(classSym && classSym->__anon1.registered)
12469 {
12470 if(classSym->__anon1.registered->fixed)
12471 {
12472 FreeSpecifier(exp->__anon1._class);
12473 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12474 exp->type = 2;
12475 }
12476 else
12477 {
12478 char className[1024];
12479
12480 strcpy(className, "__ecereClass_");
12481 FullClassNameCat(className, classSym->string, 0x1);
12482 MangleClassName(className);
12483 DeclareClass(classSym, className);
12484 FreeExpContents(exp);
12485 exp->type = 9;
12486 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12487 exp->__anon1.member.member = MkIdentifier("structSize");
12488 }
12489 }
12490 break;
12491 }
12492 case 11:
12493 {
12494 struct Type * type;
12495 struct Expression * e = exp;
12496
12497 if(exp->type == 11)
12498 {
12499 if(exp->__anon1.cast.exp)
12500 ComputeExpression(exp->__anon1.cast.exp);
12501 e = exp->__anon1.cast.exp;
12502 }
12503 if(e && exp->expType)
12504 {
12505 type = exp->expType;
12506 if(type->kind == 8)
12507 {
12508 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12509
12510 if(_class && (_class->type == 3 || _class->type == 2))
12511 {
12512 if(!_class->dataType)
12513 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12514 type = _class->dataType;
12515 }
12516 }
12517 switch(type->kind)
12518 {
12519 case 24:
12520 case 1:
12521 if(type->isSigned)
12522 {
12523 char value = (char)0;
12524
12525 if(GetChar(e, &value))
12526 {
12527 FreeExpContents(exp);
12528 exp->__anon1.__anon1.constant = PrintChar(value);
12529 exp->type = 2;
12530 }
12531 }
12532 else
12533 {
12534 unsigned char value = (unsigned char)0;
12535
12536 if(GetUChar(e, &value))
12537 {
12538 FreeExpContents(exp);
12539 exp->__anon1.__anon1.constant = PrintUChar(value);
12540 exp->type = 2;
12541 }
12542 }
12543 break;
12544 case 2:
12545 if(type->isSigned)
12546 {
12547 short value = (short)0;
12548
12549 if(GetShort(e, &value))
12550 {
12551 FreeExpContents(exp);
12552 exp->__anon1.__anon1.constant = PrintShort(value);
12553 exp->type = 2;
12554 }
12555 }
12556 else
12557 {
12558 unsigned short value = (unsigned short)0;
12559
12560 if(GetUShort(e, &value))
12561 {
12562 FreeExpContents(exp);
12563 exp->__anon1.__anon1.constant = PrintUShort(value);
12564 exp->type = 2;
12565 }
12566 }
12567 break;
12568 case 3:
12569 if(type->isSigned)
12570 {
12571 int value = 0;
12572
12573 if(GetInt(e, &value))
12574 {
12575 FreeExpContents(exp);
12576 exp->__anon1.__anon1.constant = PrintInt(value);
12577 exp->type = 2;
12578 }
12579 }
12580 else
12581 {
12582 unsigned int value = 0;
12583
12584 if(GetUInt(e, &value))
12585 {
12586 FreeExpContents(exp);
12587 exp->__anon1.__anon1.constant = PrintUInt(value);
12588 exp->type = 2;
12589 }
12590 }
12591 break;
12592 case 4:
12593 if(type->isSigned)
12594 {
12595 long long value = 0;
12596
12597 if(GetInt64(e, &value))
12598 {
12599 FreeExpContents(exp);
12600 exp->__anon1.__anon1.constant = PrintInt64(value);
12601 exp->type = 2;
12602 }
12603 }
12604 else
12605 {
12606 uint64 value = 0;
12607
12608 if(GetUInt64(e, &value))
12609 {
12610 FreeExpContents(exp);
12611 exp->__anon1.__anon1.constant = PrintUInt64(value);
12612 exp->type = 2;
12613 }
12614 }
12615 break;
12616 case 22:
12617 if(type->isSigned)
12618 {
12619 intptr_t value = 0;
12620
12621 if(GetIntPtr(e, &value))
12622 {
12623 FreeExpContents(exp);
12624 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12625 exp->type = 2;
12626 }
12627 }
12628 else
12629 {
12630 uintptr_t value = 0;
12631
12632 if(GetUIntPtr(e, &value))
12633 {
12634 FreeExpContents(exp);
12635 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12636 exp->type = 2;
12637 }
12638 }
12639 break;
12640 case 23:
12641 if(type->isSigned)
12642 {
12643 ssize_t value = 0;
12644
12645 if(GetIntSize(e, &value))
12646 {
12647 FreeExpContents(exp);
12648 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12649 exp->type = 2;
12650 }
12651 }
12652 else
12653 {
12654 size_t value = 0;
12655
12656 if(GetUIntSize(e, &value))
12657 {
12658 FreeExpContents(exp);
12659 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12660 exp->type = 2;
12661 }
12662 }
12663 break;
12664 case 6:
12665 {
12666 float value = 0;
12667
12668 if(GetFloat(e, &value))
12669 {
12670 FreeExpContents(exp);
12671 exp->__anon1.__anon1.constant = PrintFloat(value);
12672 exp->type = 2;
12673 }
12674 break;
12675 }
12676 case 7:
12677 {
12678 double value = 0;
12679
12680 if(GetDouble(e, &value))
12681 {
12682 FreeExpContents(exp);
12683 exp->__anon1.__anon1.constant = PrintDouble(value);
12684 exp->type = 2;
12685 }
12686 break;
12687 }
12688 }
12689 }
12690 break;
12691 }
12692 case 12:
12693 {
12694 struct Operand op1 =
12695 {
12696 0, 0, 0,
12697 .__anon1 = {
12698 .c = 0
12699 },
12700 {
12701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12702 }
12703 };
12704 struct Operand op2 =
12705 {
12706 0, 0, 0,
12707 .__anon1 = {
12708 .c = 0
12709 },
12710 {
12711 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12712 }
12713 };
12714 struct Operand op3 =
12715 {
12716 0, 0, 0,
12717 .__anon1 = {
12718 .c = 0
12719 },
12720 {
12721 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12722 }
12723 };
12724
12725 if(exp->__anon1.cond.exp)
12726 ComputeExpression((*exp->__anon1.cond.exp).last);
12727 if(exp->__anon1.cond.elseExp)
12728 ComputeExpression(exp->__anon1.cond.elseExp);
12729 if(exp->__anon1.cond.cond)
12730 ComputeExpression(exp->__anon1.cond.cond);
12731 op1 = GetOperand(exp->__anon1.cond.cond);
12732 if(op1.type)
12733 op1.type->refCount++;
12734 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12735 if(op2.type)
12736 op2.type->refCount++;
12737 op3 = GetOperand(exp->__anon1.cond.elseExp);
12738 if(op3.type)
12739 op3.type->refCount++;
12740 if(op1.ops.Cond)
12741 {
12742 FreeExpContents(exp);
12743 op1.ops.Cond(exp, &op1, &op2, &op3);
12744 }
12745 if(op1.type)
12746 FreeType(op1.type);
12747 if(op2.type)
12748 FreeType(op2.type);
12749 if(op3.type)
12750 FreeType(op3.type);
12751 break;
12752 }
12753 }
12754 }
12755
12756 void ApplyAnyObjectLogic(struct Expression * e);
12757
12758 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12759 {
12760 unsigned int result = 0x1;
12761
12762 if(destType)
12763 {
12764 struct __ecereNameSpace__ecere__sys__OldList converts =
12765 {
12766 0, 0, 0, 0, 0
12767 };
12768 struct Conversion * convert;
12769
12770 if(destType->kind == 0)
12771 return 0x0;
12772 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12773 result = 0x0;
12774 if(converts.count)
12775 {
12776 for(convert = converts.first; convert; convert = convert->next)
12777 {
12778 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12779
12780 if(!empty)
12781 {
12782 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12783 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12784
12785 *newExp = *exp;
12786 newExp->prev = (((void *)0));
12787 newExp->next = (((void *)0));
12788 newExp->destType = (((void *)0));
12789 if(convert->isGet)
12790 {
12791 exp->type = 8;
12792 exp->addedThis = 0x1;
12793 exp->__anon1.member.exp = newExp;
12794 FreeType(exp->__anon1.member.exp->expType);
12795 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12796 exp->__anon1.member.exp->expType->classObjectType = objectType;
12797 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12798 exp->__anon1.member.memberType = 1;
12799 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12800 exp->needCast = 0x1;
12801 if(exp->expType)
12802 exp->expType->refCount++;
12803 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12804 }
12805 else
12806 {
12807 {
12808 exp->type = 8;
12809 exp->addedThis = 0x1;
12810 exp->__anon1.member.exp = newExp;
12811 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)
12812 {
12813 newExp->byReference = 0x1;
12814 }
12815 FreeType(exp->__anon1.member.exp->expType);
12816 exp->__anon1.member.exp->expType = (((void *)0));
12817 if(convert->convert->dataType)
12818 {
12819 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12820 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12821 exp->__anon1.member.exp->expType->refCount = 1;
12822 exp->__anon1.member.exp->expType->classObjectType = objectType;
12823 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12824 }
12825 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12826 exp->__anon1.member.memberType = 4;
12827 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12828 exp->needCast = 0x1;
12829 if(convert->resultType)
12830 convert->resultType->refCount++;
12831 }
12832 }
12833 }
12834 else
12835 {
12836 FreeType(exp->expType);
12837 if(convert->isGet)
12838 {
12839 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12840 if(exp->destType->casted)
12841 exp->needCast = 0x1;
12842 if(exp->expType)
12843 exp->expType->refCount++;
12844 }
12845 else
12846 {
12847 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12848 if(exp->destType->casted)
12849 exp->needCast = 0x1;
12850 if(convert->resultType)
12851 convert->resultType->refCount++;
12852 }
12853 }
12854 }
12855 if(exp->isConstant && inCompiler)
12856 ComputeExpression(exp);
12857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12858 }
12859 if(!result && exp->expType && converts.count)
12860 {
12861 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
12862 }
12863 if(!result && exp->expType && exp->destType)
12864 {
12865 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))
12866 result = 0x1;
12867 }
12868 }
12869 return result;
12870 }
12871
12872 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12873
12874 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12875
12876 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12877
12878 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12879
12880 void CheckTemplateTypes(struct Expression * exp)
12881 {
12882 struct Expression * nbExp = GetNonBracketsExp(exp);
12883
12884 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12885 {
12886 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12887 struct Context * context;
12888
12889 *newExp = *exp;
12890 if(exp->destType)
12891 exp->destType->refCount++;
12892 if(exp->expType)
12893 exp->expType->refCount++;
12894 newExp->prev = (((void *)0));
12895 newExp->next = (((void *)0));
12896 switch(exp->expType->kind)
12897 {
12898 case 7:
12899 if(exp->destType->classObjectType)
12900 {
12901 if(exp->destType)
12902 exp->destType->refCount--;
12903 if(exp->expType)
12904 exp->expType->refCount--;
12905 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12906 }
12907 else
12908 {
12909 struct __ecereNameSpace__ecere__sys__OldList * specs;
12910 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12911 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12912
12913 context = PushContext();
12914 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12915 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12916 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12917 exp->type = 23;
12918 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12919 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12920 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12921 exp->__anon1.compound->__anon1.compound.context = context;
12922 PopContext(context);
12923 }
12924 break;
12925 default:
12926 exp->type = 11;
12927 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12928 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12929 exp->needCast = 0x1;
12930 break;
12931 }
12932 }
12933 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12934 {
12935 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12936 struct Statement * compound;
12937 struct Context * context;
12938
12939 *newExp = *exp;
12940 if(exp->destType)
12941 exp->destType->refCount++;
12942 if(exp->expType)
12943 exp->expType->refCount++;
12944 newExp->prev = (((void *)0));
12945 newExp->next = (((void *)0));
12946 switch(exp->expType->kind)
12947 {
12948 case 7:
12949 if(exp->destType->classObjectType)
12950 {
12951 if(exp->destType)
12952 exp->destType->refCount--;
12953 if(exp->expType)
12954 exp->expType->refCount--;
12955 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12956 }
12957 else
12958 {
12959 struct __ecereNameSpace__ecere__sys__OldList * specs;
12960 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12961 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12962
12963 context = PushContext();
12964 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12965 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12966 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12967 exp->type = 23;
12968 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12969 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12970 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12971 exp->__anon1.compound->__anon1.compound.context = context;
12972 PopContext(context);
12973 }
12974 break;
12975 case 8:
12976 {
12977 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12978 {
12979 exp->type = 5;
12980 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)));
12981 ProcessExpressionType((*exp->__anon1.list).first);
12982 break;
12983 }
12984 else
12985 {
12986 exp->type = 5;
12987 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12988 exp->needTemplateCast = 2;
12989 newExp->needCast = 0x1;
12990 newExp->needTemplateCast = 2;
12991 ProcessExpressionType((*exp->__anon1.list).first);
12992 break;
12993 }
12994 }
12995 default:
12996 {
12997 if(exp->expType->kind == 20)
12998 {
12999 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13000
13001 if(type)
13002 {
13003 FreeType(exp->destType);
13004 FreeType(exp->expType);
13005 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13006 break;
13007 }
13008 }
13009 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13010 {
13011 exp->type = 4;
13012 exp->__anon1.op.op = '*';
13013 exp->__anon1.op.exp1 = (((void *)0));
13014 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13015 }
13016 else
13017 {
13018 char typeString[1024];
13019 struct Declarator * decl;
13020 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13021
13022 typeString[0] = '\0';
13023 PrintType(exp->expType, typeString, 0x0, 0x0);
13024 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13025 exp->type = 11;
13026 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13027 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13028 exp->__anon1.cast.exp->needCast = 0x1;
13029 }
13030 break;
13031 }
13032 }
13033 }
13034 }
13035
13036 extern int strncmp(const char * , const char * , size_t n);
13037
13038 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13039
13040 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13041 {
13042 int nsLen = strlen(nameSpace);
13043 struct Symbol * symbol;
13044
13045 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)))
13046 {
13047 char * s = symbol->string;
13048
13049 if(!strncmp(s, nameSpace, nsLen))
13050 {
13051 int c;
13052 char * namePart;
13053
13054 for(c = strlen(s) - 1; c >= 0; c--)
13055 if(s[c] == ':')
13056 break;
13057 namePart = s + c + 1;
13058 if(!strcmp(namePart, name))
13059 {
13060 return symbol;
13061 }
13062 }
13063 else
13064 break;
13065 }
13066 return (((void *)0));
13067 }
13068
13069 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13070 {
13071 int c;
13072 char nameSpace[1024];
13073 const char * namePart;
13074 unsigned int gotColon = 0x0;
13075
13076 nameSpace[0] = '\0';
13077 for(c = strlen(name) - 1; c >= 0; c--)
13078 if(name[c] == ':')
13079 {
13080 gotColon = 0x1;
13081 break;
13082 }
13083 namePart = name + c + 1;
13084 while(c >= 0 && name[c] == ':')
13085 c--;
13086 if(c >= 0)
13087 {
13088 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13089
13090 if(symbol)
13091 return symbol;
13092 memcpy(nameSpace, name, c + 1);
13093 nameSpace[c + 1] = (char)0;
13094 return ScanWithNameSpace(tree, nameSpace, namePart);
13095 }
13096 else if(gotColon)
13097 {
13098 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13099
13100 return symbol;
13101 }
13102 else
13103 {
13104 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13105
13106 if(symbol)
13107 return symbol;
13108 return ScanWithNameSpace(tree, "", namePart);
13109 }
13110 return (((void *)0));
13111 }
13112
13113 static void ProcessDeclaration(struct Declaration * decl);
13114
13115 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13116 {
13117 struct Context * ctx;
13118 struct Symbol * symbol = (((void *)0));
13119
13120 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13121 {
13122 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13123 {
13124 symbol = (((void *)0));
13125 if(thisNameSpace)
13126 {
13127 char curName[1024];
13128
13129 strcpy(curName, thisNameSpace);
13130 strcat(curName, "::");
13131 strcat(curName, name);
13132 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13133 }
13134 if(!symbol)
13135 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13136 }
13137 else
13138 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13139 if(symbol || ctx == endContext)
13140 break;
13141 }
13142 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13143 {
13144 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13145 {
13146 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13147 struct Context * tmpContext = curContext;
13148
13149 curContext = (((void *)0));
13150 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13151 curContext = tmpContext;
13152 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13153 DeclareType(symbol->type, 0x1, 0x1);
13154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13155 symbol->id = curExternal->symbol->idCode;
13156 }
13157 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13158 {
13159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13160 symbol->id = curExternal->symbol->idCode;
13161 }
13162 }
13163 return symbol;
13164 }
13165
13166 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13167 {
13168 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13169 ListAdd(specs, MkSpecifier(UNSIGNED));
13170 switch(type->kind)
13171 {
13172 case 8:
13173 {
13174 if(type->__anon1._class->__anon1.registered)
13175 {
13176 if(!type->__anon1._class->__anon1.registered->dataType)
13177 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
13178 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13179 }
13180 break;
13181 }
13182 case 7:
13183 ListAdd(specs, MkSpecifier(DOUBLE));
13184 break;
13185 case 6:
13186 ListAdd(specs, MkSpecifier(FLOAT));
13187 break;
13188 case 1:
13189 ListAdd(specs, MkSpecifier(CHAR));
13190 break;
13191 case 24:
13192 ListAdd(specs, MkSpecifier(_BOOL));
13193 break;
13194 case 2:
13195 ListAdd(specs, MkSpecifier(SHORT));
13196 break;
13197 case 4:
13198 ListAdd(specs, MkSpecifier(INT64));
13199 break;
13200 case 22:
13201 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13202 break;
13203 case 23:
13204 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13205 break;
13206 case 3:
13207 default:
13208 ListAdd(specs, MkSpecifier(INT));
13209 break;
13210 }
13211 }
13212
13213 static void PrintArraySize(struct Type * arrayType, char * string)
13214 {
13215 char size[256];
13216
13217 size[0] = '\0';
13218 strcat(size, "[");
13219 if(arrayType->__anon1.__anon4.enumClass)
13220 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13221 else if(arrayType->__anon1.__anon4.arraySizeExp)
13222 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13223 strcat(size, "]");
13224 strcat(string, size);
13225 }
13226
13227 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13228 {
13229 if(type)
13230 {
13231 if(printConst && type->constant)
13232 strcat(string, "const ");
13233 switch(type->kind)
13234 {
13235 case 8:
13236 {
13237 struct Symbol * c = type->__anon1._class;
13238
13239 if(type->classObjectType == 2)
13240 strcat(string, "typed_object");
13241 else if(type->classObjectType == 3)
13242 strcat(string, "any_object");
13243 else
13244 {
13245 if(c && c->string)
13246 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13247 }
13248 if(type->byReference)
13249 strcat(string, " &");
13250 break;
13251 }
13252 case 0:
13253 strcat(string, "void");
13254 break;
13255 case 3:
13256 strcat(string, type->isSigned ? "int" : "uint");
13257 break;
13258 case 4:
13259 strcat(string, type->isSigned ? "int64" : "uint64");
13260 break;
13261 case 22:
13262 strcat(string, type->isSigned ? "intptr" : "uintptr");
13263 break;
13264 case 23:
13265 strcat(string, type->isSigned ? "intsize" : "uintsize");
13266 break;
13267 case 1:
13268 strcat(string, type->isSigned ? "char" : "byte");
13269 break;
13270 case 24:
13271 strcat(string, "_Bool");
13272 break;
13273 case 2:
13274 strcat(string, type->isSigned ? "short" : "uint16");
13275 break;
13276 case 6:
13277 strcat(string, "float");
13278 break;
13279 case 7:
13280 strcat(string, "double");
13281 break;
13282 case 9:
13283 if(type->__anon1.__anon1.enumName)
13284 {
13285 strcat(string, "struct ");
13286 strcat(string, type->__anon1.__anon1.enumName);
13287 }
13288 else if(type->typeName)
13289 strcat(string, type->typeName);
13290 else
13291 {
13292 struct Type * member;
13293
13294 strcat(string, "struct { ");
13295 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13296 {
13297 PrintType(member, string, 0x1, fullName);
13298 strcat(string, "; ");
13299 }
13300 strcat(string, "}");
13301 }
13302 break;
13303 case 10:
13304 if(type->__anon1.__anon1.enumName)
13305 {
13306 strcat(string, "union ");
13307 strcat(string, type->__anon1.__anon1.enumName);
13308 }
13309 else if(type->typeName)
13310 strcat(string, type->typeName);
13311 else
13312 {
13313 strcat(string, "union ");
13314 strcat(string, "(unnamed)");
13315 }
13316 break;
13317 case 15:
13318 if(type->__anon1.__anon1.enumName)
13319 {
13320 strcat(string, "enum ");
13321 strcat(string, type->__anon1.__anon1.enumName);
13322 }
13323 else if(type->typeName)
13324 strcat(string, type->typeName);
13325 else
13326 strcat(string, "int");
13327 break;
13328 case 14:
13329 strcat(string, "...");
13330 break;
13331 case 19:
13332 strcat(string, "subclass(");
13333 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13334 strcat(string, ")");
13335 break;
13336 case 20:
13337 strcat(string, type->__anon1.templateParameter->identifier->string);
13338 break;
13339 case 21:
13340 strcat(string, "thisclass");
13341 break;
13342 case 17:
13343 strcat(string, "__builtin_va_list");
13344 break;
13345 }
13346 }
13347 }
13348
13349 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13350
13351 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13352 {
13353 if(type->name && type->name[0])
13354 {
13355 if(fullName)
13356 strcat(string, type->name);
13357 else
13358 {
13359 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13360
13361 if(name)
13362 name += 2;
13363 else
13364 name = type->name;
13365 strcat(string, name);
13366 }
13367 }
13368 }
13369
13370 static void PrintAttribs(struct Type * type, char * string)
13371 {
13372 if(type)
13373 {
13374 if(type->dllExport)
13375 strcat(string, "dllexport ");
13376 if(type->attrStdcall)
13377 strcat(string, "stdcall ");
13378 }
13379 }
13380
13381 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13382 {
13383 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13384 {
13385 struct Type * attrType = (((void *)0));
13386
13387 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13388 PrintAttribs(type, string);
13389 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13390 strcat(string, " const");
13391 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13392 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13393 strcat(string, " (");
13394 if(type->kind == 13)
13395 {
13396 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13397 PrintAttribs(type->__anon1.type, string);
13398 }
13399 if(type->kind == 13)
13400 {
13401 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13402 strcat(string, "*");
13403 else
13404 strcat(string, " *");
13405 }
13406 if(printConst && type->constant && type->kind == 13)
13407 strcat(string, " const");
13408 }
13409 else
13410 PrintTypeSpecs(type, string, fullName, printConst);
13411 }
13412
13413 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13414 {
13415 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13416 strcat(string, ")");
13417 if(type->kind == 12)
13418 PrintArraySize(type, string);
13419 else if(type->kind == 11)
13420 {
13421 struct Type * param;
13422
13423 strcat(string, "(");
13424 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13425 {
13426 PrintType(param, string, 0x1, fullName);
13427 if(param->next)
13428 strcat(string, ", ");
13429 }
13430 strcat(string, ")");
13431 }
13432 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13433 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13434 }
13435
13436 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13437 {
13438 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13439 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13440 strcat(string, " ");
13441 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13442 {
13443 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13444
13445 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13446 {
13447 if(type->classObjectType == 1)
13448 strcat(string, "class");
13449 else
13450 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13451 }
13452 else if(_class && _class->string)
13453 {
13454 char * s = _class->string;
13455
13456 if(fullName)
13457 strcat(string, s);
13458 else
13459 {
13460 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13461
13462 if(name)
13463 name += 2;
13464 else
13465 name = s;
13466 strcat(string, name);
13467 }
13468 }
13469 strcat(string, "::");
13470 }
13471 if(printName && type->name)
13472 PrintName(type, string, fullName);
13473 PostPrintType(type, string, fullName);
13474 if(type->bitFieldCount)
13475 {
13476 char count[100];
13477
13478 sprintf(count, ":%d", type->bitFieldCount);
13479 strcat(string, count);
13480 }
13481 }
13482
13483 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13484 {
13485 _PrintType(type, string, printName, fullName, 0x1);
13486 }
13487
13488 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13489 {
13490 _PrintType(type, string, printName, fullName, 0x0);
13491 }
13492
13493 static struct Type * FindMember(struct Type * type, char * string)
13494 {
13495 struct Type * memberType;
13496
13497 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13498 {
13499 if(!memberType->name)
13500 {
13501 struct Type * subType = FindMember(memberType, string);
13502
13503 if(subType)
13504 return subType;
13505 }
13506 else if(!strcmp(memberType->name, string))
13507 return memberType;
13508 }
13509 return (((void *)0));
13510 }
13511
13512 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13513 {
13514 struct Type * memberType;
13515
13516 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13517 {
13518 if(!memberType->name)
13519 {
13520 struct Type * subType = FindMember(memberType, string);
13521
13522 if(subType)
13523 {
13524 *offset += memberType->offset;
13525 return subType;
13526 }
13527 }
13528 else if(!strcmp(memberType->name, string))
13529 {
13530 *offset += memberType->offset;
13531 return memberType;
13532 }
13533 }
13534 return (((void *)0));
13535 }
13536
13537 extern unsigned int parseError;
13538
13539 unsigned int GetParseError()
13540 {
13541 return parseError;
13542 }
13543
13544 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13545
13546 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13547
13548 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13549
13550 struct Expression * ParseExpressionString(char * expression)
13551 {
13552 parseError = 0x0;
13553 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13554 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13555 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13556
13557 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13558 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13559 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13560 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13561
13562 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13563 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13564 echoOn = 0x0;
13565 parsedExpression = (((void *)0));
13566 resetScanner();
13567 expression_yyparse();
13568 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13569 return parsedExpression;
13570 }
13571
13572 extern char *  QMkString(const char *  source);
13573
13574 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13575 {
13576 struct Identifier * id = exp->__anon1.__anon1.identifier;
13577 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13578 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13579 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13580 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13581
13582 if(_class && _class->type == 4)
13583 {
13584 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13585 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13586
13587 if(enumClass)
13588 {
13589 struct __ecereNameSpace__ecere__com__Class * baseClass;
13590
13591 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13592 {
13593 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13594
13595 for(value = e->values.first; value; value = value->next)
13596 {
13597 if(!strcmp(value->name, id->string))
13598 break;
13599 }
13600 if(value)
13601 {
13602 char constant[256];
13603
13604 FreeExpContents(exp);
13605 exp->type = 2;
13606 exp->isConstant = 0x1;
13607 if(!strcmp(baseClass->dataTypeString, "int"))
13608 sprintf(constant, "%d", (int)value->data);
13609 else
13610 sprintf(constant, "0x%X", (int)value->data);
13611 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13612 exp->expType = MkClassType(baseClass->fullName);
13613 break;
13614 }
13615 }
13616 }
13617 if(value)
13618 return 0x1;
13619 }
13620 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13621 {
13622 ProcessMethodType(method);
13623 exp->expType = __extension__ ({
13624 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13625
13626 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13627 });
13628 return 0x1;
13629 }
13630 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13631 {
13632 if(!prop->dataType)
13633 ProcessPropertyType(prop);
13634 exp->expType = prop->dataType;
13635 if(prop->dataType)
13636 prop->dataType->refCount++;
13637 return 0x1;
13638 }
13639 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13640 {
13641 if(!member->dataType)
13642 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13643 exp->expType = member->dataType;
13644 if(member->dataType)
13645 member->dataType->refCount++;
13646 return 0x1;
13647 }
13648 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13649 {
13650 if(!classProp->dataType)
13651 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13652 if(classProp->constant)
13653 {
13654 FreeExpContents(exp);
13655 exp->isConstant = 0x1;
13656 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13657 {
13658 exp->type = 3;
13659 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13660 }
13661 else
13662 {
13663 char constant[256];
13664
13665 exp->type = 2;
13666 sprintf(constant, "%d", (int)classProp->Get(_class));
13667 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13668 }
13669 }
13670 else
13671 {
13672 }
13673 exp->expType = classProp->dataType;
13674 if(classProp->dataType)
13675 classProp->dataType->refCount++;
13676 return 0x1;
13677 }
13678 return 0x0;
13679 }
13680
13681 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13682 {
13683 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13684 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13685 struct __ecereNameSpace__ecere__com__NameSpace * child;
13686
13687 if(!data)
13688 {
13689 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)))
13690 {
13691 data = ScanGlobalData(child, name);
13692 if(data)
13693 break;
13694 }
13695 }
13696 return data;
13697 }
13698
13699 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13700
13701 extern char *  strncpy(char * , const char * , size_t n);
13702
13703 static struct GlobalData * FindGlobalData(char * name)
13704 {
13705 int start = 0, c;
13706 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13707
13708 nameSpace = globalData;
13709 for(c = 0; name[c]; c++)
13710 {
13711 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13712 {
13713 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13714 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13715
13716 strncpy(spaceName, name + start, c - start);
13717 spaceName[c - start] = '\0';
13718 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13719 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13720 if(!newSpace)
13721 return (((void *)0));
13722 nameSpace = newSpace;
13723 if(name[c] == ':')
13724 c++;
13725 start = c + 1;
13726 }
13727 }
13728 if(c - start)
13729 {
13730 return ScanGlobalData(nameSpace, name + start);
13731 }
13732 return (((void *)0));
13733 }
13734
13735 static int definedExpStackPos;
13736
13737 static void * definedExpStack[512];
13738
13739 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13740 {
13741 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13742
13743 FreeExpContents(checkedExp);
13744 FreeType(checkedExp->expType);
13745 FreeType(checkedExp->destType);
13746 *checkedExp = *newExp;
13747 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13748 checkedExp->prev = prev;
13749 checkedExp->next = next;
13750 }
13751
13752 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13753
13754 extern int printf(const char * , ...);
13755
13756 void __ecereMethod_Expression_Clear();
13757
13758 void ApplyAnyObjectLogic(struct Expression * e)
13759 {
13760 struct Type * destType = e->destType;
13761
13762 if(destType && (destType->classObjectType == 3))
13763 {
13764 if(e && e->expType)
13765 {
13766 struct Type * type = e->expType;
13767 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13768
13769 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13770 {
13771 _class = type->__anon1._class->__anon1.registered;
13772 }
13773 else if(type->kind == 19)
13774 {
13775 _class = FindClass("ecere::com::Class")->__anon1.registered;
13776 }
13777 else
13778 {
13779 char string[1024] = "";
13780 struct Symbol * classSym;
13781
13782 PrintTypeNoConst(type, string, 0x0, 0x1);
13783 classSym = FindClass(string);
13784 if(classSym)
13785 _class = classSym->__anon1.registered;
13786 }
13787 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)))
13788 {
13789 if(!_class || strcmp(_class->fullName, "char *"))
13790 {
13791 struct Expression * checkedExp = e, * newExp;
13792
13793 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13794 {
13795 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13796 {
13797 if(checkedExp->type == 23)
13798 {
13799 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13800 }
13801 else
13802 checkedExp = (*checkedExp->__anon1.list).last;
13803 }
13804 else if(checkedExp->type == 11)
13805 checkedExp = checkedExp->__anon1.cast.exp;
13806 }
13807 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13808 {
13809 newExp = checkedExp->__anon1.op.exp2;
13810 checkedExp->__anon1.op.exp2 = (((void *)0));
13811 FreeExpContents(checkedExp);
13812 if(e->expType && e->expType->passAsTemplate)
13813 {
13814 char size[100];
13815
13816 ComputeTypeSize(e->expType);
13817 sprintf(size, "%d", e->expType->size);
13818 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))))));
13819 }
13820 ReplaceExpContents(checkedExp, newExp);
13821 e->byReference = 0x1;
13822 }
13823 else if(!e->byReference || (_class && _class->type == 5))
13824 {
13825 struct Expression * checkedExp;
13826
13827 {
13828 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;
13829
13830 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13831 {
13832 struct Context * context = PushContext();
13833 struct Declarator * decl;
13834 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13835 char typeString[1024];
13836 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13837
13838 typeString[0] = '\0';
13839 *newExp = *e;
13840 newExp->prev = (((void *)0));
13841 newExp->next = (((void *)0));
13842 newExp->expType = (((void *)0));
13843 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13844 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13845 newExp->destType = ProcessType(specs, decl);
13846 curContext = context;
13847 if(curCompound)
13848 {
13849 char name[100];
13850 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13851
13852 e->type = 23;
13853 sprintf(name, "__internalValue%03X", internalValueCounter++);
13854 if(!curCompound->__anon1.compound.declarations)
13855 curCompound->__anon1.compound.declarations = MkList();
13856 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13857 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13858 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13859 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13860 }
13861 else
13862 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13863 {
13864 struct Type * type = e->destType;
13865
13866 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13867 CopyTypeInto(e->destType, type);
13868 e->destType->refCount = 1;
13869 e->destType->classObjectType = 0;
13870 FreeType(type);
13871 }
13872 e->__anon1.compound->__anon1.compound.context = context;
13873 PopContext(context);
13874 curContext = context->parent;
13875 }
13876 }
13877 checkedExp = e;
13878 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13879 {
13880 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13881 {
13882 if(checkedExp->type == 23)
13883 {
13884 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13885 }
13886 else
13887 checkedExp = (*checkedExp->__anon1.list).last;
13888 }
13889 else if(checkedExp->type == 11)
13890 checkedExp = checkedExp->__anon1.cast.exp;
13891 }
13892 {
13893 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13894
13895 *operand = *checkedExp;
13896 checkedExp->destType = (((void *)0));
13897 checkedExp->expType = (((void *)0));
13898 __ecereMethod_Expression_Clear(checkedExp);
13899 checkedExp->type = 4;
13900 checkedExp->__anon1.op.op = '&';
13901 checkedExp->__anon1.op.exp1 = (((void *)0));
13902 checkedExp->__anon1.op.exp2 = operand;
13903 }
13904 }
13905 }
13906 }
13907 }
13908 }
13909 {
13910 }
13911 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))))
13912 {
13913 if(e->expType->classObjectType && destType && destType->classObjectType)
13914 {
13915 return ;
13916 }
13917 else
13918 {
13919 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13920
13921 *thisExp = *e;
13922 thisExp->prev = (((void *)0));
13923 thisExp->next = (((void *)0));
13924 __ecereMethod_Expression_Clear(e);
13925 e->type = 5;
13926 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13927 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13928 ((struct Expression *)(*e->__anon1.list).first)->byReference = 0x1;
13929 {
13930 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13931 CopyTypeInto(e->expType, thisExp->expType);
13932 e->expType->byReference = 0x0;
13933 e->expType->refCount = 1;
13934 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))
13935 {
13936 e->expType->classObjectType = 0;
13937 }
13938 }
13939 }
13940 }
13941 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13942 {
13943 if(destType->kind == 14)
13944 {
13945 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13946 }
13947 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))
13948 {
13949 unsigned int byReference = e->expType->byReference;
13950 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13951 struct Declarator * decl;
13952 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13953 char typeString[1024];
13954 struct Type * type;
13955 int backupClassObjectType;
13956 unsigned int backupByReference;
13957
13958 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13959 type = e->expType;
13960 else
13961 type = destType;
13962 backupClassObjectType = type->classObjectType;
13963 backupByReference = type->byReference;
13964 type->classObjectType = 0;
13965 type->byReference = 0x0;
13966 typeString[0] = '\0';
13967 PrintType(type, typeString, 0x0, 0x1);
13968 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13969 type->classObjectType = backupClassObjectType;
13970 type->byReference = backupByReference;
13971 *thisExp = *e;
13972 thisExp->prev = (((void *)0));
13973 thisExp->next = (((void *)0));
13974 __ecereMethod_Expression_Clear(e);
13975 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)))
13976 {
13977 e->type = 4;
13978 e->__anon1.op.op = '*';
13979 e->__anon1.op.exp1 = (((void *)0));
13980 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13981 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13982 CopyTypeInto(e->expType, type);
13983 e->expType->byReference = 0x0;
13984 e->expType->refCount = 1;
13985 }
13986 else
13987 {
13988 e->type = 11;
13989 e->__anon1.cast.typeName = MkTypeName(specs, decl);
13990 e->__anon1.cast.exp = thisExp;
13991 e->byReference = 0x1;
13992 e->expType = type;
13993 type->refCount++;
13994 }
13995 e->destType = destType;
13996 destType->refCount++;
13997 }
13998 }
13999 }
14000
14001 void ApplyLocation(struct Expression * exp, struct Location * loc)
14002 {
14003 exp->loc = *loc;
14004 switch(exp->type)
14005 {
14006 case 4:
14007 if(exp->__anon1.op.exp1)
14008 ApplyLocation(exp->__anon1.op.exp1, loc);
14009 if(exp->__anon1.op.exp2)
14010 ApplyLocation(exp->__anon1.op.exp2, loc);
14011 break;
14012 case 5:
14013 if(exp->__anon1.list)
14014 {
14015 struct Expression * e;
14016
14017 for(e = (*exp->__anon1.list).first; e; e = e->next)
14018 ApplyLocation(e, loc);
14019 }
14020 break;
14021 case 6:
14022 if(exp->__anon1.index.index)
14023 {
14024 struct Expression * e;
14025
14026 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14027 ApplyLocation(e, loc);
14028 }
14029 if(exp->__anon1.index.exp)
14030 ApplyLocation(exp->__anon1.index.exp, loc);
14031 break;
14032 case 7:
14033 if(exp->__anon1.call.arguments)
14034 {
14035 struct Expression * arg;
14036
14037 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14038 ApplyLocation(arg, loc);
14039 }
14040 if(exp->__anon1.call.exp)
14041 ApplyLocation(exp->__anon1.call.exp, loc);
14042 break;
14043 case 8:
14044 case 9:
14045 if(exp->__anon1.member.exp)
14046 ApplyLocation(exp->__anon1.member.exp, loc);
14047 break;
14048 case 11:
14049 if(exp->__anon1.cast.exp)
14050 ApplyLocation(exp->__anon1.cast.exp, loc);
14051 break;
14052 case 12:
14053 if(exp->__anon1.cond.exp)
14054 {
14055 struct Expression * e;
14056
14057 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14058 ApplyLocation(e, loc);
14059 }
14060 if(exp->__anon1.cond.cond)
14061 ApplyLocation(exp->__anon1.cond.cond, loc);
14062 if(exp->__anon1.cond.elseExp)
14063 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14064 break;
14065 case 34:
14066 if(exp->__anon1.vaArg.exp)
14067 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14068 break;
14069 default:
14070 break;
14071 }
14072 }
14073
14074 extern char *  strstr(const char * , const char * );
14075
14076 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14077
14078 struct __ecereNameSpace__ecere__com__DefinedExpression
14079 {
14080 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14081 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14082 const char *  name;
14083 const char *  value;
14084 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14085 } __attribute__ ((gcc_struct));
14086
14087 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14088
14089 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14090
14091 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14092
14093 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14094
14095 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14096
14097 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14098
14099 static void ProcessStatement(struct Statement * stmt);
14100
14101 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14102
14103 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14104
14105 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14106
14107 extern const char *  sourceFile;
14108
14109 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14110
14111 void ProcessExpressionType(struct Expression * exp)
14112 {
14113 unsigned int unresolved = 0x0;
14114 struct Location oldyylloc = yylloc;
14115 unsigned int notByReference = 0x0;
14116
14117 if(!exp || exp->expType)
14118 return ;
14119 yylloc = exp->loc;
14120 switch(exp->type)
14121 {
14122 case 0:
14123 {
14124 struct Identifier * id = exp->__anon1.__anon1.identifier;
14125
14126 if(!id || !topContext)
14127 return ;
14128 if(id->_class && id->_class->__anon1.__anon1.name)
14129 {
14130 id->classSym = id->_class->__anon1.__anon1.symbol;
14131 }
14132 if(strstr(id->string, "__ecereClass") == id->string)
14133 {
14134 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
14135 break;
14136 }
14137 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14138 {
14139 ReplaceClassMembers(exp, thisClass);
14140 if(exp->type != 0)
14141 {
14142 ProcessExpressionType(exp);
14143 break;
14144 }
14145 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0x0))
14146 break;
14147 }
14148 else
14149 {
14150 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14151
14152 if(!symbol)
14153 {
14154 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0, 0x0))
14155 break;
14156 else
14157 {
14158 if(thisClass)
14159 {
14160 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14161 if(exp->type != 0)
14162 {
14163 ProcessExpressionType(exp);
14164 break;
14165 }
14166 }
14167 else if(currentClass && !id->_class)
14168 {
14169 if(ResolveIdWithClass(exp, currentClass, 0x1))
14170 break;
14171 }
14172 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14173 }
14174 }
14175 if(symbol)
14176 {
14177 struct Type * type = symbol->type;
14178 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14179
14180 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14181 {
14182 struct Context * context = SetupTemplatesContext(_class);
14183
14184 type = ReplaceThisClassType(_class);
14185 FinishTemplatesContext(context);
14186 if(type)
14187 type->refCount = 0;
14188 }
14189 FreeSpecifier(id->_class);
14190 id->_class = (((void *)0));
14191 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14192 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14193 id->classSym = (((void *)0));
14194 exp->expType = type;
14195 if(type)
14196 type->refCount++;
14197 if(type && (type->kind == 15))
14198 exp->isConstant = 0x1;
14199 if(symbol->isParam || !strcmp(id->string, "this"))
14200 {
14201 if(_class && _class->type == 1 && !type->declaredWithStruct)
14202 exp->byReference = 0x1;
14203 }
14204 if(symbol->isIterator)
14205 {
14206 if(symbol->isIterator == 3)
14207 {
14208 exp->type = 5;
14209 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14210 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14211 exp->expType = (((void *)0));
14212 ProcessExpressionType(exp);
14213 }
14214 else if(symbol->isIterator != 4)
14215 {
14216 exp->type = 8;
14217 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14218 exp->__anon1.member.exp->expType = exp->expType;
14219 exp->__anon1.member.member = MkIdentifier("data");
14220 exp->expType = (((void *)0));
14221 ProcessExpressionType(exp);
14222 }
14223 }
14224 break;
14225 }
14226 else
14227 {
14228 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14229
14230 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14231 {
14232 char name[1024];
14233
14234 strcpy(name, thisNameSpace);
14235 strcat(name, "::");
14236 strcat(name, id->string);
14237 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14238 }
14239 if(!definedExp)
14240 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14241 if(definedExp)
14242 {
14243 int c;
14244
14245 for(c = 0; c < definedExpStackPos; c++)
14246 if(definedExpStack[c] == definedExp)
14247 break;
14248 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14249 {
14250 struct Location backupYylloc = yylloc;
14251 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14252
14253 definedExpStack[definedExpStackPos++] = definedExp;
14254 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14255 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14256 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14257
14258 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14259 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14260 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14261 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14262
14263 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14264 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14265 echoOn = 0x0;
14266 parsedExpression = (((void *)0));
14267 resetScanner();
14268 expression_yyparse();
14269 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14270 if(backInput)
14271 fileInput = backInput;
14272 yylloc = backupYylloc;
14273 if(parsedExpression)
14274 {
14275 FreeIdentifier(id);
14276 exp->type = 5;
14277 exp->__anon1.list = MkListOne(parsedExpression);
14278 ApplyLocation(parsedExpression, &yylloc);
14279 ProcessExpressionType(exp);
14280 definedExpStackPos--;
14281 return ;
14282 }
14283 definedExpStackPos--;
14284 }
14285 else
14286 {
14287 if(inCompiler)
14288 {
14289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14290 }
14291 }
14292 }
14293 else
14294 {
14295 struct GlobalData * data = (((void *)0));
14296
14297 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14298 {
14299 char name[1024];
14300
14301 strcpy(name, thisNameSpace);
14302 strcat(name, "::");
14303 strcat(name, id->string);
14304 data = FindGlobalData(name);
14305 }
14306 if(!data)
14307 data = FindGlobalData(id->string);
14308 if(data)
14309 {
14310 DeclareGlobalData(data);
14311 exp->expType = data->dataType;
14312 if(data->dataType)
14313 data->dataType->refCount++;
14314 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14315 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14316 FreeSpecifier(id->_class);
14317 id->_class = (((void *)0));
14318 break;
14319 }
14320 else
14321 {
14322 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14323
14324 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14325 {
14326 char name[1024];
14327
14328 strcpy(name, thisNameSpace);
14329 strcat(name, "::");
14330 strcat(name, id->string);
14331 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14332 }
14333 if(!function)
14334 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14335 if(function)
14336 {
14337 char name[1024];
14338
14339 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14340 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14341 name[0] = (char)0;
14342 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14343 strcpy(name, "__ecereFunction_");
14344 FullClassNameCat(name, id->string, 0x0);
14345 if(DeclareFunction(function, name))
14346 {
14347 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14348 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14349 }
14350 exp->expType = function->dataType;
14351 if(function->dataType)
14352 function->dataType->refCount++;
14353 FreeSpecifier(id->_class);
14354 id->_class = (((void *)0));
14355 break;
14356 }
14357 }
14358 }
14359 }
14360 }
14361 unresolved = 0x1;
14362 break;
14363 }
14364 case 1:
14365 {
14366 struct __ecereNameSpace__ecere__com__Class * _class;
14367
14368 if(!exp->__anon1.instance->_class)
14369 {
14370 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14371 {
14372 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14373 }
14374 }
14375 ProcessInstantiationType(exp->__anon1.instance);
14376 exp->isConstant = exp->__anon1.instance->isConstant;
14377 if(exp->__anon1.instance->_class)
14378 {
14379 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14380 }
14381 break;
14382 }
14383 case 2:
14384 {
14385 if(!exp->expType)
14386 {
14387 char * constant = exp->__anon1.__anon1.constant;
14388 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14389
14390 exp->expType = type;
14391 if(constant[0] == '\'')
14392 {
14393 if((int)((unsigned char *)constant)[1] > 127)
14394 {
14395 int nb;
14396 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14397
14398 if(nb < 2)
14399 ch = constant[1];
14400 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14401 exp->__anon1.__anon1.constant = PrintUInt(ch);
14402 type->kind = 8;
14403 type->__anon1._class = FindClass("unichar");
14404 type->isSigned = 0x0;
14405 }
14406 else
14407 {
14408 type->kind = 1;
14409 type->isSigned = 0x1;
14410 }
14411 }
14412 else
14413 {
14414 char * dot = strchr(constant, '.');
14415 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14416 char * exponent;
14417
14418 if(isHex)
14419 {
14420 exponent = strchr(constant, 'p');
14421 if(!exponent)
14422 exponent = strchr(constant, 'P');
14423 }
14424 else
14425 {
14426 exponent = strchr(constant, 'e');
14427 if(!exponent)
14428 exponent = strchr(constant, 'E');
14429 }
14430 if(dot || exponent)
14431 {
14432 if(strchr(constant, 'f') || strchr(constant, 'F'))
14433 type->kind = 6;
14434 else
14435 type->kind = 7;
14436 type->isSigned = 0x1;
14437 }
14438 else
14439 {
14440 unsigned int isSigned = constant[0] == '-';
14441 char * endP = (((void *)0));
14442 long long i64 = strtoll(constant, &endP, 0);
14443 uint64 ui64 = strtoull(constant, &endP, 0);
14444 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14445
14446 if(isSigned)
14447 {
14448 if(i64 < (((int)0x80000000)))
14449 is64Bit = 0x1;
14450 }
14451 else
14452 {
14453 if(ui64 > (((int)0x7fffffff)))
14454 {
14455 if(ui64 > (0xffffffff))
14456 {
14457 is64Bit = 0x1;
14458 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14459 isSigned = 0x1;
14460 }
14461 }
14462 else if(constant[0] != '0' || !constant[1])
14463 isSigned = 0x1;
14464 }
14465 type->kind = is64Bit ? 4 : 3;
14466 type->isSigned = isSigned;
14467 }
14468 }
14469 exp->isConstant = 0x1;
14470 if(exp->destType && exp->destType->kind == 7)
14471 type->kind = 7;
14472 else if(exp->destType && exp->destType->kind == 6)
14473 type->kind = 6;
14474 else if(exp->destType && exp->destType->kind == 4)
14475 type->kind = 4;
14476 }
14477 break;
14478 }
14479 case 3:
14480 {
14481 exp->isConstant = 0x1;
14482 exp->expType = __extension__ ({
14483 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14484
14485 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14486 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14487
14488 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14489 }), __ecereInstance2;
14490 });
14491 break;
14492 }
14493 case 13:
14494 case 26:
14495 ProcessExpressionType(exp->__anon1._new.size);
14496 exp->expType = __extension__ ({
14497 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14498
14499 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14500 });
14501 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14502 break;
14503 case 14:
14504 case 27:
14505 ProcessExpressionType(exp->__anon1._renew.size);
14506 ProcessExpressionType(exp->__anon1._renew.exp);
14507 exp->expType = __extension__ ({
14508 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14509
14510 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14511 });
14512 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14513 break;
14514 case 4:
14515 {
14516 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14517 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14518 unsigned int useDestType = 0x0, useSideType = 0x0;
14519 struct Location oldyylloc = yylloc;
14520 unsigned int useSideUnit = 0x0;
14521 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14522 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14523
14524 switch(exp->__anon1.op.op)
14525 {
14526 case '=':
14527 case MUL_ASSIGN:
14528 case DIV_ASSIGN:
14529 case MOD_ASSIGN:
14530 case ADD_ASSIGN:
14531 case SUB_ASSIGN:
14532 case LEFT_ASSIGN:
14533 case RIGHT_ASSIGN:
14534 case AND_ASSIGN:
14535 case XOR_ASSIGN:
14536 case OR_ASSIGN:
14537 assign = 0x1;
14538 break;
14539 case '!':
14540 break;
14541 case AND_OP:
14542 case OR_OP:
14543 boolOps = 0x1;
14544 boolResult = 0x1;
14545 break;
14546 case EQ_OP:
14547 case '<':
14548 case '>':
14549 case LE_OP:
14550 case GE_OP:
14551 case NE_OP:
14552 boolResult = 0x1;
14553 useSideType = 0x1;
14554 break;
14555 case '+':
14556 case '-':
14557 useSideUnit = 0x1;
14558 useSideType = 0x1;
14559 useDestType = 0x1;
14560 break;
14561 case LEFT_OP:
14562 case RIGHT_OP:
14563 useSideType = 0x1;
14564 useDestType = 0x1;
14565 break;
14566 case '|':
14567 case '^':
14568 useSideType = 0x1;
14569 useDestType = 0x1;
14570 break;
14571 case '/':
14572 case '%':
14573 useSideType = 0x1;
14574 useDestType = 0x1;
14575 break;
14576 case '&':
14577 case '*':
14578 if(exp->__anon1.op.exp1)
14579 {
14580 useSideType = 0x1;
14581 useDestType = 0x1;
14582 }
14583 break;
14584 }
14585 if(exp->__anon1.op.op == '&')
14586 {
14587 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14588 {
14589 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14590 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14591
14592 if(symbol && symbol->isIterator == 2)
14593 {
14594 exp->type = 8;
14595 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14596 exp->__anon1.member.member = MkIdentifier("key");
14597 exp->expType = (((void *)0));
14598 exp->__anon1.op.exp2->expType = symbol->type;
14599 symbol->type->refCount++;
14600 ProcessExpressionType(exp);
14601 FreeType(dummy);
14602 break;
14603 }
14604 }
14605 }
14606 if(exp->__anon1.op.exp1)
14607 {
14608 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14609 useDestType = 0x0;
14610 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14611 {
14612 if(exp->__anon1.op.exp1->destType)
14613 FreeType(exp->__anon1.op.exp1->destType);
14614 exp->__anon1.op.exp1->destType = exp->destType;
14615 exp->__anon1.op.exp1->opDestType = 0x1;
14616 if(exp->destType)
14617 exp->destType->refCount++;
14618 }
14619 else if(!assign)
14620 {
14621 if(exp->__anon1.op.exp1->destType)
14622 FreeType(exp->__anon1.op.exp1->destType);
14623 exp->__anon1.op.exp1->destType = dummy;
14624 dummy->refCount++;
14625 }
14626 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14627 exp->__anon1.op.exp1->destType->count++;
14628 ProcessExpressionType(exp->__anon1.op.exp1);
14629 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14630 exp->__anon1.op.exp1->destType->count--;
14631 exp->__anon1.op.exp1->opDestType = 0x0;
14632 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)
14633 {
14634 exp->__anon1.op.exp2 = MkExpConstant("1");
14635 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14636 assign = 0x1;
14637 }
14638 if(exp->__anon1.op.exp1->destType == dummy)
14639 {
14640 FreeType(dummy);
14641 exp->__anon1.op.exp1->destType = (((void *)0));
14642 }
14643 type1 = exp->__anon1.op.exp1->expType;
14644 }
14645 if(exp->__anon1.op.exp2)
14646 {
14647 char expString[10240];
14648
14649 expString[0] = '\0';
14650 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14651 {
14652 if(exp->__anon1.op.exp1)
14653 {
14654 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14655 if(exp->__anon1.op.exp1->expType)
14656 exp->__anon1.op.exp1->expType->refCount++;
14657 }
14658 else
14659 {
14660 exp->__anon1.op.exp2->destType = exp->destType;
14661 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14662 exp->__anon1.op.exp2->opDestType = 0x1;
14663 if(exp->destType)
14664 exp->destType->refCount++;
14665 }
14666 if(type1)
14667 type1->refCount++;
14668 exp->expType = type1;
14669 }
14670 else if(assign)
14671 {
14672 if(inCompiler)
14673 PrintExpression(exp->__anon1.op.exp2, expString);
14674 if(type1 && type1->kind == 13)
14675 {
14676 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)
14677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14678 else if(exp->__anon1.op.op == '=')
14679 {
14680 if(exp->__anon1.op.exp2->destType)
14681 FreeType(exp->__anon1.op.exp2->destType);
14682 exp->__anon1.op.exp2->destType = type1;
14683 if(type1)
14684 type1->refCount++;
14685 }
14686 }
14687 else
14688 {
14689 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)
14690 ;
14691 else
14692 {
14693 if(exp->__anon1.op.exp2->destType)
14694 FreeType(exp->__anon1.op.exp2->destType);
14695 exp->__anon1.op.exp2->destType = type1;
14696 if(type1)
14697 type1->refCount++;
14698 }
14699 }
14700 if(type1)
14701 type1->refCount++;
14702 exp->expType = type1;
14703 }
14704 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14705 {
14706 if(exp->__anon1.op.exp2->destType)
14707 FreeType(exp->__anon1.op.exp2->destType);
14708 exp->__anon1.op.exp2->destType = exp->destType;
14709 if(exp->__anon1.op.op != '&')
14710 exp->__anon1.op.exp2->opDestType = 0x1;
14711 if(exp->destType)
14712 exp->destType->refCount++;
14713 }
14714 else
14715 {
14716 if(exp->__anon1.op.exp2->destType)
14717 FreeType(exp->__anon1.op.exp2->destType);
14718 exp->__anon1.op.exp2->destType = dummy;
14719 dummy->refCount++;
14720 }
14721 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))
14722 {
14723 FreeType(exp->__anon1.op.exp2->destType);
14724 exp->__anon1.op.exp2->destType = type1;
14725 type1->refCount++;
14726 }
14727 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14728 exp->__anon1.op.exp2->destType->count++;
14729 if(exp->__anon1.op.op == SIZEOF)
14730 {
14731 struct Expression * e = exp->__anon1.op.exp2;
14732
14733 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14734 {
14735 if(e->type == 5 || e->type == 32 || e->type == 23)
14736 {
14737 if(e->type == 23)
14738 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14739 else
14740 e = (*e->__anon1.list).last;
14741 }
14742 }
14743 if(e->type == 11 && e->__anon1.cast.exp)
14744 e->__anon1.cast.exp->needCast = 0x1;
14745 }
14746 ProcessExpressionType(exp->__anon1.op.exp2);
14747 exp->__anon1.op.exp2->opDestType = 0x0;
14748 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14749 exp->__anon1.op.exp2->destType->count--;
14750 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14751 {
14752 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)
14753 {
14754 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14756 }
14757 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)))
14758 {
14759 if(exp->__anon1.op.op == ADD_ASSIGN)
14760 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14761 }
14762 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))
14763 {
14764 if(exp->__anon1.op.op == ADD_ASSIGN)
14765 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14766 }
14767 else if(inCompiler)
14768 {
14769 char type1String[1024];
14770 char type2String[1024];
14771
14772 type1String[0] = '\0';
14773 type2String[0] = '\0';
14774 PrintType(exp->__anon1.op.exp2->expType, type1String, 0x0, 0x1);
14775 PrintType(type1, type2String, 0x0, 0x1);
14776 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14777 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14778 }
14779 }
14780 if(exp->__anon1.op.exp2->destType == dummy)
14781 {
14782 FreeType(dummy);
14783 exp->__anon1.op.exp2->destType = (((void *)0));
14784 }
14785 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14786 {
14787 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14788 type2->refCount = 1;
14789 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14790 type2->isSigned = 0x1;
14791 }
14792 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))
14793 {
14794 type2 = __extension__ ({
14795 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14796
14797 __ecereInstance1->kind = 3, __ecereInstance1;
14798 });
14799 type2->refCount = 1;
14800 type2->isSigned = 0x1;
14801 }
14802 else
14803 {
14804 type2 = exp->__anon1.op.exp2->expType;
14805 if(type2)
14806 type2->refCount++;
14807 }
14808 }
14809 dummy->kind = 0;
14810 if(exp->__anon1.op.op == SIZEOF)
14811 {
14812 exp->expType = __extension__ ({
14813 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14814
14815 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14816 });
14817 exp->isConstant = 0x1;
14818 }
14819 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14820 {
14821 exp->expType = Dereference(type2);
14822 if(type2 && type2->kind == 8)
14823 notByReference = 0x1;
14824 }
14825 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14826 exp->expType = Reference(type2);
14827 else if(!assign)
14828 {
14829 if(boolOps)
14830 {
14831 if(exp->__anon1.op.exp1)
14832 {
14833 if(exp->__anon1.op.exp1->destType)
14834 FreeType(exp->__anon1.op.exp1->destType);
14835 exp->__anon1.op.exp1->destType = MkClassType("bool");
14836 exp->__anon1.op.exp1->destType->truth = 0x1;
14837 if(!exp->__anon1.op.exp1->expType)
14838 ProcessExpressionType(exp->__anon1.op.exp1);
14839 else
14840 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
14841 FreeType(exp->__anon1.op.exp1->expType);
14842 exp->__anon1.op.exp1->expType = MkClassType("bool");
14843 exp->__anon1.op.exp1->expType->truth = 0x1;
14844 }
14845 if(exp->__anon1.op.exp2)
14846 {
14847 if(exp->__anon1.op.exp2->destType)
14848 FreeType(exp->__anon1.op.exp2->destType);
14849 exp->__anon1.op.exp2->destType = MkClassType("bool");
14850 exp->__anon1.op.exp2->destType->truth = 0x1;
14851 if(!exp->__anon1.op.exp2->expType)
14852 ProcessExpressionType(exp->__anon1.op.exp2);
14853 else
14854 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
14855 FreeType(exp->__anon1.op.exp2->expType);
14856 exp->__anon1.op.exp2->expType = MkClassType("bool");
14857 exp->__anon1.op.exp2->expType->truth = 0x1;
14858 }
14859 }
14860 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")))))
14861 {
14862 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"))))
14863 {
14864 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)))
14865 {
14866 struct Type * intType;
14867
14868 if(!type1->__anon1._class->__anon1.registered->dataType)
14869 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14870 if(!type2->__anon1._class->__anon1.registered->dataType)
14871 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14872 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14873 if(exp->__anon1.op.exp1->destType)
14874 FreeType(exp->__anon1.op.exp1->destType);
14875 if(exp->__anon1.op.exp2->destType)
14876 FreeType(exp->__anon1.op.exp2->destType);
14877 exp->__anon1.op.exp1->destType = intType;
14878 exp->__anon1.op.exp2->destType = intType;
14879 intType->refCount++;
14880 }
14881 else
14882 {
14883 if(exp->__anon1.op.exp2->destType)
14884 FreeType(exp->__anon1.op.exp2->destType);
14885 exp->__anon1.op.exp2->destType = type1;
14886 type1->refCount++;
14887 if(exp->__anon1.op.exp1->destType)
14888 FreeType(exp->__anon1.op.exp1->destType);
14889 exp->__anon1.op.exp1->destType = type2;
14890 type2->refCount++;
14891 }
14892 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)
14893 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);
14894 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14895 {
14896 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14897
14898 if(argExp)
14899 {
14900 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14901
14902 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14903 ProcessExpressionType(exp->__anon1.op.exp1);
14904 if(type2->kind != 13)
14905 {
14906 ProcessExpressionType(classExp);
14907 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14908 if(!exp->__anon1.op.exp2->expType)
14909 {
14910 if(type2)
14911 FreeType(type2);
14912 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0x0);
14913 type2->refCount++;
14914 }
14915 ProcessExpressionType(exp->__anon1.op.exp2);
14916 }
14917 }
14918 }
14919 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)))
14920 {
14921 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14922 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14923 exp->expType = type1;
14924 if(type1)
14925 type1->refCount++;
14926 }
14927 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)))
14928 {
14929 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14930 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14931 exp->expType = type2;
14932 if(type2)
14933 type2->refCount++;
14934 }
14935 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))
14936 {
14937 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14938 }
14939 else
14940 {
14941 unsigned int success = 0x0;
14942
14943 if(type1->kind == 13 && type2->kind == 13)
14944 {
14945 if(exp->__anon1.op.op == '+')
14946 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14947 else if(exp->__anon1.op.op == '-')
14948 {
14949 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, 0x0))
14950 {
14951 exp->expType = __extension__ ({
14952 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14953
14954 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14955 });
14956 success = 0x1;
14957 if(type1->__anon1.type->kind == 20)
14958 {
14959 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14960
14961 if(argExp)
14962 {
14963 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14964
14965 ProcessExpressionType(classExp);
14966 exp->type = 5;
14967 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"))));
14968 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
14969 FreeType(dummy);
14970 return ;
14971 }
14972 }
14973 }
14974 }
14975 }
14976 if(!success && exp->__anon1.op.exp1->type == 2)
14977 {
14978 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
14979 {
14980 if(exp->expType)
14981 FreeType(exp->expType);
14982 exp->expType = exp->__anon1.op.exp1->destType;
14983 if(exp->__anon1.op.exp1->destType)
14984 exp->__anon1.op.exp1->destType->refCount++;
14985 success = 0x1;
14986 }
14987 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14988 {
14989 if(exp->expType)
14990 FreeType(exp->expType);
14991 exp->expType = exp->__anon1.op.exp2->destType;
14992 if(exp->__anon1.op.exp2->destType)
14993 exp->__anon1.op.exp2->destType->refCount++;
14994 success = 0x1;
14995 }
14996 }
14997 else if(!success)
14998 {
14999 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
15000 {
15001 if(exp->expType)
15002 FreeType(exp->expType);
15003 exp->expType = exp->__anon1.op.exp2->destType;
15004 if(exp->__anon1.op.exp2->destType)
15005 exp->__anon1.op.exp2->destType->refCount++;
15006 success = 0x1;
15007 }
15008 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15009 {
15010 if(exp->expType)
15011 FreeType(exp->expType);
15012 exp->expType = exp->__anon1.op.exp1->destType;
15013 if(exp->__anon1.op.exp1->destType)
15014 exp->__anon1.op.exp1->destType->refCount++;
15015 success = 0x1;
15016 }
15017 }
15018 if(!success)
15019 {
15020 char expString1[10240];
15021 char expString2[10240];
15022 char type1[1024];
15023 char type2[1024];
15024
15025 expString1[0] = '\0';
15026 expString2[0] = '\0';
15027 type1[0] = '\0';
15028 type2[0] = '\0';
15029 if(inCompiler)
15030 {
15031 PrintExpression(exp->__anon1.op.exp1, expString1);
15032 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15033 PrintExpression(exp->__anon1.op.exp2, expString2);
15034 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15035 PrintType(exp->__anon1.op.exp1->expType, type1, 0x0, 0x1);
15036 PrintType(exp->__anon1.op.exp2->expType, type2, 0x0, 0x1);
15037 }
15038 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15039 }
15040 }
15041 }
15042 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)
15043 {
15044 if(exp->__anon1.op.exp1->destType)
15045 FreeType(exp->__anon1.op.exp1->destType);
15046 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15047 if(type2->__anon1._class->__anon1.registered->dataType)
15048 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15049 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15050 exp->expType = type2;
15051 if(type2)
15052 type2->refCount++;
15053 }
15054 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)
15055 {
15056 if(exp->__anon1.op.exp2->destType)
15057 FreeType(exp->__anon1.op.exp2->destType);
15058 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15059 if(type1->__anon1._class->__anon1.registered->dataType)
15060 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15061 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15062 exp->expType = type1;
15063 if(type1)
15064 type1->refCount++;
15065 }
15066 else if(type1)
15067 {
15068 unsigned int valid = 0x0;
15069
15070 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15071 {
15072 if(exp->__anon1.op.exp2->destType)
15073 FreeType(exp->__anon1.op.exp2->destType);
15074 if(!type1->__anon1._class->__anon1.registered->dataType)
15075 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15076 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15077 exp->__anon1.op.exp2->destType->refCount++;
15078 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15079 if(type2)
15080 FreeType(type2);
15081 type2 = exp->__anon1.op.exp2->destType;
15082 if(type2)
15083 type2->refCount++;
15084 exp->expType = type2;
15085 type2->refCount++;
15086 }
15087 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15088 {
15089 if(exp->__anon1.op.exp1->destType)
15090 FreeType(exp->__anon1.op.exp1->destType);
15091 if(!type2->__anon1._class->__anon1.registered->dataType)
15092 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15093 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15094 exp->__anon1.op.exp1->destType->refCount++;
15095 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15096 type1 = exp->__anon1.op.exp1->destType;
15097 exp->expType = type1;
15098 type1->refCount++;
15099 }
15100 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15101 {
15102 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15103 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15104
15105 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15106 {
15107 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15108 {
15109 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15110 {
15111 if(exp->expType)
15112 FreeType(exp->expType);
15113 exp->expType = exp->__anon1.op.exp2->expType;
15114 if(exp->__anon1.op.exp2->expType)
15115 exp->__anon1.op.exp2->expType->refCount++;
15116 valid = 0x1;
15117 }
15118 }
15119 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15120 {
15121 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15122 {
15123 if(exp->expType)
15124 FreeType(exp->expType);
15125 exp->expType = exp->__anon1.op.exp1->expType;
15126 if(exp->__anon1.op.exp1->expType)
15127 exp->__anon1.op.exp1->expType->refCount++;
15128 valid = 0x1;
15129 }
15130 }
15131 }
15132 else
15133 {
15134 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15135 {
15136 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15137 {
15138 if(exp->expType)
15139 FreeType(exp->expType);
15140 exp->expType = exp->__anon1.op.exp1->expType;
15141 if(exp->__anon1.op.exp1->expType)
15142 exp->__anon1.op.exp1->expType->refCount++;
15143 valid = 0x1;
15144 }
15145 }
15146 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15147 {
15148 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15149 {
15150 if(exp->expType)
15151 FreeType(exp->expType);
15152 exp->expType = exp->__anon1.op.exp2->expType;
15153 if(exp->__anon1.op.exp2->expType)
15154 exp->__anon1.op.exp2->expType->refCount++;
15155 valid = 0x1;
15156 }
15157 }
15158 }
15159 }
15160 if(!valid)
15161 {
15162 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))
15163 {
15164 if(exp->__anon1.op.exp1->destType)
15165 FreeType(exp->__anon1.op.exp1->destType);
15166 exp->__anon1.op.exp1->destType = type2;
15167 type2->refCount++;
15168 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15169 {
15170 if(exp->expType)
15171 FreeType(exp->expType);
15172 exp->expType = exp->__anon1.op.exp1->destType;
15173 if(exp->__anon1.op.exp1->destType)
15174 exp->__anon1.op.exp1->destType->refCount++;
15175 }
15176 }
15177 else
15178 {
15179 if(exp->__anon1.op.exp2->destType)
15180 FreeType(exp->__anon1.op.exp2->destType);
15181 exp->__anon1.op.exp2->destType = type1;
15182 type1->refCount++;
15183 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
15184 {
15185 if(exp->expType)
15186 FreeType(exp->expType);
15187 exp->expType = exp->__anon1.op.exp2->destType;
15188 if(exp->__anon1.op.exp2->destType)
15189 exp->__anon1.op.exp2->destType->refCount++;
15190 }
15191 else if(type1 && type2)
15192 {
15193 char expString1[10240];
15194 char expString2[10240];
15195 char type1String[1024];
15196 char type2String[1024];
15197
15198 expString1[0] = '\0';
15199 expString2[0] = '\0';
15200 type1String[0] = '\0';
15201 type2String[0] = '\0';
15202 if(inCompiler)
15203 {
15204 PrintExpression(exp->__anon1.op.exp1, expString1);
15205 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15206 PrintExpression(exp->__anon1.op.exp2, expString2);
15207 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15208 PrintType(exp->__anon1.op.exp1->expType, type1String, 0x0, 0x1);
15209 PrintType(exp->__anon1.op.exp2->expType, type2String, 0x0, 0x1);
15210 }
15211 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15212 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15213 {
15214 exp->expType = exp->__anon1.op.exp1->expType;
15215 if(exp->__anon1.op.exp1->expType)
15216 exp->__anon1.op.exp1->expType->refCount++;
15217 }
15218 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15219 {
15220 exp->expType = exp->__anon1.op.exp2->expType;
15221 if(exp->__anon1.op.exp2->expType)
15222 exp->__anon1.op.exp2->expType->refCount++;
15223 }
15224 }
15225 }
15226 }
15227 }
15228 else if(type2)
15229 {
15230 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15231 {
15232 struct Type * oldType = exp->__anon1.op.exp1->expType;
15233
15234 exp->__anon1.op.exp1->expType = (((void *)0));
15235 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15236 FreeType(oldType);
15237 else
15238 exp->__anon1.op.exp1->expType = oldType;
15239 }
15240 if(exp->__anon1.op.exp1->destType)
15241 FreeType(exp->__anon1.op.exp1->destType);
15242 exp->__anon1.op.exp1->destType = type2;
15243 type2->refCount++;
15244 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15245 {
15246 if(exp->expType)
15247 FreeType(exp->expType);
15248 exp->expType = exp->__anon1.op.exp1->destType;
15249 if(exp->__anon1.op.exp1->destType)
15250 exp->__anon1.op.exp1->destType->refCount++;
15251 }
15252 }
15253 }
15254 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15255 {
15256 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15257 {
15258 if(exp->__anon1.op.exp1->destType)
15259 FreeType(exp->__anon1.op.exp1->destType);
15260 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15261 if(type2->__anon1._class->__anon1.registered->dataType)
15262 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15263 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15264 }
15265 if(exp->__anon1.op.op == '!')
15266 {
15267 exp->expType = MkClassType("bool");
15268 exp->expType->truth = 0x1;
15269 }
15270 else
15271 {
15272 exp->expType = type2;
15273 if(type2)
15274 type2->refCount++;
15275 }
15276 }
15277 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15278 {
15279 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15280 {
15281 if(exp->__anon1.op.exp2->destType)
15282 FreeType(exp->__anon1.op.exp2->destType);
15283 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15284 if(type1->__anon1._class->__anon1.registered->dataType)
15285 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15286 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15287 }
15288 exp->expType = type1;
15289 if(type1)
15290 type1->refCount++;
15291 }
15292 }
15293 yylloc = exp->loc;
15294 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15295 {
15296 char expString[10000];
15297
15298 expString[0] = '\0';
15299 if(inCompiler)
15300 {
15301 PrintExpression(exp->__anon1.op.exp1, expString);
15302 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15303 }
15304 if(expString[0])
15305 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15306 }
15307 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15308 {
15309 char expString[10240];
15310
15311 expString[0] = '\0';
15312 if(inCompiler)
15313 {
15314 PrintExpression(exp->__anon1.op.exp2, expString);
15315 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15316 }
15317 if(expString[0])
15318 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15319 }
15320 if(boolResult)
15321 {
15322 FreeType(exp->expType);
15323 exp->expType = MkClassType("bool");
15324 exp->expType->truth = 0x1;
15325 }
15326 if(exp->__anon1.op.op != SIZEOF)
15327 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15328 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15329 {
15330 DeclareType(exp->__anon1.op.exp2->expType, 0x0, 0x0);
15331 }
15332 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15333 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15334 yylloc = oldyylloc;
15335 FreeType(dummy);
15336 if(type2)
15337 FreeType(type2);
15338 break;
15339 }
15340 case 5:
15341 case 32:
15342 {
15343 struct Expression * e;
15344
15345 exp->isConstant = 0x1;
15346 for(e = (*exp->__anon1.list).first; e; e = e->next)
15347 {
15348 unsigned int inced = 0x0;
15349
15350 if(!e->next)
15351 {
15352 FreeType(e->destType);
15353 e->opDestType = exp->opDestType;
15354 e->destType = exp->destType;
15355 if(e->destType)
15356 {
15357 exp->destType->refCount++;
15358 e->destType->count++;
15359 inced = 0x1;
15360 }
15361 }
15362 ProcessExpressionType(e);
15363 if(inced)
15364 exp->destType->count--;
15365 if(!exp->expType && !e->next)
15366 {
15367 exp->expType = e->expType;
15368 if(e->expType)
15369 e->expType->refCount++;
15370 }
15371 if(!e->isConstant)
15372 exp->isConstant = 0x0;
15373 }
15374 e = (*exp->__anon1.list).first;
15375 if(!e->next && e->type == 8)
15376 {
15377 struct Expression * next = exp->next, * prev = exp->prev;
15378
15379 FreeType(exp->expType);
15380 FreeType(exp->destType);
15381 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15382 *exp = *e;
15383 exp->prev = prev;
15384 exp->next = next;
15385 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15386 ProcessExpressionType(exp);
15387 }
15388 break;
15389 }
15390 case 6:
15391 {
15392 struct Expression * e;
15393
15394 exp->isConstant = 0x1;
15395 ProcessExpressionType(exp->__anon1.index.exp);
15396 if(!exp->__anon1.index.exp->isConstant)
15397 exp->isConstant = 0x0;
15398 if(exp->__anon1.index.exp->expType)
15399 {
15400 struct Type * source = exp->__anon1.index.exp->expType;
15401
15402 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15403 {
15404 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15405 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15406
15407 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15408 {
15409 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0x0);
15410 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15411 {
15412 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0x0);
15413
15414 if(type->kind == 8)
15415 type->constant = 0x1;
15416 else if(type->kind == 13)
15417 {
15418 struct Type * t = type;
15419
15420 while(t->kind == 13)
15421 t = t->__anon1.type;
15422 t->constant = 0x1;
15423 }
15424 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15425 }
15426 }
15427 }
15428 }
15429 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15430 {
15431 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15432 {
15433 if(e->destType)
15434 FreeType(e->destType);
15435 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15436 }
15437 ProcessExpressionType(e);
15438 if(!e->next)
15439 {
15440 }
15441 if(!e->isConstant)
15442 exp->isConstant = 0x0;
15443 }
15444 if(!exp->expType)
15445 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15446 if(exp->expType)
15447 DeclareType(exp->expType, 0x0, 0x0);
15448 break;
15449 }
15450 case 7:
15451 {
15452 struct Expression * e;
15453 struct Type * functionType;
15454 struct Type * methodType = (((void *)0));
15455 char name[1024];
15456
15457 name[0] = '\0';
15458 if(inCompiler)
15459 {
15460 PrintExpression(exp->__anon1.call.exp, name);
15461 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15462 {
15463 PrintExpression(exp->__anon1.call.exp, name);
15464 }
15465 }
15466 if(exp->__anon1.call.exp->type == 0)
15467 {
15468 struct Expression * idExp = exp->__anon1.call.exp;
15469 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15470
15471 if(!strcmp(id->string, "__builtin_frame_address"))
15472 {
15473 exp->expType = ProcessTypeString("void *", 0x1);
15474 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15475 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15476 break;
15477 }
15478 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15479 {
15480 exp->expType = ProcessTypeString("int", 0x1);
15481 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15482 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15483 break;
15484 }
15485 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15486 {
15487 struct Expression * a = (((void *)0));
15488 struct Expression * b = (((void *)0));
15489 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15490
15491 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15492 {
15493 a = (*exp->__anon1.call.arguments).first;
15494 b = (*exp->__anon1.call.arguments).last;
15495 tempExp1 = a;
15496 tempExp2 = b;
15497 }
15498 else if((*exp->__anon1.call.arguments).count == 1)
15499 {
15500 a = (*exp->__anon1.call.arguments).first;
15501 tempExp1 = a;
15502 }
15503 if(a)
15504 {
15505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15506 idExp->__anon1.__anon1.identifier = (((void *)0));
15507 FreeExpContents(exp);
15508 ProcessExpressionType(a);
15509 if(b)
15510 ProcessExpressionType(b);
15511 exp->type = 5;
15512 exp->__anon1.list = MkList();
15513 if(a->expType && (!b || b->expType))
15514 {
15515 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15516 {
15517 if(inCompiler)
15518 {
15519 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15520 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15521 struct Declaration * decl;
15522 char temp1[1024], temp2[1024];
15523
15524 GetTypeSpecs(a->expType, specs);
15525 if(a && !a->isConstant && a->type != 0)
15526 {
15527 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15528 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15529 tempExp1 = QMkExpId(temp1);
15530 tempExp1->expType = a->expType;
15531 if(a->expType)
15532 a->expType->refCount++;
15533 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15534 }
15535 if(b && !b->isConstant && b->type != 0)
15536 {
15537 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15538 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15539 tempExp2 = QMkExpId(temp2);
15540 tempExp2->expType = b->expType;
15541 if(b->expType)
15542 b->expType->refCount++;
15543 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15544 }
15545 decl = MkDeclaration(specs, decls);
15546 if(!curCompound->__anon1.compound.declarations)
15547 curCompound->__anon1.compound.declarations = MkList();
15548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15549 }
15550 }
15551 }
15552 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15553 {
15554 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15555
15556 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15557 exp->expType = a->expType;
15558 if(a->expType)
15559 a->expType->refCount++;
15560 }
15561 else if(!strcmp(id->string, "Abs"))
15562 {
15563 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15564 exp->expType = a->expType;
15565 if(a->expType)
15566 a->expType->refCount++;
15567 }
15568 else if(!strcmp(id->string, "Sgn"))
15569 {
15570 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"))))));
15571 exp->expType = ProcessTypeString("int", 0x0);
15572 }
15573 FreeExpression(tempExp1);
15574 if(tempExp2)
15575 FreeExpression(tempExp2);
15576 FreeIdentifier(id);
15577 break;
15578 }
15579 }
15580 }
15581 {
15582 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15583
15584 if(!exp->__anon1.call.exp->destType)
15585 {
15586 exp->__anon1.call.exp->destType = dummy;
15587 dummy->refCount++;
15588 }
15589 ProcessExpressionType(exp->__anon1.call.exp);
15590 if(exp->__anon1.call.exp->destType == dummy)
15591 {
15592 FreeType(dummy);
15593 exp->__anon1.call.exp->destType = (((void *)0));
15594 }
15595 FreeType(dummy);
15596 }
15597 functionType = exp->__anon1.call.exp->expType;
15598 if(functionType && functionType->kind == 16)
15599 {
15600 methodType = functionType;
15601 functionType = methodType->__anon1.__anon3.method->dataType;
15602 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15603 {
15604 char typeString[1024];
15605
15606 typeString[0] = '\0';
15607 {
15608 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15609
15610 functionType->__anon1.__anon2.thisClass = (((void *)0));
15611 PrintType(functionType, typeString, 0x1, 0x1);
15612 functionType->__anon1.__anon2.thisClass = back;
15613 }
15614 if(strstr(typeString, "thisclass"))
15615 {
15616 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15617 struct Declarator * decl;
15618
15619 {
15620 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15621
15622 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15623 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))
15624 thisClassParams = 0x0;
15625 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15626 {
15627 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15628
15629 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15630 ProcessDeclarator(decl);
15631 thisClass = backupThisClass;
15632 }
15633 thisClassParams = 0x1;
15634 functionType = ProcessType(specs, decl);
15635 functionType->refCount = 0;
15636 FinishTemplatesContext(context);
15637 }
15638 FreeList(specs, FreeSpecifier);
15639 FreeDeclarator(decl);
15640 }
15641 }
15642 }
15643 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15644 {
15645 struct Type * type = functionType->__anon1.type;
15646
15647 if(!functionType->refCount)
15648 {
15649 functionType->__anon1.type = (((void *)0));
15650 FreeType(functionType);
15651 }
15652 functionType = type;
15653 }
15654 if(functionType && functionType->kind != 11)
15655 {
15656 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15657 }
15658 else if(functionType)
15659 {
15660 unsigned int emptyParams = 0x0, noParams = 0x0;
15661 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15662 struct Type * type = functionType->__anon1.__anon2.params.first;
15663 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15664 int extra = 0;
15665 struct Location oldyylloc = yylloc;
15666
15667 if(!type)
15668 emptyParams = 0x1;
15669 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15670 {
15671 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15672 e = e->next;
15673 }
15674 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15675 {
15676 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)
15677 {
15678 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15679 if(e)
15680 {
15681 e->destType = type;
15682 e = e->next;
15683 type = functionType->__anon1.__anon2.params.first;
15684 }
15685 else
15686 type->refCount = 0;
15687 }
15688 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15689 {
15690 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15691 type->byReference = functionType->byReference;
15692 type->typedByReference = functionType->typedByReference;
15693 if(e)
15694 {
15695 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15696 e = e->next;
15697 e->destType = type;
15698 e = e->next;
15699 type = functionType->__anon1.__anon2.params.first;
15700 }
15701 else
15702 type->refCount = 0;
15703 }
15704 }
15705 if(type && type->kind == 0)
15706 {
15707 noParams = 0x1;
15708 if(!type->refCount)
15709 FreeType(type);
15710 type = (((void *)0));
15711 }
15712 for(; e; e = e->next)
15713 {
15714 if(!type && !emptyParams)
15715 {
15716 yylloc = e->loc;
15717 if(methodType && methodType->__anon1.__anon3.methodClass)
15718 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);
15719 else
15720 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);
15721 break;
15722 }
15723 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15724 {
15725 struct Type * templatedType = (((void *)0));
15726 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15728 int id = 0;
15729
15730 if(_class && _class->templateArgs)
15731 {
15732 struct __ecereNameSpace__ecere__com__Class * sClass;
15733
15734 for(sClass = _class; sClass; sClass = sClass->base)
15735 {
15736 if(sClass->templateClass)
15737 sClass = sClass->templateClass;
15738 id = 0;
15739 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15740 {
15741 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15742 {
15743 struct __ecereNameSpace__ecere__com__Class * nextClass;
15744
15745 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15746 {
15747 if(nextClass->templateClass)
15748 nextClass = nextClass->templateClass;
15749 id += nextClass->templateParams.count;
15750 }
15751 break;
15752 }
15753 id++;
15754 }
15755 if(curParam)
15756 break;
15757 }
15758 }
15759 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15760 {
15761 unsigned int constant = type->constant;
15762 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15763
15764 {
15765 struct Context * context = SetupTemplatesContext(_class);
15766
15767 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
15768 FinishTemplatesContext(context);
15769 }
15770 if(templatedType->kind == 8 && constant)
15771 templatedType->constant = 0x1;
15772 else if(templatedType->kind == 13)
15773 {
15774 struct Type * t = templatedType->__anon1.type;
15775
15776 while(t->kind == 13)
15777 t = t->__anon1.type;
15778 if(constant)
15779 t->constant = constant;
15780 }
15781 e->destType = templatedType;
15782 if(templatedType)
15783 {
15784 templatedType->passAsTemplate = 0x1;
15785 }
15786 }
15787 else
15788 {
15789 e->destType = type;
15790 if(type)
15791 type->refCount++;
15792 }
15793 }
15794 else
15795 {
15796 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15797 {
15798 e->destType = type->prev;
15799 e->destType->refCount++;
15800 }
15801 else
15802 {
15803 e->destType = type;
15804 if(type)
15805 type->refCount++;
15806 }
15807 }
15808 if(type && type->kind != 14)
15809 {
15810 struct Type * next = type->next;
15811
15812 if(!type->refCount)
15813 FreeType(type);
15814 type = next;
15815 }
15816 }
15817 if(type && type->kind != 14)
15818 {
15819 if(methodType && methodType->__anon1.__anon3.methodClass)
15820 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);
15821 else
15822 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);
15823 }
15824 yylloc = oldyylloc;
15825 if(type && !type->refCount)
15826 FreeType(type);
15827 }
15828 else
15829 {
15830 functionType = __extension__ ({
15831 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15832
15833 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15834 });
15835 if(exp->__anon1.call.exp->type == 0)
15836 {
15837 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15838
15839 if(inCompiler)
15840 {
15841 struct Symbol * symbol;
15842 struct Location oldyylloc = yylloc;
15843
15844 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15845 if(strstr(string, "__builtin_") == string)
15846 {
15847 if(exp->destType)
15848 {
15849 functionType->__anon1.__anon2.returnType = exp->destType;
15850 exp->destType->refCount++;
15851 }
15852 }
15853 else
15854 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15855 symbol = __extension__ ({
15856 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15857
15858 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15859 });
15860 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15861 if(strstr(symbol->string, "::"))
15862 globalContext->hasNameSpace = 0x1;
15863 yylloc = oldyylloc;
15864 }
15865 }
15866 else if(exp->__anon1.call.exp->type == 8)
15867 {
15868 }
15869 else
15870 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15871 if(!functionType->__anon1.__anon2.returnType)
15872 {
15873 functionType->__anon1.__anon2.returnType = __extension__ ({
15874 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15875
15876 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15877 });
15878 }
15879 }
15880 if(functionType && functionType->kind == 11)
15881 {
15882 exp->expType = functionType->__anon1.__anon2.returnType;
15883 if(functionType->__anon1.__anon2.returnType)
15884 functionType->__anon1.__anon2.returnType->refCount++;
15885 if(!functionType->refCount)
15886 FreeType(functionType);
15887 }
15888 if(exp->__anon1.call.arguments)
15889 {
15890 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15891 {
15892 struct Type * destType = e->destType;
15893
15894 ProcessExpressionType(e);
15895 }
15896 }
15897 break;
15898 }
15899 case 8:
15900 {
15901 struct Type * type;
15902 struct Location oldyylloc = yylloc;
15903 unsigned int thisPtr;
15904 struct Expression * checkExp = exp->__anon1.member.exp;
15905
15906 while(checkExp)
15907 {
15908 if(checkExp->type == 11)
15909 checkExp = checkExp->__anon1.cast.exp;
15910 else if(checkExp->type == 5)
15911 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15912 else
15913 break;
15914 }
15915 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15916 exp->thisPtr = thisPtr;
15917 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15918 {
15919 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15920 }
15921 ProcessExpressionType(exp->__anon1.member.exp);
15922 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)
15923 {
15924 exp->isConstant = 0x0;
15925 }
15926 else
15927 exp->isConstant = exp->__anon1.member.exp->isConstant;
15928 type = exp->__anon1.member.exp->expType;
15929 yylloc = exp->loc;
15930 if(type && (type->kind == 20))
15931 {
15932 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15933 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15934
15935 if(_class)
15936 {
15937 for(param = _class->templateParams.first; param; param = param->next)
15938 {
15939 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15940 break;
15941 }
15942 }
15943 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15944 {
15945 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15946
15947 if(argExp)
15948 {
15949 struct Expression * expMember = exp->__anon1.member.exp;
15950 struct Declarator * decl;
15951 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15952 char thisClassTypeString[1024];
15953
15954 FreeIdentifier(exp->__anon1.member.member);
15955 ProcessExpressionType(argExp);
15956 {
15957 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15958
15959 if(colon)
15960 {
15961 char className[1024];
15962 struct __ecereNameSpace__ecere__com__Class * sClass;
15963
15964 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15965 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15966 }
15967 else
15968 strcpy(thisClassTypeString, _class->fullName);
15969 }
15970 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15971 exp->expType = ProcessType(specs, decl);
15972 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
15973 {
15974 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
15975 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15976 int c;
15977 int paramCount = 0;
15978 int lastParam = -1;
15979 char templateString[1024];
15980 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15981
15982 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15983 for(cClass = expClass; cClass; cClass = cClass->base)
15984 {
15985 int p = 0;
15986
15987 for(param = cClass->templateParams.first; param; param = param->next)
15988 {
15989 int id = p;
15990 struct __ecereNameSpace__ecere__com__Class * sClass;
15991 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15992
15993 for(sClass = cClass->base; sClass; sClass = sClass->base)
15994 id += sClass->templateParams.count;
15995 arg = expClass->templateArgs[id];
15996 for(sClass = _class; sClass; sClass = sClass->base)
15997 {
15998 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15999 int p = 0;
16000 struct __ecereNameSpace__ecere__com__Class * nextClass;
16001
16002 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16003 p += nextClass->templateParams.count;
16004 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16005 {
16006 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16007 {
16008 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16009 {
16010 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16011 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16012 break;
16013 }
16014 }
16015 }
16016 }
16017 {
16018 char argument[256];
16019
16020 argument[0] = '\0';
16021 switch(param->type)
16022 {
16023 case 2:
16024 {
16025 char expString[1024];
16026 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16027 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16028 struct Expression * exp;
16029 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16030
16031 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16032 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16033 ProcessExpressionType(exp);
16034 ComputeExpression(exp);
16035 expString[0] = '\0';
16036 PrintExpression(exp, expString);
16037 strcat(argument, expString);
16038 FreeExpression(exp);
16039 break;
16040 }
16041 case 1:
16042 {
16043 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16044 break;
16045 }
16046 case 0:
16047 {
16048 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16049 {
16050 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16051 strcat(argument, thisClassTypeString);
16052 else
16053 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16054 }
16055 break;
16056 }
16057 }
16058 if(argument[0])
16059 {
16060 if(paramCount)
16061 strcat(templateString, ", ");
16062 if(lastParam != p - 1)
16063 {
16064 strcat(templateString, param->name);
16065 strcat(templateString, " = ");
16066 }
16067 strcat(templateString, argument);
16068 paramCount++;
16069 lastParam = p;
16070 }
16071 p++;
16072 }
16073 }
16074 }
16075 {
16076 int len = strlen(templateString);
16077
16078 if(templateString[len - 1] == '>')
16079 templateString[len++] = ' ';
16080 templateString[len++] = '>';
16081 templateString[len++] = '\0';
16082 }
16083 {
16084 struct Context * context = SetupTemplatesContext(_class);
16085
16086 FreeType(exp->expType);
16087 exp->expType = ProcessTypeString(templateString, 0x0);
16088 FinishTemplatesContext(context);
16089 }
16090 }
16091 exp->type = 5;
16092 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")))))))));
16093 }
16094 }
16095 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16096 {
16097 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16098 }
16099 }
16100 if(type && (type->kind == 20))
16101 ;
16102 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)))
16103 {
16104 struct Identifier * id = exp->__anon1.member.member;
16105 int typeKind = type->kind;
16106 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));
16107
16108 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16109 {
16110 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16111 typeKind = 8;
16112 }
16113 if(id)
16114 {
16115 if(typeKind == 3 || typeKind == 15)
16116 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16117 else if(!_class)
16118 {
16119 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16120 {
16121 _class = type->__anon1._class->__anon1.registered;
16122 }
16123 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16124 {
16125 _class = FindClass("char *")->__anon1.registered;
16126 }
16127 else if(type->kind == 13)
16128 {
16129 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16130 FreeType(exp->expType);
16131 exp->expType = ProcessTypeString("uintptr", 0x0);
16132 exp->byReference = 0x1;
16133 }
16134 else
16135 {
16136 char string[1024] = "";
16137 struct Symbol * classSym;
16138
16139 PrintTypeNoConst(type, string, 0x0, 0x1);
16140 classSym = FindClass(string);
16141 if(classSym)
16142 _class = classSym->__anon1.registered;
16143 }
16144 }
16145 }
16146 if(_class && id)
16147 {
16148 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16149 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16150 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16151 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16152 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16153
16154 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16155 exp->__anon1.member.memberType = 1;
16156 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16157 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16158 if(typeKind != 19)
16159 {
16160 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16161 {
16162 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16163 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16164 {
16165 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16166 if(prop)
16167 member = (((void *)0));
16168 }
16169 if(!member && !prop)
16170 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16171 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16172 exp->__anon1.member.thisPtr = 0x1;
16173 }
16174 else
16175 {
16176 unsigned int useMemberForNonConst = 0x0;
16177
16178 if(!id->classSym)
16179 {
16180 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16181 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);
16182 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16183 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16184 }
16185 if((!prop || useMemberForNonConst) && !member)
16186 {
16187 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16188 if(!method)
16189 {
16190 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16191 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);
16192 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16193 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16194 }
16195 }
16196 if(member && prop)
16197 {
16198 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16199 prop = (((void *)0));
16200 else
16201 member = (((void *)0));
16202 }
16203 }
16204 }
16205 if(!prop && !member && !method)
16206 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16207 if(!prop && !member && !method)
16208 {
16209 if(typeKind == 19)
16210 {
16211 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16212 if(classProp)
16213 {
16214 exp->__anon1.member.memberType = 5;
16215 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
16216 }
16217 else
16218 {
16219 char structName[1024];
16220 struct Identifier * id = exp->__anon1.member.member;
16221 struct Expression * classExp = exp->__anon1.member.exp;
16222
16223 type->refCount++;
16224 FreeType(classExp->expType);
16225 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
16226 strcpy(structName, "__ecereClassData_");
16227 FullClassNameCat(structName, type->__anon1._class->string, 0x0);
16228 exp->type = 9;
16229 exp->__anon1.member.member = id;
16230 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"))))))));
16231 FreeType(type);
16232 ProcessExpressionType(exp);
16233 return ;
16234 }
16235 }
16236 else
16237 {
16238 struct Symbol * classSym = FindClass(id->string);
16239
16240 if(classSym)
16241 {
16242 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16243
16244 if(convertClass)
16245 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16246 }
16247 }
16248 }
16249 if(prop)
16250 {
16251 exp->__anon1.member.memberType = 1;
16252 if(!prop->dataType)
16253 ProcessPropertyType(prop);
16254 exp->expType = prop->dataType;
16255 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16256 {
16257 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16258
16259 CopyTypeInto(type, exp->expType);
16260 type->refCount = 1;
16261 type->constant = 0x1;
16262 exp->expType = type;
16263 }
16264 else if(prop->dataType)
16265 prop->dataType->refCount++;
16266 }
16267 else if(member)
16268 {
16269 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16270 {
16271 FreeExpContents(exp);
16272 exp->type = 0;
16273 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16274 ProcessExpressionType(exp);
16275 return ;
16276 }
16277 exp->__anon1.member.memberType = 3;
16278 DeclareStruct(_class->fullName, 0x0);
16279 if(!member->dataType)
16280 {
16281 struct Context * context = SetupTemplatesContext(_class);
16282
16283 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16284 FinishTemplatesContext(context);
16285 }
16286 exp->expType = member->dataType;
16287 if(member->dataType)
16288 member->dataType->refCount++;
16289 }
16290 else if(revConvert)
16291 {
16292 exp->__anon1.member.memberType = 4;
16293 exp->expType = MkClassType(revConvert->_class->fullName);
16294 }
16295 else if(method)
16296 {
16297 {
16298 exp->__anon1.member.memberType = 2;
16299 }
16300 if(!method->dataType)
16301 ProcessMethodType(method);
16302 exp->expType = __extension__ ({
16303 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16304
16305 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16306 });
16307 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16308 exp->expType->__anon1.__anon3.usedClass = _class;
16309 }
16310 else if(!classProp)
16311 {
16312 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16313 {
16314 FreeExpContents(exp);
16315 exp->type = 0;
16316 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16317 FreeType(exp->expType);
16318 exp->expType = MkClassType("ecere::com::Class");
16319 return ;
16320 }
16321 yylloc = exp->__anon1.member.member->loc;
16322 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16323 if(inCompiler)
16324 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16325 }
16326 if(_class && exp->expType)
16327 {
16328 struct __ecereNameSpace__ecere__com__Class * tClass;
16329
16330 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16331 while(tClass && !tClass->templateClass)
16332 tClass = tClass->base;
16333 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16334 {
16335 int id = 0;
16336 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16337 struct __ecereNameSpace__ecere__com__Class * sClass;
16338
16339 for(sClass = tClass; sClass; sClass = sClass->base)
16340 {
16341 id = 0;
16342 if(sClass->templateClass)
16343 sClass = sClass->templateClass;
16344 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16345 {
16346 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16347 {
16348 for(sClass = sClass->base; sClass; sClass = sClass->base)
16349 id += sClass->templateParams.count;
16350 break;
16351 }
16352 id++;
16353 }
16354 if(curParam)
16355 break;
16356 }
16357 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16358 {
16359 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16360 struct Context * context = SetupTemplatesContext(tClass);
16361 unsigned int constant = exp->expType->constant;
16362
16363 FreeType(exp->expType);
16364 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16365 if(exp->expType->kind == 8 && constant)
16366 exp->expType->constant = 0x1;
16367 else if(exp->expType->kind == 13)
16368 {
16369 struct Type * t = exp->expType->__anon1.type;
16370
16371 while(t->kind == 13)
16372 t = t->__anon1.type;
16373 if(constant)
16374 t->constant = constant;
16375 }
16376 if(exp->expType)
16377 {
16378 if(exp->expType->kind == 21)
16379 {
16380 FreeType(exp->expType);
16381 exp->expType = ReplaceThisClassType(_class);
16382 }
16383 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16384 exp->expType->passAsTemplate = 0x1;
16385 if(!exp->destType)
16386 {
16387 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16388 if(exp->destType->kind == 8 && constant)
16389 exp->destType->constant = 0x1;
16390 else if(exp->destType->kind == 13)
16391 {
16392 struct Type * t = exp->destType->__anon1.type;
16393
16394 while(t->kind == 13)
16395 t = t->__anon1.type;
16396 if(constant)
16397 t->constant = constant;
16398 }
16399 if(exp->destType->kind == 21)
16400 {
16401 FreeType(exp->destType);
16402 exp->destType = ReplaceThisClassType(_class);
16403 }
16404 }
16405 }
16406 FinishTemplatesContext(context);
16407 }
16408 }
16409 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)
16410 {
16411 int id = 0;
16412 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16413 struct __ecereNameSpace__ecere__com__Class * sClass;
16414
16415 for(sClass = tClass; sClass; sClass = sClass->base)
16416 {
16417 id = 0;
16418 if(sClass->templateClass)
16419 sClass = sClass->templateClass;
16420 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16421 {
16422 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16423 {
16424 for(sClass = sClass->base; sClass; sClass = sClass->base)
16425 id += sClass->templateParams.count;
16426 break;
16427 }
16428 id++;
16429 }
16430 if(curParam)
16431 break;
16432 }
16433 if(curParam)
16434 {
16435 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16436 struct Context * context = SetupTemplatesContext(tClass);
16437 struct Type * basicType;
16438
16439 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16440 if(basicType)
16441 {
16442 if(basicType->kind == 21)
16443 {
16444 FreeType(basicType);
16445 basicType = ReplaceThisClassType(_class);
16446 }
16447 FreeType(exp->expType);
16448 exp->expType = __extension__ ({
16449 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16450
16451 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16452 });
16453 if(!exp->destType)
16454 {
16455 exp->destType = exp->expType;
16456 exp->destType->refCount++;
16457 }
16458 {
16459 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16461 struct Declarator * decl;
16462
16463 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16464 *newExp = *exp;
16465 if(exp->destType)
16466 exp->destType->refCount++;
16467 if(exp->expType)
16468 exp->expType->refCount++;
16469 exp->type = 11;
16470 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16471 exp->__anon1.cast.exp = newExp;
16472 }
16473 }
16474 FinishTemplatesContext(context);
16475 }
16476 }
16477 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16478 {
16479 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16480
16481 if(expClass)
16482 {
16483 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16484 int c;
16485 int p = 0;
16486 int paramCount = 0;
16487 int lastParam = -1;
16488 char templateString[1024];
16489 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16490
16491 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16492 while(cClass != expClass)
16493 {
16494 struct __ecereNameSpace__ecere__com__Class * sClass;
16495
16496 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16497 ;
16498 cClass = sClass;
16499 for(param = cClass->templateParams.first; param; param = param->next)
16500 {
16501 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16502 int c;
16503 int cp = 0;
16504 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16505 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16506
16507 while(cClassCur != tClass && !paramCur)
16508 {
16509 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16510
16511 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16512 ;
16513 cClassCur = sClassCur;
16514 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16515 {
16516 if(!strcmp(paramCur->name, param->name))
16517 {
16518 break;
16519 }
16520 cp++;
16521 }
16522 }
16523 if(paramCur && paramCur->type == 0)
16524 arg = tClass->templateArgs[cp];
16525 else
16526 arg = expClass->templateArgs[p];
16527 {
16528 char argument[256];
16529
16530 argument[0] = '\0';
16531 switch(param->type)
16532 {
16533 case 2:
16534 {
16535 char expString[1024];
16536 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16537 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16538 struct Expression * exp;
16539 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16540
16541 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16542 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16543 ProcessExpressionType(exp);
16544 ComputeExpression(exp);
16545 expString[0] = '\0';
16546 PrintExpression(exp, expString);
16547 strcat(argument, expString);
16548 FreeExpression(exp);
16549 break;
16550 }
16551 case 1:
16552 {
16553 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16554 break;
16555 }
16556 case 0:
16557 {
16558 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16559 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16560 break;
16561 }
16562 }
16563 if(argument[0])
16564 {
16565 if(paramCount)
16566 strcat(templateString, ", ");
16567 if(lastParam != p - 1)
16568 {
16569 strcat(templateString, param->name);
16570 strcat(templateString, " = ");
16571 }
16572 strcat(templateString, argument);
16573 paramCount++;
16574 lastParam = p;
16575 }
16576 }
16577 p++;
16578 }
16579 }
16580 {
16581 int len = strlen(templateString);
16582
16583 if(templateString[len - 1] == '>')
16584 templateString[len++] = ' ';
16585 templateString[len++] = '>';
16586 templateString[len++] = '\0';
16587 }
16588 FreeType(exp->expType);
16589 {
16590 struct Context * context = SetupTemplatesContext(tClass);
16591
16592 exp->expType = ProcessTypeString(templateString, 0x0);
16593 FinishTemplatesContext(context);
16594 }
16595 }
16596 }
16597 }
16598 }
16599 else
16600 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)");
16601 }
16602 else if(type && (type->kind == 9 || type->kind == 10))
16603 {
16604 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16605
16606 if(memberType)
16607 {
16608 exp->expType = memberType;
16609 if(memberType)
16610 memberType->refCount++;
16611 }
16612 }
16613 else
16614 {
16615 char expString[10240];
16616
16617 expString[0] = '\0';
16618 if(inCompiler)
16619 {
16620 PrintExpression(exp, expString);
16621 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16622 }
16623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16624 }
16625 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16626 {
16627 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16628 {
16629 struct Identifier * id = exp->__anon1.member.member;
16630 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));
16631
16632 if(_class)
16633 {
16634 FreeType(exp->expType);
16635 exp->expType = ReplaceThisClassType(_class);
16636 }
16637 }
16638 }
16639 yylloc = oldyylloc;
16640 break;
16641 }
16642 case 9:
16643 {
16644 struct Type * destType = exp->destType;
16645
16646 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16647 {
16648 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16649 }
16650 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16651 exp->type = 8;
16652 if(destType)
16653 destType->count++;
16654 ProcessExpressionType(exp);
16655 if(destType)
16656 destType->count--;
16657 break;
16658 }
16659 case 15:
16660 {
16661 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16662
16663 if(classSym && classSym->__anon1.registered)
16664 {
16665 if(classSym->__anon1.registered->type == 5)
16666 {
16667 char name[1024];
16668
16669 name[0] = '\0';
16670 DeclareStruct(classSym->string, 0x0);
16671 FreeSpecifier(exp->__anon1._class);
16672 exp->type = 10;
16673 FullClassNameCat(name, classSym->string, 0x0);
16674 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16675 }
16676 else
16677 {
16678 if(classSym->__anon1.registered->fixed)
16679 {
16680 FreeSpecifier(exp->__anon1._class);
16681 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16682 exp->type = 2;
16683 }
16684 else
16685 {
16686 char className[1024];
16687
16688 strcpy(className, "__ecereClass_");
16689 FullClassNameCat(className, classSym->string, 0x1);
16690 MangleClassName(className);
16691 DeclareClass(classSym, className);
16692 FreeExpContents(exp);
16693 exp->type = 9;
16694 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16695 exp->__anon1.member.member = MkIdentifier("structSize");
16696 }
16697 }
16698 }
16699 exp->expType = __extension__ ({
16700 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16701
16702 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16703 });
16704 break;
16705 }
16706 case 10:
16707 {
16708 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16709
16710 exp->expType = __extension__ ({
16711 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16712
16713 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16714 });
16715 exp->isConstant = 0x1;
16716 DeclareType(type, 0x0, 0x0);
16717 FreeType(type);
16718 break;
16719 }
16720 case 11:
16721 {
16722 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16723
16724 type->count = 1;
16725 FreeType(exp->__anon1.cast.exp->destType);
16726 exp->__anon1.cast.exp->destType = type;
16727 type->refCount++;
16728 type->casted = 0x1;
16729 ProcessExpressionType(exp->__anon1.cast.exp);
16730 type->casted = 0x0;
16731 type->count = 0;
16732 exp->expType = type;
16733 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16734 {
16735 void * prev = exp->prev, * next = exp->next;
16736 struct Type * expType = exp->__anon1.cast.exp->destType;
16737 struct Expression * castExp = exp->__anon1.cast.exp;
16738 struct Type * destType = exp->destType;
16739
16740 if(expType)
16741 expType->refCount++;
16742 FreeType(exp->expType);
16743 FreeTypeName(exp->__anon1.cast.typeName);
16744 *exp = *castExp;
16745 FreeType(exp->expType);
16746 FreeType(exp->destType);
16747 exp->expType = expType;
16748 exp->destType = destType;
16749 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16750 exp->prev = prev;
16751 exp->next = next;
16752 }
16753 else
16754 {
16755 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16756 }
16757 break;
16758 }
16759 case 33:
16760 {
16761 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16762
16763 exp->expType = type;
16764 break;
16765 }
16766 case 34:
16767 {
16768 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16769
16770 ProcessExpressionType(exp->__anon1.vaArg.exp);
16771 exp->expType = type;
16772 break;
16773 }
16774 case 12:
16775 {
16776 struct Expression * e;
16777
16778 exp->isConstant = 0x1;
16779 FreeType(exp->__anon1.cond.cond->destType);
16780 exp->__anon1.cond.cond->destType = MkClassType("bool");
16781 exp->__anon1.cond.cond->destType->truth = 0x1;
16782 ProcessExpressionType(exp->__anon1.cond.cond);
16783 if(!exp->__anon1.cond.cond->isConstant)
16784 exp->isConstant = 0x0;
16785 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16786 {
16787 if(!e->next)
16788 {
16789 FreeType(e->destType);
16790 e->destType = exp->destType;
16791 if(e->destType)
16792 e->destType->refCount++;
16793 }
16794 ProcessExpressionType(e);
16795 if(!e->next)
16796 {
16797 exp->expType = e->expType;
16798 if(e->expType)
16799 e->expType->refCount++;
16800 }
16801 if(!e->isConstant)
16802 exp->isConstant = 0x0;
16803 }
16804 FreeType(exp->__anon1.cond.elseExp->destType);
16805 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16806 if(exp->__anon1.cond.elseExp->destType)
16807 exp->__anon1.cond.elseExp->destType->refCount++;
16808 ProcessExpressionType(exp->__anon1.cond.elseExp);
16809 if(!exp->__anon1.cond.elseExp->isConstant)
16810 exp->isConstant = 0x0;
16811 break;
16812 }
16813 case 23:
16814 {
16815 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16816 {
16817 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16818
16819 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16820 {
16821 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16822 if(exp->destType)
16823 exp->destType->refCount++;
16824 }
16825 ProcessStatement(exp->__anon1.compound);
16826 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16827 if(exp->expType)
16828 exp->expType->refCount++;
16829 }
16830 break;
16831 }
16832 case 24:
16833 {
16834 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16835
16836 if(spec && spec->type == 1)
16837 {
16838 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16839 exp->expType->kind = 19;
16840 exp->byReference = 0x1;
16841 }
16842 else
16843 {
16844 exp->expType = MkClassType("ecere::com::Class");
16845 exp->byReference = 0x1;
16846 }
16847 break;
16848 }
16849 case 25:
16850 {
16851 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16852
16853 if(_class)
16854 {
16855 struct Identifier * id = exp->__anon1.classData.id;
16856 char structName[1024];
16857 struct Expression * classExp;
16858
16859 strcpy(structName, "__ecereClassData_");
16860 FullClassNameCat(structName, _class->fullName, 0x0);
16861 exp->type = 9;
16862 exp->__anon1.member.member = id;
16863 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0x0, 0x0))
16864 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16865 else
16866 classExp = MkExpIdentifier(MkIdentifier("class"));
16867 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"))))))));
16868 ProcessExpressionType(exp);
16869 return ;
16870 }
16871 break;
16872 }
16873 case 35:
16874 {
16875 struct Type * type = (((void *)0));
16876 const char * typeString = (((void *)0));
16877 char typeStringBuf[1024];
16878
16879 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))
16880 {
16881 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16882
16883 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16884 }
16885 else if(exp->__anon1.list)
16886 {
16887 struct Expression * e;
16888
16889 for(e = (*exp->__anon1.list).first; e; e = e->next)
16890 {
16891 ProcessExpressionType(e);
16892 if(e->expType)
16893 {
16894 if(!type)
16895 {
16896 type = e->expType;
16897 type->refCount++;
16898 }
16899 else
16900 {
16901 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16902 {
16903 FreeType(type);
16904 type = e->expType;
16905 e->expType = (((void *)0));
16906 e = (*exp->__anon1.list).first;
16907 ProcessExpressionType(e);
16908 if(e->expType)
16909 {
16910 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16911 {
16912 FreeType(e->expType);
16913 e->expType = (((void *)0));
16914 FreeType(type);
16915 type = (((void *)0));
16916 break;
16917 }
16918 }
16919 }
16920 }
16921 if(e->expType)
16922 {
16923 FreeType(e->expType);
16924 e->expType = (((void *)0));
16925 }
16926 }
16927 }
16928 if(type)
16929 {
16930 typeStringBuf[0] = '\0';
16931 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16932 typeString = typeStringBuf;
16933 FreeType(type);
16934 type = (((void *)0));
16935 }
16936 }
16937 if(typeString)
16938 {
16939 char templateString[1024];
16940 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16941 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16942 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16943 struct Expression * expExt;
16944 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16945
16946 sprintf(templateString, "Container<%s>", typeString);
16947 if(exp->__anon1.list)
16948 {
16949 struct Expression * e;
16950
16951 type = ProcessTypeString(typeString, 0x0);
16952 while(e = (*exp->__anon1.list).first)
16953 {
16954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16955 e->destType = type;
16956 type->refCount++;
16957 ProcessExpressionType(e);
16958 ListAdd(initializers, MkInitializerAssignment(e));
16959 }
16960 FreeType(type);
16961 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16962 }
16963 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16964 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16965 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16966 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16967 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16968 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16969 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16970 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16971 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16972 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16973 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16974
16975 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16976 })));
16977 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16978 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16979 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16980 exp->expType = ProcessTypeString(templateString, 0x0);
16981 exp->type = 5;
16982 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16983 ProcessExpressionType(expExt);
16984 }
16985 else
16986 {
16987 exp->expType = ProcessTypeString("Container", 0x0);
16988 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16989 }
16990 break;
16991 }
16992 }
16993 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16994 {
16995 FreeType(exp->expType);
16996 exp->expType = ReplaceThisClassType(thisClass);
16997 }
16998 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)
16999 {
17000 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 0x1, 0x0);
17001
17002 if(symbol)
17003 {
17004 if(exp->expType->kind != 15)
17005 {
17006 struct Type * member;
17007 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17008
17009 FreeType(exp->expType);
17010 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17011 exp->expType->kind = symbol->type->kind;
17012 exp->expType->refCount++;
17013 exp->expType->__anon1.__anon1.enumName = enumName;
17014 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17015 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17016 member->refCount++;
17017 }
17018 else
17019 {
17020 struct __ecereNameSpace__ecere__sys__NamedLink * member;
17021
17022 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17023 {
17024 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17025
17026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17027 }
17028 }
17029 }
17030 }
17031 yylloc = exp->loc;
17032 if(exp->destType && (exp->destType->kind == 18))
17033 ;
17034 else if(exp->destType && !exp->destType->keepCast)
17035 {
17036 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17037 exp->needTemplateCast = 1;
17038 if(exp->destType->kind == 0)
17039 ;
17040 else if(!CheckExpressionType(exp, exp->destType, 0x0, !exp->destType->casted))
17041 {
17042 if(!exp->destType->count || unresolved)
17043 {
17044 if(!exp->expType)
17045 {
17046 yylloc = exp->loc;
17047 if(exp->destType->kind != 14)
17048 {
17049 char type2[1024];
17050
17051 type2[0] = '\0';
17052 if(inCompiler)
17053 {
17054 char expString[10240];
17055
17056 expString[0] = '\0';
17057 PrintType(exp->destType, type2, 0x0, 0x1);
17058 if(inCompiler)
17059 {
17060 PrintExpression(exp, expString);
17061 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17062 }
17063 if(unresolved)
17064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17065 else if(exp->type != 16)
17066 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17067 }
17068 }
17069 else
17070 {
17071 char expString[10240];
17072
17073 expString[0] = '\0';
17074 if(inCompiler)
17075 {
17076 PrintExpression(exp, expString);
17077 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17078 }
17079 if(unresolved)
17080 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17081 else if(exp->type != 16)
17082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17083 }
17084 }
17085 else
17086 {
17087 char type1[1024];
17088 char type2[1024];
17089
17090 type1[0] = '\0';
17091 type2[0] = '\0';
17092 if(inCompiler)
17093 {
17094 PrintType(exp->expType, type1, 0x0, 0x1);
17095 PrintType(exp->destType, type2, 0x0, 0x1);
17096 }
17097 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)))
17098 ;
17099 else
17100 {
17101 char expString[10240];
17102
17103 expString[0] = '\0';
17104 if(inCompiler)
17105 {
17106 PrintExpression(exp, expString);
17107 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17108 }
17109 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17110 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17111 FreeType(exp->expType);
17112 exp->destType->refCount++;
17113 exp->expType = exp->destType;
17114 }
17115 }
17116 }
17117 }
17118 }
17119 else if(unresolved)
17120 {
17121 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17122 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);
17123 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17124 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17125 }
17126 else if(!exp->expType && exp->type != 16)
17127 {
17128 char expString[10240];
17129
17130 expString[0] = '\0';
17131 if(inCompiler)
17132 {
17133 PrintExpression(exp, expString);
17134 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17135 }
17136 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17137 }
17138 if(inCompiler)
17139 ApplyAnyObjectLogic(exp);
17140 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)))
17141 {
17142 exp->byReference = 0x1;
17143 }
17144 yylloc = oldyylloc;
17145 }
17146
17147 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)
17148 {
17149 if(*curMember)
17150 {
17151 *curMember = (*curMember)->next;
17152 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17153 {
17154 *curMember = subMemberStack[--(*subMemberStackPos)];
17155 *curMember = (*curMember)->next;
17156 }
17157 while((*curMember) && (*curMember)->isProperty)
17158 *curMember = (*curMember)->next;
17159 if(subMemberStackPos)
17160 {
17161 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17162 {
17163 subMemberStack[(*subMemberStackPos)++] = *curMember;
17164 *curMember = (*curMember)->members.first;
17165 while(*curMember && (*curMember)->isProperty)
17166 *curMember = (*curMember)->next;
17167 }
17168 }
17169 }
17170 while(!*curMember)
17171 {
17172 if(!*curMember)
17173 {
17174 if(subMemberStackPos && *subMemberStackPos)
17175 {
17176 *curMember = subMemberStack[--(*subMemberStackPos)];
17177 *curMember = (*curMember)->next;
17178 }
17179 else
17180 {
17181 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17182
17183 if(*curClass == _class)
17184 break;
17185 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17186 ;
17187 *curMember = (*curClass)->membersAndProperties.first;
17188 }
17189 while((*curMember) && (*curMember)->isProperty)
17190 *curMember = (*curMember)->next;
17191 if(subMemberStackPos)
17192 {
17193 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17194 {
17195 subMemberStack[(*subMemberStackPos)++] = *curMember;
17196 *curMember = (*curMember)->members.first;
17197 while(*curMember && (*curMember)->isProperty)
17198 *curMember = (*curMember)->next;
17199 }
17200 }
17201 }
17202 }
17203 }
17204
17205 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17206 {
17207 switch(init->type)
17208 {
17209 case 0:
17210 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17211 {
17212 if(init->__anon1.exp && !init->__anon1.exp->destType)
17213 {
17214 FreeType(init->__anon1.exp->destType);
17215 init->__anon1.exp->destType = type;
17216 if(type)
17217 type->refCount++;
17218 }
17219 if(init->__anon1.exp)
17220 {
17221 ProcessExpressionType(init->__anon1.exp);
17222 init->isConstant = init->__anon1.exp->isConstant;
17223 }
17224 break;
17225 }
17226 else
17227 {
17228 struct Expression * exp = init->__anon1.exp;
17229 struct Instantiation * inst = exp->__anon1.instance;
17230 struct MembersInit * members;
17231
17232 init->type = 1;
17233 init->__anon1.list = MkList();
17234 if(inst->members)
17235 {
17236 for(members = (*inst->members).first; members; members = members->next)
17237 {
17238 if(members->type == 0)
17239 {
17240 struct MemberInit * member;
17241
17242 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17243 {
17244 ListAdd(init->__anon1.list, member->initializer);
17245 member->initializer = (((void *)0));
17246 }
17247 }
17248 }
17249 }
17250 FreeExpression(exp);
17251 }
17252 case 1:
17253 {
17254 struct Initializer * i;
17255 struct Type * initializerType = (((void *)0));
17256 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17257 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17258 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17259 int subMemberStackPos = 0;
17260
17261 if(type && type->kind == 12)
17262 initializerType = Dereference(type);
17263 else if(type && (type->kind == 9 || type->kind == 10))
17264 initializerType = type->__anon1.__anon1.members.first;
17265 for(i = (*init->__anon1.list).first; i; i = i->next)
17266 {
17267 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17268 {
17269 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17270 if(curMember)
17271 {
17272 if(!curMember->dataType)
17273 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
17274 initializerType = curMember->dataType;
17275 }
17276 }
17277 ProcessInitializer(i, initializerType);
17278 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17279 initializerType = initializerType->next;
17280 if(!i->isConstant)
17281 init->isConstant = 0x0;
17282 }
17283 if(type && type->kind == 12)
17284 FreeType(initializerType);
17285 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))
17286 {
17287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17288 }
17289 break;
17290 }
17291 }
17292 }
17293
17294 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17295
17296 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17297
17298 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17299 {
17300 switch(spec->type)
17301 {
17302 case 0:
17303 {
17304 if(spec->__anon1.specifier == THISCLASS)
17305 {
17306 if(thisClass)
17307 {
17308 spec->type = 1;
17309 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17310 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17311 ProcessSpecifier(spec, declareStruct);
17312 }
17313 }
17314 break;
17315 }
17316 case 1:
17317 {
17318 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17319
17320 if(symbol)
17321 DeclareType(symbol->type, 0x1, 0x1);
17322 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17323 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
17324 break;
17325 }
17326 case 2:
17327 {
17328 struct Enumerator * e;
17329
17330 if(spec->__anon1.__anon2.list)
17331 {
17332 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17333 {
17334 if(e->exp)
17335 ProcessExpressionType(e->exp);
17336 }
17337 }
17338 break;
17339 }
17340 case 3:
17341 case 4:
17342 {
17343 if(spec->__anon1.__anon2.definitions)
17344 {
17345 struct ClassDef * def;
17346 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17347
17348 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17349 }
17350 break;
17351 }
17352 }
17353 }
17354
17355 static void ProcessDeclarator(struct Declarator * decl)
17356 {
17357 switch(decl->type)
17358 {
17359 case 1:
17360 if(decl->__anon1.identifier->classSym)
17361 {
17362 FreeSpecifier(decl->__anon1.identifier->_class);
17363 decl->__anon1.identifier->_class = (((void *)0));
17364 }
17365 break;
17366 case 3:
17367 if(decl->__anon1.array.exp)
17368 ProcessExpressionType(decl->__anon1.array.exp);
17369 case 0:
17370 case 2:
17371 case 4:
17372 case 5:
17373 case 6:
17374 case 7:
17375 if(decl->declarator)
17376 ProcessDeclarator(decl->declarator);
17377 if(decl->type == 4)
17378 {
17379 struct Identifier * id = GetDeclId(decl);
17380
17381 if(id && id->_class)
17382 {
17383 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17384
17385 if(!decl->__anon1.function.parameters)
17386 decl->__anon1.function.parameters = MkList();
17387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17388 id->_class = (((void *)0));
17389 }
17390 if(decl->__anon1.function.parameters)
17391 {
17392 struct TypeName * param;
17393
17394 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17395 {
17396 if(param->qualifiers && (*param->qualifiers).first)
17397 {
17398 struct Specifier * spec = (*param->qualifiers).first;
17399
17400 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17401 {
17402 struct Declarator * d = param->declarator;
17403 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);
17404
17405 if(d->type != 5)
17406 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17407 FreeList(param->qualifiers, FreeSpecifier);
17408 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17409 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17411 param = newParam;
17412 }
17413 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17414 {
17415 struct Declarator * d = param->declarator;
17416
17417 FreeList(param->qualifiers, FreeSpecifier);
17418 param->qualifiers = MkListOne(MkSpecifier(VOID));
17419 if(d->type != 5)
17420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17421 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17422 }
17423 else if(spec->__anon1.specifier == THISCLASS)
17424 {
17425 if(thisClass)
17426 {
17427 spec->type = 1;
17428 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17429 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17430 ProcessSpecifier(spec, 0x0);
17431 }
17432 }
17433 }
17434 if(param->declarator)
17435 ProcessDeclarator(param->declarator);
17436 }
17437 }
17438 }
17439 break;
17440 }
17441 }
17442
17443 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17444
17445 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17446
17447 static void ProcessDeclaration(struct Declaration * decl)
17448 {
17449 yylloc = decl->loc;
17450 switch(decl->type)
17451 {
17452 case 1:
17453 {
17454 unsigned int declareStruct = 0x0;
17455
17456 if(decl->__anon1.__anon1.declarators)
17457 {
17458 struct InitDeclarator * d;
17459
17460 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17461 {
17462 struct Type * type, * subType;
17463
17464 ProcessDeclarator(d->declarator);
17465 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17466 if(d->initializer)
17467 {
17468 ProcessInitializer(d->initializer, type);
17469 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17470 {
17471 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17472 {
17473 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17474
17475 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17476 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17477 if(decl->__anon1.__anon1.specifiers)
17478 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17479 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17480 d = (((void *)0));
17481 decl->type = 2;
17482 decl->__anon1.inst = inst;
17483 }
17484 }
17485 }
17486 for(subType = type; subType; )
17487 {
17488 if(subType->kind == 8)
17489 {
17490 declareStruct = 0x1;
17491 break;
17492 }
17493 else if(subType->kind == 13)
17494 break;
17495 else if(subType->kind == 12)
17496 subType = subType->__anon1.__anon4.arrayType;
17497 else
17498 break;
17499 }
17500 FreeType(type);
17501 if(!d)
17502 break;
17503 }
17504 }
17505 if(decl->__anon1.__anon1.specifiers)
17506 {
17507 struct Specifier * s;
17508
17509 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17510 {
17511 ProcessSpecifier(s, declareStruct);
17512 }
17513 }
17514 break;
17515 }
17516 case 2:
17517 {
17518 ProcessInstantiationType(decl->__anon1.inst);
17519 break;
17520 }
17521 case 0:
17522 {
17523 struct Specifier * spec;
17524 struct Declarator * d;
17525 unsigned int declareStruct = 0x0;
17526
17527 if(decl->__anon1.__anon1.declarators)
17528 {
17529 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17530 {
17531 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17532 struct Type * subType;
17533
17534 ProcessDeclarator(d);
17535 for(subType = type; subType; )
17536 {
17537 if(subType->kind == 8)
17538 {
17539 declareStruct = 0x1;
17540 break;
17541 }
17542 else if(subType->kind == 13)
17543 break;
17544 else if(subType->kind == 12)
17545 subType = subType->__anon1.__anon4.arrayType;
17546 else
17547 break;
17548 }
17549 FreeType(type);
17550 }
17551 }
17552 if(decl->__anon1.__anon1.specifiers)
17553 {
17554 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17555 ProcessSpecifier(spec, declareStruct);
17556 }
17557 break;
17558 }
17559 }
17560 }
17561
17562 static struct FunctionDefinition * curFunction;
17563
17564 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17565 {
17566 char propName[1024], propNameM[1024];
17567 char getName[1024], setName[1024];
17568 struct __ecereNameSpace__ecere__sys__OldList * args;
17569
17570 DeclareProperty(prop, setName, getName);
17571 strcpy(propName, "__ecereProp_");
17572 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17573 strcat(propName, "_");
17574 FullClassNameCat(propName, prop->name, 0x1);
17575 MangleClassName(propName);
17576 strcpy(propNameM, "__ecerePropM_");
17577 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17578 strcat(propNameM, "_");
17579 FullClassNameCat(propNameM, prop->name, 0x1);
17580 MangleClassName(propNameM);
17581 if(prop->isWatchable)
17582 {
17583 args = MkList();
17584 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17585 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17586 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17587 args = MkList();
17588 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17589 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17590 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17591 }
17592 {
17593 args = MkList();
17594 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17595 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17596 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17597 args = MkList();
17598 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17599 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17600 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17601 }
17602 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17603 curFunction->propSet->fireWatchersDone = 0x1;
17604 }
17605
17606 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17607
17608 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17609
17610 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17611
17612 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17613
17614 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17615
17616 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17617
17618 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17619
17620 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17621
17622 static void ProcessStatement(struct Statement * stmt)
17623 {
17624 yylloc = stmt->loc;
17625 switch(stmt->type)
17626 {
17627 case 0:
17628 ProcessStatement(stmt->__anon1.labeled.stmt);
17629 break;
17630 case 1:
17631 if(stmt->__anon1.caseStmt.exp)
17632 {
17633 FreeType(stmt->__anon1.caseStmt.exp->destType);
17634 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17635 if(curSwitchType)
17636 curSwitchType->refCount++;
17637 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17638 ComputeExpression(stmt->__anon1.caseStmt.exp);
17639 }
17640 if(stmt->__anon1.caseStmt.stmt)
17641 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17642 break;
17643 case 2:
17644 {
17645 if(stmt->__anon1.compound.context)
17646 {
17647 struct Declaration * decl;
17648 struct Statement * s;
17649 struct Statement * prevCompound = curCompound;
17650 struct Context * prevContext = curContext;
17651
17652 if(!stmt->__anon1.compound.isSwitch)
17653 curCompound = stmt;
17654 curContext = stmt->__anon1.compound.context;
17655 if(stmt->__anon1.compound.declarations)
17656 {
17657 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17658 ProcessDeclaration(decl);
17659 }
17660 if(stmt->__anon1.compound.statements)
17661 {
17662 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17663 ProcessStatement(s);
17664 }
17665 curContext = prevContext;
17666 curCompound = prevCompound;
17667 }
17668 break;
17669 }
17670 case 3:
17671 {
17672 struct Expression * exp;
17673
17674 if(stmt->__anon1.expressions)
17675 {
17676 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17677 ProcessExpressionType(exp);
17678 }
17679 break;
17680 }
17681 case 4:
17682 {
17683 struct Expression * exp;
17684
17685 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17686 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17687 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 0x1;
17688 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17689 {
17690 ProcessExpressionType(exp);
17691 }
17692 if(stmt->__anon1.ifStmt.stmt)
17693 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17694 if(stmt->__anon1.ifStmt.elseStmt)
17695 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17696 break;
17697 }
17698 case 5:
17699 {
17700 struct Type * oldSwitchType = curSwitchType;
17701
17702 if(stmt->__anon1.switchStmt.exp)
17703 {
17704 struct Expression * exp;
17705
17706 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17707 {
17708 if(!exp->next)
17709 {
17710 ProcessExpressionType(exp);
17711 }
17712 if(!exp->next)
17713 curSwitchType = exp->expType;
17714 }
17715 }
17716 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17717 curSwitchType = oldSwitchType;
17718 break;
17719 }
17720 case 6:
17721 {
17722 if(stmt->__anon1.whileStmt.exp)
17723 {
17724 struct Expression * exp;
17725
17726 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17727 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17728 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 0x1;
17729 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17730 {
17731 ProcessExpressionType(exp);
17732 }
17733 }
17734 if(stmt->__anon1.whileStmt.stmt)
17735 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17736 break;
17737 }
17738 case 7:
17739 {
17740 if(stmt->__anon1.doWhile.exp)
17741 {
17742 struct Expression * exp;
17743
17744 if((*stmt->__anon1.doWhile.exp).last)
17745 {
17746 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17747 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17748 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 0x1;
17749 }
17750 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17751 {
17752 ProcessExpressionType(exp);
17753 }
17754 }
17755 if(stmt->__anon1.doWhile.stmt)
17756 ProcessStatement(stmt->__anon1.doWhile.stmt);
17757 break;
17758 }
17759 case 8:
17760 {
17761 struct Expression * exp;
17762
17763 if(stmt->__anon1.forStmt.init)
17764 ProcessStatement(stmt->__anon1.forStmt.init);
17765 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17766 {
17767 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17768 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17769 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 0x1;
17770 }
17771 if(stmt->__anon1.forStmt.check)
17772 ProcessStatement(stmt->__anon1.forStmt.check);
17773 if(stmt->__anon1.forStmt.increment)
17774 {
17775 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17776 ProcessExpressionType(exp);
17777 }
17778 if(stmt->__anon1.forStmt.stmt)
17779 ProcessStatement(stmt->__anon1.forStmt.stmt);
17780 break;
17781 }
17782 case 18:
17783 {
17784 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17785 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17786 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17787 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17788 char iteratorType[1024];
17789 struct Type * source;
17790 struct Expression * e;
17791 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));
17792 struct Expression * arrayExp;
17793 const char * typeString = (((void *)0));
17794 int builtinCount = 0;
17795
17796 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17797 {
17798 if(!e->next)
17799 {
17800 FreeType(e->destType);
17801 e->destType = ProcessTypeString("Container", 0x0);
17802 }
17803 if(!isBuiltin || e->next)
17804 ProcessExpressionType(e);
17805 }
17806 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17807 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)))
17808 {
17809 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17810 struct Symbol * symbol;
17811 struct Expression * expIt = (((void *)0));
17812 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17813 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17814 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17815 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17816
17817 stmt->type = 2;
17818 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17819 stmt->__anon1.compound.context->parent = curContext;
17820 curContext = stmt->__anon1.compound.context;
17821 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17822 {
17823 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17824
17825 isCustomAVLTree = 0x1;
17826 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17827 isMap = 0x1;
17828 }
17829 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17830 isArray = 0x1;
17831 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17832 {
17833 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17834
17835 isLinkList = 0x1;
17836 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17837 }
17838 if(isArray)
17839 {
17840 struct Declarator * decl;
17841 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17842
17843 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17844 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17845 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17846 }
17847 else if(isBuiltin)
17848 {
17849 struct Type * type = (((void *)0));
17850 char typeStringBuf[1024];
17851
17852 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17853 if(((struct Expression *)(*exp).last)->type == 11)
17854 {
17855 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17856
17857 if(typeName)
17858 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17859 }
17860 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)
17861 {
17862 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17863
17864 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17865 }
17866 else if(arrayExp->__anon1.list)
17867 {
17868 struct Expression * e;
17869
17870 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17871 {
17872 ProcessExpressionType(e);
17873 if(e->expType)
17874 {
17875 if(!type)
17876 {
17877 type = e->expType;
17878 type->refCount++;
17879 }
17880 else
17881 {
17882 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17883 {
17884 FreeType(type);
17885 type = e->expType;
17886 e->expType = (((void *)0));
17887 e = (*arrayExp->__anon1.list).first;
17888 ProcessExpressionType(e);
17889 if(e->expType)
17890 {
17891 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17892 {
17893 FreeType(e->expType);
17894 e->expType = (((void *)0));
17895 FreeType(type);
17896 type = (((void *)0));
17897 break;
17898 }
17899 }
17900 }
17901 }
17902 if(e->expType)
17903 {
17904 FreeType(e->expType);
17905 e->expType = (((void *)0));
17906 }
17907 }
17908 }
17909 if(type)
17910 {
17911 typeStringBuf[0] = '\0';
17912 PrintType(type, typeStringBuf, 0x0, 0x1);
17913 typeString = typeStringBuf;
17914 FreeType(type);
17915 }
17916 }
17917 if(typeString)
17918 {
17919 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17920 struct Declarator * decl;
17921 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17922
17923 if(arrayExp->__anon1.list)
17924 {
17925 struct Expression * e;
17926
17927 builtinCount = (*arrayExp->__anon1.list).count;
17928 type = ProcessTypeString(typeString, 0x0);
17929 while(e = (*arrayExp->__anon1.list).first)
17930 {
17931 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17932 e->destType = type;
17933 type->refCount++;
17934 ProcessExpressionType(e);
17935 ListAdd(initializers, MkInitializerAssignment(e));
17936 }
17937 FreeType(type);
17938 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17939 }
17940 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17941 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17942 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17943 FreeList(exp, FreeExpression);
17944 }
17945 else
17946 {
17947 arrayExp->expType = ProcessTypeString("Container", 0x0);
17948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17949 }
17950 }
17951 else if(isLinkList && !isList)
17952 {
17953 struct Declarator * decl;
17954 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17955
17956 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17957 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17958 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17959 }
17960 else if(_class->templateArgs)
17961 {
17962 if(isMap)
17963 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17964 else
17965 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
17966 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)))))))));
17967 }
17968 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17969 if(block)
17970 {
17971 switch(block->type)
17972 {
17973 case 2:
17974 if(block->__anon1.compound.context)
17975 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17976 break;
17977 case 4:
17978 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
17979 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17980 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
17981 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17982 break;
17983 case 5:
17984 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
17985 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17986 break;
17987 case 6:
17988 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
17989 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17990 break;
17991 case 7:
17992 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
17993 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17994 break;
17995 case 8:
17996 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
17997 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17998 break;
17999 case 18:
18000 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18001 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18002 break;
18003 }
18004 }
18005 if(filter)
18006 {
18007 block = MkIfStmt(filter, block, (((void *)0)));
18008 }
18009 if(isArray)
18010 {
18011 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));
18012 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18013 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18014 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18015 }
18016 else if(isBuiltin)
18017 {
18018 char count[128];
18019
18020 sprintf(count, "%d", builtinCount);
18021 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));
18022 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18023 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18024 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18025 }
18026 else if(isLinkList && !isList)
18027 {
18028 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18029 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18030
18031 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18032 {
18033 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));
18034 }
18035 else
18036 {
18037 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18038 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18039
18040 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));
18041 }
18042 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18043 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18044 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18045 }
18046 else
18047 {
18048 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18049 }
18050 ProcessExpressionType(expIt);
18051 if((*stmt->__anon1.compound.declarations).first)
18052 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18053 if(symbol)
18054 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18055 ProcessStatement(stmt);
18056 curContext = stmt->__anon1.compound.context->parent;
18057 break;
18058 }
18059 else
18060 {
18061 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18062 }
18063 break;
18064 }
18065 case 9:
18066 break;
18067 case 10:
18068 break;
18069 case 11:
18070 break;
18071 case 12:
18072 {
18073 struct Expression * exp;
18074
18075 if(stmt->__anon1.expressions)
18076 {
18077 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18078 {
18079 if(!exp->next)
18080 {
18081 if(curFunction && !curFunction->type)
18082 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18083 FreeType(exp->destType);
18084 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18085 if(exp->destType)
18086 exp->destType->refCount++;
18087 }
18088 ProcessExpressionType(exp);
18089 }
18090 }
18091 break;
18092 }
18093 case 14:
18094 {
18095 ProcessDeclaration(stmt->__anon1.decl);
18096 break;
18097 }
18098 case 13:
18099 {
18100 struct AsmField * field;
18101
18102 if(stmt->__anon1.asmStmt.inputFields)
18103 {
18104 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18105 if(field->expression)
18106 ProcessExpressionType(field->expression);
18107 }
18108 if(stmt->__anon1.asmStmt.outputFields)
18109 {
18110 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18111 if(field->expression)
18112 ProcessExpressionType(field->expression);
18113 }
18114 if(stmt->__anon1.asmStmt.clobberedFields)
18115 {
18116 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18117 {
18118 if(field->expression)
18119 ProcessExpressionType(field->expression);
18120 }
18121 }
18122 break;
18123 }
18124 case 17:
18125 {
18126 struct PropertyWatch * propWatch;
18127 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18128 struct Expression * object = stmt->__anon1._watch.object;
18129 struct Expression * watcher = stmt->__anon1._watch.watcher;
18130
18131 if(watcher)
18132 ProcessExpressionType(watcher);
18133 if(object)
18134 ProcessExpressionType(object);
18135 if(inCompiler)
18136 {
18137 if(watcher || thisClass)
18138 {
18139 struct External * external = curExternal;
18140 struct Context * context = curContext;
18141
18142 stmt->type = 3;
18143 stmt->__anon1.expressions = MkList();
18144 curExternal = external->prev;
18145 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18146 {
18147 struct ClassFunction * func;
18148 char watcherName[1024];
18149 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;
18150 struct External * createdExternal;
18151 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18152
18153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18154 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18155 if(propWatch->deleteWatch)
18156 strcat(watcherName, "_delete");
18157 else
18158 {
18159 struct Identifier * propID;
18160
18161 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18162 {
18163 strcat(watcherName, "_");
18164 strcat(watcherName, propID->string);
18165 }
18166 }
18167 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18168 {
18169 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)));
18170 ProcessClassFunctionBody(func, propWatch->compound);
18171 propWatch->compound = (((void *)0));
18172 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
18173 createdExternal->symbol->idCode = external->symbol->idCode;
18174 curExternal = createdExternal;
18175 ProcessFunction(createdExternal->__anon1.function);
18176 {
18177 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18178
18179 externalDecl->__anon1.declaration = decl;
18180 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18181 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18182 }
18183 if(propWatch->deleteWatch)
18184 {
18185 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18186
18187 ListAdd(args, CopyExpression(object));
18188 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18189 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18190 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18191 }
18192 else
18193 {
18194 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18195 struct Identifier * propID;
18196
18197 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18198 {
18199 char propName[1024];
18200 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18201
18202 if(prop)
18203 {
18204 char getName[1024], setName[1024];
18205 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18206
18207 DeclareProperty(prop, setName, getName);
18208 strcpy(propName, "__ecereProp_");
18209 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18210 strcat(propName, "_");
18211 FullClassNameCat(propName, prop->name, 0x1);
18212 ListAdd(args, CopyExpression(object));
18213 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18214 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18215 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18216 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18217 }
18218 else
18219 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18220 }
18221 }
18222 }
18223 else
18224 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18225 }
18226 curExternal = external;
18227 curContext = context;
18228 if(watcher)
18229 FreeExpression(watcher);
18230 if(object)
18231 FreeExpression(object);
18232 FreeList(watches, FreePropertyWatch);
18233 }
18234 else
18235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18236 }
18237 else
18238 {
18239 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18240 {
18241 ProcessStatement(propWatch->compound);
18242 }
18243 }
18244 break;
18245 }
18246 case 15:
18247 {
18248 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18249 struct Expression * object = stmt->__anon1._watch.object;
18250 struct __ecereNameSpace__ecere__com__Class * _class;
18251
18252 if(object)
18253 ProcessExpressionType(object);
18254 if(inCompiler)
18255 {
18256 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18257 if(_class)
18258 {
18259 struct Identifier * propID;
18260
18261 stmt->type = 3;
18262 stmt->__anon1.expressions = MkList();
18263 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18264 {
18265 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18266 }
18267 else if(!watches)
18268 {
18269 }
18270 if(watches)
18271 {
18272 for(propID = (*watches).first; propID; propID = propID->next)
18273 {
18274 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18275
18276 if(prop)
18277 {
18278 CreateFireWatcher(prop, object, stmt);
18279 }
18280 else
18281 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18282 }
18283 }
18284 else
18285 {
18286 struct __ecereNameSpace__ecere__com__Property * prop;
18287 struct __ecereNameSpace__ecere__com__Class * base;
18288
18289 for(base = _class; base; base = base->base)
18290 {
18291 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18292 {
18293 if(prop->isProperty && prop->isWatchable)
18294 {
18295 CreateFireWatcher(prop, object, stmt);
18296 }
18297 }
18298 }
18299 }
18300 if(object)
18301 FreeExpression(object);
18302 FreeList(watches, FreeIdentifier);
18303 }
18304 else
18305 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18306 }
18307 break;
18308 }
18309 case 16:
18310 {
18311 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18312 struct Expression * object = stmt->__anon1._watch.object;
18313 struct Expression * watcher = stmt->__anon1._watch.watcher;
18314 struct __ecereNameSpace__ecere__com__Class * _class;
18315
18316 if(object)
18317 ProcessExpressionType(object);
18318 if(watcher)
18319 ProcessExpressionType(watcher);
18320 if(inCompiler)
18321 {
18322 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18323 if(watcher || thisClass)
18324 {
18325 if(_class)
18326 {
18327 struct Identifier * propID;
18328
18329 stmt->type = 3;
18330 stmt->__anon1.expressions = MkList();
18331 if(!watches)
18332 {
18333 struct __ecereNameSpace__ecere__sys__OldList * args;
18334
18335 args = MkList();
18336 ListAdd(args, CopyExpression(object));
18337 ListAdd(args, MkExpConstant("0"));
18338 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18339 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18340 }
18341 else
18342 {
18343 for(propID = (*watches).first; propID; propID = propID->next)
18344 {
18345 char propName[1024];
18346 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18347
18348 if(prop)
18349 {
18350 char getName[1024], setName[1024];
18351 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18352
18353 DeclareProperty(prop, setName, getName);
18354 strcpy(propName, "__ecereProp_");
18355 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18356 strcat(propName, "_");
18357 FullClassNameCat(propName, prop->name, 0x1);
18358 MangleClassName(propName);
18359 ListAdd(args, CopyExpression(object));
18360 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18361 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18362 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18363 }
18364 else
18365 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18366 }
18367 }
18368 if(object)
18369 FreeExpression(object);
18370 if(watcher)
18371 FreeExpression(watcher);
18372 FreeList(watches, FreeIdentifier);
18373 }
18374 else
18375 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18376 }
18377 else
18378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18379 }
18380 break;
18381 }
18382 }
18383 }
18384
18385 extern struct Expression * QBrackets(struct Expression * exp);
18386
18387 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18388
18389 extern struct Declarator * QMkPtrDecl(const char *  id);
18390
18391 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18392
18393 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18394
18395 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18396
18397 static void ProcessFunction(struct FunctionDefinition * function)
18398 {
18399 struct Identifier * id = GetDeclId(function->declarator);
18400 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18401 struct Type * type = symbol ? symbol->type : (((void *)0));
18402 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18403 struct Context * oldTopContext = topContext;
18404
18405 yylloc = function->loc;
18406 if(type && type->__anon1.__anon2.thisClass)
18407 {
18408 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18409 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18410 char className[1024];
18411 char structName[1024];
18412 struct Declarator * funcDecl;
18413 struct Symbol * thisSymbol;
18414 unsigned int typedObject = 0x0;
18415
18416 if(_class && !_class->base)
18417 {
18418 _class = currentClass;
18419 if(_class && !_class->symbol)
18420 _class->symbol = FindClass(_class->fullName);
18421 classSym = _class ? _class->symbol : (((void *)0));
18422 typedObject = 0x1;
18423 }
18424 thisClass = _class;
18425 if(inCompiler && _class)
18426 {
18427 if(type->kind == 11)
18428 {
18429 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18430 {
18431 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18432
18433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18434 FreeType(param);
18435 }
18436 if(type->classObjectType != 1)
18437 {
18438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18439 symbol->type->__anon1.__anon2.staticMethod = 0x1;
18440 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18441 symbol->type->extraParam = 0x0;
18442 }
18443 }
18444 strcpy(className, "__ecereClass_");
18445 FullClassNameCat(className, _class->fullName, 0x1);
18446 MangleClassName(className);
18447 structName[0] = (char)0;
18448 FullClassNameCat(structName, _class->fullName, 0x0);
18449 funcDecl = GetFuncDecl(function->declarator);
18450 if(funcDecl)
18451 {
18452 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18453 {
18454 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18455
18456 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18457 {
18458 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18459 FreeTypeName(param);
18460 }
18461 }
18462 if(!function->propertyNoThis)
18463 {
18464 struct TypeName * thisParam;
18465
18466 if(type->classObjectType != 1)
18467 {
18468 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18469 if(!funcDecl->__anon1.function.parameters)
18470 funcDecl->__anon1.function.parameters = MkList();
18471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18472 }
18473 if(typedObject)
18474 {
18475 if(type->classObjectType != 1)
18476 {
18477 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18478 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18479 }
18480 thisParam = __extension__ ({
18481 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18482
18483 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18484 });
18485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18486 }
18487 }
18488 }
18489 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18490 {
18491 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18492
18493 funcDecl = GetFuncDecl(initDecl->declarator);
18494 if(funcDecl)
18495 {
18496 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18497 {
18498 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18499
18500 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18501 {
18502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18503 FreeTypeName(param);
18504 }
18505 }
18506 if(type->classObjectType != 1)
18507 {
18508 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18509 {
18510 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18511
18512 if(!funcDecl->__anon1.function.parameters)
18513 funcDecl->__anon1.function.parameters = MkList();
18514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18515 }
18516 }
18517 }
18518 }
18519 }
18520 if(function->body)
18521 {
18522 if(type->classObjectType != 1)
18523 {
18524 thisSymbol = __extension__ ({
18525 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18526
18527 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18528 });
18529 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18530 if(typedObject && thisSymbol->type)
18531 {
18532 thisSymbol->type->classObjectType = 2;
18533 thisSymbol->type->byReference = type->byReference;
18534 thisSymbol->type->typedByReference = type->byReference;
18535 }
18536 }
18537 }
18538 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18539 {
18540 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18541
18542 {
18543 struct __ecereNameSpace__ecere__com__Class * base;
18544
18545 for(base = _class; base && base->type != 1000; base = base->next)
18546 {
18547 for(member = base->membersAndProperties.first; member; member = member->next)
18548 if(!member->isProperty)
18549 break;
18550 if(member)
18551 break;
18552 }
18553 }
18554 for(member = _class->membersAndProperties.first; member; member = member->next)
18555 if(!member->isProperty)
18556 break;
18557 if(member)
18558 {
18559 char pointerName[1024];
18560 struct Declaration * decl;
18561 struct Initializer * initializer;
18562 struct Expression * exp, * bytePtr;
18563
18564 strcpy(pointerName, "__ecerePointer_");
18565 FullClassNameCat(pointerName, _class->fullName, 0x0);
18566 {
18567 char className[1024];
18568
18569 strcpy(className, "__ecereClass_");
18570 FullClassNameCat(className, classSym->string, 0x1);
18571 MangleClassName(className);
18572 DeclareClass(classSym, className);
18573 }
18574 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18575 if(_class->fixed)
18576 {
18577 char string[256];
18578
18579 sprintf(string, "%d", _class->offset);
18580 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18581 }
18582 else
18583 {
18584 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18585 }
18586 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18587 exp->expType = __extension__ ({
18588 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18589
18590 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18591 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18592
18593 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18594 }), __ecereInstance2;
18595 });
18596 if(function->body)
18597 {
18598 yylloc = function->body->loc;
18599 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18600 {
18601 struct Context * prevContext = curContext;
18602
18603 curContext = function->body->__anon1.compound.context;
18604 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18605 curContext = prevContext;
18606 }
18607 decl->symbol = (((void *)0));
18608 if(!function->body->__anon1.compound.declarations)
18609 function->body->__anon1.compound.declarations = MkList();
18610 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18611 }
18612 }
18613 }
18614 }
18615 else
18616 thisClass = (((void *)0));
18617 if(id)
18618 {
18619 FreeSpecifier(id->_class);
18620 id->_class = (((void *)0));
18621 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18622 {
18623 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18624
18625 id = GetDeclId(initDecl->declarator);
18626 FreeSpecifier(id->_class);
18627 id->_class = (((void *)0));
18628 }
18629 }
18630 if(function->body)
18631 topContext = function->body->__anon1.compound.context;
18632 {
18633 struct FunctionDefinition * oldFunction = curFunction;
18634
18635 curFunction = function;
18636 if(function->body)
18637 ProcessStatement(function->body);
18638 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18639 {
18640 struct Statement * prevCompound = curCompound;
18641 struct Context * prevContext = curContext;
18642 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18643
18644 if(!function->body->__anon1.compound.statements)
18645 function->body->__anon1.compound.statements = MkList();
18646 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18647 curCompound = function->body;
18648 curContext = function->body->__anon1.compound.context;
18649 ProcessStatement(fireWatchers);
18650 curContext = prevContext;
18651 curCompound = prevCompound;
18652 }
18653 curFunction = oldFunction;
18654 }
18655 if(function->declarator)
18656 {
18657 ProcessDeclarator(function->declarator);
18658 }
18659 topContext = oldTopContext;
18660 thisClass = oldThisClass;
18661 }
18662
18663 extern void FreeSymbol(struct Symbol * symbol);
18664
18665 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18666
18667 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18668 {
18669 struct ClassDef * def;
18670 struct External * external = curExternal;
18671 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18672
18673 for(def = definitions->first; def; def = def->next)
18674 {
18675 if(def->type == 0)
18676 {
18677 if(def->__anon1.function->declarator)
18678 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18679 else
18680 curExternal = external;
18681 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18682 }
18683 else if(def->type == 2)
18684 {
18685 if(def->__anon1.decl->type == 2)
18686 {
18687 thisClass = regClass;
18688 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18689 thisClass = (((void *)0));
18690 }
18691 else
18692 {
18693 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18694
18695 if(regClass)
18696 thisClass = regClass;
18697 ProcessDeclaration(def->__anon1.decl);
18698 thisClass = backThisClass;
18699 }
18700 }
18701 else if(def->type == 1 && def->__anon1.defProperties)
18702 {
18703 struct MemberInit * defProperty;
18704 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);
18705
18706 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18707 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18708 {
18709 thisClass = regClass;
18710 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18711 thisClass = (((void *)0));
18712 }
18713 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18714 FreeSymbol(thisSymbol);
18715 }
18716 else if(def->type == 3 && def->__anon1.propertyDef)
18717 {
18718 struct PropertyDef * prop = def->__anon1.propertyDef;
18719
18720 thisClass = regClass;
18721 if(prop->setStmt)
18722 {
18723 if(regClass)
18724 {
18725 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18726
18727 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18728 }
18729 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18730 ProcessStatement(prop->setStmt);
18731 }
18732 if(prop->getStmt)
18733 {
18734 if(regClass)
18735 {
18736 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18737
18738 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18739 }
18740 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18741 ProcessStatement(prop->getStmt);
18742 }
18743 if(prop->issetStmt)
18744 {
18745 if(regClass)
18746 {
18747 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18748
18749 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18750 }
18751 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18752 ProcessStatement(prop->issetStmt);
18753 }
18754 thisClass = (((void *)0));
18755 }
18756 else if(def->type == 4 && def->__anon1.propertyWatch)
18757 {
18758 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18759
18760 thisClass = regClass;
18761 if(propertyWatch->compound)
18762 {
18763 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);
18764
18765 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18766 curExternal = (((void *)0));
18767 ProcessStatement(propertyWatch->compound);
18768 }
18769 thisClass = (((void *)0));
18770 }
18771 }
18772 }
18773
18774 void DeclareFunctionUtil(const char * s)
18775 {
18776 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18777
18778 if(function)
18779 {
18780 char name[1024];
18781
18782 name[0] = (char)0;
18783 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18784 strcpy(name, "__ecereFunction_");
18785 FullClassNameCat(name, s, 0x0);
18786 DeclareFunction(function, name);
18787 }
18788 }
18789
18790 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18791
18792 void ComputeDataTypes()
18793 {
18794 struct External * external;
18795 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18796 struct External * after = (((void *)0));
18797
18798 currentClass = (((void *)0));
18799 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18800 for(external = (*ast).first; external; external = external->next)
18801 {
18802 if(external->type == 1)
18803 {
18804 struct Declaration * decl = external->__anon1.declaration;
18805
18806 if(decl)
18807 {
18808 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18809
18810 if(decls)
18811 {
18812 struct InitDeclarator * initDecl = (*decls).first;
18813
18814 if(initDecl)
18815 {
18816 struct Declarator * declarator = initDecl->declarator;
18817
18818 if(declarator && declarator->type == 1)
18819 {
18820 struct Identifier * id = declarator->__anon1.identifier;
18821
18822 if(id && id->string)
18823 {
18824 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18825 {
18826 external->symbol->id = -1001, external->symbol->idCode = -1001;
18827 after = external;
18828 }
18829 }
18830 }
18831 }
18832 }
18833 }
18834 }
18835 }
18836 temp->symbol = __extension__ ({
18837 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18838
18839 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18840 });
18841 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18842 curExternal = temp;
18843 DeclareFunctionUtil("eSystem_New");
18844 DeclareFunctionUtil("eSystem_New0");
18845 DeclareFunctionUtil("eSystem_Renew");
18846 DeclareFunctionUtil("eSystem_Renew0");
18847 DeclareFunctionUtil("eSystem_Delete");
18848 DeclareFunctionUtil("eClass_GetProperty");
18849 DeclareFunctionUtil("eClass_SetProperty");
18850 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18851 DeclareFunctionUtil("eInstance_SetMethod");
18852 DeclareFunctionUtil("eInstance_IncRef");
18853 DeclareFunctionUtil("eInstance_StopWatching");
18854 DeclareFunctionUtil("eInstance_Watch");
18855 DeclareFunctionUtil("eInstance_FireWatchers");
18856 DeclareStruct("ecere::com::Class", 0x0);
18857 DeclareStruct("ecere::com::Instance", 0x0);
18858 DeclareStruct("ecere::com::Property", 0x0);
18859 DeclareStruct("ecere::com::DataMember", 0x0);
18860 DeclareStruct("ecere::com::Method", 0x0);
18861 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18862 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18863 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18864 for(external = (*ast).first; external; external = external->next)
18865 {
18866 afterExternal = curExternal = external;
18867 if(external->type == 0)
18868 {
18869 currentClass = external->__anon1.function->_class;
18870 ProcessFunction(external->__anon1.function);
18871 }
18872 else if(external->type == 1)
18873 {
18874 currentClass = (((void *)0));
18875 if(external->__anon1.declaration)
18876 ProcessDeclaration(external->__anon1.declaration);
18877 }
18878 else if(external->type == 2)
18879 {
18880 struct ClassDefinition * _class = external->__anon1._class;
18881
18882 currentClass = external->symbol->__anon1.registered;
18883 if(_class->definitions)
18884 {
18885 ProcessClass(_class->definitions, _class->symbol);
18886 }
18887 if(inCompiler)
18888 {
18889 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18890 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18891 }
18892 }
18893 else if(external->type == 4)
18894 {
18895 thisNameSpace = external->__anon1.id->string;
18896 }
18897 }
18898 currentClass = (((void *)0));
18899 thisNameSpace = (((void *)0));
18900 curExternal = (((void *)0));
18901 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18902 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18903 }
18904
18905 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);
18906
18907 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);
18908
18909 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18910
18911 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18912 {
18913 struct __ecereNameSpace__ecere__com__Class * class;
18914
18915 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18916 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18917 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18918 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18919 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18920 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18921 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18922 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18923 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18924 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18925 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18926 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18927 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18928 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18929 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18930 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18931 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18932 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18933 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18934 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18935 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18936 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18937 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18938 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18939 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18940 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18941 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18945 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18964 __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);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18968 __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);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18981 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18982 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18983 __ecereClass_Conversion = class;
18984 __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);
18985 __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);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18987 __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);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19010 }
19011
19012 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19013 {
19014
19015 }
19016