compiler/libec; ecere: (#158, #305) Taking advantage of new DataType Size vs Struct...
[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->constant = 0x1;
5061 }
5062 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1, warnConst))
5063 {
5064 if(!conversions && !convert->Set)
5065 success = 0x1;
5066 else if(conversions != (((void *)0)))
5067 {
5068 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (source->kind != 8 || source->__anon1._class->__anon1.registered != _class->base))
5069 success = 0x1;
5070 else
5071 {
5072 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5073
5074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5075 success = 0x1;
5076 }
5077 }
5078 }
5079 if(constType)
5080 FreeType(constType);
5081 if(success)
5082 return 0x1;
5083 }
5084 }
5085 }
5086 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5087 {
5088 if(!dest->__anon1._class->__anon1.registered->dataType)
5089 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5090 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5091 {
5092 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0x0, 0x0, warnConst))
5093 {
5094 return 0x1;
5095 }
5096 }
5097 }
5098 }
5099 if(source->kind == 8)
5100 {
5101 struct __ecereNameSpace__ecere__com__Class * _class;
5102
5103 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5104 {
5105 struct __ecereNameSpace__ecere__com__Property * convert;
5106
5107 for(convert = _class->conversions.first; convert; convert = convert->next)
5108 {
5109 if(convert->memberAccess == 1 || _class->module == privateModule)
5110 {
5111 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5112
5113 if(!convert->dataType)
5114 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5115 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1, warnConst))
5116 {
5117 if(!conversions && !convert->Get)
5118 return 0x1;
5119 else if(conversions != (((void *)0)))
5120 {
5121 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5122 return 0x1;
5123 else
5124 {
5125 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5126
5127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5128 return 0x1;
5129 }
5130 }
5131 }
5132 }
5133 }
5134 }
5135 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5136 {
5137 if(!source->__anon1._class->__anon1.registered->dataType)
5138 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5139 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5140 {
5141 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0x0, 0x0, warnConst))
5142 return 0x1;
5143 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, warnConst))
5144 return 0x1;
5145 }
5146 }
5147 }
5148 }
5149 if(source->kind == 8 || source->kind == 19)
5150 ;
5151 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5152 return 0x1;
5153 else if(dest->kind == 7 && source->kind == 6)
5154 return 0x1;
5155 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5156 return 0x1;
5157 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5158 return 0x1;
5159 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5160 return 0x1;
5161 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5162 return 0x1;
5163 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5164 return 0x1;
5165 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
5166 return 0x1;
5167 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5168 return 0x1;
5169 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->__anon1.type->kind == 11) || source->kind == 16)))
5170 {
5171 struct Type * paramSource, * paramDest;
5172
5173 if(dest->kind == 16)
5174 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5175 if(source->kind == 16)
5176 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5177 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5178 dest = dest->__anon1.type;
5179 if(source->kind == 13 && source->__anon1.type->kind == 11)
5180 source = source->__anon1.type;
5181 if(dest->kind == 16)
5182 dest = dest->__anon1.__anon3.method->dataType;
5183 if(source->kind == 16)
5184 source = source->__anon1.__anon3.method->dataType;
5185 paramSource = source->__anon1.__anon2.params.first;
5186 if(paramSource && paramSource->kind == 0)
5187 paramSource = (((void *)0));
5188 paramDest = dest->__anon1.__anon2.params.first;
5189 if(paramDest && paramDest->kind == 0)
5190 paramDest = (((void *)0));
5191 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5192 {
5193 if(!paramDest || (!(paramDest->kind == 13 && paramDest->__anon1.type && paramDest->__anon1.type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, paramDest->__anon1._class->__anon1.registered))))
5194 {
5195 if(paramDest && paramDest->kind == 8)
5196 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5197 else
5198 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5199 return 0x0;
5200 }
5201 paramDest = paramDest->next;
5202 }
5203 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5204 {
5205 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5206 {
5207 if(dest->__anon1.__anon2.thisClass)
5208 {
5209 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5210 {
5211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5212 return 0x0;
5213 }
5214 }
5215 else
5216 {
5217 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5218 {
5219 if(owningClassDest)
5220 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5221 else
5222 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5223 return 0x0;
5224 }
5225 }
5226 paramSource = paramSource->next;
5227 }
5228 else
5229 {
5230 if(dest->__anon1.__anon2.thisClass)
5231 {
5232 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5233 {
5234 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5235 return 0x0;
5236 }
5237 }
5238 else
5239 {
5240 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5241 {
5242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5243 return 0x0;
5244 }
5245 }
5246 }
5247 }
5248 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5249 {
5250 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5251 return 0x0;
5252 }
5253 else
5254 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 0x1);
5255 for(; paramDest; paramDest = paramDest->next)
5256 {
5257 if(!paramSource)
5258 {
5259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5260 return 0x0;
5261 }
5262 {
5263 struct Type * paramDestType = paramDest;
5264 struct Type * paramSourceType = paramSource;
5265 struct Type * type = paramDestType;
5266
5267 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5268 {
5269 int id = 0;
5270 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5271 struct __ecereNameSpace__ecere__com__Class * sClass;
5272
5273 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5274 {
5275 id = 0;
5276 if(sClass->templateClass)
5277 sClass = sClass->templateClass;
5278 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5279 {
5280 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5281 {
5282 for(sClass = sClass->base; sClass; sClass = sClass->base)
5283 {
5284 if(sClass->templateClass)
5285 sClass = sClass->templateClass;
5286 id += sClass->templateParams.count;
5287 }
5288 break;
5289 }
5290 id++;
5291 }
5292 if(curParam)
5293 break;
5294 }
5295 if(curParam)
5296 {
5297 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5298
5299 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
5300 }
5301 }
5302 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)))
5303 {
5304 char type[1024];
5305
5306 type[0] = (char)0;
5307 PrintType(paramDest, type, 0x0, 0x1);
5308 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5309 if(paramDestType != paramDest)
5310 FreeType(paramDestType);
5311 return 0x0;
5312 }
5313 if(paramDestType != paramDest)
5314 FreeType(paramDestType);
5315 }
5316 paramSource = paramSource->next;
5317 }
5318 if(paramSource)
5319 {
5320 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5321 return 0x0;
5322 }
5323 return 0x1;
5324 }
5325 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5326 {
5327 return 0x1;
5328 }
5329 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5330 {
5331 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5332 return 0x1;
5333 }
5334 }
5335 return 0x0;
5336 }
5337
5338 static void FreeConvert(struct Conversion * convert)
5339 {
5340 if(convert->resultType)
5341 FreeType(convert->resultType);
5342 }
5343
5344 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5345
5346 struct __ecereNameSpace__ecere__com__BTNamedLink
5347 {
5348 const char *  name;
5349 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5350 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5351 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5352 int depth;
5353 void *  data;
5354 } __attribute__ ((gcc_struct));
5355
5356 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5357
5358 struct __ecereNameSpace__ecere__com__EnumClassData
5359 {
5360 struct __ecereNameSpace__ecere__sys__OldList values;
5361 int largest;
5362 } __attribute__ ((gcc_struct));
5363
5364 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5365
5366 struct __ecereNameSpace__ecere__sys__NamedLink
5367 {
5368 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5369 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5370 char *  name;
5371 void *  data;
5372 } __attribute__ ((gcc_struct));
5373
5374 extern void FreeExpContents(struct Expression * exp);
5375
5376 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5377
5378 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5379
5380 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5381
5382 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5383
5384 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5385
5386 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5387 {
5388 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5389
5390 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
5391 {
5392 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5393
5394 if(_class->type == 4)
5395 {
5396 struct __ecereNameSpace__ecere__sys__OldList converts =
5397 {
5398 0, 0, 0, 0, 0
5399 };
5400 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5401
5402 type->kind = 8;
5403 if(!_class->symbol)
5404 _class->symbol = FindClass(_class->fullName);
5405 type->__anon1._class = _class->symbol;
5406 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0, 0x0))
5407 {
5408 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5409 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5410
5411 if(enumClass)
5412 {
5413 struct __ecereNameSpace__ecere__com__Class * baseClass;
5414
5415 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5416 {
5417 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5418
5419 for(value = e->values.first; value; value = value->next)
5420 {
5421 if(!strcmp(value->name, string))
5422 break;
5423 }
5424 if(value)
5425 {
5426 FreeExpContents(sourceExp);
5427 FreeType(sourceExp->expType);
5428 sourceExp->isConstant = 0x1;
5429 sourceExp->expType = MkClassType(baseClass->fullName);
5430 {
5431 char constant[256];
5432
5433 sourceExp->type = 2;
5434 if(!strcmp(baseClass->dataTypeString, "int"))
5435 sprintf(constant, "%d", (int)value->data);
5436 else
5437 sprintf(constant, "0x%X", (int)value->data);
5438 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5439 }
5440 while(converts.first)
5441 {
5442 struct Conversion * convert = converts.first;
5443
5444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5446 }
5447 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5448 return 0x1;
5449 }
5450 }
5451 }
5452 }
5453 if(converts.first)
5454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5455 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5456 }
5457 }
5458 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); nameSpace != (((void *)0)); nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
5459 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5460 return 0x1;
5461 return 0x0;
5462 }
5463
5464 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5465
5466 struct __ecereNameSpace__ecere__com__SubModule
5467 {
5468 struct __ecereNameSpace__ecere__com__SubModule * prev;
5469 struct __ecereNameSpace__ecere__com__SubModule * next;
5470 struct __ecereNameSpace__ecere__com__Instance * module;
5471 int importMode;
5472 } __attribute__ ((gcc_struct));
5473
5474 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5475 {
5476 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5477
5478 if(searchFor == searchIn)
5479 return 0x1;
5480 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5481 {
5482 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5483 {
5484 if(ModuleVisibility(subModule->module, searchFor))
5485 return 0x1;
5486 }
5487 }
5488 return 0x0;
5489 }
5490
5491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5492
5493 struct __ecereNameSpace__ecere__com__Application
5494 {
5495 int argc;
5496 const char * *  argv;
5497 int exitCode;
5498 unsigned int isGUIApp;
5499 struct __ecereNameSpace__ecere__sys__OldList allModules;
5500 char *  parsedCommand;
5501 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5502 } __attribute__ ((gcc_struct));
5503
5504 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5505 {
5506 struct __ecereNameSpace__ecere__com__Instance * module;
5507
5508 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5509 return 0x1;
5510 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5511 return 0x1;
5512 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5513 return 0x1;
5514 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5515 {
5516 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5517 return 0x1;
5518 }
5519 return 0x0;
5520 }
5521
5522 extern struct Expression * CopyExpression(struct Expression * exp);
5523
5524 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5525
5526 void ReadString(char *  output, char *  string);
5527
5528 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5529
5530 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5531
5532 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5533
5534 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5535 {
5536 struct Type * source;
5537 struct Type * realDest = dest;
5538 struct Type * backupSourceExpType = (((void *)0));
5539 struct Expression * computedExp = sourceExp;
5540
5541 dest->refCount++;
5542 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5543 {
5544 computedExp = CopyExpression(sourceExp);
5545 ComputeExpression(computedExp);
5546 }
5547 source = sourceExp->expType;
5548 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5549 {
5550 if(computedExp != sourceExp)
5551 {
5552 FreeExpression(computedExp);
5553 computedExp = sourceExp;
5554 }
5555 FreeType(dest);
5556 return 0x1;
5557 }
5558 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5559 {
5560 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5561 {
5562 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5563
5564 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5565 ;
5566 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5567 ;
5568 if(sourceBase == destBase)
5569 {
5570 if(computedExp != sourceExp)
5571 {
5572 FreeExpression(computedExp);
5573 computedExp = sourceExp;
5574 }
5575 FreeType(dest);
5576 return 0x1;
5577 }
5578 }
5579 }
5580 if(source)
5581 {
5582 struct __ecereNameSpace__ecere__sys__OldList * specs;
5583 unsigned int flag = 0x0;
5584 long long value = (((int)0x7fffffff));
5585
5586 source->refCount++;
5587 if(computedExp->type == 2)
5588 {
5589 if(source->isSigned)
5590 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5591 else
5592 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5593 }
5594 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5595 {
5596 if(source->isSigned)
5597 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5598 else
5599 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5600 }
5601 if(computedExp != sourceExp)
5602 {
5603 FreeExpression(computedExp);
5604 computedExp = sourceExp;
5605 }
5606 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "ecere::com::unichar"))
5607 {
5608 FreeType(source);
5609 source = __extension__ ({
5610 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5611
5612 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5613 });
5614 }
5615 if(dest->kind == 8)
5616 {
5617 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5618
5619 if(_class && _class->type == 3)
5620 {
5621 if(source->kind != 8)
5622 {
5623 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5624 struct Type * tempDest, * tempSource;
5625
5626 for(; _class->base->type != 1000; _class = _class->base)
5627 ;
5628 tempSource = dest;
5629 tempDest = tempType;
5630 tempType->kind = 8;
5631 if(!_class->symbol)
5632 _class->symbol = FindClass(_class->fullName);
5633 tempType->__anon1._class = _class->symbol;
5634 tempType->truth = dest->truth;
5635 if(tempType->__anon1._class)
5636 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5637 backupSourceExpType = sourceExp->expType;
5638 sourceExp->expType = dest;
5639 dest->refCount++;
5640 flag = 0x1;
5641 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5642 }
5643 }
5644 if(_class && _class->type == 2 && source->kind != 8)
5645 {
5646 if(!dest->__anon1._class->__anon1.registered->dataType)
5647 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5648 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5649 {
5650 FreeType(source);
5651 FreeType(sourceExp->expType);
5652 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5653 source->refCount++;
5654 }
5655 }
5656 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5657 {
5658 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5659 struct Declarator * decl;
5660 char string[1024];
5661
5662 ReadString(string, sourceExp->__anon1.__anon2.string);
5663 decl = SpecDeclFromString(string, specs, (((void *)0)));
5664 FreeExpContents(sourceExp);
5665 FreeType(sourceExp->expType);
5666 sourceExp->type = 24;
5667 sourceExp->__anon1._classExp.specifiers = specs;
5668 sourceExp->__anon1._classExp.decl = decl;
5669 sourceExp->expType = dest;
5670 dest->refCount++;
5671 FreeType(source);
5672 FreeType(dest);
5673 if(backupSourceExpType)
5674 FreeType(backupSourceExpType);
5675 return 0x1;
5676 }
5677 }
5678 else if(source->kind == 8)
5679 {
5680 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5681
5682 if(_class && (_class->type == 3 || _class->type == 2))
5683 {
5684 if(dest->kind != 8)
5685 {
5686 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5687 struct Type * tempDest, * tempSource;
5688
5689 if(!source->__anon1._class->__anon1.registered->dataType)
5690 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0x0);
5691 for(; _class->base->type != 1000; _class = _class->base)
5692 ;
5693 tempDest = source;
5694 tempSource = tempType;
5695 tempType->kind = 8;
5696 tempType->__anon1._class = FindClass(_class->fullName);
5697 tempType->truth = source->truth;
5698 tempType->classObjectType = source->classObjectType;
5699 if(tempType->__anon1._class)
5700 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5701 if(conversions->last)
5702 {
5703 ((struct Conversion *)conversions->last)->resultType = dest;
5704 dest->refCount++;
5705 }
5706 FreeType(sourceExp->expType);
5707 sourceExp->expType = MkClassType(_class->fullName);
5708 sourceExp->expType->truth = source->truth;
5709 sourceExp->expType->classObjectType = source->classObjectType;
5710 if(!sourceExp->destType)
5711 {
5712 FreeType(sourceExp->destType);
5713 sourceExp->destType = sourceExp->expType;
5714 if(sourceExp->expType)
5715 sourceExp->expType->refCount++;
5716 }
5717 if(!_class->dataType)
5718 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5719 FreeType(dest);
5720 dest = MkClassType(source->__anon1._class->string);
5721 dest->truth = source->truth;
5722 dest->classObjectType = source->classObjectType;
5723 FreeType(source);
5724 source = _class->dataType;
5725 source->refCount++;
5726 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5727 }
5728 }
5729 }
5730 if(!flag)
5731 {
5732 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5733 {
5734 FreeType(source);
5735 FreeType(dest);
5736 return 0x1;
5737 }
5738 }
5739 if(dest->kind == 8)
5740 {
5741 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5742 unsigned int fittingValue = 0x0;
5743
5744 if(_class && _class->type == 4)
5745 {
5746 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5747 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5748
5749 if(c && value >= 0 && value <= c->largest)
5750 fittingValue = 0x1;
5751 }
5752 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5753 {
5754 if(_class->type == 0 || _class->type == 5)
5755 {
5756 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5757
5758 *newExp = *sourceExp;
5759 if(sourceExp->destType)
5760 sourceExp->destType->refCount++;
5761 if(sourceExp->expType)
5762 sourceExp->expType->refCount++;
5763 sourceExp->type = 11;
5764 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5765 sourceExp->__anon1.cast.exp = newExp;
5766 FreeType(sourceExp->expType);
5767 sourceExp->expType = (((void *)0));
5768 ProcessExpressionType(sourceExp);
5769 if(!inCompiler)
5770 {
5771 FreeType(sourceExp->expType);
5772 sourceExp->expType = dest;
5773 }
5774 FreeType(source);
5775 if(inCompiler)
5776 FreeType(dest);
5777 if(backupSourceExpType)
5778 FreeType(backupSourceExpType);
5779 return 0x1;
5780 }
5781 if(!_class->dataType)
5782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5783 FreeType(dest);
5784 dest = _class->dataType;
5785 dest->refCount++;
5786 }
5787 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5788 {
5789 specs = MkListOne(MkSpecifier(DOUBLE));
5790 }
5791 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5792 {
5793 specs = MkListOne(MkSpecifier(FLOAT));
5794 }
5795 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5796 {
5797 specs = MkList();
5798 if(!dest->isSigned)
5799 ListAdd(specs, MkSpecifier(UNSIGNED));
5800 ListAdd(specs, MkSpecifier(INT64));
5801 }
5802 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5803 {
5804 specs = MkList();
5805 if(!dest->isSigned)
5806 ListAdd(specs, MkSpecifier(UNSIGNED));
5807 ListAdd(specs, MkSpecifier(INT));
5808 }
5809 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5810 {
5811 specs = MkList();
5812 if(!dest->isSigned)
5813 ListAdd(specs, MkSpecifier(UNSIGNED));
5814 ListAdd(specs, MkSpecifier(SHORT));
5815 }
5816 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5817 {
5818 specs = MkList();
5819 if(!dest->isSigned)
5820 ListAdd(specs, MkSpecifier(UNSIGNED));
5821 ListAdd(specs, MkSpecifier(CHAR));
5822 }
5823 else
5824 {
5825 FreeType(source);
5826 FreeType(dest);
5827 if(backupSourceExpType)
5828 {
5829 if(sourceExp->expType)
5830 FreeType(sourceExp->expType);
5831 sourceExp->expType = backupSourceExpType;
5832 }
5833 return 0x0;
5834 }
5835 }
5836 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5837 {
5838 specs = MkListOne(MkSpecifier(DOUBLE));
5839 }
5840 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5841 {
5842 specs = MkListOne(MkSpecifier(FLOAT));
5843 }
5844 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5845 {
5846 specs = MkList();
5847 ListAdd(specs, MkSpecifier(BOOL));
5848 }
5849 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5850 {
5851 specs = MkList();
5852 if(!dest->isSigned)
5853 ListAdd(specs, MkSpecifier(UNSIGNED));
5854 ListAdd(specs, MkSpecifier(CHAR));
5855 }
5856 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5857 {
5858 specs = MkList();
5859 if(!dest->isSigned)
5860 ListAdd(specs, MkSpecifier(UNSIGNED));
5861 ListAdd(specs, MkSpecifier(SHORT));
5862 }
5863 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5864 {
5865 specs = MkList();
5866 if(!dest->isSigned)
5867 ListAdd(specs, MkSpecifier(UNSIGNED));
5868 ListAdd(specs, MkSpecifier(INT));
5869 }
5870 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5871 {
5872 specs = MkList();
5873 if(!dest->isSigned)
5874 ListAdd(specs, MkSpecifier(UNSIGNED));
5875 ListAdd(specs, MkSpecifier(INT64));
5876 }
5877 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5878 {
5879 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5880 }
5881 else
5882 {
5883 FreeType(source);
5884 FreeType(dest);
5885 if(backupSourceExpType)
5886 {
5887 if(sourceExp->expType)
5888 FreeType(sourceExp->expType);
5889 sourceExp->expType = backupSourceExpType;
5890 }
5891 return 0x0;
5892 }
5893 if(!flag && !sourceExp->opDestType)
5894 {
5895 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5896
5897 *newExp = *sourceExp;
5898 newExp->prev = (((void *)0));
5899 newExp->next = (((void *)0));
5900 if(sourceExp->destType)
5901 sourceExp->destType->refCount++;
5902 if(sourceExp->expType)
5903 sourceExp->expType->refCount++;
5904 sourceExp->type = 11;
5905 if(realDest->kind == 8)
5906 {
5907 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5908 FreeList(specs, FreeSpecifier);
5909 }
5910 else
5911 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5912 if(newExp->type == 4)
5913 {
5914 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5915 }
5916 else
5917 sourceExp->__anon1.cast.exp = newExp;
5918 FreeType(sourceExp->expType);
5919 sourceExp->expType = (((void *)0));
5920 ProcessExpressionType(sourceExp);
5921 }
5922 else
5923 FreeList(specs, FreeSpecifier);
5924 FreeType(dest);
5925 FreeType(source);
5926 if(backupSourceExpType)
5927 FreeType(backupSourceExpType);
5928 return 0x1;
5929 }
5930 else
5931 {
5932 if(computedExp != sourceExp)
5933 {
5934 FreeExpression(computedExp);
5935 computedExp = sourceExp;
5936 }
5937 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5938 sourceExp = (*sourceExp->__anon1.list).last;
5939 if(sourceExp->type == 0)
5940 {
5941 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5942
5943 if(dest->kind == 8)
5944 {
5945 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5946 {
5947 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5948 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5949
5950 if(enumClass)
5951 {
5952 for(; _class && _class->type == 4; _class = _class->base)
5953 {
5954 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5955 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5956
5957 for(value = e->values.first; value; value = value->next)
5958 {
5959 if(!strcmp(value->name, id->string))
5960 break;
5961 }
5962 if(value)
5963 {
5964 FreeExpContents(sourceExp);
5965 FreeType(sourceExp->expType);
5966 sourceExp->isConstant = 0x1;
5967 sourceExp->expType = MkClassType(_class->fullName);
5968 {
5969 char constant[256];
5970
5971 sourceExp->type = 2;
5972 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5973 sprintf(constant, "%d", (int)value->data);
5974 else
5975 sprintf(constant, "0x%X", (int)value->data);
5976 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5977 }
5978 FreeType(dest);
5979 return 0x1;
5980 }
5981 }
5982 }
5983 }
5984 }
5985 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5986 {
5987 FreeType(dest);
5988 return 0x1;
5989 }
5990 }
5991 FreeType(dest);
5992 }
5993 return 0x0;
5994 }
5995
5996 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 {
5998 int value2 = op2->__anon1.i;
5999
6000 exp->type = 2;
6001 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6002 if(!exp->expType)
6003 {
6004 exp->expType = op1->type;
6005 if(op1->type)
6006 op1->type->refCount++;
6007 }
6008 return 0x1;
6009 }
6010
6011 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 {
6013 unsigned int value2 = op2->__anon1.ui;
6014
6015 exp->type = 2;
6016 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6017 if(!exp->expType)
6018 {
6019 exp->expType = op1->type;
6020 if(op1->type)
6021 op1->type->refCount++;
6022 }
6023 return 0x1;
6024 }
6025
6026 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 {
6028 long long value2 = op2->__anon1.i64;
6029
6030 exp->type = 2;
6031 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6032 if(!exp->expType)
6033 {
6034 exp->expType = op1->type;
6035 if(op1->type)
6036 op1->type->refCount++;
6037 }
6038 return 0x1;
6039 }
6040
6041 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 {
6043 uint64 value2 = op2->__anon1.ui64;
6044
6045 exp->type = 2;
6046 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6047 if(!exp->expType)
6048 {
6049 exp->expType = op1->type;
6050 if(op1->type)
6051 op1->type->refCount++;
6052 }
6053 return 0x1;
6054 }
6055
6056 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 {
6058 short value2 = op2->__anon1.s;
6059
6060 exp->type = 2;
6061 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6062 if(!exp->expType)
6063 {
6064 exp->expType = op1->type;
6065 if(op1->type)
6066 op1->type->refCount++;
6067 }
6068 return 0x1;
6069 }
6070
6071 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6072 {
6073 unsigned short value2 = op2->__anon1.us;
6074
6075 exp->type = 2;
6076 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6077 if(!exp->expType)
6078 {
6079 exp->expType = op1->type;
6080 if(op1->type)
6081 op1->type->refCount++;
6082 }
6083 return 0x1;
6084 }
6085
6086 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6087 {
6088 char value2 = op2->__anon1.c;
6089
6090 exp->type = 2;
6091 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6092 if(!exp->expType)
6093 {
6094 exp->expType = op1->type;
6095 if(op1->type)
6096 op1->type->refCount++;
6097 }
6098 return 0x1;
6099 }
6100
6101 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6102 {
6103 unsigned char value2 = op2->__anon1.uc;
6104
6105 exp->type = 2;
6106 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6107 if(!exp->expType)
6108 {
6109 exp->expType = op1->type;
6110 if(op1->type)
6111 op1->type->refCount++;
6112 }
6113 return 0x1;
6114 }
6115
6116 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6117 {
6118 float value2 = op2->__anon1.f;
6119
6120 exp->type = 2;
6121 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6122 if(!exp->expType)
6123 {
6124 exp->expType = op1->type;
6125 if(op1->type)
6126 op1->type->refCount++;
6127 }
6128 return 0x1;
6129 }
6130
6131 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6132 {
6133 double value2 = op2->__anon1.d;
6134
6135 exp->type = 2;
6136 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6137 if(!exp->expType)
6138 {
6139 exp->expType = op1->type;
6140 if(op1->type)
6141 op1->type->refCount++;
6142 }
6143 return 0x1;
6144 }
6145
6146 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6147 {
6148 int value2 = op2->__anon1.i;
6149
6150 exp->type = 2;
6151 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6152 if(!exp->expType)
6153 {
6154 exp->expType = op1->type;
6155 if(op1->type)
6156 op1->type->refCount++;
6157 }
6158 return 0x1;
6159 }
6160
6161 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6162 {
6163 unsigned int value2 = op2->__anon1.ui;
6164
6165 exp->type = 2;
6166 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6167 if(!exp->expType)
6168 {
6169 exp->expType = op1->type;
6170 if(op1->type)
6171 op1->type->refCount++;
6172 }
6173 return 0x1;
6174 }
6175
6176 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6177 {
6178 long long value2 = op2->__anon1.i64;
6179
6180 exp->type = 2;
6181 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6182 if(!exp->expType)
6183 {
6184 exp->expType = op1->type;
6185 if(op1->type)
6186 op1->type->refCount++;
6187 }
6188 return 0x1;
6189 }
6190
6191 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6192 {
6193 uint64 value2 = op2->__anon1.ui64;
6194
6195 exp->type = 2;
6196 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6197 if(!exp->expType)
6198 {
6199 exp->expType = op1->type;
6200 if(op1->type)
6201 op1->type->refCount++;
6202 }
6203 return 0x1;
6204 }
6205
6206 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6207 {
6208 short value2 = op2->__anon1.s;
6209
6210 exp->type = 2;
6211 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6212 if(!exp->expType)
6213 {
6214 exp->expType = op1->type;
6215 if(op1->type)
6216 op1->type->refCount++;
6217 }
6218 return 0x1;
6219 }
6220
6221 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6222 {
6223 unsigned short value2 = op2->__anon1.us;
6224
6225 exp->type = 2;
6226 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6227 if(!exp->expType)
6228 {
6229 exp->expType = op1->type;
6230 if(op1->type)
6231 op1->type->refCount++;
6232 }
6233 return 0x1;
6234 }
6235
6236 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6237 {
6238 char value2 = op2->__anon1.c;
6239
6240 exp->type = 2;
6241 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6242 if(!exp->expType)
6243 {
6244 exp->expType = op1->type;
6245 if(op1->type)
6246 op1->type->refCount++;
6247 }
6248 return 0x1;
6249 }
6250
6251 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6252 {
6253 unsigned char value2 = op2->__anon1.uc;
6254
6255 exp->type = 2;
6256 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6257 if(!exp->expType)
6258 {
6259 exp->expType = op1->type;
6260 if(op1->type)
6261 op1->type->refCount++;
6262 }
6263 return 0x1;
6264 }
6265
6266 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6267 {
6268 float value2 = op2->__anon1.f;
6269
6270 exp->type = 2;
6271 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6272 if(!exp->expType)
6273 {
6274 exp->expType = op1->type;
6275 if(op1->type)
6276 op1->type->refCount++;
6277 }
6278 return 0x1;
6279 }
6280
6281 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6282 {
6283 double value2 = op2->__anon1.d;
6284
6285 exp->type = 2;
6286 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6287 if(!exp->expType)
6288 {
6289 exp->expType = op1->type;
6290 if(op1->type)
6291 op1->type->refCount++;
6292 }
6293 return 0x1;
6294 }
6295
6296 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6297 {
6298 int value2 = op2->__anon1.i;
6299
6300 exp->type = 2;
6301 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6302 if(!exp->expType)
6303 {
6304 exp->expType = op1->type;
6305 if(op1->type)
6306 op1->type->refCount++;
6307 }
6308 return 0x1;
6309 }
6310
6311 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6312 {
6313 unsigned int value2 = op2->__anon1.ui;
6314
6315 exp->type = 2;
6316 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6317 if(!exp->expType)
6318 {
6319 exp->expType = op1->type;
6320 if(op1->type)
6321 op1->type->refCount++;
6322 }
6323 return 0x1;
6324 }
6325
6326 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6327 {
6328 long long value2 = op2->__anon1.i64;
6329
6330 exp->type = 2;
6331 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6332 if(!exp->expType)
6333 {
6334 exp->expType = op1->type;
6335 if(op1->type)
6336 op1->type->refCount++;
6337 }
6338 return 0x1;
6339 }
6340
6341 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6342 {
6343 uint64 value2 = op2->__anon1.ui64;
6344
6345 exp->type = 2;
6346 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6347 if(!exp->expType)
6348 {
6349 exp->expType = op1->type;
6350 if(op1->type)
6351 op1->type->refCount++;
6352 }
6353 return 0x1;
6354 }
6355
6356 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6357 {
6358 short value2 = op2->__anon1.s;
6359
6360 exp->type = 2;
6361 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6362 if(!exp->expType)
6363 {
6364 exp->expType = op1->type;
6365 if(op1->type)
6366 op1->type->refCount++;
6367 }
6368 return 0x1;
6369 }
6370
6371 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6372 {
6373 unsigned short value2 = op2->__anon1.us;
6374
6375 exp->type = 2;
6376 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6377 if(!exp->expType)
6378 {
6379 exp->expType = op1->type;
6380 if(op1->type)
6381 op1->type->refCount++;
6382 }
6383 return 0x1;
6384 }
6385
6386 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6387 {
6388 char value2 = op2->__anon1.c;
6389
6390 exp->type = 2;
6391 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6392 if(!exp->expType)
6393 {
6394 exp->expType = op1->type;
6395 if(op1->type)
6396 op1->type->refCount++;
6397 }
6398 return 0x1;
6399 }
6400
6401 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6402 {
6403 unsigned char value2 = op2->__anon1.uc;
6404
6405 exp->type = 2;
6406 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6407 if(!exp->expType)
6408 {
6409 exp->expType = op1->type;
6410 if(op1->type)
6411 op1->type->refCount++;
6412 }
6413 return 0x1;
6414 }
6415
6416 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6417 {
6418 float value2 = op2->__anon1.f;
6419
6420 exp->type = 2;
6421 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6422 if(!exp->expType)
6423 {
6424 exp->expType = op1->type;
6425 if(op1->type)
6426 op1->type->refCount++;
6427 }
6428 return 0x1;
6429 }
6430
6431 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6432 {
6433 double value2 = op2->__anon1.d;
6434
6435 exp->type = 2;
6436 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6437 if(!exp->expType)
6438 {
6439 exp->expType = op1->type;
6440 if(op1->type)
6441 op1->type->refCount++;
6442 }
6443 return 0x1;
6444 }
6445
6446 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6447 {
6448 int value2 = op2->__anon1.i;
6449
6450 exp->type = 2;
6451 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6452 if(!exp->expType)
6453 {
6454 exp->expType = op1->type;
6455 if(op1->type)
6456 op1->type->refCount++;
6457 }
6458 return 0x1;
6459 }
6460
6461 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6462 {
6463 unsigned int value2 = op2->__anon1.ui;
6464
6465 exp->type = 2;
6466 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6467 if(!exp->expType)
6468 {
6469 exp->expType = op1->type;
6470 if(op1->type)
6471 op1->type->refCount++;
6472 }
6473 return 0x1;
6474 }
6475
6476 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6477 {
6478 long long value2 = op2->__anon1.i64;
6479
6480 exp->type = 2;
6481 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6482 if(!exp->expType)
6483 {
6484 exp->expType = op1->type;
6485 if(op1->type)
6486 op1->type->refCount++;
6487 }
6488 return 0x1;
6489 }
6490
6491 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6492 {
6493 uint64 value2 = op2->__anon1.ui64;
6494
6495 exp->type = 2;
6496 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6497 if(!exp->expType)
6498 {
6499 exp->expType = op1->type;
6500 if(op1->type)
6501 op1->type->refCount++;
6502 }
6503 return 0x1;
6504 }
6505
6506 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6507 {
6508 short value2 = op2->__anon1.s;
6509
6510 exp->type = 2;
6511 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6512 if(!exp->expType)
6513 {
6514 exp->expType = op1->type;
6515 if(op1->type)
6516 op1->type->refCount++;
6517 }
6518 return 0x1;
6519 }
6520
6521 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6522 {
6523 unsigned short value2 = op2->__anon1.us;
6524
6525 exp->type = 2;
6526 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6527 if(!exp->expType)
6528 {
6529 exp->expType = op1->type;
6530 if(op1->type)
6531 op1->type->refCount++;
6532 }
6533 return 0x1;
6534 }
6535
6536 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6537 {
6538 char value2 = op2->__anon1.c;
6539
6540 exp->type = 2;
6541 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6542 if(!exp->expType)
6543 {
6544 exp->expType = op1->type;
6545 if(op1->type)
6546 op1->type->refCount++;
6547 }
6548 return 0x1;
6549 }
6550
6551 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6552 {
6553 unsigned char value2 = op2->__anon1.uc;
6554
6555 exp->type = 2;
6556 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6557 if(!exp->expType)
6558 {
6559 exp->expType = op1->type;
6560 if(op1->type)
6561 op1->type->refCount++;
6562 }
6563 return 0x1;
6564 }
6565
6566 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6567 {
6568 float value2 = op2->__anon1.f;
6569
6570 exp->type = 2;
6571 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6572 if(!exp->expType)
6573 {
6574 exp->expType = op1->type;
6575 if(op1->type)
6576 op1->type->refCount++;
6577 }
6578 return 0x1;
6579 }
6580
6581 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6582 {
6583 double value2 = op2->__anon1.d;
6584
6585 exp->type = 2;
6586 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6587 if(!exp->expType)
6588 {
6589 exp->expType = op1->type;
6590 if(op1->type)
6591 op1->type->refCount++;
6592 }
6593 return 0x1;
6594 }
6595
6596 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6597 {
6598 int value2 = op2->__anon1.i;
6599
6600 exp->type = 2;
6601 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6602 if(!exp->expType)
6603 {
6604 exp->expType = op1->type;
6605 if(op1->type)
6606 op1->type->refCount++;
6607 }
6608 return 0x1;
6609 }
6610
6611 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6612 {
6613 unsigned int value2 = op2->__anon1.ui;
6614
6615 exp->type = 2;
6616 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6617 if(!exp->expType)
6618 {
6619 exp->expType = op1->type;
6620 if(op1->type)
6621 op1->type->refCount++;
6622 }
6623 return 0x1;
6624 }
6625
6626 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6627 {
6628 long long value2 = op2->__anon1.i64;
6629
6630 exp->type = 2;
6631 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6632 if(!exp->expType)
6633 {
6634 exp->expType = op1->type;
6635 if(op1->type)
6636 op1->type->refCount++;
6637 }
6638 return 0x1;
6639 }
6640
6641 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6642 {
6643 uint64 value2 = op2->__anon1.ui64;
6644
6645 exp->type = 2;
6646 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6647 if(!exp->expType)
6648 {
6649 exp->expType = op1->type;
6650 if(op1->type)
6651 op1->type->refCount++;
6652 }
6653 return 0x1;
6654 }
6655
6656 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6657 {
6658 short value2 = op2->__anon1.s;
6659
6660 exp->type = 2;
6661 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6662 if(!exp->expType)
6663 {
6664 exp->expType = op1->type;
6665 if(op1->type)
6666 op1->type->refCount++;
6667 }
6668 return 0x1;
6669 }
6670
6671 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6672 {
6673 unsigned short value2 = op2->__anon1.us;
6674
6675 exp->type = 2;
6676 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6677 if(!exp->expType)
6678 {
6679 exp->expType = op1->type;
6680 if(op1->type)
6681 op1->type->refCount++;
6682 }
6683 return 0x1;
6684 }
6685
6686 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6687 {
6688 char value2 = op2->__anon1.c;
6689
6690 exp->type = 2;
6691 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6692 if(!exp->expType)
6693 {
6694 exp->expType = op1->type;
6695 if(op1->type)
6696 op1->type->refCount++;
6697 }
6698 return 0x1;
6699 }
6700
6701 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6702 {
6703 unsigned char value2 = op2->__anon1.uc;
6704
6705 exp->type = 2;
6706 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6707 if(!exp->expType)
6708 {
6709 exp->expType = op1->type;
6710 if(op1->type)
6711 op1->type->refCount++;
6712 }
6713 return 0x1;
6714 }
6715
6716 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6717 {
6718 exp->type = 2;
6719 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6720 if(!exp->expType)
6721 {
6722 exp->expType = op1->type;
6723 if(op1->type)
6724 op1->type->refCount++;
6725 }
6726 return 0x1;
6727 }
6728
6729 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6730 {
6731 exp->type = 2;
6732 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6733 if(!exp->expType)
6734 {
6735 exp->expType = op1->type;
6736 if(op1->type)
6737 op1->type->refCount++;
6738 }
6739 return 0x1;
6740 }
6741
6742 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6743 {
6744 exp->type = 2;
6745 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6746 if(!exp->expType)
6747 {
6748 exp->expType = op1->type;
6749 if(op1->type)
6750 op1->type->refCount++;
6751 }
6752 return 0x1;
6753 }
6754
6755 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6756 {
6757 exp->type = 2;
6758 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6759 if(!exp->expType)
6760 {
6761 exp->expType = op1->type;
6762 if(op1->type)
6763 op1->type->refCount++;
6764 }
6765 return 0x1;
6766 }
6767
6768 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6769 {
6770 exp->type = 2;
6771 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6772 if(!exp->expType)
6773 {
6774 exp->expType = op1->type;
6775 if(op1->type)
6776 op1->type->refCount++;
6777 }
6778 return 0x1;
6779 }
6780
6781 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6782 {
6783 exp->type = 2;
6784 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 0x1;
6792 }
6793
6794 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6795 {
6796 exp->type = 2;
6797 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6798 if(!exp->expType)
6799 {
6800 exp->expType = op1->type;
6801 if(op1->type)
6802 op1->type->refCount++;
6803 }
6804 return 0x1;
6805 }
6806
6807 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6808 {
6809 exp->type = 2;
6810 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6811 if(!exp->expType)
6812 {
6813 exp->expType = op1->type;
6814 if(op1->type)
6815 op1->type->refCount++;
6816 }
6817 return 0x1;
6818 }
6819
6820 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6821 {
6822 exp->type = 2;
6823 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6824 if(!exp->expType)
6825 {
6826 exp->expType = op1->type;
6827 if(op1->type)
6828 op1->type->refCount++;
6829 }
6830 return 0x1;
6831 }
6832
6833 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6834 {
6835 exp->type = 2;
6836 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 0x1;
6844 }
6845
6846 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6847 {
6848 exp->type = 2;
6849 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6850 if(!exp->expType)
6851 {
6852 exp->expType = op1->type;
6853 if(op1->type)
6854 op1->type->refCount++;
6855 }
6856 return 0x1;
6857 }
6858
6859 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6860 {
6861 exp->type = 2;
6862 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6863 if(!exp->expType)
6864 {
6865 exp->expType = op1->type;
6866 if(op1->type)
6867 op1->type->refCount++;
6868 }
6869 return 0x1;
6870 }
6871
6872 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6873 {
6874 exp->type = 2;
6875 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 0x1;
6883 }
6884
6885 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6886 {
6887 exp->type = 2;
6888 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 0x1;
6896 }
6897
6898 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6899 {
6900 exp->type = 2;
6901 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 0x1;
6909 }
6910
6911 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6912 {
6913 exp->type = 2;
6914 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6915 if(!exp->expType)
6916 {
6917 exp->expType = op1->type;
6918 if(op1->type)
6919 op1->type->refCount++;
6920 }
6921 return 0x1;
6922 }
6923
6924 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6925 {
6926 exp->type = 2;
6927 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6928 if(!exp->expType)
6929 {
6930 exp->expType = op1->type;
6931 if(op1->type)
6932 op1->type->refCount++;
6933 }
6934 return 0x1;
6935 }
6936
6937 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6938 {
6939 exp->type = 2;
6940 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6941 if(!exp->expType)
6942 {
6943 exp->expType = op1->type;
6944 if(op1->type)
6945 op1->type->refCount++;
6946 }
6947 return 0x1;
6948 }
6949
6950 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6951 {
6952 exp->type = 2;
6953 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6954 if(!exp->expType)
6955 {
6956 exp->expType = op1->type;
6957 if(op1->type)
6958 op1->type->refCount++;
6959 }
6960 return 0x1;
6961 }
6962
6963 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6964 {
6965 exp->type = 2;
6966 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6967 if(!exp->expType)
6968 {
6969 exp->expType = op1->type;
6970 if(op1->type)
6971 op1->type->refCount++;
6972 }
6973 return 0x1;
6974 }
6975
6976 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6977 {
6978 exp->type = 2;
6979 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6980 if(!exp->expType)
6981 {
6982 exp->expType = op1->type;
6983 if(op1->type)
6984 op1->type->refCount++;
6985 }
6986 return 0x1;
6987 }
6988
6989 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6990 {
6991 exp->type = 2;
6992 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6993 if(!exp->expType)
6994 {
6995 exp->expType = op1->type;
6996 if(op1->type)
6997 op1->type->refCount++;
6998 }
6999 return 0x1;
7000 }
7001
7002 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7003 {
7004 exp->type = 2;
7005 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7006 if(!exp->expType)
7007 {
7008 exp->expType = op1->type;
7009 if(op1->type)
7010 op1->type->refCount++;
7011 }
7012 return 0x1;
7013 }
7014
7015 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7016 {
7017 exp->type = 2;
7018 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7019 if(!exp->expType)
7020 {
7021 exp->expType = op1->type;
7022 if(op1->type)
7023 op1->type->refCount++;
7024 }
7025 return 0x1;
7026 }
7027
7028 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7029 {
7030 exp->type = 2;
7031 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 0x1;
7039 }
7040
7041 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7042 {
7043 exp->type = 2;
7044 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 0x1;
7052 }
7053
7054 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7055 {
7056 exp->type = 2;
7057 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7058 if(!exp->expType)
7059 {
7060 exp->expType = op1->type;
7061 if(op1->type)
7062 op1->type->refCount++;
7063 }
7064 return 0x1;
7065 }
7066
7067 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7068 {
7069 exp->type = 2;
7070 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 0x1;
7078 }
7079
7080 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7081 {
7082 exp->type = 2;
7083 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 0x1;
7091 }
7092
7093 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7094 {
7095 exp->type = 2;
7096 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 0x1;
7104 }
7105
7106 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7107 {
7108 int value2 = op2->__anon1.i;
7109
7110 exp->type = 2;
7111 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7112 if(!exp->expType)
7113 {
7114 exp->expType = op1->type;
7115 if(op1->type)
7116 op1->type->refCount++;
7117 }
7118 return 0x1;
7119 }
7120
7121 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7122 {
7123 unsigned int value2 = op2->__anon1.ui;
7124
7125 exp->type = 2;
7126 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7127 if(!exp->expType)
7128 {
7129 exp->expType = op1->type;
7130 if(op1->type)
7131 op1->type->refCount++;
7132 }
7133 return 0x1;
7134 }
7135
7136 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7137 {
7138 long long value2 = op2->__anon1.i64;
7139
7140 exp->type = 2;
7141 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7142 if(!exp->expType)
7143 {
7144 exp->expType = op1->type;
7145 if(op1->type)
7146 op1->type->refCount++;
7147 }
7148 return 0x1;
7149 }
7150
7151 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7152 {
7153 uint64 value2 = op2->__anon1.ui64;
7154
7155 exp->type = 2;
7156 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7157 if(!exp->expType)
7158 {
7159 exp->expType = op1->type;
7160 if(op1->type)
7161 op1->type->refCount++;
7162 }
7163 return 0x1;
7164 }
7165
7166 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7167 {
7168 short value2 = op2->__anon1.s;
7169
7170 exp->type = 2;
7171 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7172 if(!exp->expType)
7173 {
7174 exp->expType = op1->type;
7175 if(op1->type)
7176 op1->type->refCount++;
7177 }
7178 return 0x1;
7179 }
7180
7181 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7182 {
7183 unsigned short value2 = op2->__anon1.us;
7184
7185 exp->type = 2;
7186 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7187 if(!exp->expType)
7188 {
7189 exp->expType = op1->type;
7190 if(op1->type)
7191 op1->type->refCount++;
7192 }
7193 return 0x1;
7194 }
7195
7196 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7197 {
7198 char value2 = op2->__anon1.c;
7199
7200 exp->type = 2;
7201 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7202 if(!exp->expType)
7203 {
7204 exp->expType = op1->type;
7205 if(op1->type)
7206 op1->type->refCount++;
7207 }
7208 return 0x1;
7209 }
7210
7211 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7212 {
7213 unsigned char value2 = op2->__anon1.uc;
7214
7215 exp->type = 2;
7216 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7217 if(!exp->expType)
7218 {
7219 exp->expType = op1->type;
7220 if(op1->type)
7221 op1->type->refCount++;
7222 }
7223 return 0x1;
7224 }
7225
7226 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7227 {
7228 float value2 = op2->__anon1.f;
7229
7230 exp->type = 2;
7231 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7232 if(!exp->expType)
7233 {
7234 exp->expType = op1->type;
7235 if(op1->type)
7236 op1->type->refCount++;
7237 }
7238 return 0x1;
7239 }
7240
7241 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7242 {
7243 double value2 = op2->__anon1.d;
7244
7245 exp->type = 2;
7246 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7247 if(!exp->expType)
7248 {
7249 exp->expType = op1->type;
7250 if(op1->type)
7251 op1->type->refCount++;
7252 }
7253 return 0x1;
7254 }
7255
7256 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7257 {
7258 int value2 = op2->__anon1.i;
7259
7260 exp->type = 2;
7261 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7262 if(!exp->expType)
7263 {
7264 exp->expType = op1->type;
7265 if(op1->type)
7266 op1->type->refCount++;
7267 }
7268 return 0x1;
7269 }
7270
7271 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7272 {
7273 unsigned int value2 = op2->__anon1.ui;
7274
7275 exp->type = 2;
7276 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7277 if(!exp->expType)
7278 {
7279 exp->expType = op1->type;
7280 if(op1->type)
7281 op1->type->refCount++;
7282 }
7283 return 0x1;
7284 }
7285
7286 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7287 {
7288 long long value2 = op2->__anon1.i64;
7289
7290 exp->type = 2;
7291 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7292 if(!exp->expType)
7293 {
7294 exp->expType = op1->type;
7295 if(op1->type)
7296 op1->type->refCount++;
7297 }
7298 return 0x1;
7299 }
7300
7301 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7302 {
7303 uint64 value2 = op2->__anon1.ui64;
7304
7305 exp->type = 2;
7306 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7307 if(!exp->expType)
7308 {
7309 exp->expType = op1->type;
7310 if(op1->type)
7311 op1->type->refCount++;
7312 }
7313 return 0x1;
7314 }
7315
7316 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7317 {
7318 short value2 = op2->__anon1.s;
7319
7320 exp->type = 2;
7321 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7322 if(!exp->expType)
7323 {
7324 exp->expType = op1->type;
7325 if(op1->type)
7326 op1->type->refCount++;
7327 }
7328 return 0x1;
7329 }
7330
7331 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7332 {
7333 unsigned short value2 = op2->__anon1.us;
7334
7335 exp->type = 2;
7336 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7337 if(!exp->expType)
7338 {
7339 exp->expType = op1->type;
7340 if(op1->type)
7341 op1->type->refCount++;
7342 }
7343 return 0x1;
7344 }
7345
7346 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7347 {
7348 char value2 = op2->__anon1.c;
7349
7350 exp->type = 2;
7351 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7352 if(!exp->expType)
7353 {
7354 exp->expType = op1->type;
7355 if(op1->type)
7356 op1->type->refCount++;
7357 }
7358 return 0x1;
7359 }
7360
7361 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7362 {
7363 unsigned char value2 = op2->__anon1.uc;
7364
7365 exp->type = 2;
7366 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7367 if(!exp->expType)
7368 {
7369 exp->expType = op1->type;
7370 if(op1->type)
7371 op1->type->refCount++;
7372 }
7373 return 0x1;
7374 }
7375
7376 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7377 {
7378 float value2 = op2->__anon1.f;
7379
7380 exp->type = 2;
7381 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7382 if(!exp->expType)
7383 {
7384 exp->expType = op1->type;
7385 if(op1->type)
7386 op1->type->refCount++;
7387 }
7388 return 0x1;
7389 }
7390
7391 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7392 {
7393 double value2 = op2->__anon1.d;
7394
7395 exp->type = 2;
7396 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7397 if(!exp->expType)
7398 {
7399 exp->expType = op1->type;
7400 if(op1->type)
7401 op1->type->refCount++;
7402 }
7403 return 0x1;
7404 }
7405
7406 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7407 {
7408 int value2 = op2->__anon1.i;
7409
7410 exp->type = 2;
7411 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7412 if(!exp->expType)
7413 {
7414 exp->expType = op1->type;
7415 if(op1->type)
7416 op1->type->refCount++;
7417 }
7418 return 0x1;
7419 }
7420
7421 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7422 {
7423 unsigned int value2 = op2->__anon1.ui;
7424
7425 exp->type = 2;
7426 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7427 if(!exp->expType)
7428 {
7429 exp->expType = op1->type;
7430 if(op1->type)
7431 op1->type->refCount++;
7432 }
7433 return 0x1;
7434 }
7435
7436 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7437 {
7438 long long value2 = op2->__anon1.i64;
7439
7440 exp->type = 2;
7441 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7442 if(!exp->expType)
7443 {
7444 exp->expType = op1->type;
7445 if(op1->type)
7446 op1->type->refCount++;
7447 }
7448 return 0x1;
7449 }
7450
7451 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7452 {
7453 uint64 value2 = op2->__anon1.ui64;
7454
7455 exp->type = 2;
7456 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7457 if(!exp->expType)
7458 {
7459 exp->expType = op1->type;
7460 if(op1->type)
7461 op1->type->refCount++;
7462 }
7463 return 0x1;
7464 }
7465
7466 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7467 {
7468 short value2 = op2->__anon1.s;
7469
7470 exp->type = 2;
7471 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7472 if(!exp->expType)
7473 {
7474 exp->expType = op1->type;
7475 if(op1->type)
7476 op1->type->refCount++;
7477 }
7478 return 0x1;
7479 }
7480
7481 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7482 {
7483 unsigned short value2 = op2->__anon1.us;
7484
7485 exp->type = 2;
7486 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7487 if(!exp->expType)
7488 {
7489 exp->expType = op1->type;
7490 if(op1->type)
7491 op1->type->refCount++;
7492 }
7493 return 0x1;
7494 }
7495
7496 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7497 {
7498 char value2 = op2->__anon1.c;
7499
7500 exp->type = 2;
7501 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7502 if(!exp->expType)
7503 {
7504 exp->expType = op1->type;
7505 if(op1->type)
7506 op1->type->refCount++;
7507 }
7508 return 0x1;
7509 }
7510
7511 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7512 {
7513 unsigned char value2 = op2->__anon1.uc;
7514
7515 exp->type = 2;
7516 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7517 if(!exp->expType)
7518 {
7519 exp->expType = op1->type;
7520 if(op1->type)
7521 op1->type->refCount++;
7522 }
7523 return 0x1;
7524 }
7525
7526 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7527 {
7528 float value2 = op2->__anon1.f;
7529
7530 exp->type = 2;
7531 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7532 if(!exp->expType)
7533 {
7534 exp->expType = op1->type;
7535 if(op1->type)
7536 op1->type->refCount++;
7537 }
7538 return 0x1;
7539 }
7540
7541 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7542 {
7543 double value2 = op2->__anon1.d;
7544
7545 exp->type = 2;
7546 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7547 if(!exp->expType)
7548 {
7549 exp->expType = op1->type;
7550 if(op1->type)
7551 op1->type->refCount++;
7552 }
7553 return 0x1;
7554 }
7555
7556 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7557 {
7558 int value2 = op2->__anon1.i;
7559
7560 exp->type = 2;
7561 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7562 if(!exp->expType)
7563 {
7564 exp->expType = op1->type;
7565 if(op1->type)
7566 op1->type->refCount++;
7567 }
7568 return 0x1;
7569 }
7570
7571 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7572 {
7573 unsigned int value2 = op2->__anon1.ui;
7574
7575 exp->type = 2;
7576 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7577 if(!exp->expType)
7578 {
7579 exp->expType = op1->type;
7580 if(op1->type)
7581 op1->type->refCount++;
7582 }
7583 return 0x1;
7584 }
7585
7586 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7587 {
7588 long long value2 = op2->__anon1.i64;
7589
7590 exp->type = 2;
7591 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7592 if(!exp->expType)
7593 {
7594 exp->expType = op1->type;
7595 if(op1->type)
7596 op1->type->refCount++;
7597 }
7598 return 0x1;
7599 }
7600
7601 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7602 {
7603 uint64 value2 = op2->__anon1.ui64;
7604
7605 exp->type = 2;
7606 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7607 if(!exp->expType)
7608 {
7609 exp->expType = op1->type;
7610 if(op1->type)
7611 op1->type->refCount++;
7612 }
7613 return 0x1;
7614 }
7615
7616 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7617 {
7618 short value2 = op2->__anon1.s;
7619
7620 exp->type = 2;
7621 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7622 if(!exp->expType)
7623 {
7624 exp->expType = op1->type;
7625 if(op1->type)
7626 op1->type->refCount++;
7627 }
7628 return 0x1;
7629 }
7630
7631 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7632 {
7633 unsigned short value2 = op2->__anon1.us;
7634
7635 exp->type = 2;
7636 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7637 if(!exp->expType)
7638 {
7639 exp->expType = op1->type;
7640 if(op1->type)
7641 op1->type->refCount++;
7642 }
7643 return 0x1;
7644 }
7645
7646 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7647 {
7648 char value2 = op2->__anon1.c;
7649
7650 exp->type = 2;
7651 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7652 if(!exp->expType)
7653 {
7654 exp->expType = op1->type;
7655 if(op1->type)
7656 op1->type->refCount++;
7657 }
7658 return 0x1;
7659 }
7660
7661 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7662 {
7663 unsigned char value2 = op2->__anon1.uc;
7664
7665 exp->type = 2;
7666 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7667 if(!exp->expType)
7668 {
7669 exp->expType = op1->type;
7670 if(op1->type)
7671 op1->type->refCount++;
7672 }
7673 return 0x1;
7674 }
7675
7676 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7677 {
7678 float value2 = op2->__anon1.f;
7679
7680 exp->type = 2;
7681 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7682 if(!exp->expType)
7683 {
7684 exp->expType = op1->type;
7685 if(op1->type)
7686 op1->type->refCount++;
7687 }
7688 return 0x1;
7689 }
7690
7691 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7692 {
7693 double value2 = op2->__anon1.d;
7694
7695 exp->type = 2;
7696 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7697 if(!exp->expType)
7698 {
7699 exp->expType = op1->type;
7700 if(op1->type)
7701 op1->type->refCount++;
7702 }
7703 return 0x1;
7704 }
7705
7706 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7707 {
7708 int value2 = op2->__anon1.i;
7709
7710 exp->type = 2;
7711 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7712 if(!exp->expType)
7713 {
7714 exp->expType = op1->type;
7715 if(op1->type)
7716 op1->type->refCount++;
7717 }
7718 return 0x1;
7719 }
7720
7721 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 {
7723 unsigned int value2 = op2->__anon1.ui;
7724
7725 exp->type = 2;
7726 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7727 if(!exp->expType)
7728 {
7729 exp->expType = op1->type;
7730 if(op1->type)
7731 op1->type->refCount++;
7732 }
7733 return 0x1;
7734 }
7735
7736 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 {
7738 long long value2 = op2->__anon1.i64;
7739
7740 exp->type = 2;
7741 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7742 if(!exp->expType)
7743 {
7744 exp->expType = op1->type;
7745 if(op1->type)
7746 op1->type->refCount++;
7747 }
7748 return 0x1;
7749 }
7750
7751 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 {
7753 uint64 value2 = op2->__anon1.ui64;
7754
7755 exp->type = 2;
7756 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7757 if(!exp->expType)
7758 {
7759 exp->expType = op1->type;
7760 if(op1->type)
7761 op1->type->refCount++;
7762 }
7763 return 0x1;
7764 }
7765
7766 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 {
7768 short value2 = op2->__anon1.s;
7769
7770 exp->type = 2;
7771 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7772 if(!exp->expType)
7773 {
7774 exp->expType = op1->type;
7775 if(op1->type)
7776 op1->type->refCount++;
7777 }
7778 return 0x1;
7779 }
7780
7781 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 {
7783 unsigned short value2 = op2->__anon1.us;
7784
7785 exp->type = 2;
7786 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7787 if(!exp->expType)
7788 {
7789 exp->expType = op1->type;
7790 if(op1->type)
7791 op1->type->refCount++;
7792 }
7793 return 0x1;
7794 }
7795
7796 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 {
7798 char value2 = op2->__anon1.c;
7799
7800 exp->type = 2;
7801 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7802 if(!exp->expType)
7803 {
7804 exp->expType = op1->type;
7805 if(op1->type)
7806 op1->type->refCount++;
7807 }
7808 return 0x1;
7809 }
7810
7811 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 {
7813 unsigned char value2 = op2->__anon1.uc;
7814
7815 exp->type = 2;
7816 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7817 if(!exp->expType)
7818 {
7819 exp->expType = op1->type;
7820 if(op1->type)
7821 op1->type->refCount++;
7822 }
7823 return 0x1;
7824 }
7825
7826 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 {
7828 float value2 = op2->__anon1.f;
7829
7830 exp->type = 2;
7831 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7832 if(!exp->expType)
7833 {
7834 exp->expType = op1->type;
7835 if(op1->type)
7836 op1->type->refCount++;
7837 }
7838 return 0x1;
7839 }
7840
7841 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 {
7843 double value2 = op2->__anon1.d;
7844
7845 exp->type = 2;
7846 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7847 if(!exp->expType)
7848 {
7849 exp->expType = op1->type;
7850 if(op1->type)
7851 op1->type->refCount++;
7852 }
7853 return 0x1;
7854 }
7855
7856 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 {
7858 int value2 = op2->__anon1.i;
7859
7860 exp->type = 2;
7861 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7862 if(!exp->expType)
7863 {
7864 exp->expType = op1->type;
7865 if(op1->type)
7866 op1->type->refCount++;
7867 }
7868 return 0x1;
7869 }
7870
7871 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 {
7873 unsigned int value2 = op2->__anon1.ui;
7874
7875 exp->type = 2;
7876 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7877 if(!exp->expType)
7878 {
7879 exp->expType = op1->type;
7880 if(op1->type)
7881 op1->type->refCount++;
7882 }
7883 return 0x1;
7884 }
7885
7886 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 {
7888 long long value2 = op2->__anon1.i64;
7889
7890 exp->type = 2;
7891 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7892 if(!exp->expType)
7893 {
7894 exp->expType = op1->type;
7895 if(op1->type)
7896 op1->type->refCount++;
7897 }
7898 return 0x1;
7899 }
7900
7901 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 {
7903 uint64 value2 = op2->__anon1.ui64;
7904
7905 exp->type = 2;
7906 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7907 if(!exp->expType)
7908 {
7909 exp->expType = op1->type;
7910 if(op1->type)
7911 op1->type->refCount++;
7912 }
7913 return 0x1;
7914 }
7915
7916 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 {
7918 short value2 = op2->__anon1.s;
7919
7920 exp->type = 2;
7921 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7922 if(!exp->expType)
7923 {
7924 exp->expType = op1->type;
7925 if(op1->type)
7926 op1->type->refCount++;
7927 }
7928 return 0x1;
7929 }
7930
7931 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 {
7933 unsigned short value2 = op2->__anon1.us;
7934
7935 exp->type = 2;
7936 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7937 if(!exp->expType)
7938 {
7939 exp->expType = op1->type;
7940 if(op1->type)
7941 op1->type->refCount++;
7942 }
7943 return 0x1;
7944 }
7945
7946 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 {
7948 char value2 = op2->__anon1.c;
7949
7950 exp->type = 2;
7951 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7952 if(!exp->expType)
7953 {
7954 exp->expType = op1->type;
7955 if(op1->type)
7956 op1->type->refCount++;
7957 }
7958 return 0x1;
7959 }
7960
7961 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 {
7963 unsigned char value2 = op2->__anon1.uc;
7964
7965 exp->type = 2;
7966 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7967 if(!exp->expType)
7968 {
7969 exp->expType = op1->type;
7970 if(op1->type)
7971 op1->type->refCount++;
7972 }
7973 return 0x1;
7974 }
7975
7976 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 {
7978 int value2 = op2->__anon1.i;
7979
7980 exp->type = 2;
7981 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7982 if(!exp->expType)
7983 {
7984 exp->expType = op1->type;
7985 if(op1->type)
7986 op1->type->refCount++;
7987 }
7988 return 0x1;
7989 }
7990
7991 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 {
7993 unsigned int value2 = op2->__anon1.ui;
7994
7995 exp->type = 2;
7996 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
7997 if(!exp->expType)
7998 {
7999 exp->expType = op1->type;
8000 if(op1->type)
8001 op1->type->refCount++;
8002 }
8003 return 0x1;
8004 }
8005
8006 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 {
8008 long long value2 = op2->__anon1.i64;
8009
8010 exp->type = 2;
8011 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8012 if(!exp->expType)
8013 {
8014 exp->expType = op1->type;
8015 if(op1->type)
8016 op1->type->refCount++;
8017 }
8018 return 0x1;
8019 }
8020
8021 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 {
8023 uint64 value2 = op2->__anon1.ui64;
8024
8025 exp->type = 2;
8026 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8027 if(!exp->expType)
8028 {
8029 exp->expType = op1->type;
8030 if(op1->type)
8031 op1->type->refCount++;
8032 }
8033 return 0x1;
8034 }
8035
8036 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8037 {
8038 short value2 = op2->__anon1.s;
8039
8040 exp->type = 2;
8041 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8042 if(!exp->expType)
8043 {
8044 exp->expType = op1->type;
8045 if(op1->type)
8046 op1->type->refCount++;
8047 }
8048 return 0x1;
8049 }
8050
8051 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8052 {
8053 unsigned short value2 = op2->__anon1.us;
8054
8055 exp->type = 2;
8056 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8057 if(!exp->expType)
8058 {
8059 exp->expType = op1->type;
8060 if(op1->type)
8061 op1->type->refCount++;
8062 }
8063 return 0x1;
8064 }
8065
8066 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8067 {
8068 char value2 = op2->__anon1.c;
8069
8070 exp->type = 2;
8071 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8072 if(!exp->expType)
8073 {
8074 exp->expType = op1->type;
8075 if(op1->type)
8076 op1->type->refCount++;
8077 }
8078 return 0x1;
8079 }
8080
8081 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8082 {
8083 unsigned char value2 = op2->__anon1.uc;
8084
8085 exp->type = 2;
8086 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8087 if(!exp->expType)
8088 {
8089 exp->expType = op1->type;
8090 if(op1->type)
8091 op1->type->refCount++;
8092 }
8093 return 0x1;
8094 }
8095
8096 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8097 {
8098 int value2 = op2->__anon1.i;
8099
8100 exp->type = 2;
8101 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8102 if(!exp->expType)
8103 {
8104 exp->expType = op1->type;
8105 if(op1->type)
8106 op1->type->refCount++;
8107 }
8108 return 0x1;
8109 }
8110
8111 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8112 {
8113 unsigned int value2 = op2->__anon1.ui;
8114
8115 exp->type = 2;
8116 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8117 if(!exp->expType)
8118 {
8119 exp->expType = op1->type;
8120 if(op1->type)
8121 op1->type->refCount++;
8122 }
8123 return 0x1;
8124 }
8125
8126 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8127 {
8128 long long value2 = op2->__anon1.i64;
8129
8130 exp->type = 2;
8131 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8132 if(!exp->expType)
8133 {
8134 exp->expType = op1->type;
8135 if(op1->type)
8136 op1->type->refCount++;
8137 }
8138 return 0x1;
8139 }
8140
8141 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8142 {
8143 uint64 value2 = op2->__anon1.ui64;
8144
8145 exp->type = 2;
8146 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8147 if(!exp->expType)
8148 {
8149 exp->expType = op1->type;
8150 if(op1->type)
8151 op1->type->refCount++;
8152 }
8153 return 0x1;
8154 }
8155
8156 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8157 {
8158 short value2 = op2->__anon1.s;
8159
8160 exp->type = 2;
8161 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8162 if(!exp->expType)
8163 {
8164 exp->expType = op1->type;
8165 if(op1->type)
8166 op1->type->refCount++;
8167 }
8168 return 0x1;
8169 }
8170
8171 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8172 {
8173 unsigned short value2 = op2->__anon1.us;
8174
8175 exp->type = 2;
8176 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8177 if(!exp->expType)
8178 {
8179 exp->expType = op1->type;
8180 if(op1->type)
8181 op1->type->refCount++;
8182 }
8183 return 0x1;
8184 }
8185
8186 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8187 {
8188 char value2 = op2->__anon1.c;
8189
8190 exp->type = 2;
8191 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8192 if(!exp->expType)
8193 {
8194 exp->expType = op1->type;
8195 if(op1->type)
8196 op1->type->refCount++;
8197 }
8198 return 0x1;
8199 }
8200
8201 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8202 {
8203 unsigned char value2 = op2->__anon1.uc;
8204
8205 exp->type = 2;
8206 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8207 if(!exp->expType)
8208 {
8209 exp->expType = op1->type;
8210 if(op1->type)
8211 op1->type->refCount++;
8212 }
8213 return 0x1;
8214 }
8215
8216 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8217 {
8218 int value2 = op2->__anon1.i;
8219
8220 exp->type = 2;
8221 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8222 if(!exp->expType)
8223 {
8224 exp->expType = op1->type;
8225 if(op1->type)
8226 op1->type->refCount++;
8227 }
8228 return 0x1;
8229 }
8230
8231 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8232 {
8233 unsigned int value2 = op2->__anon1.ui;
8234
8235 exp->type = 2;
8236 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8237 if(!exp->expType)
8238 {
8239 exp->expType = op1->type;
8240 if(op1->type)
8241 op1->type->refCount++;
8242 }
8243 return 0x1;
8244 }
8245
8246 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8247 {
8248 long long value2 = op2->__anon1.i64;
8249
8250 exp->type = 2;
8251 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8252 if(!exp->expType)
8253 {
8254 exp->expType = op1->type;
8255 if(op1->type)
8256 op1->type->refCount++;
8257 }
8258 return 0x1;
8259 }
8260
8261 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8262 {
8263 uint64 value2 = op2->__anon1.ui64;
8264
8265 exp->type = 2;
8266 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8267 if(!exp->expType)
8268 {
8269 exp->expType = op1->type;
8270 if(op1->type)
8271 op1->type->refCount++;
8272 }
8273 return 0x1;
8274 }
8275
8276 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8277 {
8278 short value2 = op2->__anon1.s;
8279
8280 exp->type = 2;
8281 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8282 if(!exp->expType)
8283 {
8284 exp->expType = op1->type;
8285 if(op1->type)
8286 op1->type->refCount++;
8287 }
8288 return 0x1;
8289 }
8290
8291 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8292 {
8293 unsigned short value2 = op2->__anon1.us;
8294
8295 exp->type = 2;
8296 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8297 if(!exp->expType)
8298 {
8299 exp->expType = op1->type;
8300 if(op1->type)
8301 op1->type->refCount++;
8302 }
8303 return 0x1;
8304 }
8305
8306 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8307 {
8308 char value2 = op2->__anon1.c;
8309
8310 exp->type = 2;
8311 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8312 if(!exp->expType)
8313 {
8314 exp->expType = op1->type;
8315 if(op1->type)
8316 op1->type->refCount++;
8317 }
8318 return 0x1;
8319 }
8320
8321 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8322 {
8323 unsigned char value2 = op2->__anon1.uc;
8324
8325 exp->type = 2;
8326 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8327 if(!exp->expType)
8328 {
8329 exp->expType = op1->type;
8330 if(op1->type)
8331 op1->type->refCount++;
8332 }
8333 return 0x1;
8334 }
8335
8336 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8337 {
8338 int value2 = op2->__anon1.i;
8339
8340 exp->type = 2;
8341 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8342 if(!exp->expType)
8343 {
8344 exp->expType = op1->type;
8345 if(op1->type)
8346 op1->type->refCount++;
8347 }
8348 return 0x1;
8349 }
8350
8351 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8352 {
8353 unsigned int value2 = op2->__anon1.ui;
8354
8355 exp->type = 2;
8356 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8357 if(!exp->expType)
8358 {
8359 exp->expType = op1->type;
8360 if(op1->type)
8361 op1->type->refCount++;
8362 }
8363 return 0x1;
8364 }
8365
8366 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8367 {
8368 long long value2 = op2->__anon1.i64;
8369
8370 exp->type = 2;
8371 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8372 if(!exp->expType)
8373 {
8374 exp->expType = op1->type;
8375 if(op1->type)
8376 op1->type->refCount++;
8377 }
8378 return 0x1;
8379 }
8380
8381 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8382 {
8383 uint64 value2 = op2->__anon1.ui64;
8384
8385 exp->type = 2;
8386 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8387 if(!exp->expType)
8388 {
8389 exp->expType = op1->type;
8390 if(op1->type)
8391 op1->type->refCount++;
8392 }
8393 return 0x1;
8394 }
8395
8396 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8397 {
8398 short value2 = op2->__anon1.s;
8399
8400 exp->type = 2;
8401 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8402 if(!exp->expType)
8403 {
8404 exp->expType = op1->type;
8405 if(op1->type)
8406 op1->type->refCount++;
8407 }
8408 return 0x1;
8409 }
8410
8411 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8412 {
8413 unsigned short value2 = op2->__anon1.us;
8414
8415 exp->type = 2;
8416 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8417 if(!exp->expType)
8418 {
8419 exp->expType = op1->type;
8420 if(op1->type)
8421 op1->type->refCount++;
8422 }
8423 return 0x1;
8424 }
8425
8426 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8427 {
8428 char value2 = op2->__anon1.c;
8429
8430 exp->type = 2;
8431 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8432 if(!exp->expType)
8433 {
8434 exp->expType = op1->type;
8435 if(op1->type)
8436 op1->type->refCount++;
8437 }
8438 return 0x1;
8439 }
8440
8441 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8442 {
8443 unsigned char value2 = op2->__anon1.uc;
8444
8445 exp->type = 2;
8446 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8447 if(!exp->expType)
8448 {
8449 exp->expType = op1->type;
8450 if(op1->type)
8451 op1->type->refCount++;
8452 }
8453 return 0x1;
8454 }
8455
8456 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8457 {
8458 int value2 = op2->__anon1.i;
8459
8460 exp->type = 2;
8461 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8462 if(!exp->expType)
8463 {
8464 exp->expType = op1->type;
8465 if(op1->type)
8466 op1->type->refCount++;
8467 }
8468 return 0x1;
8469 }
8470
8471 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8472 {
8473 unsigned int value2 = op2->__anon1.ui;
8474
8475 exp->type = 2;
8476 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8477 if(!exp->expType)
8478 {
8479 exp->expType = op1->type;
8480 if(op1->type)
8481 op1->type->refCount++;
8482 }
8483 return 0x1;
8484 }
8485
8486 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8487 {
8488 long long value2 = op2->__anon1.i64;
8489
8490 exp->type = 2;
8491 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8492 if(!exp->expType)
8493 {
8494 exp->expType = op1->type;
8495 if(op1->type)
8496 op1->type->refCount++;
8497 }
8498 return 0x1;
8499 }
8500
8501 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8502 {
8503 uint64 value2 = op2->__anon1.ui64;
8504
8505 exp->type = 2;
8506 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8507 if(!exp->expType)
8508 {
8509 exp->expType = op1->type;
8510 if(op1->type)
8511 op1->type->refCount++;
8512 }
8513 return 0x1;
8514 }
8515
8516 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8517 {
8518 short value2 = op2->__anon1.s;
8519
8520 exp->type = 2;
8521 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8522 if(!exp->expType)
8523 {
8524 exp->expType = op1->type;
8525 if(op1->type)
8526 op1->type->refCount++;
8527 }
8528 return 0x1;
8529 }
8530
8531 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8532 {
8533 unsigned short value2 = op2->__anon1.us;
8534
8535 exp->type = 2;
8536 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8537 if(!exp->expType)
8538 {
8539 exp->expType = op1->type;
8540 if(op1->type)
8541 op1->type->refCount++;
8542 }
8543 return 0x1;
8544 }
8545
8546 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8547 {
8548 char value2 = op2->__anon1.c;
8549
8550 exp->type = 2;
8551 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8552 if(!exp->expType)
8553 {
8554 exp->expType = op1->type;
8555 if(op1->type)
8556 op1->type->refCount++;
8557 }
8558 return 0x1;
8559 }
8560
8561 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8562 {
8563 unsigned char value2 = op2->__anon1.uc;
8564
8565 exp->type = 2;
8566 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8567 if(!exp->expType)
8568 {
8569 exp->expType = op1->type;
8570 if(op1->type)
8571 op1->type->refCount++;
8572 }
8573 return 0x1;
8574 }
8575
8576 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8577 {
8578 exp->type = 2;
8579 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8580 if(!exp->expType)
8581 {
8582 exp->expType = op1->type;
8583 if(op1->type)
8584 op1->type->refCount++;
8585 }
8586 return 0x1;
8587 }
8588
8589 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8590 {
8591 exp->type = 2;
8592 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8593 if(!exp->expType)
8594 {
8595 exp->expType = op1->type;
8596 if(op1->type)
8597 op1->type->refCount++;
8598 }
8599 return 0x1;
8600 }
8601
8602 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8603 {
8604 exp->type = 2;
8605 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8606 if(!exp->expType)
8607 {
8608 exp->expType = op1->type;
8609 if(op1->type)
8610 op1->type->refCount++;
8611 }
8612 return 0x1;
8613 }
8614
8615 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8616 {
8617 exp->type = 2;
8618 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 0x1;
8626 }
8627
8628 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8629 {
8630 exp->type = 2;
8631 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8632 if(!exp->expType)
8633 {
8634 exp->expType = op1->type;
8635 if(op1->type)
8636 op1->type->refCount++;
8637 }
8638 return 0x1;
8639 }
8640
8641 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8642 {
8643 exp->type = 2;
8644 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 0x1;
8652 }
8653
8654 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8655 {
8656 exp->type = 2;
8657 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 0x1;
8665 }
8666
8667 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8668 {
8669 exp->type = 2;
8670 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8671 if(!exp->expType)
8672 {
8673 exp->expType = op1->type;
8674 if(op1->type)
8675 op1->type->refCount++;
8676 }
8677 return 0x1;
8678 }
8679
8680 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8681 {
8682 int value2 = op2->__anon1.i;
8683
8684 exp->type = 2;
8685 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8686 if(!exp->expType)
8687 {
8688 exp->expType = op1->type;
8689 if(op1->type)
8690 op1->type->refCount++;
8691 }
8692 return 0x1;
8693 }
8694
8695 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8696 {
8697 unsigned int value2 = op2->__anon1.ui;
8698
8699 exp->type = 2;
8700 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8701 if(!exp->expType)
8702 {
8703 exp->expType = op1->type;
8704 if(op1->type)
8705 op1->type->refCount++;
8706 }
8707 return 0x1;
8708 }
8709
8710 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8711 {
8712 long long value2 = op2->__anon1.i64;
8713
8714 exp->type = 2;
8715 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8716 if(!exp->expType)
8717 {
8718 exp->expType = op1->type;
8719 if(op1->type)
8720 op1->type->refCount++;
8721 }
8722 return 0x1;
8723 }
8724
8725 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8726 {
8727 uint64 value2 = op2->__anon1.ui64;
8728
8729 exp->type = 2;
8730 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8731 if(!exp->expType)
8732 {
8733 exp->expType = op1->type;
8734 if(op1->type)
8735 op1->type->refCount++;
8736 }
8737 return 0x1;
8738 }
8739
8740 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8741 {
8742 short value2 = op2->__anon1.s;
8743
8744 exp->type = 2;
8745 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8746 if(!exp->expType)
8747 {
8748 exp->expType = op1->type;
8749 if(op1->type)
8750 op1->type->refCount++;
8751 }
8752 return 0x1;
8753 }
8754
8755 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8756 {
8757 unsigned short value2 = op2->__anon1.us;
8758
8759 exp->type = 2;
8760 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8761 if(!exp->expType)
8762 {
8763 exp->expType = op1->type;
8764 if(op1->type)
8765 op1->type->refCount++;
8766 }
8767 return 0x1;
8768 }
8769
8770 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8771 {
8772 char value2 = op2->__anon1.c;
8773
8774 exp->type = 2;
8775 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8776 if(!exp->expType)
8777 {
8778 exp->expType = op1->type;
8779 if(op1->type)
8780 op1->type->refCount++;
8781 }
8782 return 0x1;
8783 }
8784
8785 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8786 {
8787 unsigned char value2 = op2->__anon1.uc;
8788
8789 exp->type = 2;
8790 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8791 if(!exp->expType)
8792 {
8793 exp->expType = op1->type;
8794 if(op1->type)
8795 op1->type->refCount++;
8796 }
8797 return 0x1;
8798 }
8799
8800 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8801 {
8802 int value2 = op2->__anon1.i;
8803
8804 exp->type = 2;
8805 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8806 if(!exp->expType)
8807 {
8808 exp->expType = op1->type;
8809 if(op1->type)
8810 op1->type->refCount++;
8811 }
8812 return 0x1;
8813 }
8814
8815 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8816 {
8817 unsigned int value2 = op2->__anon1.ui;
8818
8819 exp->type = 2;
8820 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8821 if(!exp->expType)
8822 {
8823 exp->expType = op1->type;
8824 if(op1->type)
8825 op1->type->refCount++;
8826 }
8827 return 0x1;
8828 }
8829
8830 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8831 {
8832 long long value2 = op2->__anon1.i64;
8833
8834 exp->type = 2;
8835 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8836 if(!exp->expType)
8837 {
8838 exp->expType = op1->type;
8839 if(op1->type)
8840 op1->type->refCount++;
8841 }
8842 return 0x1;
8843 }
8844
8845 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8846 {
8847 uint64 value2 = op2->__anon1.ui64;
8848
8849 exp->type = 2;
8850 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8851 if(!exp->expType)
8852 {
8853 exp->expType = op1->type;
8854 if(op1->type)
8855 op1->type->refCount++;
8856 }
8857 return 0x1;
8858 }
8859
8860 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8861 {
8862 short value2 = op2->__anon1.s;
8863
8864 exp->type = 2;
8865 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8866 if(!exp->expType)
8867 {
8868 exp->expType = op1->type;
8869 if(op1->type)
8870 op1->type->refCount++;
8871 }
8872 return 0x1;
8873 }
8874
8875 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8876 {
8877 unsigned short value2 = op2->__anon1.us;
8878
8879 exp->type = 2;
8880 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8881 if(!exp->expType)
8882 {
8883 exp->expType = op1->type;
8884 if(op1->type)
8885 op1->type->refCount++;
8886 }
8887 return 0x1;
8888 }
8889
8890 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8891 {
8892 char value2 = op2->__anon1.c;
8893
8894 exp->type = 2;
8895 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8896 if(!exp->expType)
8897 {
8898 exp->expType = op1->type;
8899 if(op1->type)
8900 op1->type->refCount++;
8901 }
8902 return 0x1;
8903 }
8904
8905 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8906 {
8907 unsigned char value2 = op2->__anon1.uc;
8908
8909 exp->type = 2;
8910 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8911 if(!exp->expType)
8912 {
8913 exp->expType = op1->type;
8914 if(op1->type)
8915 op1->type->refCount++;
8916 }
8917 return 0x1;
8918 }
8919
8920 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8921 {
8922 int value2 = op2->__anon1.i;
8923
8924 exp->type = 2;
8925 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8926 if(!exp->expType)
8927 {
8928 exp->expType = op1->type;
8929 if(op1->type)
8930 op1->type->refCount++;
8931 }
8932 return 0x1;
8933 }
8934
8935 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8936 {
8937 unsigned int value2 = op2->__anon1.ui;
8938
8939 exp->type = 2;
8940 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8941 if(!exp->expType)
8942 {
8943 exp->expType = op1->type;
8944 if(op1->type)
8945 op1->type->refCount++;
8946 }
8947 return 0x1;
8948 }
8949
8950 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8951 {
8952 long long value2 = op2->__anon1.i64;
8953
8954 exp->type = 2;
8955 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8956 if(!exp->expType)
8957 {
8958 exp->expType = op1->type;
8959 if(op1->type)
8960 op1->type->refCount++;
8961 }
8962 return 0x1;
8963 }
8964
8965 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8966 {
8967 uint64 value2 = op2->__anon1.ui64;
8968
8969 exp->type = 2;
8970 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8971 if(!exp->expType)
8972 {
8973 exp->expType = op1->type;
8974 if(op1->type)
8975 op1->type->refCount++;
8976 }
8977 return 0x1;
8978 }
8979
8980 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8981 {
8982 short value2 = op2->__anon1.s;
8983
8984 exp->type = 2;
8985 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8986 if(!exp->expType)
8987 {
8988 exp->expType = op1->type;
8989 if(op1->type)
8990 op1->type->refCount++;
8991 }
8992 return 0x1;
8993 }
8994
8995 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8996 {
8997 unsigned short value2 = op2->__anon1.us;
8998
8999 exp->type = 2;
9000 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9001 if(!exp->expType)
9002 {
9003 exp->expType = op1->type;
9004 if(op1->type)
9005 op1->type->refCount++;
9006 }
9007 return 0x1;
9008 }
9009
9010 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9011 {
9012 char value2 = op2->__anon1.c;
9013
9014 exp->type = 2;
9015 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9016 if(!exp->expType)
9017 {
9018 exp->expType = op1->type;
9019 if(op1->type)
9020 op1->type->refCount++;
9021 }
9022 return 0x1;
9023 }
9024
9025 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9026 {
9027 unsigned char value2 = op2->__anon1.uc;
9028
9029 exp->type = 2;
9030 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9031 if(!exp->expType)
9032 {
9033 exp->expType = op1->type;
9034 if(op1->type)
9035 op1->type->refCount++;
9036 }
9037 return 0x1;
9038 }
9039
9040 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9041 {
9042 int value2 = op2->__anon1.i;
9043
9044 exp->type = 2;
9045 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9046 if(!exp->expType)
9047 {
9048 exp->expType = op1->type;
9049 if(op1->type)
9050 op1->type->refCount++;
9051 }
9052 return 0x1;
9053 }
9054
9055 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9056 {
9057 unsigned int value2 = op2->__anon1.ui;
9058
9059 exp->type = 2;
9060 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9061 if(!exp->expType)
9062 {
9063 exp->expType = op1->type;
9064 if(op1->type)
9065 op1->type->refCount++;
9066 }
9067 return 0x1;
9068 }
9069
9070 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9071 {
9072 long long value2 = op2->__anon1.i64;
9073
9074 exp->type = 2;
9075 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9076 if(!exp->expType)
9077 {
9078 exp->expType = op1->type;
9079 if(op1->type)
9080 op1->type->refCount++;
9081 }
9082 return 0x1;
9083 }
9084
9085 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9086 {
9087 uint64 value2 = op2->__anon1.ui64;
9088
9089 exp->type = 2;
9090 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9091 if(!exp->expType)
9092 {
9093 exp->expType = op1->type;
9094 if(op1->type)
9095 op1->type->refCount++;
9096 }
9097 return 0x1;
9098 }
9099
9100 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9101 {
9102 short value2 = op2->__anon1.s;
9103
9104 exp->type = 2;
9105 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9106 if(!exp->expType)
9107 {
9108 exp->expType = op1->type;
9109 if(op1->type)
9110 op1->type->refCount++;
9111 }
9112 return 0x1;
9113 }
9114
9115 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9116 {
9117 unsigned short value2 = op2->__anon1.us;
9118
9119 exp->type = 2;
9120 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9121 if(!exp->expType)
9122 {
9123 exp->expType = op1->type;
9124 if(op1->type)
9125 op1->type->refCount++;
9126 }
9127 return 0x1;
9128 }
9129
9130 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9131 {
9132 char value2 = op2->__anon1.c;
9133
9134 exp->type = 2;
9135 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9136 if(!exp->expType)
9137 {
9138 exp->expType = op1->type;
9139 if(op1->type)
9140 op1->type->refCount++;
9141 }
9142 return 0x1;
9143 }
9144
9145 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9146 {
9147 unsigned char value2 = op2->__anon1.uc;
9148
9149 exp->type = 2;
9150 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9151 if(!exp->expType)
9152 {
9153 exp->expType = op1->type;
9154 if(op1->type)
9155 op1->type->refCount++;
9156 }
9157 return 0x1;
9158 }
9159
9160 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9161 {
9162 int value2 = op2->__anon1.i;
9163
9164 exp->type = 2;
9165 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9166 if(!exp->expType)
9167 {
9168 exp->expType = op1->type;
9169 if(op1->type)
9170 op1->type->refCount++;
9171 }
9172 return 0x1;
9173 }
9174
9175 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9176 {
9177 unsigned int value2 = op2->__anon1.ui;
9178
9179 exp->type = 2;
9180 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9181 if(!exp->expType)
9182 {
9183 exp->expType = op1->type;
9184 if(op1->type)
9185 op1->type->refCount++;
9186 }
9187 return 0x1;
9188 }
9189
9190 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9191 {
9192 long long value2 = op2->__anon1.i64;
9193
9194 exp->type = 2;
9195 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9196 if(!exp->expType)
9197 {
9198 exp->expType = op1->type;
9199 if(op1->type)
9200 op1->type->refCount++;
9201 }
9202 return 0x1;
9203 }
9204
9205 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9206 {
9207 uint64 value2 = op2->__anon1.ui64;
9208
9209 exp->type = 2;
9210 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9211 if(!exp->expType)
9212 {
9213 exp->expType = op1->type;
9214 if(op1->type)
9215 op1->type->refCount++;
9216 }
9217 return 0x1;
9218 }
9219
9220 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9221 {
9222 short value2 = op2->__anon1.s;
9223
9224 exp->type = 2;
9225 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9226 if(!exp->expType)
9227 {
9228 exp->expType = op1->type;
9229 if(op1->type)
9230 op1->type->refCount++;
9231 }
9232 return 0x1;
9233 }
9234
9235 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9236 {
9237 unsigned short value2 = op2->__anon1.us;
9238
9239 exp->type = 2;
9240 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9241 if(!exp->expType)
9242 {
9243 exp->expType = op1->type;
9244 if(op1->type)
9245 op1->type->refCount++;
9246 }
9247 return 0x1;
9248 }
9249
9250 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9251 {
9252 char value2 = op2->__anon1.c;
9253
9254 exp->type = 2;
9255 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9256 if(!exp->expType)
9257 {
9258 exp->expType = op1->type;
9259 if(op1->type)
9260 op1->type->refCount++;
9261 }
9262 return 0x1;
9263 }
9264
9265 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9266 {
9267 unsigned char value2 = op2->__anon1.uc;
9268
9269 exp->type = 2;
9270 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9271 if(!exp->expType)
9272 {
9273 exp->expType = op1->type;
9274 if(op1->type)
9275 op1->type->refCount++;
9276 }
9277 return 0x1;
9278 }
9279
9280 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9281 {
9282 exp->type = 2;
9283 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9284 if(!exp->expType)
9285 {
9286 exp->expType = op1->type;
9287 if(op1->type)
9288 op1->type->refCount++;
9289 }
9290 return 0x1;
9291 }
9292
9293 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9294 {
9295 exp->type = 2;
9296 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9297 if(!exp->expType)
9298 {
9299 exp->expType = op1->type;
9300 if(op1->type)
9301 op1->type->refCount++;
9302 }
9303 return 0x1;
9304 }
9305
9306 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9307 {
9308 exp->type = 2;
9309 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9310 if(!exp->expType)
9311 {
9312 exp->expType = op1->type;
9313 if(op1->type)
9314 op1->type->refCount++;
9315 }
9316 return 0x1;
9317 }
9318
9319 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9320 {
9321 exp->type = 2;
9322 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9323 if(!exp->expType)
9324 {
9325 exp->expType = op1->type;
9326 if(op1->type)
9327 op1->type->refCount++;
9328 }
9329 return 0x1;
9330 }
9331
9332 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9333 {
9334 exp->type = 2;
9335 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9336 if(!exp->expType)
9337 {
9338 exp->expType = op1->type;
9339 if(op1->type)
9340 op1->type->refCount++;
9341 }
9342 return 0x1;
9343 }
9344
9345 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9346 {
9347 exp->type = 2;
9348 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9349 if(!exp->expType)
9350 {
9351 exp->expType = op1->type;
9352 if(op1->type)
9353 op1->type->refCount++;
9354 }
9355 return 0x1;
9356 }
9357
9358 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9359 {
9360 exp->type = 2;
9361 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9362 if(!exp->expType)
9363 {
9364 exp->expType = op1->type;
9365 if(op1->type)
9366 op1->type->refCount++;
9367 }
9368 return 0x1;
9369 }
9370
9371 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9372 {
9373 exp->type = 2;
9374 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9375 if(!exp->expType)
9376 {
9377 exp->expType = op1->type;
9378 if(op1->type)
9379 op1->type->refCount++;
9380 }
9381 return 0x1;
9382 }
9383
9384 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9385 {
9386 int value2 = op2->__anon1.i;
9387
9388 exp->type = 2;
9389 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9390 if(!exp->expType)
9391 {
9392 exp->expType = op1->type;
9393 if(op1->type)
9394 op1->type->refCount++;
9395 }
9396 return 0x1;
9397 }
9398
9399 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9400 {
9401 unsigned int value2 = op2->__anon1.ui;
9402
9403 exp->type = 2;
9404 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9405 if(!exp->expType)
9406 {
9407 exp->expType = op1->type;
9408 if(op1->type)
9409 op1->type->refCount++;
9410 }
9411 return 0x1;
9412 }
9413
9414 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9415 {
9416 long long value2 = op2->__anon1.i64;
9417
9418 exp->type = 2;
9419 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9420 if(!exp->expType)
9421 {
9422 exp->expType = op1->type;
9423 if(op1->type)
9424 op1->type->refCount++;
9425 }
9426 return 0x1;
9427 }
9428
9429 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9430 {
9431 uint64 value2 = op2->__anon1.ui64;
9432
9433 exp->type = 2;
9434 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9435 if(!exp->expType)
9436 {
9437 exp->expType = op1->type;
9438 if(op1->type)
9439 op1->type->refCount++;
9440 }
9441 return 0x1;
9442 }
9443
9444 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9445 {
9446 short value2 = op2->__anon1.s;
9447
9448 exp->type = 2;
9449 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9450 if(!exp->expType)
9451 {
9452 exp->expType = op1->type;
9453 if(op1->type)
9454 op1->type->refCount++;
9455 }
9456 return 0x1;
9457 }
9458
9459 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9460 {
9461 unsigned short value2 = op2->__anon1.us;
9462
9463 exp->type = 2;
9464 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9465 if(!exp->expType)
9466 {
9467 exp->expType = op1->type;
9468 if(op1->type)
9469 op1->type->refCount++;
9470 }
9471 return 0x1;
9472 }
9473
9474 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9475 {
9476 char value2 = op2->__anon1.c;
9477
9478 exp->type = 2;
9479 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9480 if(!exp->expType)
9481 {
9482 exp->expType = op1->type;
9483 if(op1->type)
9484 op1->type->refCount++;
9485 }
9486 return 0x1;
9487 }
9488
9489 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9490 {
9491 unsigned char value2 = op2->__anon1.uc;
9492
9493 exp->type = 2;
9494 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9495 if(!exp->expType)
9496 {
9497 exp->expType = op1->type;
9498 if(op1->type)
9499 op1->type->refCount++;
9500 }
9501 return 0x1;
9502 }
9503
9504 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9505 {
9506 float value2 = op2->__anon1.f;
9507
9508 exp->type = 2;
9509 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9510 if(!exp->expType)
9511 {
9512 exp->expType = op1->type;
9513 if(op1->type)
9514 op1->type->refCount++;
9515 }
9516 return 0x1;
9517 }
9518
9519 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9520 {
9521 double value2 = op2->__anon1.d;
9522
9523 exp->type = 2;
9524 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9525 if(!exp->expType)
9526 {
9527 exp->expType = op1->type;
9528 if(op1->type)
9529 op1->type->refCount++;
9530 }
9531 return 0x1;
9532 }
9533
9534 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9535 {
9536 int value2 = op2->__anon1.i;
9537
9538 exp->type = 2;
9539 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9540 if(!exp->expType)
9541 {
9542 exp->expType = op1->type;
9543 if(op1->type)
9544 op1->type->refCount++;
9545 }
9546 return 0x1;
9547 }
9548
9549 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9550 {
9551 unsigned int value2 = op2->__anon1.ui;
9552
9553 exp->type = 2;
9554 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9555 if(!exp->expType)
9556 {
9557 exp->expType = op1->type;
9558 if(op1->type)
9559 op1->type->refCount++;
9560 }
9561 return 0x1;
9562 }
9563
9564 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9565 {
9566 long long value2 = op2->__anon1.i64;
9567
9568 exp->type = 2;
9569 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9570 if(!exp->expType)
9571 {
9572 exp->expType = op1->type;
9573 if(op1->type)
9574 op1->type->refCount++;
9575 }
9576 return 0x1;
9577 }
9578
9579 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9580 {
9581 uint64 value2 = op2->__anon1.ui64;
9582
9583 exp->type = 2;
9584 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9585 if(!exp->expType)
9586 {
9587 exp->expType = op1->type;
9588 if(op1->type)
9589 op1->type->refCount++;
9590 }
9591 return 0x1;
9592 }
9593
9594 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9595 {
9596 short value2 = op2->__anon1.s;
9597
9598 exp->type = 2;
9599 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9600 if(!exp->expType)
9601 {
9602 exp->expType = op1->type;
9603 if(op1->type)
9604 op1->type->refCount++;
9605 }
9606 return 0x1;
9607 }
9608
9609 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9610 {
9611 unsigned short value2 = op2->__anon1.us;
9612
9613 exp->type = 2;
9614 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9615 if(!exp->expType)
9616 {
9617 exp->expType = op1->type;
9618 if(op1->type)
9619 op1->type->refCount++;
9620 }
9621 return 0x1;
9622 }
9623
9624 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9625 {
9626 char value2 = op2->__anon1.c;
9627
9628 exp->type = 2;
9629 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9630 if(!exp->expType)
9631 {
9632 exp->expType = op1->type;
9633 if(op1->type)
9634 op1->type->refCount++;
9635 }
9636 return 0x1;
9637 }
9638
9639 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9640 {
9641 unsigned char value2 = op2->__anon1.uc;
9642
9643 exp->type = 2;
9644 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9645 if(!exp->expType)
9646 {
9647 exp->expType = op1->type;
9648 if(op1->type)
9649 op1->type->refCount++;
9650 }
9651 return 0x1;
9652 }
9653
9654 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9655 {
9656 float value2 = op2->__anon1.f;
9657
9658 exp->type = 2;
9659 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9660 if(!exp->expType)
9661 {
9662 exp->expType = op1->type;
9663 if(op1->type)
9664 op1->type->refCount++;
9665 }
9666 return 0x1;
9667 }
9668
9669 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9670 {
9671 double value2 = op2->__anon1.d;
9672
9673 exp->type = 2;
9674 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9675 if(!exp->expType)
9676 {
9677 exp->expType = op1->type;
9678 if(op1->type)
9679 op1->type->refCount++;
9680 }
9681 return 0x1;
9682 }
9683
9684 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9685 {
9686 int value2 = op2->__anon1.i;
9687
9688 exp->type = 2;
9689 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9690 if(!exp->expType)
9691 {
9692 exp->expType = op1->type;
9693 if(op1->type)
9694 op1->type->refCount++;
9695 }
9696 return 0x1;
9697 }
9698
9699 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9700 {
9701 unsigned int value2 = op2->__anon1.ui;
9702
9703 exp->type = 2;
9704 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9705 if(!exp->expType)
9706 {
9707 exp->expType = op1->type;
9708 if(op1->type)
9709 op1->type->refCount++;
9710 }
9711 return 0x1;
9712 }
9713
9714 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9715 {
9716 long long value2 = op2->__anon1.i64;
9717
9718 exp->type = 2;
9719 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9720 if(!exp->expType)
9721 {
9722 exp->expType = op1->type;
9723 if(op1->type)
9724 op1->type->refCount++;
9725 }
9726 return 0x1;
9727 }
9728
9729 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9730 {
9731 uint64 value2 = op2->__anon1.ui64;
9732
9733 exp->type = 2;
9734 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9735 if(!exp->expType)
9736 {
9737 exp->expType = op1->type;
9738 if(op1->type)
9739 op1->type->refCount++;
9740 }
9741 return 0x1;
9742 }
9743
9744 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9745 {
9746 short value2 = op2->__anon1.s;
9747
9748 exp->type = 2;
9749 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9750 if(!exp->expType)
9751 {
9752 exp->expType = op1->type;
9753 if(op1->type)
9754 op1->type->refCount++;
9755 }
9756 return 0x1;
9757 }
9758
9759 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9760 {
9761 unsigned short value2 = op2->__anon1.us;
9762
9763 exp->type = 2;
9764 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9765 if(!exp->expType)
9766 {
9767 exp->expType = op1->type;
9768 if(op1->type)
9769 op1->type->refCount++;
9770 }
9771 return 0x1;
9772 }
9773
9774 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9775 {
9776 char value2 = op2->__anon1.c;
9777
9778 exp->type = 2;
9779 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9780 if(!exp->expType)
9781 {
9782 exp->expType = op1->type;
9783 if(op1->type)
9784 op1->type->refCount++;
9785 }
9786 return 0x1;
9787 }
9788
9789 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9790 {
9791 unsigned char value2 = op2->__anon1.uc;
9792
9793 exp->type = 2;
9794 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9795 if(!exp->expType)
9796 {
9797 exp->expType = op1->type;
9798 if(op1->type)
9799 op1->type->refCount++;
9800 }
9801 return 0x1;
9802 }
9803
9804 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9805 {
9806 float value2 = op2->__anon1.f;
9807
9808 exp->type = 2;
9809 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9810 if(!exp->expType)
9811 {
9812 exp->expType = op1->type;
9813 if(op1->type)
9814 op1->type->refCount++;
9815 }
9816 return 0x1;
9817 }
9818
9819 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9820 {
9821 double value2 = op2->__anon1.d;
9822
9823 exp->type = 2;
9824 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9825 if(!exp->expType)
9826 {
9827 exp->expType = op1->type;
9828 if(op1->type)
9829 op1->type->refCount++;
9830 }
9831 return 0x1;
9832 }
9833
9834 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9835 {
9836 int value2 = op2->__anon1.i;
9837
9838 exp->type = 2;
9839 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9840 if(!exp->expType)
9841 {
9842 exp->expType = op1->type;
9843 if(op1->type)
9844 op1->type->refCount++;
9845 }
9846 return 0x1;
9847 }
9848
9849 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9850 {
9851 unsigned int value2 = op2->__anon1.ui;
9852
9853 exp->type = 2;
9854 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9855 if(!exp->expType)
9856 {
9857 exp->expType = op1->type;
9858 if(op1->type)
9859 op1->type->refCount++;
9860 }
9861 return 0x1;
9862 }
9863
9864 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9865 {
9866 long long value2 = op2->__anon1.i64;
9867
9868 exp->type = 2;
9869 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9870 if(!exp->expType)
9871 {
9872 exp->expType = op1->type;
9873 if(op1->type)
9874 op1->type->refCount++;
9875 }
9876 return 0x1;
9877 }
9878
9879 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9880 {
9881 uint64 value2 = op2->__anon1.ui64;
9882
9883 exp->type = 2;
9884 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9885 if(!exp->expType)
9886 {
9887 exp->expType = op1->type;
9888 if(op1->type)
9889 op1->type->refCount++;
9890 }
9891 return 0x1;
9892 }
9893
9894 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9895 {
9896 short value2 = op2->__anon1.s;
9897
9898 exp->type = 2;
9899 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9900 if(!exp->expType)
9901 {
9902 exp->expType = op1->type;
9903 if(op1->type)
9904 op1->type->refCount++;
9905 }
9906 return 0x1;
9907 }
9908
9909 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9910 {
9911 unsigned short value2 = op2->__anon1.us;
9912
9913 exp->type = 2;
9914 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9915 if(!exp->expType)
9916 {
9917 exp->expType = op1->type;
9918 if(op1->type)
9919 op1->type->refCount++;
9920 }
9921 return 0x1;
9922 }
9923
9924 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9925 {
9926 char value2 = op2->__anon1.c;
9927
9928 exp->type = 2;
9929 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9930 if(!exp->expType)
9931 {
9932 exp->expType = op1->type;
9933 if(op1->type)
9934 op1->type->refCount++;
9935 }
9936 return 0x1;
9937 }
9938
9939 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9940 {
9941 unsigned char value2 = op2->__anon1.uc;
9942
9943 exp->type = 2;
9944 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9945 if(!exp->expType)
9946 {
9947 exp->expType = op1->type;
9948 if(op1->type)
9949 op1->type->refCount++;
9950 }
9951 return 0x1;
9952 }
9953
9954 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9955 {
9956 float value2 = op2->__anon1.f;
9957
9958 exp->type = 2;
9959 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9960 if(!exp->expType)
9961 {
9962 exp->expType = op1->type;
9963 if(op1->type)
9964 op1->type->refCount++;
9965 }
9966 return 0x1;
9967 }
9968
9969 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9970 {
9971 double value2 = op2->__anon1.d;
9972
9973 exp->type = 2;
9974 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9975 if(!exp->expType)
9976 {
9977 exp->expType = op1->type;
9978 if(op1->type)
9979 op1->type->refCount++;
9980 }
9981 return 0x1;
9982 }
9983
9984 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9985 {
9986 int value2 = op2->__anon1.i;
9987
9988 exp->type = 2;
9989 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
9990 if(!exp->expType)
9991 {
9992 exp->expType = op1->type;
9993 if(op1->type)
9994 op1->type->refCount++;
9995 }
9996 return 0x1;
9997 }
9998
9999 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10000 {
10001 unsigned int value2 = op2->__anon1.ui;
10002
10003 exp->type = 2;
10004 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10005 if(!exp->expType)
10006 {
10007 exp->expType = op1->type;
10008 if(op1->type)
10009 op1->type->refCount++;
10010 }
10011 return 0x1;
10012 }
10013
10014 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10015 {
10016 long long value2 = op2->__anon1.i64;
10017
10018 exp->type = 2;
10019 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10020 if(!exp->expType)
10021 {
10022 exp->expType = op1->type;
10023 if(op1->type)
10024 op1->type->refCount++;
10025 }
10026 return 0x1;
10027 }
10028
10029 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10030 {
10031 uint64 value2 = op2->__anon1.ui64;
10032
10033 exp->type = 2;
10034 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10035 if(!exp->expType)
10036 {
10037 exp->expType = op1->type;
10038 if(op1->type)
10039 op1->type->refCount++;
10040 }
10041 return 0x1;
10042 }
10043
10044 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10045 {
10046 short value2 = op2->__anon1.s;
10047
10048 exp->type = 2;
10049 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10050 if(!exp->expType)
10051 {
10052 exp->expType = op1->type;
10053 if(op1->type)
10054 op1->type->refCount++;
10055 }
10056 return 0x1;
10057 }
10058
10059 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10060 {
10061 unsigned short value2 = op2->__anon1.us;
10062
10063 exp->type = 2;
10064 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10065 if(!exp->expType)
10066 {
10067 exp->expType = op1->type;
10068 if(op1->type)
10069 op1->type->refCount++;
10070 }
10071 return 0x1;
10072 }
10073
10074 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10075 {
10076 char value2 = op2->__anon1.c;
10077
10078 exp->type = 2;
10079 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10080 if(!exp->expType)
10081 {
10082 exp->expType = op1->type;
10083 if(op1->type)
10084 op1->type->refCount++;
10085 }
10086 return 0x1;
10087 }
10088
10089 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10090 {
10091 unsigned char value2 = op2->__anon1.uc;
10092
10093 exp->type = 2;
10094 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10095 if(!exp->expType)
10096 {
10097 exp->expType = op1->type;
10098 if(op1->type)
10099 op1->type->refCount++;
10100 }
10101 return 0x1;
10102 }
10103
10104 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10105 {
10106 float value2 = op2->__anon1.f;
10107
10108 exp->type = 2;
10109 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10110 if(!exp->expType)
10111 {
10112 exp->expType = op1->type;
10113 if(op1->type)
10114 op1->type->refCount++;
10115 }
10116 return 0x1;
10117 }
10118
10119 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10120 {
10121 double value2 = op2->__anon1.d;
10122
10123 exp->type = 2;
10124 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10125 if(!exp->expType)
10126 {
10127 exp->expType = op1->type;
10128 if(op1->type)
10129 op1->type->refCount++;
10130 }
10131 return 0x1;
10132 }
10133
10134 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10135 {
10136 int value2 = op2->__anon1.i;
10137
10138 exp->type = 2;
10139 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10140 if(!exp->expType)
10141 {
10142 exp->expType = op1->type;
10143 if(op1->type)
10144 op1->type->refCount++;
10145 }
10146 return 0x1;
10147 }
10148
10149 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10150 {
10151 unsigned int value2 = op2->__anon1.ui;
10152
10153 exp->type = 2;
10154 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10155 if(!exp->expType)
10156 {
10157 exp->expType = op1->type;
10158 if(op1->type)
10159 op1->type->refCount++;
10160 }
10161 return 0x1;
10162 }
10163
10164 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10165 {
10166 long long value2 = op2->__anon1.i64;
10167
10168 exp->type = 2;
10169 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10170 if(!exp->expType)
10171 {
10172 exp->expType = op1->type;
10173 if(op1->type)
10174 op1->type->refCount++;
10175 }
10176 return 0x1;
10177 }
10178
10179 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10180 {
10181 uint64 value2 = op2->__anon1.ui64;
10182
10183 exp->type = 2;
10184 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10185 if(!exp->expType)
10186 {
10187 exp->expType = op1->type;
10188 if(op1->type)
10189 op1->type->refCount++;
10190 }
10191 return 0x1;
10192 }
10193
10194 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10195 {
10196 short value2 = op2->__anon1.s;
10197
10198 exp->type = 2;
10199 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10200 if(!exp->expType)
10201 {
10202 exp->expType = op1->type;
10203 if(op1->type)
10204 op1->type->refCount++;
10205 }
10206 return 0x1;
10207 }
10208
10209 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10210 {
10211 unsigned short value2 = op2->__anon1.us;
10212
10213 exp->type = 2;
10214 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10215 if(!exp->expType)
10216 {
10217 exp->expType = op1->type;
10218 if(op1->type)
10219 op1->type->refCount++;
10220 }
10221 return 0x1;
10222 }
10223
10224 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10225 {
10226 char value2 = op2->__anon1.c;
10227
10228 exp->type = 2;
10229 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10230 if(!exp->expType)
10231 {
10232 exp->expType = op1->type;
10233 if(op1->type)
10234 op1->type->refCount++;
10235 }
10236 return 0x1;
10237 }
10238
10239 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10240 {
10241 unsigned char value2 = op2->__anon1.uc;
10242
10243 exp->type = 2;
10244 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10245 if(!exp->expType)
10246 {
10247 exp->expType = op1->type;
10248 if(op1->type)
10249 op1->type->refCount++;
10250 }
10251 return 0x1;
10252 }
10253
10254 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10255 {
10256 float value2 = op2->__anon1.f;
10257
10258 exp->type = 2;
10259 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10260 if(!exp->expType)
10261 {
10262 exp->expType = op1->type;
10263 if(op1->type)
10264 op1->type->refCount++;
10265 }
10266 return 0x1;
10267 }
10268
10269 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10270 {
10271 double value2 = op2->__anon1.d;
10272
10273 exp->type = 2;
10274 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10275 if(!exp->expType)
10276 {
10277 exp->expType = op1->type;
10278 if(op1->type)
10279 op1->type->refCount++;
10280 }
10281 return 0x1;
10282 }
10283
10284 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10285 {
10286 int value2 = op2->__anon1.i;
10287
10288 exp->type = 2;
10289 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10290 if(!exp->expType)
10291 {
10292 exp->expType = op1->type;
10293 if(op1->type)
10294 op1->type->refCount++;
10295 }
10296 return 0x1;
10297 }
10298
10299 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10300 {
10301 unsigned int value2 = op2->__anon1.ui;
10302
10303 exp->type = 2;
10304 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10305 if(!exp->expType)
10306 {
10307 exp->expType = op1->type;
10308 if(op1->type)
10309 op1->type->refCount++;
10310 }
10311 return 0x1;
10312 }
10313
10314 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10315 {
10316 long long value2 = op2->__anon1.i64;
10317
10318 exp->type = 2;
10319 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10320 if(!exp->expType)
10321 {
10322 exp->expType = op1->type;
10323 if(op1->type)
10324 op1->type->refCount++;
10325 }
10326 return 0x1;
10327 }
10328
10329 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10330 {
10331 uint64 value2 = op2->__anon1.ui64;
10332
10333 exp->type = 2;
10334 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10335 if(!exp->expType)
10336 {
10337 exp->expType = op1->type;
10338 if(op1->type)
10339 op1->type->refCount++;
10340 }
10341 return 0x1;
10342 }
10343
10344 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10345 {
10346 short value2 = op2->__anon1.s;
10347
10348 exp->type = 2;
10349 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10350 if(!exp->expType)
10351 {
10352 exp->expType = op1->type;
10353 if(op1->type)
10354 op1->type->refCount++;
10355 }
10356 return 0x1;
10357 }
10358
10359 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10360 {
10361 unsigned short value2 = op2->__anon1.us;
10362
10363 exp->type = 2;
10364 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10365 if(!exp->expType)
10366 {
10367 exp->expType = op1->type;
10368 if(op1->type)
10369 op1->type->refCount++;
10370 }
10371 return 0x1;
10372 }
10373
10374 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10375 {
10376 char value2 = op2->__anon1.c;
10377
10378 exp->type = 2;
10379 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10380 if(!exp->expType)
10381 {
10382 exp->expType = op1->type;
10383 if(op1->type)
10384 op1->type->refCount++;
10385 }
10386 return 0x1;
10387 }
10388
10389 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10390 {
10391 unsigned char value2 = op2->__anon1.uc;
10392
10393 exp->type = 2;
10394 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10395 if(!exp->expType)
10396 {
10397 exp->expType = op1->type;
10398 if(op1->type)
10399 op1->type->refCount++;
10400 }
10401 return 0x1;
10402 }
10403
10404 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10405 {
10406 float value2 = op2->__anon1.f;
10407
10408 exp->type = 2;
10409 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10410 if(!exp->expType)
10411 {
10412 exp->expType = op1->type;
10413 if(op1->type)
10414 op1->type->refCount++;
10415 }
10416 return 0x1;
10417 }
10418
10419 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10420 {
10421 double value2 = op2->__anon1.d;
10422
10423 exp->type = 2;
10424 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10425 if(!exp->expType)
10426 {
10427 exp->expType = op1->type;
10428 if(op1->type)
10429 op1->type->refCount++;
10430 }
10431 return 0x1;
10432 }
10433
10434 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10435 {
10436 int value2 = op2->__anon1.i;
10437
10438 exp->type = 2;
10439 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10440 if(!exp->expType)
10441 {
10442 exp->expType = op1->type;
10443 if(op1->type)
10444 op1->type->refCount++;
10445 }
10446 return 0x1;
10447 }
10448
10449 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10450 {
10451 unsigned int value2 = op2->__anon1.ui;
10452
10453 exp->type = 2;
10454 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10455 if(!exp->expType)
10456 {
10457 exp->expType = op1->type;
10458 if(op1->type)
10459 op1->type->refCount++;
10460 }
10461 return 0x1;
10462 }
10463
10464 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10465 {
10466 long long value2 = op2->__anon1.i64;
10467
10468 exp->type = 2;
10469 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10470 if(!exp->expType)
10471 {
10472 exp->expType = op1->type;
10473 if(op1->type)
10474 op1->type->refCount++;
10475 }
10476 return 0x1;
10477 }
10478
10479 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10480 {
10481 uint64 value2 = op2->__anon1.ui64;
10482
10483 exp->type = 2;
10484 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10485 if(!exp->expType)
10486 {
10487 exp->expType = op1->type;
10488 if(op1->type)
10489 op1->type->refCount++;
10490 }
10491 return 0x1;
10492 }
10493
10494 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10495 {
10496 short value2 = op2->__anon1.s;
10497
10498 exp->type = 2;
10499 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10500 if(!exp->expType)
10501 {
10502 exp->expType = op1->type;
10503 if(op1->type)
10504 op1->type->refCount++;
10505 }
10506 return 0x1;
10507 }
10508
10509 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10510 {
10511 unsigned short value2 = op2->__anon1.us;
10512
10513 exp->type = 2;
10514 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10515 if(!exp->expType)
10516 {
10517 exp->expType = op1->type;
10518 if(op1->type)
10519 op1->type->refCount++;
10520 }
10521 return 0x1;
10522 }
10523
10524 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10525 {
10526 char value2 = op2->__anon1.c;
10527
10528 exp->type = 2;
10529 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10530 if(!exp->expType)
10531 {
10532 exp->expType = op1->type;
10533 if(op1->type)
10534 op1->type->refCount++;
10535 }
10536 return 0x1;
10537 }
10538
10539 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10540 {
10541 unsigned char value2 = op2->__anon1.uc;
10542
10543 exp->type = 2;
10544 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10545 if(!exp->expType)
10546 {
10547 exp->expType = op1->type;
10548 if(op1->type)
10549 op1->type->refCount++;
10550 }
10551 return 0x1;
10552 }
10553
10554 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10555 {
10556 float value2 = op2->__anon1.f;
10557
10558 exp->type = 2;
10559 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10560 if(!exp->expType)
10561 {
10562 exp->expType = op1->type;
10563 if(op1->type)
10564 op1->type->refCount++;
10565 }
10566 return 0x1;
10567 }
10568
10569 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10570 {
10571 double value2 = op2->__anon1.d;
10572
10573 exp->type = 2;
10574 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10575 if(!exp->expType)
10576 {
10577 exp->expType = op1->type;
10578 if(op1->type)
10579 op1->type->refCount++;
10580 }
10581 return 0x1;
10582 }
10583
10584 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10585 {
10586 exp->type = 2;
10587 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10588 if(!exp->expType)
10589 {
10590 exp->expType = op1->type;
10591 if(op1->type)
10592 op1->type->refCount++;
10593 }
10594 return 0x1;
10595 }
10596
10597 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10598 {
10599 exp->type = 2;
10600 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10601 if(!exp->expType)
10602 {
10603 exp->expType = op1->type;
10604 if(op1->type)
10605 op1->type->refCount++;
10606 }
10607 return 0x1;
10608 }
10609
10610 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10611 {
10612 exp->type = 2;
10613 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10614 if(!exp->expType)
10615 {
10616 exp->expType = op1->type;
10617 if(op1->type)
10618 op1->type->refCount++;
10619 }
10620 return 0x1;
10621 }
10622
10623 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10624 {
10625 exp->type = 2;
10626 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10627 if(!exp->expType)
10628 {
10629 exp->expType = op1->type;
10630 if(op1->type)
10631 op1->type->refCount++;
10632 }
10633 return 0x1;
10634 }
10635
10636 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10637 {
10638 exp->type = 2;
10639 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10640 if(!exp->expType)
10641 {
10642 exp->expType = op1->type;
10643 if(op1->type)
10644 op1->type->refCount++;
10645 }
10646 return 0x1;
10647 }
10648
10649 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10650 {
10651 exp->type = 2;
10652 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10653 if(!exp->expType)
10654 {
10655 exp->expType = op1->type;
10656 if(op1->type)
10657 op1->type->refCount++;
10658 }
10659 return 0x1;
10660 }
10661
10662 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10663 {
10664 exp->type = 2;
10665 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10666 if(!exp->expType)
10667 {
10668 exp->expType = op1->type;
10669 if(op1->type)
10670 op1->type->refCount++;
10671 }
10672 return 0x1;
10673 }
10674
10675 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10676 {
10677 exp->type = 2;
10678 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10679 if(!exp->expType)
10680 {
10681 exp->expType = op1->type;
10682 if(op1->type)
10683 op1->type->refCount++;
10684 }
10685 return 0x1;
10686 }
10687
10688 struct OpTable intOps =
10689 {
10690 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
10691 };
10692
10693 struct OpTable uintOps =
10694 {
10695 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
10696 };
10697
10698 struct OpTable int64Ops =
10699 {
10700 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
10701 };
10702
10703 struct OpTable uint64Ops =
10704 {
10705 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
10706 };
10707
10708 struct OpTable shortOps =
10709 {
10710 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
10711 };
10712
10713 struct OpTable ushortOps =
10714 {
10715 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
10716 };
10717
10718 struct OpTable floatOps =
10719 {
10720 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
10721 };
10722
10723 struct OpTable doubleOps =
10724 {
10725 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
10726 };
10727
10728 struct OpTable charOps =
10729 {
10730 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
10731 };
10732
10733 struct OpTable ucharOps =
10734 {
10735 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
10736 };
10737
10738 void ReadString(char * output, char * string)
10739 {
10740 int len = strlen(string);
10741 int c, d = 0;
10742 unsigned int quoted = 0x0, escaped = 0x0;
10743
10744 for(c = 0; c < len; c++)
10745 {
10746 char ch = string[c];
10747
10748 if(escaped)
10749 {
10750 switch(ch)
10751 {
10752 case 'n':
10753 output[d] = '\n';
10754 break;
10755 case 't':
10756 output[d] = '\t';
10757 break;
10758 case 'a':
10759 output[d] = '\a';
10760 break;
10761 case 'b':
10762 output[d] = '\b';
10763 break;
10764 case 'f':
10765 output[d] = '\f';
10766 break;
10767 case 'r':
10768 output[d] = '\r';
10769 break;
10770 case 'v':
10771 output[d] = '\v';
10772 break;
10773 case '\\':
10774 output[d] = '\\';
10775 break;
10776 case '\"':
10777 output[d] = '\"';
10778 break;
10779 case '\'':
10780 output[d] = '\'';
10781 break;
10782 default:
10783 output[d] = ch;
10784 }
10785 d++;
10786 escaped = 0x0;
10787 }
10788 else
10789 {
10790 if(ch == '\"')
10791 quoted ^= 0x1;
10792 else if(quoted)
10793 {
10794 if(ch == '\\')
10795 escaped = 0x1;
10796 else
10797 output[d++] = ch;
10798 }
10799 }
10800 }
10801 output[d] = '\0';
10802 }
10803
10804 int UnescapeString(char * d, char * s, int len)
10805 {
10806 int j = 0, k = 0;
10807 char ch;
10808
10809 while(j < len && (ch = s[j]))
10810 {
10811 switch(ch)
10812 {
10813 case '\\':
10814 switch((ch = s[++j]))
10815 {
10816 case 'n':
10817 d[k] = '\n';
10818 break;
10819 case 't':
10820 d[k] = '\t';
10821 break;
10822 case 'a':
10823 d[k] = '\a';
10824 break;
10825 case 'b':
10826 d[k] = '\b';
10827 break;
10828 case 'f':
10829 d[k] = '\f';
10830 break;
10831 case 'r':
10832 d[k] = '\r';
10833 break;
10834 case 'v':
10835 d[k] = '\v';
10836 break;
10837 case '\\':
10838 d[k] = '\\';
10839 break;
10840 case '\"':
10841 d[k] = '\"';
10842 break;
10843 case '\'':
10844 d[k] = '\'';
10845 break;
10846 default:
10847 d[k] = '\\';
10848 d[k] = ch;
10849 }
10850 break;
10851 default:
10852 d[k] = ch;
10853 }
10854 j++, k++;
10855 }
10856 d[k] = '\0';
10857 return k;
10858 }
10859
10860 char * OffsetEscapedString(char * s, int len, int offset)
10861 {
10862 char ch;
10863 int j = 0, k = 0;
10864
10865 while(j < len && k < offset && (ch = s[j]))
10866 {
10867 if(ch == '\\')
10868 ++j;
10869 j++, k++;
10870 }
10871 return (k == offset) ? s + j : (((void *)0));
10872 }
10873
10874 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10875
10876 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10877
10878 extern double strtod(const char * , char * * );
10879
10880 extern float (* __ecereMethod_float_inf)(void);
10881
10882 extern float (* __ecereMethod_float_nan)(void);
10883
10884 extern double (* __ecereMethod_double_inf)(void);
10885
10886 extern double (* __ecereMethod_double_nan)(void);
10887
10888 struct Operand GetOperand(struct Expression * exp)
10889 {
10890 struct Operand op =
10891 {
10892 0, 0, 0,
10893 .__anon1 = {
10894 .c = 0
10895 },
10896 {
10897 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10898 }
10899 };
10900 struct Type * type = exp->expType;
10901
10902 if(type)
10903 {
10904 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))
10905 {
10906 if(!type->__anon1._class->__anon1.registered->dataType)
10907 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
10908 type = type->__anon1._class->__anon1.registered->dataType;
10909 }
10910 if(exp->type == 3 && op.kind == 13)
10911 {
10912 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10913 op.kind = 13;
10914 op.ops = uint64Ops;
10915 }
10916 else if(exp->isConstant && exp->type == 2)
10917 {
10918 op.kind = type->kind;
10919 op.type = exp->expType;
10920 switch(op.kind)
10921 {
10922 case 24:
10923 case 1:
10924 {
10925 if(exp->__anon1.__anon1.constant[0] == '\'')
10926 {
10927 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10928 op.ops = charOps;
10929 }
10930 else if(type->isSigned)
10931 {
10932 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10933 op.ops = charOps;
10934 }
10935 else
10936 {
10937 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10938 op.ops = ucharOps;
10939 }
10940 break;
10941 }
10942 case 2:
10943 if(type->isSigned)
10944 {
10945 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10946 op.ops = shortOps;
10947 }
10948 else
10949 {
10950 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10951 op.ops = ushortOps;
10952 }
10953 break;
10954 case 3:
10955 case 5:
10956 if(type->isSigned)
10957 {
10958 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10959 op.ops = intOps;
10960 }
10961 else
10962 {
10963 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10964 op.ops = uintOps;
10965 }
10966 op.kind = 3;
10967 break;
10968 case 4:
10969 if(type->isSigned)
10970 {
10971 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10972 op.ops = int64Ops;
10973 }
10974 else
10975 {
10976 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10977 op.ops = uint64Ops;
10978 }
10979 op.kind = 4;
10980 break;
10981 case 22:
10982 if(type->isSigned)
10983 {
10984 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10985 op.ops = int64Ops;
10986 }
10987 else
10988 {
10989 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10990 op.ops = uint64Ops;
10991 }
10992 op.kind = 4;
10993 break;
10994 case 23:
10995 if(type->isSigned)
10996 {
10997 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10998 op.ops = int64Ops;
10999 }
11000 else
11001 {
11002 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11003 op.ops = uint64Ops;
11004 }
11005 op.kind = 4;
11006 break;
11007 case 6:
11008 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11009 op.__anon1.f = __ecereMethod_float_inf();
11010 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11011 op.__anon1.f = -__ecereMethod_float_inf();
11012 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11013 op.__anon1.f = __ecereMethod_float_nan();
11014 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11015 op.__anon1.f = -__ecereMethod_float_nan();
11016 else
11017 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11018 op.ops = floatOps;
11019 break;
11020 case 7:
11021 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11022 op.__anon1.d = __ecereMethod_double_inf();
11023 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11024 op.__anon1.d = -__ecereMethod_double_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11026 op.__anon1.d = __ecereMethod_double_nan();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11028 op.__anon1.d = -__ecereMethod_double_nan();
11029 else
11030 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11031 op.ops = doubleOps;
11032 break;
11033 case 12:
11034 case 13:
11035 case 8:
11036 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11037 op.kind = 13;
11038 op.ops = uint64Ops;
11039 break;
11040 }
11041 }
11042 }
11043 return op;
11044 }
11045
11046 int __ecereVMethodID_class_OnGetString;
11047
11048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11049
11050 static __attribute__((unused)) void UnusedFunction()
11051 {
11052 int a;
11053
11054 ((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);
11055 }
11056
11057 extern int __ecereVMethodID_class_OnGetString;
11058
11059 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11060 {
11061 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11062
11063 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11064 {
11065 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11066 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11067 else
11068 {
11069 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11070 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11071 struct Type * type;
11072 void * ptr = inst->data + dataMember->offset + offset;
11073 char * result = (((void *)0));
11074
11075 exp->loc = member->loc = inst->loc;
11076 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11077 if(!dataMember->dataType)
11078 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11079 type = dataMember->dataType;
11080 if(type->kind == 8)
11081 {
11082 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11083
11084 if(_class->type == 4)
11085 {
11086 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11087
11088 if(enumClass)
11089 {
11090 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11091 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11092
11093 for(item = e->values.first; item; item = item->next)
11094 {
11095 if((int)item->data == *(int *)ptr)
11096 {
11097 result = item->name;
11098 break;
11099 }
11100 }
11101 if(result)
11102 {
11103 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11104 exp->type = 0;
11105 exp->destType = MkClassType(_class->fullName);
11106 ProcessExpressionType(exp);
11107 }
11108 }
11109 }
11110 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11111 {
11112 if(!_class->dataType)
11113 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11114 type = _class->dataType;
11115 }
11116 }
11117 if(!result)
11118 {
11119 switch(type->kind)
11120 {
11121 case 6:
11122 {
11123 FreeExpContents(exp);
11124 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11125 exp->type = 2;
11126 break;
11127 }
11128 case 7:
11129 {
11130 FreeExpContents(exp);
11131 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11132 exp->type = 2;
11133 break;
11134 }
11135 case 3:
11136 {
11137 FreeExpContents(exp);
11138 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11139 exp->type = 2;
11140 break;
11141 }
11142 case 4:
11143 {
11144 FreeExpContents(exp);
11145 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11146 exp->type = 2;
11147 break;
11148 }
11149 case 22:
11150 {
11151 FreeExpContents(exp);
11152 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11153 exp->type = 2;
11154 break;
11155 }
11156 case 23:
11157 {
11158 FreeExpContents(exp);
11159 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11160 exp->type = 2;
11161 break;
11162 }
11163 default:
11164 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11165 }
11166 }
11167 ListAdd(memberList, member);
11168 }
11169 if(parentDataMember->type == 1)
11170 break;
11171 }
11172 }
11173
11174 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11175
11176 void PopulateInstance(struct Instantiation * inst)
11177 {
11178 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11179 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11180 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11181 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11182
11183 if(!inst->members)
11184 inst->members = MkListOne(MkMembersInitList(memberList));
11185 else
11186 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11187 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11188 {
11189 if(!dataMember->isProperty)
11190 {
11191 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11192 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11193 else
11194 {
11195 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11196 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11197 struct Type * type;
11198 void * ptr = inst->data + dataMember->offset;
11199 char * result = (((void *)0));
11200
11201 exp->loc = member->loc = inst->loc;
11202 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11203 if(!dataMember->dataType)
11204 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11205 type = dataMember->dataType;
11206 if(type->kind == 8)
11207 {
11208 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11209
11210 if(_class->type == 4)
11211 {
11212 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11213
11214 if(enumClass)
11215 {
11216 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11217 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11218
11219 for(item = e->values.first; item; item = item->next)
11220 {
11221 if((int)item->data == *(int *)ptr)
11222 {
11223 result = item->name;
11224 break;
11225 }
11226 }
11227 }
11228 if(result)
11229 {
11230 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11231 exp->type = 0;
11232 exp->destType = MkClassType(_class->fullName);
11233 ProcessExpressionType(exp);
11234 }
11235 }
11236 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11237 {
11238 if(!_class->dataType)
11239 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11240 type = _class->dataType;
11241 }
11242 }
11243 if(!result)
11244 {
11245 switch(type->kind)
11246 {
11247 case 6:
11248 {
11249 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11250 exp->type = 2;
11251 break;
11252 }
11253 case 7:
11254 {
11255 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11256 exp->type = 2;
11257 break;
11258 }
11259 case 3:
11260 {
11261 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11262 exp->type = 2;
11263 break;
11264 }
11265 case 4:
11266 {
11267 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11268 exp->type = 2;
11269 break;
11270 }
11271 case 22:
11272 {
11273 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11274 exp->type = 2;
11275 break;
11276 }
11277 default:
11278 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11279 }
11280 }
11281 ListAdd(memberList, member);
11282 }
11283 }
11284 }
11285 }
11286
11287 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);
11288
11289 extern void FreeInstance(struct Instantiation * inst);
11290
11291 void ComputeInstantiation(struct Expression * exp)
11292 {
11293 struct Instantiation * inst = exp->__anon1.instance;
11294 struct MembersInit * members;
11295 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11296 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11297 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11298 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11299 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11300 int subMemberStackPos = 0;
11301 uint64 bits = 0;
11302
11303 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11304 {
11305 if(inst->data)
11306 return ;
11307 if(_class->type == 0 || _class->type == 5)
11308 {
11309 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11310 if(_class->type == 0)
11311 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11312 }
11313 else
11314 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11315 }
11316 if(inst->members)
11317 {
11318 for(members = (*inst->members).first; members; members = members->next)
11319 {
11320 switch(members->type)
11321 {
11322 case 0:
11323 {
11324 if(members->__anon1.dataMembers)
11325 {
11326 struct MemberInit * member;
11327
11328 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11329 {
11330 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11331 unsigned int found = 0x0;
11332 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11333 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11334 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11335 unsigned int dataMemberOffset;
11336
11337 if(!ident)
11338 {
11339 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11340 if(curMember)
11341 {
11342 if(curMember->isProperty)
11343 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11344 else
11345 {
11346 dataMember = curMember;
11347 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11348 if(_class->type == 0)
11349 dataMemberOffset += _class->base->structSize;
11350 }
11351 found = 0x1;
11352 }
11353 }
11354 else
11355 {
11356 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11357 if(prop)
11358 {
11359 found = 0x1;
11360 if(prop->memberAccess == 1)
11361 {
11362 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11363 curClass = prop->_class;
11364 }
11365 }
11366 else
11367 {
11368 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11369 int _subMemberStackPos = 0;
11370
11371 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11372 if(dataMember)
11373 {
11374 found = 0x1;
11375 if(dataMember->memberAccess == 1)
11376 {
11377 curMember = dataMember;
11378 curClass = dataMember->_class;
11379 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11380 subMemberStackPos = _subMemberStackPos;
11381 }
11382 }
11383 }
11384 }
11385 if(found && member->initializer && member->initializer->type == 0)
11386 {
11387 struct Expression * value = member->initializer->__anon1.exp;
11388 struct Type * type = (((void *)0));
11389 unsigned int deepMember = 0x0;
11390
11391 if(prop)
11392 {
11393 type = prop->dataType;
11394 }
11395 else if(dataMember)
11396 {
11397 if(!dataMember->dataType)
11398 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11399 type = dataMember->dataType;
11400 }
11401 if(ident && ident->next)
11402 {
11403 deepMember = 0x1;
11404 for(ident = ident->next; ident && type; ident = ident->next)
11405 {
11406 if(type->kind == 8)
11407 {
11408 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11409 if(prop)
11410 type = prop->dataType;
11411 else
11412 {
11413 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11414 if(dataMember)
11415 type = dataMember->dataType;
11416 }
11417 }
11418 else if(type->kind == 9 || type->kind == 10)
11419 {
11420 struct Type * memberType;
11421
11422 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11423 {
11424 if(!strcmp(memberType->name, ident->string))
11425 {
11426 type = memberType;
11427 break;
11428 }
11429 }
11430 }
11431 }
11432 }
11433 if(value)
11434 {
11435 FreeType(value->destType);
11436 value->destType = type;
11437 if(type)
11438 type->refCount++;
11439 ComputeExpression(value);
11440 }
11441 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11442 {
11443 if(type->kind == 8)
11444 {
11445 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11446
11447 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11448 {
11449 if(!_class->dataType)
11450 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11451 type = _class->dataType;
11452 }
11453 }
11454 if(dataMember)
11455 {
11456 void * ptr = inst->data + dataMemberOffset;
11457
11458 if(value->type == 2)
11459 {
11460 switch(type->kind)
11461 {
11462 case 3:
11463 {
11464 GetInt(value, (int *)ptr);
11465 break;
11466 }
11467 case 4:
11468 {
11469 GetInt64(value, (long long *)ptr);
11470 break;
11471 }
11472 case 22:
11473 {
11474 GetIntPtr(value, (intptr_t *)ptr);
11475 break;
11476 }
11477 case 23:
11478 {
11479 GetIntSize(value, (ssize_t *)ptr);
11480 break;
11481 }
11482 case 6:
11483 {
11484 GetFloat(value, (float *)ptr);
11485 break;
11486 }
11487 case 7:
11488 {
11489 GetDouble(value, (double *)ptr);
11490 break;
11491 }
11492 }
11493 }
11494 else if(value->type == 1)
11495 {
11496 if(type->kind == 8)
11497 {
11498 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11499
11500 if(_class->type == 1)
11501 {
11502 ComputeTypeSize(type);
11503 if(value->__anon1.instance->data)
11504 memcpy(ptr, value->__anon1.instance->data, type->size);
11505 }
11506 }
11507 }
11508 }
11509 else if(prop)
11510 {
11511 if(value->type == 1 && value->__anon1.instance->data)
11512 {
11513 if(type->kind == 8)
11514 {
11515 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11516
11517 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)))
11518 {
11519 void (* Set)(void *, void *) = (void *)prop->Set;
11520
11521 Set(inst->data, value->__anon1.instance->data);
11522 PopulateInstance(inst);
11523 }
11524 }
11525 }
11526 else if(value->type == 2)
11527 {
11528 switch(type->kind)
11529 {
11530 case 7:
11531 {
11532 void (* Set)(void *, double) = (void *)prop->Set;
11533
11534 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11535 break;
11536 }
11537 case 6:
11538 {
11539 void (* Set)(void *, float) = (void *)prop->Set;
11540
11541 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11542 break;
11543 }
11544 case 3:
11545 {
11546 void (* Set)(void *, int) = (void *)prop->Set;
11547
11548 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11549 break;
11550 }
11551 case 4:
11552 {
11553 void (* Set)(void *, long long) = (void *)prop->Set;
11554
11555 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11556 break;
11557 }
11558 case 22:
11559 {
11560 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11561
11562 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11563 break;
11564 }
11565 case 23:
11566 {
11567 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11568
11569 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11570 break;
11571 }
11572 }
11573 }
11574 else if(value->type == 3)
11575 {
11576 char temp[1024];
11577
11578 ReadString(temp, value->__anon1.__anon2.string);
11579 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11580 }
11581 }
11582 }
11583 else if(!deepMember && type && _class->type == 3)
11584 {
11585 if(prop)
11586 {
11587 if(value->type == 2)
11588 {
11589 if(type->kind == 8)
11590 {
11591 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11592
11593 if(_class->type == 3)
11594 {
11595 if(!_class->dataType)
11596 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11597 type = _class->dataType;
11598 }
11599 }
11600 switch(type->kind)
11601 {
11602 case 6:
11603 {
11604 float fValue;
11605 float (* Set)(float) = (void *)prop->Set;
11606
11607 GetFloat(member->initializer->__anon1.exp, &fValue);
11608 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11609 exp->type = 2;
11610 break;
11611 }
11612 case 7:
11613 {
11614 double dValue;
11615 double (* Set)(double) = (void *)prop->Set;
11616
11617 GetDouble(member->initializer->__anon1.exp, &dValue);
11618 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11619 exp->type = 2;
11620 break;
11621 }
11622 }
11623 }
11624 }
11625 }
11626 else if(!deepMember && type && _class->type == 2)
11627 {
11628 if(prop)
11629 {
11630 if(value->type == 1 && value->__anon1.instance->data)
11631 {
11632 unsigned int (* Set)(void *) = (void *)prop->Set;
11633
11634 bits = Set(value->__anon1.instance->data);
11635 }
11636 else if(value->type == 2)
11637 {
11638 }
11639 }
11640 else if(dataMember)
11641 {
11642 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11643 struct Type * type;
11644 uint64 part;
11645
11646 bits = (bits & ~bitMember->mask);
11647 if(!bitMember->dataType)
11648 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11649 type = bitMember->dataType;
11650 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11651 {
11652 if(!type->__anon1._class->__anon1.registered->dataType)
11653 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
11654 type = type->__anon1._class->__anon1.registered->dataType;
11655 }
11656 switch(type->kind)
11657 {
11658 case 24:
11659 case 1:
11660 {
11661 unsigned char v;
11662
11663 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11664 part = (uint64)v;
11665 break;
11666 }
11667 case 2:
11668 {
11669 unsigned short v;
11670
11671 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11672 part = (uint64)v;
11673 break;
11674 }
11675 case 3:
11676 case 5:
11677 {
11678 unsigned int v;
11679
11680 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11681 part = (uint64)v;
11682 break;
11683 }
11684 case 4:
11685 {
11686 uint64 v;
11687
11688 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11689 part = v;
11690 break;
11691 }
11692 case 22:
11693 {
11694 uintptr_t v;
11695
11696 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11697 part = (uint64)v;
11698 break;
11699 }
11700 case 23:
11701 {
11702 size_t v;
11703
11704 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11705 part = (uint64)v;
11706 break;
11707 }
11708 }
11709 bits |= part << bitMember->pos;
11710 }
11711 }
11712 }
11713 else
11714 {
11715 if(_class && _class->type == 3)
11716 {
11717 ComputeExpression(member->initializer->__anon1.exp);
11718 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11719 exp->type = 2;
11720 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11721 }
11722 }
11723 }
11724 }
11725 break;
11726 }
11727 }
11728 }
11729 }
11730 if(_class && _class->type == 2)
11731 {
11732 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11733 exp->type = 2;
11734 }
11735 if(exp->type != 1)
11736 {
11737 FreeInstance(inst);
11738 }
11739 }
11740
11741 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11742 {
11743 unsigned int result = 0x0;
11744
11745 switch(kind)
11746 {
11747 case 2:
11748 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11749 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11750 break;
11751 case 3:
11752 case 5:
11753 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11754 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11755 break;
11756 case 4:
11757 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)
11758 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11759 break;
11760 case 6:
11761 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)
11762 result = GetOpFloat(op, &op->__anon1.f);
11763 break;
11764 case 7:
11765 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)
11766 result = GetOpDouble(op, &op->__anon1.d);
11767 break;
11768 case 13:
11769 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)
11770 result = GetOpUIntPtr(op, &op->__anon1.ui64);
11771 break;
11772 case 15:
11773 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)
11774 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11775 break;
11776 case 22:
11777 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11778 result = isSigned ? GetOpIntPtr(op, &op->__anon1.i64) : GetOpUIntPtr(op, &op->__anon1.i64);
11779 break;
11780 case 23:
11781 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11782 result = isSigned ? GetOpIntSize(op, &op->__anon1.ui64) : GetOpUIntSize(op, &op->__anon1.ui64);
11783 break;
11784 }
11785 return result;
11786 }
11787
11788 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11789 {
11790 if(exp->__anon1.op.op == SIZEOF)
11791 {
11792 FreeExpContents(exp);
11793 exp->type = 2;
11794 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11795 }
11796 else
11797 {
11798 if(!exp->__anon1.op.exp1)
11799 {
11800 switch(exp->__anon1.op.op)
11801 {
11802 case '+':
11803 {
11804 struct Expression * exp2 = exp->__anon1.op.exp2;
11805
11806 exp->__anon1.op.exp2 = (((void *)0));
11807 FreeExpContents(exp);
11808 FreeType(exp->expType);
11809 FreeType(exp->destType);
11810 *exp = *exp2;
11811 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11812 break;
11813 }
11814 case '-':
11815 if(op1->ops.Neg)
11816 {
11817 FreeExpContents(exp);
11818 op1->ops.Neg(exp, op1);
11819 }
11820 break;
11821 case '~':
11822 if(op1->ops.BitNot)
11823 {
11824 FreeExpContents(exp);
11825 op1->ops.BitNot(exp, op1);
11826 }
11827 break;
11828 case '!':
11829 if(op1->ops.Not)
11830 {
11831 FreeExpContents(exp);
11832 op1->ops.Not(exp, op1);
11833 }
11834 break;
11835 }
11836 }
11837 else
11838 {
11839 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11840 {
11841 if(Promote(op2, op1->kind, op1->type->isSigned))
11842 op2->kind = op1->kind, op2->ops = op1->ops;
11843 else if(Promote(op1, op2->kind, op2->type->isSigned))
11844 op1->kind = op2->kind, op1->ops = op2->ops;
11845 }
11846 switch(exp->__anon1.op.op)
11847 {
11848 case '+':
11849 if(op1->ops.Add)
11850 {
11851 FreeExpContents(exp);
11852 op1->ops.Add(exp, op1, op2);
11853 }
11854 break;
11855 case '-':
11856 if(op1->ops.Sub)
11857 {
11858 FreeExpContents(exp);
11859 op1->ops.Sub(exp, op1, op2);
11860 }
11861 break;
11862 case '*':
11863 if(op1->ops.Mul)
11864 {
11865 FreeExpContents(exp);
11866 op1->ops.Mul(exp, op1, op2);
11867 }
11868 break;
11869 case '/':
11870 if(op1->ops.Div)
11871 {
11872 FreeExpContents(exp);
11873 op1->ops.Div(exp, op1, op2);
11874 }
11875 break;
11876 case '%':
11877 if(op1->ops.Mod)
11878 {
11879 FreeExpContents(exp);
11880 op1->ops.Mod(exp, op1, op2);
11881 }
11882 break;
11883 case '&':
11884 if(exp->__anon1.op.exp2)
11885 {
11886 if(op1->ops.BitAnd)
11887 {
11888 FreeExpContents(exp);
11889 op1->ops.BitAnd(exp, op1, op2);
11890 }
11891 }
11892 break;
11893 case '|':
11894 if(op1->ops.BitOr)
11895 {
11896 FreeExpContents(exp);
11897 op1->ops.BitOr(exp, op1, op2);
11898 }
11899 break;
11900 case '^':
11901 if(op1->ops.BitXor)
11902 {
11903 FreeExpContents(exp);
11904 op1->ops.BitXor(exp, op1, op2);
11905 }
11906 break;
11907 case LEFT_OP:
11908 if(op1->ops.LShift)
11909 {
11910 FreeExpContents(exp);
11911 op1->ops.LShift(exp, op1, op2);
11912 }
11913 break;
11914 case RIGHT_OP:
11915 if(op1->ops.RShift)
11916 {
11917 FreeExpContents(exp);
11918 op1->ops.RShift(exp, op1, op2);
11919 }
11920 break;
11921 case EQ_OP:
11922 if(op1->ops.Equ)
11923 {
11924 FreeExpContents(exp);
11925 op1->ops.Equ(exp, op1, op2);
11926 }
11927 break;
11928 case NE_OP:
11929 if(op1->ops.Nqu)
11930 {
11931 FreeExpContents(exp);
11932 op1->ops.Nqu(exp, op1, op2);
11933 }
11934 break;
11935 case AND_OP:
11936 if(op1->ops.And)
11937 {
11938 FreeExpContents(exp);
11939 op1->ops.And(exp, op1, op2);
11940 }
11941 break;
11942 case OR_OP:
11943 if(op1->ops.Or)
11944 {
11945 FreeExpContents(exp);
11946 op1->ops.Or(exp, op1, op2);
11947 }
11948 break;
11949 case '>':
11950 if(op1->ops.Grt)
11951 {
11952 FreeExpContents(exp);
11953 op1->ops.Grt(exp, op1, op2);
11954 }
11955 break;
11956 case '<':
11957 if(op1->ops.Sma)
11958 {
11959 FreeExpContents(exp);
11960 op1->ops.Sma(exp, op1, op2);
11961 }
11962 break;
11963 case GE_OP:
11964 if(op1->ops.GrtEqu)
11965 {
11966 FreeExpContents(exp);
11967 op1->ops.GrtEqu(exp, op1, op2);
11968 }
11969 break;
11970 case LE_OP:
11971 if(op1->ops.SmaEqu)
11972 {
11973 FreeExpContents(exp);
11974 op1->ops.SmaEqu(exp, op1, op2);
11975 }
11976 break;
11977 }
11978 }
11979 }
11980 }
11981
11982 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11983
11984 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11985
11986 void ComputeExpression(struct Expression * exp)
11987 {
11988 char expString[10240];
11989
11990 expString[0] = '\0';
11991 switch(exp->type)
11992 {
11993 case 1:
11994 {
11995 ComputeInstantiation(exp);
11996 break;
11997 }
11998 case 4:
11999 {
12000 struct Expression * exp1, * exp2 = (((void *)0));
12001 struct Operand op1 =
12002 {
12003 0, 0, 0,
12004 .__anon1 = {
12005 .c = 0
12006 },
12007 {
12008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12009 }
12010 };
12011 struct Operand op2 =
12012 {
12013 0, 0, 0,
12014 .__anon1 = {
12015 .c = 0
12016 },
12017 {
12018 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12019 }
12020 };
12021
12022 if(exp->__anon1.op.exp2)
12023 {
12024 struct Expression * e = exp->__anon1.op.exp2;
12025
12026 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12027 {
12028 if(e->type == 5 || e->type == 32 || e->type == 23)
12029 {
12030 if(e->type == 23)
12031 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12032 else
12033 e = (*e->__anon1.list).last;
12034 }
12035 }
12036 if(exp->__anon1.op.op == 261 && e && e->expType)
12037 {
12038 if(e->type == 3 && e->__anon1.__anon2.string)
12039 {
12040 char * string = e->__anon1.__anon2.string;
12041 int len = strlen(string);
12042 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12043
12044 len = UnescapeString(tmp, string + 1, len - 2);
12045 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12046 FreeExpContents(exp);
12047 exp->type = 2;
12048 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12049 }
12050 else
12051 {
12052 struct Type * type = e->expType;
12053
12054 type->refCount++;
12055 FreeExpContents(exp);
12056 exp->type = 2;
12057 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12058 FreeType(type);
12059 }
12060 break;
12061 }
12062 else
12063 ComputeExpression(exp->__anon1.op.exp2);
12064 }
12065 if(exp->__anon1.op.exp1)
12066 {
12067 ComputeExpression(exp->__anon1.op.exp1);
12068 exp1 = exp->__anon1.op.exp1;
12069 exp2 = exp->__anon1.op.exp2;
12070 op1 = GetOperand(exp1);
12071 if(op1.type)
12072 op1.type->refCount++;
12073 if(exp2)
12074 {
12075 op2 = GetOperand(exp2);
12076 if(op2.type)
12077 op2.type->refCount++;
12078 }
12079 }
12080 else
12081 {
12082 exp1 = exp->__anon1.op.exp2;
12083 op1 = GetOperand(exp1);
12084 if(op1.type)
12085 op1.type->refCount++;
12086 }
12087 CallOperator(exp, exp1, exp2, &op1, &op2);
12088 if(op1.type)
12089 FreeType(op1.type);
12090 if(op2.type)
12091 FreeType(op2.type);
12092 break;
12093 }
12094 case 5:
12095 case 32:
12096 {
12097 struct Expression * e, * n;
12098
12099 for(e = (*exp->__anon1.list).first; e; e = n)
12100 {
12101 n = e->next;
12102 if(!n)
12103 {
12104 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12105 struct Expression * prev = exp->prev;
12106 struct Expression * next = exp->next;
12107
12108 ComputeExpression(e);
12109 FreeType(exp->expType);
12110 FreeType(exp->destType);
12111 *exp = *e;
12112 exp->prev = prev;
12113 exp->next = next;
12114 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12115 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12116 }
12117 else
12118 {
12119 FreeExpression(e);
12120 }
12121 }
12122 break;
12123 }
12124 case 8:
12125 {
12126 struct Expression * memberExp = exp->__anon1.member.exp;
12127 struct Identifier * memberID = exp->__anon1.member.member;
12128 struct Type * type;
12129
12130 ComputeExpression(exp->__anon1.member.exp);
12131 type = exp->__anon1.member.exp->expType;
12132 if(type)
12133 {
12134 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)));
12135 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12136 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12137 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12138
12139 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12140 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12141 if(!_class)
12142 {
12143 char string[256];
12144 struct Symbol * classSym;
12145
12146 string[0] = '\0';
12147 PrintTypeNoConst(type, string, 0x0, 0x1);
12148 classSym = FindClass(string);
12149 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12150 }
12151 if(exp->__anon1.member.member)
12152 {
12153 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12154 if(!prop)
12155 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12156 }
12157 if(!prop && !member && _class && exp->__anon1.member.member)
12158 {
12159 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12160
12161 convertTo = _class;
12162 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12163 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12164 }
12165 if(prop)
12166 {
12167 if(prop->compiled)
12168 {
12169 struct Type * type = prop->dataType;
12170
12171 if(_class->type == 3)
12172 {
12173 if(type->kind == 8)
12174 {
12175 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12176
12177 if(_class->type == 3)
12178 {
12179 if(!_class->dataType)
12180 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12181 type = _class->dataType;
12182 }
12183 }
12184 switch(type->kind)
12185 {
12186 case 6:
12187 {
12188 float value;
12189 float (* Get)(float) = (void *)prop->Get;
12190
12191 GetFloat(exp->__anon1.member.exp, &value);
12192 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12193 exp->type = 2;
12194 break;
12195 }
12196 case 7:
12197 {
12198 double value;
12199 double (* Get)(double);
12200
12201 GetDouble(exp->__anon1.member.exp, &value);
12202 if(convertTo)
12203 Get = (void *)prop->Set;
12204 else
12205 Get = (void *)prop->Get;
12206 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12207 exp->type = 2;
12208 break;
12209 }
12210 }
12211 }
12212 else
12213 {
12214 if(convertTo)
12215 {
12216 struct Expression * value = exp->__anon1.member.exp;
12217 struct Type * type;
12218
12219 if(!prop->dataType)
12220 ProcessPropertyType(prop);
12221 type = prop->dataType;
12222 if(!type)
12223 {
12224 }
12225 else if(_class->type == 1)
12226 {
12227 switch(type->kind)
12228 {
12229 case 8:
12230 {
12231 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12232
12233 if(propertyClass->type == 1 && value->type == 1)
12234 {
12235 void (* Set)(void *, void *) = (void *)prop->Set;
12236
12237 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12238 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12239 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12240 exp->__anon1.instance->loc = exp->loc;
12241 exp->type = 1;
12242 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12243 PopulateInstance(exp->__anon1.instance);
12244 }
12245 break;
12246 }
12247 case 3:
12248 {
12249 int intValue;
12250 void (* Set)(void *, int) = (void *)prop->Set;
12251
12252 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12253 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12254 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12255 exp->__anon1.instance->loc = exp->loc;
12256 exp->type = 1;
12257 GetInt(value, &intValue);
12258 Set(exp->__anon1.instance->data, intValue);
12259 PopulateInstance(exp->__anon1.instance);
12260 break;
12261 }
12262 case 4:
12263 {
12264 long long intValue;
12265 void (* Set)(void *, long long) = (void *)prop->Set;
12266
12267 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12268 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12269 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12270 exp->__anon1.instance->loc = exp->loc;
12271 exp->type = 1;
12272 GetInt64(value, &intValue);
12273 Set(exp->__anon1.instance->data, intValue);
12274 PopulateInstance(exp->__anon1.instance);
12275 break;
12276 }
12277 case 22:
12278 {
12279 intptr_t intValue;
12280 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12281
12282 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12283 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12284 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12285 exp->__anon1.instance->loc = exp->loc;
12286 exp->type = 1;
12287 GetIntPtr(value, &intValue);
12288 Set(exp->__anon1.instance->data, intValue);
12289 PopulateInstance(exp->__anon1.instance);
12290 break;
12291 }
12292 case 23:
12293 {
12294 ssize_t intValue;
12295 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12296
12297 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12298 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12299 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12300 exp->__anon1.instance->loc = exp->loc;
12301 exp->type = 1;
12302 GetIntSize(value, &intValue);
12303 Set(exp->__anon1.instance->data, intValue);
12304 PopulateInstance(exp->__anon1.instance);
12305 break;
12306 }
12307 case 6:
12308 {
12309 float floatValue;
12310 void (* Set)(void *, float) = (void *)prop->Set;
12311
12312 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12313 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12314 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12315 exp->__anon1.instance->loc = exp->loc;
12316 exp->type = 1;
12317 GetFloat(value, &floatValue);
12318 Set(exp->__anon1.instance->data, floatValue);
12319 PopulateInstance(exp->__anon1.instance);
12320 break;
12321 }
12322 case 7:
12323 {
12324 double doubleValue;
12325 void (* Set)(void *, double) = (void *)prop->Set;
12326
12327 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12328 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12329 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12330 exp->__anon1.instance->loc = exp->loc;
12331 exp->type = 1;
12332 GetDouble(value, &doubleValue);
12333 Set(exp->__anon1.instance->data, doubleValue);
12334 PopulateInstance(exp->__anon1.instance);
12335 break;
12336 }
12337 }
12338 }
12339 else if(_class->type == 2)
12340 {
12341 switch(type->kind)
12342 {
12343 case 8:
12344 {
12345 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12346
12347 if(propertyClass->type == 1 && value->__anon1.instance->data)
12348 {
12349 unsigned int (* Set)(void *) = (void *)prop->Set;
12350 unsigned int bits = Set(value->__anon1.instance->data);
12351
12352 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12353 exp->type = 2;
12354 break;
12355 }
12356 else if(_class->type == 2)
12357 {
12358 unsigned int value;
12359 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12360 unsigned int bits;
12361
12362 GetUInt(exp->__anon1.member.exp, &value);
12363 bits = Set(value);
12364 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12365 exp->type = 2;
12366 }
12367 }
12368 }
12369 }
12370 }
12371 else
12372 {
12373 if(_class->type == 2)
12374 {
12375 unsigned int value;
12376
12377 GetUInt(exp->__anon1.member.exp, &value);
12378 switch(type->kind)
12379 {
12380 case 8:
12381 {
12382 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12383
12384 if(_class->type == 1)
12385 {
12386 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12387
12388 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12389 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12390 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12391 exp->__anon1.instance->loc = exp->loc;
12392 exp->type = 1;
12393 Get(value, exp->__anon1.instance->data);
12394 PopulateInstance(exp->__anon1.instance);
12395 }
12396 else if(_class->type == 2)
12397 {
12398 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12399 uint64 bits = Get(value);
12400
12401 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12402 exp->type = 2;
12403 }
12404 break;
12405 }
12406 }
12407 }
12408 else if(_class->type == 1)
12409 {
12410 char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12411
12412 switch(type->kind)
12413 {
12414 case 8:
12415 {
12416 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12417
12418 if(_class->type == 1 && value)
12419 {
12420 void (* Get)(void *, void *) = (void *)prop->Get;
12421
12422 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12423 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12424 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12425 exp->__anon1.instance->loc = exp->loc;
12426 exp->type = 1;
12427 Get(value, exp->__anon1.instance->data);
12428 PopulateInstance(exp->__anon1.instance);
12429 }
12430 break;
12431 }
12432 }
12433 }
12434 }
12435 }
12436 }
12437 else
12438 {
12439 exp->isConstant = 0x0;
12440 }
12441 }
12442 else if(member)
12443 {
12444 }
12445 }
12446 if(exp->type != 8)
12447 {
12448 FreeExpression(memberExp);
12449 FreeIdentifier(memberID);
12450 }
12451 break;
12452 }
12453 case 10:
12454 {
12455 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12456
12457 FreeExpContents(exp);
12458 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12459 exp->type = 2;
12460 FreeType(type);
12461 break;
12462 }
12463 case 15:
12464 {
12465 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12466
12467 if(classSym && classSym->__anon1.registered)
12468 {
12469 if(classSym->__anon1.registered->fixed)
12470 {
12471 FreeSpecifier(exp->__anon1._class);
12472 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12473 exp->type = 2;
12474 }
12475 else
12476 {
12477 char className[1024];
12478
12479 strcpy(className, "__ecereClass_");
12480 FullClassNameCat(className, classSym->string, 0x1);
12481 MangleClassName(className);
12482 DeclareClass(classSym, className);
12483 FreeExpContents(exp);
12484 exp->type = 9;
12485 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12486 exp->__anon1.member.member = MkIdentifier("structSize");
12487 }
12488 }
12489 break;
12490 }
12491 case 11:
12492 {
12493 struct Type * type;
12494 struct Expression * e = exp;
12495
12496 if(exp->type == 11)
12497 {
12498 if(exp->__anon1.cast.exp)
12499 ComputeExpression(exp->__anon1.cast.exp);
12500 e = exp->__anon1.cast.exp;
12501 }
12502 if(e && exp->expType)
12503 {
12504 type = exp->expType;
12505 if(type->kind == 8)
12506 {
12507 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12508
12509 if(_class && (_class->type == 3 || _class->type == 2))
12510 {
12511 if(!_class->dataType)
12512 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12513 type = _class->dataType;
12514 }
12515 }
12516 switch(type->kind)
12517 {
12518 case 24:
12519 case 1:
12520 if(type->isSigned)
12521 {
12522 char value = (char)0;
12523
12524 if(GetChar(e, &value))
12525 {
12526 FreeExpContents(exp);
12527 exp->__anon1.__anon1.constant = PrintChar(value);
12528 exp->type = 2;
12529 }
12530 }
12531 else
12532 {
12533 unsigned char value = (unsigned char)0;
12534
12535 if(GetUChar(e, &value))
12536 {
12537 FreeExpContents(exp);
12538 exp->__anon1.__anon1.constant = PrintUChar(value);
12539 exp->type = 2;
12540 }
12541 }
12542 break;
12543 case 2:
12544 if(type->isSigned)
12545 {
12546 short value = (short)0;
12547
12548 if(GetShort(e, &value))
12549 {
12550 FreeExpContents(exp);
12551 exp->__anon1.__anon1.constant = PrintShort(value);
12552 exp->type = 2;
12553 }
12554 }
12555 else
12556 {
12557 unsigned short value = (unsigned short)0;
12558
12559 if(GetUShort(e, &value))
12560 {
12561 FreeExpContents(exp);
12562 exp->__anon1.__anon1.constant = PrintUShort(value);
12563 exp->type = 2;
12564 }
12565 }
12566 break;
12567 case 3:
12568 if(type->isSigned)
12569 {
12570 int value = 0;
12571
12572 if(GetInt(e, &value))
12573 {
12574 FreeExpContents(exp);
12575 exp->__anon1.__anon1.constant = PrintInt(value);
12576 exp->type = 2;
12577 }
12578 }
12579 else
12580 {
12581 unsigned int value = 0;
12582
12583 if(GetUInt(e, &value))
12584 {
12585 FreeExpContents(exp);
12586 exp->__anon1.__anon1.constant = PrintUInt(value);
12587 exp->type = 2;
12588 }
12589 }
12590 break;
12591 case 4:
12592 if(type->isSigned)
12593 {
12594 long long value = 0;
12595
12596 if(GetInt64(e, &value))
12597 {
12598 FreeExpContents(exp);
12599 exp->__anon1.__anon1.constant = PrintInt64(value);
12600 exp->type = 2;
12601 }
12602 }
12603 else
12604 {
12605 uint64 value = 0;
12606
12607 if(GetUInt64(e, &value))
12608 {
12609 FreeExpContents(exp);
12610 exp->__anon1.__anon1.constant = PrintUInt64(value);
12611 exp->type = 2;
12612 }
12613 }
12614 break;
12615 case 22:
12616 if(type->isSigned)
12617 {
12618 intptr_t value = 0;
12619
12620 if(GetIntPtr(e, &value))
12621 {
12622 FreeExpContents(exp);
12623 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12624 exp->type = 2;
12625 }
12626 }
12627 else
12628 {
12629 uintptr_t value = 0;
12630
12631 if(GetUIntPtr(e, &value))
12632 {
12633 FreeExpContents(exp);
12634 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12635 exp->type = 2;
12636 }
12637 }
12638 break;
12639 case 23:
12640 if(type->isSigned)
12641 {
12642 ssize_t value = 0;
12643
12644 if(GetIntSize(e, &value))
12645 {
12646 FreeExpContents(exp);
12647 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12648 exp->type = 2;
12649 }
12650 }
12651 else
12652 {
12653 size_t value = 0;
12654
12655 if(GetUIntSize(e, &value))
12656 {
12657 FreeExpContents(exp);
12658 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12659 exp->type = 2;
12660 }
12661 }
12662 break;
12663 case 6:
12664 {
12665 float value = 0;
12666
12667 if(GetFloat(e, &value))
12668 {
12669 FreeExpContents(exp);
12670 exp->__anon1.__anon1.constant = PrintFloat(value);
12671 exp->type = 2;
12672 }
12673 break;
12674 }
12675 case 7:
12676 {
12677 double value = 0;
12678
12679 if(GetDouble(e, &value))
12680 {
12681 FreeExpContents(exp);
12682 exp->__anon1.__anon1.constant = PrintDouble(value);
12683 exp->type = 2;
12684 }
12685 break;
12686 }
12687 }
12688 }
12689 break;
12690 }
12691 case 12:
12692 {
12693 struct Operand op1 =
12694 {
12695 0, 0, 0,
12696 .__anon1 = {
12697 .c = 0
12698 },
12699 {
12700 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12701 }
12702 };
12703 struct Operand op2 =
12704 {
12705 0, 0, 0,
12706 .__anon1 = {
12707 .c = 0
12708 },
12709 {
12710 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12711 }
12712 };
12713 struct Operand op3 =
12714 {
12715 0, 0, 0,
12716 .__anon1 = {
12717 .c = 0
12718 },
12719 {
12720 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12721 }
12722 };
12723
12724 if(exp->__anon1.cond.exp)
12725 ComputeExpression((*exp->__anon1.cond.exp).last);
12726 if(exp->__anon1.cond.elseExp)
12727 ComputeExpression(exp->__anon1.cond.elseExp);
12728 if(exp->__anon1.cond.cond)
12729 ComputeExpression(exp->__anon1.cond.cond);
12730 op1 = GetOperand(exp->__anon1.cond.cond);
12731 if(op1.type)
12732 op1.type->refCount++;
12733 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12734 if(op2.type)
12735 op2.type->refCount++;
12736 op3 = GetOperand(exp->__anon1.cond.elseExp);
12737 if(op3.type)
12738 op3.type->refCount++;
12739 if(op1.ops.Cond)
12740 {
12741 FreeExpContents(exp);
12742 op1.ops.Cond(exp, &op1, &op2, &op3);
12743 }
12744 if(op1.type)
12745 FreeType(op1.type);
12746 if(op2.type)
12747 FreeType(op2.type);
12748 if(op3.type)
12749 FreeType(op3.type);
12750 break;
12751 }
12752 }
12753 }
12754
12755 void ApplyAnyObjectLogic(struct Expression * e);
12756
12757 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12758 {
12759 unsigned int result = 0x1;
12760
12761 if(destType)
12762 {
12763 struct __ecereNameSpace__ecere__sys__OldList converts =
12764 {
12765 0, 0, 0, 0, 0
12766 };
12767 struct Conversion * convert;
12768
12769 if(destType->kind == 0)
12770 return 0x0;
12771 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12772 result = 0x0;
12773 if(converts.count)
12774 {
12775 for(convert = converts.first; convert; convert = convert->next)
12776 {
12777 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12778
12779 if(!empty)
12780 {
12781 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12782 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12783
12784 *newExp = *exp;
12785 newExp->prev = (((void *)0));
12786 newExp->next = (((void *)0));
12787 newExp->destType = (((void *)0));
12788 if(convert->isGet)
12789 {
12790 exp->type = 8;
12791 exp->addedThis = 0x1;
12792 exp->__anon1.member.exp = newExp;
12793 FreeType(exp->__anon1.member.exp->expType);
12794 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12795 exp->__anon1.member.exp->expType->classObjectType = objectType;
12796 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12797 exp->__anon1.member.memberType = 1;
12798 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12799 exp->needCast = 0x1;
12800 if(exp->expType)
12801 exp->expType->refCount++;
12802 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12803 }
12804 else
12805 {
12806 {
12807 exp->type = 8;
12808 exp->addedThis = 0x1;
12809 exp->__anon1.member.exp = newExp;
12810 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)
12811 {
12812 newExp->byReference = 0x1;
12813 }
12814 FreeType(exp->__anon1.member.exp->expType);
12815 exp->__anon1.member.exp->expType = (((void *)0));
12816 if(convert->convert->dataType)
12817 {
12818 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12819 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12820 exp->__anon1.member.exp->expType->refCount = 1;
12821 exp->__anon1.member.exp->expType->classObjectType = objectType;
12822 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12823 }
12824 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12825 exp->__anon1.member.memberType = 4;
12826 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12827 exp->needCast = 0x1;
12828 if(convert->resultType)
12829 convert->resultType->refCount++;
12830 }
12831 }
12832 }
12833 else
12834 {
12835 FreeType(exp->expType);
12836 if(convert->isGet)
12837 {
12838 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12839 exp->needCast = 0x1;
12840 if(exp->expType)
12841 exp->expType->refCount++;
12842 }
12843 else
12844 {
12845 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12846 exp->needCast = 0x1;
12847 if(convert->resultType)
12848 convert->resultType->refCount++;
12849 }
12850 }
12851 }
12852 if(exp->isConstant && inCompiler)
12853 ComputeExpression(exp);
12854 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12855 }
12856 if(!result && exp->expType && converts.count)
12857 {
12858 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
12859 }
12860 if(!result && exp->expType && exp->destType)
12861 {
12862 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))
12863 result = 0x1;
12864 }
12865 }
12866 return result;
12867 }
12868
12869 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12870
12871 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12872
12873 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12874
12875 void CheckTemplateTypes(struct Expression * exp)
12876 {
12877 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12878 {
12879 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12880 struct Context * context;
12881
12882 *newExp = *exp;
12883 if(exp->destType)
12884 exp->destType->refCount++;
12885 if(exp->expType)
12886 exp->expType->refCount++;
12887 newExp->prev = (((void *)0));
12888 newExp->next = (((void *)0));
12889 switch(exp->expType->kind)
12890 {
12891 case 7:
12892 if(exp->destType->classObjectType)
12893 {
12894 if(exp->destType)
12895 exp->destType->refCount--;
12896 if(exp->expType)
12897 exp->expType->refCount--;
12898 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12899 }
12900 else
12901 {
12902 struct __ecereNameSpace__ecere__sys__OldList * specs;
12903 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12904 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12905
12906 context = PushContext();
12907 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12908 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12909 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12910 exp->type = 23;
12911 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12912 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12913 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12914 exp->__anon1.compound->__anon1.compound.context = context;
12915 PopContext(context);
12916 }
12917 break;
12918 default:
12919 exp->type = 11;
12920 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12921 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12922 break;
12923 }
12924 }
12925 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12926 {
12927 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12928 struct Statement * compound;
12929 struct Context * context;
12930
12931 *newExp = *exp;
12932 if(exp->destType)
12933 exp->destType->refCount++;
12934 if(exp->expType)
12935 exp->expType->refCount++;
12936 newExp->prev = (((void *)0));
12937 newExp->next = (((void *)0));
12938 switch(exp->expType->kind)
12939 {
12940 case 7:
12941 if(exp->destType->classObjectType)
12942 {
12943 if(exp->destType)
12944 exp->destType->refCount--;
12945 if(exp->expType)
12946 exp->expType->refCount--;
12947 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12948 }
12949 else
12950 {
12951 struct __ecereNameSpace__ecere__sys__OldList * specs;
12952 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12953 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12954
12955 context = PushContext();
12956 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12957 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12958 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12959 exp->type = 23;
12960 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12961 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12962 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12963 exp->__anon1.compound->__anon1.compound.context = context;
12964 PopContext(context);
12965 }
12966 break;
12967 case 8:
12968 {
12969 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12970 {
12971 exp->type = 5;
12972 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)));
12973 ProcessExpressionType((*exp->__anon1.list).first);
12974 break;
12975 }
12976 else
12977 {
12978 exp->type = 5;
12979 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12980 newExp->needCast = 0x1;
12981 ProcessExpressionType((*exp->__anon1.list).first);
12982 break;
12983 }
12984 }
12985 default:
12986 {
12987 if(exp->expType->kind == 20)
12988 {
12989 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
12990
12991 if(type)
12992 {
12993 FreeType(exp->destType);
12994 FreeType(exp->expType);
12995 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12996 break;
12997 }
12998 }
12999 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13000 {
13001 exp->type = 4;
13002 exp->__anon1.op.op = '*';
13003 exp->__anon1.op.exp1 = (((void *)0));
13004 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13005 }
13006 else
13007 {
13008 char typeString[1024];
13009 struct Declarator * decl;
13010 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13011
13012 typeString[0] = '\0';
13013 PrintType(exp->expType, typeString, 0x0, 0x0);
13014 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13015 exp->type = 11;
13016 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13017 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13018 exp->__anon1.cast.exp->needCast = 0x1;
13019 }
13020 break;
13021 }
13022 }
13023 }
13024 }
13025
13026 extern int strncmp(const char * , const char * , size_t n);
13027
13028 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13029
13030 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13031 {
13032 int nsLen = strlen(nameSpace);
13033 struct Symbol * symbol;
13034
13035 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)))
13036 {
13037 char * s = symbol->string;
13038
13039 if(!strncmp(s, nameSpace, nsLen))
13040 {
13041 int c;
13042 char * namePart;
13043
13044 for(c = strlen(s) - 1; c >= 0; c--)
13045 if(s[c] == ':')
13046 break;
13047 namePart = s + c + 1;
13048 if(!strcmp(namePart, name))
13049 {
13050 return symbol;
13051 }
13052 }
13053 else
13054 break;
13055 }
13056 return (((void *)0));
13057 }
13058
13059 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13060 {
13061 int c;
13062 char nameSpace[1024];
13063 const char * namePart;
13064 unsigned int gotColon = 0x0;
13065
13066 nameSpace[0] = '\0';
13067 for(c = strlen(name) - 1; c >= 0; c--)
13068 if(name[c] == ':')
13069 {
13070 gotColon = 0x1;
13071 break;
13072 }
13073 namePart = name + c + 1;
13074 while(c >= 0 && name[c] == ':')
13075 c--;
13076 if(c >= 0)
13077 {
13078 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13079
13080 if(symbol)
13081 return symbol;
13082 memcpy(nameSpace, name, c + 1);
13083 nameSpace[c + 1] = (char)0;
13084 return ScanWithNameSpace(tree, nameSpace, namePart);
13085 }
13086 else if(gotColon)
13087 {
13088 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13089
13090 return symbol;
13091 }
13092 else
13093 {
13094 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13095
13096 if(symbol)
13097 return symbol;
13098 return ScanWithNameSpace(tree, "", namePart);
13099 }
13100 return (((void *)0));
13101 }
13102
13103 static void ProcessDeclaration(struct Declaration * decl);
13104
13105 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13106 {
13107 struct Context * ctx;
13108 struct Symbol * symbol = (((void *)0));
13109
13110 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13111 {
13112 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13113 {
13114 symbol = (((void *)0));
13115 if(thisNameSpace)
13116 {
13117 char curName[1024];
13118
13119 strcpy(curName, thisNameSpace);
13120 strcat(curName, "::");
13121 strcat(curName, name);
13122 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13123 }
13124 if(!symbol)
13125 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13126 }
13127 else
13128 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13129 if(symbol || ctx == endContext)
13130 break;
13131 }
13132 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13133 {
13134 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13135 {
13136 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13137 struct Context * tmpContext = curContext;
13138
13139 curContext = (((void *)0));
13140 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13141 curContext = tmpContext;
13142 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13143 DeclareType(symbol->type, 0x1, 0x1);
13144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13145 symbol->id = curExternal->symbol->idCode;
13146 }
13147 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13148 {
13149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13150 symbol->id = curExternal->symbol->idCode;
13151 }
13152 }
13153 return symbol;
13154 }
13155
13156 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13157 {
13158 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13159 ListAdd(specs, MkSpecifier(UNSIGNED));
13160 switch(type->kind)
13161 {
13162 case 8:
13163 {
13164 if(type->__anon1._class->__anon1.registered)
13165 {
13166 if(!type->__anon1._class->__anon1.registered->dataType)
13167 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0x0);
13168 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13169 }
13170 break;
13171 }
13172 case 7:
13173 ListAdd(specs, MkSpecifier(DOUBLE));
13174 break;
13175 case 6:
13176 ListAdd(specs, MkSpecifier(FLOAT));
13177 break;
13178 case 1:
13179 ListAdd(specs, MkSpecifier(CHAR));
13180 break;
13181 case 24:
13182 ListAdd(specs, MkSpecifier(_BOOL));
13183 break;
13184 case 2:
13185 ListAdd(specs, MkSpecifier(SHORT));
13186 break;
13187 case 4:
13188 ListAdd(specs, MkSpecifier(INT64));
13189 break;
13190 case 22:
13191 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13192 break;
13193 case 23:
13194 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13195 break;
13196 case 3:
13197 default:
13198 ListAdd(specs, MkSpecifier(INT));
13199 break;
13200 }
13201 }
13202
13203 static void PrintArraySize(struct Type * arrayType, char * string)
13204 {
13205 char size[256];
13206
13207 size[0] = '\0';
13208 strcat(size, "[");
13209 if(arrayType->__anon1.__anon4.enumClass)
13210 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13211 else if(arrayType->__anon1.__anon4.arraySizeExp)
13212 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13213 strcat(size, "]");
13214 strcat(string, size);
13215 }
13216
13217 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13218 {
13219 if(type)
13220 {
13221 if(printConst && type->constant)
13222 strcat(string, "const ");
13223 switch(type->kind)
13224 {
13225 case 8:
13226 {
13227 struct Symbol * c = type->__anon1._class;
13228
13229 if(type->classObjectType == 2)
13230 strcat(string, "typed_object");
13231 else if(type->classObjectType == 3)
13232 strcat(string, "any_object");
13233 else
13234 {
13235 if(c && c->string)
13236 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13237 }
13238 if(type->byReference)
13239 strcat(string, " &");
13240 break;
13241 }
13242 case 0:
13243 strcat(string, "void");
13244 break;
13245 case 3:
13246 strcat(string, type->isSigned ? "int" : "uint");
13247 break;
13248 case 4:
13249 strcat(string, type->isSigned ? "int64" : "uint64");
13250 break;
13251 case 22:
13252 strcat(string, type->isSigned ? "intptr" : "uintptr");
13253 break;
13254 case 23:
13255 strcat(string, type->isSigned ? "intsize" : "uintsize");
13256 break;
13257 case 1:
13258 strcat(string, type->isSigned ? "char" : "byte");
13259 break;
13260 case 24:
13261 strcat(string, "_Bool");
13262 break;
13263 case 2:
13264 strcat(string, type->isSigned ? "short" : "uint16");
13265 break;
13266 case 6:
13267 strcat(string, "float");
13268 break;
13269 case 7:
13270 strcat(string, "double");
13271 break;
13272 case 9:
13273 if(type->__anon1.__anon1.enumName)
13274 {
13275 strcat(string, "struct ");
13276 strcat(string, type->__anon1.__anon1.enumName);
13277 }
13278 else if(type->typeName)
13279 strcat(string, type->typeName);
13280 else
13281 {
13282 struct Type * member;
13283
13284 strcat(string, "struct { ");
13285 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13286 {
13287 PrintType(member, string, 0x1, fullName);
13288 strcat(string, "; ");
13289 }
13290 strcat(string, "}");
13291 }
13292 break;
13293 case 10:
13294 if(type->__anon1.__anon1.enumName)
13295 {
13296 strcat(string, "union ");
13297 strcat(string, type->__anon1.__anon1.enumName);
13298 }
13299 else if(type->typeName)
13300 strcat(string, type->typeName);
13301 else
13302 {
13303 strcat(string, "union ");
13304 strcat(string, "(unnamed)");
13305 }
13306 break;
13307 case 15:
13308 if(type->__anon1.__anon1.enumName)
13309 {
13310 strcat(string, "enum ");
13311 strcat(string, type->__anon1.__anon1.enumName);
13312 }
13313 else if(type->typeName)
13314 strcat(string, type->typeName);
13315 else
13316 strcat(string, "int");
13317 break;
13318 case 14:
13319 strcat(string, "...");
13320 break;
13321 case 19:
13322 strcat(string, "subclass(");
13323 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13324 strcat(string, ")");
13325 break;
13326 case 20:
13327 strcat(string, type->__anon1.templateParameter->identifier->string);
13328 break;
13329 case 21:
13330 strcat(string, "thisclass");
13331 break;
13332 case 17:
13333 strcat(string, "__builtin_va_list");
13334 break;
13335 }
13336 }
13337 }
13338
13339 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13340
13341 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13342 {
13343 if(type->name && type->name[0])
13344 {
13345 if(fullName)
13346 strcat(string, type->name);
13347 else
13348 {
13349 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13350
13351 if(name)
13352 name += 2;
13353 else
13354 name = type->name;
13355 strcat(string, name);
13356 }
13357 }
13358 }
13359
13360 static void PrintAttribs(struct Type * type, char * string)
13361 {
13362 if(type)
13363 {
13364 if(type->dllExport)
13365 strcat(string, "dllexport ");
13366 if(type->attrStdcall)
13367 strcat(string, "stdcall ");
13368 }
13369 }
13370
13371 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13372 {
13373 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13374 {
13375 struct Type * attrType = (((void *)0));
13376
13377 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13378 PrintAttribs(type, string);
13379 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13380 strcat(string, " const");
13381 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13382 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13383 strcat(string, " (");
13384 if(type->kind == 13)
13385 {
13386 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13387 PrintAttribs(type->__anon1.type, string);
13388 }
13389 if(type->kind == 13)
13390 {
13391 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13392 strcat(string, "*");
13393 else
13394 strcat(string, " *");
13395 }
13396 if(printConst && type->constant && type->kind == 13)
13397 strcat(string, " const");
13398 }
13399 else
13400 PrintTypeSpecs(type, string, fullName, printConst);
13401 }
13402
13403 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13404 {
13405 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13406 strcat(string, ")");
13407 if(type->kind == 12)
13408 PrintArraySize(type, string);
13409 else if(type->kind == 11)
13410 {
13411 struct Type * param;
13412
13413 strcat(string, "(");
13414 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13415 {
13416 PrintType(param, string, 0x1, fullName);
13417 if(param->next)
13418 strcat(string, ", ");
13419 }
13420 strcat(string, ")");
13421 }
13422 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13423 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13424 }
13425
13426 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13427 {
13428 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13429 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13430 strcat(string, " ");
13431 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13432 {
13433 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13434
13435 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13436 {
13437 if(type->classObjectType == 1)
13438 strcat(string, "class");
13439 else
13440 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13441 }
13442 else if(_class && _class->string)
13443 {
13444 char * s = _class->string;
13445
13446 if(fullName)
13447 strcat(string, s);
13448 else
13449 {
13450 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13451
13452 if(name)
13453 name += 2;
13454 else
13455 name = s;
13456 strcat(string, name);
13457 }
13458 }
13459 strcat(string, "::");
13460 }
13461 if(printName && type->name)
13462 PrintName(type, string, fullName);
13463 PostPrintType(type, string, fullName);
13464 if(type->bitFieldCount)
13465 {
13466 char count[100];
13467
13468 sprintf(count, ":%d", type->bitFieldCount);
13469 strcat(string, count);
13470 }
13471 }
13472
13473 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13474 {
13475 _PrintType(type, string, printName, fullName, 0x1);
13476 }
13477
13478 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13479 {
13480 _PrintType(type, string, printName, fullName, 0x0);
13481 }
13482
13483 static struct Type * FindMember(struct Type * type, char * string)
13484 {
13485 struct Type * memberType;
13486
13487 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13488 {
13489 if(!memberType->name)
13490 {
13491 struct Type * subType = FindMember(memberType, string);
13492
13493 if(subType)
13494 return subType;
13495 }
13496 else if(!strcmp(memberType->name, string))
13497 return memberType;
13498 }
13499 return (((void *)0));
13500 }
13501
13502 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13503 {
13504 struct Type * memberType;
13505
13506 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13507 {
13508 if(!memberType->name)
13509 {
13510 struct Type * subType = FindMember(memberType, string);
13511
13512 if(subType)
13513 {
13514 *offset += memberType->offset;
13515 return subType;
13516 }
13517 }
13518 else if(!strcmp(memberType->name, string))
13519 {
13520 *offset += memberType->offset;
13521 return memberType;
13522 }
13523 }
13524 return (((void *)0));
13525 }
13526
13527 extern unsigned int parseError;
13528
13529 unsigned int GetParseError()
13530 {
13531 return parseError;
13532 }
13533
13534 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13535
13536 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13537
13538 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13539
13540 struct Expression * ParseExpressionString(char * expression)
13541 {
13542 parseError = 0x0;
13543 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13544 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13545 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13546
13547 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13548 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13549 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13550 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13551
13552 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13553 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13554 echoOn = 0x0;
13555 parsedExpression = (((void *)0));
13556 resetScanner();
13557 expression_yyparse();
13558 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13559 return parsedExpression;
13560 }
13561
13562 extern char *  QMkString(const char *  source);
13563
13564 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13565 {
13566 struct Identifier * id = exp->__anon1.__anon1.identifier;
13567 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13568 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13569 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13570 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13571
13572 if(_class && _class->type == 4)
13573 {
13574 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13575 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13576
13577 if(enumClass)
13578 {
13579 struct __ecereNameSpace__ecere__com__Class * baseClass;
13580
13581 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13582 {
13583 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13584
13585 for(value = e->values.first; value; value = value->next)
13586 {
13587 if(!strcmp(value->name, id->string))
13588 break;
13589 }
13590 if(value)
13591 {
13592 char constant[256];
13593
13594 FreeExpContents(exp);
13595 exp->type = 2;
13596 exp->isConstant = 0x1;
13597 if(!strcmp(baseClass->dataTypeString, "int"))
13598 sprintf(constant, "%d", (int)value->data);
13599 else
13600 sprintf(constant, "0x%X", (int)value->data);
13601 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13602 exp->expType = MkClassType(baseClass->fullName);
13603 break;
13604 }
13605 }
13606 }
13607 if(value)
13608 return 0x1;
13609 }
13610 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13611 {
13612 ProcessMethodType(method);
13613 exp->expType = __extension__ ({
13614 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13615
13616 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13617 });
13618 return 0x1;
13619 }
13620 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13621 {
13622 if(!prop->dataType)
13623 ProcessPropertyType(prop);
13624 exp->expType = prop->dataType;
13625 if(prop->dataType)
13626 prop->dataType->refCount++;
13627 return 0x1;
13628 }
13629 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13630 {
13631 if(!member->dataType)
13632 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13633 exp->expType = member->dataType;
13634 if(member->dataType)
13635 member->dataType->refCount++;
13636 return 0x1;
13637 }
13638 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13639 {
13640 if(!classProp->dataType)
13641 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13642 if(classProp->constant)
13643 {
13644 FreeExpContents(exp);
13645 exp->isConstant = 0x1;
13646 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13647 {
13648 exp->type = 3;
13649 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13650 }
13651 else
13652 {
13653 char constant[256];
13654
13655 exp->type = 2;
13656 sprintf(constant, "%d", (int)classProp->Get(_class));
13657 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13658 }
13659 }
13660 else
13661 {
13662 }
13663 exp->expType = classProp->dataType;
13664 if(classProp->dataType)
13665 classProp->dataType->refCount++;
13666 return 0x1;
13667 }
13668 return 0x0;
13669 }
13670
13671 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13672 {
13673 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13674 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13675 struct __ecereNameSpace__ecere__com__NameSpace * child;
13676
13677 if(!data)
13678 {
13679 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)))
13680 {
13681 data = ScanGlobalData(child, name);
13682 if(data)
13683 break;
13684 }
13685 }
13686 return data;
13687 }
13688
13689 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13690
13691 extern char *  strncpy(char * , const char * , size_t n);
13692
13693 static struct GlobalData * FindGlobalData(char * name)
13694 {
13695 int start = 0, c;
13696 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13697
13698 nameSpace = globalData;
13699 for(c = 0; name[c]; c++)
13700 {
13701 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13702 {
13703 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13704 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13705
13706 strncpy(spaceName, name + start, c - start);
13707 spaceName[c - start] = '\0';
13708 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13709 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13710 if(!newSpace)
13711 return (((void *)0));
13712 nameSpace = newSpace;
13713 if(name[c] == ':')
13714 c++;
13715 start = c + 1;
13716 }
13717 }
13718 if(c - start)
13719 {
13720 return ScanGlobalData(nameSpace, name + start);
13721 }
13722 return (((void *)0));
13723 }
13724
13725 static int definedExpStackPos;
13726
13727 static void * definedExpStack[512];
13728
13729 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13730 {
13731 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13732
13733 FreeExpContents(checkedExp);
13734 FreeType(checkedExp->expType);
13735 FreeType(checkedExp->destType);
13736 *checkedExp = *newExp;
13737 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13738 checkedExp->prev = prev;
13739 checkedExp->next = next;
13740 }
13741
13742 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13743
13744 extern int printf(const char * , ...);
13745
13746 void __ecereMethod_Expression_Clear();
13747
13748 void ApplyAnyObjectLogic(struct Expression * e)
13749 {
13750 struct Type * destType = e->destType;
13751
13752 if(destType && (destType->classObjectType == 3))
13753 {
13754 if(e && e->expType)
13755 {
13756 struct Type * type = e->expType;
13757 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13758
13759 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13760 {
13761 _class = type->__anon1._class->__anon1.registered;
13762 }
13763 else if(type->kind == 19)
13764 {
13765 _class = FindClass("ecere::com::Class")->__anon1.registered;
13766 }
13767 else
13768 {
13769 char string[1024] = "";
13770 struct Symbol * classSym;
13771
13772 PrintTypeNoConst(type, string, 0x0, 0x1);
13773 classSym = FindClass(string);
13774 if(classSym)
13775 _class = classSym->__anon1.registered;
13776 }
13777 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)))
13778 {
13779 if(!_class || strcmp(_class->fullName, "char *"))
13780 {
13781 struct Expression * checkedExp = e, * newExp;
13782
13783 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13784 {
13785 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13786 {
13787 if(checkedExp->type == 23)
13788 {
13789 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13790 }
13791 else
13792 checkedExp = (*checkedExp->__anon1.list).last;
13793 }
13794 else if(checkedExp->type == 11)
13795 checkedExp = checkedExp->__anon1.cast.exp;
13796 }
13797 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13798 {
13799 newExp = checkedExp->__anon1.op.exp2;
13800 checkedExp->__anon1.op.exp2 = (((void *)0));
13801 FreeExpContents(checkedExp);
13802 if(e->expType && e->expType->passAsTemplate)
13803 {
13804 char size[100];
13805
13806 ComputeTypeSize(e->expType);
13807 sprintf(size, "%d", e->expType->size);
13808 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))))));
13809 }
13810 ReplaceExpContents(checkedExp, newExp);
13811 e->byReference = 0x1;
13812 }
13813 else if(!e->byReference || (_class && _class->type == 5))
13814 {
13815 struct Expression * checkedExp;
13816
13817 {
13818 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;
13819
13820 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13821 {
13822 struct Context * context = PushContext();
13823 struct Declarator * decl;
13824 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13825 char typeString[1024];
13826 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13827
13828 typeString[0] = '\0';
13829 *newExp = *e;
13830 newExp->prev = (((void *)0));
13831 newExp->next = (((void *)0));
13832 newExp->expType = (((void *)0));
13833 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13834 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13835 newExp->destType = ProcessType(specs, decl);
13836 curContext = context;
13837 if(curCompound)
13838 {
13839 char name[100];
13840 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13841
13842 e->type = 23;
13843 sprintf(name, "__internalValue%03X", internalValueCounter++);
13844 if(!curCompound->__anon1.compound.declarations)
13845 curCompound->__anon1.compound.declarations = MkList();
13846 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13847 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13848 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13849 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13850 }
13851 else
13852 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13853 {
13854 struct Type * type = e->destType;
13855
13856 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13857 CopyTypeInto(e->destType, type);
13858 e->destType->refCount = 1;
13859 e->destType->classObjectType = 0;
13860 FreeType(type);
13861 }
13862 e->__anon1.compound->__anon1.compound.context = context;
13863 PopContext(context);
13864 curContext = context->parent;
13865 }
13866 }
13867 checkedExp = e;
13868 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13869 {
13870 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13871 {
13872 if(checkedExp->type == 23)
13873 {
13874 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13875 }
13876 else
13877 checkedExp = (*checkedExp->__anon1.list).last;
13878 }
13879 else if(checkedExp->type == 11)
13880 checkedExp = checkedExp->__anon1.cast.exp;
13881 }
13882 {
13883 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13884
13885 *operand = *checkedExp;
13886 checkedExp->destType = (((void *)0));
13887 checkedExp->expType = (((void *)0));
13888 __ecereMethod_Expression_Clear(checkedExp);
13889 checkedExp->type = 4;
13890 checkedExp->__anon1.op.op = '&';
13891 checkedExp->__anon1.op.exp1 = (((void *)0));
13892 checkedExp->__anon1.op.exp2 = operand;
13893 }
13894 }
13895 }
13896 }
13897 }
13898 }
13899 {
13900 }
13901 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))))
13902 {
13903 if(e->expType->classObjectType && destType && destType->classObjectType)
13904 {
13905 return ;
13906 }
13907 else
13908 {
13909 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13910
13911 *thisExp = *e;
13912 thisExp->prev = (((void *)0));
13913 thisExp->next = (((void *)0));
13914 __ecereMethod_Expression_Clear(e);
13915 e->type = 5;
13916 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13917 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13918 ((struct Expression *)(*e->__anon1.list).first)->byReference = 0x1;
13919 {
13920 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13921 CopyTypeInto(e->expType, thisExp->expType);
13922 e->expType->byReference = 0x0;
13923 e->expType->refCount = 1;
13924 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))
13925 {
13926 e->expType->classObjectType = 0;
13927 }
13928 }
13929 }
13930 }
13931 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13932 {
13933 if(destType->kind == 14)
13934 {
13935 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13936 }
13937 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))
13938 {
13939 unsigned int byReference = e->expType->byReference;
13940 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13941 struct Declarator * decl;
13942 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13943 char typeString[1024];
13944 struct Type * type;
13945 int backupClassObjectType;
13946 unsigned int backupByReference;
13947
13948 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13949 type = e->expType;
13950 else
13951 type = destType;
13952 backupClassObjectType = type->classObjectType;
13953 backupByReference = type->byReference;
13954 type->classObjectType = 0;
13955 type->byReference = 0x0;
13956 typeString[0] = '\0';
13957 PrintType(type, typeString, 0x0, 0x1);
13958 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13959 type->classObjectType = backupClassObjectType;
13960 type->byReference = backupByReference;
13961 *thisExp = *e;
13962 thisExp->prev = (((void *)0));
13963 thisExp->next = (((void *)0));
13964 __ecereMethod_Expression_Clear(e);
13965 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)))
13966 {
13967 e->type = 4;
13968 e->__anon1.op.op = '*';
13969 e->__anon1.op.exp1 = (((void *)0));
13970 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13971 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13972 CopyTypeInto(e->expType, type);
13973 e->expType->byReference = 0x0;
13974 e->expType->refCount = 1;
13975 }
13976 else
13977 {
13978 e->type = 11;
13979 e->__anon1.cast.typeName = MkTypeName(specs, decl);
13980 e->__anon1.cast.exp = thisExp;
13981 e->byReference = 0x1;
13982 e->expType = type;
13983 type->refCount++;
13984 }
13985 e->destType = destType;
13986 destType->refCount++;
13987 }
13988 }
13989 }
13990
13991 void ApplyLocation(struct Expression * exp, struct Location * loc)
13992 {
13993 exp->loc = *loc;
13994 switch(exp->type)
13995 {
13996 case 4:
13997 if(exp->__anon1.op.exp1)
13998 ApplyLocation(exp->__anon1.op.exp1, loc);
13999 if(exp->__anon1.op.exp2)
14000 ApplyLocation(exp->__anon1.op.exp2, loc);
14001 break;
14002 case 5:
14003 if(exp->__anon1.list)
14004 {
14005 struct Expression * e;
14006
14007 for(e = (*exp->__anon1.list).first; e; e = e->next)
14008 ApplyLocation(e, loc);
14009 }
14010 break;
14011 case 6:
14012 if(exp->__anon1.index.index)
14013 {
14014 struct Expression * e;
14015
14016 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14017 ApplyLocation(e, loc);
14018 }
14019 if(exp->__anon1.index.exp)
14020 ApplyLocation(exp->__anon1.index.exp, loc);
14021 break;
14022 case 7:
14023 if(exp->__anon1.call.arguments)
14024 {
14025 struct Expression * arg;
14026
14027 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14028 ApplyLocation(arg, loc);
14029 }
14030 if(exp->__anon1.call.exp)
14031 ApplyLocation(exp->__anon1.call.exp, loc);
14032 break;
14033 case 8:
14034 case 9:
14035 if(exp->__anon1.member.exp)
14036 ApplyLocation(exp->__anon1.member.exp, loc);
14037 break;
14038 case 11:
14039 if(exp->__anon1.cast.exp)
14040 ApplyLocation(exp->__anon1.cast.exp, loc);
14041 break;
14042 case 12:
14043 if(exp->__anon1.cond.exp)
14044 {
14045 struct Expression * e;
14046
14047 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14048 ApplyLocation(e, loc);
14049 }
14050 if(exp->__anon1.cond.cond)
14051 ApplyLocation(exp->__anon1.cond.cond, loc);
14052 if(exp->__anon1.cond.elseExp)
14053 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14054 break;
14055 case 34:
14056 if(exp->__anon1.vaArg.exp)
14057 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14058 break;
14059 default:
14060 break;
14061 }
14062 }
14063
14064 extern char *  strstr(const char * , const char * );
14065
14066 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14067
14068 struct __ecereNameSpace__ecere__com__DefinedExpression
14069 {
14070 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14071 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14072 const char *  name;
14073 const char *  value;
14074 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14075 } __attribute__ ((gcc_struct));
14076
14077 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14078
14079 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14080
14081 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14082
14083 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14084
14085 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14086
14087 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14088
14089 static void ProcessStatement(struct Statement * stmt);
14090
14091 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14092
14093 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14094
14095 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14096
14097 extern const char *  sourceFile;
14098
14099 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14100
14101 void ProcessExpressionType(struct Expression * exp)
14102 {
14103 unsigned int unresolved = 0x0;
14104 struct Location oldyylloc = yylloc;
14105 unsigned int notByReference = 0x0;
14106
14107 if(!exp || exp->expType)
14108 return ;
14109 yylloc = exp->loc;
14110 switch(exp->type)
14111 {
14112 case 0:
14113 {
14114 struct Identifier * id = exp->__anon1.__anon1.identifier;
14115
14116 if(!id || !topContext)
14117 return ;
14118 if(id->_class && id->_class->__anon1.__anon1.name)
14119 {
14120 id->classSym = id->_class->__anon1.__anon1.symbol;
14121 }
14122 if(strstr(id->string, "__ecereClass") == id->string)
14123 {
14124 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
14125 break;
14126 }
14127 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14128 {
14129 ReplaceClassMembers(exp, thisClass);
14130 if(exp->type != 0)
14131 {
14132 ProcessExpressionType(exp);
14133 break;
14134 }
14135 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0x0))
14136 break;
14137 }
14138 else
14139 {
14140 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14141
14142 if(!symbol)
14143 {
14144 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0, 0x0))
14145 break;
14146 else
14147 {
14148 if(thisClass)
14149 {
14150 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14151 if(exp->type != 0)
14152 {
14153 ProcessExpressionType(exp);
14154 break;
14155 }
14156 }
14157 else if(currentClass && !id->_class)
14158 {
14159 if(ResolveIdWithClass(exp, currentClass, 0x1))
14160 break;
14161 }
14162 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14163 }
14164 }
14165 if(symbol)
14166 {
14167 struct Type * type = symbol->type;
14168 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14169
14170 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14171 {
14172 struct Context * context = SetupTemplatesContext(_class);
14173
14174 type = ReplaceThisClassType(_class);
14175 FinishTemplatesContext(context);
14176 if(type)
14177 type->refCount = 0;
14178 }
14179 FreeSpecifier(id->_class);
14180 id->_class = (((void *)0));
14181 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14182 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14183 id->classSym = (((void *)0));
14184 exp->expType = type;
14185 if(type)
14186 type->refCount++;
14187 if(type && (type->kind == 15))
14188 exp->isConstant = 0x1;
14189 if(symbol->isParam || !strcmp(id->string, "this"))
14190 {
14191 if(_class && _class->type == 1 && !type->declaredWithStruct)
14192 exp->byReference = 0x1;
14193 }
14194 if(symbol->isIterator)
14195 {
14196 if(symbol->isIterator == 3)
14197 {
14198 exp->type = 5;
14199 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14200 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14201 exp->expType = (((void *)0));
14202 ProcessExpressionType(exp);
14203 }
14204 else if(symbol->isIterator != 4)
14205 {
14206 exp->type = 8;
14207 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14208 exp->__anon1.member.exp->expType = exp->expType;
14209 exp->__anon1.member.member = MkIdentifier("data");
14210 exp->expType = (((void *)0));
14211 ProcessExpressionType(exp);
14212 }
14213 }
14214 break;
14215 }
14216 else
14217 {
14218 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14219
14220 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14221 {
14222 char name[1024];
14223
14224 strcpy(name, thisNameSpace);
14225 strcat(name, "::");
14226 strcat(name, id->string);
14227 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14228 }
14229 if(!definedExp)
14230 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14231 if(definedExp)
14232 {
14233 int c;
14234
14235 for(c = 0; c < definedExpStackPos; c++)
14236 if(definedExpStack[c] == definedExp)
14237 break;
14238 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14239 {
14240 struct Location backupYylloc = yylloc;
14241 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14242
14243 definedExpStack[definedExpStackPos++] = definedExp;
14244 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14245 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14246 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14247
14248 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14249 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14250 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14251 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14252
14253 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14254 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14255 echoOn = 0x0;
14256 parsedExpression = (((void *)0));
14257 resetScanner();
14258 expression_yyparse();
14259 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14260 if(backInput)
14261 fileInput = backInput;
14262 yylloc = backupYylloc;
14263 if(parsedExpression)
14264 {
14265 FreeIdentifier(id);
14266 exp->type = 5;
14267 exp->__anon1.list = MkListOne(parsedExpression);
14268 ApplyLocation(parsedExpression, &yylloc);
14269 ProcessExpressionType(exp);
14270 definedExpStackPos--;
14271 return ;
14272 }
14273 definedExpStackPos--;
14274 }
14275 else
14276 {
14277 if(inCompiler)
14278 {
14279 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14280 }
14281 }
14282 }
14283 else
14284 {
14285 struct GlobalData * data = (((void *)0));
14286
14287 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14288 {
14289 char name[1024];
14290
14291 strcpy(name, thisNameSpace);
14292 strcat(name, "::");
14293 strcat(name, id->string);
14294 data = FindGlobalData(name);
14295 }
14296 if(!data)
14297 data = FindGlobalData(id->string);
14298 if(data)
14299 {
14300 DeclareGlobalData(data);
14301 exp->expType = data->dataType;
14302 if(data->dataType)
14303 data->dataType->refCount++;
14304 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14305 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14306 FreeSpecifier(id->_class);
14307 id->_class = (((void *)0));
14308 break;
14309 }
14310 else
14311 {
14312 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14313
14314 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14315 {
14316 char name[1024];
14317
14318 strcpy(name, thisNameSpace);
14319 strcat(name, "::");
14320 strcat(name, id->string);
14321 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14322 }
14323 if(!function)
14324 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14325 if(function)
14326 {
14327 char name[1024];
14328
14329 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14330 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14331 name[0] = (char)0;
14332 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14333 strcpy(name, "__ecereFunction_");
14334 FullClassNameCat(name, id->string, 0x0);
14335 if(DeclareFunction(function, name))
14336 {
14337 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14338 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14339 }
14340 exp->expType = function->dataType;
14341 if(function->dataType)
14342 function->dataType->refCount++;
14343 FreeSpecifier(id->_class);
14344 id->_class = (((void *)0));
14345 break;
14346 }
14347 }
14348 }
14349 }
14350 }
14351 unresolved = 0x1;
14352 break;
14353 }
14354 case 1:
14355 {
14356 struct __ecereNameSpace__ecere__com__Class * _class;
14357
14358 if(!exp->__anon1.instance->_class)
14359 {
14360 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14361 {
14362 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14363 }
14364 }
14365 ProcessInstantiationType(exp->__anon1.instance);
14366 exp->isConstant = exp->__anon1.instance->isConstant;
14367 if(exp->__anon1.instance->_class)
14368 {
14369 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14370 }
14371 break;
14372 }
14373 case 2:
14374 {
14375 if(!exp->expType)
14376 {
14377 char * constant = exp->__anon1.__anon1.constant;
14378 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14379
14380 exp->expType = type;
14381 if(constant[0] == '\'')
14382 {
14383 if((int)((unsigned char *)constant)[1] > 127)
14384 {
14385 int nb;
14386 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14387
14388 if(nb < 2)
14389 ch = constant[1];
14390 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14391 exp->__anon1.__anon1.constant = PrintUInt(ch);
14392 type->kind = 8;
14393 type->__anon1._class = FindClass("unichar");
14394 type->isSigned = 0x0;
14395 }
14396 else
14397 {
14398 type->kind = 1;
14399 type->isSigned = 0x1;
14400 }
14401 }
14402 else
14403 {
14404 char * dot = strchr(constant, '.');
14405 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14406 char * exponent;
14407
14408 if(isHex)
14409 {
14410 exponent = strchr(constant, 'p');
14411 if(!exponent)
14412 exponent = strchr(constant, 'P');
14413 }
14414 else
14415 {
14416 exponent = strchr(constant, 'e');
14417 if(!exponent)
14418 exponent = strchr(constant, 'E');
14419 }
14420 if(dot || exponent)
14421 {
14422 if(strchr(constant, 'f') || strchr(constant, 'F'))
14423 type->kind = 6;
14424 else
14425 type->kind = 7;
14426 type->isSigned = 0x1;
14427 }
14428 else
14429 {
14430 unsigned int isSigned = constant[0] == '-';
14431 char * endP = (((void *)0));
14432 long long i64 = strtoll(constant, &endP, 0);
14433 uint64 ui64 = strtoull(constant, &endP, 0);
14434 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14435
14436 if(isSigned)
14437 {
14438 if(i64 < (((int)0x80000000)))
14439 is64Bit = 0x1;
14440 }
14441 else
14442 {
14443 if(ui64 > (((int)0x7fffffff)))
14444 {
14445 if(ui64 > (0xffffffff))
14446 {
14447 is64Bit = 0x1;
14448 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14449 isSigned = 0x1;
14450 }
14451 }
14452 else if(constant[0] != '0' || !constant[1])
14453 isSigned = 0x1;
14454 }
14455 type->kind = is64Bit ? 4 : 3;
14456 type->isSigned = isSigned;
14457 }
14458 }
14459 exp->isConstant = 0x1;
14460 if(exp->destType && exp->destType->kind == 7)
14461 type->kind = 7;
14462 else if(exp->destType && exp->destType->kind == 6)
14463 type->kind = 6;
14464 else if(exp->destType && exp->destType->kind == 4)
14465 type->kind = 4;
14466 }
14467 break;
14468 }
14469 case 3:
14470 {
14471 exp->isConstant = 0x1;
14472 exp->expType = __extension__ ({
14473 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14474
14475 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14476 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14477
14478 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14479 }), __ecereInstance2;
14480 });
14481 break;
14482 }
14483 case 13:
14484 case 26:
14485 ProcessExpressionType(exp->__anon1._new.size);
14486 exp->expType = __extension__ ({
14487 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14488
14489 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14490 });
14491 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14492 break;
14493 case 14:
14494 case 27:
14495 ProcessExpressionType(exp->__anon1._renew.size);
14496 ProcessExpressionType(exp->__anon1._renew.exp);
14497 exp->expType = __extension__ ({
14498 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14499
14500 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14501 });
14502 DeclareType(exp->expType->__anon1.type, 0x0, 0x0);
14503 break;
14504 case 4:
14505 {
14506 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14507 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14508 unsigned int useDestType = 0x0, useSideType = 0x0;
14509 struct Location oldyylloc = yylloc;
14510 unsigned int useSideUnit = 0x0;
14511 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14512 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14513
14514 switch(exp->__anon1.op.op)
14515 {
14516 case '=':
14517 case MUL_ASSIGN:
14518 case DIV_ASSIGN:
14519 case MOD_ASSIGN:
14520 case ADD_ASSIGN:
14521 case SUB_ASSIGN:
14522 case LEFT_ASSIGN:
14523 case RIGHT_ASSIGN:
14524 case AND_ASSIGN:
14525 case XOR_ASSIGN:
14526 case OR_ASSIGN:
14527 assign = 0x1;
14528 break;
14529 case '!':
14530 break;
14531 case AND_OP:
14532 case OR_OP:
14533 boolOps = 0x1;
14534 boolResult = 0x1;
14535 break;
14536 case EQ_OP:
14537 case '<':
14538 case '>':
14539 case LE_OP:
14540 case GE_OP:
14541 case NE_OP:
14542 boolResult = 0x1;
14543 useSideType = 0x1;
14544 break;
14545 case '+':
14546 case '-':
14547 useSideUnit = 0x1;
14548 useSideType = 0x1;
14549 useDestType = 0x1;
14550 break;
14551 case LEFT_OP:
14552 case RIGHT_OP:
14553 useSideType = 0x1;
14554 useDestType = 0x1;
14555 break;
14556 case '|':
14557 case '^':
14558 useSideType = 0x1;
14559 useDestType = 0x1;
14560 break;
14561 case '/':
14562 case '%':
14563 useSideType = 0x1;
14564 useDestType = 0x1;
14565 break;
14566 case '&':
14567 case '*':
14568 if(exp->__anon1.op.exp1)
14569 {
14570 useSideType = 0x1;
14571 useDestType = 0x1;
14572 }
14573 break;
14574 }
14575 if(exp->__anon1.op.op == '&')
14576 {
14577 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14578 {
14579 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14580 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14581
14582 if(symbol && symbol->isIterator == 2)
14583 {
14584 exp->type = 8;
14585 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14586 exp->__anon1.member.member = MkIdentifier("key");
14587 exp->expType = (((void *)0));
14588 exp->__anon1.op.exp2->expType = symbol->type;
14589 symbol->type->refCount++;
14590 ProcessExpressionType(exp);
14591 FreeType(dummy);
14592 break;
14593 }
14594 }
14595 }
14596 if(exp->__anon1.op.exp1)
14597 {
14598 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14599 useDestType = 0x0;
14600 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14601 {
14602 if(exp->__anon1.op.exp1->destType)
14603 FreeType(exp->__anon1.op.exp1->destType);
14604 exp->__anon1.op.exp1->destType = exp->destType;
14605 exp->__anon1.op.exp1->opDestType = 0x1;
14606 if(exp->destType)
14607 exp->destType->refCount++;
14608 }
14609 else if(!assign)
14610 {
14611 if(exp->__anon1.op.exp1->destType)
14612 FreeType(exp->__anon1.op.exp1->destType);
14613 exp->__anon1.op.exp1->destType = dummy;
14614 dummy->refCount++;
14615 }
14616 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14617 exp->__anon1.op.exp1->destType->count++;
14618 ProcessExpressionType(exp->__anon1.op.exp1);
14619 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14620 exp->__anon1.op.exp1->destType->count--;
14621 exp->__anon1.op.exp1->opDestType = 0x0;
14622 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)
14623 {
14624 exp->__anon1.op.exp2 = MkExpConstant("1");
14625 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14626 assign = 0x1;
14627 }
14628 if(exp->__anon1.op.exp1->destType == dummy)
14629 {
14630 FreeType(dummy);
14631 exp->__anon1.op.exp1->destType = (((void *)0));
14632 }
14633 type1 = exp->__anon1.op.exp1->expType;
14634 }
14635 if(exp->__anon1.op.exp2)
14636 {
14637 char expString[10240];
14638
14639 expString[0] = '\0';
14640 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14641 {
14642 if(exp->__anon1.op.exp1)
14643 {
14644 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14645 if(exp->__anon1.op.exp1->expType)
14646 exp->__anon1.op.exp1->expType->refCount++;
14647 }
14648 else
14649 {
14650 exp->__anon1.op.exp2->destType = exp->destType;
14651 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14652 exp->__anon1.op.exp2->opDestType = 0x1;
14653 if(exp->destType)
14654 exp->destType->refCount++;
14655 }
14656 if(type1)
14657 type1->refCount++;
14658 exp->expType = type1;
14659 }
14660 else if(assign)
14661 {
14662 if(inCompiler)
14663 PrintExpression(exp->__anon1.op.exp2, expString);
14664 if(type1 && type1->kind == 13)
14665 {
14666 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)
14667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14668 else if(exp->__anon1.op.op == '=')
14669 {
14670 if(exp->__anon1.op.exp2->destType)
14671 FreeType(exp->__anon1.op.exp2->destType);
14672 exp->__anon1.op.exp2->destType = type1;
14673 if(type1)
14674 type1->refCount++;
14675 }
14676 }
14677 else
14678 {
14679 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)
14680 ;
14681 else
14682 {
14683 if(exp->__anon1.op.exp2->destType)
14684 FreeType(exp->__anon1.op.exp2->destType);
14685 exp->__anon1.op.exp2->destType = type1;
14686 if(type1)
14687 type1->refCount++;
14688 }
14689 }
14690 if(type1)
14691 type1->refCount++;
14692 exp->expType = type1;
14693 }
14694 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14695 {
14696 if(exp->__anon1.op.exp2->destType)
14697 FreeType(exp->__anon1.op.exp2->destType);
14698 exp->__anon1.op.exp2->destType = exp->destType;
14699 if(exp->__anon1.op.op != '&')
14700 exp->__anon1.op.exp2->opDestType = 0x1;
14701 if(exp->destType)
14702 exp->destType->refCount++;
14703 }
14704 else
14705 {
14706 if(exp->__anon1.op.exp2->destType)
14707 FreeType(exp->__anon1.op.exp2->destType);
14708 exp->__anon1.op.exp2->destType = dummy;
14709 dummy->refCount++;
14710 }
14711 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))
14712 {
14713 FreeType(exp->__anon1.op.exp2->destType);
14714 exp->__anon1.op.exp2->destType = type1;
14715 type1->refCount++;
14716 }
14717 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14718 exp->__anon1.op.exp2->destType->count++;
14719 if(exp->__anon1.op.op == SIZEOF)
14720 {
14721 struct Expression * e = exp->__anon1.op.exp2;
14722
14723 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14724 {
14725 if(e->type == 5 || e->type == 32 || e->type == 23)
14726 {
14727 if(e->type == 23)
14728 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14729 else
14730 e = (*e->__anon1.list).last;
14731 }
14732 }
14733 if(e->type == 11 && e->__anon1.cast.exp)
14734 e->__anon1.cast.exp->needCast = 0x1;
14735 }
14736 ProcessExpressionType(exp->__anon1.op.exp2);
14737 exp->__anon1.op.exp2->opDestType = 0x0;
14738 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14739 exp->__anon1.op.exp2->destType->count--;
14740 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14741 {
14742 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)
14743 {
14744 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14746 }
14747 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)))
14748 {
14749 if(exp->__anon1.op.op == ADD_ASSIGN)
14750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14751 }
14752 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))
14753 {
14754 if(exp->__anon1.op.op == ADD_ASSIGN)
14755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14756 }
14757 else if(inCompiler)
14758 {
14759 char type1String[1024];
14760 char type2String[1024];
14761
14762 type1String[0] = '\0';
14763 type2String[0] = '\0';
14764 PrintType(exp->__anon1.op.exp2->expType, type1String, 0x0, 0x1);
14765 PrintType(type1, type2String, 0x0, 0x1);
14766 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14767 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14768 }
14769 }
14770 if(exp->__anon1.op.exp2->destType == dummy)
14771 {
14772 FreeType(dummy);
14773 exp->__anon1.op.exp2->destType = (((void *)0));
14774 }
14775 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14776 {
14777 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14778 type2->refCount = 1;
14779 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14780 type2->isSigned = 0x1;
14781 }
14782 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))
14783 {
14784 type2 = __extension__ ({
14785 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14786
14787 __ecereInstance1->kind = 3, __ecereInstance1;
14788 });
14789 type2->refCount = 1;
14790 type2->isSigned = 0x1;
14791 }
14792 else
14793 {
14794 type2 = exp->__anon1.op.exp2->expType;
14795 if(type2)
14796 type2->refCount++;
14797 }
14798 }
14799 dummy->kind = 0;
14800 if(exp->__anon1.op.op == SIZEOF)
14801 {
14802 exp->expType = __extension__ ({
14803 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14804
14805 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14806 });
14807 exp->isConstant = 0x1;
14808 }
14809 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14810 {
14811 exp->expType = Dereference(type2);
14812 if(type2 && type2->kind == 8)
14813 notByReference = 0x1;
14814 }
14815 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14816 exp->expType = Reference(type2);
14817 else if(!assign)
14818 {
14819 if(boolOps)
14820 {
14821 if(exp->__anon1.op.exp1)
14822 {
14823 if(exp->__anon1.op.exp1->destType)
14824 FreeType(exp->__anon1.op.exp1->destType);
14825 exp->__anon1.op.exp1->destType = MkClassType("bool");
14826 exp->__anon1.op.exp1->destType->truth = 0x1;
14827 if(!exp->__anon1.op.exp1->expType)
14828 ProcessExpressionType(exp->__anon1.op.exp1);
14829 else
14830 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
14831 FreeType(exp->__anon1.op.exp1->expType);
14832 exp->__anon1.op.exp1->expType = MkClassType("bool");
14833 exp->__anon1.op.exp1->expType->truth = 0x1;
14834 }
14835 if(exp->__anon1.op.exp2)
14836 {
14837 if(exp->__anon1.op.exp2->destType)
14838 FreeType(exp->__anon1.op.exp2->destType);
14839 exp->__anon1.op.exp2->destType = MkClassType("bool");
14840 exp->__anon1.op.exp2->destType->truth = 0x1;
14841 if(!exp->__anon1.op.exp2->expType)
14842 ProcessExpressionType(exp->__anon1.op.exp2);
14843 else
14844 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
14845 FreeType(exp->__anon1.op.exp2->expType);
14846 exp->__anon1.op.exp2->expType = MkClassType("bool");
14847 exp->__anon1.op.exp2->expType->truth = 0x1;
14848 }
14849 }
14850 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")))))
14851 {
14852 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"))))
14853 {
14854 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)))
14855 {
14856 struct Type * intType;
14857
14858 if(!type1->__anon1._class->__anon1.registered->dataType)
14859 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14860 if(!type2->__anon1._class->__anon1.registered->dataType)
14861 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
14862 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14863 if(exp->__anon1.op.exp1->destType)
14864 FreeType(exp->__anon1.op.exp1->destType);
14865 if(exp->__anon1.op.exp2->destType)
14866 FreeType(exp->__anon1.op.exp2->destType);
14867 exp->__anon1.op.exp1->destType = intType;
14868 exp->__anon1.op.exp2->destType = intType;
14869 intType->refCount++;
14870 }
14871 else
14872 {
14873 if(exp->__anon1.op.exp2->destType)
14874 FreeType(exp->__anon1.op.exp2->destType);
14875 exp->__anon1.op.exp2->destType = type1;
14876 type1->refCount++;
14877 if(exp->__anon1.op.exp1->destType)
14878 FreeType(exp->__anon1.op.exp1->destType);
14879 exp->__anon1.op.exp1->destType = type2;
14880 type2->refCount++;
14881 }
14882 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)
14883 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);
14884 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14885 {
14886 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14887
14888 if(argExp)
14889 {
14890 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14891
14892 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14893 ProcessExpressionType(exp->__anon1.op.exp1);
14894 if(type2->kind != 13)
14895 {
14896 ProcessExpressionType(classExp);
14897 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14898 if(!exp->__anon1.op.exp2->expType)
14899 {
14900 if(type2)
14901 FreeType(type2);
14902 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0x0);
14903 type2->refCount++;
14904 }
14905 ProcessExpressionType(exp->__anon1.op.exp2);
14906 }
14907 }
14908 }
14909 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)))
14910 {
14911 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14912 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14913 exp->expType = type1;
14914 if(type1)
14915 type1->refCount++;
14916 }
14917 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)))
14918 {
14919 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14920 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14921 exp->expType = type2;
14922 if(type2)
14923 type2->refCount++;
14924 }
14925 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))
14926 {
14927 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14928 }
14929 else
14930 {
14931 unsigned int success = 0x0;
14932
14933 if(type1->kind == 13 && type2->kind == 13)
14934 {
14935 if(exp->__anon1.op.op == '+')
14936 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14937 else if(exp->__anon1.op.op == '-')
14938 {
14939 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, 0x0))
14940 {
14941 exp->expType = __extension__ ({
14942 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14943
14944 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14945 });
14946 success = 0x1;
14947 if(type1->__anon1.type->kind == 20)
14948 {
14949 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 0x1);
14950
14951 if(argExp)
14952 {
14953 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14954
14955 ProcessExpressionType(classExp);
14956 exp->type = 5;
14957 exp->__anon1.list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp1))), exp->__anon1.op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp2)))))), '/', MkExpMember(classExp, MkIdentifier("typeSize"))));
14958 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
14959 FreeType(dummy);
14960 return ;
14961 }
14962 }
14963 }
14964 }
14965 }
14966 if(!success && exp->__anon1.op.exp1->type == 2)
14967 {
14968 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
14969 {
14970 if(exp->expType)
14971 FreeType(exp->expType);
14972 exp->expType = exp->__anon1.op.exp1->destType;
14973 if(exp->__anon1.op.exp1->destType)
14974 exp->__anon1.op.exp1->destType->refCount++;
14975 success = 0x1;
14976 }
14977 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14978 {
14979 if(exp->expType)
14980 FreeType(exp->expType);
14981 exp->expType = exp->__anon1.op.exp2->destType;
14982 if(exp->__anon1.op.exp2->destType)
14983 exp->__anon1.op.exp2->destType->refCount++;
14984 success = 0x1;
14985 }
14986 }
14987 else if(!success)
14988 {
14989 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
14990 {
14991 if(exp->expType)
14992 FreeType(exp->expType);
14993 exp->expType = exp->__anon1.op.exp2->destType;
14994 if(exp->__anon1.op.exp2->destType)
14995 exp->__anon1.op.exp2->destType->refCount++;
14996 success = 0x1;
14997 }
14998 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
14999 {
15000 if(exp->expType)
15001 FreeType(exp->expType);
15002 exp->expType = exp->__anon1.op.exp1->destType;
15003 if(exp->__anon1.op.exp1->destType)
15004 exp->__anon1.op.exp1->destType->refCount++;
15005 success = 0x1;
15006 }
15007 }
15008 if(!success)
15009 {
15010 char expString1[10240];
15011 char expString2[10240];
15012 char type1[1024];
15013 char type2[1024];
15014
15015 expString1[0] = '\0';
15016 expString2[0] = '\0';
15017 type1[0] = '\0';
15018 type2[0] = '\0';
15019 if(inCompiler)
15020 {
15021 PrintExpression(exp->__anon1.op.exp1, expString1);
15022 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15023 PrintExpression(exp->__anon1.op.exp2, expString2);
15024 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15025 PrintType(exp->__anon1.op.exp1->expType, type1, 0x0, 0x1);
15026 PrintType(exp->__anon1.op.exp2->expType, type2, 0x0, 0x1);
15027 }
15028 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15029 }
15030 }
15031 }
15032 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)
15033 {
15034 if(exp->__anon1.op.exp1->destType)
15035 FreeType(exp->__anon1.op.exp1->destType);
15036 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15037 if(type2->__anon1._class->__anon1.registered->dataType)
15038 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15039 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15040 exp->expType = type2;
15041 if(type2)
15042 type2->refCount++;
15043 }
15044 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)
15045 {
15046 if(exp->__anon1.op.exp2->destType)
15047 FreeType(exp->__anon1.op.exp2->destType);
15048 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15049 if(type1->__anon1._class->__anon1.registered->dataType)
15050 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15051 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15052 exp->expType = type1;
15053 if(type1)
15054 type1->refCount++;
15055 }
15056 else if(type1)
15057 {
15058 unsigned int valid = 0x0;
15059
15060 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15061 {
15062 if(exp->__anon1.op.exp2->destType)
15063 FreeType(exp->__anon1.op.exp2->destType);
15064 if(!type1->__anon1._class->__anon1.registered->dataType)
15065 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15066 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15067 exp->__anon1.op.exp2->destType->refCount++;
15068 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15069 if(type2)
15070 FreeType(type2);
15071 type2 = exp->__anon1.op.exp2->destType;
15072 if(type2)
15073 type2->refCount++;
15074 exp->expType = type2;
15075 type2->refCount++;
15076 }
15077 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15078 {
15079 if(exp->__anon1.op.exp1->destType)
15080 FreeType(exp->__anon1.op.exp1->destType);
15081 if(!type2->__anon1._class->__anon1.registered->dataType)
15082 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0x0);
15083 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15084 exp->__anon1.op.exp1->destType->refCount++;
15085 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15086 type1 = exp->__anon1.op.exp1->destType;
15087 exp->expType = type1;
15088 type1->refCount++;
15089 }
15090 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15091 {
15092 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15093 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15094
15095 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15096 {
15097 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15098 {
15099 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15100 {
15101 if(exp->expType)
15102 FreeType(exp->expType);
15103 exp->expType = exp->__anon1.op.exp2->expType;
15104 if(exp->__anon1.op.exp2->expType)
15105 exp->__anon1.op.exp2->expType->refCount++;
15106 valid = 0x1;
15107 }
15108 }
15109 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15110 {
15111 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15112 {
15113 if(exp->expType)
15114 FreeType(exp->expType);
15115 exp->expType = exp->__anon1.op.exp1->expType;
15116 if(exp->__anon1.op.exp1->expType)
15117 exp->__anon1.op.exp1->expType->refCount++;
15118 valid = 0x1;
15119 }
15120 }
15121 }
15122 else
15123 {
15124 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15125 {
15126 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0x0, 0x0))
15127 {
15128 if(exp->expType)
15129 FreeType(exp->expType);
15130 exp->expType = exp->__anon1.op.exp1->expType;
15131 if(exp->__anon1.op.exp1->expType)
15132 exp->__anon1.op.exp1->expType->refCount++;
15133 valid = 0x1;
15134 }
15135 }
15136 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15137 {
15138 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0x0, 0x0))
15139 {
15140 if(exp->expType)
15141 FreeType(exp->expType);
15142 exp->expType = exp->__anon1.op.exp2->expType;
15143 if(exp->__anon1.op.exp2->expType)
15144 exp->__anon1.op.exp2->expType->refCount++;
15145 valid = 0x1;
15146 }
15147 }
15148 }
15149 }
15150 if(!valid)
15151 {
15152 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))
15153 {
15154 if(exp->__anon1.op.exp1->destType)
15155 FreeType(exp->__anon1.op.exp1->destType);
15156 exp->__anon1.op.exp1->destType = type2;
15157 type2->refCount++;
15158 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15159 {
15160 if(exp->expType)
15161 FreeType(exp->expType);
15162 exp->expType = exp->__anon1.op.exp1->destType;
15163 if(exp->__anon1.op.exp1->destType)
15164 exp->__anon1.op.exp1->destType->refCount++;
15165 }
15166 }
15167 else
15168 {
15169 if(exp->__anon1.op.exp2->destType)
15170 FreeType(exp->__anon1.op.exp2->destType);
15171 exp->__anon1.op.exp2->destType = type1;
15172 type1->refCount++;
15173 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0))
15174 {
15175 if(exp->expType)
15176 FreeType(exp->expType);
15177 exp->expType = exp->__anon1.op.exp2->destType;
15178 if(exp->__anon1.op.exp2->destType)
15179 exp->__anon1.op.exp2->destType->refCount++;
15180 }
15181 else if(type1 && type2)
15182 {
15183 char expString1[10240];
15184 char expString2[10240];
15185 char type1String[1024];
15186 char type2String[1024];
15187
15188 expString1[0] = '\0';
15189 expString2[0] = '\0';
15190 type1String[0] = '\0';
15191 type2String[0] = '\0';
15192 if(inCompiler)
15193 {
15194 PrintExpression(exp->__anon1.op.exp1, expString1);
15195 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15196 PrintExpression(exp->__anon1.op.exp2, expString2);
15197 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15198 PrintType(exp->__anon1.op.exp1->expType, type1String, 0x0, 0x1);
15199 PrintType(exp->__anon1.op.exp2->expType, type2String, 0x0, 0x1);
15200 }
15201 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15202 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15203 {
15204 exp->expType = exp->__anon1.op.exp1->expType;
15205 if(exp->__anon1.op.exp1->expType)
15206 exp->__anon1.op.exp1->expType->refCount++;
15207 }
15208 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15209 {
15210 exp->expType = exp->__anon1.op.exp2->expType;
15211 if(exp->__anon1.op.exp2->expType)
15212 exp->__anon1.op.exp2->expType->refCount++;
15213 }
15214 }
15215 }
15216 }
15217 }
15218 else if(type2)
15219 {
15220 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15221 {
15222 struct Type * oldType = exp->__anon1.op.exp1->expType;
15223
15224 exp->__anon1.op.exp1->expType = (((void *)0));
15225 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15226 FreeType(oldType);
15227 else
15228 exp->__anon1.op.exp1->expType = oldType;
15229 }
15230 if(exp->__anon1.op.exp1->destType)
15231 FreeType(exp->__anon1.op.exp1->destType);
15232 exp->__anon1.op.exp1->destType = type2;
15233 type2->refCount++;
15234 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0))
15235 {
15236 if(exp->expType)
15237 FreeType(exp->expType);
15238 exp->expType = exp->__anon1.op.exp1->destType;
15239 if(exp->__anon1.op.exp1->destType)
15240 exp->__anon1.op.exp1->destType->refCount++;
15241 }
15242 }
15243 }
15244 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15245 {
15246 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15247 {
15248 if(exp->__anon1.op.exp1->destType)
15249 FreeType(exp->__anon1.op.exp1->destType);
15250 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15251 if(type2->__anon1._class->__anon1.registered->dataType)
15252 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15253 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0x0, 0x0);
15254 }
15255 if(exp->__anon1.op.op == '!')
15256 {
15257 exp->expType = MkClassType("bool");
15258 exp->expType->truth = 0x1;
15259 }
15260 else
15261 {
15262 exp->expType = type2;
15263 if(type2)
15264 type2->refCount++;
15265 }
15266 }
15267 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15268 {
15269 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15270 {
15271 if(exp->__anon1.op.exp2->destType)
15272 FreeType(exp->__anon1.op.exp2->destType);
15273 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15274 if(type1->__anon1._class->__anon1.registered->dataType)
15275 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15276 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0x0, 0x0);
15277 }
15278 exp->expType = type1;
15279 if(type1)
15280 type1->refCount++;
15281 }
15282 }
15283 yylloc = exp->loc;
15284 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15285 {
15286 char expString[10000];
15287
15288 expString[0] = '\0';
15289 if(inCompiler)
15290 {
15291 PrintExpression(exp->__anon1.op.exp1, expString);
15292 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15293 }
15294 if(expString[0])
15295 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15296 }
15297 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15298 {
15299 char expString[10240];
15300
15301 expString[0] = '\0';
15302 if(inCompiler)
15303 {
15304 PrintExpression(exp->__anon1.op.exp2, expString);
15305 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15306 }
15307 if(expString[0])
15308 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15309 }
15310 if(boolResult)
15311 {
15312 FreeType(exp->expType);
15313 exp->expType = MkClassType("bool");
15314 exp->expType->truth = 0x1;
15315 }
15316 if(exp->__anon1.op.op != SIZEOF)
15317 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15318 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15319 {
15320 DeclareType(exp->__anon1.op.exp2->expType, 0x0, 0x0);
15321 }
15322 yylloc = oldyylloc;
15323 FreeType(dummy);
15324 if(type2)
15325 FreeType(type2);
15326 break;
15327 }
15328 case 5:
15329 case 32:
15330 {
15331 struct Expression * e;
15332
15333 exp->isConstant = 0x1;
15334 for(e = (*exp->__anon1.list).first; e; e = e->next)
15335 {
15336 unsigned int inced = 0x0;
15337
15338 if(!e->next)
15339 {
15340 FreeType(e->destType);
15341 e->opDestType = exp->opDestType;
15342 e->destType = exp->destType;
15343 if(e->destType)
15344 {
15345 exp->destType->refCount++;
15346 e->destType->count++;
15347 inced = 0x1;
15348 }
15349 }
15350 ProcessExpressionType(e);
15351 if(inced)
15352 exp->destType->count--;
15353 if(!exp->expType && !e->next)
15354 {
15355 exp->expType = e->expType;
15356 if(e->expType)
15357 e->expType->refCount++;
15358 }
15359 if(!e->isConstant)
15360 exp->isConstant = 0x0;
15361 }
15362 e = (*exp->__anon1.list).first;
15363 if(!e->next && e->type == 8)
15364 {
15365 struct Expression * next = exp->next, * prev = exp->prev;
15366
15367 FreeType(exp->expType);
15368 FreeType(exp->destType);
15369 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15370 *exp = *e;
15371 exp->prev = prev;
15372 exp->next = next;
15373 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15374 ProcessExpressionType(exp);
15375 }
15376 break;
15377 }
15378 case 6:
15379 {
15380 struct Expression * e;
15381
15382 exp->isConstant = 0x1;
15383 ProcessExpressionType(exp->__anon1.index.exp);
15384 if(!exp->__anon1.index.exp->isConstant)
15385 exp->isConstant = 0x0;
15386 if(exp->__anon1.index.exp->expType)
15387 {
15388 struct Type * source = exp->__anon1.index.exp->expType;
15389
15390 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15391 {
15392 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15393 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15394
15395 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15396 {
15397 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0x0);
15398 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15399 {
15400 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0x0);
15401
15402 if(type->kind == 8)
15403 type->constant = 0x1;
15404 else if(type->kind == 13)
15405 {
15406 struct Type * t = type;
15407
15408 while(t->kind == 13)
15409 t = t->__anon1.type;
15410 t->constant = 0x1;
15411 }
15412 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15413 }
15414 }
15415 }
15416 }
15417 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15418 {
15419 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15420 {
15421 if(e->destType)
15422 FreeType(e->destType);
15423 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15424 }
15425 ProcessExpressionType(e);
15426 if(!e->next)
15427 {
15428 }
15429 if(!e->isConstant)
15430 exp->isConstant = 0x0;
15431 }
15432 if(!exp->expType)
15433 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15434 if(exp->expType)
15435 DeclareType(exp->expType, 0x0, 0x0);
15436 break;
15437 }
15438 case 7:
15439 {
15440 struct Expression * e;
15441 struct Type * functionType;
15442 struct Type * methodType = (((void *)0));
15443 char name[1024];
15444
15445 name[0] = '\0';
15446 if(inCompiler)
15447 {
15448 PrintExpression(exp->__anon1.call.exp, name);
15449 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15450 {
15451 PrintExpression(exp->__anon1.call.exp, name);
15452 }
15453 }
15454 if(exp->__anon1.call.exp->type == 0)
15455 {
15456 struct Expression * idExp = exp->__anon1.call.exp;
15457 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15458
15459 if(!strcmp(id->string, "__builtin_frame_address"))
15460 {
15461 exp->expType = ProcessTypeString("void *", 0x1);
15462 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15463 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15464 break;
15465 }
15466 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15467 {
15468 exp->expType = ProcessTypeString("int", 0x1);
15469 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15470 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15471 break;
15472 }
15473 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15474 {
15475 struct Expression * a = (((void *)0));
15476 struct Expression * b = (((void *)0));
15477 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15478
15479 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15480 {
15481 a = (*exp->__anon1.call.arguments).first;
15482 b = (*exp->__anon1.call.arguments).last;
15483 tempExp1 = a;
15484 tempExp2 = b;
15485 }
15486 else if((*exp->__anon1.call.arguments).count == 1)
15487 {
15488 a = (*exp->__anon1.call.arguments).first;
15489 tempExp1 = a;
15490 }
15491 if(a)
15492 {
15493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15494 idExp->__anon1.__anon1.identifier = (((void *)0));
15495 FreeExpContents(exp);
15496 ProcessExpressionType(a);
15497 if(b)
15498 ProcessExpressionType(b);
15499 exp->type = 5;
15500 exp->__anon1.list = MkList();
15501 if(a->expType && (!b || b->expType))
15502 {
15503 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15504 {
15505 if(inCompiler)
15506 {
15507 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15508 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15509 struct Declaration * decl;
15510 char temp1[1024], temp2[1024];
15511
15512 GetTypeSpecs(a->expType, specs);
15513 if(a && !a->isConstant && a->type != 0)
15514 {
15515 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15516 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15517 tempExp1 = QMkExpId(temp1);
15518 tempExp1->expType = a->expType;
15519 if(a->expType)
15520 a->expType->refCount++;
15521 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15522 }
15523 if(b && !b->isConstant && b->type != 0)
15524 {
15525 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15526 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15527 tempExp2 = QMkExpId(temp2);
15528 tempExp2->expType = b->expType;
15529 if(b->expType)
15530 b->expType->refCount++;
15531 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15532 }
15533 decl = MkDeclaration(specs, decls);
15534 if(!curCompound->__anon1.compound.declarations)
15535 curCompound->__anon1.compound.declarations = MkList();
15536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15537 }
15538 }
15539 }
15540 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15541 {
15542 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15543
15544 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15545 exp->expType = a->expType;
15546 if(a->expType)
15547 a->expType->refCount++;
15548 }
15549 else if(!strcmp(id->string, "Abs"))
15550 {
15551 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15552 exp->expType = a->expType;
15553 if(a->expType)
15554 a->expType->refCount++;
15555 }
15556 else if(!strcmp(id->string, "Sgn"))
15557 {
15558 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"))))));
15559 exp->expType = ProcessTypeString("int", 0x0);
15560 }
15561 FreeExpression(tempExp1);
15562 if(tempExp2)
15563 FreeExpression(tempExp2);
15564 FreeIdentifier(id);
15565 break;
15566 }
15567 }
15568 }
15569 {
15570 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15571
15572 if(!exp->__anon1.call.exp->destType)
15573 {
15574 exp->__anon1.call.exp->destType = dummy;
15575 dummy->refCount++;
15576 }
15577 ProcessExpressionType(exp->__anon1.call.exp);
15578 if(exp->__anon1.call.exp->destType == dummy)
15579 {
15580 FreeType(dummy);
15581 exp->__anon1.call.exp->destType = (((void *)0));
15582 }
15583 FreeType(dummy);
15584 }
15585 functionType = exp->__anon1.call.exp->expType;
15586 if(functionType && functionType->kind == 16)
15587 {
15588 methodType = functionType;
15589 functionType = methodType->__anon1.__anon3.method->dataType;
15590 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15591 {
15592 char typeString[1024];
15593
15594 typeString[0] = '\0';
15595 {
15596 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15597
15598 functionType->__anon1.__anon2.thisClass = (((void *)0));
15599 PrintType(functionType, typeString, 0x1, 0x1);
15600 functionType->__anon1.__anon2.thisClass = back;
15601 }
15602 if(strstr(typeString, "thisclass"))
15603 {
15604 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15605 struct Declarator * decl;
15606
15607 {
15608 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15609
15610 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15611 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))
15612 thisClassParams = 0x0;
15613 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15614 {
15615 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15616
15617 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15618 ProcessDeclarator(decl);
15619 thisClass = backupThisClass;
15620 }
15621 thisClassParams = 0x1;
15622 functionType = ProcessType(specs, decl);
15623 functionType->refCount = 0;
15624 FinishTemplatesContext(context);
15625 }
15626 FreeList(specs, FreeSpecifier);
15627 FreeDeclarator(decl);
15628 }
15629 }
15630 }
15631 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15632 {
15633 struct Type * type = functionType->__anon1.type;
15634
15635 if(!functionType->refCount)
15636 {
15637 functionType->__anon1.type = (((void *)0));
15638 FreeType(functionType);
15639 }
15640 functionType = type;
15641 }
15642 if(functionType && functionType->kind != 11)
15643 {
15644 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15645 }
15646 else if(functionType)
15647 {
15648 unsigned int emptyParams = 0x0, noParams = 0x0;
15649 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15650 struct Type * type = functionType->__anon1.__anon2.params.first;
15651 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15652 int extra = 0;
15653 struct Location oldyylloc = yylloc;
15654
15655 if(!type)
15656 emptyParams = 0x1;
15657 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15658 {
15659 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15660 e = e->next;
15661 }
15662 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15663 {
15664 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)
15665 {
15666 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15667 if(e)
15668 {
15669 e->destType = type;
15670 e = e->next;
15671 type = functionType->__anon1.__anon2.params.first;
15672 }
15673 else
15674 type->refCount = 0;
15675 }
15676 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15677 {
15678 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15679 type->byReference = functionType->byReference;
15680 type->typedByReference = functionType->typedByReference;
15681 if(e)
15682 {
15683 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15684 e = e->next;
15685 e->destType = type;
15686 e = e->next;
15687 type = functionType->__anon1.__anon2.params.first;
15688 }
15689 else
15690 type->refCount = 0;
15691 }
15692 }
15693 if(type && type->kind == 0)
15694 {
15695 noParams = 0x1;
15696 if(!type->refCount)
15697 FreeType(type);
15698 type = (((void *)0));
15699 }
15700 for(; e; e = e->next)
15701 {
15702 if(!type && !emptyParams)
15703 {
15704 yylloc = e->loc;
15705 if(methodType && methodType->__anon1.__anon3.methodClass)
15706 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);
15707 else
15708 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);
15709 break;
15710 }
15711 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15712 {
15713 struct Type * templatedType = (((void *)0));
15714 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15715 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15716 int id = 0;
15717
15718 if(_class && _class->templateArgs)
15719 {
15720 struct __ecereNameSpace__ecere__com__Class * sClass;
15721
15722 for(sClass = _class; sClass; sClass = sClass->base)
15723 {
15724 if(sClass->templateClass)
15725 sClass = sClass->templateClass;
15726 id = 0;
15727 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15728 {
15729 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15730 {
15731 struct __ecereNameSpace__ecere__com__Class * nextClass;
15732
15733 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15734 {
15735 if(nextClass->templateClass)
15736 nextClass = nextClass->templateClass;
15737 id += nextClass->templateParams.count;
15738 }
15739 break;
15740 }
15741 id++;
15742 }
15743 if(curParam)
15744 break;
15745 }
15746 }
15747 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15748 {
15749 unsigned int constant = type->constant;
15750 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15751
15752 {
15753 struct Context * context = SetupTemplatesContext(_class);
15754
15755 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
15756 FinishTemplatesContext(context);
15757 }
15758 if(templatedType->kind == 8 && constant)
15759 templatedType->constant = 0x1;
15760 else if(templatedType->kind == 13)
15761 {
15762 struct Type * t = templatedType->__anon1.type;
15763
15764 while(t->kind == 13)
15765 t = t->__anon1.type;
15766 if(constant)
15767 t->constant = constant;
15768 }
15769 e->destType = templatedType;
15770 if(templatedType)
15771 {
15772 templatedType->passAsTemplate = 0x1;
15773 }
15774 }
15775 else
15776 {
15777 e->destType = type;
15778 if(type)
15779 type->refCount++;
15780 }
15781 }
15782 else
15783 {
15784 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15785 {
15786 e->destType = type->prev;
15787 e->destType->refCount++;
15788 }
15789 else
15790 {
15791 e->destType = type;
15792 if(type)
15793 type->refCount++;
15794 }
15795 }
15796 if(type && type->kind != 14)
15797 {
15798 struct Type * next = type->next;
15799
15800 if(!type->refCount)
15801 FreeType(type);
15802 type = next;
15803 }
15804 }
15805 if(type && type->kind != 14)
15806 {
15807 if(methodType && methodType->__anon1.__anon3.methodClass)
15808 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);
15809 else
15810 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);
15811 }
15812 yylloc = oldyylloc;
15813 if(type && !type->refCount)
15814 FreeType(type);
15815 }
15816 else
15817 {
15818 functionType = __extension__ ({
15819 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15820
15821 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15822 });
15823 if(exp->__anon1.call.exp->type == 0)
15824 {
15825 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15826
15827 if(inCompiler)
15828 {
15829 struct Symbol * symbol;
15830 struct Location oldyylloc = yylloc;
15831
15832 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15833 if(strstr(string, "__builtin_") == string)
15834 {
15835 if(exp->destType)
15836 {
15837 functionType->__anon1.__anon2.returnType = exp->destType;
15838 exp->destType->refCount++;
15839 }
15840 }
15841 else
15842 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15843 symbol = __extension__ ({
15844 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15845
15846 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15847 });
15848 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15849 if(strstr(symbol->string, "::"))
15850 globalContext->hasNameSpace = 0x1;
15851 yylloc = oldyylloc;
15852 }
15853 }
15854 else if(exp->__anon1.call.exp->type == 8)
15855 {
15856 }
15857 else
15858 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15859 if(!functionType->__anon1.__anon2.returnType)
15860 {
15861 functionType->__anon1.__anon2.returnType = __extension__ ({
15862 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15863
15864 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15865 });
15866 }
15867 }
15868 if(functionType && functionType->kind == 11)
15869 {
15870 exp->expType = functionType->__anon1.__anon2.returnType;
15871 if(functionType->__anon1.__anon2.returnType)
15872 functionType->__anon1.__anon2.returnType->refCount++;
15873 if(!functionType->refCount)
15874 FreeType(functionType);
15875 }
15876 if(exp->__anon1.call.arguments)
15877 {
15878 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15879 {
15880 struct Type * destType = e->destType;
15881
15882 ProcessExpressionType(e);
15883 }
15884 }
15885 break;
15886 }
15887 case 8:
15888 {
15889 struct Type * type;
15890 struct Location oldyylloc = yylloc;
15891 unsigned int thisPtr;
15892 struct Expression * checkExp = exp->__anon1.member.exp;
15893
15894 while(checkExp)
15895 {
15896 if(checkExp->type == 11)
15897 checkExp = checkExp->__anon1.cast.exp;
15898 else if(checkExp->type == 5)
15899 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15900 else
15901 break;
15902 }
15903 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15904 exp->thisPtr = thisPtr;
15905 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15906 {
15907 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15908 }
15909 ProcessExpressionType(exp->__anon1.member.exp);
15910 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)
15911 {
15912 exp->isConstant = 0x0;
15913 }
15914 else
15915 exp->isConstant = exp->__anon1.member.exp->isConstant;
15916 type = exp->__anon1.member.exp->expType;
15917 yylloc = exp->loc;
15918 if(type && (type->kind == 20))
15919 {
15920 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15921 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15922
15923 if(_class)
15924 {
15925 for(param = _class->templateParams.first; param; param = param->next)
15926 {
15927 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15928 break;
15929 }
15930 }
15931 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15932 {
15933 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15934
15935 if(argExp)
15936 {
15937 struct Expression * expMember = exp->__anon1.member.exp;
15938 struct Declarator * decl;
15939 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15940 char thisClassTypeString[1024];
15941
15942 FreeIdentifier(exp->__anon1.member.member);
15943 ProcessExpressionType(argExp);
15944 {
15945 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15946
15947 if(colon)
15948 {
15949 char className[1024];
15950 struct __ecereNameSpace__ecere__com__Class * sClass;
15951
15952 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15953 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15954 }
15955 else
15956 strcpy(thisClassTypeString, _class->fullName);
15957 }
15958 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15959 exp->expType = ProcessType(specs, decl);
15960 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
15961 {
15962 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
15963 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15964 int c;
15965 int paramCount = 0;
15966 int lastParam = -1;
15967 char templateString[1024];
15968 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15969
15970 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15971 for(cClass = expClass; cClass; cClass = cClass->base)
15972 {
15973 int p = 0;
15974
15975 for(param = cClass->templateParams.first; param; param = param->next)
15976 {
15977 int id = p;
15978 struct __ecereNameSpace__ecere__com__Class * sClass;
15979 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15980
15981 for(sClass = cClass->base; sClass; sClass = sClass->base)
15982 id += sClass->templateParams.count;
15983 arg = expClass->templateArgs[id];
15984 for(sClass = _class; sClass; sClass = sClass->base)
15985 {
15986 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15987 int p = 0;
15988 struct __ecereNameSpace__ecere__com__Class * nextClass;
15989
15990 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15991 p += nextClass->templateParams.count;
15992 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15993 {
15994 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
15995 {
15996 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
15997 {
15998 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
15999 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16000 break;
16001 }
16002 }
16003 }
16004 }
16005 {
16006 char argument[256];
16007
16008 argument[0] = '\0';
16009 switch(param->type)
16010 {
16011 case 2:
16012 {
16013 char expString[1024];
16014 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16015 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16016 struct Expression * exp;
16017 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16018
16019 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16020 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16021 ProcessExpressionType(exp);
16022 ComputeExpression(exp);
16023 expString[0] = '\0';
16024 PrintExpression(exp, expString);
16025 strcat(argument, expString);
16026 FreeExpression(exp);
16027 break;
16028 }
16029 case 1:
16030 {
16031 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16032 break;
16033 }
16034 case 0:
16035 {
16036 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16037 {
16038 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16039 strcat(argument, thisClassTypeString);
16040 else
16041 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16042 }
16043 break;
16044 }
16045 }
16046 if(argument[0])
16047 {
16048 if(paramCount)
16049 strcat(templateString, ", ");
16050 if(lastParam != p - 1)
16051 {
16052 strcat(templateString, param->name);
16053 strcat(templateString, " = ");
16054 }
16055 strcat(templateString, argument);
16056 paramCount++;
16057 lastParam = p;
16058 }
16059 p++;
16060 }
16061 }
16062 }
16063 {
16064 int len = strlen(templateString);
16065
16066 if(templateString[len - 1] == '>')
16067 templateString[len++] = ' ';
16068 templateString[len++] = '>';
16069 templateString[len++] = '\0';
16070 }
16071 {
16072 struct Context * context = SetupTemplatesContext(_class);
16073
16074 FreeType(exp->expType);
16075 exp->expType = ProcessTypeString(templateString, 0x0);
16076 FinishTemplatesContext(context);
16077 }
16078 }
16079 exp->type = 5;
16080 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")))))))));
16081 }
16082 }
16083 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16084 {
16085 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16086 }
16087 }
16088 if(type && (type->kind == 20))
16089 ;
16090 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)))
16091 {
16092 struct Identifier * id = exp->__anon1.member.member;
16093 int typeKind = type->kind;
16094 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));
16095
16096 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16097 {
16098 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16099 typeKind = 8;
16100 }
16101 if(id)
16102 {
16103 if(typeKind == 3 || typeKind == 15)
16104 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16105 else if(!_class)
16106 {
16107 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16108 {
16109 _class = type->__anon1._class->__anon1.registered;
16110 }
16111 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16112 {
16113 _class = FindClass("char *")->__anon1.registered;
16114 }
16115 else if(type->kind == 13)
16116 {
16117 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16118 FreeType(exp->expType);
16119 exp->expType = ProcessTypeString("uintptr", 0x0);
16120 exp->byReference = 0x1;
16121 }
16122 else
16123 {
16124 char string[1024] = "";
16125 struct Symbol * classSym;
16126
16127 PrintTypeNoConst(type, string, 0x0, 0x1);
16128 classSym = FindClass(string);
16129 if(classSym)
16130 _class = classSym->__anon1.registered;
16131 }
16132 }
16133 }
16134 if(_class && id)
16135 {
16136 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16137 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16138 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16139 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16140 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16141
16142 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16143 exp->__anon1.member.memberType = 1;
16144 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16146 if(typeKind != 19)
16147 {
16148 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16149 {
16150 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16151 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16152 {
16153 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16154 if(prop)
16155 member = (((void *)0));
16156 }
16157 if(!member && !prop)
16158 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16159 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16160 exp->__anon1.member.thisPtr = 0x1;
16161 }
16162 else
16163 {
16164 unsigned int useMemberForNonConst = 0x0;
16165
16166 if(!id->classSym)
16167 {
16168 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16169 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);
16170 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16171 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16172 }
16173 if((!prop || useMemberForNonConst) && !member)
16174 {
16175 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16176 if(!method)
16177 {
16178 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16179 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);
16180 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16181 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16182 }
16183 }
16184 if(member && prop)
16185 {
16186 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16187 prop = (((void *)0));
16188 else
16189 member = (((void *)0));
16190 }
16191 }
16192 }
16193 if(!prop && !member && !method)
16194 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16195 if(!prop && !member && !method)
16196 {
16197 if(typeKind == 19)
16198 {
16199 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16200 if(classProp)
16201 {
16202 exp->__anon1.member.memberType = 5;
16203 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
16204 }
16205 else
16206 {
16207 char structName[1024];
16208 struct Identifier * id = exp->__anon1.member.member;
16209 struct Expression * classExp = exp->__anon1.member.exp;
16210
16211 type->refCount++;
16212 FreeType(classExp->expType);
16213 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
16214 strcpy(structName, "__ecereClassData_");
16215 FullClassNameCat(structName, type->__anon1._class->string, 0x0);
16216 exp->type = 9;
16217 exp->__anon1.member.member = id;
16218 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"))))))));
16219 FreeType(type);
16220 ProcessExpressionType(exp);
16221 return ;
16222 }
16223 }
16224 else
16225 {
16226 struct Symbol * classSym = FindClass(id->string);
16227
16228 if(classSym)
16229 {
16230 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16231
16232 if(convertClass)
16233 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16234 }
16235 }
16236 }
16237 if(prop)
16238 {
16239 exp->__anon1.member.memberType = 1;
16240 if(!prop->dataType)
16241 ProcessPropertyType(prop);
16242 exp->expType = prop->dataType;
16243 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16244 {
16245 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16246
16247 CopyTypeInto(type, exp->expType);
16248 type->refCount = 1;
16249 type->constant = 0x1;
16250 exp->expType = type;
16251 }
16252 else if(prop->dataType)
16253 prop->dataType->refCount++;
16254 }
16255 else if(member)
16256 {
16257 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16258 {
16259 FreeExpContents(exp);
16260 exp->type = 0;
16261 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16262 ProcessExpressionType(exp);
16263 return ;
16264 }
16265 exp->__anon1.member.memberType = 3;
16266 DeclareStruct(_class->fullName, 0x0);
16267 if(!member->dataType)
16268 {
16269 struct Context * context = SetupTemplatesContext(_class);
16270
16271 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16272 FinishTemplatesContext(context);
16273 }
16274 exp->expType = member->dataType;
16275 if(member->dataType)
16276 member->dataType->refCount++;
16277 }
16278 else if(revConvert)
16279 {
16280 exp->__anon1.member.memberType = 4;
16281 exp->expType = MkClassType(revConvert->_class->fullName);
16282 }
16283 else if(method)
16284 {
16285 {
16286 exp->__anon1.member.memberType = 2;
16287 }
16288 if(!method->dataType)
16289 ProcessMethodType(method);
16290 exp->expType = __extension__ ({
16291 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16292
16293 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16294 });
16295 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16296 exp->expType->__anon1.__anon3.usedClass = _class;
16297 }
16298 else if(!classProp)
16299 {
16300 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16301 {
16302 FreeExpContents(exp);
16303 exp->type = 0;
16304 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16305 FreeType(exp->expType);
16306 exp->expType = MkClassType("ecere::com::Class");
16307 return ;
16308 }
16309 yylloc = exp->__anon1.member.member->loc;
16310 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16311 if(inCompiler)
16312 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16313 }
16314 if(_class && exp->expType)
16315 {
16316 struct __ecereNameSpace__ecere__com__Class * tClass;
16317
16318 tClass = _class;
16319 while(tClass && !tClass->templateClass)
16320 tClass = tClass->base;
16321 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16322 {
16323 int id = 0;
16324 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16325 struct __ecereNameSpace__ecere__com__Class * sClass;
16326
16327 for(sClass = tClass; sClass; sClass = sClass->base)
16328 {
16329 id = 0;
16330 if(sClass->templateClass)
16331 sClass = sClass->templateClass;
16332 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16333 {
16334 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16335 {
16336 for(sClass = sClass->base; sClass; sClass = sClass->base)
16337 id += sClass->templateParams.count;
16338 break;
16339 }
16340 id++;
16341 }
16342 if(curParam)
16343 break;
16344 }
16345 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16346 {
16347 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16348 struct Context * context = SetupTemplatesContext(tClass);
16349 unsigned int constant = exp->expType->constant;
16350
16351 FreeType(exp->expType);
16352 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16353 if(exp->expType->kind == 8 && constant)
16354 exp->expType->constant = 0x1;
16355 else if(exp->expType->kind == 13)
16356 {
16357 struct Type * t = exp->expType->__anon1.type;
16358
16359 while(t->kind == 13)
16360 t = t->__anon1.type;
16361 if(constant)
16362 t->constant = constant;
16363 }
16364 if(exp->expType)
16365 {
16366 if(exp->expType->kind == 21)
16367 {
16368 FreeType(exp->expType);
16369 exp->expType = ReplaceThisClassType(_class);
16370 }
16371 if(tClass->templateClass)
16372 exp->expType->passAsTemplate = 0x1;
16373 if(!exp->destType)
16374 {
16375 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16376 if(exp->destType->kind == 8 && constant)
16377 exp->destType->constant = 0x1;
16378 else if(exp->destType->kind == 13)
16379 {
16380 struct Type * t = exp->destType->__anon1.type;
16381
16382 while(t->kind == 13)
16383 t = t->__anon1.type;
16384 if(constant)
16385 t->constant = constant;
16386 }
16387 if(exp->destType->kind == 21)
16388 {
16389 FreeType(exp->destType);
16390 exp->destType = ReplaceThisClassType(_class);
16391 }
16392 }
16393 }
16394 FinishTemplatesContext(context);
16395 }
16396 }
16397 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)
16398 {
16399 int id = 0;
16400 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16401 struct __ecereNameSpace__ecere__com__Class * sClass;
16402
16403 for(sClass = tClass; sClass; sClass = sClass->base)
16404 {
16405 id = 0;
16406 if(sClass->templateClass)
16407 sClass = sClass->templateClass;
16408 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16409 {
16410 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16411 {
16412 for(sClass = sClass->base; sClass; sClass = sClass->base)
16413 id += sClass->templateParams.count;
16414 break;
16415 }
16416 id++;
16417 }
16418 if(curParam)
16419 break;
16420 }
16421 if(curParam)
16422 {
16423 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16424 struct Context * context = SetupTemplatesContext(tClass);
16425 struct Type * basicType;
16426
16427 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0x0);
16428 if(basicType)
16429 {
16430 if(basicType->kind == 21)
16431 {
16432 FreeType(basicType);
16433 basicType = ReplaceThisClassType(_class);
16434 }
16435 FreeType(exp->expType);
16436 exp->expType = __extension__ ({
16437 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16438
16439 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16440 });
16441 if(!exp->destType)
16442 {
16443 exp->destType = exp->expType;
16444 exp->destType->refCount++;
16445 }
16446 {
16447 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16448 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16449 struct Declarator * decl;
16450
16451 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16452 *newExp = *exp;
16453 if(exp->destType)
16454 exp->destType->refCount++;
16455 if(exp->expType)
16456 exp->expType->refCount++;
16457 exp->type = 11;
16458 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16459 exp->__anon1.cast.exp = newExp;
16460 }
16461 }
16462 FinishTemplatesContext(context);
16463 }
16464 }
16465 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16466 {
16467 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16468
16469 if(expClass)
16470 {
16471 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16472 int c;
16473 int p = 0;
16474 int paramCount = 0;
16475 int lastParam = -1;
16476 char templateString[1024];
16477 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16478
16479 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16480 while(cClass != expClass)
16481 {
16482 struct __ecereNameSpace__ecere__com__Class * sClass;
16483
16484 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16485 ;
16486 cClass = sClass;
16487 for(param = cClass->templateParams.first; param; param = param->next)
16488 {
16489 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16490 int c;
16491 int cp = 0;
16492 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16493 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16494
16495 while(cClassCur != tClass && !paramCur)
16496 {
16497 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16498
16499 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16500 ;
16501 cClassCur = sClassCur;
16502 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16503 {
16504 if(!strcmp(paramCur->name, param->name))
16505 {
16506 break;
16507 }
16508 cp++;
16509 }
16510 }
16511 if(paramCur && paramCur->type == 0)
16512 arg = tClass->templateArgs[cp];
16513 else
16514 arg = expClass->templateArgs[p];
16515 {
16516 char argument[256];
16517
16518 argument[0] = '\0';
16519 switch(param->type)
16520 {
16521 case 2:
16522 {
16523 char expString[1024];
16524 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16525 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16526 struct Expression * exp;
16527 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16528
16529 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16530 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16531 ProcessExpressionType(exp);
16532 ComputeExpression(exp);
16533 expString[0] = '\0';
16534 PrintExpression(exp, expString);
16535 strcat(argument, expString);
16536 FreeExpression(exp);
16537 break;
16538 }
16539 case 1:
16540 {
16541 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16542 break;
16543 }
16544 case 0:
16545 {
16546 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16547 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16548 break;
16549 }
16550 }
16551 if(argument[0])
16552 {
16553 if(paramCount)
16554 strcat(templateString, ", ");
16555 if(lastParam != p - 1)
16556 {
16557 strcat(templateString, param->name);
16558 strcat(templateString, " = ");
16559 }
16560 strcat(templateString, argument);
16561 paramCount++;
16562 lastParam = p;
16563 }
16564 }
16565 p++;
16566 }
16567 }
16568 {
16569 int len = strlen(templateString);
16570
16571 if(templateString[len - 1] == '>')
16572 templateString[len++] = ' ';
16573 templateString[len++] = '>';
16574 templateString[len++] = '\0';
16575 }
16576 FreeType(exp->expType);
16577 {
16578 struct Context * context = SetupTemplatesContext(tClass);
16579
16580 exp->expType = ProcessTypeString(templateString, 0x0);
16581 FinishTemplatesContext(context);
16582 }
16583 }
16584 }
16585 }
16586 }
16587 else
16588 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)");
16589 }
16590 else if(type && (type->kind == 9 || type->kind == 10))
16591 {
16592 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16593
16594 if(memberType)
16595 {
16596 exp->expType = memberType;
16597 if(memberType)
16598 memberType->refCount++;
16599 }
16600 }
16601 else
16602 {
16603 char expString[10240];
16604
16605 expString[0] = '\0';
16606 if(inCompiler)
16607 {
16608 PrintExpression(exp, expString);
16609 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16610 }
16611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16612 }
16613 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16614 {
16615 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16616 {
16617 struct Identifier * id = exp->__anon1.member.member;
16618 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));
16619
16620 if(_class)
16621 {
16622 FreeType(exp->expType);
16623 exp->expType = ReplaceThisClassType(_class);
16624 }
16625 }
16626 }
16627 yylloc = oldyylloc;
16628 break;
16629 }
16630 case 9:
16631 {
16632 struct Type * destType = exp->destType;
16633
16634 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16635 {
16636 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16637 }
16638 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16639 exp->type = 8;
16640 if(destType)
16641 destType->count++;
16642 ProcessExpressionType(exp);
16643 if(destType)
16644 destType->count--;
16645 break;
16646 }
16647 case 15:
16648 {
16649 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16650
16651 if(classSym && classSym->__anon1.registered)
16652 {
16653 if(classSym->__anon1.registered->type == 5)
16654 {
16655 char name[1024];
16656
16657 name[0] = '\0';
16658 DeclareStruct(classSym->string, 0x0);
16659 FreeSpecifier(exp->__anon1._class);
16660 exp->type = 10;
16661 FullClassNameCat(name, classSym->string, 0x0);
16662 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16663 }
16664 else
16665 {
16666 if(classSym->__anon1.registered->fixed)
16667 {
16668 FreeSpecifier(exp->__anon1._class);
16669 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16670 exp->type = 2;
16671 }
16672 else
16673 {
16674 char className[1024];
16675
16676 strcpy(className, "__ecereClass_");
16677 FullClassNameCat(className, classSym->string, 0x1);
16678 MangleClassName(className);
16679 DeclareClass(classSym, className);
16680 FreeExpContents(exp);
16681 exp->type = 9;
16682 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16683 exp->__anon1.member.member = MkIdentifier("structSize");
16684 }
16685 }
16686 }
16687 exp->expType = __extension__ ({
16688 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16689
16690 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16691 });
16692 break;
16693 }
16694 case 10:
16695 {
16696 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16697
16698 exp->expType = __extension__ ({
16699 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16700
16701 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16702 });
16703 exp->isConstant = 0x1;
16704 DeclareType(type, 0x0, 0x0);
16705 FreeType(type);
16706 break;
16707 }
16708 case 11:
16709 {
16710 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16711
16712 type->count = 1;
16713 FreeType(exp->__anon1.cast.exp->destType);
16714 exp->__anon1.cast.exp->destType = type;
16715 type->refCount++;
16716 type->casted = 0x1;
16717 ProcessExpressionType(exp->__anon1.cast.exp);
16718 type->casted = 0x0;
16719 type->count = 0;
16720 exp->expType = type;
16721 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16722 {
16723 void * prev = exp->prev, * next = exp->next;
16724 struct Type * expType = exp->__anon1.cast.exp->destType;
16725 struct Expression * castExp = exp->__anon1.cast.exp;
16726 struct Type * destType = exp->destType;
16727
16728 if(expType)
16729 expType->refCount++;
16730 FreeType(exp->expType);
16731 FreeTypeName(exp->__anon1.cast.typeName);
16732 *exp = *castExp;
16733 FreeType(exp->expType);
16734 FreeType(exp->destType);
16735 exp->expType = expType;
16736 exp->destType = destType;
16737 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16738 exp->prev = prev;
16739 exp->next = next;
16740 }
16741 else
16742 {
16743 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16744 }
16745 break;
16746 }
16747 case 33:
16748 {
16749 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16750
16751 exp->expType = type;
16752 break;
16753 }
16754 case 34:
16755 {
16756 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16757
16758 ProcessExpressionType(exp->__anon1.vaArg.exp);
16759 exp->expType = type;
16760 break;
16761 }
16762 case 12:
16763 {
16764 struct Expression * e;
16765
16766 exp->isConstant = 0x1;
16767 FreeType(exp->__anon1.cond.cond->destType);
16768 exp->__anon1.cond.cond->destType = MkClassType("bool");
16769 exp->__anon1.cond.cond->destType->truth = 0x1;
16770 ProcessExpressionType(exp->__anon1.cond.cond);
16771 if(!exp->__anon1.cond.cond->isConstant)
16772 exp->isConstant = 0x0;
16773 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16774 {
16775 if(!e->next)
16776 {
16777 FreeType(e->destType);
16778 e->destType = exp->destType;
16779 if(e->destType)
16780 e->destType->refCount++;
16781 }
16782 ProcessExpressionType(e);
16783 if(!e->next)
16784 {
16785 exp->expType = e->expType;
16786 if(e->expType)
16787 e->expType->refCount++;
16788 }
16789 if(!e->isConstant)
16790 exp->isConstant = 0x0;
16791 }
16792 FreeType(exp->__anon1.cond.elseExp->destType);
16793 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16794 if(exp->__anon1.cond.elseExp->destType)
16795 exp->__anon1.cond.elseExp->destType->refCount++;
16796 ProcessExpressionType(exp->__anon1.cond.elseExp);
16797 if(!exp->__anon1.cond.elseExp->isConstant)
16798 exp->isConstant = 0x0;
16799 break;
16800 }
16801 case 23:
16802 {
16803 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16804 {
16805 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16806
16807 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16808 {
16809 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16810 if(exp->destType)
16811 exp->destType->refCount++;
16812 }
16813 ProcessStatement(exp->__anon1.compound);
16814 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16815 if(exp->expType)
16816 exp->expType->refCount++;
16817 }
16818 break;
16819 }
16820 case 24:
16821 {
16822 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16823
16824 if(spec && spec->type == 1)
16825 {
16826 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16827 exp->expType->kind = 19;
16828 exp->byReference = 0x1;
16829 }
16830 else
16831 {
16832 exp->expType = MkClassType("ecere::com::Class");
16833 exp->byReference = 0x1;
16834 }
16835 break;
16836 }
16837 case 25:
16838 {
16839 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16840
16841 if(_class)
16842 {
16843 struct Identifier * id = exp->__anon1.classData.id;
16844 char structName[1024];
16845 struct Expression * classExp;
16846
16847 strcpy(structName, "__ecereClassData_");
16848 FullClassNameCat(structName, _class->fullName, 0x0);
16849 exp->type = 9;
16850 exp->__anon1.member.member = id;
16851 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0x0, 0x0))
16852 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16853 else
16854 classExp = MkExpIdentifier(MkIdentifier("class"));
16855 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"))))))));
16856 ProcessExpressionType(exp);
16857 return ;
16858 }
16859 break;
16860 }
16861 case 35:
16862 {
16863 struct Type * type = (((void *)0));
16864 const char * typeString = (((void *)0));
16865 char typeStringBuf[1024];
16866
16867 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))
16868 {
16869 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16870
16871 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16872 }
16873 else if(exp->__anon1.list)
16874 {
16875 struct Expression * e;
16876
16877 for(e = (*exp->__anon1.list).first; e; e = e->next)
16878 {
16879 ProcessExpressionType(e);
16880 if(e->expType)
16881 {
16882 if(!type)
16883 {
16884 type = e->expType;
16885 type->refCount++;
16886 }
16887 else
16888 {
16889 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16890 {
16891 FreeType(type);
16892 type = e->expType;
16893 e->expType = (((void *)0));
16894 e = (*exp->__anon1.list).first;
16895 ProcessExpressionType(e);
16896 if(e->expType)
16897 {
16898 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16899 {
16900 FreeType(e->expType);
16901 e->expType = (((void *)0));
16902 FreeType(type);
16903 type = (((void *)0));
16904 break;
16905 }
16906 }
16907 }
16908 }
16909 if(e->expType)
16910 {
16911 FreeType(e->expType);
16912 e->expType = (((void *)0));
16913 }
16914 }
16915 }
16916 if(type)
16917 {
16918 typeStringBuf[0] = '\0';
16919 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16920 typeString = typeStringBuf;
16921 FreeType(type);
16922 type = (((void *)0));
16923 }
16924 }
16925 if(typeString)
16926 {
16927 char templateString[1024];
16928 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16929 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16930 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16931 struct Expression * expExt;
16932 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16933
16934 sprintf(templateString, "Container<%s>", typeString);
16935 if(exp->__anon1.list)
16936 {
16937 struct Expression * e;
16938
16939 type = ProcessTypeString(typeString, 0x0);
16940 while(e = (*exp->__anon1.list).first)
16941 {
16942 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16943 e->destType = type;
16944 type->refCount++;
16945 ProcessExpressionType(e);
16946 ListAdd(initializers, MkInitializerAssignment(e));
16947 }
16948 FreeType(type);
16949 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16950 }
16951 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16952 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16953 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16954 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16955 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16956 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16957 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16958 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16959 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16960 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16961 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16962
16963 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16964 })));
16965 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16966 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16967 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
16968 exp->expType = ProcessTypeString(templateString, 0x0);
16969 exp->type = 5;
16970 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16971 ProcessExpressionType(expExt);
16972 }
16973 else
16974 {
16975 exp->expType = ProcessTypeString("Container", 0x0);
16976 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16977 }
16978 break;
16979 }
16980 }
16981 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16982 {
16983 FreeType(exp->expType);
16984 exp->expType = ReplaceThisClassType(thisClass);
16985 }
16986 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)
16987 {
16988 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 0x1, 0x0);
16989
16990 if(symbol)
16991 {
16992 if(exp->expType->kind != 15)
16993 {
16994 struct Type * member;
16995 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
16996
16997 FreeType(exp->expType);
16998 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16999 exp->expType->kind = symbol->type->kind;
17000 exp->expType->refCount++;
17001 exp->expType->__anon1.__anon1.enumName = enumName;
17002 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17003 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17004 member->refCount++;
17005 }
17006 else
17007 {
17008 struct __ecereNameSpace__ecere__sys__NamedLink * member;
17009
17010 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17011 {
17012 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17013
17014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17015 }
17016 }
17017 }
17018 }
17019 yylloc = exp->loc;
17020 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
17021 ;
17022 else if(exp->destType && !exp->destType->keepCast)
17023 {
17024 if(!CheckExpressionType(exp, exp->destType, 0x0, !exp->destType->casted))
17025 {
17026 if(!exp->destType->count || unresolved)
17027 {
17028 if(!exp->expType)
17029 {
17030 yylloc = exp->loc;
17031 if(exp->destType->kind != 14)
17032 {
17033 char type2[1024];
17034
17035 type2[0] = '\0';
17036 if(inCompiler)
17037 {
17038 char expString[10240];
17039
17040 expString[0] = '\0';
17041 PrintType(exp->destType, type2, 0x0, 0x1);
17042 if(inCompiler)
17043 {
17044 PrintExpression(exp, expString);
17045 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17046 }
17047 if(unresolved)
17048 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17049 else if(exp->type != 16)
17050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17051 }
17052 }
17053 else
17054 {
17055 char expString[10240];
17056
17057 expString[0] = '\0';
17058 if(inCompiler)
17059 {
17060 PrintExpression(exp, expString);
17061 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17062 }
17063 if(unresolved)
17064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17065 else if(exp->type != 16)
17066 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17067 }
17068 }
17069 else
17070 {
17071 char type1[1024];
17072 char type2[1024];
17073
17074 type1[0] = '\0';
17075 type2[0] = '\0';
17076 if(inCompiler)
17077 {
17078 PrintType(exp->expType, type1, 0x0, 0x1);
17079 PrintType(exp->destType, type2, 0x0, 0x1);
17080 }
17081 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)))
17082 ;
17083 else
17084 {
17085 char expString[10240];
17086
17087 expString[0] = '\0';
17088 if(inCompiler)
17089 {
17090 PrintExpression(exp, expString);
17091 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17092 }
17093 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17094 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17095 FreeType(exp->expType);
17096 exp->destType->refCount++;
17097 exp->expType = exp->destType;
17098 }
17099 }
17100 }
17101 }
17102 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
17103 {
17104 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17105 char typeString[1024];
17106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17107 struct Declarator * decl;
17108
17109 typeString[0] = '\0';
17110 *newExp = *exp;
17111 if(exp->expType)
17112 exp->expType->refCount++;
17113 if(exp->expType)
17114 exp->expType->refCount++;
17115 exp->type = 11;
17116 newExp->destType = exp->expType;
17117 PrintType(exp->expType, typeString, 0x0, 0x0);
17118 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17119 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
17120 exp->__anon1.cast.exp = newExp;
17121 }
17122 }
17123 else if(unresolved)
17124 {
17125 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17126 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);
17127 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17129 }
17130 else if(!exp->expType && exp->type != 16)
17131 {
17132 char expString[10240];
17133
17134 expString[0] = '\0';
17135 if(inCompiler)
17136 {
17137 PrintExpression(exp, expString);
17138 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17139 }
17140 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17141 }
17142 if(inCompiler)
17143 ApplyAnyObjectLogic(exp);
17144 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)))
17145 {
17146 exp->byReference = 0x1;
17147 }
17148 yylloc = oldyylloc;
17149 }
17150
17151 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)
17152 {
17153 if(*curMember)
17154 {
17155 *curMember = (*curMember)->next;
17156 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17157 {
17158 *curMember = subMemberStack[--(*subMemberStackPos)];
17159 *curMember = (*curMember)->next;
17160 }
17161 while((*curMember) && (*curMember)->isProperty)
17162 *curMember = (*curMember)->next;
17163 if(subMemberStackPos)
17164 {
17165 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17166 {
17167 subMemberStack[(*subMemberStackPos)++] = *curMember;
17168 *curMember = (*curMember)->members.first;
17169 while(*curMember && (*curMember)->isProperty)
17170 *curMember = (*curMember)->next;
17171 }
17172 }
17173 }
17174 while(!*curMember)
17175 {
17176 if(!*curMember)
17177 {
17178 if(subMemberStackPos && *subMemberStackPos)
17179 {
17180 *curMember = subMemberStack[--(*subMemberStackPos)];
17181 *curMember = (*curMember)->next;
17182 }
17183 else
17184 {
17185 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17186
17187 if(*curClass == _class)
17188 break;
17189 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17190 ;
17191 *curMember = (*curClass)->membersAndProperties.first;
17192 }
17193 while((*curMember) && (*curMember)->isProperty)
17194 *curMember = (*curMember)->next;
17195 if(subMemberStackPos)
17196 {
17197 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17198 {
17199 subMemberStack[(*subMemberStackPos)++] = *curMember;
17200 *curMember = (*curMember)->members.first;
17201 while(*curMember && (*curMember)->isProperty)
17202 *curMember = (*curMember)->next;
17203 }
17204 }
17205 }
17206 }
17207 }
17208
17209 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17210 {
17211 switch(init->type)
17212 {
17213 case 0:
17214 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17215 {
17216 if(init->__anon1.exp && !init->__anon1.exp->destType)
17217 {
17218 FreeType(init->__anon1.exp->destType);
17219 init->__anon1.exp->destType = type;
17220 if(type)
17221 type->refCount++;
17222 }
17223 if(init->__anon1.exp)
17224 {
17225 ProcessExpressionType(init->__anon1.exp);
17226 init->isConstant = init->__anon1.exp->isConstant;
17227 }
17228 break;
17229 }
17230 else
17231 {
17232 struct Expression * exp = init->__anon1.exp;
17233 struct Instantiation * inst = exp->__anon1.instance;
17234 struct MembersInit * members;
17235
17236 init->type = 1;
17237 init->__anon1.list = MkList();
17238 if(inst->members)
17239 {
17240 for(members = (*inst->members).first; members; members = members->next)
17241 {
17242 if(members->type == 0)
17243 {
17244 struct MemberInit * member;
17245
17246 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17247 {
17248 ListAdd(init->__anon1.list, member->initializer);
17249 member->initializer = (((void *)0));
17250 }
17251 }
17252 }
17253 }
17254 FreeExpression(exp);
17255 }
17256 case 1:
17257 {
17258 struct Initializer * i;
17259 struct Type * initializerType = (((void *)0));
17260 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17261 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17262 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17263 int subMemberStackPos = 0;
17264
17265 if(type && type->kind == 12)
17266 initializerType = Dereference(type);
17267 else if(type && (type->kind == 9 || type->kind == 10))
17268 initializerType = type->__anon1.__anon1.members.first;
17269 for(i = (*init->__anon1.list).first; i; i = i->next)
17270 {
17271 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17272 {
17273 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17274 if(curMember)
17275 {
17276 if(!curMember->dataType)
17277 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
17278 initializerType = curMember->dataType;
17279 }
17280 }
17281 ProcessInitializer(i, initializerType);
17282 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17283 initializerType = initializerType->next;
17284 if(!i->isConstant)
17285 init->isConstant = 0x0;
17286 }
17287 if(type && type->kind == 12)
17288 FreeType(initializerType);
17289 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))
17290 {
17291 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17292 }
17293 break;
17294 }
17295 }
17296 }
17297
17298 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17299
17300 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17301
17302 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17303 {
17304 switch(spec->type)
17305 {
17306 case 0:
17307 {
17308 if(spec->__anon1.specifier == THISCLASS)
17309 {
17310 if(thisClass)
17311 {
17312 spec->type = 1;
17313 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17314 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17315 ProcessSpecifier(spec, declareStruct);
17316 }
17317 }
17318 break;
17319 }
17320 case 1:
17321 {
17322 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17323
17324 if(symbol)
17325 DeclareType(symbol->type, 0x1, 0x1);
17326 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17327 DeclareStruct(spec->__anon1.__anon1.name, 0x0);
17328 break;
17329 }
17330 case 2:
17331 {
17332 struct Enumerator * e;
17333
17334 if(spec->__anon1.__anon2.list)
17335 {
17336 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17337 {
17338 if(e->exp)
17339 ProcessExpressionType(e->exp);
17340 }
17341 }
17342 break;
17343 }
17344 case 3:
17345 case 4:
17346 {
17347 if(spec->__anon1.__anon2.definitions)
17348 {
17349 struct ClassDef * def;
17350 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17351
17352 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17353 }
17354 break;
17355 }
17356 }
17357 }
17358
17359 static void ProcessDeclarator(struct Declarator * decl)
17360 {
17361 switch(decl->type)
17362 {
17363 case 1:
17364 if(decl->__anon1.identifier->classSym)
17365 {
17366 FreeSpecifier(decl->__anon1.identifier->_class);
17367 decl->__anon1.identifier->_class = (((void *)0));
17368 }
17369 break;
17370 case 3:
17371 if(decl->__anon1.array.exp)
17372 ProcessExpressionType(decl->__anon1.array.exp);
17373 case 0:
17374 case 2:
17375 case 4:
17376 case 5:
17377 case 6:
17378 case 7:
17379 if(decl->declarator)
17380 ProcessDeclarator(decl->declarator);
17381 if(decl->type == 4)
17382 {
17383 struct Identifier * id = GetDeclId(decl);
17384
17385 if(id && id->_class)
17386 {
17387 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17388
17389 if(!decl->__anon1.function.parameters)
17390 decl->__anon1.function.parameters = MkList();
17391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17392 id->_class = (((void *)0));
17393 }
17394 if(decl->__anon1.function.parameters)
17395 {
17396 struct TypeName * param;
17397
17398 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17399 {
17400 if(param->qualifiers && (*param->qualifiers).first)
17401 {
17402 struct Specifier * spec = (*param->qualifiers).first;
17403
17404 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17405 {
17406 struct Declarator * d = param->declarator;
17407 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);
17408
17409 if(d->type != 5)
17410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17411 FreeList(param->qualifiers, FreeSpecifier);
17412 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17413 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17415 param = newParam;
17416 }
17417 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17418 {
17419 struct Declarator * d = param->declarator;
17420
17421 FreeList(param->qualifiers, FreeSpecifier);
17422 param->qualifiers = MkListOne(MkSpecifier(VOID));
17423 if(d->type != 5)
17424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17425 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17426 }
17427 else if(spec->__anon1.specifier == THISCLASS)
17428 {
17429 if(thisClass)
17430 {
17431 spec->type = 1;
17432 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17433 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17434 ProcessSpecifier(spec, 0x0);
17435 }
17436 }
17437 }
17438 if(param->declarator)
17439 ProcessDeclarator(param->declarator);
17440 }
17441 }
17442 }
17443 break;
17444 }
17445 }
17446
17447 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17448
17449 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17450
17451 static void ProcessDeclaration(struct Declaration * decl)
17452 {
17453 yylloc = decl->loc;
17454 switch(decl->type)
17455 {
17456 case 1:
17457 {
17458 unsigned int declareStruct = 0x0;
17459
17460 if(decl->__anon1.__anon1.declarators)
17461 {
17462 struct InitDeclarator * d;
17463
17464 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17465 {
17466 struct Type * type, * subType;
17467
17468 ProcessDeclarator(d->declarator);
17469 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17470 if(d->initializer)
17471 {
17472 ProcessInitializer(d->initializer, type);
17473 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17474 {
17475 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17476 {
17477 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17478
17479 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17480 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17481 if(decl->__anon1.__anon1.specifiers)
17482 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17483 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17484 d = (((void *)0));
17485 decl->type = 2;
17486 decl->__anon1.inst = inst;
17487 }
17488 }
17489 }
17490 for(subType = type; subType; )
17491 {
17492 if(subType->kind == 8)
17493 {
17494 declareStruct = 0x1;
17495 break;
17496 }
17497 else if(subType->kind == 13)
17498 break;
17499 else if(subType->kind == 12)
17500 subType = subType->__anon1.__anon4.arrayType;
17501 else
17502 break;
17503 }
17504 FreeType(type);
17505 if(!d)
17506 break;
17507 }
17508 }
17509 if(decl->__anon1.__anon1.specifiers)
17510 {
17511 struct Specifier * s;
17512
17513 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17514 {
17515 ProcessSpecifier(s, declareStruct);
17516 }
17517 }
17518 break;
17519 }
17520 case 2:
17521 {
17522 ProcessInstantiationType(decl->__anon1.inst);
17523 break;
17524 }
17525 case 0:
17526 {
17527 struct Specifier * spec;
17528 struct Declarator * d;
17529 unsigned int declareStruct = 0x0;
17530
17531 if(decl->__anon1.__anon1.declarators)
17532 {
17533 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17534 {
17535 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17536 struct Type * subType;
17537
17538 ProcessDeclarator(d);
17539 for(subType = type; subType; )
17540 {
17541 if(subType->kind == 8)
17542 {
17543 declareStruct = 0x1;
17544 break;
17545 }
17546 else if(subType->kind == 13)
17547 break;
17548 else if(subType->kind == 12)
17549 subType = subType->__anon1.__anon4.arrayType;
17550 else
17551 break;
17552 }
17553 FreeType(type);
17554 }
17555 }
17556 if(decl->__anon1.__anon1.specifiers)
17557 {
17558 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17559 ProcessSpecifier(spec, declareStruct);
17560 }
17561 break;
17562 }
17563 }
17564 }
17565
17566 static struct FunctionDefinition * curFunction;
17567
17568 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17569 {
17570 char propName[1024], propNameM[1024];
17571 char getName[1024], setName[1024];
17572 struct __ecereNameSpace__ecere__sys__OldList * args;
17573
17574 DeclareProperty(prop, setName, getName);
17575 strcpy(propName, "__ecereProp_");
17576 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17577 strcat(propName, "_");
17578 FullClassNameCat(propName, prop->name, 0x1);
17579 MangleClassName(propName);
17580 strcpy(propNameM, "__ecerePropM_");
17581 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17582 strcat(propNameM, "_");
17583 FullClassNameCat(propNameM, prop->name, 0x1);
17584 MangleClassName(propNameM);
17585 if(prop->isWatchable)
17586 {
17587 args = MkList();
17588 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17589 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17590 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17591 args = MkList();
17592 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17593 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17594 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17595 }
17596 {
17597 args = MkList();
17598 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17599 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17600 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17601 args = MkList();
17602 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17603 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17604 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17605 }
17606 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17607 curFunction->propSet->fireWatchersDone = 0x1;
17608 }
17609
17610 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17611
17612 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17613
17614 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17615
17616 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17617
17618 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17619
17620 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17621
17622 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17623
17624 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17625
17626 static void ProcessStatement(struct Statement * stmt)
17627 {
17628 yylloc = stmt->loc;
17629 switch(stmt->type)
17630 {
17631 case 0:
17632 ProcessStatement(stmt->__anon1.labeled.stmt);
17633 break;
17634 case 1:
17635 if(stmt->__anon1.caseStmt.exp)
17636 {
17637 FreeType(stmt->__anon1.caseStmt.exp->destType);
17638 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17639 if(curSwitchType)
17640 curSwitchType->refCount++;
17641 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17642 ComputeExpression(stmt->__anon1.caseStmt.exp);
17643 }
17644 if(stmt->__anon1.caseStmt.stmt)
17645 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17646 break;
17647 case 2:
17648 {
17649 if(stmt->__anon1.compound.context)
17650 {
17651 struct Declaration * decl;
17652 struct Statement * s;
17653 struct Statement * prevCompound = curCompound;
17654 struct Context * prevContext = curContext;
17655
17656 if(!stmt->__anon1.compound.isSwitch)
17657 curCompound = stmt;
17658 curContext = stmt->__anon1.compound.context;
17659 if(stmt->__anon1.compound.declarations)
17660 {
17661 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17662 ProcessDeclaration(decl);
17663 }
17664 if(stmt->__anon1.compound.statements)
17665 {
17666 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17667 ProcessStatement(s);
17668 }
17669 curContext = prevContext;
17670 curCompound = prevCompound;
17671 }
17672 break;
17673 }
17674 case 3:
17675 {
17676 struct Expression * exp;
17677
17678 if(stmt->__anon1.expressions)
17679 {
17680 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17681 ProcessExpressionType(exp);
17682 }
17683 break;
17684 }
17685 case 4:
17686 {
17687 struct Expression * exp;
17688
17689 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17690 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17691 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 0x1;
17692 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17693 {
17694 ProcessExpressionType(exp);
17695 }
17696 if(stmt->__anon1.ifStmt.stmt)
17697 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17698 if(stmt->__anon1.ifStmt.elseStmt)
17699 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17700 break;
17701 }
17702 case 5:
17703 {
17704 struct Type * oldSwitchType = curSwitchType;
17705
17706 if(stmt->__anon1.switchStmt.exp)
17707 {
17708 struct Expression * exp;
17709
17710 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17711 {
17712 if(!exp->next)
17713 {
17714 ProcessExpressionType(exp);
17715 }
17716 if(!exp->next)
17717 curSwitchType = exp->expType;
17718 }
17719 }
17720 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17721 curSwitchType = oldSwitchType;
17722 break;
17723 }
17724 case 6:
17725 {
17726 if(stmt->__anon1.whileStmt.exp)
17727 {
17728 struct Expression * exp;
17729
17730 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17731 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17732 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 0x1;
17733 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17734 {
17735 ProcessExpressionType(exp);
17736 }
17737 }
17738 if(stmt->__anon1.whileStmt.stmt)
17739 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17740 break;
17741 }
17742 case 7:
17743 {
17744 if(stmt->__anon1.doWhile.exp)
17745 {
17746 struct Expression * exp;
17747
17748 if((*stmt->__anon1.doWhile.exp).last)
17749 {
17750 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17751 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17752 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 0x1;
17753 }
17754 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17755 {
17756 ProcessExpressionType(exp);
17757 }
17758 }
17759 if(stmt->__anon1.doWhile.stmt)
17760 ProcessStatement(stmt->__anon1.doWhile.stmt);
17761 break;
17762 }
17763 case 8:
17764 {
17765 struct Expression * exp;
17766
17767 if(stmt->__anon1.forStmt.init)
17768 ProcessStatement(stmt->__anon1.forStmt.init);
17769 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17770 {
17771 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17772 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17773 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 0x1;
17774 }
17775 if(stmt->__anon1.forStmt.check)
17776 ProcessStatement(stmt->__anon1.forStmt.check);
17777 if(stmt->__anon1.forStmt.increment)
17778 {
17779 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17780 ProcessExpressionType(exp);
17781 }
17782 if(stmt->__anon1.forStmt.stmt)
17783 ProcessStatement(stmt->__anon1.forStmt.stmt);
17784 break;
17785 }
17786 case 18:
17787 {
17788 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17789 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17790 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17791 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17792 char iteratorType[1024];
17793 struct Type * source;
17794 struct Expression * e;
17795 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));
17796 struct Expression * arrayExp;
17797 const char * typeString = (((void *)0));
17798 int builtinCount = 0;
17799
17800 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17801 {
17802 if(!e->next)
17803 {
17804 FreeType(e->destType);
17805 e->destType = ProcessTypeString("Container", 0x0);
17806 }
17807 if(!isBuiltin || e->next)
17808 ProcessExpressionType(e);
17809 }
17810 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17811 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)))
17812 {
17813 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17814 struct Symbol * symbol;
17815 struct Expression * expIt = (((void *)0));
17816 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17817 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17818 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17819 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17820
17821 stmt->type = 2;
17822 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17823 stmt->__anon1.compound.context->parent = curContext;
17824 curContext = stmt->__anon1.compound.context;
17825 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17826 {
17827 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17828
17829 isCustomAVLTree = 0x1;
17830 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17831 isMap = 0x1;
17832 }
17833 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17834 isArray = 0x1;
17835 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17836 {
17837 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17838
17839 isLinkList = 0x1;
17840 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17841 }
17842 if(isArray)
17843 {
17844 struct Declarator * decl;
17845 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17846
17847 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17848 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17849 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17850 }
17851 else if(isBuiltin)
17852 {
17853 struct Type * type = (((void *)0));
17854 char typeStringBuf[1024];
17855
17856 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17857 if(((struct Expression *)(*exp).last)->type == 11)
17858 {
17859 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17860
17861 if(typeName)
17862 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17863 }
17864 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)
17865 {
17866 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17867
17868 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17869 }
17870 else if(arrayExp->__anon1.list)
17871 {
17872 struct Expression * e;
17873
17874 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17875 {
17876 ProcessExpressionType(e);
17877 if(e->expType)
17878 {
17879 if(!type)
17880 {
17881 type = e->expType;
17882 type->refCount++;
17883 }
17884 else
17885 {
17886 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17887 {
17888 FreeType(type);
17889 type = e->expType;
17890 e->expType = (((void *)0));
17891 e = (*arrayExp->__anon1.list).first;
17892 ProcessExpressionType(e);
17893 if(e->expType)
17894 {
17895 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17896 {
17897 FreeType(e->expType);
17898 e->expType = (((void *)0));
17899 FreeType(type);
17900 type = (((void *)0));
17901 break;
17902 }
17903 }
17904 }
17905 }
17906 if(e->expType)
17907 {
17908 FreeType(e->expType);
17909 e->expType = (((void *)0));
17910 }
17911 }
17912 }
17913 if(type)
17914 {
17915 typeStringBuf[0] = '\0';
17916 PrintType(type, typeStringBuf, 0x0, 0x1);
17917 typeString = typeStringBuf;
17918 FreeType(type);
17919 }
17920 }
17921 if(typeString)
17922 {
17923 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17924 struct Declarator * decl;
17925 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17926
17927 if(arrayExp->__anon1.list)
17928 {
17929 struct Expression * e;
17930
17931 builtinCount = (*arrayExp->__anon1.list).count;
17932 type = ProcessTypeString(typeString, 0x0);
17933 while(e = (*arrayExp->__anon1.list).first)
17934 {
17935 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17936 e->destType = type;
17937 type->refCount++;
17938 ProcessExpressionType(e);
17939 ListAdd(initializers, MkInitializerAssignment(e));
17940 }
17941 FreeType(type);
17942 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17943 }
17944 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17945 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17946 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17947 FreeList(exp, FreeExpression);
17948 }
17949 else
17950 {
17951 arrayExp->expType = ProcessTypeString("Container", 0x0);
17952 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17953 }
17954 }
17955 else if(isLinkList && !isList)
17956 {
17957 struct Declarator * decl;
17958 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17959
17960 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17961 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17962 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17963 }
17964 else if(_class->templateArgs)
17965 {
17966 if(isMap)
17967 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17968 else
17969 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
17970 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)))))))));
17971 }
17972 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17973 if(block)
17974 {
17975 switch(block->type)
17976 {
17977 case 2:
17978 if(block->__anon1.compound.context)
17979 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17980 break;
17981 case 4:
17982 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
17983 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17984 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
17985 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17986 break;
17987 case 5:
17988 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
17989 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17990 break;
17991 case 6:
17992 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
17993 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17994 break;
17995 case 7:
17996 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
17997 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
17998 break;
17999 case 8:
18000 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18001 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18002 break;
18003 case 18:
18004 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18005 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18006 break;
18007 }
18008 }
18009 if(filter)
18010 {
18011 block = MkIfStmt(filter, block, (((void *)0)));
18012 }
18013 if(isArray)
18014 {
18015 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));
18016 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18017 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18018 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18019 }
18020 else if(isBuiltin)
18021 {
18022 char count[128];
18023
18024 sprintf(count, "%d", builtinCount);
18025 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));
18026 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18027 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18028 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18029 }
18030 else if(isLinkList && !isList)
18031 {
18032 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18033 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18034
18035 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18036 {
18037 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));
18038 }
18039 else
18040 {
18041 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18042 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18043
18044 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));
18045 }
18046 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18047 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18048 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18049 }
18050 else
18051 {
18052 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18053 }
18054 ProcessExpressionType(expIt);
18055 if((*stmt->__anon1.compound.declarations).first)
18056 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18057 if(symbol)
18058 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18059 ProcessStatement(stmt);
18060 curContext = stmt->__anon1.compound.context->parent;
18061 break;
18062 }
18063 else
18064 {
18065 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18066 }
18067 break;
18068 }
18069 case 9:
18070 break;
18071 case 10:
18072 break;
18073 case 11:
18074 break;
18075 case 12:
18076 {
18077 struct Expression * exp;
18078
18079 if(stmt->__anon1.expressions)
18080 {
18081 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18082 {
18083 if(!exp->next)
18084 {
18085 if(curFunction && !curFunction->type)
18086 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18087 FreeType(exp->destType);
18088 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18089 if(exp->destType)
18090 exp->destType->refCount++;
18091 }
18092 ProcessExpressionType(exp);
18093 }
18094 }
18095 break;
18096 }
18097 case 14:
18098 {
18099 ProcessDeclaration(stmt->__anon1.decl);
18100 break;
18101 }
18102 case 13:
18103 {
18104 struct AsmField * field;
18105
18106 if(stmt->__anon1.asmStmt.inputFields)
18107 {
18108 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18109 if(field->expression)
18110 ProcessExpressionType(field->expression);
18111 }
18112 if(stmt->__anon1.asmStmt.outputFields)
18113 {
18114 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18115 if(field->expression)
18116 ProcessExpressionType(field->expression);
18117 }
18118 if(stmt->__anon1.asmStmt.clobberedFields)
18119 {
18120 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18121 {
18122 if(field->expression)
18123 ProcessExpressionType(field->expression);
18124 }
18125 }
18126 break;
18127 }
18128 case 17:
18129 {
18130 struct PropertyWatch * propWatch;
18131 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18132 struct Expression * object = stmt->__anon1._watch.object;
18133 struct Expression * watcher = stmt->__anon1._watch.watcher;
18134
18135 if(watcher)
18136 ProcessExpressionType(watcher);
18137 if(object)
18138 ProcessExpressionType(object);
18139 if(inCompiler)
18140 {
18141 if(watcher || thisClass)
18142 {
18143 struct External * external = curExternal;
18144 struct Context * context = curContext;
18145
18146 stmt->type = 3;
18147 stmt->__anon1.expressions = MkList();
18148 curExternal = external->prev;
18149 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18150 {
18151 struct ClassFunction * func;
18152 char watcherName[1024];
18153 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;
18154 struct External * createdExternal;
18155 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18156
18157 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18158 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18159 if(propWatch->deleteWatch)
18160 strcat(watcherName, "_delete");
18161 else
18162 {
18163 struct Identifier * propID;
18164
18165 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18166 {
18167 strcat(watcherName, "_");
18168 strcat(watcherName, propID->string);
18169 }
18170 }
18171 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18172 {
18173 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)));
18174 ProcessClassFunctionBody(func, propWatch->compound);
18175 propWatch->compound = (((void *)0));
18176 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
18177 createdExternal->symbol->idCode = external->symbol->idCode;
18178 curExternal = createdExternal;
18179 ProcessFunction(createdExternal->__anon1.function);
18180 {
18181 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18182
18183 externalDecl->__anon1.declaration = decl;
18184 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18185 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18186 }
18187 if(propWatch->deleteWatch)
18188 {
18189 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18190
18191 ListAdd(args, CopyExpression(object));
18192 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18193 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18194 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18195 }
18196 else
18197 {
18198 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18199 struct Identifier * propID;
18200
18201 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18202 {
18203 char propName[1024];
18204 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18205
18206 if(prop)
18207 {
18208 char getName[1024], setName[1024];
18209 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18210
18211 DeclareProperty(prop, setName, getName);
18212 strcpy(propName, "__ecereProp_");
18213 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18214 strcat(propName, "_");
18215 FullClassNameCat(propName, prop->name, 0x1);
18216 ListAdd(args, CopyExpression(object));
18217 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18218 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18219 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18220 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18221 }
18222 else
18223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18224 }
18225 }
18226 }
18227 else
18228 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18229 }
18230 curExternal = external;
18231 curContext = context;
18232 if(watcher)
18233 FreeExpression(watcher);
18234 if(object)
18235 FreeExpression(object);
18236 FreeList(watches, FreePropertyWatch);
18237 }
18238 else
18239 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18240 }
18241 else
18242 {
18243 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18244 {
18245 ProcessStatement(propWatch->compound);
18246 }
18247 }
18248 break;
18249 }
18250 case 15:
18251 {
18252 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18253 struct Expression * object = stmt->__anon1._watch.object;
18254 struct __ecereNameSpace__ecere__com__Class * _class;
18255
18256 if(object)
18257 ProcessExpressionType(object);
18258 if(inCompiler)
18259 {
18260 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18261 if(_class)
18262 {
18263 struct Identifier * propID;
18264
18265 stmt->type = 3;
18266 stmt->__anon1.expressions = MkList();
18267 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18268 {
18269 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18270 }
18271 else if(!watches)
18272 {
18273 }
18274 if(watches)
18275 {
18276 for(propID = (*watches).first; propID; propID = propID->next)
18277 {
18278 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18279
18280 if(prop)
18281 {
18282 CreateFireWatcher(prop, object, stmt);
18283 }
18284 else
18285 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18286 }
18287 }
18288 else
18289 {
18290 struct __ecereNameSpace__ecere__com__Property * prop;
18291 struct __ecereNameSpace__ecere__com__Class * base;
18292
18293 for(base = _class; base; base = base->base)
18294 {
18295 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18296 {
18297 if(prop->isProperty && prop->isWatchable)
18298 {
18299 CreateFireWatcher(prop, object, stmt);
18300 }
18301 }
18302 }
18303 }
18304 if(object)
18305 FreeExpression(object);
18306 FreeList(watches, FreeIdentifier);
18307 }
18308 else
18309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18310 }
18311 break;
18312 }
18313 case 16:
18314 {
18315 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18316 struct Expression * object = stmt->__anon1._watch.object;
18317 struct Expression * watcher = stmt->__anon1._watch.watcher;
18318 struct __ecereNameSpace__ecere__com__Class * _class;
18319
18320 if(object)
18321 ProcessExpressionType(object);
18322 if(watcher)
18323 ProcessExpressionType(watcher);
18324 if(inCompiler)
18325 {
18326 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18327 if(watcher || thisClass)
18328 {
18329 if(_class)
18330 {
18331 struct Identifier * propID;
18332
18333 stmt->type = 3;
18334 stmt->__anon1.expressions = MkList();
18335 if(!watches)
18336 {
18337 struct __ecereNameSpace__ecere__sys__OldList * args;
18338
18339 args = MkList();
18340 ListAdd(args, CopyExpression(object));
18341 ListAdd(args, MkExpConstant("0"));
18342 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18343 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18344 }
18345 else
18346 {
18347 for(propID = (*watches).first; propID; propID = propID->next)
18348 {
18349 char propName[1024];
18350 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18351
18352 if(prop)
18353 {
18354 char getName[1024], setName[1024];
18355 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18356
18357 DeclareProperty(prop, setName, getName);
18358 strcpy(propName, "__ecereProp_");
18359 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18360 strcat(propName, "_");
18361 FullClassNameCat(propName, prop->name, 0x1);
18362 MangleClassName(propName);
18363 ListAdd(args, CopyExpression(object));
18364 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18365 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18366 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18367 }
18368 else
18369 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18370 }
18371 }
18372 if(object)
18373 FreeExpression(object);
18374 if(watcher)
18375 FreeExpression(watcher);
18376 FreeList(watches, FreeIdentifier);
18377 }
18378 else
18379 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18380 }
18381 else
18382 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18383 }
18384 break;
18385 }
18386 }
18387 }
18388
18389 extern struct Expression * QBrackets(struct Expression * exp);
18390
18391 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18392
18393 extern struct Declarator * QMkPtrDecl(const char *  id);
18394
18395 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18396
18397 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18398
18399 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18400
18401 static void ProcessFunction(struct FunctionDefinition * function)
18402 {
18403 struct Identifier * id = GetDeclId(function->declarator);
18404 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18405 struct Type * type = symbol ? symbol->type : (((void *)0));
18406 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18407 struct Context * oldTopContext = topContext;
18408
18409 yylloc = function->loc;
18410 if(type && type->__anon1.__anon2.thisClass)
18411 {
18412 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18413 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18414 char className[1024];
18415 char structName[1024];
18416 struct Declarator * funcDecl;
18417 struct Symbol * thisSymbol;
18418 unsigned int typedObject = 0x0;
18419
18420 if(_class && !_class->base)
18421 {
18422 _class = currentClass;
18423 if(_class && !_class->symbol)
18424 _class->symbol = FindClass(_class->fullName);
18425 classSym = _class ? _class->symbol : (((void *)0));
18426 typedObject = 0x1;
18427 }
18428 thisClass = _class;
18429 if(inCompiler && _class)
18430 {
18431 if(type->kind == 11)
18432 {
18433 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18434 {
18435 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18436
18437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18438 FreeType(param);
18439 }
18440 if(type->classObjectType != 1)
18441 {
18442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18443 symbol->type->__anon1.__anon2.staticMethod = 0x1;
18444 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18445 symbol->type->extraParam = 0x0;
18446 }
18447 }
18448 strcpy(className, "__ecereClass_");
18449 FullClassNameCat(className, _class->fullName, 0x1);
18450 MangleClassName(className);
18451 structName[0] = (char)0;
18452 FullClassNameCat(structName, _class->fullName, 0x0);
18453 funcDecl = GetFuncDecl(function->declarator);
18454 if(funcDecl)
18455 {
18456 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18457 {
18458 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18459
18460 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18461 {
18462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18463 FreeTypeName(param);
18464 }
18465 }
18466 if(!function->propertyNoThis)
18467 {
18468 struct TypeName * thisParam;
18469
18470 if(type->classObjectType != 1)
18471 {
18472 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18473 if(!funcDecl->__anon1.function.parameters)
18474 funcDecl->__anon1.function.parameters = MkList();
18475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18476 }
18477 if(typedObject)
18478 {
18479 if(type->classObjectType != 1)
18480 {
18481 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18482 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18483 }
18484 thisParam = __extension__ ({
18485 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18486
18487 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18488 });
18489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18490 }
18491 }
18492 }
18493 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18494 {
18495 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18496
18497 funcDecl = GetFuncDecl(initDecl->declarator);
18498 if(funcDecl)
18499 {
18500 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18501 {
18502 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18503
18504 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18505 {
18506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18507 FreeTypeName(param);
18508 }
18509 }
18510 if(type->classObjectType != 1)
18511 {
18512 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18513 {
18514 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18515
18516 if(!funcDecl->__anon1.function.parameters)
18517 funcDecl->__anon1.function.parameters = MkList();
18518 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18519 }
18520 }
18521 }
18522 }
18523 }
18524 if(function->body)
18525 {
18526 if(type->classObjectType != 1)
18527 {
18528 thisSymbol = __extension__ ({
18529 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18530
18531 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18532 });
18533 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18534 if(typedObject && thisSymbol->type)
18535 {
18536 thisSymbol->type->classObjectType = 2;
18537 thisSymbol->type->byReference = type->byReference;
18538 thisSymbol->type->typedByReference = type->byReference;
18539 }
18540 }
18541 }
18542 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18543 {
18544 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18545
18546 {
18547 struct __ecereNameSpace__ecere__com__Class * base;
18548
18549 for(base = _class; base && base->type != 1000; base = base->next)
18550 {
18551 for(member = base->membersAndProperties.first; member; member = member->next)
18552 if(!member->isProperty)
18553 break;
18554 if(member)
18555 break;
18556 }
18557 }
18558 for(member = _class->membersAndProperties.first; member; member = member->next)
18559 if(!member->isProperty)
18560 break;
18561 if(member)
18562 {
18563 char pointerName[1024];
18564 struct Declaration * decl;
18565 struct Initializer * initializer;
18566 struct Expression * exp, * bytePtr;
18567
18568 strcpy(pointerName, "__ecerePointer_");
18569 FullClassNameCat(pointerName, _class->fullName, 0x0);
18570 {
18571 char className[1024];
18572
18573 strcpy(className, "__ecereClass_");
18574 FullClassNameCat(className, classSym->string, 0x1);
18575 MangleClassName(className);
18576 DeclareClass(classSym, className);
18577 }
18578 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18579 if(_class->fixed)
18580 {
18581 char string[256];
18582
18583 sprintf(string, "%d", _class->offset);
18584 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18585 }
18586 else
18587 {
18588 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18589 }
18590 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18591 exp->expType = __extension__ ({
18592 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18593
18594 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18595 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18596
18597 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18598 }), __ecereInstance2;
18599 });
18600 if(function->body)
18601 {
18602 yylloc = function->body->loc;
18603 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18604 {
18605 struct Context * prevContext = curContext;
18606
18607 curContext = function->body->__anon1.compound.context;
18608 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18609 curContext = prevContext;
18610 }
18611 decl->symbol = (((void *)0));
18612 if(!function->body->__anon1.compound.declarations)
18613 function->body->__anon1.compound.declarations = MkList();
18614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18615 }
18616 }
18617 }
18618 }
18619 else
18620 thisClass = (((void *)0));
18621 if(id)
18622 {
18623 FreeSpecifier(id->_class);
18624 id->_class = (((void *)0));
18625 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18626 {
18627 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18628
18629 id = GetDeclId(initDecl->declarator);
18630 FreeSpecifier(id->_class);
18631 id->_class = (((void *)0));
18632 }
18633 }
18634 if(function->body)
18635 topContext = function->body->__anon1.compound.context;
18636 {
18637 struct FunctionDefinition * oldFunction = curFunction;
18638
18639 curFunction = function;
18640 if(function->body)
18641 ProcessStatement(function->body);
18642 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18643 {
18644 struct Statement * prevCompound = curCompound;
18645 struct Context * prevContext = curContext;
18646 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18647
18648 if(!function->body->__anon1.compound.statements)
18649 function->body->__anon1.compound.statements = MkList();
18650 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18651 curCompound = function->body;
18652 curContext = function->body->__anon1.compound.context;
18653 ProcessStatement(fireWatchers);
18654 curContext = prevContext;
18655 curCompound = prevCompound;
18656 }
18657 curFunction = oldFunction;
18658 }
18659 if(function->declarator)
18660 {
18661 ProcessDeclarator(function->declarator);
18662 }
18663 topContext = oldTopContext;
18664 thisClass = oldThisClass;
18665 }
18666
18667 extern void FreeSymbol(struct Symbol * symbol);
18668
18669 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18670
18671 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18672 {
18673 struct ClassDef * def;
18674 struct External * external = curExternal;
18675 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18676
18677 for(def = definitions->first; def; def = def->next)
18678 {
18679 if(def->type == 0)
18680 {
18681 if(def->__anon1.function->declarator)
18682 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18683 else
18684 curExternal = external;
18685 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18686 }
18687 else if(def->type == 2)
18688 {
18689 if(def->__anon1.decl->type == 2)
18690 {
18691 thisClass = regClass;
18692 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18693 thisClass = (((void *)0));
18694 }
18695 else
18696 {
18697 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18698
18699 if(regClass)
18700 thisClass = regClass;
18701 ProcessDeclaration(def->__anon1.decl);
18702 thisClass = backThisClass;
18703 }
18704 }
18705 else if(def->type == 1 && def->__anon1.defProperties)
18706 {
18707 struct MemberInit * defProperty;
18708 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);
18709
18710 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18711 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18712 {
18713 thisClass = regClass;
18714 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18715 thisClass = (((void *)0));
18716 }
18717 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18718 FreeSymbol(thisSymbol);
18719 }
18720 else if(def->type == 3 && def->__anon1.propertyDef)
18721 {
18722 struct PropertyDef * prop = def->__anon1.propertyDef;
18723
18724 thisClass = regClass;
18725 if(prop->setStmt)
18726 {
18727 if(regClass)
18728 {
18729 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18730
18731 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18732 }
18733 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18734 ProcessStatement(prop->setStmt);
18735 }
18736 if(prop->getStmt)
18737 {
18738 if(regClass)
18739 {
18740 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18741
18742 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18743 }
18744 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18745 ProcessStatement(prop->getStmt);
18746 }
18747 if(prop->issetStmt)
18748 {
18749 if(regClass)
18750 {
18751 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18752
18753 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18754 }
18755 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18756 ProcessStatement(prop->issetStmt);
18757 }
18758 thisClass = (((void *)0));
18759 }
18760 else if(def->type == 4 && def->__anon1.propertyWatch)
18761 {
18762 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18763
18764 thisClass = regClass;
18765 if(propertyWatch->compound)
18766 {
18767 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);
18768
18769 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18770 curExternal = (((void *)0));
18771 ProcessStatement(propertyWatch->compound);
18772 }
18773 thisClass = (((void *)0));
18774 }
18775 }
18776 }
18777
18778 void DeclareFunctionUtil(const char * s)
18779 {
18780 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18781
18782 if(function)
18783 {
18784 char name[1024];
18785
18786 name[0] = (char)0;
18787 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18788 strcpy(name, "__ecereFunction_");
18789 FullClassNameCat(name, s, 0x0);
18790 DeclareFunction(function, name);
18791 }
18792 }
18793
18794 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18795
18796 void ComputeDataTypes()
18797 {
18798 struct External * external;
18799 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18800 struct External * after = (((void *)0));
18801
18802 currentClass = (((void *)0));
18803 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18804 for(external = (*ast).first; external; external = external->next)
18805 {
18806 if(external->type == 1)
18807 {
18808 struct Declaration * decl = external->__anon1.declaration;
18809
18810 if(decl)
18811 {
18812 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18813
18814 if(decls)
18815 {
18816 struct InitDeclarator * initDecl = (*decls).first;
18817
18818 if(initDecl)
18819 {
18820 struct Declarator * declarator = initDecl->declarator;
18821
18822 if(declarator && declarator->type == 1)
18823 {
18824 struct Identifier * id = declarator->__anon1.identifier;
18825
18826 if(id && id->string)
18827 {
18828 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18829 {
18830 external->symbol->id = -1001, external->symbol->idCode = -1001;
18831 after = external;
18832 }
18833 }
18834 }
18835 }
18836 }
18837 }
18838 }
18839 }
18840 temp->symbol = __extension__ ({
18841 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18842
18843 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18844 });
18845 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18846 curExternal = temp;
18847 DeclareFunctionUtil("eSystem_New");
18848 DeclareFunctionUtil("eSystem_New0");
18849 DeclareFunctionUtil("eSystem_Renew");
18850 DeclareFunctionUtil("eSystem_Renew0");
18851 DeclareFunctionUtil("eSystem_Delete");
18852 DeclareFunctionUtil("eClass_GetProperty");
18853 DeclareFunctionUtil("eClass_SetProperty");
18854 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18855 DeclareFunctionUtil("eInstance_SetMethod");
18856 DeclareFunctionUtil("eInstance_IncRef");
18857 DeclareFunctionUtil("eInstance_StopWatching");
18858 DeclareFunctionUtil("eInstance_Watch");
18859 DeclareFunctionUtil("eInstance_FireWatchers");
18860 DeclareStruct("ecere::com::Class", 0x0);
18861 DeclareStruct("ecere::com::Instance", 0x0);
18862 DeclareStruct("ecere::com::Property", 0x0);
18863 DeclareStruct("ecere::com::DataMember", 0x0);
18864 DeclareStruct("ecere::com::Method", 0x0);
18865 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18866 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18867 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18868 for(external = (*ast).first; external; external = external->next)
18869 {
18870 afterExternal = curExternal = external;
18871 if(external->type == 0)
18872 {
18873 currentClass = external->__anon1.function->_class;
18874 ProcessFunction(external->__anon1.function);
18875 }
18876 else if(external->type == 1)
18877 {
18878 currentClass = (((void *)0));
18879 if(external->__anon1.declaration)
18880 ProcessDeclaration(external->__anon1.declaration);
18881 }
18882 else if(external->type == 2)
18883 {
18884 struct ClassDefinition * _class = external->__anon1._class;
18885
18886 currentClass = external->symbol->__anon1.registered;
18887 if(_class->definitions)
18888 {
18889 ProcessClass(_class->definitions, _class->symbol);
18890 }
18891 if(inCompiler)
18892 {
18893 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18894 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18895 }
18896 }
18897 else if(external->type == 4)
18898 {
18899 thisNameSpace = external->__anon1.id->string;
18900 }
18901 }
18902 currentClass = (((void *)0));
18903 thisNameSpace = (((void *)0));
18904 curExternal = (((void *)0));
18905 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18906 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18907 }
18908
18909 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);
18910
18911 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);
18912
18913 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18914
18915 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18916 {
18917 struct __ecereNameSpace__ecere__com__Class * class;
18918
18919 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18920 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18921 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18922 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18923 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18924 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18925 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18926 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18927 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18928 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18929 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18930 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18931 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18932 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18933 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18934 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18935 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18936 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18937 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18938 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18939 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18940 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18941 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18945 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18968 __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);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18972 __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);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18985 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18986 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18987 __ecereClass_Conversion = class;
18988 __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);
18989 __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);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18991 __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);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19014 }
19015
19016 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19017 {
19018
19019 }
19020