compiler/libec: (#99) Avoiding anon struct/unions in favor of supporting GCC 4.4...
[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 } __attribute__ ((gcc_struct));
494
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
496
497 struct TemplateDatatype
498 {
499 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
500 struct Declarator * decl;
501 } __attribute__ ((gcc_struct));
502
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
504
505 struct TemplateArgument;
506
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
508
509 struct TemplateParameter
510 {
511 struct TemplateParameter * prev;
512 struct TemplateParameter * next;
513 struct Location loc;
514 int type;
515 struct Identifier * identifier;
516 union
517 {
518 struct TemplateDatatype * dataType;
519 int memberType;
520 } __attribute__ ((gcc_struct)) __anon1;
521 struct TemplateArgument * defaultArgument;
522 const char *  dataTypeString;
523 struct Type * baseType;
524 } __attribute__ ((gcc_struct));
525
526 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
527
528 struct Specifier
529 {
530 struct Specifier * prev;
531 struct Specifier * next;
532 struct Location loc;
533 int type;
534 union
535 {
536 int specifier;
537 struct
538 {
539 struct ExtDecl * extDecl;
540 char *  name;
541 struct Symbol * symbol;
542 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
543 } __attribute__ ((gcc_struct)) __anon1;
544 struct
545 {
546 struct Identifier * id;
547 struct __ecereNameSpace__ecere__sys__OldList *  list;
548 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
549 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
550 unsigned int addNameSpace;
551 struct Context * ctx;
552 struct ExtDecl * extDeclStruct;
553 } __attribute__ ((gcc_struct)) __anon2;
554 struct Expression * expression;
555 struct Specifier * _class;
556 struct TemplateParameter * templateParameter;
557 } __attribute__ ((gcc_struct)) __anon1;
558 } __attribute__ ((gcc_struct));
559
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
561
562 struct Identifier
563 {
564 struct Identifier * prev;
565 struct Identifier * next;
566 struct Location loc;
567 struct Symbol * classSym;
568 struct Specifier * _class;
569 char *  string;
570 struct Identifier * badID;
571 } __attribute__ ((gcc_struct));
572
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
574
575 struct Pointer;
576
577 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
578
579 struct Declarator
580 {
581 struct Declarator * prev;
582 struct Declarator * next;
583 struct Location loc;
584 int type;
585 struct Symbol * symbol;
586 struct Declarator * declarator;
587 union
588 {
589 struct Identifier * identifier;
590 struct
591 {
592 struct Expression * exp;
593 struct Expression * posExp;
594 struct Attrib * attrib;
595 } __attribute__ ((gcc_struct)) structDecl;
596 struct
597 {
598 struct Expression * exp;
599 struct Specifier * enumClass;
600 } __attribute__ ((gcc_struct)) array;
601 struct
602 {
603 struct __ecereNameSpace__ecere__sys__OldList * parameters;
604 } __attribute__ ((gcc_struct)) function;
605 struct
606 {
607 struct Pointer * pointer;
608 } __attribute__ ((gcc_struct)) pointer;
609 struct
610 {
611 struct ExtDecl * extended;
612 } __attribute__ ((gcc_struct)) extended;
613 } __attribute__ ((gcc_struct)) __anon1;
614 } __attribute__ ((gcc_struct));
615
616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
617
618 struct FunctionDefinition
619 {
620 struct FunctionDefinition * prev;
621 struct FunctionDefinition * next;
622 struct Location loc;
623 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
624 struct Declarator * declarator;
625 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
626 struct Statement * body;
627 struct __ecereNameSpace__ecere__com__Class * _class;
628 struct __ecereNameSpace__ecere__sys__OldList attached;
629 int declMode;
630 struct Type * type;
631 struct Symbol * propSet;
632 int tempCount;
633 unsigned int propertyNoThis;
634 } __attribute__ ((gcc_struct));
635
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
637
638 struct DBTableDef;
639
640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
641
642 struct External
643 {
644 struct External * prev;
645 struct External * next;
646 struct Location loc;
647 int type;
648 struct Symbol * symbol;
649 union
650 {
651 struct FunctionDefinition * function;
652 struct ClassDefinition * _class;
653 struct Declaration * declaration;
654 char *  importString;
655 struct Identifier * id;
656 struct DBTableDef * table;
657 } __attribute__ ((gcc_struct)) __anon1;
658 int importType;
659 } __attribute__ ((gcc_struct));
660
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
662
663 struct ModuleImport
664 {
665 struct ModuleImport * prev;
666 struct ModuleImport * next;
667 char *  name;
668 struct __ecereNameSpace__ecere__sys__OldList classes;
669 struct __ecereNameSpace__ecere__sys__OldList functions;
670 int importType;
671 int importAccess;
672 } __attribute__ ((gcc_struct));
673
674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
675
676 struct ClassImport
677 {
678 struct ClassImport * prev;
679 struct ClassImport * next;
680 char *  name;
681 struct __ecereNameSpace__ecere__sys__OldList methods;
682 struct __ecereNameSpace__ecere__sys__OldList properties;
683 unsigned int itself;
684 int isRemote;
685 } __attribute__ ((gcc_struct));
686
687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
688
689 struct Symbol
690 {
691 char *  string;
692 struct Symbol * parent;
693 struct Symbol * left;
694 struct Symbol * right;
695 int depth;
696 struct Type * type;
697 union
698 {
699 struct __ecereNameSpace__ecere__com__Method * method;
700 struct __ecereNameSpace__ecere__com__Property * _property;
701 struct __ecereNameSpace__ecere__com__Class * registered;
702 } __attribute__ ((gcc_struct)) __anon1;
703 int id;
704 int idCode;
705 union
706 {
707 struct
708 {
709 struct External * pointerExternal;
710 struct External * structExternal;
711 } __attribute__ ((gcc_struct)) __anon1;
712 struct
713 {
714 struct External * externalGet;
715 struct External * externalSet;
716 struct External * externalPtr;
717 struct External * externalIsSet;
718 } __attribute__ ((gcc_struct)) __anon2;
719 struct
720 {
721 struct External * methodExternal;
722 struct External * methodCodeExternal;
723 } __attribute__ ((gcc_struct)) __anon3;
724 } __attribute__ ((gcc_struct)) __anon2;
725 unsigned int imported;
726 unsigned int declaredStructSym;
727 struct __ecereNameSpace__ecere__com__Class * _class;
728 unsigned int declaredStruct;
729 unsigned int needConstructor;
730 unsigned int needDestructor;
731 char *  constructorName;
732 char *  structName;
733 char *  className;
734 char *  destructorName;
735 struct ModuleImport * module;
736 struct ClassImport * _import;
737 struct Location nameLoc;
738 unsigned int isParam;
739 unsigned int isRemote;
740 unsigned int isStruct;
741 unsigned int fireWatchersDone;
742 int declaring;
743 unsigned int classData;
744 unsigned int isStatic;
745 char *  shortName;
746 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
747 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
748 struct Context * ctx;
749 int isIterator;
750 struct Expression * propCategory;
751 } __attribute__ ((gcc_struct));
752
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
754
755 struct Type
756 {
757 struct Type * prev;
758 struct Type * next;
759 int refCount;
760 union
761 {
762 struct Symbol * _class;
763 struct
764 {
765 struct __ecereNameSpace__ecere__sys__OldList members;
766 char *  enumName;
767 } __attribute__ ((gcc_struct)) __anon1;
768 struct
769 {
770 struct Type * returnType;
771 struct __ecereNameSpace__ecere__sys__OldList params;
772 struct Symbol * thisClass;
773 unsigned int staticMethod;
774 struct TemplateParameter * thisClassTemplate;
775 } __attribute__ ((gcc_struct)) __anon2;
776 struct
777 {
778 struct __ecereNameSpace__ecere__com__Method * method;
779 struct __ecereNameSpace__ecere__com__Class * methodClass;
780 struct __ecereNameSpace__ecere__com__Class * usedClass;
781 } __attribute__ ((gcc_struct)) __anon3;
782 struct
783 {
784 struct Type * arrayType;
785 int arraySize;
786 struct Expression * arraySizeExp;
787 unsigned int freeExp;
788 struct Symbol * enumClass;
789 } __attribute__ ((gcc_struct)) __anon4;
790 struct Type * type;
791 struct TemplateParameter * templateParameter;
792 } __attribute__ ((gcc_struct)) __anon1;
793 int kind;
794 unsigned int size;
795 char *  name;
796 char *  typeName;
797 int classObjectType;
798 int alignment;
799 unsigned int offset;
800 int bitFieldCount;
801 int count;
802 unsigned int isSigned : 1;
803 unsigned int constant : 1;
804 unsigned int truth : 1;
805 unsigned int byReference : 1;
806 unsigned int extraParam : 1;
807 unsigned int directClassAccess : 1;
808 unsigned int computing : 1;
809 unsigned int keepCast : 1;
810 unsigned int passAsTemplate : 1;
811 unsigned int dllExport : 1;
812 unsigned int attrStdcall : 1;
813 unsigned int declaredWithStruct : 1;
814 unsigned int typedByReference : 1;
815 unsigned int casted : 1;
816 } __attribute__ ((gcc_struct));
817
818 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
819
820 struct __ecereNameSpace__ecere__com__Class
821 {
822 struct __ecereNameSpace__ecere__com__Class * prev;
823 struct __ecereNameSpace__ecere__com__Class * next;
824 const char *  name;
825 int offset;
826 int structSize;
827 int (* *  _vTbl)();
828 int vTblSize;
829 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
830 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
831 int offsetClass;
832 int sizeClass;
833 struct __ecereNameSpace__ecere__com__Class * base;
834 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
835 struct __ecereNameSpace__ecere__sys__BinaryTree members;
836 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
837 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
838 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
839 struct __ecereNameSpace__ecere__sys__OldList derivatives;
840 int memberID;
841 int startMemberID;
842 int type;
843 struct __ecereNameSpace__ecere__com__Instance * module;
844 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
845 const char *  dataTypeString;
846 struct Type * dataType;
847 int typeSize;
848 int defaultAlignment;
849 void (*  Initialize)();
850 int memberOffset;
851 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
852 const char *  designerClass;
853 unsigned int noExpansion;
854 const char *  defaultProperty;
855 unsigned int comRedefinition;
856 int count;
857 int isRemote;
858 unsigned int internalDecl;
859 void *  data;
860 unsigned int computeSize;
861 int structAlignment;
862 int destructionWatchOffset;
863 unsigned int fixed;
864 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
865 int inheritanceAccess;
866 const char *  fullName;
867 void *  symbol;
868 struct __ecereNameSpace__ecere__sys__OldList conversions;
869 struct __ecereNameSpace__ecere__sys__OldList templateParams;
870 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
871 struct __ecereNameSpace__ecere__com__Class * templateClass;
872 struct __ecereNameSpace__ecere__sys__OldList templatized;
873 int numParams;
874 unsigned int isInstanceClass;
875 unsigned int byValueSystemClass;
876 } __attribute__ ((gcc_struct));
877
878 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
879
880 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
881
882 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
883
884 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
885
886 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
887
888 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);
889
890 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
891
892 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
893
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
895
896 struct __ecereNameSpace__ecere__com__Instance
897 {
898 int (* *  _vTbl)();
899 struct __ecereNameSpace__ecere__com__Class * _class;
900 int _refCount;
901 } __attribute__ ((gcc_struct));
902
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
904
905 struct __ecereNameSpace__ecere__com__DataMember
906 {
907 struct __ecereNameSpace__ecere__com__DataMember * prev;
908 struct __ecereNameSpace__ecere__com__DataMember * next;
909 const char *  name;
910 unsigned int isProperty;
911 int memberAccess;
912 int id;
913 struct __ecereNameSpace__ecere__com__Class * _class;
914 const char *  dataTypeString;
915 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
916 struct Type * dataType;
917 int type;
918 int offset;
919 int memberID;
920 struct __ecereNameSpace__ecere__sys__OldList members;
921 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
922 int memberOffset;
923 int structAlignment;
924 } __attribute__ ((gcc_struct));
925
926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
927
928 struct __ecereNameSpace__ecere__com__SerialBuffer
929 {
930 unsigned char *  _buffer;
931 unsigned int count;
932 unsigned int _size;
933 unsigned int pos;
934 } __attribute__ ((gcc_struct));
935
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
937
938 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
939 {
940 union
941 {
942 struct
943 {
944 const char *  dataTypeString;
945 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
946 } __attribute__ ((gcc_struct)) __anon1;
947 struct __ecereNameSpace__ecere__com__DataValue expression;
948 struct
949 {
950 const char *  memberString;
951 union
952 {
953 struct __ecereNameSpace__ecere__com__DataMember * member;
954 struct __ecereNameSpace__ecere__com__Property * prop;
955 struct __ecereNameSpace__ecere__com__Method * method;
956 } __attribute__ ((gcc_struct)) __anon1;
957 } __attribute__ ((gcc_struct)) __anon2;
958 } __attribute__ ((gcc_struct)) __anon1;
959 } __attribute__ ((gcc_struct));
960
961 void exit(int status);
962
963 void * calloc(size_t nmemb, size_t size);
964
965 void free(void * ptr);
966
967 void * malloc(size_t size);
968
969 void * realloc(void * ptr, size_t size);
970
971 long int strtol(const char * nptr, char ** endptr, int base);
972
973 long long int strtoll(const char * nptr, char ** endptr, int base);
974
975 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
976
977 enum yytokentype
978 {
979 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
980 };
981
982 typedef union YYSTYPE
983 {
984 int specifierType;
985 int i;
986 int declMode;
987 struct Identifier * id;
988 struct Expression * exp;
989 struct Specifier * specifier;
990 struct __ecereNameSpace__ecere__sys__OldList * list;
991 struct Enumerator * enumerator;
992 struct Declarator * declarator;
993 struct Pointer * pointer;
994 struct Initializer * initializer;
995 struct InitDeclarator * initDeclarator;
996 struct TypeName * typeName;
997 struct Declaration * declaration;
998 struct Statement * stmt;
999 struct FunctionDefinition * function;
1000 struct External * external;
1001 struct Context * context;
1002 struct AsmField * asmField;
1003 struct Attrib * attrib;
1004 struct ExtDecl * extDecl;
1005 struct Attribute * attribute;
1006 struct Instantiation * instance;
1007 struct MembersInit * membersInit;
1008 struct MemberInit * memberInit;
1009 struct ClassFunction * classFunction;
1010 struct ClassDefinition * _class;
1011 struct ClassDef * classDef;
1012 struct PropertyDef * prop;
1013 char * string;
1014 struct Symbol * symbol;
1015 struct PropertyWatch * propertyWatch;
1016 struct TemplateParameter * templateParameter;
1017 struct TemplateArgument * templateArgument;
1018 struct TemplateDatatype * templateDatatype;
1019 struct DBTableEntry * dbtableEntry;
1020 struct DBIndexItem * dbindexItem;
1021 struct DBTableDef * dbtableDef;
1022 } __attribute__ ((gcc_struct)) YYSTYPE;
1023
1024 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1025
1026 struct Enumerator
1027 {
1028 struct Enumerator * prev;
1029 struct Enumerator * next;
1030 struct Location loc;
1031 struct Identifier * id;
1032 struct Expression * exp;
1033 } __attribute__ ((gcc_struct));
1034
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1036
1037 struct InitDeclarator
1038 {
1039 struct InitDeclarator * prev;
1040 struct InitDeclarator * next;
1041 struct Location loc;
1042 struct Declarator * declarator;
1043 struct Initializer * initializer;
1044 } __attribute__ ((gcc_struct));
1045
1046 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1047
1048 struct AsmField
1049 {
1050 struct AsmField * prev;
1051 struct AsmField * next;
1052 struct Location loc;
1053 char *  command;
1054 struct Expression * expression;
1055 struct Identifier * symbolic;
1056 } __attribute__ ((gcc_struct));
1057
1058 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1059
1060 struct Attribute;
1061
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1063
1064 struct ClassFunction
1065 {
1066 struct ClassFunction * prev;
1067 struct ClassFunction * next;
1068 struct Location loc;
1069 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1070 struct Declarator * declarator;
1071 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1072 struct Statement * body;
1073 struct __ecereNameSpace__ecere__com__Class * _class;
1074 struct __ecereNameSpace__ecere__sys__OldList attached;
1075 int declMode;
1076 struct Type * type;
1077 struct Symbol * propSet;
1078 unsigned int isVirtual;
1079 unsigned int isConstructor;
1080 unsigned int isDestructor;
1081 unsigned int dontMangle;
1082 int id;
1083 int idCode;
1084 } __attribute__ ((gcc_struct));
1085
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1087
1088 struct MembersInit
1089 {
1090 struct MembersInit * prev;
1091 struct MembersInit * next;
1092 struct Location loc;
1093 int type;
1094 union
1095 {
1096 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1097 struct ClassFunction * function;
1098 } __attribute__ ((gcc_struct)) __anon1;
1099 } __attribute__ ((gcc_struct));
1100
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1102
1103 struct MemberInit
1104 {
1105 struct MemberInit * prev;
1106 struct MemberInit * next;
1107 struct Location loc;
1108 struct Location realLoc;
1109 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1110 struct Initializer * initializer;
1111 unsigned int used;
1112 unsigned int variable;
1113 unsigned int takeOutExp;
1114 } __attribute__ ((gcc_struct));
1115
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1117
1118 struct PropertyDef
1119 {
1120 struct PropertyDef * prev;
1121 struct PropertyDef * next;
1122 struct Location loc;
1123 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1124 struct Declarator * declarator;
1125 struct Identifier * id;
1126 struct Statement * getStmt;
1127 struct Statement * setStmt;
1128 struct Statement * issetStmt;
1129 struct Symbol * symbol;
1130 struct Expression * category;
1131 struct
1132 {
1133 unsigned int conversion : 1;
1134 unsigned int isWatchable : 1;
1135 unsigned int isDBProp : 1;
1136 } __attribute__ ((gcc_struct)) __anon1;
1137 } __attribute__ ((gcc_struct));
1138
1139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1140
1141 struct PropertyWatch
1142 {
1143 struct PropertyWatch * prev;
1144 struct PropertyWatch * next;
1145 struct Location loc;
1146 struct Statement * compound;
1147 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1148 unsigned int deleteWatch;
1149 } __attribute__ ((gcc_struct));
1150
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1152
1153 struct ClassDef
1154 {
1155 struct ClassDef * prev;
1156 struct ClassDef * next;
1157 struct Location loc;
1158 int type;
1159 union
1160 {
1161 struct Declaration * decl;
1162 struct ClassFunction * function;
1163 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1164 struct PropertyDef * propertyDef;
1165 struct PropertyWatch * propertyWatch;
1166 char *  designer;
1167 struct Identifier * defaultProperty;
1168 struct
1169 {
1170 struct Identifier * id;
1171 struct Initializer * initializer;
1172 } __attribute__ ((gcc_struct)) __anon1;
1173 } __attribute__ ((gcc_struct)) __anon1;
1174 int memberAccess;
1175 void *  object;
1176 } __attribute__ ((gcc_struct));
1177
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1179
1180 struct DBTableEntry;
1181
1182 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1183
1184 struct DBIndexItem;
1185
1186 extern YYSTYPE yylval;
1187
1188 extern struct Location yylloc;
1189
1190 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1191
1192 extern int returnCode;
1193
1194 extern struct Expression * parsedExpression;
1195
1196 extern unsigned int yydebug;
1197
1198 void SetYydebug(unsigned int b)
1199 {
1200 yydebug = b;
1201 }
1202
1203 extern unsigned int echoOn;
1204
1205 void resetScanner();
1206
1207 int propWatcherID;
1208
1209 int expression_yyparse();
1210
1211 static struct Statement * curCompound;
1212
1213 struct External * curExternal, * afterExternal;
1214
1215 static struct Type * curSwitchType;
1216
1217 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1218
1219 struct __ecereNameSpace__ecere__com__Class * thisClass;
1220
1221 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1222 {
1223 thisClass = c;
1224 }
1225
1226 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1227 {
1228 return thisClass;
1229 }
1230
1231 static char * thisNameSpace;
1232
1233 struct __ecereNameSpace__ecere__com__Class * containerClass;
1234
1235 unsigned int thisClassParams = 0x1;
1236
1237 unsigned int internalValueCounter;
1238
1239 extern unsigned int outputLineNumbers;
1240
1241 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1242
1243 extern size_t strlen(const char * );
1244
1245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1246
1247 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1248
1249 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1250
1251 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1252
1253 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1254
1255 void PrintExpression(struct Expression * exp, char * string)
1256 {
1257 {
1258 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1259 int count;
1260 unsigned int backOutputLineNumbers = outputLineNumbers;
1261
1262 outputLineNumbers = 0x0;
1263 if(exp)
1264 OutputExpression(exp, f);
1265 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1266 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1267
1268 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1269 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1270 count = strlen(string);
1271 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1272 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1273
1274 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1275 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1276 string[count] = '\0';
1277 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1278 outputLineNumbers = backOutputLineNumbers;
1279 }
1280 }
1281
1282 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1283
1284 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1285
1286 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1287 {
1288 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1289 {
1290 if(!param->baseType)
1291 {
1292 if(param->dataTypeString)
1293 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1294 else
1295 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1296 }
1297 return param->baseType;
1298 }
1299 return (((void *)0));
1300 }
1301
1302 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1303 {
1304 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1305 return 0x1;
1306 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1307 {
1308 return 0x0;
1309 }
1310 if(type1->kind == type2->kind)
1311 {
1312 switch(type1->kind)
1313 {
1314 case 24:
1315 case 1:
1316 case 2:
1317 case 3:
1318 case 4:
1319 case 22:
1320 case 23:
1321 if(type1->passAsTemplate && !type2->passAsTemplate)
1322 return 0x1;
1323 return type1->isSigned != type2->isSigned;
1324 case 8:
1325 return type1->__anon1._class != type2->__anon1._class;
1326 case 13:
1327 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1328 default:
1329 return 0x1;
1330 }
1331 }
1332 return 0x1;
1333 }
1334
1335 extern int strcmp(const char * , const char * );
1336
1337 extern struct Context * curContext;
1338
1339 extern struct Context * topContext;
1340
1341 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1342
1343 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);
1344
1345 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1346
1347 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);
1348
1349 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);
1350
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1352
1353 struct __ecereNameSpace__ecere__com__ClassProperty
1354 {
1355 const char *  name;
1356 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1357 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1358 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1359 int depth;
1360 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1361 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1362 const char *  dataTypeString;
1363 struct Type * dataType;
1364 unsigned int constant;
1365 } __attribute__ ((gcc_struct));
1366
1367 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1368
1369 extern struct Expression * QMkExpId(const char *  id);
1370
1371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1372
1373 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1374 {
1375 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1377 const char *  name;
1378 int type;
1379 union
1380 {
1381 const char *  dataTypeString;
1382 int memberType;
1383 } __attribute__ ((gcc_struct)) __anon1;
1384 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1385 void *  param;
1386 } __attribute__ ((gcc_struct));
1387
1388 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1389
1390 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1391
1392 extern void FreeIdentifier(struct Identifier * id);
1393
1394 void ProcessExpressionType(struct Expression * exp);
1395
1396 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1397
1398 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1399
1400 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1401
1402 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1403
1404 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1405
1406 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1407
1408 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1409
1410 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1411
1412 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1413 {
1414 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1415 {
1416 struct Identifier * id = exp->__anon1.__anon1.identifier;
1417 struct Context * ctx;
1418 struct Symbol * symbol = (((void *)0));
1419
1420 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1421 {
1422 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1423 {
1424 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1425 if(symbol)
1426 break;
1427 }
1428 }
1429 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))))
1430 {
1431 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1432 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1433 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1434 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1435
1436 if(!prop)
1437 {
1438 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1439 }
1440 if(!prop && !method)
1441 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1442 if(!prop && !method && !member)
1443 {
1444 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1445 }
1446 if(prop || method || member || classProp)
1447 {
1448 exp->type = 8;
1449 exp->__anon1.member.member = id;
1450 exp->__anon1.member.memberType = 0;
1451 exp->__anon1.member.exp = QMkExpId("this");
1452 exp->addedThis = 0x1;
1453 }
1454 else if(_class && _class->templateParams.first)
1455 {
1456 struct __ecereNameSpace__ecere__com__Class * sClass;
1457
1458 for(sClass = _class; sClass; sClass = sClass->base)
1459 {
1460 if(sClass->templateParams.first)
1461 {
1462 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1463
1464 for(param = sClass->templateParams.first; param; param = param->next)
1465 {
1466 if(param->type == 2 && !strcmp(param->name, id->string))
1467 {
1468 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1469
1470 if(argExp)
1471 {
1472 struct Declarator * decl;
1473 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1474
1475 FreeIdentifier(exp->__anon1.member.member);
1476 ProcessExpressionType(argExp);
1477 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1478 exp->expType = ProcessType(specs, decl);
1479 exp->type = 5;
1480 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1481 }
1482 }
1483 }
1484 }
1485 }
1486 }
1487 }
1488 }
1489 }
1490
1491 extern int sprintf(char * , const char * , ...);
1492
1493 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1494
1495 extern char *  strcat(char * , const char * );
1496
1497 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1498
1499 char * PrintInt(long long result)
1500 {
1501 char temp[100];
1502
1503 if(result > (((int)0x7fffffff)))
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1505 else
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1507 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1508 strcat(temp, "LL");
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1510 }
1511
1512 char * PrintUInt(uint64 result)
1513 {
1514 char temp[100];
1515
1516 if(result > (0xffffffff))
1517 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1518 else if(result > (((int)0x7fffffff)))
1519 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1520 else
1521 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1522 return __ecereNameSpace__ecere__sys__CopyString(temp);
1523 }
1524
1525 char * PrintInt64(long long result)
1526 {
1527 char temp[100];
1528
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 }
1532
1533 char * PrintUInt64(uint64 result)
1534 {
1535 char temp[100];
1536
1537 if(result > (((long long)0x7fffffffffffffffLL)))
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1539 else
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 }
1543
1544 char * PrintHexUInt(uint64 result)
1545 {
1546 char temp[100];
1547
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1550 else
1551 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1552 if(result > (0xffffffff))
1553 strcat(temp, "LL");
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1555 }
1556
1557 char * PrintHexUInt64(uint64 result)
1558 {
1559 char temp[100];
1560
1561 if(result > (0xffffffff))
1562 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1563 else
1564 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1565 return __ecereNameSpace__ecere__sys__CopyString(temp);
1566 }
1567
1568 char * PrintShort(short result)
1569 {
1570 char temp[100];
1571
1572 sprintf(temp, "%d", (unsigned short)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 }
1575
1576 char * PrintUShort(unsigned short result)
1577 {
1578 char temp[100];
1579
1580 if(result > (unsigned short)32767)
1581 sprintf(temp, "0x%X", (int)result);
1582 else
1583 sprintf(temp, "%d", (int)result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 }
1586
1587 extern int isprint(int c);
1588
1589 char * PrintChar(char result)
1590 {
1591 char temp[100];
1592
1593 if(result > (char)0 && isprint(result))
1594 sprintf(temp, "'%c'", result);
1595 else if(result < (char)0)
1596 sprintf(temp, "%d", (int)result);
1597 else
1598 sprintf(temp, "0x%X", (unsigned char)result);
1599 return __ecereNameSpace__ecere__sys__CopyString(temp);
1600 }
1601
1602 char * PrintUChar(unsigned char result)
1603 {
1604 char temp[100];
1605
1606 sprintf(temp, "0x%X", result);
1607 return __ecereNameSpace__ecere__sys__CopyString(temp);
1608 }
1609
1610 extern char *  strcpy(char * , const char * );
1611
1612 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1613
1614 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1615
1616 extern int (* __ecereProp_float_Get_signBit)(float this);
1617
1618 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1619
1620 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1621
1622 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1623
1624 char * PrintFloat(float result)
1625 {
1626 char temp[350];
1627
1628 if(__ecereProp_float_Get_isInf(result))
1629 {
1630 if(__ecereProp_float_Get_signBit(result))
1631 strcpy(temp, "-inf");
1632 else
1633 strcpy(temp, "inf");
1634 }
1635 else if(__ecereProp_float_Get_isNan(result))
1636 {
1637 if(__ecereProp_float_Get_signBit(result))
1638 strcpy(temp, "-nan");
1639 else
1640 strcpy(temp, "nan");
1641 }
1642 else
1643 sprintf(temp, "%.16ff", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1645 }
1646
1647 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1648
1649 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1650
1651 extern int (* __ecereProp_double_Get_signBit)(double this);
1652
1653 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1654
1655 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1656
1657 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1658
1659 char * PrintDouble(double result)
1660 {
1661 char temp[350];
1662
1663 if(__ecereProp_double_Get_isInf(result))
1664 {
1665 if(__ecereProp_double_Get_signBit(result))
1666 strcpy(temp, "-inf");
1667 else
1668 strcpy(temp, "inf");
1669 }
1670 else if(__ecereProp_double_Get_isNan(result))
1671 {
1672 if(__ecereProp_double_Get_signBit(result))
1673 strcpy(temp, "-nan");
1674 else
1675 strcpy(temp, "nan");
1676 }
1677 else
1678 sprintf(temp, "%.16f", result);
1679 return __ecereNameSpace__ecere__sys__CopyString(temp);
1680 }
1681
1682 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1683
1684 struct OpTable
1685 {
1686 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1692 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1693 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1694 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1706 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  Not)(struct Expression *, struct Operand *);
1712 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1721 } __attribute__ ((gcc_struct));
1722
1723 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1724
1725 struct Operand
1726 {
1727 int kind;
1728 struct Type * type;
1729 unsigned int ptrSize;
1730 union
1731 {
1732 char c;
1733 unsigned char uc;
1734 short s;
1735 unsigned short us;
1736 int i;
1737 unsigned int ui;
1738 float f;
1739 double d;
1740 long long i64;
1741 uint64 ui64;
1742 } __attribute__ ((gcc_struct)) __anon1;
1743 struct OpTable ops;
1744 } __attribute__ ((gcc_struct));
1745
1746 unsigned int GetOpInt(struct Operand * op2, int * value2)
1747 {
1748 if(op2->kind == 3 && op2->type->isSigned)
1749 *value2 = op2->__anon1.i;
1750 else if(op2->kind == 3)
1751 *value2 = (int)op2->__anon1.ui;
1752 else if(op2->kind == 4 && op2->type->isSigned)
1753 *value2 = (int)op2->__anon1.i64;
1754 else if(op2->kind == 4)
1755 *value2 = (int)op2->__anon1.ui64;
1756 else if(op2->kind == 23 && op2->type->isSigned)
1757 *value2 = (int)op2->__anon1.i64;
1758 else if(op2->kind == 23)
1759 *value2 = (int)op2->__anon1.ui64;
1760 else if(op2->kind == 22 && op2->type->isSigned)
1761 *value2 = (int)op2->__anon1.i64;
1762 else if(op2->kind == 22)
1763 *value2 = (int)op2->__anon1.ui64;
1764 else if(op2->kind == 2 && op2->type->isSigned)
1765 *value2 = (int)op2->__anon1.s;
1766 else if(op2->kind == 2)
1767 *value2 = (int)op2->__anon1.us;
1768 else if(op2->kind == 1 && op2->type->isSigned)
1769 *value2 = (int)op2->__anon1.c;
1770 else if(op2->kind == 24 || op2->kind == 1)
1771 *value2 = (int)op2->__anon1.uc;
1772 else if(op2->kind == 6)
1773 *value2 = (int)op2->__anon1.f;
1774 else if(op2->kind == 7)
1775 *value2 = (int)op2->__anon1.d;
1776 else if(op2->kind == 13)
1777 *value2 = (int)op2->__anon1.ui64;
1778 else
1779 return 0x0;
1780 return 0x1;
1781 }
1782
1783 struct Operand GetOperand(struct Expression * exp);
1784
1785 unsigned int GetInt(struct Expression * exp, int * value2)
1786 {
1787 struct Operand op2 = GetOperand(exp);
1788
1789 return GetOpInt(&op2, value2);
1790 }
1791
1792 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1793 {
1794 if(op2->kind == 3 && op2->type->isSigned)
1795 *value2 = (unsigned int)op2->__anon1.i;
1796 else if(op2->kind == 3)
1797 *value2 = op2->__anon1.ui;
1798 else if(op2->kind == 4 && op2->type->isSigned)
1799 *value2 = (unsigned int)op2->__anon1.i64;
1800 else if(op2->kind == 4)
1801 *value2 = (unsigned int)op2->__anon1.ui64;
1802 else if(op2->kind == 23 && op2->type->isSigned)
1803 *value2 = (unsigned int)op2->__anon1.i64;
1804 else if(op2->kind == 23)
1805 *value2 = (unsigned int)op2->__anon1.ui64;
1806 else if(op2->kind == 22 && op2->type->isSigned)
1807 *value2 = (unsigned int)op2->__anon1.i64;
1808 else if(op2->kind == 22)
1809 *value2 = (unsigned int)op2->__anon1.ui64;
1810 else if(op2->kind == 2 && op2->type->isSigned)
1811 *value2 = (unsigned int)op2->__anon1.s;
1812 else if(op2->kind == 2)
1813 *value2 = (unsigned int)op2->__anon1.us;
1814 else if(op2->kind == 1 && op2->type->isSigned)
1815 *value2 = (unsigned int)op2->__anon1.c;
1816 else if(op2->kind == 24 || op2->kind == 1)
1817 *value2 = (unsigned int)op2->__anon1.uc;
1818 else if(op2->kind == 6)
1819 *value2 = (unsigned int)op2->__anon1.f;
1820 else if(op2->kind == 7)
1821 *value2 = (unsigned int)op2->__anon1.d;
1822 else if(op2->kind == 13)
1823 *value2 = (unsigned int)op2->__anon1.ui64;
1824 else
1825 return 0x0;
1826 return 0x1;
1827 }
1828
1829 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1830 {
1831 struct Operand op2 = GetOperand(exp);
1832
1833 return GetOpUInt(&op2, value2);
1834 }
1835
1836 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1837 {
1838 if(op2->kind == 3 && op2->type->isSigned)
1839 *value2 = (long long)op2->__anon1.i;
1840 else if(op2->kind == 3)
1841 *value2 = (long long)op2->__anon1.ui;
1842 else if(op2->kind == 4 && op2->type->isSigned)
1843 *value2 = op2->__anon1.i64;
1844 else if(op2->kind == 4)
1845 *value2 = (long long)op2->__anon1.ui64;
1846 else if(op2->kind == 23 && op2->type->isSigned)
1847 *value2 = op2->__anon1.i64;
1848 else if(op2->kind == 23)
1849 *value2 = (long long)op2->__anon1.ui64;
1850 else if(op2->kind == 22 && op2->type->isSigned)
1851 *value2 = op2->__anon1.i64;
1852 else if(op2->kind == 22)
1853 *value2 = (long long)op2->__anon1.ui64;
1854 else if(op2->kind == 2 && op2->type->isSigned)
1855 *value2 = (long long)op2->__anon1.s;
1856 else if(op2->kind == 2)
1857 *value2 = (long long)op2->__anon1.us;
1858 else if(op2->kind == 1 && op2->type->isSigned)
1859 *value2 = (long long)op2->__anon1.c;
1860 else if(op2->kind == 24 || op2->kind == 1)
1861 *value2 = (long long)op2->__anon1.uc;
1862 else if(op2->kind == 6)
1863 *value2 = (long long)op2->__anon1.f;
1864 else if(op2->kind == 7)
1865 *value2 = (long long)op2->__anon1.d;
1866 else if(op2->kind == 13)
1867 *value2 = (long long)op2->__anon1.ui64;
1868 else
1869 return 0x0;
1870 return 0x1;
1871 }
1872
1873 unsigned int GetInt64(struct Expression * exp, long long * value2)
1874 {
1875 struct Operand op2 = GetOperand(exp);
1876
1877 return GetOpInt64(&op2, value2);
1878 }
1879
1880 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1881 {
1882 if(op2->kind == 3 && op2->type->isSigned)
1883 *value2 = (uint64)op2->__anon1.i;
1884 else if(op2->kind == 3)
1885 *value2 = (uint64)op2->__anon1.ui;
1886 else if(op2->kind == 4 && op2->type->isSigned)
1887 *value2 = (uint64)op2->__anon1.i64;
1888 else if(op2->kind == 4)
1889 *value2 = op2->__anon1.ui64;
1890 else if(op2->kind == 23 && op2->type->isSigned)
1891 *value2 = (uint64)op2->__anon1.i64;
1892 else if(op2->kind == 23)
1893 *value2 = op2->__anon1.ui64;
1894 else if(op2->kind == 22 && op2->type->isSigned)
1895 *value2 = (uint64)op2->__anon1.i64;
1896 else if(op2->kind == 22)
1897 *value2 = op2->__anon1.ui64;
1898 else if(op2->kind == 2 && op2->type->isSigned)
1899 *value2 = (uint64)op2->__anon1.s;
1900 else if(op2->kind == 2)
1901 *value2 = (uint64)op2->__anon1.us;
1902 else if(op2->kind == 1 && op2->type->isSigned)
1903 *value2 = (uint64)op2->__anon1.c;
1904 else if(op2->kind == 24 || op2->kind == 1)
1905 *value2 = (uint64)op2->__anon1.uc;
1906 else if(op2->kind == 6)
1907 *value2 = (uint64)op2->__anon1.f;
1908 else if(op2->kind == 7)
1909 *value2 = (uint64)op2->__anon1.d;
1910 else if(op2->kind == 13)
1911 *value2 = op2->__anon1.ui64;
1912 else
1913 return 0x0;
1914 return 0x1;
1915 }
1916
1917 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1918 {
1919 struct Operand op2 = GetOperand(exp);
1920
1921 return GetOpUInt64(&op2, value2);
1922 }
1923
1924 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1925 {
1926 if(op2->kind == 3 && op2->type->isSigned)
1927 *value2 = (intptr_t)op2->__anon1.i;
1928 else if(op2->kind == 3)
1929 *value2 = (intptr_t)op2->__anon1.ui;
1930 else if(op2->kind == 4 && op2->type->isSigned)
1931 *value2 = (intptr_t)op2->__anon1.i64;
1932 else if(op2->kind == 4)
1933 *value2 = (intptr_t)op2->__anon1.ui64;
1934 else if(op2->kind == 23 && op2->type->isSigned)
1935 *value2 = (intptr_t)op2->__anon1.i64;
1936 else if(op2->kind == 23)
1937 *value2 = (intptr_t)op2->__anon1.ui64;
1938 else if(op2->kind == 22 && op2->type->isSigned)
1939 *value2 = (intptr_t)op2->__anon1.i64;
1940 else if(op2->kind == 22)
1941 *value2 = (intptr_t)op2->__anon1.ui64;
1942 else if(op2->kind == 2 && op2->type->isSigned)
1943 *value2 = (intptr_t)op2->__anon1.s;
1944 else if(op2->kind == 2)
1945 *value2 = (intptr_t)op2->__anon1.us;
1946 else if(op2->kind == 1 && op2->type->isSigned)
1947 *value2 = (intptr_t)op2->__anon1.c;
1948 else if(op2->kind == 24 || op2->kind == 1)
1949 *value2 = (intptr_t)op2->__anon1.uc;
1950 else if(op2->kind == 6)
1951 *value2 = (intptr_t)op2->__anon1.f;
1952 else if(op2->kind == 7)
1953 *value2 = (intptr_t)op2->__anon1.d;
1954 else if(op2->kind == 13)
1955 *value2 = (intptr_t)op2->__anon1.ui64;
1956 else
1957 return 0x0;
1958 return 0x1;
1959 }
1960
1961 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1962 {
1963 struct Operand op2 = GetOperand(exp);
1964
1965 return GetOpIntPtr(&op2, value2);
1966 }
1967
1968 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1969 {
1970 if(op2->kind == 3 && op2->type->isSigned)
1971 *value2 = (uintptr_t)op2->__anon1.i;
1972 else if(op2->kind == 3)
1973 *value2 = (uintptr_t)op2->__anon1.ui;
1974 else if(op2->kind == 4 && op2->type->isSigned)
1975 *value2 = (uintptr_t)op2->__anon1.i64;
1976 else if(op2->kind == 4)
1977 *value2 = (uintptr_t)op2->__anon1.ui64;
1978 else if(op2->kind == 23 && op2->type->isSigned)
1979 *value2 = (uintptr_t)op2->__anon1.i64;
1980 else if(op2->kind == 23)
1981 *value2 = (uintptr_t)op2->__anon1.ui64;
1982 else if(op2->kind == 22 && op2->type->isSigned)
1983 *value2 = (uintptr_t)op2->__anon1.i64;
1984 else if(op2->kind == 22)
1985 *value2 = (uintptr_t)op2->__anon1.ui64;
1986 else if(op2->kind == 2 && op2->type->isSigned)
1987 *value2 = (uintptr_t)op2->__anon1.s;
1988 else if(op2->kind == 2)
1989 *value2 = (uintptr_t)op2->__anon1.us;
1990 else if(op2->kind == 1 && op2->type->isSigned)
1991 *value2 = (uintptr_t)op2->__anon1.c;
1992 else if(op2->kind == 24 || op2->kind == 1)
1993 *value2 = (uintptr_t)op2->__anon1.uc;
1994 else if(op2->kind == 6)
1995 *value2 = (uintptr_t)op2->__anon1.f;
1996 else if(op2->kind == 7)
1997 *value2 = (uintptr_t)op2->__anon1.d;
1998 else if(op2->kind == 13)
1999 *value2 = (uintptr_t)op2->__anon1.ui64;
2000 else
2001 return 0x0;
2002 return 0x1;
2003 }
2004
2005 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2006 {
2007 struct Operand op2 = GetOperand(exp);
2008
2009 return GetOpUIntPtr(&op2, value2);
2010 }
2011
2012 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2013 {
2014 if(op2->kind == 3 && op2->type->isSigned)
2015 *value2 = (ssize_t)op2->__anon1.i;
2016 else if(op2->kind == 3)
2017 *value2 = (ssize_t)op2->__anon1.ui;
2018 else if(op2->kind == 4 && op2->type->isSigned)
2019 *value2 = (ssize_t)op2->__anon1.i64;
2020 else if(op2->kind == 4)
2021 *value2 = (ssize_t)op2->__anon1.ui64;
2022 else if(op2->kind == 23 && op2->type->isSigned)
2023 *value2 = (ssize_t)op2->__anon1.i64;
2024 else if(op2->kind == 23)
2025 *value2 = (ssize_t)op2->__anon1.ui64;
2026 else if(op2->kind == 22 && op2->type->isSigned)
2027 *value2 = (ssize_t)op2->__anon1.i64;
2028 else if(op2->kind == 22)
2029 *value2 = (ssize_t)op2->__anon1.ui64;
2030 else if(op2->kind == 2 && op2->type->isSigned)
2031 *value2 = (ssize_t)op2->__anon1.s;
2032 else if(op2->kind == 2)
2033 *value2 = (ssize_t)op2->__anon1.us;
2034 else if(op2->kind == 1 && op2->type->isSigned)
2035 *value2 = (ssize_t)op2->__anon1.c;
2036 else if(op2->kind == 24 || op2->kind == 1)
2037 *value2 = (ssize_t)op2->__anon1.uc;
2038 else if(op2->kind == 6)
2039 *value2 = (ssize_t)op2->__anon1.f;
2040 else if(op2->kind == 7)
2041 *value2 = (ssize_t)op2->__anon1.d;
2042 else if(op2->kind == 13)
2043 *value2 = (ssize_t)op2->__anon1.ui64;
2044 else
2045 return 0x0;
2046 return 0x1;
2047 }
2048
2049 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2050 {
2051 struct Operand op2 = GetOperand(exp);
2052
2053 return GetOpIntSize(&op2, value2);
2054 }
2055
2056 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2057 {
2058 if(op2->kind == 3 && op2->type->isSigned)
2059 *value2 = (size_t)op2->__anon1.i;
2060 else if(op2->kind == 3)
2061 *value2 = (size_t)op2->__anon1.ui;
2062 else if(op2->kind == 4 && op2->type->isSigned)
2063 *value2 = (size_t)op2->__anon1.i64;
2064 else if(op2->kind == 4)
2065 *value2 = (size_t)op2->__anon1.ui64;
2066 else if(op2->kind == 23 && op2->type->isSigned)
2067 *value2 = (size_t)op2->__anon1.i64;
2068 else if(op2->kind == 23)
2069 *value2 = (size_t)op2->__anon1.ui64;
2070 else if(op2->kind == 22 && op2->type->isSigned)
2071 *value2 = (size_t)op2->__anon1.i64;
2072 else if(op2->kind == 22)
2073 *value2 = (size_t)op2->__anon1.ui64;
2074 else if(op2->kind == 2 && op2->type->isSigned)
2075 *value2 = (size_t)op2->__anon1.s;
2076 else if(op2->kind == 2)
2077 *value2 = (size_t)op2->__anon1.us;
2078 else if(op2->kind == 1 && op2->type->isSigned)
2079 *value2 = (size_t)op2->__anon1.c;
2080 else if(op2->kind == 24 || op2->kind == 1)
2081 *value2 = (size_t)op2->__anon1.uc;
2082 else if(op2->kind == 6)
2083 *value2 = (size_t)op2->__anon1.f;
2084 else if(op2->kind == 7)
2085 *value2 = (size_t)op2->__anon1.d;
2086 else if(op2->kind == 13)
2087 *value2 = (size_t)op2->__anon1.ui64;
2088 else
2089 return 0x0;
2090 return 0x1;
2091 }
2092
2093 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2094 {
2095 struct Operand op2 = GetOperand(exp);
2096
2097 return GetOpUIntSize(&op2, value2);
2098 }
2099
2100 unsigned int GetOpShort(struct Operand * op2, short * value2)
2101 {
2102 if(op2->kind == 3 && op2->type->isSigned)
2103 *value2 = (short)op2->__anon1.i;
2104 else if(op2->kind == 3)
2105 *value2 = (short)op2->__anon1.ui;
2106 else if(op2->kind == 4 && op2->type->isSigned)
2107 *value2 = (short)op2->__anon1.i64;
2108 else if(op2->kind == 4)
2109 *value2 = (short)op2->__anon1.ui64;
2110 else if(op2->kind == 23 && op2->type->isSigned)
2111 *value2 = (short)op2->__anon1.i64;
2112 else if(op2->kind == 23)
2113 *value2 = (short)op2->__anon1.ui64;
2114 else if(op2->kind == 22 && op2->type->isSigned)
2115 *value2 = (short)op2->__anon1.i64;
2116 else if(op2->kind == 22)
2117 *value2 = (short)op2->__anon1.ui64;
2118 else if(op2->kind == 2 && op2->type->isSigned)
2119 *value2 = op2->__anon1.s;
2120 else if(op2->kind == 2)
2121 *value2 = (short)op2->__anon1.us;
2122 else if(op2->kind == 1 && op2->type->isSigned)
2123 *value2 = (short)op2->__anon1.c;
2124 else if(op2->kind == 24 || op2->kind == 1)
2125 *value2 = (short)op2->__anon1.uc;
2126 else if(op2->kind == 6)
2127 *value2 = (short)op2->__anon1.f;
2128 else if(op2->kind == 7)
2129 *value2 = (short)op2->__anon1.d;
2130 else if(op2->kind == 13)
2131 *value2 = (short)op2->__anon1.ui64;
2132 else
2133 return 0x0;
2134 return 0x1;
2135 }
2136
2137 unsigned int GetShort(struct Expression * exp, short * value2)
2138 {
2139 struct Operand op2 = GetOperand(exp);
2140
2141 return GetOpShort(&op2, value2);
2142 }
2143
2144 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2145 {
2146 if(op2->kind == 3 && op2->type->isSigned)
2147 *value2 = (unsigned short)op2->__anon1.i;
2148 else if(op2->kind == 3)
2149 *value2 = (unsigned short)op2->__anon1.ui;
2150 else if(op2->kind == 4 && op2->type->isSigned)
2151 *value2 = (unsigned short)op2->__anon1.i64;
2152 else if(op2->kind == 4)
2153 *value2 = (unsigned short)op2->__anon1.ui64;
2154 else if(op2->kind == 23 && op2->type->isSigned)
2155 *value2 = (unsigned short)op2->__anon1.i64;
2156 else if(op2->kind == 23)
2157 *value2 = (unsigned short)op2->__anon1.ui64;
2158 else if(op2->kind == 22 && op2->type->isSigned)
2159 *value2 = (unsigned short)op2->__anon1.i64;
2160 else if(op2->kind == 22)
2161 *value2 = (unsigned short)op2->__anon1.ui64;
2162 else if(op2->kind == 2 && op2->type->isSigned)
2163 *value2 = (unsigned short)op2->__anon1.s;
2164 else if(op2->kind == 2)
2165 *value2 = op2->__anon1.us;
2166 else if(op2->kind == 1 && op2->type->isSigned)
2167 *value2 = (unsigned short)op2->__anon1.c;
2168 else if(op2->kind == 24 || op2->kind == 1)
2169 *value2 = (unsigned short)op2->__anon1.uc;
2170 else if(op2->kind == 6)
2171 *value2 = (unsigned short)op2->__anon1.f;
2172 else if(op2->kind == 7)
2173 *value2 = (unsigned short)op2->__anon1.d;
2174 else if(op2->kind == 13)
2175 *value2 = (unsigned short)op2->__anon1.ui64;
2176 else
2177 return 0x0;
2178 return 0x1;
2179 }
2180
2181 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2182 {
2183 struct Operand op2 = GetOperand(exp);
2184
2185 return GetOpUShort(&op2, value2);
2186 }
2187
2188 unsigned int GetOpChar(struct Operand * op2, char * value2)
2189 {
2190 if(op2->kind == 3 && op2->type->isSigned)
2191 *value2 = (char)op2->__anon1.i;
2192 else if(op2->kind == 3)
2193 *value2 = (char)op2->__anon1.ui;
2194 else if(op2->kind == 4 && op2->type->isSigned)
2195 *value2 = (char)op2->__anon1.i64;
2196 else if(op2->kind == 4)
2197 *value2 = (char)op2->__anon1.ui64;
2198 else if(op2->kind == 23 && op2->type->isSigned)
2199 *value2 = (char)op2->__anon1.i64;
2200 else if(op2->kind == 23)
2201 *value2 = (char)op2->__anon1.ui64;
2202 else if(op2->kind == 22 && op2->type->isSigned)
2203 *value2 = (char)op2->__anon1.i64;
2204 else if(op2->kind == 22)
2205 *value2 = (char)op2->__anon1.ui64;
2206 else if(op2->kind == 2 && op2->type->isSigned)
2207 *value2 = (char)op2->__anon1.s;
2208 else if(op2->kind == 2)
2209 *value2 = (char)op2->__anon1.us;
2210 else if(op2->kind == 1 && op2->type->isSigned)
2211 *value2 = op2->__anon1.c;
2212 else if(op2->kind == 24 || op2->kind == 1)
2213 *value2 = (char)op2->__anon1.uc;
2214 else if(op2->kind == 6)
2215 *value2 = (char)op2->__anon1.f;
2216 else if(op2->kind == 7)
2217 *value2 = (char)op2->__anon1.d;
2218 else if(op2->kind == 13)
2219 *value2 = (char)op2->__anon1.ui64;
2220 else
2221 return 0x0;
2222 return 0x1;
2223 }
2224
2225 unsigned int GetChar(struct Expression * exp, char * value2)
2226 {
2227 struct Operand op2 = GetOperand(exp);
2228
2229 return GetOpChar(&op2, value2);
2230 }
2231
2232 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2233 {
2234 if(op2->kind == 3 && op2->type->isSigned)
2235 *value2 = (unsigned char)op2->__anon1.i;
2236 else if(op2->kind == 3)
2237 *value2 = (unsigned char)op2->__anon1.ui;
2238 else if(op2->kind == 4 && op2->type->isSigned)
2239 *value2 = (unsigned char)op2->__anon1.i64;
2240 else if(op2->kind == 4)
2241 *value2 = (unsigned char)op2->__anon1.ui64;
2242 else if(op2->kind == 23 && op2->type->isSigned)
2243 *value2 = (unsigned char)op2->__anon1.i64;
2244 else if(op2->kind == 23)
2245 *value2 = (unsigned char)op2->__anon1.ui64;
2246 else if(op2->kind == 22 && op2->type->isSigned)
2247 *value2 = (unsigned char)op2->__anon1.i64;
2248 else if(op2->kind == 22)
2249 *value2 = (unsigned char)op2->__anon1.ui64;
2250 else if(op2->kind == 2 && op2->type->isSigned)
2251 *value2 = (unsigned char)op2->__anon1.s;
2252 else if(op2->kind == 2)
2253 *value2 = (unsigned char)op2->__anon1.us;
2254 else if(op2->kind == 1 && op2->type->isSigned)
2255 *value2 = (unsigned char)op2->__anon1.c;
2256 else if(op2->kind == 24 || op2->kind == 1)
2257 *value2 = op2->__anon1.uc;
2258 else if(op2->kind == 6)
2259 *value2 = (unsigned char)op2->__anon1.f;
2260 else if(op2->kind == 7)
2261 *value2 = (unsigned char)op2->__anon1.d;
2262 else if(op2->kind == 13)
2263 *value2 = (unsigned char)op2->__anon1.ui64;
2264 else
2265 return 0x0;
2266 return 0x1;
2267 }
2268
2269 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2270 {
2271 struct Operand op2 = GetOperand(exp);
2272
2273 return GetOpUChar(&op2, value2);
2274 }
2275
2276 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2277 {
2278 if(op2->kind == 3 && op2->type->isSigned)
2279 *value2 = (float)(float)op2->__anon1.i;
2280 else if(op2->kind == 3)
2281 *value2 = (float)(float)op2->__anon1.ui;
2282 else if(op2->kind == 4 && op2->type->isSigned)
2283 *value2 = (float)(float)op2->__anon1.i64;
2284 else if(op2->kind == 4)
2285 *value2 = (float)(float)op2->__anon1.ui64;
2286 else if(op2->kind == 23 && op2->type->isSigned)
2287 *value2 = (float)(float)op2->__anon1.i64;
2288 else if(op2->kind == 23)
2289 *value2 = (float)(float)op2->__anon1.ui64;
2290 else if(op2->kind == 22 && op2->type->isSigned)
2291 *value2 = (float)(float)op2->__anon1.i64;
2292 else if(op2->kind == 22)
2293 *value2 = (float)(float)op2->__anon1.ui64;
2294 else if(op2->kind == 2 && op2->type->isSigned)
2295 *value2 = (float)(float)op2->__anon1.s;
2296 else if(op2->kind == 2)
2297 *value2 = (float)(float)op2->__anon1.us;
2298 else if(op2->kind == 1 && op2->type->isSigned)
2299 *value2 = (float)(float)op2->__anon1.c;
2300 else if(op2->kind == 24 || op2->kind == 1)
2301 *value2 = (float)(float)op2->__anon1.uc;
2302 else if(op2->kind == 6)
2303 *value2 = (float)op2->__anon1.f;
2304 else if(op2->kind == 7)
2305 *value2 = (float)op2->__anon1.d;
2306 else if(op2->kind == 13)
2307 *value2 = (float)(float)op2->__anon1.ui64;
2308 else
2309 return 0x0;
2310 return 0x1;
2311 }
2312
2313 unsigned int GetFloat(struct Expression * exp, float * value2)
2314 {
2315 struct Operand op2 = GetOperand(exp);
2316
2317 return GetOpFloat(&op2, value2);
2318 }
2319
2320 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2321 {
2322 if(op2->kind == 3 && op2->type->isSigned)
2323 *value2 = (double)(double)op2->__anon1.i;
2324 else if(op2->kind == 3)
2325 *value2 = (double)(double)op2->__anon1.ui;
2326 else if(op2->kind == 4 && op2->type->isSigned)
2327 *value2 = (double)(double)op2->__anon1.i64;
2328 else if(op2->kind == 4)
2329 *value2 = (double)(double)op2->__anon1.ui64;
2330 else if(op2->kind == 23 && op2->type->isSigned)
2331 *value2 = (double)(double)op2->__anon1.i64;
2332 else if(op2->kind == 23)
2333 *value2 = (double)(double)op2->__anon1.ui64;
2334 else if(op2->kind == 22 && op2->type->isSigned)
2335 *value2 = (double)(double)op2->__anon1.i64;
2336 else if(op2->kind == 22)
2337 *value2 = (double)(double)op2->__anon1.ui64;
2338 else if(op2->kind == 2 && op2->type->isSigned)
2339 *value2 = (double)(double)op2->__anon1.s;
2340 else if(op2->kind == 2)
2341 *value2 = (double)(double)op2->__anon1.us;
2342 else if(op2->kind == 1 && op2->type->isSigned)
2343 *value2 = (double)(double)op2->__anon1.c;
2344 else if(op2->kind == 24 || op2->kind == 1)
2345 *value2 = (double)(double)op2->__anon1.uc;
2346 else if(op2->kind == 6)
2347 *value2 = (double)op2->__anon1.f;
2348 else if(op2->kind == 7)
2349 *value2 = (double)op2->__anon1.d;
2350 else if(op2->kind == 13)
2351 *value2 = (double)(double)op2->__anon1.ui64;
2352 else
2353 return 0x0;
2354 return 0x1;
2355 }
2356
2357 unsigned int GetDouble(struct Expression * exp, double * value2)
2358 {
2359 struct Operand op2 = GetOperand(exp);
2360
2361 return GetOpDouble(&op2, value2);
2362 }
2363
2364 void ComputeExpression(struct Expression * exp);
2365
2366 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2367
2368 extern int targetBits;
2369
2370 int ComputeTypeSize(struct Type * type);
2371
2372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2373
2374 struct __ecereNameSpace__ecere__com__BitMember
2375 {
2376 struct __ecereNameSpace__ecere__com__BitMember * prev;
2377 struct __ecereNameSpace__ecere__com__BitMember * next;
2378 const char *  name;
2379 unsigned int isProperty;
2380 int memberAccess;
2381 int id;
2382 struct __ecereNameSpace__ecere__com__Class * _class;
2383 const char *  dataTypeString;
2384 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2385 struct Type * dataType;
2386 int type;
2387 int size;
2388 int pos;
2389 uint64 mask;
2390 } __attribute__ ((gcc_struct));
2391
2392 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2393
2394 struct __ecereNameSpace__ecere__sys__OldLink
2395 {
2396 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2397 struct __ecereNameSpace__ecere__sys__OldLink * next;
2398 void *  data;
2399 } __attribute__ ((gcc_struct));
2400
2401 void FinishTemplatesContext(struct Context * context);
2402
2403 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2404 {
2405 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2406 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2407
2408 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))
2409 {
2410 int unionMemberOffset = 0;
2411 int bitFields = 0;
2412
2413 if(member)
2414 {
2415 member->memberOffset = 0;
2416 if(targetBits < sizeof(void *) * 8)
2417 member->structAlignment = 0;
2418 }
2419 else if(targetBits < sizeof(void *) * 8)
2420 _class->structAlignment = 0;
2421 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2422 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2423 if(!member && _class->destructionWatchOffset)
2424 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2425 {
2426 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2427
2428 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2429 {
2430 if(!dataMember->isProperty)
2431 {
2432 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2433 {
2434 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2435 }
2436 }
2437 }
2438 }
2439 {
2440 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2441
2442 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2443 {
2444 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2445 {
2446 if(!isMember && _class->type == 2 && dataMember->dataType)
2447 {
2448 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2449 uint64 mask = 0;
2450 int d;
2451
2452 ComputeTypeSize(dataMember->dataType);
2453 if(bitMember->pos == -1)
2454 bitMember->pos = _class->memberOffset;
2455 if(!bitMember->size)
2456 bitMember->size = dataMember->dataType->size * 8;
2457 _class->memberOffset = bitMember->pos + bitMember->size;
2458 for(d = 0; d < bitMember->size; d++)
2459 {
2460 if(d)
2461 mask <<= 1;
2462 mask |= 1;
2463 }
2464 bitMember->mask = mask << bitMember->pos;
2465 }
2466 else if(dataMember->type == 0 && dataMember->dataType)
2467 {
2468 int size;
2469 int alignment = 0;
2470
2471 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)))
2472 ComputeTypeSize(dataMember->dataType);
2473 if(dataMember->dataType->bitFieldCount)
2474 {
2475 bitFields += dataMember->dataType->bitFieldCount;
2476 size = 0;
2477 }
2478 else
2479 {
2480 if(bitFields)
2481 {
2482 int size = (bitFields + 7) / 8;
2483
2484 if(isMember)
2485 {
2486 int __simpleStruct0;
2487
2488 if(alignment)
2489 {
2490 int __simpleStruct0;
2491
2492 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2493 if(member->memberOffset % alignment)
2494 member->memberOffset += alignment - (member->memberOffset % alignment);
2495 }
2496 dataMember->offset = member->memberOffset;
2497 if(member->type == 1)
2498 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2499 else
2500 {
2501 member->memberOffset += size;
2502 }
2503 }
2504 else
2505 {
2506 if(alignment)
2507 {
2508 int __simpleStruct0;
2509
2510 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2511 if(_class->memberOffset % alignment)
2512 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2513 }
2514 dataMember->offset = _class->memberOffset;
2515 _class->memberOffset += size;
2516 }
2517 bitFields = 0;
2518 }
2519 size = dataMember->dataType->size;
2520 alignment = dataMember->dataType->alignment;
2521 }
2522 if(isMember)
2523 {
2524 int __simpleStruct0;
2525
2526 if(alignment)
2527 {
2528 int __simpleStruct0;
2529
2530 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2531 if(member->memberOffset % alignment)
2532 member->memberOffset += alignment - (member->memberOffset % alignment);
2533 }
2534 dataMember->offset = member->memberOffset;
2535 if(member->type == 1)
2536 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2537 else
2538 {
2539 member->memberOffset += size;
2540 }
2541 }
2542 else
2543 {
2544 if(alignment)
2545 {
2546 int __simpleStruct0;
2547
2548 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2549 if(_class->memberOffset % alignment)
2550 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2551 }
2552 dataMember->offset = _class->memberOffset;
2553 _class->memberOffset += size;
2554 }
2555 }
2556 else
2557 {
2558 int alignment;
2559
2560 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2561 alignment = dataMember->structAlignment;
2562 if(isMember)
2563 {
2564 int __simpleStruct0;
2565
2566 if(alignment)
2567 {
2568 int __simpleStruct0;
2569
2570 if(member->memberOffset % alignment)
2571 member->memberOffset += alignment - (member->memberOffset % alignment);
2572 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2573 }
2574 dataMember->offset = member->memberOffset;
2575 if(member->type == 1)
2576 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2577 else
2578 member->memberOffset += dataMember->memberOffset;
2579 }
2580 else
2581 {
2582 if(alignment)
2583 {
2584 int __simpleStruct0;
2585
2586 if(_class->memberOffset % alignment)
2587 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2588 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2589 }
2590 dataMember->offset = _class->memberOffset;
2591 _class->memberOffset += dataMember->memberOffset;
2592 }
2593 }
2594 }
2595 }
2596 if(bitFields)
2597 {
2598 int alignment = 0;
2599 int size = (bitFields + 7) / 8;
2600
2601 if(isMember)
2602 {
2603 int __simpleStruct0;
2604
2605 if(alignment)
2606 {
2607 int __simpleStruct0;
2608
2609 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2610 if(member->memberOffset % alignment)
2611 member->memberOffset += alignment - (member->memberOffset % alignment);
2612 }
2613 if(member->type == 1)
2614 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2615 else
2616 {
2617 member->memberOffset += size;
2618 }
2619 }
2620 else
2621 {
2622 if(alignment)
2623 {
2624 int __simpleStruct0;
2625
2626 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2627 if(_class->memberOffset % alignment)
2628 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2629 }
2630 _class->memberOffset += size;
2631 }
2632 bitFields = 0;
2633 }
2634 }
2635 if(member && member->type == 1)
2636 {
2637 member->memberOffset = unionMemberOffset;
2638 }
2639 if(!isMember)
2640 {
2641 if(_class->type != 2)
2642 {
2643 int extra = 0;
2644
2645 if(_class->structAlignment)
2646 {
2647 if(_class->memberOffset % _class->structAlignment)
2648 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2649 }
2650 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2651 if(!member)
2652 {
2653 struct __ecereNameSpace__ecere__com__Property * prop;
2654
2655 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2656 {
2657 if(prop->isProperty && prop->isWatchable)
2658 {
2659 prop->watcherOffset = _class->structSize;
2660 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2661 }
2662 }
2663 }
2664 {
2665 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2666
2667 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2668 {
2669 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2670
2671 if(deriv->computeSize)
2672 {
2673 deriv->offset = _class->structSize;
2674 deriv->memberOffset = 0;
2675 deriv->structSize = deriv->offset;
2676 ComputeClassMembers(deriv, 0x0);
2677 }
2678 }
2679 }
2680 }
2681 }
2682 }
2683 if(context)
2684 FinishTemplatesContext(context);
2685 }
2686
2687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2688
2689 struct __ecereNameSpace__ecere__com__NameSpace
2690 {
2691 const char *  name;
2692 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2693 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2694 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2695 int depth;
2696 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2697 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2698 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2699 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2700 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2701 } __attribute__ ((gcc_struct));
2702
2703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2704
2705 struct __ecereNameSpace__ecere__com__Module
2706 {
2707 struct __ecereNameSpace__ecere__com__Instance * application;
2708 struct __ecereNameSpace__ecere__sys__OldList classes;
2709 struct __ecereNameSpace__ecere__sys__OldList defines;
2710 struct __ecereNameSpace__ecere__sys__OldList functions;
2711 struct __ecereNameSpace__ecere__sys__OldList modules;
2712 struct __ecereNameSpace__ecere__com__Instance * prev;
2713 struct __ecereNameSpace__ecere__com__Instance * next;
2714 const char *  name;
2715 void *  library;
2716 void *  Unload;
2717 int importType;
2718 int origImportType;
2719 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2720 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2721 } __attribute__ ((gcc_struct));
2722
2723 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2724 {
2725 struct __ecereNameSpace__ecere__com__Class * _class;
2726 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2727
2728 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2729 ComputeModuleClasses(subModule->data);
2730 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2731 ComputeClassMembers(_class, 0x0);
2732 }
2733
2734 extern unsigned int inCompiler;
2735
2736 extern void Compiler_Error(const char *  format, ...);
2737
2738 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2739
2740 int ComputeTypeSize(struct Type * type)
2741 {
2742 unsigned int size = type ? type->size : 0;
2743
2744 if(!size && type && !type->computing)
2745 {
2746 type->computing = 0x1;
2747 switch(type->kind)
2748 {
2749 case 24:
2750 type->alignment = size = sizeof(char);
2751 break;
2752 case 1:
2753 type->alignment = size = sizeof(char);
2754 break;
2755 case 3:
2756 type->alignment = size = sizeof(int);
2757 break;
2758 case 4:
2759 type->alignment = size = sizeof(long long);
2760 break;
2761 case 22:
2762 type->alignment = size = targetBits / 8;
2763 break;
2764 case 23:
2765 type->alignment = size = targetBits / 8;
2766 break;
2767 case 5:
2768 type->alignment = size = sizeof(long);
2769 break;
2770 case 2:
2771 type->alignment = size = sizeof(short);
2772 break;
2773 case 6:
2774 type->alignment = size = sizeof(float);
2775 break;
2776 case 7:
2777 type->alignment = size = sizeof(double);
2778 break;
2779 case 8:
2780 {
2781 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2782
2783 if(_class && _class->type == 1)
2784 {
2785 ComputeClassMembers(_class, 0x0);
2786 type->alignment = _class->structAlignment;
2787 size = _class->structSize;
2788 if(type->alignment && size % type->alignment)
2789 size += type->alignment - (size % type->alignment);
2790 }
2791 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2792 {
2793 if(!_class->dataType)
2794 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2795 size = type->alignment = ComputeTypeSize(_class->dataType);
2796 }
2797 else
2798 size = type->alignment = targetBits / 8;
2799 break;
2800 }
2801 case 13:
2802 case 19:
2803 size = type->alignment = targetBits / 8;
2804 break;
2805 case 12:
2806 if(type->__anon1.__anon4.arraySizeExp)
2807 {
2808 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2809 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2810 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)))
2811 {
2812 struct Location oldLoc = yylloc;
2813 char expression[10240];
2814
2815 expression[0] = '\0';
2816 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2817 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2818 if(inCompiler)
2819 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2820 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2821 yylloc = oldLoc;
2822 }
2823 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2824 }
2825 else if(type->__anon1.__anon4.enumClass)
2826 {
2827 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2828 {
2829 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2830 }
2831 else
2832 type->__anon1.__anon4.arraySize = 0;
2833 }
2834 else
2835 {
2836 type->__anon1.__anon4.arraySize = 0;
2837 }
2838 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2839 if(type->__anon1.type)
2840 type->alignment = type->__anon1.type->alignment;
2841 break;
2842 case 9:
2843 {
2844 struct Type * member;
2845
2846 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2847 {
2848 int __simpleStruct0, __simpleStruct1;
2849 unsigned int addSize = ComputeTypeSize(member);
2850
2851 member->offset = size;
2852 if(member->alignment && size % member->alignment)
2853 member->offset += member->alignment - (size % member->alignment);
2854 size = member->offset;
2855 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2856 size += addSize;
2857 }
2858 if(type->alignment && size % type->alignment)
2859 size += type->alignment - (size % type->alignment);
2860 break;
2861 }
2862 case 10:
2863 {
2864 struct Type * member;
2865
2866 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2867 {
2868 int __simpleStruct0, __simpleStruct1;
2869 unsigned int addSize = ComputeTypeSize(member);
2870
2871 member->offset = size;
2872 if(member->alignment && size % member->alignment)
2873 member->offset += member->alignment - (size % member->alignment);
2874 size = member->offset;
2875 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2876 size = ((size > addSize) ? size : addSize);
2877 }
2878 if(type->alignment && size % type->alignment)
2879 size += type->alignment - (size % type->alignment);
2880 break;
2881 }
2882 case 20:
2883 {
2884 struct TemplateParameter * param = type->__anon1.templateParameter;
2885 struct Type * baseType = ProcessTemplateParameterType(param);
2886
2887 if(baseType)
2888 {
2889 size = ComputeTypeSize(baseType);
2890 type->alignment = baseType->alignment;
2891 }
2892 else
2893 type->alignment = size = sizeof(uint64);
2894 break;
2895 }
2896 case 15:
2897 {
2898 type->alignment = size = sizeof(enum
2899 {
2900 test
2901 });
2902 break;
2903 }
2904 case 21:
2905 {
2906 type->alignment = size = targetBits / 8;
2907 break;
2908 }
2909 }
2910 type->size = size;
2911 type->computing = 0x0;
2912 }
2913 return size;
2914 }
2915
2916 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2917
2918 extern struct Identifier * MkIdentifier(const char *  string);
2919
2920 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2921
2922 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2923
2924 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2925
2926 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2927
2928 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2929
2930 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2931
2932 extern void FreeType(struct Type * type);
2933
2934 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2935
2936 extern struct Specifier * MkSpecifier(int specifier);
2937
2938 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2939
2940 extern struct Expression * MkExpConstant(const char *  string);
2941
2942 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)
2943 {
2944 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2945 unsigned int totalSize = 0;
2946 unsigned int maxSize = 0;
2947 int alignment;
2948 unsigned int size;
2949 struct __ecereNameSpace__ecere__com__DataMember * member;
2950 int anonID = 1;
2951 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2952
2953 if(addedPadding)
2954 *addedPadding = 0x0;
2955 if(!isMember && _class->base)
2956 {
2957 maxSize = _class->structSize;
2958 {
2959 if(_class->type == 1 || _class->type == 5)
2960 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2961 else
2962 {
2963 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2964
2965 if(maxSize > baseSize)
2966 maxSize -= baseSize;
2967 else
2968 maxSize = 0;
2969 }
2970 }
2971 }
2972 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2973 {
2974 if(!member->isProperty)
2975 {
2976 switch(member->type)
2977 {
2978 case 0:
2979 {
2980 if(member->dataTypeString)
2981 {
2982 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2983 struct Declarator * decl;
2984
2985 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2986 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2987 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2988 if(!member->dataType)
2989 member->dataType = ProcessType(specs, decl);
2990 ReplaceThisClassSpecifiers(specs, topClass);
2991 {
2992 struct Type * type = ProcessType(specs, decl);
2993
2994 DeclareType(member->dataType, 0x0, 0x0);
2995 FreeType(type);
2996 }
2997 ComputeTypeSize(member->dataType);
2998 size = member->dataType->size;
2999 alignment = member->dataType->alignment;
3000 if(alignment)
3001 {
3002 if(totalSize % alignment)
3003 totalSize += alignment - (totalSize % alignment);
3004 }
3005 totalSize += size;
3006 }
3007 break;
3008 }
3009 case 1:
3010 case 2:
3011 {
3012 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3013 char id[100];
3014
3015 sprintf(id, "__anon%d", anonID++);
3016 size = 0;
3017 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3018 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3019 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3020 alignment = member->structAlignment;
3021 if(alignment)
3022 {
3023 if(totalSize % alignment)
3024 totalSize += alignment - (totalSize % alignment);
3025 }
3026 totalSize += size;
3027 break;
3028 }
3029 }
3030 }
3031 }
3032 if(retSize)
3033 {
3034 unsigned int __simpleStruct0;
3035
3036 if(topMember && topMember->type == 1)
3037 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3038 else
3039 *retSize += totalSize;
3040 }
3041 else if(totalSize < maxSize && _class->type != 1000)
3042 {
3043 int autoPadding = 0;
3044
3045 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3046 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3047 if(totalSize + autoPadding < maxSize)
3048 {
3049 char sizeString[50];
3050
3051 sprintf(sizeString, "%d", maxSize - totalSize);
3052 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3053 if(addedPadding)
3054 *addedPadding = 0x1;
3055 }
3056 }
3057 if(context)
3058 FinishTemplatesContext(context);
3059 return topMember ? topMember->memberID : _class->memberID;
3060 }
3061
3062 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3063 {
3064 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3065 struct __ecereNameSpace__ecere__com__DataMember * member;
3066 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3067
3068 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3069 DeclareMembers(_class->base, 0x0);
3070 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3071 {
3072 if(!member->isProperty)
3073 {
3074 switch(member->type)
3075 {
3076 case 0:
3077 {
3078 if(!member->dataType && member->dataTypeString)
3079 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3080 if(member->dataType)
3081 DeclareType(member->dataType, 0x0, 0x0);
3082 break;
3083 }
3084 case 1:
3085 case 2:
3086 {
3087 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3088 break;
3089 }
3090 }
3091 }
3092 }
3093 if(context)
3094 FinishTemplatesContext(context);
3095 return topMember ? topMember->memberID : _class->memberID;
3096 }
3097
3098 extern struct Identifier * GetDeclId(struct Declarator * decl);
3099
3100 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3101 {
3102 struct ClassDef * def;
3103 int anonID = 1;
3104
3105 for(def = (*definitions).first; def; def = def->next)
3106 {
3107 if(def->type == 2)
3108 {
3109 struct Declaration * decl = def->__anon1.decl;
3110
3111 if(decl && decl->__anon1.__anon1.specifiers)
3112 {
3113 struct Specifier * spec;
3114 unsigned int isStruct = 0x0;
3115
3116 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3117 {
3118 if(spec->type == 3 || spec->type == 4)
3119 {
3120 if(spec->__anon1.__anon2.definitions)
3121 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3122 isStruct = 0x1;
3123 }
3124 }
3125 if(isStruct)
3126 {
3127 struct Declarator * d = (((void *)0));
3128
3129 if(decl->__anon1.__anon1.declarators)
3130 {
3131 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3132 {
3133 struct Identifier * idDecl = GetDeclId(d);
3134
3135 if(idDecl)
3136 break;
3137 }
3138 }
3139 if(!d)
3140 {
3141 char id[100];
3142
3143 sprintf(id, "__anon%d", anonID++);
3144 if(!decl->__anon1.__anon1.declarators)
3145 decl->__anon1.__anon1.declarators = MkList();
3146 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3147 }
3148 }
3149 }
3150 }
3151 }
3152 }
3153
3154 extern struct Symbol * FindClass(const char *  name);
3155
3156 extern char *  strchr(const char * , int);
3157
3158 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3159
3160 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3161
3162 extern void FreeClassDef(struct ClassDef * def);
3163
3164 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3165
3166 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3167
3168 extern void MangleClassName(char *  className);
3169
3170 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3171
3172 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3173
3174 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3175
3176 void DeclareStruct(const char * name, unsigned int skipNoHead)
3177 {
3178 struct External * external = (((void *)0));
3179 struct Symbol * classSym = FindClass(name);
3180
3181 if(!inCompiler || !classSym)
3182 return ;
3183 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3184 return ;
3185 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3186 {
3187 struct Declaration * decl;
3188 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3189 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3190 char structName[1024];
3191 struct Specifier * spec = (((void *)0));
3192
3193 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3194 classSym->declaring++;
3195 if(strchr(classSym->string, '<'))
3196 {
3197 if(classSym->__anon1.registered->templateClass)
3198 {
3199 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3200 classSym->declaring--;
3201 }
3202 return ;
3203 }
3204 DeclareMembers(classSym->__anon1.registered, 0x0);
3205 structName[0] = (char)0;
3206 FullClassNameCat(structName, name, 0x0);
3207 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3208 {
3209 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3210 {
3211 if(spec->type == 3 || spec->type == 4)
3212 break;
3213 }
3214 }
3215 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3216 {
3217 unsigned int addedPadding = 0x0;
3218
3219 classSym->declaredStructSym = 0x1;
3220 declarations = MkList();
3221 AddMembers(declarations, classSym->__anon1.registered, 0x0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3222 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3223 {
3224 FreeList(declarations, FreeClassDef);
3225 declarations = (((void *)0));
3226 }
3227 }
3228 if(skipNoHead || declarations)
3229 {
3230 if(spec)
3231 {
3232 if(declarations)
3233 spec->__anon1.__anon2.definitions = declarations;
3234 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3235 {
3236 if(classSym->__anon2.__anon1.structExternal)
3237 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3239 classSym->id = curExternal->symbol->idCode;
3240 classSym->idCode = curExternal->symbol->idCode;
3241 }
3242 }
3243 else
3244 {
3245 if(!external)
3246 external = MkExternalDeclaration((((void *)0)));
3247 specifiers = MkList();
3248 declarators = MkList();
3249 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3250 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3251 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3252 decl->symbol->__anon2.__anon1.pointerExternal = external;
3253 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3254 {
3255 char className[1024];
3256
3257 strcpy(className, "__ecereClass_");
3258 FullClassNameCat(className, classSym->string, 0x1);
3259 MangleClassName(className);
3260 DeclareClass(classSym, className);
3261 external->symbol = classSym;
3262 classSym->__anon2.__anon1.pointerExternal = external;
3263 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3264 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3265 }
3266 else
3267 {
3268 char className[1024];
3269
3270 strcpy(className, "__ecereClass_");
3271 FullClassNameCat(className, classSym->string, 0x1);
3272 MangleClassName(className);
3273 classSym->__anon2.__anon1.structExternal = external;
3274 DeclareClass(classSym, className);
3275 external->symbol = classSym;
3276 }
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3278 }
3279 }
3280 classSym->declaring--;
3281 }
3282 else
3283 {
3284 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3285 {
3286 struct Specifier * spec;
3287
3288 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3289 {
3290 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3291 }
3292 }
3293 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3294 {
3295 classSym->declaring++;
3296 {
3297 if(classSym->__anon1.registered)
3298 DeclareMembers(classSym->__anon1.registered, 0x0);
3299 }
3300 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3301 {
3302 if(classSym->__anon2.__anon1.structExternal)
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3305 classSym->id = curExternal->symbol->idCode;
3306 classSym->idCode = curExternal->symbol->idCode;
3307 }
3308 classSym->declaring--;
3309 }
3310 }
3311 }
3312
3313 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3314
3315 extern struct ModuleImport * mainModule;
3316
3317 extern struct Specifier * MkSpecifierName(const char *  name);
3318
3319 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3320
3321 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3322
3323 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3324
3325 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3326
3327 extern void FreeDeclarator(struct Declarator * decl);
3328
3329 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3330
3331 struct PropertyImport
3332 {
3333 struct PropertyImport * prev;
3334 struct PropertyImport * next;
3335 char *  name;
3336 unsigned int isVirtual;
3337 unsigned int hasSet;
3338 unsigned int hasGet;
3339 } __attribute__ ((gcc_struct));
3340
3341 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3342
3343 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3344 {
3345 struct Symbol * symbol = prop->symbol;
3346
3347 strcpy(setName, "__ecereProp_");
3348 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3349 strcat(setName, "_Set_");
3350 FullClassNameCat(setName, prop->name, 0x1);
3351 MangleClassName(setName);
3352 strcpy(getName, "__ecereProp_");
3353 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3354 strcat(getName, "_Get_");
3355 FullClassNameCat(getName, prop->name, 0x1);
3356 MangleClassName(getName);
3357 if(prop->_class->type == 1)
3358 DeclareStruct(prop->_class->fullName, 0x0);
3359 if(!symbol || curExternal->symbol->idCode < symbol->id)
3360 {
3361 unsigned int imported = 0x0;
3362 unsigned int dllImport = 0x0;
3363
3364 if(!symbol || symbol->_import)
3365 {
3366 if(!symbol)
3367 {
3368 struct Symbol * classSym;
3369
3370 if(!prop->_class->symbol)
3371 prop->_class->symbol = FindClass(prop->_class->fullName);
3372 classSym = prop->_class->symbol;
3373 if(classSym && !classSym->_import)
3374 {
3375 struct ModuleImport * module;
3376
3377 if(prop->_class->module)
3378 module = FindModule(prop->_class->module);
3379 else
3380 module = mainModule;
3381 classSym->_import = __extension__ ({
3382 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3383
3384 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3385 });
3386 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3387 }
3388 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3389 symbol->_import = (struct ClassImport *)__extension__ ({
3390 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3391
3392 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3393 });
3394 if(classSym)
3395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3396 }
3397 imported = 0x1;
3398 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)
3399 dllImport = 0x1;
3400 }
3401 if(!symbol->type)
3402 {
3403 struct Context * context = SetupTemplatesContext(prop->_class);
3404
3405 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3406 FinishTemplatesContext(context);
3407 }
3408 if(prop->Get)
3409 {
3410 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3411 {
3412 struct Declaration * decl;
3413 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3414 struct Declarator * d;
3415 struct __ecereNameSpace__ecere__sys__OldList * params;
3416 struct Specifier * spec;
3417 struct External * external;
3418 struct Declarator * typeDecl;
3419 unsigned int simple = 0x0;
3420
3421 specifiers = MkList();
3422 declarators = MkList();
3423 params = MkList();
3424 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3425 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3426 if(dllImport)
3427 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3428 {
3429 struct Context * context = SetupTemplatesContext(prop->_class);
3430
3431 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3432 FinishTemplatesContext(context);
3433 }
3434 for(spec = (*specifiers).first; spec; spec = spec->next)
3435 {
3436 if(spec->type == 1)
3437 {
3438 if((!typeDecl || typeDecl->type == 1))
3439 {
3440 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3441
3442 symbol->_class = classSym->__anon1.registered;
3443 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3444 {
3445 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3446 simple = 0x1;
3447 }
3448 }
3449 }
3450 }
3451 if(!simple)
3452 d = PlugDeclarator(typeDecl, d);
3453 else
3454 {
3455 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3456 specifiers = MkList();
3457 }
3458 d = MkDeclaratorFunction(d, params);
3459 if(dllImport)
3460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3461 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3463 if(simple)
3464 ListAdd(specifiers, MkSpecifier(VOID));
3465 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3466 decl = MkDeclaration(specifiers, declarators);
3467 external = MkExternalDeclaration(decl);
3468 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3469 external->symbol = symbol;
3470 symbol->__anon2.__anon2.externalGet = external;
3471 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3472 if(typeDecl)
3473 FreeDeclarator(typeDecl);
3474 }
3475 else
3476 {
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3478 }
3479 }
3480 if(prop->Set)
3481 {
3482 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3483 {
3484 struct Declaration * decl;
3485 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3486 struct Declarator * d;
3487 struct __ecereNameSpace__ecere__sys__OldList * params;
3488 struct Specifier * spec;
3489 struct External * external;
3490 struct Declarator * typeDecl;
3491
3492 declarators = MkList();
3493 params = MkList();
3494 if(!prop->conversion || prop->_class->type == 1)
3495 {
3496 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3497 }
3498 specifiers = MkList();
3499 {
3500 struct Context * context = SetupTemplatesContext(prop->_class);
3501
3502 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3503 FinishTemplatesContext(context);
3504 }
3505 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3507 ListAdd(params, MkTypeName(specifiers, d));
3508 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3509 if(dllImport)
3510 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3511 d = MkDeclaratorFunction(d, params);
3512 for(spec = (*specifiers).first; spec; spec = spec->next)
3513 {
3514 if(spec->type == 1)
3515 {
3516 if((!typeDecl || typeDecl->type == 1))
3517 {
3518 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3519
3520 symbol->_class = classSym->__anon1.registered;
3521 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3522 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
3523 }
3524 }
3525 }
3526 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3527 specifiers = MkList();
3528 if(dllImport)
3529 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3530 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3532 if(!prop->conversion || prop->_class->type == 1)
3533 ListAdd(specifiers, MkSpecifier(VOID));
3534 else
3535 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3536 decl = MkDeclaration(specifiers, declarators);
3537 external = MkExternalDeclaration(decl);
3538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3539 external->symbol = symbol;
3540 symbol->__anon2.__anon2.externalSet = external;
3541 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3542 }
3543 else
3544 {
3545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3546 }
3547 }
3548 if(!symbol->__anon2.__anon2.externalPtr)
3549 {
3550 struct Declaration * decl;
3551 struct External * external;
3552 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3553 char propName[1024];
3554
3555 if(imported)
3556 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3557 else
3558 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3559 ListAdd(specifiers, MkSpecifierName("Property"));
3560 strcpy(propName, "__ecereProp_");
3561 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3562 strcat(propName, "_");
3563 FullClassNameCat(propName, prop->name, 0x1);
3564 MangleClassName(propName);
3565 {
3566 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3567
3568 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3569 if(!imported)
3570 {
3571 strcpy(propName, "__ecerePropM_");
3572 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3573 strcat(propName, "_");
3574 FullClassNameCat(propName, prop->name, 0x1);
3575 MangleClassName(propName);
3576 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3577 }
3578 decl = MkDeclaration(specifiers, list);
3579 }
3580 external = MkExternalDeclaration(decl);
3581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3582 external->symbol = symbol;
3583 symbol->__anon2.__anon2.externalPtr = external;
3584 }
3585 else
3586 {
3587 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3588 }
3589 symbol->id = curExternal->symbol->idCode;
3590 }
3591 }
3592
3593 struct Type * Dereference(struct Type * source)
3594 {
3595 struct Type * type = (((void *)0));
3596
3597 if(source)
3598 {
3599 if(source->kind == 13 || source->kind == 12)
3600 {
3601 type = source->__anon1.type;
3602 source->__anon1.type->refCount++;
3603 }
3604 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3605 {
3606 type = __extension__ ({
3607 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3608
3609 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3610 });
3611 }
3612 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3613 {
3614 type = source;
3615 source->refCount++;
3616 }
3617 else
3618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3619 }
3620 return type;
3621 }
3622
3623 static struct Type * Reference(struct Type * source)
3624 {
3625 struct Type * type = (((void *)0));
3626
3627 if(source)
3628 {
3629 type = __extension__ ({
3630 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3631
3632 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3633 });
3634 source->refCount++;
3635 }
3636 return type;
3637 }
3638
3639 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
3640
3641 extern void *  memcpy(void * , const void * , size_t size);
3642
3643 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3644
3645 extern void FreeExpression(struct Expression * exp);
3646
3647 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3648
3649 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst);
3650
3651 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3652
3653 extern struct Type * MkClassType(const char *  name);
3654
3655 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
3656
3657 void ProcessMemberInitData(struct MemberInit * member, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
3658 {
3659 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3660 unsigned int found = 0x0;
3661 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3662 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3663 unsigned int freeType = 0x0;
3664
3665 yylloc = member->loc;
3666 if(!ident)
3667 {
3668 if(curMember)
3669 {
3670 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3671 if(*curMember)
3672 {
3673 found = 0x1;
3674 dataMember = *curMember;
3675 }
3676 }
3677 }
3678 else
3679 {
3680 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3681 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3682 int _subMemberStackPos = 0;
3683
3684 if(!thisMember)
3685 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3686 if(thisMember)
3687 {
3688 dataMember = thisMember;
3689 if(curMember && thisMember->memberAccess == 1)
3690 {
3691 *curMember = thisMember;
3692 *curClass = thisMember->_class;
3693 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3694 *subMemberStackPos = _subMemberStackPos;
3695 }
3696 found = 0x1;
3697 }
3698 else
3699 {
3700 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3701 if(method && method->type == 1)
3702 found = 0x1;
3703 else
3704 method = (((void *)0));
3705 }
3706 }
3707 if(found)
3708 {
3709 struct Type * type = (((void *)0));
3710
3711 if(dataMember)
3712 {
3713 if(!dataMember->dataType && dataMember->dataTypeString)
3714 {
3715 struct Context * context = SetupTemplatesContext(_class);
3716
3717 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3718 FinishTemplatesContext(context);
3719 }
3720 type = dataMember->dataType;
3721 }
3722 else if(method)
3723 {
3724 if(!method->dataType)
3725 ProcessMethodType(method);
3726 type = method->dataType;
3727 }
3728 if(ident && ident->next)
3729 {
3730 for(ident = ident->next; ident && type; ident = ident->next)
3731 {
3732 if(type->kind == 8)
3733 {
3734 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3735 if(!dataMember)
3736 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3737 if(dataMember)
3738 type = dataMember->dataType;
3739 }
3740 else if(type->kind == 9 || type->kind == 10)
3741 {
3742 struct Type * memberType;
3743
3744 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3745 {
3746 if(!strcmp(memberType->name, ident->string))
3747 {
3748 type = memberType;
3749 break;
3750 }
3751 }
3752 }
3753 }
3754 }
3755 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3756 {
3757 int id = 0;
3758 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3759 struct __ecereNameSpace__ecere__com__Class * sClass;
3760
3761 for(sClass = _class; sClass; sClass = sClass->base)
3762 {
3763 id = 0;
3764 if(sClass->templateClass)
3765 sClass = sClass->templateClass;
3766 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3767 {
3768 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3769 {
3770 for(sClass = sClass->base; sClass; sClass = sClass->base)
3771 {
3772 if(sClass->templateClass)
3773 sClass = sClass->templateClass;
3774 id += sClass->templateParams.count;
3775 }
3776 break;
3777 }
3778 id++;
3779 }
3780 if(curParam)
3781 break;
3782 }
3783 if(curParam)
3784 {
3785 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3786
3787 if(arg.__anon1.__anon1.dataTypeString)
3788 {
3789 unsigned int constant = type->constant;
3790
3791 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
3792 if(type->kind == 8 && constant)
3793 type->constant = 0x1;
3794 else if(type->kind == 13)
3795 {
3796 struct Type * t = type->__anon1.type;
3797
3798 while(t->kind == 13)
3799 t = t->__anon1.type;
3800 if(constant)
3801 t->constant = constant;
3802 }
3803 freeType = 0x1;
3804 if(type && _class->templateClass)
3805 type->passAsTemplate = 0x1;
3806 if(type)
3807 {
3808 }
3809 }
3810 }
3811 }
3812 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3813 {
3814 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3815 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3816 int c;
3817 int paramCount = 0;
3818 int lastParam = -1;
3819 char templateString[1024];
3820 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3821
3822 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3823 for(cClass = expClass; cClass; cClass = cClass->base)
3824 {
3825 int p = 0;
3826
3827 if(cClass->templateClass)
3828 cClass = cClass->templateClass;
3829 for(param = cClass->templateParams.first; param; param = param->next)
3830 {
3831 int id = p;
3832 struct __ecereNameSpace__ecere__com__Class * sClass;
3833 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3834
3835 for(sClass = cClass->base; sClass; sClass = sClass->base)
3836 {
3837 if(sClass->templateClass)
3838 sClass = sClass->templateClass;
3839 id += sClass->templateParams.count;
3840 }
3841 arg = expClass->templateArgs[id];
3842 for(sClass = _class; sClass; sClass = sClass->base)
3843 {
3844 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3845 int p = 0;
3846 struct __ecereNameSpace__ecere__com__Class * nextClass;
3847
3848 if(sClass->templateClass)
3849 sClass = sClass->templateClass;
3850 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3851 {
3852 if(nextClass->templateClass)
3853 nextClass = nextClass->templateClass;
3854 p += nextClass->templateParams.count;
3855 }
3856 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3857 {
3858 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3859 {
3860 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3861 {
3862 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3863 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3864 break;
3865 }
3866 }
3867 }
3868 }
3869 {
3870 char argument[256];
3871
3872 argument[0] = '\0';
3873 switch(param->type)
3874 {
3875 case 2:
3876 {
3877 char expString[1024];
3878 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3879 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3880 struct Expression * exp;
3881 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3882
3883 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3884 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3885 ProcessExpressionType(exp);
3886 ComputeExpression(exp);
3887 expString[0] = '\0';
3888 PrintExpression(exp, expString);
3889 strcat(argument, expString);
3890 FreeExpression(exp);
3891 break;
3892 }
3893 case 1:
3894 {
3895 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3896 break;
3897 }
3898 case 0:
3899 {
3900 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3901 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3902 break;
3903 }
3904 }
3905 if(argument[0])
3906 {
3907 if(paramCount)
3908 strcat(templateString, ", ");
3909 if(lastParam != p - 1)
3910 {
3911 strcat(templateString, param->name);
3912 strcat(templateString, " = ");
3913 }
3914 strcat(templateString, argument);
3915 paramCount++;
3916 lastParam = p;
3917 }
3918 p++;
3919 }
3920 }
3921 }
3922 {
3923 int len = strlen(templateString);
3924
3925 if(templateString[len - 1] == '<')
3926 len--;
3927 else
3928 {
3929 if(templateString[len - 1] == '>')
3930 templateString[len++] = ' ';
3931 templateString[len++] = '>';
3932 }
3933 templateString[len++] = '\0';
3934 }
3935 {
3936 struct Context * context = SetupTemplatesContext(_class);
3937
3938 if(freeType)
3939 FreeType(type);
3940 type = ProcessTypeString(templateString, 0x0);
3941 freeType = 0x1;
3942 FinishTemplatesContext(context);
3943 }
3944 }
3945 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3946 {
3947 ProcessExpressionType(member->initializer->__anon1.exp);
3948 if(!member->initializer->__anon1.exp->expType)
3949 {
3950 if(inCompiler)
3951 {
3952 char expString[10240];
3953
3954 expString[0] = '\0';
3955 PrintExpression(member->initializer->__anon1.exp, expString);
3956 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3958 }
3959 }
3960 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0, 0x1))
3961 {
3962 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3963 }
3964 }
3965 else if(member->initializer)
3966 {
3967 ProcessInitializer(member->initializer, type);
3968 }
3969 if(freeType)
3970 FreeType(type);
3971 }
3972 else
3973 {
3974 if(_class && _class->type == 3)
3975 {
3976 if(member->initializer)
3977 {
3978 struct Type * type = MkClassType(_class->fullName);
3979
3980 ProcessInitializer(member->initializer, type);
3981 FreeType(type);
3982 }
3983 }
3984 else
3985 {
3986 if(member->initializer)
3987 {
3988 ProcessInitializer(member->initializer, (((void *)0)));
3989 }
3990 if(ident)
3991 {
3992 if(method)
3993 {
3994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3995 }
3996 else if(_class)
3997 {
3998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3999 if(inCompiler)
4000 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4001 }
4002 }
4003 else if(_class)
4004 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4005 }
4006 }
4007 }
4008
4009 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);
4010
4011 extern void FreeSpecifier(struct Specifier * spec);
4012
4013 static void ProcessFunction(struct FunctionDefinition * function);
4014
4015 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4016
4017 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4018
4019 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4020
4021 extern void FreeClassFunction(struct ClassFunction * func);
4022
4023 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4024
4025 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4026
4027 void ProcessInstantiationType(struct Instantiation * inst)
4028 {
4029 yylloc = inst->loc;
4030 if(inst->_class)
4031 {
4032 struct MembersInit * members;
4033 struct Symbol * classSym;
4034 struct __ecereNameSpace__ecere__com__Class * _class;
4035
4036 classSym = inst->_class->__anon1.__anon1.symbol;
4037 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4038 if(!_class || _class->type != 5)
4039 DeclareStruct(inst->_class->__anon1.__anon1.name, 0x0);
4040 afterExternal = afterExternal ? afterExternal : curExternal;
4041 if(inst->exp)
4042 ProcessExpressionType(inst->exp);
4043 inst->isConstant = 0x1;
4044 if(inst->members)
4045 {
4046 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4047 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4048 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4049 int subMemberStackPos = 0;
4050
4051 for(members = (*inst->members).first; members; members = members->next)
4052 {
4053 switch(members->type)
4054 {
4055 case 1:
4056 {
4057 char name[1024];
4058 static unsigned int instMethodID = 0;
4059 struct External * external = curExternal;
4060 struct Context * context = curContext;
4061 struct Declarator * declarator = members->__anon1.function->declarator;
4062 struct Identifier * nameID = GetDeclId(declarator);
4063 char * unmangled = nameID ? nameID->string : (((void *)0));
4064 struct Expression * exp;
4065 struct External * createdExternal = (((void *)0));
4066
4067 if(inCompiler)
4068 {
4069 char number[16];
4070
4071 strcpy(name, "__ecereInstMeth_");
4072 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
4073 strcat(name, "_");
4074 strcat(name, nameID->string);
4075 strcat(name, "_");
4076 sprintf(number, "_%08d", instMethodID++);
4077 strcat(name, number);
4078 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4079 }
4080 if(declarator)
4081 {
4082 struct Symbol * symbol = declarator->symbol;
4083 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4084
4085 if(method && method->type == 1)
4086 {
4087 symbol->__anon1.method = method;
4088 ProcessMethodType(method);
4089 if(!symbol->type->__anon1.__anon2.thisClass)
4090 {
4091 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4092 {
4093 if(!currentClass->symbol)
4094 currentClass->symbol = FindClass(currentClass->fullName);
4095 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4096 }
4097 else
4098 {
4099 if(!_class->symbol)
4100 _class->symbol = FindClass(_class->fullName);
4101 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4102 }
4103 }
4104 DeclareType(symbol->type, 0x1, 0x1);
4105 }
4106 else if(classSym)
4107 {
4108 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4109 }
4110 }
4111 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 0x1);
4112 if(nameID)
4113 {
4114 FreeSpecifier(nameID->_class);
4115 nameID->_class = (((void *)0));
4116 }
4117 if(inCompiler)
4118 {
4119 struct External * oldExternal = curExternal;
4120
4121 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4122 {
4123 struct External * externalDecl;
4124
4125 externalDecl = MkExternalDeclaration((((void *)0)));
4126 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4127 if(createdExternal->__anon1.function)
4128 {
4129 ProcessFunction(createdExternal->__anon1.function);
4130 {
4131 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4132
4133 externalDecl->__anon1.declaration = decl;
4134 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4135 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4136 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4137 }
4138 }
4139 }
4140 }
4141 else if(declarator)
4142 {
4143 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4144 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4145 }
4146 curExternal = external;
4147 curContext = context;
4148 if(inCompiler)
4149 {
4150 FreeClassFunction(members->__anon1.function);
4151 exp = QMkExpId(name);
4152 members->type = 0;
4153 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4154 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4155 }
4156 break;
4157 }
4158 case 0:
4159 {
4160 if(members->__anon1.dataMembers && classSym)
4161 {
4162 struct MemberInit * member;
4163 struct Location oldyyloc = yylloc;
4164
4165 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4166 {
4167 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4168 if(member->initializer && !member->initializer->isConstant)
4169 inst->isConstant = 0x0;
4170 }
4171 yylloc = oldyyloc;
4172 }
4173 break;
4174 }
4175 }
4176 }
4177 }
4178 }
4179 }
4180
4181 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4182 {
4183 if(inCompiler)
4184 {
4185 if(type->kind == 11)
4186 {
4187 struct Type * param;
4188
4189 if(declareParams)
4190 {
4191 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4192 DeclareType(param, declarePointers, 0x1);
4193 }
4194 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 0x1);
4195 }
4196 else if(type->kind == 13 && declarePointers)
4197 DeclareType(type->__anon1.type, declarePointers, 0x0);
4198 else if(type->kind == 8)
4199 {
4200 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4201 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4202 }
4203 else if(type->kind == 9 || type->kind == 10)
4204 {
4205 struct Type * member;
4206
4207 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4208 DeclareType(member, 0x0, 0x0);
4209 }
4210 else if(type->kind == 12)
4211 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0x0);
4212 }
4213 }
4214
4215 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4216
4217 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4218 {
4219 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4220 int id = 0;
4221 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4222 struct __ecereNameSpace__ecere__com__Class * sClass;
4223
4224 for(sClass = _class; sClass; sClass = sClass->base)
4225 {
4226 id = 0;
4227 if(sClass->templateClass)
4228 sClass = sClass->templateClass;
4229 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4230 {
4231 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4232 {
4233 for(sClass = sClass->base; sClass; sClass = sClass->base)
4234 {
4235 if(sClass->templateClass)
4236 sClass = sClass->templateClass;
4237 id += sClass->templateParams.count;
4238 }
4239 break;
4240 }
4241 id++;
4242 }
4243 if(curParam)
4244 break;
4245 }
4246 if(curParam)
4247 {
4248 arg = &_class->templateArgs[id];
4249 if(arg && param->type == 0)
4250 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4251 }
4252 return arg;
4253 }
4254
4255 extern struct Context * PushContext(void);
4256
4257 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4258
4259 struct TemplatedType
4260 {
4261 uintptr_t key;
4262 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4263 struct __ecereNameSpace__ecere__sys__BTNode * left;
4264 struct __ecereNameSpace__ecere__sys__BTNode * right;
4265 int depth;
4266 struct TemplateParameter * param;
4267 } __attribute__ ((gcc_struct));
4268
4269 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4270
4271 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4272 {
4273 struct Context * context = PushContext();
4274
4275 context->templateTypesOnly = 0x1;
4276 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4277 {
4278 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4279
4280 for(; param; param = param->next)
4281 {
4282 if(param->type == 0 && param->identifier)
4283 {
4284 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4285
4286 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4287 }
4288 }
4289 }
4290 else if(_class)
4291 {
4292 struct __ecereNameSpace__ecere__com__Class * sClass;
4293
4294 for(sClass = _class; sClass; sClass = sClass->base)
4295 {
4296 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4297
4298 for(p = sClass->templateParams.first; p; p = p->next)
4299 {
4300 if(p->type == 0)
4301 {
4302 struct TemplateParameter * param = p->param;
4303 struct TemplatedType * type;
4304
4305 if(!param)
4306 {
4307 p->param = param = __extension__ ({
4308 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4309
4310 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4311 });
4312 }
4313 type = __extension__ ({
4314 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4315
4316 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4317 });
4318 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4319 }
4320 }
4321 }
4322 }
4323 return context;
4324 }
4325
4326 extern void PopContext(struct Context * ctx);
4327
4328 extern void FreeContext(struct Context * context);
4329
4330 void FinishTemplatesContext(struct Context * context)
4331 {
4332 PopContext(context);
4333 FreeContext(context);
4334 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4335 }
4336
4337 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4338 {
4339 if(!method->dataType)
4340 {
4341 struct Context * context = SetupTemplatesContext(method->_class);
4342
4343 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4344 FinishTemplatesContext(context);
4345 if(method->type != 1 && method->dataType)
4346 {
4347 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4348 {
4349 if(!method->_class->symbol)
4350 method->_class->symbol = FindClass(method->_class->fullName);
4351 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4352 }
4353 }
4354 }
4355 }
4356
4357 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4358 {
4359 if(!prop->dataType)
4360 {
4361 struct Context * context = SetupTemplatesContext(prop->_class);
4362
4363 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4364 FinishTemplatesContext(context);
4365 }
4366 }
4367
4368 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4369
4370 extern void FreeTypeName(struct TypeName * typeName);
4371
4372 static void ProcessDeclarator(struct Declarator * decl);
4373
4374 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4375
4376 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4377
4378 struct MethodImport
4379 {
4380 struct MethodImport * prev;
4381 struct MethodImport * next;
4382 char *  name;
4383 unsigned int isVirtual;
4384 } __attribute__ ((gcc_struct));
4385
4386 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4387
4388 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4389 {
4390 struct Symbol * symbol = method->symbol;
4391
4392 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4393 {
4394 unsigned int imported = 0x0;
4395 unsigned int dllImport = 0x0;
4396
4397 if(!method->dataType)
4398 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4399 if(!symbol || symbol->_import || method->type == 1)
4400 {
4401 if(!symbol || method->type == 1)
4402 {
4403 struct Symbol * classSym;
4404
4405 if(!method->_class->symbol)
4406 method->_class->symbol = FindClass(method->_class->fullName);
4407 classSym = method->_class->symbol;
4408 if(!classSym->_import)
4409 {
4410 struct ModuleImport * module;
4411
4412 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4413 module = FindModule(method->_class->module);
4414 else
4415 module = mainModule;
4416 classSym->_import = __extension__ ({
4417 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4418
4419 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4420 });
4421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4422 }
4423 if(!symbol)
4424 {
4425 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4426 }
4427 if(!symbol->_import)
4428 {
4429 symbol->_import = (struct ClassImport *)__extension__ ({
4430 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4431
4432 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4433 });
4434 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4435 }
4436 if(!symbol)
4437 {
4438 symbol->type = method->dataType;
4439 if(symbol->type)
4440 symbol->type->refCount++;
4441 }
4442 }
4443 if(!method->dataType->dllExport)
4444 {
4445 imported = 0x1;
4446 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)
4447 dllImport = 0x1;
4448 }
4449 }
4450 if(method->type != 1 && method->dataType)
4451 DeclareType(method->dataType, 0x1, 0x1);
4452 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4453 {
4454 struct Declaration * decl;
4455 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4456 struct Declarator * d;
4457 struct Declarator * funcDecl;
4458 struct External * external;
4459
4460 specifiers = MkList();
4461 declarators = MkList();
4462 if(dllImport)
4463 ListAdd(specifiers, MkSpecifier(EXTERN));
4464 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4465 ListAdd(specifiers, MkSpecifier(STATIC));
4466 if(method->type == 1)
4467 {
4468 ListAdd(specifiers, MkSpecifier(INT));
4469 d = MkDeclaratorIdentifier(MkIdentifier(name));
4470 }
4471 else
4472 {
4473 d = MkDeclaratorIdentifier(MkIdentifier(name));
4474 if(dllImport)
4475 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4476 {
4477 struct Context * context = SetupTemplatesContext(method->_class);
4478
4479 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4480 FinishTemplatesContext(context);
4481 }
4482 funcDecl = GetFuncDecl(d);
4483 if(dllImport)
4484 {
4485 struct Specifier * spec, * next;
4486
4487 for(spec = (*specifiers).first; spec; spec = next)
4488 {
4489 next = spec->next;
4490 if(spec->type == 5)
4491 {
4492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4493 FreeSpecifier(spec);
4494 }
4495 }
4496 }
4497 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4498 {
4499 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4500 {
4501 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4502 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")));
4503 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4504 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4505
4506 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4507 {
4508 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4509
4510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4511 FreeTypeName(param);
4512 }
4513 if(!funcDecl->__anon1.function.parameters)
4514 funcDecl->__anon1.function.parameters = MkList();
4515 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4516 }
4517 }
4518 }
4519 ProcessDeclarator(d);
4520 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4521 decl = MkDeclaration(specifiers, declarators);
4522 ReplaceThisClassSpecifiers(specifiers, method->_class);
4523 if(symbol->__anon2.__anon1.pointerExternal)
4524 {
4525 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4526
4527 {
4528 *functionSymbol = *symbol;
4529 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4530 if(functionSymbol->type)
4531 functionSymbol->type->refCount++;
4532 }
4533 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4534 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4535 }
4536 external = MkExternalDeclaration(decl);
4537 if(curExternal)
4538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4539 external->symbol = symbol;
4540 symbol->__anon2.__anon1.pointerExternal = external;
4541 }
4542 else if(ast)
4543 {
4544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4545 }
4546 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4547 }
4548 }
4549
4550 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4551 {
4552 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4553 {
4554 unsigned int first = 0x1;
4555 int p = 0;
4556 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4557 int lastParam = -1;
4558 char className[1024];
4559
4560 strcpy(className, _class->fullName);
4561 for(param = _class->templateParams.first; param; param = param->next)
4562 {
4563 {
4564 if(first)
4565 strcat(className, "<");
4566 if(!first)
4567 strcat(className, ", ");
4568 if(lastParam + 1 != p)
4569 {
4570 strcat(className, param->name);
4571 strcat(className, " = ");
4572 }
4573 strcat(className, param->name);
4574 first = 0x0;
4575 lastParam = p;
4576 }
4577 p++;
4578 }
4579 if(!first)
4580 {
4581 int len = strlen(className);
4582
4583 if(className[len - 1] == '>')
4584 className[len++] = ' ';
4585 className[len++] = '>';
4586 className[len++] = '\0';
4587 }
4588 return __ecereNameSpace__ecere__sys__CopyString(className);
4589 }
4590 else
4591 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4592 }
4593
4594 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4595 {
4596 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4597 {
4598 unsigned int first = 0x1;
4599 int p = 0;
4600 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4601 int lastParam = -1;
4602 char className[1024];
4603
4604 strcpy(className, _class->fullName);
4605 for(param = _class->templateParams.first; param; param = param->next)
4606 {
4607 {
4608 if(first)
4609 strcat(className, "<");
4610 if(!first)
4611 strcat(className, ", ");
4612 if(lastParam + 1 != p)
4613 {
4614 strcat(className, param->name);
4615 strcat(className, " = ");
4616 }
4617 strcat(className, param->name);
4618 first = 0x0;
4619 lastParam = p;
4620 }
4621 p++;
4622 }
4623 if(!first)
4624 {
4625 int len = strlen(className);
4626
4627 if(className[len - 1] == '>')
4628 className[len++] = ' ';
4629 className[len++] = '>';
4630 className[len++] = '\0';
4631 }
4632 return MkClassType(className);
4633 }
4634 else
4635 {
4636 return MkClassType(_class->fullName);
4637 }
4638 }
4639
4640 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4641 {
4642 if(specs != (((void *)0)) && _class)
4643 {
4644 struct Specifier * spec;
4645
4646 for(spec = specs->first; spec; spec = spec->next)
4647 {
4648 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4649 {
4650 spec->type = 1;
4651 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4652 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4653 }
4654 }
4655 }
4656 }
4657
4658 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4659
4660 struct __ecereNameSpace__ecere__com__GlobalFunction
4661 {
4662 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4663 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4664 const char *  name;
4665 int (*  function)();
4666 struct __ecereNameSpace__ecere__com__Instance * module;
4667 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4668 const char *  dataTypeString;
4669 struct Type * dataType;
4670 void *  symbol;
4671 } __attribute__ ((gcc_struct));
4672
4673 extern struct Context * globalContext;
4674
4675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4676
4677 struct FunctionImport
4678 {
4679 struct FunctionImport * prev;
4680 struct FunctionImport * next;
4681 char *  name;
4682 } __attribute__ ((gcc_struct));
4683
4684 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4685 {
4686 struct Symbol * symbol = function->symbol;
4687
4688 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4689 {
4690 unsigned int imported = 0x0;
4691 unsigned int dllImport = 0x0;
4692
4693 if(!function->dataType)
4694 {
4695 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4696 if(!function->dataType->__anon1.__anon2.thisClass)
4697 function->dataType->__anon1.__anon2.staticMethod = 0x1;
4698 }
4699 if(inCompiler)
4700 {
4701 if(!symbol)
4702 {
4703 struct ModuleImport * module = FindModule(function->module);
4704
4705 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4706 if(module->name)
4707 {
4708 if(!function->dataType->dllExport)
4709 {
4710 symbol->_import = (struct ClassImport *)__extension__ ({
4711 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4712
4713 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4714 });
4715 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4716 }
4717 }
4718 {
4719 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4720 if(!symbol->type->__anon1.__anon2.thisClass)
4721 symbol->type->__anon1.__anon2.staticMethod = 0x1;
4722 }
4723 }
4724 imported = symbol->_import ? 0x1 : 0x0;
4725 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4726 dllImport = 0x1;
4727 }
4728 DeclareType(function->dataType, 0x1, 0x1);
4729 if(inCompiler)
4730 {
4731 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4732 {
4733 struct Declaration * decl;
4734 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4735 struct Declarator * d;
4736 struct Declarator * funcDecl;
4737 struct External * external;
4738
4739 specifiers = MkList();
4740 declarators = MkList();
4741 ListAdd(specifiers, MkSpecifier(EXTERN));
4742 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4743 if(dllImport)
4744 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4745 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4746 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4747 {
4748 struct Specifier * spec;
4749
4750 for(spec = (*specifiers).first; spec; spec = spec->next)
4751 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4752 {
4753 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4754 FreeSpecifier(spec);
4755 break;
4756 }
4757 }
4758 funcDecl = GetFuncDecl(d);
4759 if(funcDecl && !funcDecl->__anon1.function.parameters)
4760 {
4761 funcDecl->__anon1.function.parameters = MkList();
4762 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4763 }
4764 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4765 {
4766 struct Context * oldCtx = curContext;
4767
4768 curContext = globalContext;
4769 decl = MkDeclaration(specifiers, declarators);
4770 curContext = oldCtx;
4771 }
4772 if(symbol->__anon2.__anon1.pointerExternal)
4773 {
4774 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4775
4776 {
4777 *functionSymbol = *symbol;
4778 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4779 if(functionSymbol->type)
4780 functionSymbol->type->refCount++;
4781 }
4782 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4783 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4784 }
4785 external = MkExternalDeclaration(decl);
4786 if(curExternal)
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4788 external->symbol = symbol;
4789 symbol->__anon2.__anon1.pointerExternal = external;
4790 }
4791 else
4792 {
4793 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4794 }
4795 if(curExternal)
4796 symbol->id = curExternal->symbol->idCode;
4797 }
4798 }
4799 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4800 }
4801
4802 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4803
4804 struct GlobalData
4805 {
4806 uintptr_t key;
4807 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4808 struct __ecereNameSpace__ecere__sys__BTNode * left;
4809 struct __ecereNameSpace__ecere__sys__BTNode * right;
4810 int depth;
4811 struct __ecereNameSpace__ecere__com__Instance * module;
4812 char *  dataTypeString;
4813 struct Type * dataType;
4814 void *  symbol;
4815 char *  fullName;
4816 } __attribute__ ((gcc_struct));
4817
4818 void DeclareGlobalData(struct GlobalData * data)
4819 {
4820 struct Symbol * symbol = data->symbol;
4821
4822 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4823 {
4824 if(inCompiler)
4825 {
4826 if(!symbol)
4827 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4828 }
4829 if(!data->dataType)
4830 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4831 DeclareType(data->dataType, 0x1, 0x1);
4832 if(inCompiler)
4833 {
4834 if(!symbol->__anon2.__anon1.pointerExternal)
4835 {
4836 struct Declaration * decl;
4837 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4838 struct Declarator * d;
4839 struct External * external;
4840
4841 specifiers = MkList();
4842 declarators = MkList();
4843 ListAdd(specifiers, MkSpecifier(EXTERN));
4844 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4845 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4846 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4847 decl = MkDeclaration(specifiers, declarators);
4848 external = MkExternalDeclaration(decl);
4849 if(curExternal)
4850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4851 external->symbol = symbol;
4852 symbol->__anon2.__anon1.pointerExternal = external;
4853 }
4854 else
4855 {
4856 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4857 }
4858 if(curExternal)
4859 symbol->id = curExternal->symbol->idCode;
4860 }
4861 }
4862 }
4863
4864 struct Conversion
4865 {
4866 struct Conversion * prev, * next;
4867 struct __ecereNameSpace__ecere__com__Property * convert;
4868 unsigned int isGet;
4869 struct Type * resultType;
4870 } __attribute__ ((gcc_struct));
4871
4872 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4873
4874 extern void Compiler_Warning(const char *  format, ...);
4875
4876 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4877 {
4878 unsigned int status = 0x1;
4879
4880 if(((source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered) || dest->kind == 13))
4881 {
4882 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4883 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4884
4885 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4886 {
4887 struct Type * sourceType = source, * destType = dest;
4888
4889 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4890 sourceType = sourceType->__anon1.type;
4891 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4892 destType = destType->__anon1.type;
4893 if(!destType->constant && sourceType->constant)
4894 {
4895 status = 0x0;
4896 if(warn)
4897 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4898 }
4899 }
4900 }
4901 return status;
4902 }
4903
4904 extern void CopyTypeInto(struct Type * type, struct Type * src);
4905
4906 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4907
4908 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst)
4909 {
4910 if(source && dest)
4911 {
4912 if(warnConst)
4913 CheckConstCompatibility(source, dest, 0x1);
4914 if(source->kind == 20 && dest->kind != 20)
4915 {
4916 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4917
4918 if(type)
4919 source = type;
4920 }
4921 if(dest->kind == 20 && source->kind != 20)
4922 {
4923 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4924
4925 if(type)
4926 dest = type;
4927 }
4928 if(dest->classObjectType == 2 && dest->kind != 11)
4929 {
4930 if(source->classObjectType != 3)
4931 return 0x1;
4932 else
4933 {
4934 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4935 {
4936 return 0x1;
4937 }
4938 }
4939 }
4940 else
4941 {
4942 if(source->kind != 11 && source->classObjectType == 3)
4943 return 0x1;
4944 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4945 return 0x1;
4946 }
4947 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4948 {
4949 if((dest->__anon1.__anon1.enumName && source->__anon1.__anon1.enumName && !strcmp(dest->__anon1.__anon1.enumName, source->__anon1.__anon1.enumName)) || (source->__anon1.__anon1.members.first && source->__anon1.__anon1.members.first == dest->__anon1.__anon1.members.first))
4950 return 0x1;
4951 }
4952 if(dest->kind == 14 && source->kind != 0)
4953 return 0x1;
4954 if(dest->kind == 13 && dest->__anon1.type->kind == 0 && ((source->kind == 8 && (!source->__anon1._class || !source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type == 1 || source->__anon1._class->__anon1.registered->type == 0 || source->__anon1._class->__anon1.registered->type == 5 || source->__anon1._class->__anon1.registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4955 return 0x1;
4956 if(!isConversionExploration && source->kind == 13 && source->__anon1.type->kind == 0 && ((dest->kind == 8 && (!dest->__anon1._class || !dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type == 1 || dest->__anon1._class->__anon1.registered->type == 0 || dest->__anon1._class->__anon1.registered->type == 5 || dest->__anon1._class->__anon1.registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4957 return 0x1;
4958 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4959 {
4960 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4961 {
4962 if(conversions != (((void *)0)))
4963 {
4964 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4965 return 0x1;
4966 }
4967 else
4968 {
4969 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4970
4971 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4972 ;
4973 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4974 ;
4975 if(sourceBase == destBase)
4976 return 0x1;
4977 }
4978 }
4979 else if(source->__anon1._class && dest->__anon1._class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type != 4) || (!dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, dest->__anon1._class->__anon1.registered))
4980 return 0x1;
4981 else
4982 {
4983 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
4984 {
4985 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4986 {
4987 return 0x1;
4988 }
4989 }
4990 }
4991 }
4992 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
4993 return 0x1;
4994 if(doConversion)
4995 {
4996 if(source->kind == 8)
4997 {
4998 struct __ecereNameSpace__ecere__com__Class * _class;
4999
5000 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5001 {
5002 struct __ecereNameSpace__ecere__com__Property * convert;
5003
5004 for(convert = _class->conversions.first; convert; convert = convert->next)
5005 {
5006 if(convert->memberAccess == 1 || _class->module == privateModule)
5007 {
5008 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5009
5010 if(!convert->dataType)
5011 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5012 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1, warnConst))
5013 {
5014 if(!conversions && !convert->Get)
5015 return 0x1;
5016 else if(conversions != (((void *)0)))
5017 {
5018 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5019 return 0x1;
5020 else
5021 {
5022 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5023
5024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5025 return 0x1;
5026 }
5027 }
5028 }
5029 }
5030 }
5031 }
5032 }
5033 if(dest->kind == 8)
5034 {
5035 struct __ecereNameSpace__ecere__com__Class * _class;
5036
5037 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5038 {
5039 struct __ecereNameSpace__ecere__com__Property * convert;
5040
5041 for(convert = _class->conversions.first; convert; convert = convert->next)
5042 {
5043 if(convert->memberAccess == 1 || _class->module == privateModule)
5044 {
5045 struct Type * constType = (((void *)0));
5046 unsigned int success = 0x0;
5047
5048 if(!convert->dataType)
5049 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5050 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5051 {
5052 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5053
5054 constType = __extension__ ({
5055 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5056
5057 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5058 });
5059 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5060 ptrType->refCount++;
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(success)
5081 return 0x1;
5082 if(constType)
5083 FreeType(constType);
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 exp->needCast = 0x1;
12841 if(exp->expType)
12842 exp->expType->refCount++;
12843 }
12844 else
12845 {
12846 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12847 exp->needCast = 0x1;
12848 if(convert->resultType)
12849 convert->resultType->refCount++;
12850 }
12851 }
12852 }
12853 if(exp->isConstant && inCompiler)
12854 ComputeExpression(exp);
12855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12856 }
12857 if(!result && exp->expType && converts.count)
12858 {
12859 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
12860 }
12861 if(!result && exp->expType && exp->destType)
12862 {
12863 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))
12864 result = 0x1;
12865 }
12866 }
12867 return result;
12868 }
12869
12870 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12871
12872 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12873
12874 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12875
12876 void CheckTemplateTypes(struct Expression * exp)
12877 {
12878 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12879 {
12880 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12881 struct Context * context;
12882
12883 *newExp = *exp;
12884 if(exp->destType)
12885 exp->destType->refCount++;
12886 if(exp->expType)
12887 exp->expType->refCount++;
12888 newExp->prev = (((void *)0));
12889 newExp->next = (((void *)0));
12890 switch(exp->expType->kind)
12891 {
12892 case 7:
12893 if(exp->destType->classObjectType)
12894 {
12895 if(exp->destType)
12896 exp->destType->refCount--;
12897 if(exp->expType)
12898 exp->expType->refCount--;
12899 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12900 }
12901 else
12902 {
12903 struct __ecereNameSpace__ecere__sys__OldList * specs;
12904 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12905 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12906
12907 context = PushContext();
12908 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12909 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12910 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12911 exp->type = 23;
12912 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12913 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12914 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12915 exp->__anon1.compound->__anon1.compound.context = context;
12916 PopContext(context);
12917 }
12918 break;
12919 default:
12920 exp->type = 11;
12921 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12922 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12923 break;
12924 }
12925 }
12926 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12927 {
12928 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12929 struct Statement * compound;
12930 struct Context * context;
12931
12932 *newExp = *exp;
12933 if(exp->destType)
12934 exp->destType->refCount++;
12935 if(exp->expType)
12936 exp->expType->refCount++;
12937 newExp->prev = (((void *)0));
12938 newExp->next = (((void *)0));
12939 switch(exp->expType->kind)
12940 {
12941 case 7:
12942 if(exp->destType->classObjectType)
12943 {
12944 if(exp->destType)
12945 exp->destType->refCount--;
12946 if(exp->expType)
12947 exp->expType->refCount--;
12948 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12949 }
12950 else
12951 {
12952 struct __ecereNameSpace__ecere__sys__OldList * specs;
12953 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12954 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12955
12956 context = PushContext();
12957 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12958 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12959 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12960 exp->type = 23;
12961 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12962 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12963 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12964 exp->__anon1.compound->__anon1.compound.context = context;
12965 PopContext(context);
12966 }
12967 break;
12968 case 8:
12969 {
12970 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12971 {
12972 exp->type = 5;
12973 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)));
12974 ProcessExpressionType((*exp->__anon1.list).first);
12975 break;
12976 }
12977 else
12978 {
12979 exp->type = 5;
12980 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12981 newExp->needCast = 0x1;
12982 ProcessExpressionType((*exp->__anon1.list).first);
12983 break;
12984 }
12985 }
12986 default:
12987 {
12988 if(exp->expType->kind == 20)
12989 {
12990 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
12991
12992 if(type)
12993 {
12994 FreeType(exp->destType);
12995 FreeType(exp->expType);
12996 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12997 break;
12998 }
12999 }
13000 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13001 {
13002 exp->type = 4;
13003 exp->__anon1.op.op = '*';
13004 exp->__anon1.op.exp1 = (((void *)0));
13005 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13006 }
13007 else
13008 {
13009 char typeString[1024];
13010 struct Declarator * decl;
13011 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13012
13013 typeString[0] = '\0';
13014 PrintType(exp->expType, typeString, 0x0, 0x0);
13015 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13016 exp->type = 11;
13017 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13018 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13019 exp->__anon1.cast.exp->needCast = 0x1;
13020 }
13021 break;
13022 }
13023 }
13024 }
13025 }
13026
13027 extern int strncmp(const char * , const char * , size_t n);
13028
13029 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13030
13031 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13032 {
13033 int nsLen = strlen(nameSpace);
13034 struct Symbol * symbol;
13035
13036 for(symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(tree, nameSpace); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
13037 {
13038 char * s = symbol->string;
13039
13040 if(!strncmp(s, nameSpace, nsLen))
13041 {
13042 int c;
13043 char * namePart;
13044
13045 for(c = strlen(s) - 1; c >= 0; c--)
13046 if(s[c] == ':')
13047 break;
13048 namePart = s + c + 1;
13049 if(!strcmp(namePart, name))
13050 {
13051 return symbol;
13052 }
13053 }
13054 else
13055 break;
13056 }
13057 return (((void *)0));
13058 }
13059
13060 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13061 {
13062 int c;
13063 char nameSpace[1024];
13064 const char * namePart;
13065 unsigned int gotColon = 0x0;
13066
13067 nameSpace[0] = '\0';
13068 for(c = strlen(name) - 1; c >= 0; c--)
13069 if(name[c] == ':')
13070 {
13071 gotColon = 0x1;
13072 break;
13073 }
13074 namePart = name + c + 1;
13075 while(c >= 0 && name[c] == ':')
13076 c--;
13077 if(c >= 0)
13078 {
13079 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13080
13081 if(symbol)
13082 return symbol;
13083 memcpy(nameSpace, name, c + 1);
13084 nameSpace[c + 1] = (char)0;
13085 return ScanWithNameSpace(tree, nameSpace, namePart);
13086 }
13087 else if(gotColon)
13088 {
13089 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13090
13091 return symbol;
13092 }
13093 else
13094 {
13095 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13096
13097 if(symbol)
13098 return symbol;
13099 return ScanWithNameSpace(tree, "", namePart);
13100 }
13101 return (((void *)0));
13102 }
13103
13104 static void ProcessDeclaration(struct Declaration * decl);
13105
13106 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13107 {
13108 struct Context * ctx;
13109 struct Symbol * symbol = (((void *)0));
13110
13111 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13112 {
13113 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13114 {
13115 symbol = (((void *)0));
13116 if(thisNameSpace)
13117 {
13118 char curName[1024];
13119
13120 strcpy(curName, thisNameSpace);
13121 strcat(curName, "::");
13122 strcat(curName, name);
13123 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13124 }
13125 if(!symbol)
13126 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13127 }
13128 else
13129 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13130 if(symbol || ctx == endContext)
13131 break;
13132 }
13133 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13134 {
13135 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13136 {
13137 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13138 struct Context * tmpContext = curContext;
13139
13140 curContext = (((void *)0));
13141 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13142 curContext = tmpContext;
13143 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13144 DeclareType(symbol->type, 0x1, 0x1);
13145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13146 symbol->id = curExternal->symbol->idCode;
13147 }
13148 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13149 {
13150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13151 symbol->id = curExternal->symbol->idCode;
13152 }
13153 }
13154 return symbol;
13155 }
13156
13157 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13158 {
13159 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13160 ListAdd(specs, MkSpecifier(UNSIGNED));
13161 switch(type->kind)
13162 {
13163 case 8:
13164 {
13165 if(type->__anon1._class->__anon1.registered)
13166 {
13167 if(!type->__anon1._class->__anon1.registered->dataType)
13168 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
13169 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13170 }
13171 break;
13172 }
13173 case 7:
13174 ListAdd(specs, MkSpecifier(DOUBLE));
13175 break;
13176 case 6:
13177 ListAdd(specs, MkSpecifier(FLOAT));
13178 break;
13179 case 1:
13180 ListAdd(specs, MkSpecifier(CHAR));
13181 break;
13182 case 24:
13183 ListAdd(specs, MkSpecifier(_BOOL));
13184 break;
13185 case 2:
13186 ListAdd(specs, MkSpecifier(SHORT));
13187 break;
13188 case 4:
13189 ListAdd(specs, MkSpecifier(INT64));
13190 break;
13191 case 22:
13192 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13193 break;
13194 case 23:
13195 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13196 break;
13197 case 3:
13198 default:
13199 ListAdd(specs, MkSpecifier(INT));
13200 break;
13201 }
13202 }
13203
13204 static void PrintArraySize(struct Type * arrayType, char * string)
13205 {
13206 char size[256];
13207
13208 size[0] = '\0';
13209 strcat(size, "[");
13210 if(arrayType->__anon1.__anon4.enumClass)
13211 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13212 else if(arrayType->__anon1.__anon4.arraySizeExp)
13213 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13214 strcat(size, "]");
13215 strcat(string, size);
13216 }
13217
13218 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13219 {
13220 if(type)
13221 {
13222 if(printConst && type->constant)
13223 strcat(string, "const ");
13224 switch(type->kind)
13225 {
13226 case 8:
13227 {
13228 struct Symbol * c = type->__anon1._class;
13229
13230 if(type->classObjectType == 2)
13231 strcat(string, "typed_object");
13232 else if(type->classObjectType == 3)
13233 strcat(string, "any_object");
13234 else
13235 {
13236 if(c && c->string)
13237 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13238 }
13239 if(type->byReference)
13240 strcat(string, " &");
13241 break;
13242 }
13243 case 0:
13244 strcat(string, "void");
13245 break;
13246 case 3:
13247 strcat(string, type->isSigned ? "int" : "uint");
13248 break;
13249 case 4:
13250 strcat(string, type->isSigned ? "int64" : "uint64");
13251 break;
13252 case 22:
13253 strcat(string, type->isSigned ? "intptr" : "uintptr");
13254 break;
13255 case 23:
13256 strcat(string, type->isSigned ? "intsize" : "uintsize");
13257 break;
13258 case 1:
13259 strcat(string, type->isSigned ? "char" : "byte");
13260 break;
13261 case 24:
13262 strcat(string, "_Bool");
13263 break;
13264 case 2:
13265 strcat(string, type->isSigned ? "short" : "uint16");
13266 break;
13267 case 6:
13268 strcat(string, "float");
13269 break;
13270 case 7:
13271 strcat(string, "double");
13272 break;
13273 case 9:
13274 if(type->__anon1.__anon1.enumName)
13275 {
13276 strcat(string, "struct ");
13277 strcat(string, type->__anon1.__anon1.enumName);
13278 }
13279 else if(type->typeName)
13280 strcat(string, type->typeName);
13281 else
13282 {
13283 struct Type * member;
13284
13285 strcat(string, "struct { ");
13286 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13287 {
13288 PrintType(member, string, 0x1, fullName);
13289 strcat(string, "; ");
13290 }
13291 strcat(string, "}");
13292 }
13293 break;
13294 case 10:
13295 if(type->__anon1.__anon1.enumName)
13296 {
13297 strcat(string, "union ");
13298 strcat(string, type->__anon1.__anon1.enumName);
13299 }
13300 else if(type->typeName)
13301 strcat(string, type->typeName);
13302 else
13303 {
13304 strcat(string, "union ");
13305 strcat(string, "(unnamed)");
13306 }
13307 break;
13308 case 15:
13309 if(type->__anon1.__anon1.enumName)
13310 {
13311 strcat(string, "enum ");
13312 strcat(string, type->__anon1.__anon1.enumName);
13313 }
13314 else if(type->typeName)
13315 strcat(string, type->typeName);
13316 else
13317 strcat(string, "int");
13318 break;
13319 case 14:
13320 strcat(string, "...");
13321 break;
13322 case 19:
13323 strcat(string, "subclass(");
13324 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13325 strcat(string, ")");
13326 break;
13327 case 20:
13328 strcat(string, type->__anon1.templateParameter->identifier->string);
13329 break;
13330 case 21:
13331 strcat(string, "thisclass");
13332 break;
13333 case 17:
13334 strcat(string, "__builtin_va_list");
13335 break;
13336 }
13337 }
13338 }
13339
13340 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13341
13342 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13343 {
13344 if(type->name && type->name[0])
13345 {
13346 if(fullName)
13347 strcat(string, type->name);
13348 else
13349 {
13350 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13351
13352 if(name)
13353 name += 2;
13354 else
13355 name = type->name;
13356 strcat(string, name);
13357 }
13358 }
13359 }
13360
13361 static void PrintAttribs(struct Type * type, char * string)
13362 {
13363 if(type)
13364 {
13365 if(type->dllExport)
13366 strcat(string, "dllexport ");
13367 if(type->attrStdcall)
13368 strcat(string, "stdcall ");
13369 }
13370 }
13371
13372 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13373 {
13374 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13375 {
13376 struct Type * attrType = (((void *)0));
13377
13378 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13379 PrintAttribs(type, string);
13380 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13381 strcat(string, " const");
13382 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13383 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13384 strcat(string, " (");
13385 if(type->kind == 13)
13386 {
13387 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13388 PrintAttribs(type->__anon1.type, string);
13389 }
13390 if(type->kind == 13)
13391 {
13392 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13393 strcat(string, "*");
13394 else
13395 strcat(string, " *");
13396 }
13397 if(printConst && type->constant && type->kind == 13)
13398 strcat(string, " const");
13399 }
13400 else
13401 PrintTypeSpecs(type, string, fullName, printConst);
13402 }
13403
13404 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13405 {
13406 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13407 strcat(string, ")");
13408 if(type->kind == 12)
13409 PrintArraySize(type, string);
13410 else if(type->kind == 11)
13411 {
13412 struct Type * param;
13413
13414 strcat(string, "(");
13415 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13416 {
13417 PrintType(param, string, 0x1, fullName);
13418 if(param->next)
13419 strcat(string, ", ");
13420 }
13421 strcat(string, ")");
13422 }
13423 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13424 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13425 }
13426
13427 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13428 {
13429 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13430 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13431 strcat(string, " ");
13432 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13433 {
13434 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13435
13436 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13437 {
13438 if(type->classObjectType == 1)
13439 strcat(string, "class");
13440 else
13441 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13442 }
13443 else if(_class && _class->string)
13444 {
13445 char * s = _class->string;
13446
13447 if(fullName)
13448 strcat(string, s);
13449 else
13450 {
13451 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13452
13453 if(name)
13454 name += 2;
13455 else
13456 name = s;
13457 strcat(string, name);
13458 }
13459 }
13460 strcat(string, "::");
13461 }
13462 if(printName && type->name)
13463 PrintName(type, string, fullName);
13464 PostPrintType(type, string, fullName);
13465 if(type->bitFieldCount)
13466 {
13467 char count[100];
13468
13469 sprintf(count, ":%d", type->bitFieldCount);
13470 strcat(string, count);
13471 }
13472 }
13473
13474 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13475 {
13476 _PrintType(type, string, printName, fullName, 0x1);
13477 }
13478
13479 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13480 {
13481 _PrintType(type, string, printName, fullName, 0x0);
13482 }
13483
13484 static struct Type * FindMember(struct Type * type, char * string)
13485 {
13486 struct Type * memberType;
13487
13488 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13489 {
13490 if(!memberType->name)
13491 {
13492 struct Type * subType = FindMember(memberType, string);
13493
13494 if(subType)
13495 return subType;
13496 }
13497 else if(!strcmp(memberType->name, string))
13498 return memberType;
13499 }
13500 return (((void *)0));
13501 }
13502
13503 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13504 {
13505 struct Type * memberType;
13506
13507 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13508 {
13509 if(!memberType->name)
13510 {
13511 struct Type * subType = FindMember(memberType, string);
13512
13513 if(subType)
13514 {
13515 *offset += memberType->offset;
13516 return subType;
13517 }
13518 }
13519 else if(!strcmp(memberType->name, string))
13520 {
13521 *offset += memberType->offset;
13522 return memberType;
13523 }
13524 }
13525 return (((void *)0));
13526 }
13527
13528 extern unsigned int parseError;
13529
13530 unsigned int GetParseError()
13531 {
13532 return parseError;
13533 }
13534
13535 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13536
13537 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13538
13539 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13540
13541 struct Expression * ParseExpressionString(char * expression)
13542 {
13543 parseError = 0x0;
13544 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13545 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13546 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13547
13548 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13549 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13550 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13551 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13552
13553 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13554 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13555 echoOn = 0x0;
13556 parsedExpression = (((void *)0));
13557 resetScanner();
13558 expression_yyparse();
13559 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13560 return parsedExpression;
13561 }
13562
13563 extern char *  QMkString(const char *  source);
13564
13565 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13566 {
13567 struct Identifier * id = exp->__anon1.__anon1.identifier;
13568 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13569 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13570 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13571 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13572
13573 if(_class && _class->type == 4)
13574 {
13575 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13576 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13577
13578 if(enumClass)
13579 {
13580 struct __ecereNameSpace__ecere__com__Class * baseClass;
13581
13582 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13583 {
13584 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13585
13586 for(value = e->values.first; value; value = value->next)
13587 {
13588 if(!strcmp(value->name, id->string))
13589 break;
13590 }
13591 if(value)
13592 {
13593 char constant[256];
13594
13595 FreeExpContents(exp);
13596 exp->type = 2;
13597 exp->isConstant = 0x1;
13598 if(!strcmp(baseClass->dataTypeString, "int"))
13599 sprintf(constant, "%d", (int)value->data);
13600 else
13601 sprintf(constant, "0x%X", (int)value->data);
13602 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13603 exp->expType = MkClassType(baseClass->fullName);
13604 break;
13605 }
13606 }
13607 }
13608 if(value)
13609 return 0x1;
13610 }
13611 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13612 {
13613 ProcessMethodType(method);
13614 exp->expType = __extension__ ({
13615 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13616
13617 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13618 });
13619 return 0x1;
13620 }
13621 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13622 {
13623 if(!prop->dataType)
13624 ProcessPropertyType(prop);
13625 exp->expType = prop->dataType;
13626 if(prop->dataType)
13627 prop->dataType->refCount++;
13628 return 0x1;
13629 }
13630 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13631 {
13632 if(!member->dataType)
13633 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13634 exp->expType = member->dataType;
13635 if(member->dataType)
13636 member->dataType->refCount++;
13637 return 0x1;
13638 }
13639 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13640 {
13641 if(!classProp->dataType)
13642 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13643 if(classProp->constant)
13644 {
13645 FreeExpContents(exp);
13646 exp->isConstant = 0x1;
13647 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13648 {
13649 exp->type = 3;
13650 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13651 }
13652 else
13653 {
13654 char constant[256];
13655
13656 exp->type = 2;
13657 sprintf(constant, "%d", (int)classProp->Get(_class));
13658 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13659 }
13660 }
13661 else
13662 {
13663 }
13664 exp->expType = classProp->dataType;
13665 if(classProp->dataType)
13666 classProp->dataType->refCount++;
13667 return 0x1;
13668 }
13669 return 0x0;
13670 }
13671
13672 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13673 {
13674 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13675 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13676 struct __ecereNameSpace__ecere__com__NameSpace * child;
13677
13678 if(!data)
13679 {
13680 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)))
13681 {
13682 data = ScanGlobalData(child, name);
13683 if(data)
13684 break;
13685 }
13686 }
13687 return data;
13688 }
13689
13690 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13691
13692 extern char *  strncpy(char * , const char * , size_t n);
13693
13694 static struct GlobalData * FindGlobalData(char * name)
13695 {
13696 int start = 0, c;
13697 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13698
13699 nameSpace = globalData;
13700 for(c = 0; name[c]; c++)
13701 {
13702 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13703 {
13704 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13705 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13706
13707 strncpy(spaceName, name + start, c - start);
13708 spaceName[c - start] = '\0';
13709 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13710 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13711 if(!newSpace)
13712 return (((void *)0));
13713 nameSpace = newSpace;
13714 if(name[c] == ':')
13715 c++;
13716 start = c + 1;
13717 }
13718 }
13719 if(c - start)
13720 {
13721 return ScanGlobalData(nameSpace, name + start);
13722 }
13723 return (((void *)0));
13724 }
13725
13726 static int definedExpStackPos;
13727
13728 static void * definedExpStack[512];
13729
13730 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13731 {
13732 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13733
13734 FreeExpContents(checkedExp);
13735 FreeType(checkedExp->expType);
13736 FreeType(checkedExp->destType);
13737 *checkedExp = *newExp;
13738 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13739 checkedExp->prev = prev;
13740 checkedExp->next = next;
13741 }
13742
13743 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13744
13745 extern int printf(const char * , ...);
13746
13747 void __ecereMethod_Expression_Clear();
13748
13749 void ApplyAnyObjectLogic(struct Expression * e)
13750 {
13751 struct Type * destType = e->destType;
13752
13753 if(destType && (destType->classObjectType == 3))
13754 {
13755 if(e && e->expType)
13756 {
13757 struct Type * type = e->expType;
13758 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13759
13760 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13761 {
13762 _class = type->__anon1._class->__anon1.registered;
13763 }
13764 else if(type->kind == 19)
13765 {
13766 _class = FindClass("ecere::com::Class")->__anon1.registered;
13767 }
13768 else
13769 {
13770 char string[1024] = "";
13771 struct Symbol * classSym;
13772
13773 PrintTypeNoConst(type, string, 0x0, 0x1);
13774 classSym = FindClass(string);
13775 if(classSym)
13776 _class = classSym->__anon1.registered;
13777 }
13778 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)))
13779 {
13780 if(!_class || strcmp(_class->fullName, "char *"))
13781 {
13782 struct Expression * checkedExp = e, * newExp;
13783
13784 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13785 {
13786 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13787 {
13788 if(checkedExp->type == 23)
13789 {
13790 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13791 }
13792 else
13793 checkedExp = (*checkedExp->__anon1.list).last;
13794 }
13795 else if(checkedExp->type == 11)
13796 checkedExp = checkedExp->__anon1.cast.exp;
13797 }
13798 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13799 {
13800 newExp = checkedExp->__anon1.op.exp2;
13801 checkedExp->__anon1.op.exp2 = (((void *)0));
13802 FreeExpContents(checkedExp);
13803 if(e->expType && e->expType->passAsTemplate)
13804 {
13805 char size[100];
13806
13807 ComputeTypeSize(e->expType);
13808 sprintf(size, "%d", e->expType->size);
13809 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))))));
13810 }
13811 ReplaceExpContents(checkedExp, newExp);
13812 e->byReference = 0x1;
13813 }
13814 else if(!e->byReference || (_class && _class->type == 5))
13815 {
13816 struct Expression * checkedExp;
13817
13818 {
13819 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;
13820
13821 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13822 {
13823 struct Context * context = PushContext();
13824 struct Declarator * decl;
13825 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13826 char typeString[1024];
13827 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13828
13829 typeString[0] = '\0';
13830 *newExp = *e;
13831 newExp->prev = (((void *)0));
13832 newExp->next = (((void *)0));
13833 newExp->expType = (((void *)0));
13834 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13835 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13836 newExp->destType = ProcessType(specs, decl);
13837 curContext = context;
13838 if(curCompound)
13839 {
13840 char name[100];
13841 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13842
13843 e->type = 23;
13844 sprintf(name, "__internalValue%03X", internalValueCounter++);
13845 if(!curCompound->__anon1.compound.declarations)
13846 curCompound->__anon1.compound.declarations = MkList();
13847 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13848 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13849 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13850 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13851 }
13852 else
13853 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13854 {
13855 struct Type * type = e->destType;
13856
13857 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13858 CopyTypeInto(e->destType, type);
13859 e->destType->refCount = 1;
13860 e->destType->classObjectType = 0;
13861 FreeType(type);
13862 }
13863 e->__anon1.compound->__anon1.compound.context = context;
13864 PopContext(context);
13865 curContext = context->parent;
13866 }
13867 }
13868 checkedExp = e;
13869 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13870 {
13871 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13872 {
13873 if(checkedExp->type == 23)
13874 {
13875 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13876 }
13877 else
13878 checkedExp = (*checkedExp->__anon1.list).last;
13879 }
13880 else if(checkedExp->type == 11)
13881 checkedExp = checkedExp->__anon1.cast.exp;
13882 }
13883 {
13884 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13885
13886 *operand = *checkedExp;
13887 checkedExp->destType = (((void *)0));
13888 checkedExp->expType = (((void *)0));
13889 __ecereMethod_Expression_Clear(checkedExp);
13890 checkedExp->type = 4;
13891 checkedExp->__anon1.op.op = '&';
13892 checkedExp->__anon1.op.exp1 = (((void *)0));
13893 checkedExp->__anon1.op.exp2 = operand;
13894 }
13895 }
13896 }
13897 }
13898 }
13899 }
13900 {
13901 }
13902 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))))
13903 {
13904 if(e->expType->classObjectType && destType && destType->classObjectType)
13905 {
13906 return ;
13907 }
13908 else
13909 {
13910 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13911
13912 *thisExp = *e;
13913 thisExp->prev = (((void *)0));
13914 thisExp->next = (((void *)0));
13915 __ecereMethod_Expression_Clear(e);
13916 e->type = 5;
13917 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13918 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13919 ((struct Expression *)(*e->__anon1.list).first)->byReference = 0x1;
13920 {
13921 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13922 CopyTypeInto(e->expType, thisExp->expType);
13923 e->expType->byReference = 0x0;
13924 e->expType->refCount = 1;
13925 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))
13926 {
13927 e->expType->classObjectType = 0;
13928 }
13929 }
13930 }
13931 }
13932 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13933 {
13934 if(destType->kind == 14)
13935 {
13936 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13937 }
13938 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))
13939 {
13940 unsigned int byReference = e->expType->byReference;
13941 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13942 struct Declarator * decl;
13943 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13944 char typeString[1024];
13945 struct Type * type;
13946 int backupClassObjectType;
13947 unsigned int backupByReference;
13948
13949 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13950 type = e->expType;
13951 else
13952 type = destType;
13953 backupClassObjectType = type->classObjectType;
13954 backupByReference = type->byReference;
13955 type->classObjectType = 0;
13956 type->byReference = 0x0;
13957 typeString[0] = '\0';
13958 PrintType(type, typeString, 0x0, 0x1);
13959 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13960 type->classObjectType = backupClassObjectType;
13961 type->byReference = backupByReference;
13962 *thisExp = *e;
13963 thisExp->prev = (((void *)0));
13964 thisExp->next = (((void *)0));
13965 __ecereMethod_Expression_Clear(e);
13966 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)))
13967 {
13968 e->type = 4;
13969 e->__anon1.op.op = '*';
13970 e->__anon1.op.exp1 = (((void *)0));
13971 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13972 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13973 CopyTypeInto(e->expType, type);
13974 e->expType->byReference = 0x0;
13975 e->expType->refCount = 1;
13976 }
13977 else
13978 {
13979 e->type = 11;
13980 e->__anon1.cast.typeName = MkTypeName(specs, decl);
13981 e->__anon1.cast.exp = thisExp;
13982 e->byReference = 0x1;
13983 e->expType = type;
13984 type->refCount++;
13985 }
13986 e->destType = destType;
13987 destType->refCount++;
13988 }
13989 }
13990 }
13991
13992 void ApplyLocation(struct Expression * exp, struct Location * loc)
13993 {
13994 exp->loc = *loc;
13995 switch(exp->type)
13996 {
13997 case 4:
13998 if(exp->__anon1.op.exp1)
13999 ApplyLocation(exp->__anon1.op.exp1, loc);
14000 if(exp->__anon1.op.exp2)
14001 ApplyLocation(exp->__anon1.op.exp2, loc);
14002 break;
14003 case 5:
14004 if(exp->__anon1.list)
14005 {
14006 struct Expression * e;
14007
14008 for(e = (*exp->__anon1.list).first; e; e = e->next)
14009 ApplyLocation(e, loc);
14010 }
14011 break;
14012 case 6:
14013 if(exp->__anon1.index.index)
14014 {
14015 struct Expression * e;
14016
14017 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14018 ApplyLocation(e, loc);
14019 }
14020 if(exp->__anon1.index.exp)
14021 ApplyLocation(exp->__anon1.index.exp, loc);
14022 break;
14023 case 7:
14024 if(exp->__anon1.call.arguments)
14025 {
14026 struct Expression * arg;
14027
14028 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14029 ApplyLocation(arg, loc);
14030 }
14031 if(exp->__anon1.call.exp)
14032 ApplyLocation(exp->__anon1.call.exp, loc);
14033 break;
14034 case 8:
14035 case 9:
14036 if(exp->__anon1.member.exp)
14037 ApplyLocation(exp->__anon1.member.exp, loc);
14038 break;
14039 case 11:
14040 if(exp->__anon1.cast.exp)
14041 ApplyLocation(exp->__anon1.cast.exp, loc);
14042 break;
14043 case 12:
14044 if(exp->__anon1.cond.exp)
14045 {
14046 struct Expression * e;
14047
14048 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14049 ApplyLocation(e, loc);
14050 }
14051 if(exp->__anon1.cond.cond)
14052 ApplyLocation(exp->__anon1.cond.cond, loc);
14053 if(exp->__anon1.cond.elseExp)
14054 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14055 break;
14056 case 34:
14057 if(exp->__anon1.vaArg.exp)
14058 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14059 break;
14060 default:
14061 break;
14062 }
14063 }
14064
14065 extern char *  strstr(const char * , const char * );
14066
14067 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14068
14069 struct __ecereNameSpace__ecere__com__DefinedExpression
14070 {
14071 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14072 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14073 const char *  name;
14074 const char *  value;
14075 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14076 } __attribute__ ((gcc_struct));
14077
14078 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14079
14080 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14081
14082 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14083
14084 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14085
14086 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14087
14088 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
14089
14090 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14091
14092 static void ProcessStatement(struct Statement * stmt);
14093
14094 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14095
14096 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14097
14098 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14099
14100 extern const char *  sourceFile;
14101
14102 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14103
14104 void ProcessExpressionType(struct Expression * exp)
14105 {
14106 unsigned int unresolved = 0x0;
14107 struct Location oldyylloc = yylloc;
14108 unsigned int notByReference = 0x0;
14109
14110 if(!exp || exp->expType)
14111 return ;
14112 yylloc = exp->loc;
14113 switch(exp->type)
14114 {
14115 case 0:
14116 {
14117 struct Identifier * id = exp->__anon1.__anon1.identifier;
14118
14119 if(!id || !topContext)
14120 return ;
14121 if(id->_class && id->_class->__anon1.__anon1.name)
14122 {
14123 id->classSym = id->_class->__anon1.__anon1.symbol;
14124 }
14125 if(strstr(id->string, "__ecereClass") == id->string)
14126 {
14127 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
14128 break;
14129 }
14130 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14131 {
14132 ReplaceClassMembers(exp, thisClass);
14133 if(exp->type != 0)
14134 {
14135 ProcessExpressionType(exp);
14136 break;
14137 }
14138 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0x0))
14139 break;
14140 }
14141 else
14142 {
14143 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14144
14145 if(!symbol)
14146 {
14147 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0, 0x0))
14148 break;
14149 else
14150 {
14151 if(thisClass)
14152 {
14153 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14154 if(exp->type != 0)
14155 {
14156 ProcessExpressionType(exp);
14157 break;
14158 }
14159 }
14160 else if(currentClass && !id->_class)
14161 {
14162 if(ResolveIdWithClass(exp, currentClass, 0x1))
14163 break;
14164 }
14165 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14166 }
14167 }
14168 if(symbol)
14169 {
14170 struct Type * type = symbol->type;
14171 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14172
14173 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14174 {
14175 struct Context * context = SetupTemplatesContext(_class);
14176
14177 type = ReplaceThisClassType(_class);
14178 FinishTemplatesContext(context);
14179 if(type)
14180 type->refCount = 0;
14181 }
14182 FreeSpecifier(id->_class);
14183 id->_class = (((void *)0));
14184 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14185 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14186 id->classSym = (((void *)0));
14187 exp->expType = type;
14188 if(type)
14189 type->refCount++;
14190 if(type && (type->kind == 15))
14191 exp->isConstant = 0x1;
14192 if(symbol->isParam || !strcmp(id->string, "this"))
14193 {
14194 if(_class && _class->type == 1 && !type->declaredWithStruct)
14195 exp->byReference = 0x1;
14196 }
14197 if(symbol->isIterator)
14198 {
14199 if(symbol->isIterator == 3)
14200 {
14201 exp->type = 5;
14202 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14203 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14204 exp->expType = (((void *)0));
14205 ProcessExpressionType(exp);
14206 }
14207 else if(symbol->isIterator != 4)
14208 {
14209 exp->type = 8;
14210 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14211 exp->__anon1.member.exp->expType = exp->expType;
14212 exp->__anon1.member.member = MkIdentifier("data");
14213 exp->expType = (((void *)0));
14214 ProcessExpressionType(exp);
14215 }
14216 }
14217 break;
14218 }
14219 else
14220 {
14221 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14222
14223 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14224 {
14225 char name[1024];
14226
14227 strcpy(name, thisNameSpace);
14228 strcat(name, "::");
14229 strcat(name, id->string);
14230 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14231 }
14232 if(!definedExp)
14233 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14234 if(definedExp)
14235 {
14236 int c;
14237
14238 for(c = 0; c < definedExpStackPos; c++)
14239 if(definedExpStack[c] == definedExp)
14240 break;
14241 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14242 {
14243 struct Location backupYylloc = yylloc;
14244 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14245
14246 definedExpStack[definedExpStackPos++] = definedExp;
14247 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14248 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14249 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14250
14251 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14252 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14253 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14254 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14255
14256 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14257 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14258 echoOn = 0x0;
14259 parsedExpression = (((void *)0));
14260 resetScanner();
14261 expression_yyparse();
14262 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14263 if(backInput)
14264 fileInput = backInput;
14265 yylloc = backupYylloc;
14266 if(parsedExpression)
14267 {
14268 FreeIdentifier(id);
14269 exp->type = 5;
14270 exp->__anon1.list = MkListOne(parsedExpression);
14271 ApplyLocation(parsedExpression, &yylloc);
14272 ProcessExpressionType(exp);
14273 definedExpStackPos--;
14274 return ;
14275 }
14276 definedExpStackPos--;
14277 }
14278 else
14279 {
14280 if(inCompiler)
14281 {
14282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14283 }
14284 }
14285 }
14286 else
14287 {
14288 struct GlobalData * data = (((void *)0));
14289
14290 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14291 {
14292 char name[1024];
14293
14294 strcpy(name, thisNameSpace);
14295 strcat(name, "::");
14296 strcat(name, id->string);
14297 data = FindGlobalData(name);
14298 }
14299 if(!data)
14300 data = FindGlobalData(id->string);
14301 if(data)
14302 {
14303 DeclareGlobalData(data);
14304 exp->expType = data->dataType;
14305 if(data->dataType)
14306 data->dataType->refCount++;
14307 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14308 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14309 FreeSpecifier(id->_class);
14310 id->_class = (((void *)0));
14311 break;
14312 }
14313 else
14314 {
14315 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14316
14317 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14318 {
14319 char name[1024];
14320
14321 strcpy(name, thisNameSpace);
14322 strcat(name, "::");
14323 strcat(name, id->string);
14324 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14325 }
14326 if(!function)
14327 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14328 if(function)
14329 {
14330 char name[1024];
14331
14332 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14333 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14334 name[0] = (char)0;
14335 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14336 strcpy(name, "__ecereFunction_");
14337 FullClassNameCat(name, id->string, 0x0);
14338 if(DeclareFunction(function, name))
14339 {
14340 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14341 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14342 }
14343 exp->expType = function->dataType;
14344 if(function->dataType)
14345 function->dataType->refCount++;
14346 FreeSpecifier(id->_class);
14347 id->_class = (((void *)0));
14348 break;
14349 }
14350 }
14351 }
14352 }
14353 }
14354 unresolved = 0x1;
14355 break;
14356 }
14357 case 1:
14358 {
14359 struct __ecereNameSpace__ecere__com__Class * _class;
14360
14361 if(!exp->__anon1.instance->_class)
14362 {
14363 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14364 {
14365 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14366 }
14367 }
14368 ProcessInstantiationType(exp->__anon1.instance);
14369 exp->isConstant = exp->__anon1.instance->isConstant;
14370 if(exp->__anon1.instance->_class)
14371 {
14372 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14373 }
14374 break;
14375 }
14376 case 2:
14377 {
14378 if(!exp->expType)
14379 {
14380 char * constant = exp->__anon1.__anon1.constant;
14381 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14382
14383 exp->expType = type;
14384 if(constant[0] == '\'')
14385 {
14386 if((int)((unsigned char *)constant)[1] > 127)
14387 {
14388 int nb;
14389 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14390
14391 if(nb < 2)
14392 ch = constant[1];
14393 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14394 exp->__anon1.__anon1.constant = PrintUInt(ch);
14395 type->kind = 8;
14396 type->__anon1._class = FindClass("unichar");
14397 type->isSigned = 0x0;
14398 }
14399 else
14400 {
14401 type->kind = 1;
14402 type->isSigned = 0x1;
14403 }
14404 }
14405 else
14406 {
14407 char * dot = strchr(constant, '.');
14408 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14409 char * exponent;
14410
14411 if(isHex)
14412 {
14413 exponent = strchr(constant, 'p');
14414 if(!exponent)
14415 exponent = strchr(constant, 'P');
14416 }
14417 else
14418 {
14419 exponent = strchr(constant, 'e');
14420 if(!exponent)
14421 exponent = strchr(constant, 'E');
14422 }
14423 if(dot || exponent)
14424 {
14425 if(strchr(constant, 'f') || strchr(constant, 'F'))
14426 type->kind = 6;
14427 else
14428 type->kind = 7;
14429 type->isSigned = 0x1;
14430 }
14431 else
14432 {
14433 unsigned int isSigned = constant[0] == '-';
14434 char * endP = (((void *)0));
14435 long long i64 = strtoll(constant, &endP, 0);
14436 uint64 ui64 = strtoull(constant, &endP, 0);
14437 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14438
14439 if(isSigned)
14440 {
14441 if(i64 < (((int)0x80000000)))
14442 is64Bit = 0x1;
14443 }
14444 else
14445 {
14446 if(ui64 > (((int)0x7fffffff)))
14447 {
14448 if(ui64 > (0xffffffff))
14449 {
14450 is64Bit = 0x1;
14451 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14452 isSigned = 0x1;
14453 }
14454 }
14455 else if(constant[0] != '0' || !constant[1])
14456 isSigned = 0x1;
14457 }
14458 type->kind = is64Bit ? 4 : 3;
14459 type->isSigned = isSigned;
14460 }
14461 }
14462 exp->isConstant = 0x1;
14463 if(exp->destType && exp->destType->kind == 7)
14464 type->kind = 7;
14465 else if(exp->destType && exp->destType->kind == 6)
14466 type->kind = 6;
14467 else if(exp->destType && exp->destType->kind == 4)
14468 type->kind = 4;
14469 }
14470 break;
14471 }
14472 case 3:
14473 {
14474 exp->isConstant = 0x1;
14475 exp->expType = __extension__ ({
14476 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14477
14478 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14479 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14480
14481 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14482 }), __ecereInstance2;
14483 });
14484 break;
14485 }
14486 case 13:
14487 case 26:
14488 ProcessExpressionType(exp->__anon1._new.size);
14489 exp->expType = __extension__ ({
14490 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14491
14492 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14493 });
14494 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14495 break;
14496 case 14:
14497 case 27:
14498 ProcessExpressionType(exp->__anon1._renew.size);
14499 ProcessExpressionType(exp->__anon1._renew.exp);
14500 exp->expType = __extension__ ({
14501 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14502
14503 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14504 });
14505 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14506 break;
14507 case 4:
14508 {
14509 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14510 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14511 unsigned int useDestType = 0x0, useSideType = 0x0;
14512 struct Location oldyylloc = yylloc;
14513 unsigned int useSideUnit = 0x0;
14514 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14515 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14516
14517 switch(exp->__anon1.op.op)
14518 {
14519 case '=':
14520 case MUL_ASSIGN:
14521 case DIV_ASSIGN:
14522 case MOD_ASSIGN:
14523 case ADD_ASSIGN:
14524 case SUB_ASSIGN:
14525 case LEFT_ASSIGN:
14526 case RIGHT_ASSIGN:
14527 case AND_ASSIGN:
14528 case XOR_ASSIGN:
14529 case OR_ASSIGN:
14530 assign = 0x1;
14531 break;
14532 case '!':
14533 break;
14534 case AND_OP:
14535 case OR_OP:
14536 boolOps = 0x1;
14537 boolResult = 0x1;
14538 break;
14539 case EQ_OP:
14540 case '<':
14541 case '>':
14542 case LE_OP:
14543 case GE_OP:
14544 case NE_OP:
14545 boolResult = 0x1;
14546 useSideType = 0x1;
14547 break;
14548 case '+':
14549 case '-':
14550 useSideUnit = 0x1;
14551 useSideType = 0x1;
14552 useDestType = 0x1;
14553 break;
14554 case LEFT_OP:
14555 case RIGHT_OP:
14556 useSideType = 0x1;
14557 useDestType = 0x1;
14558 break;
14559 case '|':
14560 case '^':
14561 useSideType = 0x1;
14562 useDestType = 0x1;
14563 break;
14564 case '/':
14565 case '%':
14566 useSideType = 0x1;
14567 useDestType = 0x1;
14568 break;
14569 case '&':
14570 case '*':
14571 if(exp->__anon1.op.exp1)
14572 {
14573 useSideType = 0x1;
14574 useDestType = 0x1;
14575 }
14576 break;
14577 }
14578 if(exp->__anon1.op.op == '&')
14579 {
14580 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14581 {
14582 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14583 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14584
14585 if(symbol && symbol->isIterator == 2)
14586 {
14587 exp->type = 8;
14588 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14589 exp->__anon1.member.member = MkIdentifier("key");
14590 exp->expType = (((void *)0));
14591 exp->__anon1.op.exp2->expType = symbol->type;
14592 symbol->type->refCount++;
14593 ProcessExpressionType(exp);
14594 FreeType(dummy);
14595 break;
14596 }
14597 }
14598 }
14599 if(exp->__anon1.op.exp1)
14600 {
14601 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14602 useDestType = 0x0;
14603 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14604 {
14605 if(exp->__anon1.op.exp1->destType)
14606 FreeType(exp->__anon1.op.exp1->destType);
14607 exp->__anon1.op.exp1->destType = exp->destType;
14608 exp->__anon1.op.exp1->opDestType = 0x1;
14609 if(exp->destType)
14610 exp->destType->refCount++;
14611 }
14612 else if(!assign)
14613 {
14614 if(exp->__anon1.op.exp1->destType)
14615 FreeType(exp->__anon1.op.exp1->destType);
14616 exp->__anon1.op.exp1->destType = dummy;
14617 dummy->refCount++;
14618 }
14619 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14620 exp->__anon1.op.exp1->destType->count++;
14621 ProcessExpressionType(exp->__anon1.op.exp1);
14622 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14623 exp->__anon1.op.exp1->destType->count--;
14624 exp->__anon1.op.exp1->opDestType = 0x0;
14625 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)
14626 {
14627 exp->__anon1.op.exp2 = MkExpConstant("1");
14628 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14629 assign = 0x1;
14630 }
14631 if(exp->__anon1.op.exp1->destType == dummy)
14632 {
14633 FreeType(dummy);
14634 exp->__anon1.op.exp1->destType = (((void *)0));
14635 }
14636 type1 = exp->__anon1.op.exp1->expType;
14637 }
14638 if(exp->__anon1.op.exp2)
14639 {
14640 char expString[10240];
14641
14642 expString[0] = '\0';
14643 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14644 {
14645 if(exp->__anon1.op.exp1)
14646 {
14647 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14648 if(exp->__anon1.op.exp1->expType)
14649 exp->__anon1.op.exp1->expType->refCount++;
14650 }
14651 else
14652 {
14653 exp->__anon1.op.exp2->destType = exp->destType;
14654 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14655 exp->__anon1.op.exp2->opDestType = 0x1;
14656 if(exp->destType)
14657 exp->destType->refCount++;
14658 }
14659 if(type1)
14660 type1->refCount++;
14661 exp->expType = type1;
14662 }
14663 else if(assign)
14664 {
14665 if(inCompiler)
14666 PrintExpression(exp->__anon1.op.exp2, expString);
14667 if(type1 && type1->kind == 13)
14668 {
14669 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)
14670 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14671 else if(exp->__anon1.op.op == '=')
14672 {
14673 if(exp->__anon1.op.exp2->destType)
14674 FreeType(exp->__anon1.op.exp2->destType);
14675 exp->__anon1.op.exp2->destType = type1;
14676 if(type1)
14677 type1->refCount++;
14678 }
14679 }
14680 else
14681 {
14682 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)
14683 ;
14684 else
14685 {
14686 if(exp->__anon1.op.exp2->destType)
14687 FreeType(exp->__anon1.op.exp2->destType);
14688 exp->__anon1.op.exp2->destType = type1;
14689 if(type1)
14690 type1->refCount++;
14691 }
14692 }
14693 if(type1)
14694 type1->refCount++;
14695 exp->expType = type1;
14696 }
14697 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14698 {
14699 if(exp->__anon1.op.exp2->destType)
14700 FreeType(exp->__anon1.op.exp2->destType);
14701 exp->__anon1.op.exp2->destType = exp->destType;
14702 if(exp->__anon1.op.op != '&')
14703 exp->__anon1.op.exp2->opDestType = 0x1;
14704 if(exp->destType)
14705 exp->destType->refCount++;
14706 }
14707 else
14708 {
14709 if(exp->__anon1.op.exp2->destType)
14710 FreeType(exp->__anon1.op.exp2->destType);
14711 exp->__anon1.op.exp2->destType = dummy;
14712 dummy->refCount++;
14713 }
14714 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))
14715 {
14716 FreeType(exp->__anon1.op.exp2->destType);
14717 exp->__anon1.op.exp2->destType = type1;
14718 type1->refCount++;
14719 }
14720 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14721 exp->__anon1.op.exp2->destType->count++;
14722 if(exp->__anon1.op.op == SIZEOF)
14723 {
14724 struct Expression * e = exp->__anon1.op.exp2;
14725
14726 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14727 {
14728 if(e->type == 5 || e->type == 32 || e->type == 23)
14729 {
14730 if(e->type == 23)
14731 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14732 else
14733 e = (*e->__anon1.list).last;
14734 }
14735 }
14736 if(e->type == 11 && e->__anon1.cast.exp)
14737 e->__anon1.cast.exp->needCast = 0x1;
14738 }
14739 ProcessExpressionType(exp->__anon1.op.exp2);
14740 exp->__anon1.op.exp2->opDestType = 0x0;
14741 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14742 exp->__anon1.op.exp2->destType->count--;
14743 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14744 {
14745 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)
14746 {
14747 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14749 }
14750 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)))
14751 {
14752 if(exp->__anon1.op.op == ADD_ASSIGN)
14753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14754 }
14755 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))
14756 {
14757 if(exp->__anon1.op.op == ADD_ASSIGN)
14758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14759 }
14760 else if(inCompiler)
14761 {
14762 char type1String[1024];
14763 char type2String[1024];
14764
14765 type1String[0] = '\0';
14766 type2String[0] = '\0';
14767 PrintType(exp->__anon1.op.exp2->expType, type1String, 0x0, 0x1);
14768 PrintType(type1, type2String, 0x0, 0x1);
14769 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14770 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14771 }
14772 }
14773 if(exp->__anon1.op.exp2->destType == dummy)
14774 {
14775 FreeType(dummy);
14776 exp->__anon1.op.exp2->destType = (((void *)0));
14777 }
14778 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14779 {
14780 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14781 type2->refCount = 1;
14782 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14783 type2->isSigned = 0x1;
14784 }
14785 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))
14786 {
14787 type2 = __extension__ ({
14788 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14789
14790 __ecereInstance1->kind = 3, __ecereInstance1;
14791 });
14792 type2->refCount = 1;
14793 type2->isSigned = 0x1;
14794 }
14795 else
14796 {
14797 type2 = exp->__anon1.op.exp2->expType;
14798 if(type2)
14799 type2->refCount++;
14800 }
14801 }
14802 dummy->kind = 0;
14803 if(exp->__anon1.op.op == SIZEOF)
14804 {
14805 exp->expType = __extension__ ({
14806 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14807
14808 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14809 });
14810 exp->isConstant = 0x1;
14811 }
14812 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14813 {
14814 exp->expType = Dereference(type2);
14815 if(type2 && type2->kind == 8)
14816 notByReference = 0x1;
14817 }
14818 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14819 exp->expType = Reference(type2);
14820 else if(!assign)
14821 {
14822 if(boolOps)
14823 {
14824 if(exp->__anon1.op.exp1)
14825 {
14826 if(exp->__anon1.op.exp1->destType)
14827 FreeType(exp->__anon1.op.exp1->destType);
14828 exp->__anon1.op.exp1->destType = MkClassType("bool");
14829 exp->__anon1.op.exp1->destType->truth = 0x1;
14830 if(!exp->__anon1.op.exp1->expType)
14831 ProcessExpressionType(exp->__anon1.op.exp1);
14832 else
14833 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
14834 FreeType(exp->__anon1.op.exp1->expType);
14835 exp->__anon1.op.exp1->expType = MkClassType("bool");
14836 exp->__anon1.op.exp1->expType->truth = 0x1;
14837 }
14838 if(exp->__anon1.op.exp2)
14839 {
14840 if(exp->__anon1.op.exp2->destType)
14841 FreeType(exp->__anon1.op.exp2->destType);
14842 exp->__anon1.op.exp2->destType = MkClassType("bool");
14843 exp->__anon1.op.exp2->destType->truth = 0x1;
14844 if(!exp->__anon1.op.exp2->expType)
14845 ProcessExpressionType(exp->__anon1.op.exp2);
14846 else
14847 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
14848 FreeType(exp->__anon1.op.exp2->expType);
14849 exp->__anon1.op.exp2->expType = MkClassType("bool");
14850 exp->__anon1.op.exp2->expType->truth = 0x1;
14851 }
14852 }
14853 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")))))
14854 {
14855 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"))))
14856 {
14857 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)))
14858 {
14859 struct Type * intType;
14860
14861 if(!type1->__anon1._class->__anon1.registered->dataType)
14862 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14863 if(!type2->__anon1._class->__anon1.registered->dataType)
14864 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14865 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14866 if(exp->__anon1.op.exp1->destType)
14867 FreeType(exp->__anon1.op.exp1->destType);
14868 if(exp->__anon1.op.exp2->destType)
14869 FreeType(exp->__anon1.op.exp2->destType);
14870 exp->__anon1.op.exp1->destType = intType;
14871 exp->__anon1.op.exp2->destType = intType;
14872 intType->refCount++;
14873 }
14874 else
14875 {
14876 if(exp->__anon1.op.exp2->destType)
14877 FreeType(exp->__anon1.op.exp2->destType);
14878 exp->__anon1.op.exp2->destType = type1;
14879 type1->refCount++;
14880 if(exp->__anon1.op.exp1->destType)
14881 FreeType(exp->__anon1.op.exp1->destType);
14882 exp->__anon1.op.exp1->destType = type2;
14883 type2->refCount++;
14884 }
14885 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)
14886 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);
14887 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14888 {
14889 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14890
14891 if(argExp)
14892 {
14893 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14894
14895 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14896 ProcessExpressionType(exp->__anon1.op.exp1);
14897 if(type2->kind != 13)
14898 {
14899 ProcessExpressionType(classExp);
14900 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
14901 if(!exp->__anon1.op.exp2->expType)
14902 {
14903 if(type2)
14904 FreeType(type2);
14905 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0x0);
14906 type2->refCount++;
14907 }
14908 ProcessExpressionType(exp->__anon1.op.exp2);
14909 }
14910 }
14911 }
14912 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)))
14913 {
14914 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14916 exp->expType = type1;
14917 if(type1)
14918 type1->refCount++;
14919 }
14920 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)))
14921 {
14922 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14923 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14924 exp->expType = type2;
14925 if(type2)
14926 type2->refCount++;
14927 }
14928 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))
14929 {
14930 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14931 }
14932 else
14933 {
14934 unsigned int success = 0x0;
14935
14936 if(type1->kind == 13 && type2->kind == 13)
14937 {
14938 if(exp->__anon1.op.op == '+')
14939 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14940 else if(exp->__anon1.op.op == '-')
14941 {
14942 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, 0x0))
14943 {
14944 exp->expType = __extension__ ({
14945 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14946
14947 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14948 });
14949 success = 0x1;
14950 if(type1->__anon1.type->kind == 20)
14951 {
14952 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14953
14954 if(argExp)
14955 {
14956 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14957
14958 ProcessExpressionType(classExp);
14959 exp->type = 5;
14960 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)))))), '/', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
14961 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
14962 FreeType(dummy);
14963 return ;
14964 }
14965 }
14966 }
14967 }
14968 }
14969 if(!success && exp->__anon1.op.exp1->type == 2)
14970 {
14971 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
14972 {
14973 if(exp->expType)
14974 FreeType(exp->expType);
14975 exp->expType = exp->__anon1.op.exp1->destType;
14976 if(exp->__anon1.op.exp1->destType)
14977 exp->__anon1.op.exp1->destType->refCount++;
14978 success = 0x1;
14979 }
14980 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14981 {
14982 if(exp->expType)
14983 FreeType(exp->expType);
14984 exp->expType = exp->__anon1.op.exp2->destType;
14985 if(exp->__anon1.op.exp2->destType)
14986 exp->__anon1.op.exp2->destType->refCount++;
14987 success = 0x1;
14988 }
14989 }
14990 else if(!success)
14991 {
14992 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14993 {
14994 if(exp->expType)
14995 FreeType(exp->expType);
14996 exp->expType = exp->__anon1.op.exp2->destType;
14997 if(exp->__anon1.op.exp2->destType)
14998 exp->__anon1.op.exp2->destType->refCount++;
14999 success = 0x1;
15000 }
15001 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15002 {
15003 if(exp->expType)
15004 FreeType(exp->expType);
15005 exp->expType = exp->__anon1.op.exp1->destType;
15006 if(exp->__anon1.op.exp1->destType)
15007 exp->__anon1.op.exp1->destType->refCount++;
15008 success = 0x1;
15009 }
15010 }
15011 if(!success)
15012 {
15013 char expString1[10240];
15014 char expString2[10240];
15015 char type1[1024];
15016 char type2[1024];
15017
15018 expString1[0] = '\0';
15019 expString2[0] = '\0';
15020 type1[0] = '\0';
15021 type2[0] = '\0';
15022 if(inCompiler)
15023 {
15024 PrintExpression(exp->__anon1.op.exp1, expString1);
15025 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15026 PrintExpression(exp->__anon1.op.exp2, expString2);
15027 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15028 PrintType(exp->__anon1.op.exp1->expType, type1, 0x0, 0x1);
15029 PrintType(exp->__anon1.op.exp2->expType, type2, 0x0, 0x1);
15030 }
15031 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15032 }
15033 }
15034 }
15035 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)
15036 {
15037 if(exp->__anon1.op.exp1->destType)
15038 FreeType(exp->__anon1.op.exp1->destType);
15039 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15040 if(type2->__anon1._class->__anon1.registered->dataType)
15041 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15042 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15043 exp->expType = type2;
15044 if(type2)
15045 type2->refCount++;
15046 }
15047 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)
15048 {
15049 if(exp->__anon1.op.exp2->destType)
15050 FreeType(exp->__anon1.op.exp2->destType);
15051 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15052 if(type1->__anon1._class->__anon1.registered->dataType)
15053 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15054 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15055 exp->expType = type1;
15056 if(type1)
15057 type1->refCount++;
15058 }
15059 else if(type1)
15060 {
15061 unsigned int valid = 0x0;
15062
15063 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15064 {
15065 if(exp->__anon1.op.exp2->destType)
15066 FreeType(exp->__anon1.op.exp2->destType);
15067 if(!type1->__anon1._class->__anon1.registered->dataType)
15068 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15069 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15070 exp->__anon1.op.exp2->destType->refCount++;
15071 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15072 if(type2)
15073 FreeType(type2);
15074 type2 = exp->__anon1.op.exp2->destType;
15075 if(type2)
15076 type2->refCount++;
15077 exp->expType = type2;
15078 type2->refCount++;
15079 }
15080 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15081 {
15082 if(exp->__anon1.op.exp1->destType)
15083 FreeType(exp->__anon1.op.exp1->destType);
15084 if(!type2->__anon1._class->__anon1.registered->dataType)
15085 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15086 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15087 exp->__anon1.op.exp1->destType->refCount++;
15088 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15089 type1 = exp->__anon1.op.exp1->destType;
15090 exp->expType = type1;
15091 type1->refCount++;
15092 }
15093 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15094 {
15095 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15096 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15097
15098 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15099 {
15100 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15101 {
15102 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15103 {
15104 if(exp->expType)
15105 FreeType(exp->expType);
15106 exp->expType = exp->__anon1.op.exp2->expType;
15107 if(exp->__anon1.op.exp2->expType)
15108 exp->__anon1.op.exp2->expType->refCount++;
15109 valid = 0x1;
15110 }
15111 }
15112 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15113 {
15114 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15115 {
15116 if(exp->expType)
15117 FreeType(exp->expType);
15118 exp->expType = exp->__anon1.op.exp1->expType;
15119 if(exp->__anon1.op.exp1->expType)
15120 exp->__anon1.op.exp1->expType->refCount++;
15121 valid = 0x1;
15122 }
15123 }
15124 }
15125 else
15126 {
15127 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15128 {
15129 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15130 {
15131 if(exp->expType)
15132 FreeType(exp->expType);
15133 exp->expType = exp->__anon1.op.exp1->expType;
15134 if(exp->__anon1.op.exp1->expType)
15135 exp->__anon1.op.exp1->expType->refCount++;
15136 valid = 0x1;
15137 }
15138 }
15139 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15140 {
15141 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15142 {
15143 if(exp->expType)
15144 FreeType(exp->expType);
15145 exp->expType = exp->__anon1.op.exp2->expType;
15146 if(exp->__anon1.op.exp2->expType)
15147 exp->__anon1.op.exp2->expType->refCount++;
15148 valid = 0x1;
15149 }
15150 }
15151 }
15152 }
15153 if(!valid)
15154 {
15155 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))
15156 {
15157 if(exp->__anon1.op.exp1->destType)
15158 FreeType(exp->__anon1.op.exp1->destType);
15159 exp->__anon1.op.exp1->destType = type2;
15160 type2->refCount++;
15161 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15162 {
15163 if(exp->expType)
15164 FreeType(exp->expType);
15165 exp->expType = exp->__anon1.op.exp1->destType;
15166 if(exp->__anon1.op.exp1->destType)
15167 exp->__anon1.op.exp1->destType->refCount++;
15168 }
15169 }
15170 else
15171 {
15172 if(exp->__anon1.op.exp2->destType)
15173 FreeType(exp->__anon1.op.exp2->destType);
15174 exp->__anon1.op.exp2->destType = type1;
15175 type1->refCount++;
15176 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
15177 {
15178 if(exp->expType)
15179 FreeType(exp->expType);
15180 exp->expType = exp->__anon1.op.exp2->destType;
15181 if(exp->__anon1.op.exp2->destType)
15182 exp->__anon1.op.exp2->destType->refCount++;
15183 }
15184 else if(type1 && type2)
15185 {
15186 char expString1[10240];
15187 char expString2[10240];
15188 char type1String[1024];
15189 char type2String[1024];
15190
15191 expString1[0] = '\0';
15192 expString2[0] = '\0';
15193 type1String[0] = '\0';
15194 type2String[0] = '\0';
15195 if(inCompiler)
15196 {
15197 PrintExpression(exp->__anon1.op.exp1, expString1);
15198 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15199 PrintExpression(exp->__anon1.op.exp2, expString2);
15200 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15201 PrintType(exp->__anon1.op.exp1->expType, type1String, 0x0, 0x1);
15202 PrintType(exp->__anon1.op.exp2->expType, type2String, 0x0, 0x1);
15203 }
15204 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15205 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15206 {
15207 exp->expType = exp->__anon1.op.exp1->expType;
15208 if(exp->__anon1.op.exp1->expType)
15209 exp->__anon1.op.exp1->expType->refCount++;
15210 }
15211 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15212 {
15213 exp->expType = exp->__anon1.op.exp2->expType;
15214 if(exp->__anon1.op.exp2->expType)
15215 exp->__anon1.op.exp2->expType->refCount++;
15216 }
15217 }
15218 }
15219 }
15220 }
15221 else if(type2)
15222 {
15223 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15224 {
15225 struct Type * oldType = exp->__anon1.op.exp1->expType;
15226
15227 exp->__anon1.op.exp1->expType = (((void *)0));
15228 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15229 FreeType(oldType);
15230 else
15231 exp->__anon1.op.exp1->expType = oldType;
15232 }
15233 if(exp->__anon1.op.exp1->destType)
15234 FreeType(exp->__anon1.op.exp1->destType);
15235 exp->__anon1.op.exp1->destType = type2;
15236 type2->refCount++;
15237 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15238 {
15239 if(exp->expType)
15240 FreeType(exp->expType);
15241 exp->expType = exp->__anon1.op.exp1->destType;
15242 if(exp->__anon1.op.exp1->destType)
15243 exp->__anon1.op.exp1->destType->refCount++;
15244 }
15245 }
15246 }
15247 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15248 {
15249 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15250 {
15251 if(exp->__anon1.op.exp1->destType)
15252 FreeType(exp->__anon1.op.exp1->destType);
15253 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15254 if(type2->__anon1._class->__anon1.registered->dataType)
15255 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15256 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15257 }
15258 if(exp->__anon1.op.op == '!')
15259 {
15260 exp->expType = MkClassType("bool");
15261 exp->expType->truth = 0x1;
15262 }
15263 else
15264 {
15265 exp->expType = type2;
15266 if(type2)
15267 type2->refCount++;
15268 }
15269 }
15270 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15271 {
15272 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15273 {
15274 if(exp->__anon1.op.exp2->destType)
15275 FreeType(exp->__anon1.op.exp2->destType);
15276 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15277 if(type1->__anon1._class->__anon1.registered->dataType)
15278 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15279 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15280 }
15281 exp->expType = type1;
15282 if(type1)
15283 type1->refCount++;
15284 }
15285 }
15286 yylloc = exp->loc;
15287 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15288 {
15289 char expString[10000];
15290
15291 expString[0] = '\0';
15292 if(inCompiler)
15293 {
15294 PrintExpression(exp->__anon1.op.exp1, expString);
15295 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15296 }
15297 if(expString[0])
15298 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15299 }
15300 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15301 {
15302 char expString[10240];
15303
15304 expString[0] = '\0';
15305 if(inCompiler)
15306 {
15307 PrintExpression(exp->__anon1.op.exp2, expString);
15308 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15309 }
15310 if(expString[0])
15311 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15312 }
15313 if(boolResult)
15314 {
15315 FreeType(exp->expType);
15316 exp->expType = MkClassType("bool");
15317 exp->expType->truth = 0x1;
15318 }
15319 if(exp->__anon1.op.op != SIZEOF)
15320 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15321 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15322 {
15323 DeclareType(exp->__anon1.op.exp2->expType, 0x0, 0x0);
15324 }
15325 yylloc = oldyylloc;
15326 FreeType(dummy);
15327 if(type2)
15328 FreeType(type2);
15329 break;
15330 }
15331 case 5:
15332 case 32:
15333 {
15334 struct Expression * e;
15335
15336 exp->isConstant = 0x1;
15337 for(e = (*exp->__anon1.list).first; e; e = e->next)
15338 {
15339 unsigned int inced = 0x0;
15340
15341 if(!e->next)
15342 {
15343 FreeType(e->destType);
15344 e->opDestType = exp->opDestType;
15345 e->destType = exp->destType;
15346 if(e->destType)
15347 {
15348 exp->destType->refCount++;
15349 e->destType->count++;
15350 inced = 0x1;
15351 }
15352 }
15353 ProcessExpressionType(e);
15354 if(inced)
15355 exp->destType->count--;
15356 if(!exp->expType && !e->next)
15357 {
15358 exp->expType = e->expType;
15359 if(e->expType)
15360 e->expType->refCount++;
15361 }
15362 if(!e->isConstant)
15363 exp->isConstant = 0x0;
15364 }
15365 e = (*exp->__anon1.list).first;
15366 if(!e->next && e->type == 8)
15367 {
15368 struct Expression * next = exp->next, * prev = exp->prev;
15369
15370 FreeType(exp->expType);
15371 FreeType(exp->destType);
15372 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15373 *exp = *e;
15374 exp->prev = prev;
15375 exp->next = next;
15376 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15377 ProcessExpressionType(exp);
15378 }
15379 break;
15380 }
15381 case 6:
15382 {
15383 struct Expression * e;
15384
15385 exp->isConstant = 0x1;
15386 ProcessExpressionType(exp->__anon1.index.exp);
15387 if(!exp->__anon1.index.exp->isConstant)
15388 exp->isConstant = 0x0;
15389 if(exp->__anon1.index.exp->expType)
15390 {
15391 struct Type * source = exp->__anon1.index.exp->expType;
15392
15393 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15394 {
15395 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15396 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15397
15398 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15399 {
15400 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0x0);
15401 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15402 {
15403 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0x0);
15404
15405 if(type->kind == 8)
15406 type->constant = 0x1;
15407 else if(type->kind == 13)
15408 {
15409 struct Type * t = type;
15410
15411 while(t->kind == 13)
15412 t = t->__anon1.type;
15413 t->constant = 0x1;
15414 }
15415 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15416 }
15417 }
15418 }
15419 }
15420 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15421 {
15422 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15423 {
15424 if(e->destType)
15425 FreeType(e->destType);
15426 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15427 }
15428 ProcessExpressionType(e);
15429 if(!e->next)
15430 {
15431 }
15432 if(!e->isConstant)
15433 exp->isConstant = 0x0;
15434 }
15435 if(!exp->expType)
15436 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15437 if(exp->expType)
15438 DeclareType(exp->expType, 0x0, 0x0);
15439 break;
15440 }
15441 case 7:
15442 {
15443 struct Expression * e;
15444 struct Type * functionType;
15445 struct Type * methodType = (((void *)0));
15446 char name[1024];
15447
15448 name[0] = '\0';
15449 if(inCompiler)
15450 {
15451 PrintExpression(exp->__anon1.call.exp, name);
15452 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15453 {
15454 PrintExpression(exp->__anon1.call.exp, name);
15455 }
15456 }
15457 if(exp->__anon1.call.exp->type == 0)
15458 {
15459 struct Expression * idExp = exp->__anon1.call.exp;
15460 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15461
15462 if(!strcmp(id->string, "__builtin_frame_address"))
15463 {
15464 exp->expType = ProcessTypeString("void *", 0x1);
15465 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15466 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15467 break;
15468 }
15469 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15470 {
15471 exp->expType = ProcessTypeString("int", 0x1);
15472 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15473 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15474 break;
15475 }
15476 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15477 {
15478 struct Expression * a = (((void *)0));
15479 struct Expression * b = (((void *)0));
15480 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15481
15482 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15483 {
15484 a = (*exp->__anon1.call.arguments).first;
15485 b = (*exp->__anon1.call.arguments).last;
15486 tempExp1 = a;
15487 tempExp2 = b;
15488 }
15489 else if((*exp->__anon1.call.arguments).count == 1)
15490 {
15491 a = (*exp->__anon1.call.arguments).first;
15492 tempExp1 = a;
15493 }
15494 if(a)
15495 {
15496 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15497 idExp->__anon1.__anon1.identifier = (((void *)0));
15498 FreeExpContents(exp);
15499 ProcessExpressionType(a);
15500 if(b)
15501 ProcessExpressionType(b);
15502 exp->type = 5;
15503 exp->__anon1.list = MkList();
15504 if(a->expType && (!b || b->expType))
15505 {
15506 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15507 {
15508 if(inCompiler)
15509 {
15510 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15511 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15512 struct Declaration * decl;
15513 char temp1[1024], temp2[1024];
15514
15515 GetTypeSpecs(a->expType, specs);
15516 if(a && !a->isConstant && a->type != 0)
15517 {
15518 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15519 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15520 tempExp1 = QMkExpId(temp1);
15521 tempExp1->expType = a->expType;
15522 if(a->expType)
15523 a->expType->refCount++;
15524 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15525 }
15526 if(b && !b->isConstant && b->type != 0)
15527 {
15528 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15529 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15530 tempExp2 = QMkExpId(temp2);
15531 tempExp2->expType = b->expType;
15532 if(b->expType)
15533 b->expType->refCount++;
15534 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15535 }
15536 decl = MkDeclaration(specs, decls);
15537 if(!curCompound->__anon1.compound.declarations)
15538 curCompound->__anon1.compound.declarations = MkList();
15539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15540 }
15541 }
15542 }
15543 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15544 {
15545 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15546
15547 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15548 exp->expType = a->expType;
15549 if(a->expType)
15550 a->expType->refCount++;
15551 }
15552 else if(!strcmp(id->string, "Abs"))
15553 {
15554 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15555 exp->expType = a->expType;
15556 if(a->expType)
15557 a->expType->refCount++;
15558 }
15559 else if(!strcmp(id->string, "Sgn"))
15560 {
15561 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '!', CopyExpression(tempExp1)))), MkListOne(MkExpConstant("0")), MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpConstant("-1")), MkExpConstant("1"))))));
15562 exp->expType = ProcessTypeString("int", 0x0);
15563 }
15564 FreeExpression(tempExp1);
15565 if(tempExp2)
15566 FreeExpression(tempExp2);
15567 FreeIdentifier(id);
15568 break;
15569 }
15570 }
15571 }
15572 {
15573 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15574
15575 if(!exp->__anon1.call.exp->destType)
15576 {
15577 exp->__anon1.call.exp->destType = dummy;
15578 dummy->refCount++;
15579 }
15580 ProcessExpressionType(exp->__anon1.call.exp);
15581 if(exp->__anon1.call.exp->destType == dummy)
15582 {
15583 FreeType(dummy);
15584 exp->__anon1.call.exp->destType = (((void *)0));
15585 }
15586 FreeType(dummy);
15587 }
15588 functionType = exp->__anon1.call.exp->expType;
15589 if(functionType && functionType->kind == 16)
15590 {
15591 methodType = functionType;
15592 functionType = methodType->__anon1.__anon3.method->dataType;
15593 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15594 {
15595 char typeString[1024];
15596
15597 typeString[0] = '\0';
15598 {
15599 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15600
15601 functionType->__anon1.__anon2.thisClass = (((void *)0));
15602 PrintType(functionType, typeString, 0x1, 0x1);
15603 functionType->__anon1.__anon2.thisClass = back;
15604 }
15605 if(strstr(typeString, "thisclass"))
15606 {
15607 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15608 struct Declarator * decl;
15609
15610 {
15611 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15612
15613 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15614 if(thisClass != (exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass ? exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass : exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass))
15615 thisClassParams = 0x0;
15616 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15617 {
15618 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15619
15620 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15621 ProcessDeclarator(decl);
15622 thisClass = backupThisClass;
15623 }
15624 thisClassParams = 0x1;
15625 functionType = ProcessType(specs, decl);
15626 functionType->refCount = 0;
15627 FinishTemplatesContext(context);
15628 }
15629 FreeList(specs, FreeSpecifier);
15630 FreeDeclarator(decl);
15631 }
15632 }
15633 }
15634 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15635 {
15636 struct Type * type = functionType->__anon1.type;
15637
15638 if(!functionType->refCount)
15639 {
15640 functionType->__anon1.type = (((void *)0));
15641 FreeType(functionType);
15642 }
15643 functionType = type;
15644 }
15645 if(functionType && functionType->kind != 11)
15646 {
15647 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15648 }
15649 else if(functionType)
15650 {
15651 unsigned int emptyParams = 0x0, noParams = 0x0;
15652 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15653 struct Type * type = functionType->__anon1.__anon2.params.first;
15654 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15655 int extra = 0;
15656 struct Location oldyylloc = yylloc;
15657
15658 if(!type)
15659 emptyParams = 0x1;
15660 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15661 {
15662 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15663 e = e->next;
15664 }
15665 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15666 {
15667 if(memberExp && memberExp->__anon1.member.exp && memberExp->__anon1.member.exp->expType && memberExp->__anon1.member.exp->expType->kind == 19 && memberExp->__anon1.member.exp->expType->__anon1._class)
15668 {
15669 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15670 if(e)
15671 {
15672 e->destType = type;
15673 e = e->next;
15674 type = functionType->__anon1.__anon2.params.first;
15675 }
15676 else
15677 type->refCount = 0;
15678 }
15679 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15680 {
15681 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15682 type->byReference = functionType->byReference;
15683 type->typedByReference = functionType->typedByReference;
15684 if(e)
15685 {
15686 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15687 e = e->next;
15688 e->destType = type;
15689 e = e->next;
15690 type = functionType->__anon1.__anon2.params.first;
15691 }
15692 else
15693 type->refCount = 0;
15694 }
15695 }
15696 if(type && type->kind == 0)
15697 {
15698 noParams = 0x1;
15699 if(!type->refCount)
15700 FreeType(type);
15701 type = (((void *)0));
15702 }
15703 for(; e; e = e->next)
15704 {
15705 if(!type && !emptyParams)
15706 {
15707 yylloc = e->loc;
15708 if(methodType && methodType->__anon1.__anon3.methodClass)
15709 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15710 else
15711 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
15712 break;
15713 }
15714 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15715 {
15716 struct Type * templatedType = (((void *)0));
15717 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15718 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15719 int id = 0;
15720
15721 if(_class && _class->templateArgs)
15722 {
15723 struct __ecereNameSpace__ecere__com__Class * sClass;
15724
15725 for(sClass = _class; sClass; sClass = sClass->base)
15726 {
15727 if(sClass->templateClass)
15728 sClass = sClass->templateClass;
15729 id = 0;
15730 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15731 {
15732 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15733 {
15734 struct __ecereNameSpace__ecere__com__Class * nextClass;
15735
15736 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15737 {
15738 if(nextClass->templateClass)
15739 nextClass = nextClass->templateClass;
15740 id += nextClass->templateParams.count;
15741 }
15742 break;
15743 }
15744 id++;
15745 }
15746 if(curParam)
15747 break;
15748 }
15749 }
15750 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15751 {
15752 unsigned int constant = type->constant;
15753 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15754
15755 {
15756 struct Context * context = SetupTemplatesContext(_class);
15757
15758 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
15759 FinishTemplatesContext(context);
15760 }
15761 if(templatedType->kind == 8 && constant)
15762 templatedType->constant = 0x1;
15763 else if(templatedType->kind == 13)
15764 {
15765 struct Type * t = templatedType->__anon1.type;
15766
15767 while(t->kind == 13)
15768 t = t->__anon1.type;
15769 if(constant)
15770 t->constant = constant;
15771 }
15772 e->destType = templatedType;
15773 if(templatedType)
15774 {
15775 templatedType->passAsTemplate = 0x1;
15776 }
15777 }
15778 else
15779 {
15780 e->destType = type;
15781 if(type)
15782 type->refCount++;
15783 }
15784 }
15785 else
15786 {
15787 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15788 {
15789 e->destType = type->prev;
15790 e->destType->refCount++;
15791 }
15792 else
15793 {
15794 e->destType = type;
15795 if(type)
15796 type->refCount++;
15797 }
15798 }
15799 if(type && type->kind != 14)
15800 {
15801 struct Type * next = type->next;
15802
15803 if(!type->refCount)
15804 FreeType(type);
15805 type = next;
15806 }
15807 }
15808 if(type && type->kind != 14)
15809 {
15810 if(methodType && methodType->__anon1.__anon3.methodClass)
15811 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15812 else
15813 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
15814 }
15815 yylloc = oldyylloc;
15816 if(type && !type->refCount)
15817 FreeType(type);
15818 }
15819 else
15820 {
15821 functionType = __extension__ ({
15822 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15823
15824 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15825 });
15826 if(exp->__anon1.call.exp->type == 0)
15827 {
15828 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15829
15830 if(inCompiler)
15831 {
15832 struct Symbol * symbol;
15833 struct Location oldyylloc = yylloc;
15834
15835 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15836 if(strstr(string, "__builtin_") == string)
15837 {
15838 if(exp->destType)
15839 {
15840 functionType->__anon1.__anon2.returnType = exp->destType;
15841 exp->destType->refCount++;
15842 }
15843 }
15844 else
15845 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15846 symbol = __extension__ ({
15847 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15848
15849 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15850 });
15851 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15852 if(strstr(symbol->string, "::"))
15853 globalContext->hasNameSpace = 0x1;
15854 yylloc = oldyylloc;
15855 }
15856 }
15857 else if(exp->__anon1.call.exp->type == 8)
15858 {
15859 }
15860 else
15861 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15862 if(!functionType->__anon1.__anon2.returnType)
15863 {
15864 functionType->__anon1.__anon2.returnType = __extension__ ({
15865 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15866
15867 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15868 });
15869 }
15870 }
15871 if(functionType && functionType->kind == 11)
15872 {
15873 exp->expType = functionType->__anon1.__anon2.returnType;
15874 if(functionType->__anon1.__anon2.returnType)
15875 functionType->__anon1.__anon2.returnType->refCount++;
15876 if(!functionType->refCount)
15877 FreeType(functionType);
15878 }
15879 if(exp->__anon1.call.arguments)
15880 {
15881 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15882 {
15883 struct Type * destType = e->destType;
15884
15885 ProcessExpressionType(e);
15886 }
15887 }
15888 break;
15889 }
15890 case 8:
15891 {
15892 struct Type * type;
15893 struct Location oldyylloc = yylloc;
15894 unsigned int thisPtr;
15895 struct Expression * checkExp = exp->__anon1.member.exp;
15896
15897 while(checkExp)
15898 {
15899 if(checkExp->type == 11)
15900 checkExp = checkExp->__anon1.cast.exp;
15901 else if(checkExp->type == 5)
15902 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15903 else
15904 break;
15905 }
15906 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15907 exp->thisPtr = thisPtr;
15908 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15909 {
15910 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15911 }
15912 ProcessExpressionType(exp->__anon1.member.exp);
15913 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)
15914 {
15915 exp->isConstant = 0x0;
15916 }
15917 else
15918 exp->isConstant = exp->__anon1.member.exp->isConstant;
15919 type = exp->__anon1.member.exp->expType;
15920 yylloc = exp->loc;
15921 if(type && (type->kind == 20))
15922 {
15923 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15924 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15925
15926 if(_class)
15927 {
15928 for(param = _class->templateParams.first; param; param = param->next)
15929 {
15930 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15931 break;
15932 }
15933 }
15934 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15935 {
15936 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15937
15938 if(argExp)
15939 {
15940 struct Expression * expMember = exp->__anon1.member.exp;
15941 struct Declarator * decl;
15942 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15943 char thisClassTypeString[1024];
15944
15945 FreeIdentifier(exp->__anon1.member.member);
15946 ProcessExpressionType(argExp);
15947 {
15948 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15949
15950 if(colon)
15951 {
15952 char className[1024];
15953 struct __ecereNameSpace__ecere__com__Class * sClass;
15954
15955 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15956 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15957 }
15958 else
15959 strcpy(thisClassTypeString, _class->fullName);
15960 }
15961 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15962 exp->expType = ProcessType(specs, decl);
15963 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
15964 {
15965 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
15966 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15967 int c;
15968 int paramCount = 0;
15969 int lastParam = -1;
15970 char templateString[1024];
15971 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15972
15973 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15974 for(cClass = expClass; cClass; cClass = cClass->base)
15975 {
15976 int p = 0;
15977
15978 for(param = cClass->templateParams.first; param; param = param->next)
15979 {
15980 int id = p;
15981 struct __ecereNameSpace__ecere__com__Class * sClass;
15982 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15983
15984 for(sClass = cClass->base; sClass; sClass = sClass->base)
15985 id += sClass->templateParams.count;
15986 arg = expClass->templateArgs[id];
15987 for(sClass = _class; sClass; sClass = sClass->base)
15988 {
15989 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15990 int p = 0;
15991 struct __ecereNameSpace__ecere__com__Class * nextClass;
15992
15993 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15994 p += nextClass->templateParams.count;
15995 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15996 {
15997 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
15998 {
15999 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16000 {
16001 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16002 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16003 break;
16004 }
16005 }
16006 }
16007 }
16008 {
16009 char argument[256];
16010
16011 argument[0] = '\0';
16012 switch(param->type)
16013 {
16014 case 2:
16015 {
16016 char expString[1024];
16017 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16018 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16019 struct Expression * exp;
16020 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16021
16022 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16023 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16024 ProcessExpressionType(exp);
16025 ComputeExpression(exp);
16026 expString[0] = '\0';
16027 PrintExpression(exp, expString);
16028 strcat(argument, expString);
16029 FreeExpression(exp);
16030 break;
16031 }
16032 case 1:
16033 {
16034 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16035 break;
16036 }
16037 case 0:
16038 {
16039 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16040 {
16041 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16042 strcat(argument, thisClassTypeString);
16043 else
16044 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16045 }
16046 break;
16047 }
16048 }
16049 if(argument[0])
16050 {
16051 if(paramCount)
16052 strcat(templateString, ", ");
16053 if(lastParam != p - 1)
16054 {
16055 strcat(templateString, param->name);
16056 strcat(templateString, " = ");
16057 }
16058 strcat(templateString, argument);
16059 paramCount++;
16060 lastParam = p;
16061 }
16062 p++;
16063 }
16064 }
16065 }
16066 {
16067 int len = strlen(templateString);
16068
16069 if(templateString[len - 1] == '>')
16070 templateString[len++] = ' ';
16071 templateString[len++] = '>';
16072 templateString[len++] = '\0';
16073 }
16074 {
16075 struct Context * context = SetupTemplatesContext(_class);
16076
16077 FreeType(exp->expType);
16078 exp->expType = ProcessTypeString(templateString, 0x0);
16079 FinishTemplatesContext(context);
16080 }
16081 }
16082 exp->type = 5;
16083 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")))))))));
16084 }
16085 }
16086 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16087 {
16088 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16089 }
16090 }
16091 if(type && (type->kind == 20))
16092 ;
16093 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)))
16094 {
16095 struct Identifier * id = exp->__anon1.member.member;
16096 int typeKind = type->kind;
16097 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));
16098
16099 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16100 {
16101 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16102 typeKind = 8;
16103 }
16104 if(id)
16105 {
16106 if(typeKind == 3 || typeKind == 15)
16107 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16108 else if(!_class)
16109 {
16110 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16111 {
16112 _class = type->__anon1._class->__anon1.registered;
16113 }
16114 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16115 {
16116 _class = FindClass("char *")->__anon1.registered;
16117 }
16118 else if(type->kind == 13)
16119 {
16120 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16121 FreeType(exp->expType);
16122 exp->expType = ProcessTypeString("uintptr", 0x0);
16123 exp->byReference = 0x1;
16124 }
16125 else
16126 {
16127 char string[1024] = "";
16128 struct Symbol * classSym;
16129
16130 PrintTypeNoConst(type, string, 0x0, 0x1);
16131 classSym = FindClass(string);
16132 if(classSym)
16133 _class = classSym->__anon1.registered;
16134 }
16135 }
16136 }
16137 if(_class && id)
16138 {
16139 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16140 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16141 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16142 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16143 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16144
16145 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16146 exp->__anon1.member.memberType = 1;
16147 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16148 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16149 if(typeKind != 19)
16150 {
16151 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16152 {
16153 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16154 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16155 {
16156 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16157 if(prop)
16158 member = (((void *)0));
16159 }
16160 if(!member && !prop)
16161 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16162 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16163 exp->__anon1.member.thisPtr = 0x1;
16164 }
16165 else
16166 {
16167 unsigned int useMemberForNonConst = 0x0;
16168
16169 if(!id->classSym)
16170 {
16171 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16172 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);
16173 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16174 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16175 }
16176 if((!prop || useMemberForNonConst) && !member)
16177 {
16178 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16179 if(!method)
16180 {
16181 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16182 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);
16183 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16184 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16185 }
16186 }
16187 if(member && prop)
16188 {
16189 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16190 prop = (((void *)0));
16191 else
16192 member = (((void *)0));
16193 }
16194 }
16195 }
16196 if(!prop && !member && !method)
16197 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16198 if(!prop && !member && !method)
16199 {
16200 if(typeKind == 19)
16201 {
16202 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16203 if(classProp)
16204 {
16205 exp->__anon1.member.memberType = 5;
16206 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
16207 }
16208 else
16209 {
16210 char structName[1024];
16211 struct Identifier * id = exp->__anon1.member.member;
16212 struct Expression * classExp = exp->__anon1.member.exp;
16213
16214 type->refCount++;
16215 FreeType(classExp->expType);
16216 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
16217 strcpy(structName, "__ecereClassData_");
16218 FullClassNameCat(structName, type->__anon1._class->string, 0x0);
16219 exp->type = 9;
16220 exp->__anon1.member.member = id;
16221 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"))))))));
16222 FreeType(type);
16223 ProcessExpressionType(exp);
16224 return ;
16225 }
16226 }
16227 else
16228 {
16229 struct Symbol * classSym = FindClass(id->string);
16230
16231 if(classSym)
16232 {
16233 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16234
16235 if(convertClass)
16236 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16237 }
16238 }
16239 }
16240 if(prop)
16241 {
16242 exp->__anon1.member.memberType = 1;
16243 if(!prop->dataType)
16244 ProcessPropertyType(prop);
16245 exp->expType = prop->dataType;
16246 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16247 {
16248 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16249
16250 CopyTypeInto(type, exp->expType);
16251 type->refCount = 1;
16252 type->constant = 0x1;
16253 exp->expType = type;
16254 }
16255 else if(prop->dataType)
16256 prop->dataType->refCount++;
16257 }
16258 else if(member)
16259 {
16260 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16261 {
16262 FreeExpContents(exp);
16263 exp->type = 0;
16264 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16265 ProcessExpressionType(exp);
16266 return ;
16267 }
16268 exp->__anon1.member.memberType = 3;
16269 DeclareStruct(_class->fullName, 0x0);
16270 if(!member->dataType)
16271 {
16272 struct Context * context = SetupTemplatesContext(_class);
16273
16274 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16275 FinishTemplatesContext(context);
16276 }
16277 exp->expType = member->dataType;
16278 if(member->dataType)
16279 member->dataType->refCount++;
16280 }
16281 else if(revConvert)
16282 {
16283 exp->__anon1.member.memberType = 4;
16284 exp->expType = MkClassType(revConvert->_class->fullName);
16285 }
16286 else if(method)
16287 {
16288 {
16289 exp->__anon1.member.memberType = 2;
16290 }
16291 if(!method->dataType)
16292 ProcessMethodType(method);
16293 exp->expType = __extension__ ({
16294 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16295
16296 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16297 });
16298 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16299 exp->expType->__anon1.__anon3.usedClass = _class;
16300 }
16301 else if(!classProp)
16302 {
16303 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16304 {
16305 FreeExpContents(exp);
16306 exp->type = 0;
16307 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16308 FreeType(exp->expType);
16309 exp->expType = MkClassType("ecere::com::Class");
16310 return ;
16311 }
16312 yylloc = exp->__anon1.member.member->loc;
16313 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16314 if(inCompiler)
16315 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16316 }
16317 if(_class && exp->expType)
16318 {
16319 struct __ecereNameSpace__ecere__com__Class * tClass;
16320
16321 tClass = _class;
16322 while(tClass && !tClass->templateClass)
16323 tClass = tClass->base;
16324 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16325 {
16326 int id = 0;
16327 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16328 struct __ecereNameSpace__ecere__com__Class * sClass;
16329
16330 for(sClass = tClass; sClass; sClass = sClass->base)
16331 {
16332 id = 0;
16333 if(sClass->templateClass)
16334 sClass = sClass->templateClass;
16335 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16336 {
16337 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16338 {
16339 for(sClass = sClass->base; sClass; sClass = sClass->base)
16340 id += sClass->templateParams.count;
16341 break;
16342 }
16343 id++;
16344 }
16345 if(curParam)
16346 break;
16347 }
16348 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16349 {
16350 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16351 struct Context * context = SetupTemplatesContext(tClass);
16352 unsigned int constant = exp->expType->constant;
16353
16354 FreeType(exp->expType);
16355 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16356 if(exp->expType->kind == 8 && constant)
16357 exp->expType->constant = 0x1;
16358 else if(exp->expType->kind == 13)
16359 {
16360 struct Type * t = exp->expType->__anon1.type;
16361
16362 while(t->kind == 13)
16363 t = t->__anon1.type;
16364 if(constant)
16365 t->constant = constant;
16366 }
16367 if(exp->expType)
16368 {
16369 if(exp->expType->kind == 21)
16370 {
16371 FreeType(exp->expType);
16372 exp->expType = ReplaceThisClassType(_class);
16373 }
16374 if(tClass->templateClass)
16375 exp->expType->passAsTemplate = 0x1;
16376 if(!exp->destType)
16377 {
16378 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16379 if(exp->destType->kind == 8 && constant)
16380 exp->destType->constant = 0x1;
16381 else if(exp->destType->kind == 13)
16382 {
16383 struct Type * t = exp->destType->__anon1.type;
16384
16385 while(t->kind == 13)
16386 t = t->__anon1.type;
16387 if(constant)
16388 t->constant = constant;
16389 }
16390 if(exp->destType->kind == 21)
16391 {
16392 FreeType(exp->destType);
16393 exp->destType = ReplaceThisClassType(_class);
16394 }
16395 }
16396 }
16397 FinishTemplatesContext(context);
16398 }
16399 }
16400 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)
16401 {
16402 int id = 0;
16403 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16404 struct __ecereNameSpace__ecere__com__Class * sClass;
16405
16406 for(sClass = tClass; sClass; sClass = sClass->base)
16407 {
16408 id = 0;
16409 if(sClass->templateClass)
16410 sClass = sClass->templateClass;
16411 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16412 {
16413 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16414 {
16415 for(sClass = sClass->base; sClass; sClass = sClass->base)
16416 id += sClass->templateParams.count;
16417 break;
16418 }
16419 id++;
16420 }
16421 if(curParam)
16422 break;
16423 }
16424 if(curParam)
16425 {
16426 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16427 struct Context * context = SetupTemplatesContext(tClass);
16428 struct Type * basicType;
16429
16430 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16431 if(basicType)
16432 {
16433 if(basicType->kind == 21)
16434 {
16435 FreeType(basicType);
16436 basicType = ReplaceThisClassType(_class);
16437 }
16438 FreeType(exp->expType);
16439 exp->expType = __extension__ ({
16440 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16441
16442 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16443 });
16444 if(!exp->destType)
16445 {
16446 exp->destType = exp->expType;
16447 exp->destType->refCount++;
16448 }
16449 {
16450 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16451 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16452 struct Declarator * decl;
16453
16454 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16455 *newExp = *exp;
16456 if(exp->destType)
16457 exp->destType->refCount++;
16458 if(exp->expType)
16459 exp->expType->refCount++;
16460 exp->type = 11;
16461 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16462 exp->__anon1.cast.exp = newExp;
16463 }
16464 }
16465 FinishTemplatesContext(context);
16466 }
16467 }
16468 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16469 {
16470 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16471
16472 if(expClass)
16473 {
16474 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16475 int c;
16476 int p = 0;
16477 int paramCount = 0;
16478 int lastParam = -1;
16479 char templateString[1024];
16480 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16481
16482 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16483 while(cClass != expClass)
16484 {
16485 struct __ecereNameSpace__ecere__com__Class * sClass;
16486
16487 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16488 ;
16489 cClass = sClass;
16490 for(param = cClass->templateParams.first; param; param = param->next)
16491 {
16492 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16493 int c;
16494 int cp = 0;
16495 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16496 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16497
16498 while(cClassCur != tClass && !paramCur)
16499 {
16500 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16501
16502 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16503 ;
16504 cClassCur = sClassCur;
16505 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16506 {
16507 if(!strcmp(paramCur->name, param->name))
16508 {
16509 break;
16510 }
16511 cp++;
16512 }
16513 }
16514 if(paramCur && paramCur->type == 0)
16515 arg = tClass->templateArgs[cp];
16516 else
16517 arg = expClass->templateArgs[p];
16518 {
16519 char argument[256];
16520
16521 argument[0] = '\0';
16522 switch(param->type)
16523 {
16524 case 2:
16525 {
16526 char expString[1024];
16527 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16528 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16529 struct Expression * exp;
16530 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16531
16532 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16533 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16534 ProcessExpressionType(exp);
16535 ComputeExpression(exp);
16536 expString[0] = '\0';
16537 PrintExpression(exp, expString);
16538 strcat(argument, expString);
16539 FreeExpression(exp);
16540 break;
16541 }
16542 case 1:
16543 {
16544 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16545 break;
16546 }
16547 case 0:
16548 {
16549 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16550 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16551 break;
16552 }
16553 }
16554 if(argument[0])
16555 {
16556 if(paramCount)
16557 strcat(templateString, ", ");
16558 if(lastParam != p - 1)
16559 {
16560 strcat(templateString, param->name);
16561 strcat(templateString, " = ");
16562 }
16563 strcat(templateString, argument);
16564 paramCount++;
16565 lastParam = p;
16566 }
16567 }
16568 p++;
16569 }
16570 }
16571 {
16572 int len = strlen(templateString);
16573
16574 if(templateString[len - 1] == '>')
16575 templateString[len++] = ' ';
16576 templateString[len++] = '>';
16577 templateString[len++] = '\0';
16578 }
16579 FreeType(exp->expType);
16580 {
16581 struct Context * context = SetupTemplatesContext(tClass);
16582
16583 exp->expType = ProcessTypeString(templateString, 0x0);
16584 FinishTemplatesContext(context);
16585 }
16586 }
16587 }
16588 }
16589 }
16590 else
16591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->string : (type->__anon1._class ? type->__anon1._class->string : (((void *)0)))) : "(null)");
16592 }
16593 else if(type && (type->kind == 9 || type->kind == 10))
16594 {
16595 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16596
16597 if(memberType)
16598 {
16599 exp->expType = memberType;
16600 if(memberType)
16601 memberType->refCount++;
16602 }
16603 }
16604 else
16605 {
16606 char expString[10240];
16607
16608 expString[0] = '\0';
16609 if(inCompiler)
16610 {
16611 PrintExpression(exp, expString);
16612 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16613 }
16614 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16615 }
16616 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16617 {
16618 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16619 {
16620 struct Identifier * id = exp->__anon1.member.member;
16621 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
16622
16623 if(_class)
16624 {
16625 FreeType(exp->expType);
16626 exp->expType = ReplaceThisClassType(_class);
16627 }
16628 }
16629 }
16630 yylloc = oldyylloc;
16631 break;
16632 }
16633 case 9:
16634 {
16635 struct Type * destType = exp->destType;
16636
16637 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16638 {
16639 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16640 }
16641 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16642 exp->type = 8;
16643 if(destType)
16644 destType->count++;
16645 ProcessExpressionType(exp);
16646 if(destType)
16647 destType->count--;
16648 break;
16649 }
16650 case 15:
16651 {
16652 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16653
16654 if(classSym && classSym->__anon1.registered)
16655 {
16656 if(classSym->__anon1.registered->type == 5)
16657 {
16658 char name[1024];
16659
16660 name[0] = '\0';
16661 DeclareStruct(classSym->string, 0x0);
16662 FreeSpecifier(exp->__anon1._class);
16663 exp->type = 10;
16664 FullClassNameCat(name, classSym->string, 0x0);
16665 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16666 }
16667 else
16668 {
16669 if(classSym->__anon1.registered->fixed)
16670 {
16671 FreeSpecifier(exp->__anon1._class);
16672 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16673 exp->type = 2;
16674 }
16675 else
16676 {
16677 char className[1024];
16678
16679 strcpy(className, "__ecereClass_");
16680 FullClassNameCat(className, classSym->string, 0x1);
16681 MangleClassName(className);
16682 DeclareClass(classSym, className);
16683 FreeExpContents(exp);
16684 exp->type = 9;
16685 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16686 exp->__anon1.member.member = MkIdentifier("structSize");
16687 }
16688 }
16689 }
16690 exp->expType = __extension__ ({
16691 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16692
16693 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16694 });
16695 break;
16696 }
16697 case 10:
16698 {
16699 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16700
16701 exp->expType = __extension__ ({
16702 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16703
16704 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16705 });
16706 exp->isConstant = 0x1;
16707 DeclareType(type, 0x0, 0x0);
16708 FreeType(type);
16709 break;
16710 }
16711 case 11:
16712 {
16713 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16714
16715 type->count = 1;
16716 FreeType(exp->__anon1.cast.exp->destType);
16717 exp->__anon1.cast.exp->destType = type;
16718 type->refCount++;
16719 type->casted = 0x1;
16720 ProcessExpressionType(exp->__anon1.cast.exp);
16721 type->casted = 0x0;
16722 type->count = 0;
16723 exp->expType = type;
16724 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16725 {
16726 void * prev = exp->prev, * next = exp->next;
16727 struct Type * expType = exp->__anon1.cast.exp->destType;
16728 struct Expression * castExp = exp->__anon1.cast.exp;
16729 struct Type * destType = exp->destType;
16730
16731 if(expType)
16732 expType->refCount++;
16733 FreeType(exp->expType);
16734 FreeTypeName(exp->__anon1.cast.typeName);
16735 *exp = *castExp;
16736 FreeType(exp->expType);
16737 FreeType(exp->destType);
16738 exp->expType = expType;
16739 exp->destType = destType;
16740 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16741 exp->prev = prev;
16742 exp->next = next;
16743 }
16744 else
16745 {
16746 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16747 }
16748 break;
16749 }
16750 case 33:
16751 {
16752 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16753
16754 exp->expType = type;
16755 break;
16756 }
16757 case 34:
16758 {
16759 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16760
16761 ProcessExpressionType(exp->__anon1.vaArg.exp);
16762 exp->expType = type;
16763 break;
16764 }
16765 case 12:
16766 {
16767 struct Expression * e;
16768
16769 exp->isConstant = 0x1;
16770 FreeType(exp->__anon1.cond.cond->destType);
16771 exp->__anon1.cond.cond->destType = MkClassType("bool");
16772 exp->__anon1.cond.cond->destType->truth = 0x1;
16773 ProcessExpressionType(exp->__anon1.cond.cond);
16774 if(!exp->__anon1.cond.cond->isConstant)
16775 exp->isConstant = 0x0;
16776 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16777 {
16778 if(!e->next)
16779 {
16780 FreeType(e->destType);
16781 e->destType = exp->destType;
16782 if(e->destType)
16783 e->destType->refCount++;
16784 }
16785 ProcessExpressionType(e);
16786 if(!e->next)
16787 {
16788 exp->expType = e->expType;
16789 if(e->expType)
16790 e->expType->refCount++;
16791 }
16792 if(!e->isConstant)
16793 exp->isConstant = 0x0;
16794 }
16795 FreeType(exp->__anon1.cond.elseExp->destType);
16796 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16797 if(exp->__anon1.cond.elseExp->destType)
16798 exp->__anon1.cond.elseExp->destType->refCount++;
16799 ProcessExpressionType(exp->__anon1.cond.elseExp);
16800 if(!exp->__anon1.cond.elseExp->isConstant)
16801 exp->isConstant = 0x0;
16802 break;
16803 }
16804 case 23:
16805 {
16806 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16807 {
16808 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16809
16810 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16811 {
16812 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16813 if(exp->destType)
16814 exp->destType->refCount++;
16815 }
16816 ProcessStatement(exp->__anon1.compound);
16817 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16818 if(exp->expType)
16819 exp->expType->refCount++;
16820 }
16821 break;
16822 }
16823 case 24:
16824 {
16825 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16826
16827 if(spec && spec->type == 1)
16828 {
16829 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16830 exp->expType->kind = 19;
16831 exp->byReference = 0x1;
16832 }
16833 else
16834 {
16835 exp->expType = MkClassType("ecere::com::Class");
16836 exp->byReference = 0x1;
16837 }
16838 break;
16839 }
16840 case 25:
16841 {
16842 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16843
16844 if(_class)
16845 {
16846 struct Identifier * id = exp->__anon1.classData.id;
16847 char structName[1024];
16848 struct Expression * classExp;
16849
16850 strcpy(structName, "__ecereClassData_");
16851 FullClassNameCat(structName, _class->fullName, 0x0);
16852 exp->type = 9;
16853 exp->__anon1.member.member = id;
16854 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0x0, 0x0))
16855 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16856 else
16857 classExp = MkExpIdentifier(MkIdentifier("class"));
16858 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"))))))));
16859 ProcessExpressionType(exp);
16860 return ;
16861 }
16862 break;
16863 }
16864 case 35:
16865 {
16866 struct Type * type = (((void *)0));
16867 const char * typeString = (((void *)0));
16868 char typeStringBuf[1024];
16869
16870 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))
16871 {
16872 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16873
16874 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16875 }
16876 else if(exp->__anon1.list)
16877 {
16878 struct Expression * e;
16879
16880 for(e = (*exp->__anon1.list).first; e; e = e->next)
16881 {
16882 ProcessExpressionType(e);
16883 if(e->expType)
16884 {
16885 if(!type)
16886 {
16887 type = e->expType;
16888 type->refCount++;
16889 }
16890 else
16891 {
16892 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16893 {
16894 FreeType(type);
16895 type = e->expType;
16896 e->expType = (((void *)0));
16897 e = (*exp->__anon1.list).first;
16898 ProcessExpressionType(e);
16899 if(e->expType)
16900 {
16901 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16902 {
16903 FreeType(e->expType);
16904 e->expType = (((void *)0));
16905 FreeType(type);
16906 type = (((void *)0));
16907 break;
16908 }
16909 }
16910 }
16911 }
16912 if(e->expType)
16913 {
16914 FreeType(e->expType);
16915 e->expType = (((void *)0));
16916 }
16917 }
16918 }
16919 if(type)
16920 {
16921 typeStringBuf[0] = '\0';
16922 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16923 typeString = typeStringBuf;
16924 FreeType(type);
16925 type = (((void *)0));
16926 }
16927 }
16928 if(typeString)
16929 {
16930 char templateString[1024];
16931 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16932 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16933 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16934 struct Expression * expExt;
16935 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16936
16937 sprintf(templateString, "Container<%s>", typeString);
16938 if(exp->__anon1.list)
16939 {
16940 struct Expression * e;
16941
16942 type = ProcessTypeString(typeString, 0x0);
16943 while(e = (*exp->__anon1.list).first)
16944 {
16945 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16946 e->destType = type;
16947 type->refCount++;
16948 ProcessExpressionType(e);
16949 ListAdd(initializers, MkInitializerAssignment(e));
16950 }
16951 FreeType(type);
16952 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16953 }
16954 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16955 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16956 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16957 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16958 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16959 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16960 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16961 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16962 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16963 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16964 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16965
16966 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16967 })));
16968 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16969 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16970 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16971 exp->expType = ProcessTypeString(templateString, 0x0);
16972 exp->type = 5;
16973 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16974 ProcessExpressionType(expExt);
16975 }
16976 else
16977 {
16978 exp->expType = ProcessTypeString("Container", 0x0);
16979 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16980 }
16981 break;
16982 }
16983 }
16984 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16985 {
16986 FreeType(exp->expType);
16987 exp->expType = ReplaceThisClassType(thisClass);
16988 }
16989 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)
16990 {
16991 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 0x1, 0x0);
16992
16993 if(symbol)
16994 {
16995 if(exp->expType->kind != 15)
16996 {
16997 struct Type * member;
16998 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
16999
17000 FreeType(exp->expType);
17001 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17002 exp->expType->kind = symbol->type->kind;
17003 exp->expType->refCount++;
17004 exp->expType->__anon1.__anon1.enumName = enumName;
17005 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17006 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17007 member->refCount++;
17008 }
17009 else
17010 {
17011 struct __ecereNameSpace__ecere__sys__NamedLink * member;
17012
17013 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17014 {
17015 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17016
17017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17018 }
17019 }
17020 }
17021 }
17022 yylloc = exp->loc;
17023 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
17024 ;
17025 else if(exp->destType && !exp->destType->keepCast)
17026 {
17027 if(!CheckExpressionType(exp, exp->destType, 0x0, !exp->destType->casted))
17028 {
17029 if(!exp->destType->count || unresolved)
17030 {
17031 if(!exp->expType)
17032 {
17033 yylloc = exp->loc;
17034 if(exp->destType->kind != 14)
17035 {
17036 char type2[1024];
17037
17038 type2[0] = '\0';
17039 if(inCompiler)
17040 {
17041 char expString[10240];
17042
17043 expString[0] = '\0';
17044 PrintType(exp->destType, type2, 0x0, 0x1);
17045 if(inCompiler)
17046 {
17047 PrintExpression(exp, expString);
17048 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17049 }
17050 if(unresolved)
17051 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17052 else if(exp->type != 16)
17053 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17054 }
17055 }
17056 else
17057 {
17058 char expString[10240];
17059
17060 expString[0] = '\0';
17061 if(inCompiler)
17062 {
17063 PrintExpression(exp, expString);
17064 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17065 }
17066 if(unresolved)
17067 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17068 else if(exp->type != 16)
17069 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17070 }
17071 }
17072 else
17073 {
17074 char type1[1024];
17075 char type2[1024];
17076
17077 type1[0] = '\0';
17078 type2[0] = '\0';
17079 if(inCompiler)
17080 {
17081 PrintType(exp->expType, type1, 0x0, 0x1);
17082 PrintType(exp->destType, type2, 0x0, 0x1);
17083 }
17084 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)))
17085 ;
17086 else
17087 {
17088 char expString[10240];
17089
17090 expString[0] = '\0';
17091 if(inCompiler)
17092 {
17093 PrintExpression(exp, expString);
17094 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17095 }
17096 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17097 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17098 FreeType(exp->expType);
17099 exp->destType->refCount++;
17100 exp->expType = exp->destType;
17101 }
17102 }
17103 }
17104 }
17105 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
17106 {
17107 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17108 char typeString[1024];
17109 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17110 struct Declarator * decl;
17111
17112 typeString[0] = '\0';
17113 *newExp = *exp;
17114 if(exp->expType)
17115 exp->expType->refCount++;
17116 if(exp->expType)
17117 exp->expType->refCount++;
17118 exp->type = 11;
17119 newExp->destType = exp->expType;
17120 PrintType(exp->expType, typeString, 0x0, 0x0);
17121 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17122 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
17123 exp->__anon1.cast.exp = newExp;
17124 }
17125 }
17126 else if(unresolved)
17127 {
17128 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17129 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);
17130 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17131 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17132 }
17133 else if(!exp->expType && exp->type != 16)
17134 {
17135 char expString[10240];
17136
17137 expString[0] = '\0';
17138 if(inCompiler)
17139 {
17140 PrintExpression(exp, expString);
17141 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17142 }
17143 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17144 }
17145 if(inCompiler)
17146 ApplyAnyObjectLogic(exp);
17147 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)))
17148 {
17149 exp->byReference = 0x1;
17150 }
17151 yylloc = oldyylloc;
17152 }
17153
17154 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)
17155 {
17156 if(*curMember)
17157 {
17158 *curMember = (*curMember)->next;
17159 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17160 {
17161 *curMember = subMemberStack[--(*subMemberStackPos)];
17162 *curMember = (*curMember)->next;
17163 }
17164 while((*curMember) && (*curMember)->isProperty)
17165 *curMember = (*curMember)->next;
17166 if(subMemberStackPos)
17167 {
17168 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17169 {
17170 subMemberStack[(*subMemberStackPos)++] = *curMember;
17171 *curMember = (*curMember)->members.first;
17172 while(*curMember && (*curMember)->isProperty)
17173 *curMember = (*curMember)->next;
17174 }
17175 }
17176 }
17177 while(!*curMember)
17178 {
17179 if(!*curMember)
17180 {
17181 if(subMemberStackPos && *subMemberStackPos)
17182 {
17183 *curMember = subMemberStack[--(*subMemberStackPos)];
17184 *curMember = (*curMember)->next;
17185 }
17186 else
17187 {
17188 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17189
17190 if(*curClass == _class)
17191 break;
17192 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17193 ;
17194 *curMember = (*curClass)->membersAndProperties.first;
17195 }
17196 while((*curMember) && (*curMember)->isProperty)
17197 *curMember = (*curMember)->next;
17198 if(subMemberStackPos)
17199 {
17200 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17201 {
17202 subMemberStack[(*subMemberStackPos)++] = *curMember;
17203 *curMember = (*curMember)->members.first;
17204 while(*curMember && (*curMember)->isProperty)
17205 *curMember = (*curMember)->next;
17206 }
17207 }
17208 }
17209 }
17210 }
17211
17212 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17213 {
17214 switch(init->type)
17215 {
17216 case 0:
17217 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17218 {
17219 if(init->__anon1.exp && !init->__anon1.exp->destType)
17220 {
17221 FreeType(init->__anon1.exp->destType);
17222 init->__anon1.exp->destType = type;
17223 if(type)
17224 type->refCount++;
17225 }
17226 if(init->__anon1.exp)
17227 {
17228 ProcessExpressionType(init->__anon1.exp);
17229 init->isConstant = init->__anon1.exp->isConstant;
17230 }
17231 break;
17232 }
17233 else
17234 {
17235 struct Expression * exp = init->__anon1.exp;
17236 struct Instantiation * inst = exp->__anon1.instance;
17237 struct MembersInit * members;
17238
17239 init->type = 1;
17240 init->__anon1.list = MkList();
17241 if(inst->members)
17242 {
17243 for(members = (*inst->members).first; members; members = members->next)
17244 {
17245 if(members->type == 0)
17246 {
17247 struct MemberInit * member;
17248
17249 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17250 {
17251 ListAdd(init->__anon1.list, member->initializer);
17252 member->initializer = (((void *)0));
17253 }
17254 }
17255 }
17256 }
17257 FreeExpression(exp);
17258 }
17259 case 1:
17260 {
17261 struct Initializer * i;
17262 struct Type * initializerType = (((void *)0));
17263 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17264 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17265 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17266 int subMemberStackPos = 0;
17267
17268 if(type && type->kind == 12)
17269 initializerType = Dereference(type);
17270 else if(type && (type->kind == 9 || type->kind == 10))
17271 initializerType = type->__anon1.__anon1.members.first;
17272 for(i = (*init->__anon1.list).first; i; i = i->next)
17273 {
17274 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17275 {
17276 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17277 if(curMember)
17278 {
17279 if(!curMember->dataType)
17280 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
17281 initializerType = curMember->dataType;
17282 }
17283 }
17284 ProcessInitializer(i, initializerType);
17285 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17286 initializerType = initializerType->next;
17287 if(!i->isConstant)
17288 init->isConstant = 0x0;
17289 }
17290 if(type && type->kind == 12)
17291 FreeType(initializerType);
17292 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))
17293 {
17294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17295 }
17296 break;
17297 }
17298 }
17299 }
17300
17301 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17302
17303 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17304
17305 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17306 {
17307 switch(spec->type)
17308 {
17309 case 0:
17310 {
17311 if(spec->__anon1.specifier == THISCLASS)
17312 {
17313 if(thisClass)
17314 {
17315 spec->type = 1;
17316 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17317 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17318 ProcessSpecifier(spec, declareStruct);
17319 }
17320 }
17321 break;
17322 }
17323 case 1:
17324 {
17325 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17326
17327 if(symbol)
17328 DeclareType(symbol->type, 0x1, 0x1);
17329 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17330 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
17331 break;
17332 }
17333 case 2:
17334 {
17335 struct Enumerator * e;
17336
17337 if(spec->__anon1.__anon2.list)
17338 {
17339 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17340 {
17341 if(e->exp)
17342 ProcessExpressionType(e->exp);
17343 }
17344 }
17345 break;
17346 }
17347 case 3:
17348 case 4:
17349 {
17350 if(spec->__anon1.__anon2.definitions)
17351 {
17352 struct ClassDef * def;
17353 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17354
17355 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17356 }
17357 break;
17358 }
17359 }
17360 }
17361
17362 static void ProcessDeclarator(struct Declarator * decl)
17363 {
17364 switch(decl->type)
17365 {
17366 case 1:
17367 if(decl->__anon1.identifier->classSym)
17368 {
17369 FreeSpecifier(decl->__anon1.identifier->_class);
17370 decl->__anon1.identifier->_class = (((void *)0));
17371 }
17372 break;
17373 case 3:
17374 if(decl->__anon1.array.exp)
17375 ProcessExpressionType(decl->__anon1.array.exp);
17376 case 0:
17377 case 2:
17378 case 4:
17379 case 5:
17380 case 6:
17381 case 7:
17382 if(decl->declarator)
17383 ProcessDeclarator(decl->declarator);
17384 if(decl->type == 4)
17385 {
17386 struct Identifier * id = GetDeclId(decl);
17387
17388 if(id && id->_class)
17389 {
17390 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17391
17392 if(!decl->__anon1.function.parameters)
17393 decl->__anon1.function.parameters = MkList();
17394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17395 id->_class = (((void *)0));
17396 }
17397 if(decl->__anon1.function.parameters)
17398 {
17399 struct TypeName * param;
17400
17401 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17402 {
17403 if(param->qualifiers && (*param->qualifiers).first)
17404 {
17405 struct Specifier * spec = (*param->qualifiers).first;
17406
17407 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17408 {
17409 struct Declarator * d = param->declarator;
17410 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);
17411
17412 if(d->type != 5)
17413 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17414 FreeList(param->qualifiers, FreeSpecifier);
17415 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17416 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17418 param = newParam;
17419 }
17420 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17421 {
17422 struct Declarator * d = param->declarator;
17423
17424 FreeList(param->qualifiers, FreeSpecifier);
17425 param->qualifiers = MkListOne(MkSpecifier(VOID));
17426 if(d->type != 5)
17427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17428 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17429 }
17430 else if(spec->__anon1.specifier == THISCLASS)
17431 {
17432 if(thisClass)
17433 {
17434 spec->type = 1;
17435 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17436 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17437 ProcessSpecifier(spec, 0x0);
17438 }
17439 }
17440 }
17441 if(param->declarator)
17442 ProcessDeclarator(param->declarator);
17443 }
17444 }
17445 }
17446 break;
17447 }
17448 }
17449
17450 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17451
17452 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17453
17454 static void ProcessDeclaration(struct Declaration * decl)
17455 {
17456 yylloc = decl->loc;
17457 switch(decl->type)
17458 {
17459 case 1:
17460 {
17461 unsigned int declareStruct = 0x0;
17462
17463 if(decl->__anon1.__anon1.declarators)
17464 {
17465 struct InitDeclarator * d;
17466
17467 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17468 {
17469 struct Type * type, * subType;
17470
17471 ProcessDeclarator(d->declarator);
17472 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17473 if(d->initializer)
17474 {
17475 ProcessInitializer(d->initializer, type);
17476 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17477 {
17478 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17479 {
17480 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17481
17482 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17483 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17484 if(decl->__anon1.__anon1.specifiers)
17485 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17486 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17487 d = (((void *)0));
17488 decl->type = 2;
17489 decl->__anon1.inst = inst;
17490 }
17491 }
17492 }
17493 for(subType = type; subType; )
17494 {
17495 if(subType->kind == 8)
17496 {
17497 declareStruct = 0x1;
17498 break;
17499 }
17500 else if(subType->kind == 13)
17501 break;
17502 else if(subType->kind == 12)
17503 subType = subType->__anon1.__anon4.arrayType;
17504 else
17505 break;
17506 }
17507 FreeType(type);
17508 if(!d)
17509 break;
17510 }
17511 }
17512 if(decl->__anon1.__anon1.specifiers)
17513 {
17514 struct Specifier * s;
17515
17516 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17517 {
17518 ProcessSpecifier(s, declareStruct);
17519 }
17520 }
17521 break;
17522 }
17523 case 2:
17524 {
17525 ProcessInstantiationType(decl->__anon1.inst);
17526 break;
17527 }
17528 case 0:
17529 {
17530 struct Specifier * spec;
17531 struct Declarator * d;
17532 unsigned int declareStruct = 0x0;
17533
17534 if(decl->__anon1.__anon1.declarators)
17535 {
17536 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17537 {
17538 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17539 struct Type * subType;
17540
17541 ProcessDeclarator(d);
17542 for(subType = type; subType; )
17543 {
17544 if(subType->kind == 8)
17545 {
17546 declareStruct = 0x1;
17547 break;
17548 }
17549 else if(subType->kind == 13)
17550 break;
17551 else if(subType->kind == 12)
17552 subType = subType->__anon1.__anon4.arrayType;
17553 else
17554 break;
17555 }
17556 FreeType(type);
17557 }
17558 }
17559 if(decl->__anon1.__anon1.specifiers)
17560 {
17561 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17562 ProcessSpecifier(spec, declareStruct);
17563 }
17564 break;
17565 }
17566 }
17567 }
17568
17569 static struct FunctionDefinition * curFunction;
17570
17571 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17572 {
17573 char propName[1024], propNameM[1024];
17574 char getName[1024], setName[1024];
17575 struct __ecereNameSpace__ecere__sys__OldList * args;
17576
17577 DeclareProperty(prop, setName, getName);
17578 strcpy(propName, "__ecereProp_");
17579 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17580 strcat(propName, "_");
17581 FullClassNameCat(propName, prop->name, 0x1);
17582 MangleClassName(propName);
17583 strcpy(propNameM, "__ecerePropM_");
17584 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17585 strcat(propNameM, "_");
17586 FullClassNameCat(propNameM, prop->name, 0x1);
17587 MangleClassName(propNameM);
17588 if(prop->isWatchable)
17589 {
17590 args = MkList();
17591 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17592 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17593 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17594 args = MkList();
17595 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17596 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17597 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17598 }
17599 {
17600 args = MkList();
17601 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17602 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17603 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17604 args = MkList();
17605 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17606 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17607 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17608 }
17609 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17610 curFunction->propSet->fireWatchersDone = 0x1;
17611 }
17612
17613 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17614
17615 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17616
17617 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17618
17619 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17620
17621 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17622
17623 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17624
17625 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17626
17627 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17628
17629 static void ProcessStatement(struct Statement * stmt)
17630 {
17631 yylloc = stmt->loc;
17632 switch(stmt->type)
17633 {
17634 case 0:
17635 ProcessStatement(stmt->__anon1.labeled.stmt);
17636 break;
17637 case 1:
17638 if(stmt->__anon1.caseStmt.exp)
17639 {
17640 FreeType(stmt->__anon1.caseStmt.exp->destType);
17641 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17642 if(curSwitchType)
17643 curSwitchType->refCount++;
17644 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17645 ComputeExpression(stmt->__anon1.caseStmt.exp);
17646 }
17647 if(stmt->__anon1.caseStmt.stmt)
17648 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17649 break;
17650 case 2:
17651 {
17652 if(stmt->__anon1.compound.context)
17653 {
17654 struct Declaration * decl;
17655 struct Statement * s;
17656 struct Statement * prevCompound = curCompound;
17657 struct Context * prevContext = curContext;
17658
17659 if(!stmt->__anon1.compound.isSwitch)
17660 curCompound = stmt;
17661 curContext = stmt->__anon1.compound.context;
17662 if(stmt->__anon1.compound.declarations)
17663 {
17664 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17665 ProcessDeclaration(decl);
17666 }
17667 if(stmt->__anon1.compound.statements)
17668 {
17669 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17670 ProcessStatement(s);
17671 }
17672 curContext = prevContext;
17673 curCompound = prevCompound;
17674 }
17675 break;
17676 }
17677 case 3:
17678 {
17679 struct Expression * exp;
17680
17681 if(stmt->__anon1.expressions)
17682 {
17683 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17684 ProcessExpressionType(exp);
17685 }
17686 break;
17687 }
17688 case 4:
17689 {
17690 struct Expression * exp;
17691
17692 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17693 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17694 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 0x1;
17695 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17696 {
17697 ProcessExpressionType(exp);
17698 }
17699 if(stmt->__anon1.ifStmt.stmt)
17700 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17701 if(stmt->__anon1.ifStmt.elseStmt)
17702 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17703 break;
17704 }
17705 case 5:
17706 {
17707 struct Type * oldSwitchType = curSwitchType;
17708
17709 if(stmt->__anon1.switchStmt.exp)
17710 {
17711 struct Expression * exp;
17712
17713 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17714 {
17715 if(!exp->next)
17716 {
17717 ProcessExpressionType(exp);
17718 }
17719 if(!exp->next)
17720 curSwitchType = exp->expType;
17721 }
17722 }
17723 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17724 curSwitchType = oldSwitchType;
17725 break;
17726 }
17727 case 6:
17728 {
17729 if(stmt->__anon1.whileStmt.exp)
17730 {
17731 struct Expression * exp;
17732
17733 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17734 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17735 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 0x1;
17736 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17737 {
17738 ProcessExpressionType(exp);
17739 }
17740 }
17741 if(stmt->__anon1.whileStmt.stmt)
17742 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17743 break;
17744 }
17745 case 7:
17746 {
17747 if(stmt->__anon1.doWhile.exp)
17748 {
17749 struct Expression * exp;
17750
17751 if((*stmt->__anon1.doWhile.exp).last)
17752 {
17753 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17754 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17755 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 0x1;
17756 }
17757 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17758 {
17759 ProcessExpressionType(exp);
17760 }
17761 }
17762 if(stmt->__anon1.doWhile.stmt)
17763 ProcessStatement(stmt->__anon1.doWhile.stmt);
17764 break;
17765 }
17766 case 8:
17767 {
17768 struct Expression * exp;
17769
17770 if(stmt->__anon1.forStmt.init)
17771 ProcessStatement(stmt->__anon1.forStmt.init);
17772 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17773 {
17774 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17775 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17776 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 0x1;
17777 }
17778 if(stmt->__anon1.forStmt.check)
17779 ProcessStatement(stmt->__anon1.forStmt.check);
17780 if(stmt->__anon1.forStmt.increment)
17781 {
17782 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17783 ProcessExpressionType(exp);
17784 }
17785 if(stmt->__anon1.forStmt.stmt)
17786 ProcessStatement(stmt->__anon1.forStmt.stmt);
17787 break;
17788 }
17789 case 18:
17790 {
17791 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17792 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17793 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17794 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17795 char iteratorType[1024];
17796 struct Type * source;
17797 struct Expression * e;
17798 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));
17799 struct Expression * arrayExp;
17800 const char * typeString = (((void *)0));
17801 int builtinCount = 0;
17802
17803 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17804 {
17805 if(!e->next)
17806 {
17807 FreeType(e->destType);
17808 e->destType = ProcessTypeString("Container", 0x0);
17809 }
17810 if(!isBuiltin || e->next)
17811 ProcessExpressionType(e);
17812 }
17813 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17814 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)))
17815 {
17816 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17817 struct Symbol * symbol;
17818 struct Expression * expIt = (((void *)0));
17819 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17820 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17821 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17822 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17823
17824 stmt->type = 2;
17825 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17826 stmt->__anon1.compound.context->parent = curContext;
17827 curContext = stmt->__anon1.compound.context;
17828 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17829 {
17830 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17831
17832 isCustomAVLTree = 0x1;
17833 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17834 isMap = 0x1;
17835 }
17836 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17837 isArray = 0x1;
17838 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17839 {
17840 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17841
17842 isLinkList = 0x1;
17843 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17844 }
17845 if(isArray)
17846 {
17847 struct Declarator * decl;
17848 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17849
17850 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17851 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17852 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17853 }
17854 else if(isBuiltin)
17855 {
17856 struct Type * type = (((void *)0));
17857 char typeStringBuf[1024];
17858
17859 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17860 if(((struct Expression *)(*exp).last)->type == 11)
17861 {
17862 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17863
17864 if(typeName)
17865 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17866 }
17867 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)
17868 {
17869 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17870
17871 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17872 }
17873 else if(arrayExp->__anon1.list)
17874 {
17875 struct Expression * e;
17876
17877 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17878 {
17879 ProcessExpressionType(e);
17880 if(e->expType)
17881 {
17882 if(!type)
17883 {
17884 type = e->expType;
17885 type->refCount++;
17886 }
17887 else
17888 {
17889 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17890 {
17891 FreeType(type);
17892 type = e->expType;
17893 e->expType = (((void *)0));
17894 e = (*arrayExp->__anon1.list).first;
17895 ProcessExpressionType(e);
17896 if(e->expType)
17897 {
17898 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17899 {
17900 FreeType(e->expType);
17901 e->expType = (((void *)0));
17902 FreeType(type);
17903 type = (((void *)0));
17904 break;
17905 }
17906 }
17907 }
17908 }
17909 if(e->expType)
17910 {
17911 FreeType(e->expType);
17912 e->expType = (((void *)0));
17913 }
17914 }
17915 }
17916 if(type)
17917 {
17918 typeStringBuf[0] = '\0';
17919 PrintType(type, typeStringBuf, 0x0, 0x1);
17920 typeString = typeStringBuf;
17921 FreeType(type);
17922 }
17923 }
17924 if(typeString)
17925 {
17926 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17927 struct Declarator * decl;
17928 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17929
17930 if(arrayExp->__anon1.list)
17931 {
17932 struct Expression * e;
17933
17934 builtinCount = (*arrayExp->__anon1.list).count;
17935 type = ProcessTypeString(typeString, 0x0);
17936 while(e = (*arrayExp->__anon1.list).first)
17937 {
17938 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17939 e->destType = type;
17940 type->refCount++;
17941 ProcessExpressionType(e);
17942 ListAdd(initializers, MkInitializerAssignment(e));
17943 }
17944 FreeType(type);
17945 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17946 }
17947 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17948 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17949 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17950 FreeList(exp, FreeExpression);
17951 }
17952 else
17953 {
17954 arrayExp->expType = ProcessTypeString("Container", 0x0);
17955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17956 }
17957 }
17958 else if(isLinkList && !isList)
17959 {
17960 struct Declarator * decl;
17961 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17962
17963 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17964 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17965 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17966 }
17967 else if(_class->templateArgs)
17968 {
17969 if(isMap)
17970 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17971 else
17972 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
17973 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)))))))));
17974 }
17975 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17976 if(block)
17977 {
17978 switch(block->type)
17979 {
17980 case 2:
17981 if(block->__anon1.compound.context)
17982 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17983 break;
17984 case 4:
17985 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
17986 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17987 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
17988 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17989 break;
17990 case 5:
17991 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
17992 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17993 break;
17994 case 6:
17995 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
17996 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17997 break;
17998 case 7:
17999 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18000 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18001 break;
18002 case 8:
18003 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18004 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18005 break;
18006 case 18:
18007 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18008 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18009 break;
18010 }
18011 }
18012 if(filter)
18013 {
18014 block = MkIfStmt(filter, block, (((void *)0)));
18015 }
18016 if(isArray)
18017 {
18018 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));
18019 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18020 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18021 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18022 }
18023 else if(isBuiltin)
18024 {
18025 char count[128];
18026
18027 sprintf(count, "%d", builtinCount);
18028 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));
18029 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18030 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18031 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18032 }
18033 else if(isLinkList && !isList)
18034 {
18035 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18036 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18037
18038 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
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)), '=', MkExpMember(MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("next")))), block));
18041 }
18042 else
18043 {
18044 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18045 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18046
18047 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));
18048 }
18049 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18050 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18051 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18052 }
18053 else
18054 {
18055 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18056 }
18057 ProcessExpressionType(expIt);
18058 if((*stmt->__anon1.compound.declarations).first)
18059 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18060 if(symbol)
18061 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18062 ProcessStatement(stmt);
18063 curContext = stmt->__anon1.compound.context->parent;
18064 break;
18065 }
18066 else
18067 {
18068 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18069 }
18070 break;
18071 }
18072 case 9:
18073 break;
18074 case 10:
18075 break;
18076 case 11:
18077 break;
18078 case 12:
18079 {
18080 struct Expression * exp;
18081
18082 if(stmt->__anon1.expressions)
18083 {
18084 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18085 {
18086 if(!exp->next)
18087 {
18088 if(curFunction && !curFunction->type)
18089 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18090 FreeType(exp->destType);
18091 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18092 if(exp->destType)
18093 exp->destType->refCount++;
18094 }
18095 ProcessExpressionType(exp);
18096 }
18097 }
18098 break;
18099 }
18100 case 14:
18101 {
18102 ProcessDeclaration(stmt->__anon1.decl);
18103 break;
18104 }
18105 case 13:
18106 {
18107 struct AsmField * field;
18108
18109 if(stmt->__anon1.asmStmt.inputFields)
18110 {
18111 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18112 if(field->expression)
18113 ProcessExpressionType(field->expression);
18114 }
18115 if(stmt->__anon1.asmStmt.outputFields)
18116 {
18117 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18118 if(field->expression)
18119 ProcessExpressionType(field->expression);
18120 }
18121 if(stmt->__anon1.asmStmt.clobberedFields)
18122 {
18123 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18124 {
18125 if(field->expression)
18126 ProcessExpressionType(field->expression);
18127 }
18128 }
18129 break;
18130 }
18131 case 17:
18132 {
18133 struct PropertyWatch * propWatch;
18134 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18135 struct Expression * object = stmt->__anon1._watch.object;
18136 struct Expression * watcher = stmt->__anon1._watch.watcher;
18137
18138 if(watcher)
18139 ProcessExpressionType(watcher);
18140 if(object)
18141 ProcessExpressionType(object);
18142 if(inCompiler)
18143 {
18144 if(watcher || thisClass)
18145 {
18146 struct External * external = curExternal;
18147 struct Context * context = curContext;
18148
18149 stmt->type = 3;
18150 stmt->__anon1.expressions = MkList();
18151 curExternal = external->prev;
18152 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18153 {
18154 struct ClassFunction * func;
18155 char watcherName[1024];
18156 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;
18157 struct External * createdExternal;
18158 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18159
18160 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18161 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18162 if(propWatch->deleteWatch)
18163 strcat(watcherName, "_delete");
18164 else
18165 {
18166 struct Identifier * propID;
18167
18168 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18169 {
18170 strcat(watcherName, "_");
18171 strcat(watcherName, propID->string);
18172 }
18173 }
18174 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18175 {
18176 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)));
18177 ProcessClassFunctionBody(func, propWatch->compound);
18178 propWatch->compound = (((void *)0));
18179 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
18180 createdExternal->symbol->idCode = external->symbol->idCode;
18181 curExternal = createdExternal;
18182 ProcessFunction(createdExternal->__anon1.function);
18183 {
18184 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18185
18186 externalDecl->__anon1.declaration = decl;
18187 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18188 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18189 }
18190 if(propWatch->deleteWatch)
18191 {
18192 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18193
18194 ListAdd(args, CopyExpression(object));
18195 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18196 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18197 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18198 }
18199 else
18200 {
18201 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18202 struct Identifier * propID;
18203
18204 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18205 {
18206 char propName[1024];
18207 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18208
18209 if(prop)
18210 {
18211 char getName[1024], setName[1024];
18212 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18213
18214 DeclareProperty(prop, setName, getName);
18215 strcpy(propName, "__ecereProp_");
18216 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18217 strcat(propName, "_");
18218 FullClassNameCat(propName, prop->name, 0x1);
18219 ListAdd(args, CopyExpression(object));
18220 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18221 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18222 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18223 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18224 }
18225 else
18226 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18227 }
18228 }
18229 }
18230 else
18231 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18232 }
18233 curExternal = external;
18234 curContext = context;
18235 if(watcher)
18236 FreeExpression(watcher);
18237 if(object)
18238 FreeExpression(object);
18239 FreeList(watches, FreePropertyWatch);
18240 }
18241 else
18242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18243 }
18244 else
18245 {
18246 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18247 {
18248 ProcessStatement(propWatch->compound);
18249 }
18250 }
18251 break;
18252 }
18253 case 15:
18254 {
18255 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18256 struct Expression * object = stmt->__anon1._watch.object;
18257 struct __ecereNameSpace__ecere__com__Class * _class;
18258
18259 if(object)
18260 ProcessExpressionType(object);
18261 if(inCompiler)
18262 {
18263 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18264 if(_class)
18265 {
18266 struct Identifier * propID;
18267
18268 stmt->type = 3;
18269 stmt->__anon1.expressions = MkList();
18270 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18271 {
18272 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18273 }
18274 else if(!watches)
18275 {
18276 }
18277 if(watches)
18278 {
18279 for(propID = (*watches).first; propID; propID = propID->next)
18280 {
18281 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18282
18283 if(prop)
18284 {
18285 CreateFireWatcher(prop, object, stmt);
18286 }
18287 else
18288 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18289 }
18290 }
18291 else
18292 {
18293 struct __ecereNameSpace__ecere__com__Property * prop;
18294 struct __ecereNameSpace__ecere__com__Class * base;
18295
18296 for(base = _class; base; base = base->base)
18297 {
18298 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18299 {
18300 if(prop->isProperty && prop->isWatchable)
18301 {
18302 CreateFireWatcher(prop, object, stmt);
18303 }
18304 }
18305 }
18306 }
18307 if(object)
18308 FreeExpression(object);
18309 FreeList(watches, FreeIdentifier);
18310 }
18311 else
18312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18313 }
18314 break;
18315 }
18316 case 16:
18317 {
18318 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18319 struct Expression * object = stmt->__anon1._watch.object;
18320 struct Expression * watcher = stmt->__anon1._watch.watcher;
18321 struct __ecereNameSpace__ecere__com__Class * _class;
18322
18323 if(object)
18324 ProcessExpressionType(object);
18325 if(watcher)
18326 ProcessExpressionType(watcher);
18327 if(inCompiler)
18328 {
18329 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18330 if(watcher || thisClass)
18331 {
18332 if(_class)
18333 {
18334 struct Identifier * propID;
18335
18336 stmt->type = 3;
18337 stmt->__anon1.expressions = MkList();
18338 if(!watches)
18339 {
18340 struct __ecereNameSpace__ecere__sys__OldList * args;
18341
18342 args = MkList();
18343 ListAdd(args, CopyExpression(object));
18344 ListAdd(args, MkExpConstant("0"));
18345 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18346 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18347 }
18348 else
18349 {
18350 for(propID = (*watches).first; propID; propID = propID->next)
18351 {
18352 char propName[1024];
18353 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18354
18355 if(prop)
18356 {
18357 char getName[1024], setName[1024];
18358 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18359
18360 DeclareProperty(prop, setName, getName);
18361 strcpy(propName, "__ecereProp_");
18362 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18363 strcat(propName, "_");
18364 FullClassNameCat(propName, prop->name, 0x1);
18365 MangleClassName(propName);
18366 ListAdd(args, CopyExpression(object));
18367 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18368 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18369 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18370 }
18371 else
18372 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18373 }
18374 }
18375 if(object)
18376 FreeExpression(object);
18377 if(watcher)
18378 FreeExpression(watcher);
18379 FreeList(watches, FreeIdentifier);
18380 }
18381 else
18382 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18383 }
18384 else
18385 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18386 }
18387 break;
18388 }
18389 }
18390 }
18391
18392 extern struct Expression * QBrackets(struct Expression * exp);
18393
18394 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18395
18396 extern struct Declarator * QMkPtrDecl(const char *  id);
18397
18398 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18399
18400 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18401
18402 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18403
18404 static void ProcessFunction(struct FunctionDefinition * function)
18405 {
18406 struct Identifier * id = GetDeclId(function->declarator);
18407 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18408 struct Type * type = symbol ? symbol->type : (((void *)0));
18409 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18410 struct Context * oldTopContext = topContext;
18411
18412 yylloc = function->loc;
18413 if(type && type->__anon1.__anon2.thisClass)
18414 {
18415 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18416 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18417 char className[1024];
18418 char structName[1024];
18419 struct Declarator * funcDecl;
18420 struct Symbol * thisSymbol;
18421 unsigned int typedObject = 0x0;
18422
18423 if(_class && !_class->base)
18424 {
18425 _class = currentClass;
18426 if(_class && !_class->symbol)
18427 _class->symbol = FindClass(_class->fullName);
18428 classSym = _class ? _class->symbol : (((void *)0));
18429 typedObject = 0x1;
18430 }
18431 thisClass = _class;
18432 if(inCompiler && _class)
18433 {
18434 if(type->kind == 11)
18435 {
18436 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18437 {
18438 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18439
18440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18441 FreeType(param);
18442 }
18443 if(type->classObjectType != 1)
18444 {
18445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18446 symbol->type->__anon1.__anon2.staticMethod = 0x1;
18447 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18448 symbol->type->extraParam = 0x0;
18449 }
18450 }
18451 strcpy(className, "__ecereClass_");
18452 FullClassNameCat(className, _class->fullName, 0x1);
18453 MangleClassName(className);
18454 structName[0] = (char)0;
18455 FullClassNameCat(structName, _class->fullName, 0x0);
18456 funcDecl = GetFuncDecl(function->declarator);
18457 if(funcDecl)
18458 {
18459 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18460 {
18461 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18462
18463 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18464 {
18465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18466 FreeTypeName(param);
18467 }
18468 }
18469 if(!function->propertyNoThis)
18470 {
18471 struct TypeName * thisParam;
18472
18473 if(type->classObjectType != 1)
18474 {
18475 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18476 if(!funcDecl->__anon1.function.parameters)
18477 funcDecl->__anon1.function.parameters = MkList();
18478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18479 }
18480 if(typedObject)
18481 {
18482 if(type->classObjectType != 1)
18483 {
18484 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18485 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18486 }
18487 thisParam = __extension__ ({
18488 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18489
18490 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18491 });
18492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18493 }
18494 }
18495 }
18496 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18497 {
18498 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18499
18500 funcDecl = GetFuncDecl(initDecl->declarator);
18501 if(funcDecl)
18502 {
18503 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18504 {
18505 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18506
18507 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18508 {
18509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18510 FreeTypeName(param);
18511 }
18512 }
18513 if(type->classObjectType != 1)
18514 {
18515 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18516 {
18517 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18518
18519 if(!funcDecl->__anon1.function.parameters)
18520 funcDecl->__anon1.function.parameters = MkList();
18521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18522 }
18523 }
18524 }
18525 }
18526 }
18527 if(function->body)
18528 {
18529 if(type->classObjectType != 1)
18530 {
18531 thisSymbol = __extension__ ({
18532 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18533
18534 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18535 });
18536 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18537 if(typedObject && thisSymbol->type)
18538 {
18539 thisSymbol->type->classObjectType = 2;
18540 thisSymbol->type->byReference = type->byReference;
18541 thisSymbol->type->typedByReference = type->byReference;
18542 }
18543 }
18544 }
18545 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18546 {
18547 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18548
18549 {
18550 struct __ecereNameSpace__ecere__com__Class * base;
18551
18552 for(base = _class; base && base->type != 1000; base = base->next)
18553 {
18554 for(member = base->membersAndProperties.first; member; member = member->next)
18555 if(!member->isProperty)
18556 break;
18557 if(member)
18558 break;
18559 }
18560 }
18561 for(member = _class->membersAndProperties.first; member; member = member->next)
18562 if(!member->isProperty)
18563 break;
18564 if(member)
18565 {
18566 char pointerName[1024];
18567 struct Declaration * decl;
18568 struct Initializer * initializer;
18569 struct Expression * exp, * bytePtr;
18570
18571 strcpy(pointerName, "__ecerePointer_");
18572 FullClassNameCat(pointerName, _class->fullName, 0x0);
18573 {
18574 char className[1024];
18575
18576 strcpy(className, "__ecereClass_");
18577 FullClassNameCat(className, classSym->string, 0x1);
18578 MangleClassName(className);
18579 DeclareClass(classSym, className);
18580 }
18581 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18582 if(_class->fixed)
18583 {
18584 char string[256];
18585
18586 sprintf(string, "%d", _class->offset);
18587 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18588 }
18589 else
18590 {
18591 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18592 }
18593 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18594 exp->expType = __extension__ ({
18595 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18596
18597 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18598 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18599
18600 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18601 }), __ecereInstance2;
18602 });
18603 if(function->body)
18604 {
18605 yylloc = function->body->loc;
18606 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18607 {
18608 struct Context * prevContext = curContext;
18609
18610 curContext = function->body->__anon1.compound.context;
18611 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18612 curContext = prevContext;
18613 }
18614 decl->symbol = (((void *)0));
18615 if(!function->body->__anon1.compound.declarations)
18616 function->body->__anon1.compound.declarations = MkList();
18617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18618 }
18619 }
18620 }
18621 }
18622 else
18623 thisClass = (((void *)0));
18624 if(id)
18625 {
18626 FreeSpecifier(id->_class);
18627 id->_class = (((void *)0));
18628 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18629 {
18630 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18631
18632 id = GetDeclId(initDecl->declarator);
18633 FreeSpecifier(id->_class);
18634 id->_class = (((void *)0));
18635 }
18636 }
18637 if(function->body)
18638 topContext = function->body->__anon1.compound.context;
18639 {
18640 struct FunctionDefinition * oldFunction = curFunction;
18641
18642 curFunction = function;
18643 if(function->body)
18644 ProcessStatement(function->body);
18645 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18646 {
18647 struct Statement * prevCompound = curCompound;
18648 struct Context * prevContext = curContext;
18649 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18650
18651 if(!function->body->__anon1.compound.statements)
18652 function->body->__anon1.compound.statements = MkList();
18653 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18654 curCompound = function->body;
18655 curContext = function->body->__anon1.compound.context;
18656 ProcessStatement(fireWatchers);
18657 curContext = prevContext;
18658 curCompound = prevCompound;
18659 }
18660 curFunction = oldFunction;
18661 }
18662 if(function->declarator)
18663 {
18664 ProcessDeclarator(function->declarator);
18665 }
18666 topContext = oldTopContext;
18667 thisClass = oldThisClass;
18668 }
18669
18670 extern void FreeSymbol(struct Symbol * symbol);
18671
18672 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18673
18674 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18675 {
18676 struct ClassDef * def;
18677 struct External * external = curExternal;
18678 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18679
18680 for(def = definitions->first; def; def = def->next)
18681 {
18682 if(def->type == 0)
18683 {
18684 if(def->__anon1.function->declarator)
18685 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18686 else
18687 curExternal = external;
18688 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18689 }
18690 else if(def->type == 2)
18691 {
18692 if(def->__anon1.decl->type == 2)
18693 {
18694 thisClass = regClass;
18695 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18696 thisClass = (((void *)0));
18697 }
18698 else
18699 {
18700 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18701
18702 if(regClass)
18703 thisClass = regClass;
18704 ProcessDeclaration(def->__anon1.decl);
18705 thisClass = backThisClass;
18706 }
18707 }
18708 else if(def->type == 1 && def->__anon1.defProperties)
18709 {
18710 struct MemberInit * defProperty;
18711 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);
18712
18713 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18714 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18715 {
18716 thisClass = regClass;
18717 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18718 thisClass = (((void *)0));
18719 }
18720 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18721 FreeSymbol(thisSymbol);
18722 }
18723 else if(def->type == 3 && def->__anon1.propertyDef)
18724 {
18725 struct PropertyDef * prop = def->__anon1.propertyDef;
18726
18727 thisClass = regClass;
18728 if(prop->setStmt)
18729 {
18730 if(regClass)
18731 {
18732 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18733
18734 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18735 }
18736 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18737 ProcessStatement(prop->setStmt);
18738 }
18739 if(prop->getStmt)
18740 {
18741 if(regClass)
18742 {
18743 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18744
18745 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18746 }
18747 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18748 ProcessStatement(prop->getStmt);
18749 }
18750 if(prop->issetStmt)
18751 {
18752 if(regClass)
18753 {
18754 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18755
18756 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18757 }
18758 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18759 ProcessStatement(prop->issetStmt);
18760 }
18761 thisClass = (((void *)0));
18762 }
18763 else if(def->type == 4 && def->__anon1.propertyWatch)
18764 {
18765 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18766
18767 thisClass = regClass;
18768 if(propertyWatch->compound)
18769 {
18770 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);
18771
18772 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18773 curExternal = (((void *)0));
18774 ProcessStatement(propertyWatch->compound);
18775 }
18776 thisClass = (((void *)0));
18777 }
18778 }
18779 }
18780
18781 void DeclareFunctionUtil(const char * s)
18782 {
18783 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18784
18785 if(function)
18786 {
18787 char name[1024];
18788
18789 name[0] = (char)0;
18790 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18791 strcpy(name, "__ecereFunction_");
18792 FullClassNameCat(name, s, 0x0);
18793 DeclareFunction(function, name);
18794 }
18795 }
18796
18797 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18798
18799 void ComputeDataTypes()
18800 {
18801 struct External * external;
18802 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18803 struct External * after = (((void *)0));
18804
18805 currentClass = (((void *)0));
18806 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18807 for(external = (*ast).first; external; external = external->next)
18808 {
18809 if(external->type == 1)
18810 {
18811 struct Declaration * decl = external->__anon1.declaration;
18812
18813 if(decl)
18814 {
18815 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18816
18817 if(decls)
18818 {
18819 struct InitDeclarator * initDecl = (*decls).first;
18820
18821 if(initDecl)
18822 {
18823 struct Declarator * declarator = initDecl->declarator;
18824
18825 if(declarator && declarator->type == 1)
18826 {
18827 struct Identifier * id = declarator->__anon1.identifier;
18828
18829 if(id && id->string)
18830 {
18831 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18832 {
18833 external->symbol->id = -1001, external->symbol->idCode = -1001;
18834 after = external;
18835 }
18836 }
18837 }
18838 }
18839 }
18840 }
18841 }
18842 }
18843 temp->symbol = __extension__ ({
18844 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18845
18846 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18847 });
18848 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18849 curExternal = temp;
18850 DeclareFunctionUtil("eSystem_New");
18851 DeclareFunctionUtil("eSystem_New0");
18852 DeclareFunctionUtil("eSystem_Renew");
18853 DeclareFunctionUtil("eSystem_Renew0");
18854 DeclareFunctionUtil("eSystem_Delete");
18855 DeclareFunctionUtil("eClass_GetProperty");
18856 DeclareFunctionUtil("eClass_SetProperty");
18857 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18858 DeclareFunctionUtil("eInstance_SetMethod");
18859 DeclareFunctionUtil("eInstance_IncRef");
18860 DeclareFunctionUtil("eInstance_StopWatching");
18861 DeclareFunctionUtil("eInstance_Watch");
18862 DeclareFunctionUtil("eInstance_FireWatchers");
18863 DeclareStruct("ecere::com::Class", 0x0);
18864 DeclareStruct("ecere::com::Instance", 0x0);
18865 DeclareStruct("ecere::com::Property", 0x0);
18866 DeclareStruct("ecere::com::DataMember", 0x0);
18867 DeclareStruct("ecere::com::Method", 0x0);
18868 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18869 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18871 for(external = (*ast).first; external; external = external->next)
18872 {
18873 afterExternal = curExternal = external;
18874 if(external->type == 0)
18875 {
18876 currentClass = external->__anon1.function->_class;
18877 ProcessFunction(external->__anon1.function);
18878 }
18879 else if(external->type == 1)
18880 {
18881 currentClass = (((void *)0));
18882 if(external->__anon1.declaration)
18883 ProcessDeclaration(external->__anon1.declaration);
18884 }
18885 else if(external->type == 2)
18886 {
18887 struct ClassDefinition * _class = external->__anon1._class;
18888
18889 currentClass = external->symbol->__anon1.registered;
18890 if(_class->definitions)
18891 {
18892 ProcessClass(_class->definitions, _class->symbol);
18893 }
18894 if(inCompiler)
18895 {
18896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18897 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18898 }
18899 }
18900 else if(external->type == 4)
18901 {
18902 thisNameSpace = external->__anon1.id->string;
18903 }
18904 }
18905 currentClass = (((void *)0));
18906 thisNameSpace = (((void *)0));
18907 curExternal = (((void *)0));
18908 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18909 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18910 }
18911
18912 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);
18913
18914 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);
18915
18916 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18917
18918 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18919 {
18920 struct __ecereNameSpace__ecere__com__Class * class;
18921
18922 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18923 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18924 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18925 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18926 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18927 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18928 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18929 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18930 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18931 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18932 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18933 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18934 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18935 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18936 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18937 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18938 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18939 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18940 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18941 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18945 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18971 __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);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18975 __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);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18988 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18989 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18990 __ecereClass_Conversion = class;
18991 __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);
18992 __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);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18994 __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);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19017 }
19018
19019 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19020 {
19021
19022 }
19023