compiler/libec: Casts where function pointers are expected
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40
41 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
42 #define _64BIT 1
43 #else
44 #define _64BIT 0
45 #endif
46
47 #define arch_PointerSize                  sizeof(void *)
48 #define structSize_Instance               (_64BIT ? 24 : 12)
49 #define structSize_Module                 (_64BIT ? 560 : 300)
50 #define structSize_NamedLink64            (_64BIT ? 32 : 24)
51
52 struct __ecereNameSpace__ecere__com__Instance;
53
54 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
55
56 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
57
58 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
59
60 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
61
62 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
63
64 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
65
66 struct __ecereNameSpace__ecere__sys__BTNode;
67
68 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
69
70 struct __ecereNameSpace__ecere__sys__BinaryTree
71 {
72 struct __ecereNameSpace__ecere__sys__BTNode * root;
73 int count;
74 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
75 void (*  FreeKey)(void *  key);
76 } __attribute__ ((gcc_struct));
77
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
79
80 struct __ecereNameSpace__ecere__sys__OldList
81 {
82 void *  first;
83 void *  last;
84 int count;
85 unsigned int offset;
86 unsigned int circ;
87 } __attribute__ ((gcc_struct));
88
89 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
90
91 struct __ecereNameSpace__ecere__com__Method
92 {
93 const char *  name;
94 struct __ecereNameSpace__ecere__com__Method * parent;
95 struct __ecereNameSpace__ecere__com__Method * left;
96 struct __ecereNameSpace__ecere__com__Method * right;
97 int depth;
98 int (*  function)();
99 int vid;
100 int type;
101 struct __ecereNameSpace__ecere__com__Class * _class;
102 void *  symbol;
103 const char *  dataTypeString;
104 struct Type * dataType;
105 int memberAccess;
106 } __attribute__ ((gcc_struct));
107
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
109
110 struct __ecereNameSpace__ecere__com__Property
111 {
112 struct __ecereNameSpace__ecere__com__Property * prev;
113 struct __ecereNameSpace__ecere__com__Property * next;
114 const char *  name;
115 unsigned int isProperty;
116 int memberAccess;
117 int id;
118 struct __ecereNameSpace__ecere__com__Class * _class;
119 const char *  dataTypeString;
120 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
121 struct Type * dataType;
122 void (*  Set)(void * , int);
123 int (*  Get)(void * );
124 unsigned int (*  IsSet)(void * );
125 void *  data;
126 void *  symbol;
127 int vid;
128 unsigned int conversion;
129 unsigned int watcherOffset;
130 const char *  category;
131 unsigned int compiled;
132 unsigned int selfWatchable;
133 unsigned int isWatchable;
134 } __attribute__ ((gcc_struct));
135
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
137
138 struct CodePosition
139 {
140 int line;
141 int charPos;
142 int pos;
143 int included;
144 } __attribute__ ((gcc_struct));
145
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
147
148 struct Location
149 {
150 struct CodePosition start;
151 struct CodePosition end;
152 } __attribute__ ((gcc_struct));
153
154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
155
156 struct Attrib;
157
158 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
159
160 struct ExtDecl
161 {
162 struct Location loc;
163 int type;
164 union
165 {
166 char * s;
167 struct Attrib * attr;
168 } __attribute__ ((gcc_struct)) __anon1;
169 } __attribute__ ((gcc_struct));
170
171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
172
173 struct ClassDefinition
174 {
175 struct ClassDefinition * prev;
176 struct ClassDefinition * next;
177 struct Location loc;
178 struct Specifier * _class;
179 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
180 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
181 struct Symbol * symbol;
182 struct Location blockStart;
183 struct Location nameLoc;
184 int endid;
185 int declMode;
186 unsigned int deleteWatchable;
187 } __attribute__ ((gcc_struct));
188
189 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
190
191 struct Context
192 {
193 struct Context * parent;
194 struct __ecereNameSpace__ecere__sys__BinaryTree types;
195 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
196 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
197 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
198 int nextID;
199 int simpleID;
200 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
201 struct ClassDefinition * classDef;
202 unsigned int templateTypesOnly;
203 unsigned int hasNameSpace;
204 } __attribute__ ((gcc_struct));
205
206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
207
208 struct Instantiation
209 {
210 struct Instantiation * prev;
211 struct Instantiation * next;
212 struct Location loc;
213 struct Specifier * _class;
214 struct Expression * exp;
215 struct __ecereNameSpace__ecere__sys__OldList *  members;
216 struct Symbol * symbol;
217 unsigned int fullSet;
218 unsigned int isConstant;
219 unsigned char *  data;
220 struct Location nameLoc;
221 struct Location insideLoc;
222 unsigned int built;
223 } __attribute__ ((gcc_struct));
224
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
226
227 struct Declaration
228 {
229 struct Declaration * prev;
230 struct Declaration * next;
231 struct Location loc;
232 int type;
233 union
234 {
235 struct
236 {
237 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
238 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
239 } __attribute__ ((gcc_struct)) __anon1;
240 struct Instantiation * inst;
241 struct
242 {
243 struct Identifier * id;
244 struct Expression * exp;
245 } __attribute__ ((gcc_struct)) __anon2;
246 } __attribute__ ((gcc_struct)) __anon1;
247 struct Specifier * extStorage;
248 struct Symbol * symbol;
249 int declMode;
250 } __attribute__ ((gcc_struct));
251
252 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
253
254 struct Statement
255 {
256 struct Statement * prev;
257 struct Statement * next;
258 struct Location loc;
259 int type;
260 union
261 {
262 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
263 struct
264 {
265 struct Identifier * id;
266 struct Statement * stmt;
267 } __attribute__ ((gcc_struct)) labeled;
268 struct
269 {
270 struct Expression * exp;
271 struct Statement * stmt;
272 } __attribute__ ((gcc_struct)) caseStmt;
273 struct
274 {
275 struct __ecereNameSpace__ecere__sys__OldList * declarations;
276 struct __ecereNameSpace__ecere__sys__OldList * statements;
277 struct Context * context;
278 unsigned int isSwitch;
279 } __attribute__ ((gcc_struct)) compound;
280 struct
281 {
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 struct Statement * elseStmt;
285 } __attribute__ ((gcc_struct)) ifStmt;
286 struct
287 {
288 struct __ecereNameSpace__ecere__sys__OldList * exp;
289 struct Statement * stmt;
290 } __attribute__ ((gcc_struct)) switchStmt;
291 struct
292 {
293 struct __ecereNameSpace__ecere__sys__OldList * exp;
294 struct Statement * stmt;
295 } __attribute__ ((gcc_struct)) whileStmt;
296 struct
297 {
298 struct __ecereNameSpace__ecere__sys__OldList * exp;
299 struct Statement * stmt;
300 } __attribute__ ((gcc_struct)) doWhile;
301 struct
302 {
303 struct Statement * init;
304 struct Statement * check;
305 struct __ecereNameSpace__ecere__sys__OldList * increment;
306 struct Statement * stmt;
307 } __attribute__ ((gcc_struct)) forStmt;
308 struct
309 {
310 struct Identifier * id;
311 } __attribute__ ((gcc_struct)) gotoStmt;
312 struct
313 {
314 struct Specifier * spec;
315 char * statements;
316 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
317 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
318 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
319 } __attribute__ ((gcc_struct)) asmStmt;
320 struct
321 {
322 struct Expression * watcher;
323 struct Expression * object;
324 struct __ecereNameSpace__ecere__sys__OldList * watches;
325 } __attribute__ ((gcc_struct)) _watch;
326 struct
327 {
328 struct Identifier * id;
329 struct __ecereNameSpace__ecere__sys__OldList * exp;
330 struct __ecereNameSpace__ecere__sys__OldList * filter;
331 struct Statement * stmt;
332 } __attribute__ ((gcc_struct)) forEachStmt;
333 struct Declaration * decl;
334 } __attribute__ ((gcc_struct)) __anon1;
335 } __attribute__ ((gcc_struct));
336
337 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
338
339 struct TypeName
340 {
341 struct TypeName * prev;
342 struct TypeName * next;
343 struct Location loc;
344 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
345 struct Declarator * declarator;
346 int classObjectType;
347 struct Expression * bitCount;
348 } __attribute__ ((gcc_struct));
349
350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
351
352 struct Initializer
353 {
354 struct Initializer * prev;
355 struct Initializer * next;
356 struct Location loc;
357 int type;
358 union
359 {
360 struct Expression * exp;
361 struct __ecereNameSpace__ecere__sys__OldList *  list;
362 } __attribute__ ((gcc_struct)) __anon1;
363 unsigned int isConstant;
364 struct Identifier * id;
365 } __attribute__ ((gcc_struct));
366
367 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
368
369 struct __ecereNameSpace__ecere__com__DataValue
370 {
371 union
372 {
373 char c;
374 unsigned char uc;
375 short s;
376 unsigned short us;
377 int i;
378 unsigned int ui;
379 void *  p;
380 float f;
381 double d;
382 long long i64;
383 uint64 ui64;
384 } __attribute__ ((gcc_struct)) __anon1;
385 } __attribute__ ((gcc_struct));
386
387 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
388
389 struct Expression
390 {
391 struct Expression * prev;
392 struct Expression * next;
393 struct Location loc;
394 int type;
395 union
396 {
397 struct
398 {
399 char *  constant;
400 struct Identifier * identifier;
401 } __attribute__ ((gcc_struct)) __anon1;
402 struct Statement * compound;
403 struct Instantiation * instance;
404 struct
405 {
406 char *  string;
407 unsigned int intlString;
408 } __attribute__ ((gcc_struct)) __anon2;
409 struct __ecereNameSpace__ecere__sys__OldList *  list;
410 struct
411 {
412 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
413 struct Declarator * decl;
414 } __attribute__ ((gcc_struct)) _classExp;
415 struct
416 {
417 struct Identifier * id;
418 } __attribute__ ((gcc_struct)) classData;
419 struct
420 {
421 struct Expression * exp;
422 struct __ecereNameSpace__ecere__sys__OldList * arguments;
423 struct Location argLoc;
424 } __attribute__ ((gcc_struct)) call;
425 struct
426 {
427 struct Expression * exp;
428 struct __ecereNameSpace__ecere__sys__OldList * index;
429 } __attribute__ ((gcc_struct)) index;
430 struct
431 {
432 struct Expression * exp;
433 struct Identifier * member;
434 int memberType;
435 unsigned int thisPtr;
436 } __attribute__ ((gcc_struct)) member;
437 struct
438 {
439 int op;
440 struct Expression * exp1;
441 struct Expression * exp2;
442 } __attribute__ ((gcc_struct)) op;
443 struct TypeName * typeName;
444 struct Specifier * _class;
445 struct
446 {
447 struct TypeName * typeName;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) cast;
450 struct
451 {
452 struct Expression * cond;
453 struct __ecereNameSpace__ecere__sys__OldList * exp;
454 struct Expression * elseExp;
455 } __attribute__ ((gcc_struct)) cond;
456 struct
457 {
458 struct TypeName * typeName;
459 struct Expression * size;
460 } __attribute__ ((gcc_struct)) _new;
461 struct
462 {
463 struct TypeName * typeName;
464 struct Expression * size;
465 struct Expression * exp;
466 } __attribute__ ((gcc_struct)) _renew;
467 struct
468 {
469 char * table;
470 struct Identifier * id;
471 } __attribute__ ((gcc_struct)) db;
472 struct
473 {
474 struct Expression * ds;
475 struct Expression * name;
476 } __attribute__ ((gcc_struct)) dbopen;
477 struct
478 {
479 struct TypeName * typeName;
480 struct Initializer * initializer;
481 } __attribute__ ((gcc_struct)) initializer;
482 struct
483 {
484 struct Expression * exp;
485 struct TypeName * typeName;
486 } __attribute__ ((gcc_struct)) vaArg;
487 } __attribute__ ((gcc_struct)) __anon1;
488 unsigned int debugValue;
489 struct __ecereNameSpace__ecere__com__DataValue val;
490 uint64 address;
491 unsigned int hasAddress;
492 struct Type * expType;
493 struct Type * destType;
494 unsigned int usage;
495 int tempCount;
496 unsigned int byReference;
497 unsigned int isConstant;
498 unsigned int addedThis;
499 unsigned int needCast;
500 unsigned int thisPtr;
501 unsigned int opDestType;
502 unsigned int needTemplateCast;
503 } __attribute__ ((gcc_struct));
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
506
507 struct TemplateDatatype
508 {
509 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
510 struct Declarator * decl;
511 } __attribute__ ((gcc_struct));
512
513 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
514
515 struct TemplateArgument;
516
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
518
519 struct TemplateParameter
520 {
521 struct TemplateParameter * prev;
522 struct TemplateParameter * next;
523 struct Location loc;
524 int type;
525 struct Identifier * identifier;
526 union
527 {
528 struct TemplateDatatype * dataType;
529 int memberType;
530 } __attribute__ ((gcc_struct)) __anon1;
531 struct TemplateArgument * defaultArgument;
532 const char *  dataTypeString;
533 struct Type * baseType;
534 } __attribute__ ((gcc_struct));
535
536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
537
538 struct Specifier
539 {
540 struct Specifier * prev;
541 struct Specifier * next;
542 struct Location loc;
543 int type;
544 union
545 {
546 int specifier;
547 struct
548 {
549 struct ExtDecl * extDecl;
550 char *  name;
551 struct Symbol * symbol;
552 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
553 } __attribute__ ((gcc_struct)) __anon1;
554 struct
555 {
556 struct Identifier * id;
557 struct __ecereNameSpace__ecere__sys__OldList *  list;
558 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
559 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
560 unsigned int addNameSpace;
561 struct Context * ctx;
562 struct ExtDecl * extDeclStruct;
563 } __attribute__ ((gcc_struct)) __anon2;
564 struct Expression * expression;
565 struct Specifier * _class;
566 struct TemplateParameter * templateParameter;
567 } __attribute__ ((gcc_struct)) __anon1;
568 } __attribute__ ((gcc_struct));
569
570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
571
572 struct Identifier
573 {
574 struct Identifier * prev;
575 struct Identifier * next;
576 struct Location loc;
577 struct Symbol * classSym;
578 struct Specifier * _class;
579 char *  string;
580 struct Identifier * badID;
581 } __attribute__ ((gcc_struct));
582
583 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
584
585 struct Pointer;
586
587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
588
589 struct Declarator
590 {
591 struct Declarator * prev;
592 struct Declarator * next;
593 struct Location loc;
594 int type;
595 struct Symbol * symbol;
596 struct Declarator * declarator;
597 union
598 {
599 struct Identifier * identifier;
600 struct
601 {
602 struct Expression * exp;
603 struct Expression * posExp;
604 struct Attrib * attrib;
605 } __attribute__ ((gcc_struct)) structDecl;
606 struct
607 {
608 struct Expression * exp;
609 struct Specifier * enumClass;
610 } __attribute__ ((gcc_struct)) array;
611 struct
612 {
613 struct __ecereNameSpace__ecere__sys__OldList * parameters;
614 } __attribute__ ((gcc_struct)) function;
615 struct
616 {
617 struct Pointer * pointer;
618 } __attribute__ ((gcc_struct)) pointer;
619 struct
620 {
621 struct ExtDecl * extended;
622 } __attribute__ ((gcc_struct)) extended;
623 } __attribute__ ((gcc_struct)) __anon1;
624 } __attribute__ ((gcc_struct));
625
626 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
627
628 struct FunctionDefinition
629 {
630 struct FunctionDefinition * prev;
631 struct FunctionDefinition * next;
632 struct Location loc;
633 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
634 struct Declarator * declarator;
635 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
636 struct Statement * body;
637 struct __ecereNameSpace__ecere__com__Class * _class;
638 struct __ecereNameSpace__ecere__sys__OldList attached;
639 int declMode;
640 struct Type * type;
641 struct Symbol * propSet;
642 int tempCount;
643 unsigned int propertyNoThis;
644 } __attribute__ ((gcc_struct));
645
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
647
648 struct DBTableDef;
649
650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
651
652 struct External
653 {
654 struct External * prev;
655 struct External * next;
656 struct Location loc;
657 int type;
658 struct Symbol * symbol;
659 union
660 {
661 struct FunctionDefinition * function;
662 struct ClassDefinition * _class;
663 struct Declaration * declaration;
664 char *  importString;
665 struct Identifier * id;
666 struct DBTableDef * table;
667 } __attribute__ ((gcc_struct)) __anon1;
668 int importType;
669 } __attribute__ ((gcc_struct));
670
671 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
672
673 struct ModuleImport
674 {
675 struct ModuleImport * prev;
676 struct ModuleImport * next;
677 char *  name;
678 struct __ecereNameSpace__ecere__sys__OldList classes;
679 struct __ecereNameSpace__ecere__sys__OldList functions;
680 int importType;
681 int importAccess;
682 } __attribute__ ((gcc_struct));
683
684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
685
686 struct ClassImport
687 {
688 struct ClassImport * prev;
689 struct ClassImport * next;
690 char *  name;
691 struct __ecereNameSpace__ecere__sys__OldList methods;
692 struct __ecereNameSpace__ecere__sys__OldList properties;
693 unsigned int itself;
694 int isRemote;
695 } __attribute__ ((gcc_struct));
696
697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
698
699 struct Symbol
700 {
701 char *  string;
702 struct Symbol * parent;
703 struct Symbol * left;
704 struct Symbol * right;
705 int depth;
706 struct Type * type;
707 union
708 {
709 struct __ecereNameSpace__ecere__com__Method * method;
710 struct __ecereNameSpace__ecere__com__Property * _property;
711 struct __ecereNameSpace__ecere__com__Class * registered;
712 } __attribute__ ((gcc_struct)) __anon1;
713 int id;
714 int idCode;
715 union
716 {
717 struct
718 {
719 struct External * pointerExternal;
720 struct External * structExternal;
721 } __attribute__ ((gcc_struct)) __anon1;
722 struct
723 {
724 struct External * externalGet;
725 struct External * externalSet;
726 struct External * externalPtr;
727 struct External * externalIsSet;
728 } __attribute__ ((gcc_struct)) __anon2;
729 struct
730 {
731 struct External * methodExternal;
732 struct External * methodCodeExternal;
733 } __attribute__ ((gcc_struct)) __anon3;
734 } __attribute__ ((gcc_struct)) __anon2;
735 unsigned int imported;
736 unsigned int declaredStructSym;
737 struct __ecereNameSpace__ecere__com__Class * _class;
738 unsigned int declaredStruct;
739 unsigned int needConstructor;
740 unsigned int needDestructor;
741 char *  constructorName;
742 char *  structName;
743 char *  className;
744 char *  destructorName;
745 struct ModuleImport * module;
746 struct ClassImport * _import;
747 struct Location nameLoc;
748 unsigned int isParam;
749 unsigned int isRemote;
750 unsigned int isStruct;
751 unsigned int fireWatchersDone;
752 int declaring;
753 unsigned int classData;
754 unsigned int isStatic;
755 char *  shortName;
756 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
757 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
758 struct Context * ctx;
759 int isIterator;
760 struct Expression * propCategory;
761 } __attribute__ ((gcc_struct));
762
763 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
764
765 struct Type
766 {
767 struct Type * prev;
768 struct Type * next;
769 int refCount;
770 union
771 {
772 struct Symbol * _class;
773 struct
774 {
775 struct __ecereNameSpace__ecere__sys__OldList members;
776 char *  enumName;
777 } __attribute__ ((gcc_struct)) __anon1;
778 struct
779 {
780 struct Type * returnType;
781 struct __ecereNameSpace__ecere__sys__OldList params;
782 struct Symbol * thisClass;
783 unsigned int staticMethod;
784 struct TemplateParameter * thisClassTemplate;
785 } __attribute__ ((gcc_struct)) __anon2;
786 struct
787 {
788 struct __ecereNameSpace__ecere__com__Method * method;
789 struct __ecereNameSpace__ecere__com__Class * methodClass;
790 struct __ecereNameSpace__ecere__com__Class * usedClass;
791 } __attribute__ ((gcc_struct)) __anon3;
792 struct
793 {
794 struct Type * arrayType;
795 int arraySize;
796 struct Expression * arraySizeExp;
797 unsigned int freeExp;
798 struct Symbol * enumClass;
799 } __attribute__ ((gcc_struct)) __anon4;
800 struct Type * type;
801 struct TemplateParameter * templateParameter;
802 } __attribute__ ((gcc_struct)) __anon1;
803 int kind;
804 unsigned int size;
805 char *  name;
806 char *  typeName;
807 int classObjectType;
808 int alignment;
809 unsigned int offset;
810 int bitFieldCount;
811 int count;
812 unsigned int isSigned : 1;
813 unsigned int constant : 1;
814 unsigned int truth : 1;
815 unsigned int byReference : 1;
816 unsigned int extraParam : 1;
817 unsigned int directClassAccess : 1;
818 unsigned int computing : 1;
819 unsigned int keepCast : 1;
820 unsigned int passAsTemplate : 1;
821 unsigned int dllExport : 1;
822 unsigned int attrStdcall : 1;
823 unsigned int declaredWithStruct : 1;
824 unsigned int typedByReference : 1;
825 unsigned int casted : 1;
826 } __attribute__ ((gcc_struct));
827
828 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
829
830 struct __ecereNameSpace__ecere__com__Class
831 {
832 struct __ecereNameSpace__ecere__com__Class * prev;
833 struct __ecereNameSpace__ecere__com__Class * next;
834 const char *  name;
835 int offset;
836 int structSize;
837 int (* *  _vTbl)();
838 int vTblSize;
839 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
840 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
841 int offsetClass;
842 int sizeClass;
843 struct __ecereNameSpace__ecere__com__Class * base;
844 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
845 struct __ecereNameSpace__ecere__sys__BinaryTree members;
846 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
847 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
848 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
849 struct __ecereNameSpace__ecere__sys__OldList derivatives;
850 int memberID;
851 int startMemberID;
852 int type;
853 struct __ecereNameSpace__ecere__com__Instance * module;
854 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
855 const char *  dataTypeString;
856 struct Type * dataType;
857 int typeSize;
858 int defaultAlignment;
859 void (*  Initialize)();
860 int memberOffset;
861 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
862 const char *  designerClass;
863 unsigned int noExpansion;
864 const char *  defaultProperty;
865 unsigned int comRedefinition;
866 int count;
867 int isRemote;
868 unsigned int internalDecl;
869 void *  data;
870 unsigned int computeSize;
871 int structAlignment;
872 int destructionWatchOffset;
873 unsigned int fixed;
874 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
875 int inheritanceAccess;
876 const char *  fullName;
877 void *  symbol;
878 struct __ecereNameSpace__ecere__sys__OldList conversions;
879 struct __ecereNameSpace__ecere__sys__OldList templateParams;
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
881 struct __ecereNameSpace__ecere__com__Class * templateClass;
882 struct __ecereNameSpace__ecere__sys__OldList templatized;
883 int numParams;
884 unsigned int isInstanceClass;
885 unsigned int byValueSystemClass;
886 } __attribute__ ((gcc_struct));
887
888 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
889
890 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
891
892 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
893
894 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
895
896 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
897
898 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);
899
900 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
901
902 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
903
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
905
906 struct __ecereNameSpace__ecere__com__Instance
907 {
908 int (* *  _vTbl)();
909 struct __ecereNameSpace__ecere__com__Class * _class;
910 int _refCount;
911 } __attribute__ ((gcc_struct));
912
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
914
915 struct __ecereNameSpace__ecere__com__DataMember
916 {
917 struct __ecereNameSpace__ecere__com__DataMember * prev;
918 struct __ecereNameSpace__ecere__com__DataMember * next;
919 const char *  name;
920 unsigned int isProperty;
921 int memberAccess;
922 int id;
923 struct __ecereNameSpace__ecere__com__Class * _class;
924 const char *  dataTypeString;
925 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
926 struct Type * dataType;
927 int type;
928 int offset;
929 int memberID;
930 struct __ecereNameSpace__ecere__sys__OldList members;
931 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
932 int memberOffset;
933 int structAlignment;
934 } __attribute__ ((gcc_struct));
935
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
937
938 struct __ecereNameSpace__ecere__com__SerialBuffer
939 {
940 unsigned char *  _buffer;
941 unsigned int count;
942 unsigned int _size;
943 unsigned int pos;
944 } __attribute__ ((gcc_struct));
945
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
947
948 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
949 {
950 union
951 {
952 struct
953 {
954 const char *  dataTypeString;
955 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
956 } __attribute__ ((gcc_struct)) __anon1;
957 struct __ecereNameSpace__ecere__com__DataValue expression;
958 struct
959 {
960 const char *  memberString;
961 union
962 {
963 struct __ecereNameSpace__ecere__com__DataMember * member;
964 struct __ecereNameSpace__ecere__com__Property * prop;
965 struct __ecereNameSpace__ecere__com__Method * method;
966 } __attribute__ ((gcc_struct)) __anon1;
967 } __attribute__ ((gcc_struct)) __anon2;
968 } __attribute__ ((gcc_struct)) __anon1;
969 } __attribute__ ((gcc_struct));
970
971 void exit(int status);
972
973 void * calloc(size_t nmemb, size_t size);
974
975 void free(void * ptr);
976
977 void * malloc(size_t size);
978
979 void * realloc(void * ptr, size_t size);
980
981 long int strtol(const char * nptr, char ** endptr, int base);
982
983 long long int strtoll(const char * nptr, char ** endptr, int base);
984
985 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
986
987 enum yytokentype
988 {
989 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
990 };
991
992 typedef union YYSTYPE
993 {
994 int specifierType;
995 int i;
996 int declMode;
997 struct Identifier * id;
998 struct Expression * exp;
999 struct Specifier * specifier;
1000 struct __ecereNameSpace__ecere__sys__OldList * list;
1001 struct Enumerator * enumerator;
1002 struct Declarator * declarator;
1003 struct Pointer * pointer;
1004 struct Initializer * initializer;
1005 struct InitDeclarator * initDeclarator;
1006 struct TypeName * typeName;
1007 struct Declaration * declaration;
1008 struct Statement * stmt;
1009 struct FunctionDefinition * function;
1010 struct External * external;
1011 struct Context * context;
1012 struct AsmField * asmField;
1013 struct Attrib * attrib;
1014 struct ExtDecl * extDecl;
1015 struct Attribute * attribute;
1016 struct Instantiation * instance;
1017 struct MembersInit * membersInit;
1018 struct MemberInit * memberInit;
1019 struct ClassFunction * classFunction;
1020 struct ClassDefinition * _class;
1021 struct ClassDef * classDef;
1022 struct PropertyDef * prop;
1023 char * string;
1024 struct Symbol * symbol;
1025 struct PropertyWatch * propertyWatch;
1026 struct TemplateParameter * templateParameter;
1027 struct TemplateArgument * templateArgument;
1028 struct TemplateDatatype * templateDatatype;
1029 struct DBTableEntry * dbtableEntry;
1030 struct DBIndexItem * dbindexItem;
1031 struct DBTableDef * dbtableDef;
1032 } __attribute__ ((gcc_struct)) YYSTYPE;
1033
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1035
1036 struct Enumerator
1037 {
1038 struct Enumerator * prev;
1039 struct Enumerator * next;
1040 struct Location loc;
1041 struct Identifier * id;
1042 struct Expression * exp;
1043 } __attribute__ ((gcc_struct));
1044
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1046
1047 struct InitDeclarator
1048 {
1049 struct InitDeclarator * prev;
1050 struct InitDeclarator * next;
1051 struct Location loc;
1052 struct Declarator * declarator;
1053 struct Initializer * initializer;
1054 } __attribute__ ((gcc_struct));
1055
1056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1057
1058 struct AsmField
1059 {
1060 struct AsmField * prev;
1061 struct AsmField * next;
1062 struct Location loc;
1063 char *  command;
1064 struct Expression * expression;
1065 struct Identifier * symbolic;
1066 } __attribute__ ((gcc_struct));
1067
1068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1069
1070 struct Attribute;
1071
1072 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1073
1074 struct ClassFunction
1075 {
1076 struct ClassFunction * prev;
1077 struct ClassFunction * next;
1078 struct Location loc;
1079 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1080 struct Declarator * declarator;
1081 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1082 struct Statement * body;
1083 struct __ecereNameSpace__ecere__com__Class * _class;
1084 struct __ecereNameSpace__ecere__sys__OldList attached;
1085 int declMode;
1086 struct Type * type;
1087 struct Symbol * propSet;
1088 unsigned int isVirtual;
1089 unsigned int isConstructor;
1090 unsigned int isDestructor;
1091 unsigned int dontMangle;
1092 int id;
1093 int idCode;
1094 } __attribute__ ((gcc_struct));
1095
1096 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1097
1098 struct MembersInit
1099 {
1100 struct MembersInit * prev;
1101 struct MembersInit * next;
1102 struct Location loc;
1103 int type;
1104 union
1105 {
1106 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1107 struct ClassFunction * function;
1108 } __attribute__ ((gcc_struct)) __anon1;
1109 } __attribute__ ((gcc_struct));
1110
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1112
1113 struct MemberInit
1114 {
1115 struct MemberInit * prev;
1116 struct MemberInit * next;
1117 struct Location loc;
1118 struct Location realLoc;
1119 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1120 struct Initializer * initializer;
1121 unsigned int used;
1122 unsigned int variable;
1123 unsigned int takeOutExp;
1124 } __attribute__ ((gcc_struct));
1125
1126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1127
1128 struct PropertyDef
1129 {
1130 struct PropertyDef * prev;
1131 struct PropertyDef * next;
1132 struct Location loc;
1133 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1134 struct Declarator * declarator;
1135 struct Identifier * id;
1136 struct Statement * getStmt;
1137 struct Statement * setStmt;
1138 struct Statement * issetStmt;
1139 struct Symbol * symbol;
1140 struct Expression * category;
1141 struct
1142 {
1143 unsigned int conversion : 1;
1144 unsigned int isWatchable : 1;
1145 unsigned int isDBProp : 1;
1146 } __attribute__ ((gcc_struct)) __anon1;
1147 } __attribute__ ((gcc_struct));
1148
1149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1150
1151 struct PropertyWatch
1152 {
1153 struct PropertyWatch * prev;
1154 struct PropertyWatch * next;
1155 struct Location loc;
1156 struct Statement * compound;
1157 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1158 unsigned int deleteWatch;
1159 } __attribute__ ((gcc_struct));
1160
1161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1162
1163 struct ClassDef
1164 {
1165 struct ClassDef * prev;
1166 struct ClassDef * next;
1167 struct Location loc;
1168 int type;
1169 union
1170 {
1171 struct Declaration * decl;
1172 struct ClassFunction * function;
1173 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1174 struct PropertyDef * propertyDef;
1175 struct PropertyWatch * propertyWatch;
1176 char *  designer;
1177 struct Identifier * defaultProperty;
1178 struct
1179 {
1180 struct Identifier * id;
1181 struct Initializer * initializer;
1182 } __attribute__ ((gcc_struct)) __anon1;
1183 } __attribute__ ((gcc_struct)) __anon1;
1184 int memberAccess;
1185 void *  object;
1186 } __attribute__ ((gcc_struct));
1187
1188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1189
1190 struct DBTableEntry;
1191
1192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1193
1194 struct DBIndexItem;
1195
1196 extern YYSTYPE yylval;
1197
1198 extern struct Location yylloc;
1199
1200 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1201
1202 extern int returnCode;
1203
1204 extern struct Expression * parsedExpression;
1205
1206 extern unsigned int yydebug;
1207
1208 void SetYydebug(unsigned int b)
1209 {
1210 yydebug = b;
1211 }
1212
1213 extern unsigned int echoOn;
1214
1215 void resetScanner();
1216
1217 int propWatcherID;
1218
1219 int expression_yyparse();
1220
1221 static struct Statement * curCompound;
1222
1223 struct External * curExternal, * afterExternal;
1224
1225 static struct Type * curSwitchType;
1226
1227 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1228
1229 struct __ecereNameSpace__ecere__com__Class * thisClass;
1230
1231 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1232 {
1233 thisClass = c;
1234 }
1235
1236 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1237 {
1238 return thisClass;
1239 }
1240
1241 static char * thisNameSpace;
1242
1243 struct __ecereNameSpace__ecere__com__Class * containerClass;
1244
1245 unsigned int thisClassParams = 1;
1246
1247 unsigned int internalValueCounter;
1248
1249 extern unsigned int outputLineNumbers;
1250
1251 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1252
1253 extern size_t strlen(const char * );
1254
1255 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1256
1257 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1258
1259 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1260
1261 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1262
1263 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1264
1265 void PrintExpression(struct Expression * exp, char * string)
1266 {
1267 {
1268 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1269 int count;
1270 unsigned int backOutputLineNumbers = outputLineNumbers;
1271
1272 outputLineNumbers = 0;
1273 if(exp)
1274 OutputExpression(exp, f);
1275 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1276 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1277
1278 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1279 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1280 count = strlen(string);
1281 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1282 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1283
1284 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1285 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1286 string[count] = '\0';
1287 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1288 outputLineNumbers = backOutputLineNumbers;
1289 }
1290 }
1291
1292 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1293
1294 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1295
1296 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1297 {
1298 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1299 {
1300 if(!param->baseType)
1301 {
1302 if(param->dataTypeString)
1303 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1304 else
1305 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1306 }
1307 return param->baseType;
1308 }
1309 return (((void *)0));
1310 }
1311
1312 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1313 {
1314 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1315 return 1;
1316 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1317 {
1318 return 0;
1319 }
1320 if(type1->kind == type2->kind)
1321 {
1322 switch(type1->kind)
1323 {
1324 case 24:
1325 case 1:
1326 case 2:
1327 case 3:
1328 case 4:
1329 case 22:
1330 case 23:
1331 if(type1->passAsTemplate && !type2->passAsTemplate)
1332 return 1;
1333 return type1->isSigned != type2->isSigned;
1334 case 8:
1335 return type1->__anon1._class != type2->__anon1._class;
1336 case 13:
1337 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1338 default:
1339 return 1;
1340 }
1341 }
1342 return 1;
1343 }
1344
1345 extern int strcmp(const char * , const char * );
1346
1347 extern struct Context * curContext;
1348
1349 extern struct Context * topContext;
1350
1351 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1352
1353 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);
1354
1355 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1356
1357 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);
1358
1359 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);
1360
1361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1362
1363 struct __ecereNameSpace__ecere__com__ClassProperty
1364 {
1365 const char *  name;
1366 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1367 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1368 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1369 int depth;
1370 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1371 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1372 const char *  dataTypeString;
1373 struct Type * dataType;
1374 unsigned int constant;
1375 } __attribute__ ((gcc_struct));
1376
1377 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1378
1379 extern struct Expression * QMkExpId(const char *  id);
1380
1381 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1382
1383 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1384 {
1385 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1387 const char *  name;
1388 int type;
1389 union
1390 {
1391 const char *  dataTypeString;
1392 int memberType;
1393 } __attribute__ ((gcc_struct)) __anon1;
1394 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1395 void *  param;
1396 } __attribute__ ((gcc_struct));
1397
1398 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1399
1400 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1401
1402 extern void FreeIdentifier(struct Identifier * id);
1403
1404 void ProcessExpressionType(struct Expression * exp);
1405
1406 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1407
1408 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1409
1410 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1411
1412 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1413
1414 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1415
1416 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1417
1418 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1419
1420 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1421
1422 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1423 {
1424 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1425 {
1426 struct Identifier * id = exp->__anon1.__anon1.identifier;
1427 struct Context * ctx;
1428 struct Symbol * symbol = (((void *)0));
1429
1430 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1431 {
1432 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1433 {
1434 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1435 if(symbol)
1436 break;
1437 }
1438 }
1439 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))))
1440 {
1441 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1442 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1443 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1444 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1445
1446 if(!prop)
1447 {
1448 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1449 }
1450 if(!prop && !method)
1451 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1452 if(!prop && !method && !member)
1453 {
1454 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1455 }
1456 if(prop || method || member || classProp)
1457 {
1458 exp->type = 8;
1459 exp->__anon1.member.member = id;
1460 exp->__anon1.member.memberType = 0;
1461 exp->__anon1.member.exp = QMkExpId("this");
1462 exp->addedThis = 1;
1463 }
1464 else if(_class && _class->templateParams.first)
1465 {
1466 struct __ecereNameSpace__ecere__com__Class * sClass;
1467
1468 for(sClass = _class; sClass; sClass = sClass->base)
1469 {
1470 if(sClass->templateParams.first)
1471 {
1472 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1473
1474 for(param = sClass->templateParams.first; param; param = param->next)
1475 {
1476 if(param->type == 2 && !strcmp(param->name, id->string))
1477 {
1478 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1479
1480 if(argExp)
1481 {
1482 struct Declarator * decl;
1483 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1484
1485 FreeIdentifier(exp->__anon1.member.member);
1486 ProcessExpressionType(argExp);
1487 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1488 exp->expType = ProcessType(specs, decl);
1489 exp->type = 5;
1490 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1491 }
1492 }
1493 }
1494 }
1495 }
1496 }
1497 }
1498 }
1499 }
1500
1501 extern int sprintf(char * , const char * , ...);
1502
1503 extern char *  strcat(char * , const char * );
1504
1505 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1506
1507 char * PrintInt(long long result)
1508 {
1509 char temp[100];
1510
1511 if(result > (((int)0x7fffffff)))
1512 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1513 else
1514 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1515 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1516 strcat(temp, "LL");
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintUInt(uint64 result)
1521 {
1522 char temp[100];
1523
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else if(result > (((int)0x7fffffff)))
1527 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1528 else
1529 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 }
1532
1533 char * PrintInt64(long long result)
1534 {
1535 char temp[100];
1536
1537 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1538 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
1539 else
1540 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 }
1543
1544 char * PrintUInt64(uint64 result)
1545 {
1546 char temp[100];
1547
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1550 else if(result > (((int)0x7fffffff)))
1551 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1552 else
1553 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1555 }
1556
1557 char * PrintHexUInt(uint64 result)
1558 {
1559 char temp[100];
1560
1561 if(result > (0xffffffff))
1562 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1563 else
1564 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1565 if(result > (0xffffffff))
1566 strcat(temp, "LL");
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1568 }
1569
1570 char * PrintHexUInt64(uint64 result)
1571 {
1572 char temp[100];
1573
1574 if(result > (0xffffffff))
1575 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1576 else
1577 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1578 return __ecereNameSpace__ecere__sys__CopyString(temp);
1579 }
1580
1581 char * PrintShort(short result)
1582 {
1583 char temp[100];
1584
1585 sprintf(temp, "%d", (unsigned short)result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 }
1588
1589 char * PrintUShort(unsigned short result)
1590 {
1591 char temp[100];
1592
1593 if(result > (unsigned short)32767)
1594 sprintf(temp, "0x%X", (int)result);
1595 else
1596 sprintf(temp, "%d", (int)result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1598 }
1599
1600 extern int isprint(int c);
1601
1602 char * PrintChar(char result)
1603 {
1604 char temp[100];
1605
1606 if(result > (char)0 && isprint(result))
1607 sprintf(temp, "'%c'", result);
1608 else if(result < (char)0)
1609 sprintf(temp, "%d", (int)result);
1610 else
1611 sprintf(temp, "0x%X", (unsigned char)result);
1612 return __ecereNameSpace__ecere__sys__CopyString(temp);
1613 }
1614
1615 char * PrintUChar(unsigned char result)
1616 {
1617 char temp[100];
1618
1619 sprintf(temp, "0x%X", result);
1620 return __ecereNameSpace__ecere__sys__CopyString(temp);
1621 }
1622
1623 extern char *  strcpy(char * , const char * );
1624
1625 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1626
1627 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
1628
1629 extern int (* __ecereProp_float_Get_signBit)(float this);
1630
1631 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
1632
1633 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1634
1635 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
1636
1637 char * PrintFloat(float result)
1638 {
1639 char temp[350];
1640
1641 if(__ecereProp_float_Get_isInf(result))
1642 {
1643 if(__ecereProp_float_Get_signBit(result))
1644 strcpy(temp, "-inf");
1645 else
1646 strcpy(temp, "inf");
1647 }
1648 else if(__ecereProp_float_Get_isNan(result))
1649 {
1650 if(__ecereProp_float_Get_signBit(result))
1651 strcpy(temp, "-nan");
1652 else
1653 strcpy(temp, "nan");
1654 }
1655 else
1656 sprintf(temp, "%.16ff", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1658 }
1659
1660 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1661
1662 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
1663
1664 extern int (* __ecereProp_double_Get_signBit)(double this);
1665
1666 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
1667
1668 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1669
1670 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
1671
1672 char * PrintDouble(double result)
1673 {
1674 char temp[350];
1675
1676 if(__ecereProp_double_Get_isInf(result))
1677 {
1678 if(__ecereProp_double_Get_signBit(result))
1679 strcpy(temp, "-inf");
1680 else
1681 strcpy(temp, "inf");
1682 }
1683 else if(__ecereProp_double_Get_isNan(result))
1684 {
1685 if(__ecereProp_double_Get_signBit(result))
1686 strcpy(temp, "-nan");
1687 else
1688 strcpy(temp, "nan");
1689 }
1690 else
1691 sprintf(temp, "%.16f", result);
1692 return __ecereNameSpace__ecere__sys__CopyString(temp);
1693 }
1694
1695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1696
1697 struct OpTable
1698 {
1699 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1705 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1706 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1707 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1719 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  Not)(struct Expression *, struct Operand *);
1725 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1728 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1729 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1730 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1731 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1732 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1733 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1734 } __attribute__ ((gcc_struct));
1735
1736 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1737
1738 struct Operand
1739 {
1740 int kind;
1741 struct Type * type;
1742 unsigned int ptrSize;
1743 union
1744 {
1745 char c;
1746 unsigned char uc;
1747 short s;
1748 unsigned short us;
1749 int i;
1750 unsigned int ui;
1751 float f;
1752 double d;
1753 long long i64;
1754 uint64 ui64;
1755 } __attribute__ ((gcc_struct)) __anon1;
1756 struct OpTable ops;
1757 } __attribute__ ((gcc_struct));
1758
1759 unsigned int GetOpInt(struct Operand * op2, int * value2)
1760 {
1761 if(op2->kind == 3 && op2->type->isSigned)
1762 *value2 = op2->__anon1.i;
1763 else if(op2->kind == 3)
1764 *value2 = (int)op2->__anon1.ui;
1765 else if(op2->kind == 4 && op2->type->isSigned)
1766 *value2 = (int)op2->__anon1.i64;
1767 else if(op2->kind == 4)
1768 *value2 = (int)op2->__anon1.ui64;
1769 else if(op2->kind == 23 && op2->type->isSigned)
1770 *value2 = (int)op2->__anon1.i64;
1771 else if(op2->kind == 23)
1772 *value2 = (int)op2->__anon1.ui64;
1773 else if(op2->kind == 22 && op2->type->isSigned)
1774 *value2 = (int)op2->__anon1.i64;
1775 else if(op2->kind == 22)
1776 *value2 = (int)op2->__anon1.ui64;
1777 else if(op2->kind == 2 && op2->type->isSigned)
1778 *value2 = (int)op2->__anon1.s;
1779 else if(op2->kind == 2)
1780 *value2 = (int)op2->__anon1.us;
1781 else if(op2->kind == 1 && op2->type->isSigned)
1782 *value2 = (int)op2->__anon1.c;
1783 else if(op2->kind == 24 || op2->kind == 1)
1784 *value2 = (int)op2->__anon1.uc;
1785 else if(op2->kind == 6)
1786 *value2 = (int)op2->__anon1.f;
1787 else if(op2->kind == 7)
1788 *value2 = (int)op2->__anon1.d;
1789 else if(op2->kind == 13)
1790 *value2 = (int)op2->__anon1.ui64;
1791 else
1792 return 0;
1793 return 1;
1794 }
1795
1796 struct Operand GetOperand(struct Expression * exp);
1797
1798 unsigned int GetInt(struct Expression * exp, int * value2)
1799 {
1800 struct Operand op2 = GetOperand(exp);
1801
1802 return GetOpInt(&op2, value2);
1803 }
1804
1805 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1806 {
1807 if(op2->kind == 3 && op2->type->isSigned)
1808 *value2 = (unsigned int)op2->__anon1.i;
1809 else if(op2->kind == 3)
1810 *value2 = op2->__anon1.ui;
1811 else if(op2->kind == 4 && op2->type->isSigned)
1812 *value2 = (unsigned int)op2->__anon1.i64;
1813 else if(op2->kind == 4)
1814 *value2 = (unsigned int)op2->__anon1.ui64;
1815 else if(op2->kind == 23 && op2->type->isSigned)
1816 *value2 = (unsigned int)op2->__anon1.i64;
1817 else if(op2->kind == 23)
1818 *value2 = (unsigned int)op2->__anon1.ui64;
1819 else if(op2->kind == 22 && op2->type->isSigned)
1820 *value2 = (unsigned int)op2->__anon1.i64;
1821 else if(op2->kind == 22)
1822 *value2 = (unsigned int)op2->__anon1.ui64;
1823 else if(op2->kind == 2 && op2->type->isSigned)
1824 *value2 = (unsigned int)op2->__anon1.s;
1825 else if(op2->kind == 2)
1826 *value2 = (unsigned int)op2->__anon1.us;
1827 else if(op2->kind == 1 && op2->type->isSigned)
1828 *value2 = (unsigned int)op2->__anon1.c;
1829 else if(op2->kind == 24 || op2->kind == 1)
1830 *value2 = (unsigned int)op2->__anon1.uc;
1831 else if(op2->kind == 6)
1832 *value2 = (unsigned int)op2->__anon1.f;
1833 else if(op2->kind == 7)
1834 *value2 = (unsigned int)op2->__anon1.d;
1835 else if(op2->kind == 13)
1836 *value2 = (unsigned int)op2->__anon1.ui64;
1837 else
1838 return 0;
1839 return 1;
1840 }
1841
1842 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1843 {
1844 struct Operand op2 = GetOperand(exp);
1845
1846 return GetOpUInt(&op2, value2);
1847 }
1848
1849 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1850 {
1851 if(op2->kind == 3 && op2->type->isSigned)
1852 *value2 = (long long)op2->__anon1.i;
1853 else if(op2->kind == 3)
1854 *value2 = (long long)op2->__anon1.ui;
1855 else if(op2->kind == 4 && op2->type->isSigned)
1856 *value2 = op2->__anon1.i64;
1857 else if(op2->kind == 4)
1858 *value2 = (long long)op2->__anon1.ui64;
1859 else if(op2->kind == 23 && op2->type->isSigned)
1860 *value2 = op2->__anon1.i64;
1861 else if(op2->kind == 23)
1862 *value2 = (long long)op2->__anon1.ui64;
1863 else if(op2->kind == 22 && op2->type->isSigned)
1864 *value2 = op2->__anon1.i64;
1865 else if(op2->kind == 22)
1866 *value2 = (long long)op2->__anon1.ui64;
1867 else if(op2->kind == 2 && op2->type->isSigned)
1868 *value2 = (long long)op2->__anon1.s;
1869 else if(op2->kind == 2)
1870 *value2 = (long long)op2->__anon1.us;
1871 else if(op2->kind == 1 && op2->type->isSigned)
1872 *value2 = (long long)op2->__anon1.c;
1873 else if(op2->kind == 24 || op2->kind == 1)
1874 *value2 = (long long)op2->__anon1.uc;
1875 else if(op2->kind == 6)
1876 *value2 = (long long)op2->__anon1.f;
1877 else if(op2->kind == 7)
1878 *value2 = (long long)op2->__anon1.d;
1879 else if(op2->kind == 13)
1880 *value2 = (long long)op2->__anon1.ui64;
1881 else
1882 return 0;
1883 return 1;
1884 }
1885
1886 unsigned int GetInt64(struct Expression * exp, long long * value2)
1887 {
1888 struct Operand op2 = GetOperand(exp);
1889
1890 return GetOpInt64(&op2, value2);
1891 }
1892
1893 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1894 {
1895 if(op2->kind == 3 && op2->type->isSigned)
1896 *value2 = (uint64)op2->__anon1.i;
1897 else if(op2->kind == 3)
1898 *value2 = (uint64)op2->__anon1.ui;
1899 else if(op2->kind == 4 && op2->type->isSigned)
1900 *value2 = (uint64)op2->__anon1.i64;
1901 else if(op2->kind == 4)
1902 *value2 = op2->__anon1.ui64;
1903 else if(op2->kind == 23 && op2->type->isSigned)
1904 *value2 = (uint64)op2->__anon1.i64;
1905 else if(op2->kind == 23)
1906 *value2 = op2->__anon1.ui64;
1907 else if(op2->kind == 22 && op2->type->isSigned)
1908 *value2 = (uint64)op2->__anon1.i64;
1909 else if(op2->kind == 22)
1910 *value2 = op2->__anon1.ui64;
1911 else if(op2->kind == 2 && op2->type->isSigned)
1912 *value2 = (uint64)op2->__anon1.s;
1913 else if(op2->kind == 2)
1914 *value2 = (uint64)op2->__anon1.us;
1915 else if(op2->kind == 1 && op2->type->isSigned)
1916 *value2 = (uint64)op2->__anon1.c;
1917 else if(op2->kind == 24 || op2->kind == 1)
1918 *value2 = (uint64)op2->__anon1.uc;
1919 else if(op2->kind == 6)
1920 *value2 = (uint64)op2->__anon1.f;
1921 else if(op2->kind == 7)
1922 *value2 = (uint64)op2->__anon1.d;
1923 else if(op2->kind == 13)
1924 *value2 = op2->__anon1.ui64;
1925 else
1926 return 0;
1927 return 1;
1928 }
1929
1930 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1931 {
1932 struct Operand op2 = GetOperand(exp);
1933
1934 return GetOpUInt64(&op2, value2);
1935 }
1936
1937 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1938 {
1939 if(op2->kind == 3 && op2->type->isSigned)
1940 *value2 = (intptr_t)op2->__anon1.i;
1941 else if(op2->kind == 3)
1942 *value2 = (intptr_t)op2->__anon1.ui;
1943 else if(op2->kind == 4 && op2->type->isSigned)
1944 *value2 = (intptr_t)op2->__anon1.i64;
1945 else if(op2->kind == 4)
1946 *value2 = (intptr_t)op2->__anon1.ui64;
1947 else if(op2->kind == 23 && op2->type->isSigned)
1948 *value2 = (intptr_t)op2->__anon1.i64;
1949 else if(op2->kind == 23)
1950 *value2 = (intptr_t)op2->__anon1.ui64;
1951 else if(op2->kind == 22 && op2->type->isSigned)
1952 *value2 = (intptr_t)op2->__anon1.i64;
1953 else if(op2->kind == 22)
1954 *value2 = (intptr_t)op2->__anon1.ui64;
1955 else if(op2->kind == 2 && op2->type->isSigned)
1956 *value2 = (intptr_t)op2->__anon1.s;
1957 else if(op2->kind == 2)
1958 *value2 = (intptr_t)op2->__anon1.us;
1959 else if(op2->kind == 1 && op2->type->isSigned)
1960 *value2 = (intptr_t)op2->__anon1.c;
1961 else if(op2->kind == 24 || op2->kind == 1)
1962 *value2 = (intptr_t)op2->__anon1.uc;
1963 else if(op2->kind == 6)
1964 *value2 = (intptr_t)op2->__anon1.f;
1965 else if(op2->kind == 7)
1966 *value2 = (intptr_t)op2->__anon1.d;
1967 else if(op2->kind == 13)
1968 *value2 = (intptr_t)op2->__anon1.ui64;
1969 else
1970 return 0;
1971 return 1;
1972 }
1973
1974 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1975 {
1976 struct Operand op2 = GetOperand(exp);
1977
1978 return GetOpIntPtr(&op2, value2);
1979 }
1980
1981 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1982 {
1983 if(op2->kind == 3 && op2->type->isSigned)
1984 *value2 = (uintptr_t)op2->__anon1.i;
1985 else if(op2->kind == 3)
1986 *value2 = (uintptr_t)op2->__anon1.ui;
1987 else if(op2->kind == 4 && op2->type->isSigned)
1988 *value2 = (uintptr_t)op2->__anon1.i64;
1989 else if(op2->kind == 4)
1990 *value2 = (uintptr_t)op2->__anon1.ui64;
1991 else if(op2->kind == 23 && op2->type->isSigned)
1992 *value2 = (uintptr_t)op2->__anon1.i64;
1993 else if(op2->kind == 23)
1994 *value2 = (uintptr_t)op2->__anon1.ui64;
1995 else if(op2->kind == 22 && op2->type->isSigned)
1996 *value2 = (uintptr_t)op2->__anon1.i64;
1997 else if(op2->kind == 22)
1998 *value2 = (uintptr_t)op2->__anon1.ui64;
1999 else if(op2->kind == 2 && op2->type->isSigned)
2000 *value2 = (uintptr_t)op2->__anon1.s;
2001 else if(op2->kind == 2)
2002 *value2 = (uintptr_t)op2->__anon1.us;
2003 else if(op2->kind == 1 && op2->type->isSigned)
2004 *value2 = (uintptr_t)op2->__anon1.c;
2005 else if(op2->kind == 24 || op2->kind == 1)
2006 *value2 = (uintptr_t)op2->__anon1.uc;
2007 else if(op2->kind == 6)
2008 *value2 = (uintptr_t)op2->__anon1.f;
2009 else if(op2->kind == 7)
2010 *value2 = (uintptr_t)op2->__anon1.d;
2011 else if(op2->kind == 13)
2012 *value2 = (uintptr_t)op2->__anon1.ui64;
2013 else
2014 return 0;
2015 return 1;
2016 }
2017
2018 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2019 {
2020 struct Operand op2 = GetOperand(exp);
2021
2022 return GetOpUIntPtr(&op2, value2);
2023 }
2024
2025 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2026 {
2027 if(op2->kind == 3 && op2->type->isSigned)
2028 *value2 = (ssize_t)op2->__anon1.i;
2029 else if(op2->kind == 3)
2030 *value2 = (ssize_t)op2->__anon1.ui;
2031 else if(op2->kind == 4 && op2->type->isSigned)
2032 *value2 = (ssize_t)op2->__anon1.i64;
2033 else if(op2->kind == 4)
2034 *value2 = (ssize_t)op2->__anon1.ui64;
2035 else if(op2->kind == 23 && op2->type->isSigned)
2036 *value2 = (ssize_t)op2->__anon1.i64;
2037 else if(op2->kind == 23)
2038 *value2 = (ssize_t)op2->__anon1.ui64;
2039 else if(op2->kind == 22 && op2->type->isSigned)
2040 *value2 = (ssize_t)op2->__anon1.i64;
2041 else if(op2->kind == 22)
2042 *value2 = (ssize_t)op2->__anon1.ui64;
2043 else if(op2->kind == 2 && op2->type->isSigned)
2044 *value2 = (ssize_t)op2->__anon1.s;
2045 else if(op2->kind == 2)
2046 *value2 = (ssize_t)op2->__anon1.us;
2047 else if(op2->kind == 1 && op2->type->isSigned)
2048 *value2 = (ssize_t)op2->__anon1.c;
2049 else if(op2->kind == 24 || op2->kind == 1)
2050 *value2 = (ssize_t)op2->__anon1.uc;
2051 else if(op2->kind == 6)
2052 *value2 = (ssize_t)op2->__anon1.f;
2053 else if(op2->kind == 7)
2054 *value2 = (ssize_t)op2->__anon1.d;
2055 else if(op2->kind == 13)
2056 *value2 = (ssize_t)op2->__anon1.ui64;
2057 else
2058 return 0;
2059 return 1;
2060 }
2061
2062 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2063 {
2064 struct Operand op2 = GetOperand(exp);
2065
2066 return GetOpIntSize(&op2, value2);
2067 }
2068
2069 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2070 {
2071 if(op2->kind == 3 && op2->type->isSigned)
2072 *value2 = (size_t)op2->__anon1.i;
2073 else if(op2->kind == 3)
2074 *value2 = (size_t)op2->__anon1.ui;
2075 else if(op2->kind == 4 && op2->type->isSigned)
2076 *value2 = (size_t)op2->__anon1.i64;
2077 else if(op2->kind == 4)
2078 *value2 = (size_t)op2->__anon1.ui64;
2079 else if(op2->kind == 23 && op2->type->isSigned)
2080 *value2 = (size_t)op2->__anon1.i64;
2081 else if(op2->kind == 23)
2082 *value2 = (size_t)op2->__anon1.ui64;
2083 else if(op2->kind == 22 && op2->type->isSigned)
2084 *value2 = (size_t)op2->__anon1.i64;
2085 else if(op2->kind == 22)
2086 *value2 = (size_t)op2->__anon1.ui64;
2087 else if(op2->kind == 2 && op2->type->isSigned)
2088 *value2 = (size_t)op2->__anon1.s;
2089 else if(op2->kind == 2)
2090 *value2 = (size_t)op2->__anon1.us;
2091 else if(op2->kind == 1 && op2->type->isSigned)
2092 *value2 = (size_t)op2->__anon1.c;
2093 else if(op2->kind == 24 || op2->kind == 1)
2094 *value2 = (size_t)op2->__anon1.uc;
2095 else if(op2->kind == 6)
2096 *value2 = (size_t)op2->__anon1.f;
2097 else if(op2->kind == 7)
2098 *value2 = (size_t)op2->__anon1.d;
2099 else if(op2->kind == 13)
2100 *value2 = (size_t)op2->__anon1.ui64;
2101 else
2102 return 0;
2103 return 1;
2104 }
2105
2106 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2107 {
2108 struct Operand op2 = GetOperand(exp);
2109
2110 return GetOpUIntSize(&op2, value2);
2111 }
2112
2113 unsigned int GetOpShort(struct Operand * op2, short * value2)
2114 {
2115 if(op2->kind == 3 && op2->type->isSigned)
2116 *value2 = (short)op2->__anon1.i;
2117 else if(op2->kind == 3)
2118 *value2 = (short)op2->__anon1.ui;
2119 else if(op2->kind == 4 && op2->type->isSigned)
2120 *value2 = (short)op2->__anon1.i64;
2121 else if(op2->kind == 4)
2122 *value2 = (short)op2->__anon1.ui64;
2123 else if(op2->kind == 23 && op2->type->isSigned)
2124 *value2 = (short)op2->__anon1.i64;
2125 else if(op2->kind == 23)
2126 *value2 = (short)op2->__anon1.ui64;
2127 else if(op2->kind == 22 && op2->type->isSigned)
2128 *value2 = (short)op2->__anon1.i64;
2129 else if(op2->kind == 22)
2130 *value2 = (short)op2->__anon1.ui64;
2131 else if(op2->kind == 2 && op2->type->isSigned)
2132 *value2 = op2->__anon1.s;
2133 else if(op2->kind == 2)
2134 *value2 = (short)op2->__anon1.us;
2135 else if(op2->kind == 1 && op2->type->isSigned)
2136 *value2 = (short)op2->__anon1.c;
2137 else if(op2->kind == 24 || op2->kind == 1)
2138 *value2 = (short)op2->__anon1.uc;
2139 else if(op2->kind == 6)
2140 *value2 = (short)op2->__anon1.f;
2141 else if(op2->kind == 7)
2142 *value2 = (short)op2->__anon1.d;
2143 else if(op2->kind == 13)
2144 *value2 = (short)op2->__anon1.ui64;
2145 else
2146 return 0;
2147 return 1;
2148 }
2149
2150 unsigned int GetShort(struct Expression * exp, short * value2)
2151 {
2152 struct Operand op2 = GetOperand(exp);
2153
2154 return GetOpShort(&op2, value2);
2155 }
2156
2157 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2158 {
2159 if(op2->kind == 3 && op2->type->isSigned)
2160 *value2 = (unsigned short)op2->__anon1.i;
2161 else if(op2->kind == 3)
2162 *value2 = (unsigned short)op2->__anon1.ui;
2163 else if(op2->kind == 4 && op2->type->isSigned)
2164 *value2 = (unsigned short)op2->__anon1.i64;
2165 else if(op2->kind == 4)
2166 *value2 = (unsigned short)op2->__anon1.ui64;
2167 else if(op2->kind == 23 && op2->type->isSigned)
2168 *value2 = (unsigned short)op2->__anon1.i64;
2169 else if(op2->kind == 23)
2170 *value2 = (unsigned short)op2->__anon1.ui64;
2171 else if(op2->kind == 22 && op2->type->isSigned)
2172 *value2 = (unsigned short)op2->__anon1.i64;
2173 else if(op2->kind == 22)
2174 *value2 = (unsigned short)op2->__anon1.ui64;
2175 else if(op2->kind == 2 && op2->type->isSigned)
2176 *value2 = (unsigned short)op2->__anon1.s;
2177 else if(op2->kind == 2)
2178 *value2 = op2->__anon1.us;
2179 else if(op2->kind == 1 && op2->type->isSigned)
2180 *value2 = (unsigned short)op2->__anon1.c;
2181 else if(op2->kind == 24 || op2->kind == 1)
2182 *value2 = (unsigned short)op2->__anon1.uc;
2183 else if(op2->kind == 6)
2184 *value2 = (unsigned short)op2->__anon1.f;
2185 else if(op2->kind == 7)
2186 *value2 = (unsigned short)op2->__anon1.d;
2187 else if(op2->kind == 13)
2188 *value2 = (unsigned short)op2->__anon1.ui64;
2189 else
2190 return 0;
2191 return 1;
2192 }
2193
2194 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2195 {
2196 struct Operand op2 = GetOperand(exp);
2197
2198 return GetOpUShort(&op2, value2);
2199 }
2200
2201 unsigned int GetOpChar(struct Operand * op2, char * value2)
2202 {
2203 if(op2->kind == 3 && op2->type->isSigned)
2204 *value2 = (char)op2->__anon1.i;
2205 else if(op2->kind == 3)
2206 *value2 = (char)op2->__anon1.ui;
2207 else if(op2->kind == 4 && op2->type->isSigned)
2208 *value2 = (char)op2->__anon1.i64;
2209 else if(op2->kind == 4)
2210 *value2 = (char)op2->__anon1.ui64;
2211 else if(op2->kind == 23 && op2->type->isSigned)
2212 *value2 = (char)op2->__anon1.i64;
2213 else if(op2->kind == 23)
2214 *value2 = (char)op2->__anon1.ui64;
2215 else if(op2->kind == 22 && op2->type->isSigned)
2216 *value2 = (char)op2->__anon1.i64;
2217 else if(op2->kind == 22)
2218 *value2 = (char)op2->__anon1.ui64;
2219 else if(op2->kind == 2 && op2->type->isSigned)
2220 *value2 = (char)op2->__anon1.s;
2221 else if(op2->kind == 2)
2222 *value2 = (char)op2->__anon1.us;
2223 else if(op2->kind == 1 && op2->type->isSigned)
2224 *value2 = op2->__anon1.c;
2225 else if(op2->kind == 24 || op2->kind == 1)
2226 *value2 = (char)op2->__anon1.uc;
2227 else if(op2->kind == 6)
2228 *value2 = (char)op2->__anon1.f;
2229 else if(op2->kind == 7)
2230 *value2 = (char)op2->__anon1.d;
2231 else if(op2->kind == 13)
2232 *value2 = (char)op2->__anon1.ui64;
2233 else
2234 return 0;
2235 return 1;
2236 }
2237
2238 unsigned int GetChar(struct Expression * exp, char * value2)
2239 {
2240 struct Operand op2 = GetOperand(exp);
2241
2242 return GetOpChar(&op2, value2);
2243 }
2244
2245 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2246 {
2247 if(op2->kind == 3 && op2->type->isSigned)
2248 *value2 = (unsigned char)op2->__anon1.i;
2249 else if(op2->kind == 3)
2250 *value2 = (unsigned char)op2->__anon1.ui;
2251 else if(op2->kind == 4 && op2->type->isSigned)
2252 *value2 = (unsigned char)op2->__anon1.i64;
2253 else if(op2->kind == 4)
2254 *value2 = (unsigned char)op2->__anon1.ui64;
2255 else if(op2->kind == 23 && op2->type->isSigned)
2256 *value2 = (unsigned char)op2->__anon1.i64;
2257 else if(op2->kind == 23)
2258 *value2 = (unsigned char)op2->__anon1.ui64;
2259 else if(op2->kind == 22 && op2->type->isSigned)
2260 *value2 = (unsigned char)op2->__anon1.i64;
2261 else if(op2->kind == 22)
2262 *value2 = (unsigned char)op2->__anon1.ui64;
2263 else if(op2->kind == 2 && op2->type->isSigned)
2264 *value2 = (unsigned char)op2->__anon1.s;
2265 else if(op2->kind == 2)
2266 *value2 = (unsigned char)op2->__anon1.us;
2267 else if(op2->kind == 1 && op2->type->isSigned)
2268 *value2 = (unsigned char)op2->__anon1.c;
2269 else if(op2->kind == 24 || op2->kind == 1)
2270 *value2 = op2->__anon1.uc;
2271 else if(op2->kind == 6)
2272 *value2 = (unsigned char)op2->__anon1.f;
2273 else if(op2->kind == 7)
2274 *value2 = (unsigned char)op2->__anon1.d;
2275 else if(op2->kind == 13)
2276 *value2 = (unsigned char)op2->__anon1.ui64;
2277 else
2278 return 0;
2279 return 1;
2280 }
2281
2282 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2283 {
2284 struct Operand op2 = GetOperand(exp);
2285
2286 return GetOpUChar(&op2, value2);
2287 }
2288
2289 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2290 {
2291 if(op2->kind == 3 && op2->type->isSigned)
2292 *value2 = (float)(float)op2->__anon1.i;
2293 else if(op2->kind == 3)
2294 *value2 = (float)(float)op2->__anon1.ui;
2295 else if(op2->kind == 4 && op2->type->isSigned)
2296 *value2 = (float)(float)op2->__anon1.i64;
2297 else if(op2->kind == 4)
2298 *value2 = (float)(float)op2->__anon1.ui64;
2299 else if(op2->kind == 23 && op2->type->isSigned)
2300 *value2 = (float)(float)op2->__anon1.i64;
2301 else if(op2->kind == 23)
2302 *value2 = (float)(float)op2->__anon1.ui64;
2303 else if(op2->kind == 22 && op2->type->isSigned)
2304 *value2 = (float)(float)op2->__anon1.i64;
2305 else if(op2->kind == 22)
2306 *value2 = (float)(float)op2->__anon1.ui64;
2307 else if(op2->kind == 2 && op2->type->isSigned)
2308 *value2 = (float)(float)op2->__anon1.s;
2309 else if(op2->kind == 2)
2310 *value2 = (float)(float)op2->__anon1.us;
2311 else if(op2->kind == 1 && op2->type->isSigned)
2312 *value2 = (float)(float)op2->__anon1.c;
2313 else if(op2->kind == 24 || op2->kind == 1)
2314 *value2 = (float)(float)op2->__anon1.uc;
2315 else if(op2->kind == 6)
2316 *value2 = (float)op2->__anon1.f;
2317 else if(op2->kind == 7)
2318 *value2 = (float)op2->__anon1.d;
2319 else if(op2->kind == 13)
2320 *value2 = (float)(float)op2->__anon1.ui64;
2321 else
2322 return 0;
2323 return 1;
2324 }
2325
2326 unsigned int GetFloat(struct Expression * exp, float * value2)
2327 {
2328 struct Operand op2 = GetOperand(exp);
2329
2330 return GetOpFloat(&op2, value2);
2331 }
2332
2333 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2334 {
2335 if(op2->kind == 3 && op2->type->isSigned)
2336 *value2 = (double)(double)op2->__anon1.i;
2337 else if(op2->kind == 3)
2338 *value2 = (double)(double)op2->__anon1.ui;
2339 else if(op2->kind == 4 && op2->type->isSigned)
2340 *value2 = (double)(double)op2->__anon1.i64;
2341 else if(op2->kind == 4)
2342 *value2 = (double)(double)op2->__anon1.ui64;
2343 else if(op2->kind == 23 && op2->type->isSigned)
2344 *value2 = (double)(double)op2->__anon1.i64;
2345 else if(op2->kind == 23)
2346 *value2 = (double)(double)op2->__anon1.ui64;
2347 else if(op2->kind == 22 && op2->type->isSigned)
2348 *value2 = (double)(double)op2->__anon1.i64;
2349 else if(op2->kind == 22)
2350 *value2 = (double)(double)op2->__anon1.ui64;
2351 else if(op2->kind == 2 && op2->type->isSigned)
2352 *value2 = (double)(double)op2->__anon1.s;
2353 else if(op2->kind == 2)
2354 *value2 = (double)(double)op2->__anon1.us;
2355 else if(op2->kind == 1 && op2->type->isSigned)
2356 *value2 = (double)(double)op2->__anon1.c;
2357 else if(op2->kind == 24 || op2->kind == 1)
2358 *value2 = (double)(double)op2->__anon1.uc;
2359 else if(op2->kind == 6)
2360 *value2 = (double)op2->__anon1.f;
2361 else if(op2->kind == 7)
2362 *value2 = (double)op2->__anon1.d;
2363 else if(op2->kind == 13)
2364 *value2 = (double)(double)op2->__anon1.ui64;
2365 else
2366 return 0;
2367 return 1;
2368 }
2369
2370 unsigned int GetDouble(struct Expression * exp, double * value2)
2371 {
2372 struct Operand op2 = GetOperand(exp);
2373
2374 return GetOpDouble(&op2, value2);
2375 }
2376
2377 void ComputeExpression(struct Expression * exp);
2378
2379 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2380
2381 extern int targetBits;
2382
2383 int ComputeTypeSize(struct Type * type);
2384
2385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2386
2387 struct __ecereNameSpace__ecere__com__BitMember
2388 {
2389 struct __ecereNameSpace__ecere__com__BitMember * prev;
2390 struct __ecereNameSpace__ecere__com__BitMember * next;
2391 const char *  name;
2392 unsigned int isProperty;
2393 int memberAccess;
2394 int id;
2395 struct __ecereNameSpace__ecere__com__Class * _class;
2396 const char *  dataTypeString;
2397 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2398 struct Type * dataType;
2399 int type;
2400 int size;
2401 int pos;
2402 uint64 mask;
2403 } __attribute__ ((gcc_struct));
2404
2405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2406
2407 struct __ecereNameSpace__ecere__sys__OldLink
2408 {
2409 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2410 struct __ecereNameSpace__ecere__sys__OldLink * next;
2411 void *  data;
2412 } __attribute__ ((gcc_struct));
2413
2414 void FinishTemplatesContext(struct Context * context);
2415
2416 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2417 {
2418 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2419 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2420
2421 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))
2422 {
2423 int unionMemberOffset = 0;
2424 int bitFields = 0;
2425
2426 if(member)
2427 {
2428 member->memberOffset = 0;
2429 if(targetBits < sizeof(void *) * 8)
2430 member->structAlignment = 0;
2431 }
2432 else if(targetBits < sizeof(void *) * 8)
2433 _class->structAlignment = 0;
2434 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2435 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2436 if(!member && _class->destructionWatchOffset)
2437 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2438 {
2439 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2440
2441 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2442 {
2443 if(!dataMember->isProperty)
2444 {
2445 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2446 {
2447 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
2448 }
2449 }
2450 }
2451 }
2452 {
2453 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2454
2455 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2456 {
2457 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2458 {
2459 if(!isMember && _class->type == 2 && dataMember->dataType)
2460 {
2461 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2462 uint64 mask = 0;
2463 int d;
2464
2465 ComputeTypeSize(dataMember->dataType);
2466 if(bitMember->pos == -1)
2467 bitMember->pos = _class->memberOffset;
2468 if(!bitMember->size)
2469 bitMember->size = dataMember->dataType->size * 8;
2470 _class->memberOffset = bitMember->pos + bitMember->size;
2471 for(d = 0; d < bitMember->size; d++)
2472 {
2473 if(d)
2474 mask <<= 1;
2475 mask |= 1;
2476 }
2477 bitMember->mask = mask << bitMember->pos;
2478 }
2479 else if(dataMember->type == 0 && dataMember->dataType)
2480 {
2481 int size;
2482 int alignment = 0;
2483
2484 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)))
2485 ComputeTypeSize(dataMember->dataType);
2486 if(dataMember->dataType->bitFieldCount)
2487 {
2488 bitFields += dataMember->dataType->bitFieldCount;
2489 size = 0;
2490 }
2491 else
2492 {
2493 if(bitFields)
2494 {
2495 int size = (bitFields + 7) / 8;
2496
2497 if(isMember)
2498 {
2499 int __simpleStruct0;
2500
2501 if(alignment)
2502 {
2503 int __simpleStruct0;
2504
2505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2506 if(member->memberOffset % alignment)
2507 member->memberOffset += alignment - (member->memberOffset % alignment);
2508 }
2509 dataMember->offset = member->memberOffset;
2510 if(member->type == 1)
2511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2512 else
2513 {
2514 member->memberOffset += size;
2515 }
2516 }
2517 else
2518 {
2519 if(alignment)
2520 {
2521 int __simpleStruct0;
2522
2523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2524 if(_class->memberOffset % alignment)
2525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2526 }
2527 dataMember->offset = _class->memberOffset;
2528 _class->memberOffset += size;
2529 }
2530 bitFields = 0;
2531 }
2532 size = dataMember->dataType->size;
2533 alignment = dataMember->dataType->alignment;
2534 }
2535 if(isMember)
2536 {
2537 int __simpleStruct0;
2538
2539 if(alignment)
2540 {
2541 int __simpleStruct0;
2542
2543 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2544 if(member->memberOffset % alignment)
2545 member->memberOffset += alignment - (member->memberOffset % alignment);
2546 }
2547 dataMember->offset = member->memberOffset;
2548 if(member->type == 1)
2549 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2550 else
2551 {
2552 member->memberOffset += size;
2553 }
2554 }
2555 else
2556 {
2557 if(alignment)
2558 {
2559 int __simpleStruct0;
2560
2561 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2562 if(_class->memberOffset % alignment)
2563 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2564 }
2565 dataMember->offset = _class->memberOffset;
2566 _class->memberOffset += size;
2567 }
2568 }
2569 else
2570 {
2571 int alignment;
2572
2573 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
2574 alignment = dataMember->structAlignment;
2575 if(isMember)
2576 {
2577 int __simpleStruct0;
2578
2579 if(alignment)
2580 {
2581 int __simpleStruct0;
2582
2583 if(member->memberOffset % alignment)
2584 member->memberOffset += alignment - (member->memberOffset % alignment);
2585 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2586 }
2587 dataMember->offset = member->memberOffset;
2588 if(member->type == 1)
2589 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2590 else
2591 member->memberOffset += dataMember->memberOffset;
2592 }
2593 else
2594 {
2595 if(alignment)
2596 {
2597 int __simpleStruct0;
2598
2599 if(_class->memberOffset % alignment)
2600 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2602 }
2603 dataMember->offset = _class->memberOffset;
2604 _class->memberOffset += dataMember->memberOffset;
2605 }
2606 }
2607 }
2608 }
2609 if(bitFields)
2610 {
2611 int alignment = 0;
2612 int size = (bitFields + 7) / 8;
2613
2614 if(isMember)
2615 {
2616 int __simpleStruct0;
2617
2618 if(alignment)
2619 {
2620 int __simpleStruct0;
2621
2622 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2623 if(member->memberOffset % alignment)
2624 member->memberOffset += alignment - (member->memberOffset % alignment);
2625 }
2626 if(member->type == 1)
2627 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2628 else
2629 {
2630 member->memberOffset += size;
2631 }
2632 }
2633 else
2634 {
2635 if(alignment)
2636 {
2637 int __simpleStruct0;
2638
2639 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2640 if(_class->memberOffset % alignment)
2641 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2642 }
2643 _class->memberOffset += size;
2644 }
2645 bitFields = 0;
2646 }
2647 }
2648 if(member && member->type == 1)
2649 {
2650 member->memberOffset = unionMemberOffset;
2651 }
2652 if(!isMember)
2653 {
2654 if(_class->type != 2)
2655 {
2656 int extra = 0;
2657
2658 if(_class->structAlignment)
2659 {
2660 if(_class->memberOffset % _class->structAlignment)
2661 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2662 }
2663 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2664 if(!member)
2665 {
2666 struct __ecereNameSpace__ecere__com__Property * prop;
2667
2668 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2669 {
2670 if(prop->isProperty && prop->isWatchable)
2671 {
2672 prop->watcherOffset = _class->structSize;
2673 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2674 }
2675 }
2676 }
2677 {
2678 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2679
2680 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2681 {
2682 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2683
2684 if(deriv->computeSize)
2685 {
2686 deriv->offset = _class->structSize;
2687 deriv->memberOffset = 0;
2688 deriv->structSize = deriv->offset;
2689 ComputeClassMembers(deriv, 0);
2690 }
2691 }
2692 }
2693 }
2694 }
2695 }
2696 if(context)
2697 FinishTemplatesContext(context);
2698 }
2699
2700 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2701
2702 struct __ecereNameSpace__ecere__com__NameSpace
2703 {
2704 const char *  name;
2705 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2706 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2707 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2708 int depth;
2709 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2710 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2711 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2712 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2713 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2714 } __attribute__ ((gcc_struct));
2715
2716 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2717
2718 struct __ecereNameSpace__ecere__com__Module
2719 {
2720 struct __ecereNameSpace__ecere__com__Instance * application;
2721 struct __ecereNameSpace__ecere__sys__OldList classes;
2722 struct __ecereNameSpace__ecere__sys__OldList defines;
2723 struct __ecereNameSpace__ecere__sys__OldList functions;
2724 struct __ecereNameSpace__ecere__sys__OldList modules;
2725 struct __ecereNameSpace__ecere__com__Instance * prev;
2726 struct __ecereNameSpace__ecere__com__Instance * next;
2727 const char *  name;
2728 void *  library;
2729 void *  Unload;
2730 int importType;
2731 int origImportType;
2732 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2733 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2734 } __attribute__ ((gcc_struct));
2735
2736 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2737 {
2738 struct __ecereNameSpace__ecere__com__Class * _class;
2739 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2740
2741 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2742 ComputeModuleClasses(subModule->data);
2743 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2744 ComputeClassMembers(_class, 0);
2745 }
2746
2747 extern unsigned int inCompiler;
2748
2749 extern void Compiler_Error(const char *  format, ...);
2750
2751 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2752
2753 int ComputeTypeSize(struct Type * type)
2754 {
2755 unsigned int size = type ? type->size : 0;
2756
2757 if(!size && type && !type->computing)
2758 {
2759 type->computing = 1;
2760 switch(type->kind)
2761 {
2762 case 24:
2763 type->alignment = size = sizeof(char);
2764 break;
2765 case 1:
2766 type->alignment = size = sizeof(char);
2767 break;
2768 case 3:
2769 type->alignment = size = sizeof(int);
2770 break;
2771 case 4:
2772 type->alignment = size = sizeof(long long);
2773 break;
2774 case 22:
2775 type->alignment = size = targetBits / 8;
2776 break;
2777 case 23:
2778 type->alignment = size = targetBits / 8;
2779 break;
2780 case 5:
2781 type->alignment = size = sizeof(long);
2782 break;
2783 case 2:
2784 type->alignment = size = sizeof(short);
2785 break;
2786 case 6:
2787 type->alignment = size = sizeof(float);
2788 break;
2789 case 7:
2790 type->alignment = size = sizeof(double);
2791 break;
2792 case 8:
2793 {
2794 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2795
2796 if(_class && _class->type == 1)
2797 {
2798 ComputeClassMembers(_class, 0);
2799 type->alignment = _class->structAlignment;
2800 size = _class->structSize;
2801 if(type->alignment && size % type->alignment)
2802 size += type->alignment - (size % type->alignment);
2803 }
2804 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2805 {
2806 if(!_class->dataType)
2807 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
2808 size = type->alignment = ComputeTypeSize(_class->dataType);
2809 }
2810 else
2811 size = type->alignment = targetBits / 8;
2812 break;
2813 }
2814 case 13:
2815 case 19:
2816 size = type->alignment = targetBits / 8;
2817 break;
2818 case 12:
2819 if(type->__anon1.__anon4.arraySizeExp)
2820 {
2821 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2822 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2823 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)))
2824 {
2825 struct Location oldLoc = yylloc;
2826 char expression[10240];
2827
2828 expression[0] = '\0';
2829 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2830 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2831 if(inCompiler)
2832 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2834 yylloc = oldLoc;
2835 }
2836 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2837 }
2838 else if(type->__anon1.__anon4.enumClass)
2839 {
2840 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2841 {
2842 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2843 }
2844 else
2845 type->__anon1.__anon4.arraySize = 0;
2846 }
2847 else
2848 {
2849 type->__anon1.__anon4.arraySize = 0;
2850 }
2851 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2852 if(type->__anon1.type)
2853 type->alignment = type->__anon1.type->alignment;
2854 break;
2855 case 9:
2856 {
2857 struct Type * member;
2858
2859 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2860 {
2861 int __simpleStruct0, __simpleStruct1;
2862 unsigned int addSize = ComputeTypeSize(member);
2863
2864 member->offset = size;
2865 if(member->alignment && size % member->alignment)
2866 member->offset += member->alignment - (size % member->alignment);
2867 size = member->offset;
2868 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2869 size += addSize;
2870 }
2871 if(type->alignment && size % type->alignment)
2872 size += type->alignment - (size % type->alignment);
2873 break;
2874 }
2875 case 10:
2876 {
2877 struct Type * member;
2878
2879 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2880 {
2881 int __simpleStruct0, __simpleStruct1;
2882 unsigned int addSize = ComputeTypeSize(member);
2883
2884 member->offset = size;
2885 if(member->alignment && size % member->alignment)
2886 member->offset += member->alignment - (size % member->alignment);
2887 size = member->offset;
2888 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2889 size = ((size > addSize) ? size : addSize);
2890 }
2891 if(type->alignment && size % type->alignment)
2892 size += type->alignment - (size % type->alignment);
2893 break;
2894 }
2895 case 20:
2896 {
2897 struct TemplateParameter * param = type->__anon1.templateParameter;
2898 struct Type * baseType = ProcessTemplateParameterType(param);
2899
2900 if(baseType)
2901 {
2902 size = ComputeTypeSize(baseType);
2903 type->alignment = baseType->alignment;
2904 }
2905 else
2906 type->alignment = size = sizeof(uint64);
2907 break;
2908 }
2909 case 15:
2910 {
2911 type->alignment = size = sizeof(enum
2912 {
2913 test
2914 });
2915 break;
2916 }
2917 case 21:
2918 {
2919 type->alignment = size = targetBits / 8;
2920 break;
2921 }
2922 }
2923 type->size = size;
2924 type->computing = 0;
2925 }
2926 return size;
2927 }
2928
2929 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2930
2931 extern struct Identifier * MkIdentifier(const char *  string);
2932
2933 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2934
2935 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2936
2937 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2938
2939 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2940
2941 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2942
2943 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2944
2945 extern void FreeType(struct Type * type);
2946
2947 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2948
2949 extern struct Specifier * MkSpecifier(int specifier);
2950
2951 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2952
2953 extern struct Expression * MkExpConstant(const char *  string);
2954
2955 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)
2956 {
2957 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2958 unsigned int totalSize = 0;
2959 unsigned int maxSize = 0;
2960 int alignment;
2961 unsigned int size;
2962 struct __ecereNameSpace__ecere__com__DataMember * member;
2963 int anonID = 1;
2964 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2965
2966 if(addedPadding)
2967 *addedPadding = 0;
2968 if(!isMember && _class->base)
2969 {
2970 maxSize = _class->structSize;
2971 {
2972 if(_class->type == 1 || _class->type == 5)
2973 AddMembers(declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
2974 else
2975 {
2976 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2977
2978 if(maxSize > baseSize)
2979 maxSize -= baseSize;
2980 else
2981 maxSize = 0;
2982 }
2983 }
2984 }
2985 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2986 {
2987 if(!member->isProperty)
2988 {
2989 switch(member->type)
2990 {
2991 case 0:
2992 {
2993 if(member->dataTypeString)
2994 {
2995 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2996 struct Declarator * decl;
2997
2998 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2999 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
3000 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
3001 if(!member->dataType)
3002 member->dataType = ProcessType(specs, decl);
3003 ReplaceThisClassSpecifiers(specs, topClass);
3004 {
3005 struct Type * type = ProcessType(specs, decl);
3006
3007 DeclareType(member->dataType, 0, 0);
3008 FreeType(type);
3009 }
3010 ComputeTypeSize(member->dataType);
3011 size = member->dataType->size;
3012 alignment = member->dataType->alignment;
3013 if(alignment)
3014 {
3015 if(totalSize % alignment)
3016 totalSize += alignment - (totalSize % alignment);
3017 }
3018 totalSize += size;
3019 }
3020 break;
3021 }
3022 case 1:
3023 case 2:
3024 {
3025 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3026 char id[100];
3027
3028 sprintf(id, "__anon%d", anonID++);
3029 size = 0;
3030 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
3031 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3032 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3033 alignment = member->structAlignment;
3034 if(alignment)
3035 {
3036 if(totalSize % alignment)
3037 totalSize += alignment - (totalSize % alignment);
3038 }
3039 totalSize += size;
3040 break;
3041 }
3042 }
3043 }
3044 }
3045 if(retSize)
3046 {
3047 unsigned int __simpleStruct0;
3048
3049 if(topMember && topMember->type == 1)
3050 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3051 else
3052 *retSize += totalSize;
3053 }
3054 else if(totalSize < maxSize && _class->type != 1000)
3055 {
3056 int autoPadding = 0;
3057
3058 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3059 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3060 if(totalSize + autoPadding < maxSize)
3061 {
3062 char sizeString[50];
3063
3064 sprintf(sizeString, "%d", maxSize - totalSize);
3065 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3066 if(addedPadding)
3067 *addedPadding = 1;
3068 }
3069 }
3070 if(context)
3071 FinishTemplatesContext(context);
3072 return topMember ? topMember->memberID : _class->memberID;
3073 }
3074
3075 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3076 {
3077 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3078 struct __ecereNameSpace__ecere__com__DataMember * member;
3079 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3080
3081 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3082 DeclareMembers(_class->base, 0);
3083 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3084 {
3085 if(!member->isProperty)
3086 {
3087 switch(member->type)
3088 {
3089 case 0:
3090 {
3091 if(!member->dataType && member->dataTypeString)
3092 member->dataType = ProcessTypeString(member->dataTypeString, 0);
3093 if(member->dataType)
3094 DeclareType(member->dataType, 0, 0);
3095 break;
3096 }
3097 case 1:
3098 case 2:
3099 {
3100 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 1);
3101 break;
3102 }
3103 }
3104 }
3105 }
3106 if(context)
3107 FinishTemplatesContext(context);
3108 return topMember ? topMember->memberID : _class->memberID;
3109 }
3110
3111 extern struct Identifier * GetDeclId(struct Declarator * decl);
3112
3113 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3114 {
3115 struct ClassDef * def;
3116 int anonID = 1;
3117
3118 for(def = (*definitions).first; def; def = def->next)
3119 {
3120 if(def->type == 2)
3121 {
3122 struct Declaration * decl = def->__anon1.decl;
3123
3124 if(decl && decl->__anon1.__anon1.specifiers)
3125 {
3126 struct Specifier * spec;
3127 unsigned int isStruct = 0;
3128
3129 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3130 {
3131 if(spec->type == 3 || spec->type == 4)
3132 {
3133 if(spec->__anon1.__anon2.definitions)
3134 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3135 isStruct = 1;
3136 }
3137 }
3138 if(isStruct)
3139 {
3140 struct Declarator * d = (((void *)0));
3141
3142 if(decl->__anon1.__anon1.declarators)
3143 {
3144 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3145 {
3146 struct Identifier * idDecl = GetDeclId(d);
3147
3148 if(idDecl)
3149 break;
3150 }
3151 }
3152 if(!d)
3153 {
3154 char id[100];
3155
3156 sprintf(id, "__anon%d", anonID++);
3157 if(!decl->__anon1.__anon1.declarators)
3158 decl->__anon1.__anon1.declarators = MkList();
3159 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3160 }
3161 }
3162 }
3163 }
3164 }
3165 }
3166
3167 extern struct Symbol * FindClass(const char *  name);
3168
3169 extern char *  strchr(const char * , int);
3170
3171 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3172
3173 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3174
3175 extern void FreeClassDef(struct ClassDef * def);
3176
3177 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3178
3179 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3180
3181 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3182
3183 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3184
3185 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3186
3187 void DeclareStruct(const char * name, unsigned int skipNoHead)
3188 {
3189 struct External * external = (((void *)0));
3190 struct Symbol * classSym = FindClass(name);
3191
3192 if(!inCompiler || !classSym)
3193 return ;
3194 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3195 return ;
3196 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3197 {
3198 struct Declaration * decl;
3199 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3200 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3201 char structName[1024];
3202 struct Specifier * spec = (((void *)0));
3203
3204 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3205 classSym->declaring++;
3206 if(strchr(classSym->string, '<'))
3207 {
3208 if(classSym->__anon1.registered->templateClass)
3209 {
3210 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3211 classSym->declaring--;
3212 }
3213 return ;
3214 }
3215 DeclareMembers(classSym->__anon1.registered, 0);
3216 structName[0] = (char)0;
3217 FullClassNameCat(structName, name, 0);
3218 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3219 {
3220 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3221 {
3222 if(spec->type == 3 || spec->type == 4)
3223 break;
3224 }
3225 }
3226 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3227 {
3228 unsigned int addedPadding = 0;
3229
3230 classSym->declaredStructSym = 1;
3231 declarations = MkList();
3232 AddMembers(declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3233 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3234 {
3235 FreeList(declarations, (void *)(FreeClassDef));
3236 declarations = (((void *)0));
3237 }
3238 }
3239 if(skipNoHead || declarations)
3240 {
3241 if(spec)
3242 {
3243 if(declarations)
3244 spec->__anon1.__anon2.definitions = declarations;
3245 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3246 {
3247 if(classSym->__anon2.__anon1.structExternal)
3248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3250 classSym->id = curExternal->symbol->idCode;
3251 classSym->idCode = curExternal->symbol->idCode;
3252 }
3253 }
3254 else
3255 {
3256 if(!external)
3257 external = MkExternalDeclaration((((void *)0)));
3258 specifiers = MkList();
3259 declarators = MkList();
3260 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3261 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3262 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3263 decl->symbol->__anon2.__anon1.pointerExternal = external;
3264 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3265 {
3266 char className[1024];
3267
3268 strcpy(className, "__ecereClass_");
3269 FullClassNameCat(className, classSym->string, 1);
3270 DeclareClass(classSym, className);
3271 external->symbol = classSym;
3272 classSym->__anon2.__anon1.pointerExternal = external;
3273 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3274 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3275 }
3276 else
3277 {
3278 char className[1024];
3279
3280 strcpy(className, "__ecereClass_");
3281 FullClassNameCat(className, classSym->string, 1);
3282 classSym->__anon2.__anon1.structExternal = external;
3283 DeclareClass(classSym, className);
3284 external->symbol = classSym;
3285 }
3286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3287 }
3288 }
3289 classSym->declaring--;
3290 }
3291 else
3292 {
3293 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3294 {
3295 struct Specifier * spec;
3296
3297 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3298 {
3299 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3300 }
3301 }
3302 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3303 {
3304 classSym->declaring++;
3305 {
3306 if(classSym->__anon1.registered)
3307 DeclareMembers(classSym->__anon1.registered, 0);
3308 }
3309 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3310 {
3311 if(classSym->__anon2.__anon1.structExternal)
3312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3314 classSym->id = curExternal->symbol->idCode;
3315 classSym->idCode = curExternal->symbol->idCode;
3316 }
3317 classSym->declaring--;
3318 }
3319 }
3320 }
3321
3322 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3323
3324 extern struct ModuleImport * mainModule;
3325
3326 extern struct Specifier * MkSpecifierName(const char *  name);
3327
3328 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3329
3330 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3331
3332 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3333
3334 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3335
3336 extern void FreeDeclarator(struct Declarator * decl);
3337
3338 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
3339
3340 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
3341
3342 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
3343
3344 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
3345
3346 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3347
3348 struct PropertyImport
3349 {
3350 struct PropertyImport * prev;
3351 struct PropertyImport * next;
3352 char *  name;
3353 unsigned int isVirtual;
3354 unsigned int hasSet;
3355 unsigned int hasGet;
3356 } __attribute__ ((gcc_struct));
3357
3358 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3359
3360 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3361 {
3362 struct Symbol * symbol = prop->symbol;
3363
3364 strcpy(setName, "__ecereProp_");
3365 FullClassNameCat(setName, prop->_class->fullName, 0);
3366 strcat(setName, "_Set_");
3367 FullClassNameCat(setName, prop->name, 1);
3368 strcpy(getName, "__ecereProp_");
3369 FullClassNameCat(getName, prop->_class->fullName, 0);
3370 strcat(getName, "_Get_");
3371 FullClassNameCat(getName, prop->name, 1);
3372 if(prop->_class->type == 1)
3373 DeclareStruct(prop->_class->fullName, 0);
3374 if(!symbol || curExternal->symbol->idCode < symbol->id)
3375 {
3376 unsigned int imported = 0;
3377 unsigned int dllImport = 0;
3378
3379 if(!symbol || symbol->_import)
3380 {
3381 if(!symbol)
3382 {
3383 struct Symbol * classSym;
3384
3385 if(!prop->_class->symbol)
3386 prop->_class->symbol = FindClass(prop->_class->fullName);
3387 classSym = prop->_class->symbol;
3388 if(classSym && !classSym->_import)
3389 {
3390 struct ModuleImport * module;
3391
3392 if(prop->_class->module)
3393 module = FindModule(prop->_class->module);
3394 else
3395 module = mainModule;
3396 classSym->_import = __extension__ ({
3397 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3398
3399 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3400 });
3401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3402 }
3403 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3404 symbol->_import = (struct ClassImport *)__extension__ ({
3405 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3406
3407 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3408 });
3409 if(classSym)
3410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3411 }
3412 imported = 1;
3413 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)
3414 dllImport = 1;
3415 }
3416 if(!symbol->type)
3417 {
3418 struct Context * context = SetupTemplatesContext(prop->_class);
3419
3420 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3421 FinishTemplatesContext(context);
3422 }
3423 if(prop->Get)
3424 {
3425 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3426 {
3427 struct Declaration * decl;
3428 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3429 struct Declarator * d;
3430 struct __ecereNameSpace__ecere__sys__OldList * params;
3431 struct Specifier * spec;
3432 struct External * external;
3433 struct Declarator * typeDecl;
3434 unsigned int simple = 0;
3435
3436 specifiers = MkList();
3437 declarators = MkList();
3438 params = MkList();
3439 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3440 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3441 if(dllImport)
3442 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3443 {
3444 struct Context * context = SetupTemplatesContext(prop->_class);
3445
3446 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3447 FinishTemplatesContext(context);
3448 }
3449 for(spec = (*specifiers).first; spec; spec = spec->next)
3450 {
3451 if(spec->type == 1)
3452 {
3453 if((!typeDecl || typeDecl->type == 1))
3454 {
3455 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3456
3457 symbol->_class = classSym->__anon1.registered;
3458 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3459 {
3460 DeclareStruct(spec->__anon1.__anon1.name, 0);
3461 simple = 1;
3462 }
3463 }
3464 }
3465 }
3466 if(!simple)
3467 d = PlugDeclarator(typeDecl, d);
3468 else
3469 {
3470 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3471 specifiers = MkList();
3472 }
3473 d = MkDeclaratorFunction(d, params);
3474 if(dllImport)
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3476 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3478 if(simple)
3479 ListAdd(specifiers, MkSpecifier(VOID));
3480 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3481 decl = MkDeclaration(specifiers, declarators);
3482 external = MkExternalDeclaration(decl);
3483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3484 external->symbol = symbol;
3485 symbol->__anon2.__anon2.externalGet = external;
3486 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3487 if(typeDecl)
3488 FreeDeclarator(typeDecl);
3489 }
3490 else
3491 {
3492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3493 }
3494 }
3495 if(prop->Set)
3496 {
3497 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3498 {
3499 struct Declaration * decl;
3500 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3501 struct Declarator * d;
3502 struct __ecereNameSpace__ecere__sys__OldList * params;
3503 struct Specifier * spec;
3504 struct External * external;
3505 struct Declarator * typeDecl;
3506
3507 declarators = MkList();
3508 params = MkList();
3509 if(!prop->conversion || prop->_class->type == 1)
3510 {
3511 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3512 }
3513 specifiers = MkList();
3514 {
3515 struct Context * context = SetupTemplatesContext(prop->_class);
3516
3517 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3518 FinishTemplatesContext(context);
3519 }
3520 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3522 ListAdd(params, MkTypeName(specifiers, d));
3523 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3524 if(dllImport)
3525 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3526 d = MkDeclaratorFunction(d, params);
3527 for(spec = (*specifiers).first; spec; spec = spec->next)
3528 {
3529 if(spec->type == 1)
3530 {
3531 if((!typeDecl || typeDecl->type == 1))
3532 {
3533 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3534
3535 symbol->_class = classSym->__anon1.registered;
3536 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3537 DeclareStruct(spec->__anon1.__anon1.name, 0);
3538 }
3539 }
3540 }
3541 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3542 specifiers = MkList();
3543 if(dllImport)
3544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3545 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3547 if(!prop->conversion || prop->_class->type == 1)
3548 ListAdd(specifiers, MkSpecifier(VOID));
3549 else
3550 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3551 decl = MkDeclaration(specifiers, declarators);
3552 external = MkExternalDeclaration(decl);
3553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3554 external->symbol = symbol;
3555 symbol->__anon2.__anon2.externalSet = external;
3556 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3557 }
3558 else
3559 {
3560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3561 }
3562 }
3563 if(!symbol->__anon2.__anon2.externalPtr)
3564 {
3565 struct Declaration * decl;
3566 struct External * external;
3567 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3568 char propName[1024];
3569
3570 if(imported)
3571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3572 else
3573 {
3574 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
3576 }
3577 ListAdd(specifiers, MkSpecifierName("Property"));
3578 strcpy(propName, "__ecereProp_");
3579 FullClassNameCat(propName, prop->_class->fullName, 0);
3580 strcat(propName, "_");
3581 FullClassNameCat(propName, prop->name, 1);
3582 {
3583 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3584
3585 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3586 if(!imported)
3587 {
3588 strcpy(propName, "__ecerePropM_");
3589 FullClassNameCat(propName, prop->_class->fullName, 0);
3590 strcat(propName, "_");
3591 FullClassNameCat(propName, prop->name, 1);
3592 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3593 }
3594 decl = MkDeclaration(specifiers, list);
3595 }
3596 external = MkExternalDeclaration(decl);
3597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3598 external->symbol = symbol;
3599 symbol->__anon2.__anon2.externalPtr = external;
3600 }
3601 else
3602 {
3603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3604 }
3605 symbol->id = curExternal->symbol->idCode;
3606 }
3607 }
3608
3609 struct Type * Dereference(struct Type * source)
3610 {
3611 struct Type * type = (((void *)0));
3612
3613 if(source)
3614 {
3615 if(source->kind == 13 || source->kind == 12)
3616 {
3617 type = source->__anon1.type;
3618 source->__anon1.type->refCount++;
3619 }
3620 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3621 {
3622 type = __extension__ ({
3623 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3624
3625 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3626 });
3627 }
3628 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3629 {
3630 type = source;
3631 source->refCount++;
3632 }
3633 else
3634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3635 }
3636 return type;
3637 }
3638
3639 static struct Type * Reference(struct Type * source)
3640 {
3641 struct Type * type = (((void *)0));
3642
3643 if(source)
3644 {
3645 type = __extension__ ({
3646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3647
3648 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3649 });
3650 source->refCount++;
3651 }
3652 return type;
3653 }
3654
3655 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);
3656
3657 extern void *  memcpy(void * , const void * , size_t size);
3658
3659 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3660
3661 extern void FreeExpression(struct Expression * exp);
3662
3663 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3664
3665 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);
3666
3667 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3668
3669 extern struct Type * MkClassType(const char *  name);
3670
3671 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);
3672
3673 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)
3674 {
3675 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3676 unsigned int found = 0;
3677 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3678 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3679 unsigned int freeType = 0;
3680
3681 yylloc = member->loc;
3682 if(!ident)
3683 {
3684 if(curMember)
3685 {
3686 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3687 if(*curMember)
3688 {
3689 found = 1;
3690 dataMember = *curMember;
3691 }
3692 }
3693 }
3694 else
3695 {
3696 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3697 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3698 int _subMemberStackPos = 0;
3699
3700 if(!thisMember)
3701 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3702 if(thisMember)
3703 {
3704 dataMember = thisMember;
3705 if(curMember && thisMember->memberAccess == 1)
3706 {
3707 *curMember = thisMember;
3708 *curClass = thisMember->_class;
3709 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3710 *subMemberStackPos = _subMemberStackPos;
3711 }
3712 found = 1;
3713 }
3714 else
3715 {
3716 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3717 if(method && method->type == 1)
3718 found = 1;
3719 else
3720 method = (((void *)0));
3721 }
3722 }
3723 if(found)
3724 {
3725 struct Type * type = (((void *)0));
3726
3727 if(dataMember)
3728 {
3729 if(!dataMember->dataType && dataMember->dataTypeString)
3730 {
3731 struct Context * context = SetupTemplatesContext(_class);
3732
3733 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3734 FinishTemplatesContext(context);
3735 }
3736 type = dataMember->dataType;
3737 }
3738 else if(method)
3739 {
3740 if(!method->dataType)
3741 ProcessMethodType(method);
3742 type = method->dataType;
3743 }
3744 if(ident && ident->next)
3745 {
3746 for(ident = ident->next; ident && type; ident = ident->next)
3747 {
3748 if(type->kind == 8)
3749 {
3750 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3751 if(!dataMember)
3752 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3753 if(dataMember)
3754 type = dataMember->dataType;
3755 }
3756 else if(type->kind == 9 || type->kind == 10)
3757 {
3758 struct Type * memberType;
3759
3760 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3761 {
3762 if(!strcmp(memberType->name, ident->string))
3763 {
3764 type = memberType;
3765 break;
3766 }
3767 }
3768 }
3769 }
3770 }
3771 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3772 {
3773 int id = 0;
3774 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3775 struct __ecereNameSpace__ecere__com__Class * sClass;
3776
3777 for(sClass = _class; sClass; sClass = sClass->base)
3778 {
3779 id = 0;
3780 if(sClass->templateClass)
3781 sClass = sClass->templateClass;
3782 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3783 {
3784 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3785 {
3786 for(sClass = sClass->base; sClass; sClass = sClass->base)
3787 {
3788 if(sClass->templateClass)
3789 sClass = sClass->templateClass;
3790 id += sClass->templateParams.count;
3791 }
3792 break;
3793 }
3794 id++;
3795 }
3796 if(curParam)
3797 break;
3798 }
3799 if(curParam)
3800 {
3801 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3802
3803 if(arg.__anon1.__anon1.dataTypeString)
3804 {
3805 unsigned int constant = type->constant;
3806
3807 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3808 if(type->kind == 8 && constant)
3809 type->constant = 1;
3810 else if(type->kind == 13)
3811 {
3812 struct Type * t = type->__anon1.type;
3813
3814 while(t->kind == 13)
3815 t = t->__anon1.type;
3816 if(constant)
3817 t->constant = constant;
3818 }
3819 freeType = 1;
3820 if(type && _class->templateClass)
3821 type->passAsTemplate = 1;
3822 if(type)
3823 {
3824 }
3825 }
3826 }
3827 }
3828 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3829 {
3830 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3831 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3832 int paramCount = 0;
3833 int lastParam = -1;
3834 char templateString[1024];
3835 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3836
3837 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3838 for(cClass = expClass; cClass; cClass = cClass->base)
3839 {
3840 int p = 0;
3841
3842 if(cClass->templateClass)
3843 cClass = cClass->templateClass;
3844 for(param = cClass->templateParams.first; param; param = param->next)
3845 {
3846 int id = p;
3847 struct __ecereNameSpace__ecere__com__Class * sClass;
3848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3849
3850 for(sClass = cClass->base; sClass; sClass = sClass->base)
3851 {
3852 if(sClass->templateClass)
3853 sClass = sClass->templateClass;
3854 id += sClass->templateParams.count;
3855 }
3856 arg = expClass->templateArgs[id];
3857 for(sClass = _class; sClass; sClass = sClass->base)
3858 {
3859 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3860 int p = 0;
3861 struct __ecereNameSpace__ecere__com__Class * nextClass;
3862
3863 if(sClass->templateClass)
3864 sClass = sClass->templateClass;
3865 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3866 {
3867 if(nextClass->templateClass)
3868 nextClass = nextClass->templateClass;
3869 p += nextClass->templateParams.count;
3870 }
3871 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3872 {
3873 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3874 {
3875 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3876 {
3877 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3878 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3879 break;
3880 }
3881 }
3882 }
3883 }
3884 {
3885 char argument[256];
3886
3887 argument[0] = '\0';
3888 switch(param->type)
3889 {
3890 case 2:
3891 {
3892 char expString[1024];
3893 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3894 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3895 struct Expression * exp;
3896 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3897
3898 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3899 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3900 ProcessExpressionType(exp);
3901 ComputeExpression(exp);
3902 expString[0] = '\0';
3903 PrintExpression(exp, expString);
3904 strcat(argument, expString);
3905 FreeExpression(exp);
3906 break;
3907 }
3908 case 1:
3909 {
3910 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3911 break;
3912 }
3913 case 0:
3914 {
3915 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3916 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3917 break;
3918 }
3919 }
3920 if(argument[0])
3921 {
3922 if(paramCount)
3923 strcat(templateString, ", ");
3924 if(lastParam != p - 1)
3925 {
3926 strcat(templateString, param->name);
3927 strcat(templateString, " = ");
3928 }
3929 strcat(templateString, argument);
3930 paramCount++;
3931 lastParam = p;
3932 }
3933 p++;
3934 }
3935 }
3936 }
3937 {
3938 int len = strlen(templateString);
3939
3940 if(templateString[len - 1] == '<')
3941 len--;
3942 else
3943 {
3944 if(templateString[len - 1] == '>')
3945 templateString[len++] = ' ';
3946 templateString[len++] = '>';
3947 }
3948 templateString[len++] = '\0';
3949 }
3950 {
3951 struct Context * context = SetupTemplatesContext(_class);
3952
3953 if(freeType)
3954 FreeType(type);
3955 type = ProcessTypeString(templateString, 0);
3956 freeType = 1;
3957 FinishTemplatesContext(context);
3958 }
3959 }
3960 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3961 {
3962 ProcessExpressionType(member->initializer->__anon1.exp);
3963 if(!member->initializer->__anon1.exp->expType)
3964 {
3965 if(inCompiler)
3966 {
3967 char expString[10240];
3968
3969 expString[0] = '\0';
3970 PrintExpression(member->initializer->__anon1.exp, expString);
3971 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3973 }
3974 }
3975 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3976 {
3977 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3978 }
3979 }
3980 else if(member->initializer)
3981 {
3982 ProcessInitializer(member->initializer, type);
3983 }
3984 if(freeType)
3985 FreeType(type);
3986 }
3987 else
3988 {
3989 if(_class && _class->type == 3)
3990 {
3991 if(member->initializer)
3992 {
3993 struct Type * type = MkClassType(_class->fullName);
3994
3995 ProcessInitializer(member->initializer, type);
3996 FreeType(type);
3997 }
3998 }
3999 else
4000 {
4001 if(member->initializer)
4002 {
4003 ProcessInitializer(member->initializer, (((void *)0)));
4004 }
4005 if(ident)
4006 {
4007 if(method)
4008 {
4009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4010 }
4011 else if(_class)
4012 {
4013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4014 if(inCompiler)
4015 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4016 }
4017 }
4018 else if(_class)
4019 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4020 }
4021 }
4022 }
4023
4024 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);
4025
4026 extern void FreeSpecifier(struct Specifier * spec);
4027
4028 static void ProcessFunction(struct FunctionDefinition * function);
4029
4030 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4031
4032 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4033
4034 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4035
4036 extern void FreeClassFunction(struct ClassFunction * func);
4037
4038 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4039
4040 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4041
4042 void ProcessInstantiationType(struct Instantiation * inst)
4043 {
4044 yylloc = inst->loc;
4045 if(inst->_class)
4046 {
4047 struct MembersInit * members;
4048 struct Symbol * classSym;
4049 struct __ecereNameSpace__ecere__com__Class * _class;
4050
4051 classSym = inst->_class->__anon1.__anon1.symbol;
4052 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4053 if(!_class || _class->type != 5)
4054 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4055 afterExternal = afterExternal ? afterExternal : curExternal;
4056 if(inst->exp)
4057 ProcessExpressionType(inst->exp);
4058 inst->isConstant = 1;
4059 if(inst->members)
4060 {
4061 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4062 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4063 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4064 int subMemberStackPos = 0;
4065
4066 for(members = (*inst->members).first; members; members = members->next)
4067 {
4068 switch(members->type)
4069 {
4070 case 1:
4071 {
4072 char name[1024];
4073 static unsigned int instMethodID = 0;
4074 struct External * external = curExternal;
4075 struct Context * context = curContext;
4076 struct Declarator * declarator = members->__anon1.function->declarator;
4077 struct Identifier * nameID = GetDeclId(declarator);
4078 char * unmangled = nameID ? nameID->string : (((void *)0));
4079 struct Expression * exp;
4080 struct External * createdExternal = (((void *)0));
4081
4082 if(inCompiler)
4083 {
4084 char number[16];
4085
4086 strcpy(name, "__ecereInstMeth_");
4087 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4088 strcat(name, "_");
4089 strcat(name, nameID->string);
4090 strcat(name, "_");
4091 sprintf(number, "_%08d", instMethodID++);
4092 strcat(name, number);
4093 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4094 }
4095 if(declarator)
4096 {
4097 struct Symbol * symbol = declarator->symbol;
4098 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4099
4100 if(method && method->type == 1)
4101 {
4102 symbol->__anon1.method = method;
4103 ProcessMethodType(method);
4104 if(!symbol->type->__anon1.__anon2.thisClass)
4105 {
4106 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4107 {
4108 if(!currentClass->symbol)
4109 currentClass->symbol = FindClass(currentClass->fullName);
4110 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4111 }
4112 else
4113 {
4114 if(!_class->symbol)
4115 _class->symbol = FindClass(_class->fullName);
4116 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4117 }
4118 }
4119 DeclareType(symbol->type, 1, 1);
4120 }
4121 else if(classSym)
4122 {
4123 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4124 }
4125 }
4126 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4127 if(nameID)
4128 {
4129 FreeSpecifier(nameID->_class);
4130 nameID->_class = (((void *)0));
4131 }
4132 if(inCompiler)
4133 {
4134 struct External * oldExternal = curExternal;
4135
4136 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4137 {
4138 struct External * externalDecl;
4139
4140 externalDecl = MkExternalDeclaration((((void *)0)));
4141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4142 if(createdExternal->__anon1.function)
4143 {
4144 ProcessFunction(createdExternal->__anon1.function);
4145 {
4146 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4147
4148 externalDecl->__anon1.declaration = decl;
4149 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4150 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4151 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4152 }
4153 }
4154 }
4155 }
4156 else if(declarator)
4157 {
4158 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4159 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4160 }
4161 curExternal = external;
4162 curContext = context;
4163 if(inCompiler)
4164 {
4165 FreeClassFunction(members->__anon1.function);
4166 exp = QMkExpId(name);
4167 members->type = 0;
4168 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4169 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4170 }
4171 break;
4172 }
4173 case 0:
4174 {
4175 if(members->__anon1.dataMembers && classSym)
4176 {
4177 struct MemberInit * member;
4178 struct Location oldyyloc = yylloc;
4179
4180 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4181 {
4182 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4183 if(member->initializer && !member->initializer->isConstant)
4184 inst->isConstant = 0;
4185 }
4186 yylloc = oldyyloc;
4187 }
4188 break;
4189 }
4190 }
4191 }
4192 }
4193 }
4194 }
4195
4196 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4197 {
4198 if(inCompiler)
4199 {
4200 if(type->kind == 11)
4201 {
4202 struct Type * param;
4203
4204 if(declareParams)
4205 {
4206 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4207 DeclareType(param, declarePointers, 1);
4208 }
4209 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4210 }
4211 else if(type->kind == 13 && declarePointers)
4212 DeclareType(type->__anon1.type, declarePointers, 0);
4213 else if(type->kind == 8)
4214 {
4215 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4216 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4217 }
4218 else if(type->kind == 9 || type->kind == 10)
4219 {
4220 struct Type * member;
4221
4222 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4223 DeclareType(member, 0, 0);
4224 }
4225 else if(type->kind == 12)
4226 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4227 }
4228 }
4229
4230 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4231
4232 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4233 {
4234 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4235 int id = 0;
4236 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4237 struct __ecereNameSpace__ecere__com__Class * sClass;
4238
4239 for(sClass = _class; sClass; sClass = sClass->base)
4240 {
4241 id = 0;
4242 if(sClass->templateClass)
4243 sClass = sClass->templateClass;
4244 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4245 {
4246 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4247 {
4248 for(sClass = sClass->base; sClass; sClass = sClass->base)
4249 {
4250 if(sClass->templateClass)
4251 sClass = sClass->templateClass;
4252 id += sClass->templateParams.count;
4253 }
4254 break;
4255 }
4256 id++;
4257 }
4258 if(curParam)
4259 break;
4260 }
4261 if(curParam)
4262 {
4263 arg = &_class->templateArgs[id];
4264 if(arg && param->type == 0)
4265 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4266 }
4267 return arg;
4268 }
4269
4270 extern struct Context * PushContext(void);
4271
4272 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4273
4274 struct TemplatedType
4275 {
4276 uintptr_t key;
4277 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4278 struct __ecereNameSpace__ecere__sys__BTNode * left;
4279 struct __ecereNameSpace__ecere__sys__BTNode * right;
4280 int depth;
4281 struct TemplateParameter * param;
4282 } __attribute__ ((gcc_struct));
4283
4284 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4285
4286 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4287 {
4288 struct Context * context = PushContext();
4289
4290 context->templateTypesOnly = 1;
4291 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4292 {
4293 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4294
4295 for(; param; param = param->next)
4296 {
4297 if(param->type == 0 && param->identifier)
4298 {
4299 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4300
4301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4302 }
4303 }
4304 }
4305 else if(_class)
4306 {
4307 struct __ecereNameSpace__ecere__com__Class * sClass;
4308
4309 for(sClass = _class; sClass; sClass = sClass->base)
4310 {
4311 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4312
4313 for(p = sClass->templateParams.first; p; p = p->next)
4314 {
4315 if(p->type == 0)
4316 {
4317 struct TemplateParameter * param = p->param;
4318 struct TemplatedType * type;
4319
4320 if(!param)
4321 {
4322 p->param = param = __extension__ ({
4323 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4324
4325 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4326 });
4327 }
4328 type = __extension__ ({
4329 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4330
4331 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4332 });
4333 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4334 }
4335 }
4336 }
4337 }
4338 return context;
4339 }
4340
4341 extern void PopContext(struct Context * ctx);
4342
4343 extern void FreeContext(struct Context * context);
4344
4345 void FinishTemplatesContext(struct Context * context)
4346 {
4347 PopContext(context);
4348 FreeContext(context);
4349 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4350 }
4351
4352 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4353 {
4354 if(!method->dataType)
4355 {
4356 struct Context * context = SetupTemplatesContext(method->_class);
4357
4358 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4359 FinishTemplatesContext(context);
4360 if(method->type != 1 && method->dataType)
4361 {
4362 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4363 {
4364 if(!method->_class->symbol)
4365 method->_class->symbol = FindClass(method->_class->fullName);
4366 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4367 }
4368 }
4369 }
4370 }
4371
4372 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4373 {
4374 if(!prop->dataType)
4375 {
4376 struct Context * context = SetupTemplatesContext(prop->_class);
4377
4378 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4379 FinishTemplatesContext(context);
4380 }
4381 }
4382
4383 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4384
4385 extern void FreeTypeName(struct TypeName * typeName);
4386
4387 static void ProcessDeclarator(struct Declarator * decl);
4388
4389 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4390
4391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4392
4393 struct MethodImport
4394 {
4395 struct MethodImport * prev;
4396 struct MethodImport * next;
4397 char *  name;
4398 unsigned int isVirtual;
4399 } __attribute__ ((gcc_struct));
4400
4401 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4402
4403 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4404 {
4405 struct Symbol * symbol = method->symbol;
4406
4407 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4408 {
4409 unsigned int dllImport = 0;
4410
4411 if(!method->dataType)
4412 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4413 if(!symbol || symbol->_import || method->type == 1)
4414 {
4415 if(!symbol || method->type == 1)
4416 {
4417 struct Symbol * classSym;
4418
4419 if(!method->_class->symbol)
4420 method->_class->symbol = FindClass(method->_class->fullName);
4421 classSym = method->_class->symbol;
4422 if(!classSym->_import)
4423 {
4424 struct ModuleImport * module;
4425
4426 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4427 module = FindModule(method->_class->module);
4428 else
4429 module = mainModule;
4430 classSym->_import = __extension__ ({
4431 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4432
4433 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4434 });
4435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4436 }
4437 if(!symbol)
4438 {
4439 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4440 }
4441 if(!symbol->_import)
4442 {
4443 symbol->_import = (struct ClassImport *)__extension__ ({
4444 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4445
4446 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4447 });
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4449 }
4450 if(!symbol)
4451 {
4452 symbol->type = method->dataType;
4453 if(symbol->type)
4454 symbol->type->refCount++;
4455 }
4456 }
4457 if(!method->dataType->dllExport)
4458 {
4459 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)
4460 dllImport = 1;
4461 }
4462 }
4463 if(method->type != 1 && method->dataType)
4464 DeclareType(method->dataType, 1, 1);
4465 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4466 {
4467 struct Declaration * decl;
4468 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4469 struct Declarator * d;
4470 struct Declarator * funcDecl;
4471 struct External * external;
4472
4473 specifiers = MkList();
4474 declarators = MkList();
4475 if(dllImport)
4476 ListAdd(specifiers, MkSpecifier(EXTERN));
4477 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4478 ListAdd(specifiers, MkSpecifier(STATIC));
4479 if(method->type == 1)
4480 {
4481 ListAdd(specifiers, MkSpecifier(INT));
4482 d = MkDeclaratorIdentifier(MkIdentifier(name));
4483 }
4484 else
4485 {
4486 d = MkDeclaratorIdentifier(MkIdentifier(name));
4487 if(dllImport)
4488 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4489 {
4490 struct Context * context = SetupTemplatesContext(method->_class);
4491
4492 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4493 FinishTemplatesContext(context);
4494 }
4495 funcDecl = GetFuncDecl(d);
4496 if(dllImport)
4497 {
4498 struct Specifier * spec, * next;
4499
4500 for(spec = (*specifiers).first; spec; spec = next)
4501 {
4502 next = spec->next;
4503 if(spec->type == 5)
4504 {
4505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4506 FreeSpecifier(spec);
4507 }
4508 }
4509 }
4510 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4511 {
4512 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4513 {
4514 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4515 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")));
4516 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4517 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4518
4519 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4520 {
4521 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4522
4523 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4524 FreeTypeName(param);
4525 }
4526 if(!funcDecl->__anon1.function.parameters)
4527 funcDecl->__anon1.function.parameters = MkList();
4528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4529 }
4530 }
4531 }
4532 ProcessDeclarator(d);
4533 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4534 decl = MkDeclaration(specifiers, declarators);
4535 ReplaceThisClassSpecifiers(specifiers, method->_class);
4536 if(symbol->__anon2.__anon1.pointerExternal)
4537 {
4538 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4539
4540 {
4541 *functionSymbol = *symbol;
4542 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4543 if(functionSymbol->type)
4544 functionSymbol->type->refCount++;
4545 }
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4547 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4548 }
4549 external = MkExternalDeclaration(decl);
4550 if(curExternal)
4551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4552 external->symbol = symbol;
4553 symbol->__anon2.__anon1.pointerExternal = external;
4554 }
4555 else if(ast)
4556 {
4557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4558 }
4559 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4560 }
4561 }
4562
4563 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4564 {
4565 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4566 {
4567 unsigned int first = 1;
4568 int p = 0;
4569 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4570 int lastParam = -1;
4571 char className[1024];
4572
4573 strcpy(className, _class->fullName);
4574 for(param = _class->templateParams.first; param; param = param->next)
4575 {
4576 {
4577 if(first)
4578 strcat(className, "<");
4579 if(!first)
4580 strcat(className, ", ");
4581 if(lastParam + 1 != p)
4582 {
4583 strcat(className, param->name);
4584 strcat(className, " = ");
4585 }
4586 strcat(className, param->name);
4587 first = 0;
4588 lastParam = p;
4589 }
4590 p++;
4591 }
4592 if(!first)
4593 {
4594 int len = strlen(className);
4595
4596 if(className[len - 1] == '>')
4597 className[len++] = ' ';
4598 className[len++] = '>';
4599 className[len++] = '\0';
4600 }
4601 return __ecereNameSpace__ecere__sys__CopyString(className);
4602 }
4603 else
4604 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4605 }
4606
4607 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4608 {
4609 struct Type * type;
4610
4611 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4612 {
4613 unsigned int first = 1;
4614 int p = 0;
4615 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4616 int lastParam = -1;
4617 char className[1024];
4618
4619 strcpy(className, _class->fullName);
4620 for(param = _class->templateParams.first; param; param = param->next)
4621 {
4622 {
4623 if(first)
4624 strcat(className, "<");
4625 if(!first)
4626 strcat(className, ", ");
4627 if(lastParam + 1 != p)
4628 {
4629 strcat(className, param->name);
4630 strcat(className, " = ");
4631 }
4632 strcat(className, param->name);
4633 first = 0;
4634 lastParam = p;
4635 }
4636 p++;
4637 }
4638 if(!first)
4639 {
4640 int len = strlen(className);
4641
4642 if(className[len - 1] == '>')
4643 className[len++] = ' ';
4644 className[len++] = '>';
4645 className[len++] = '\0';
4646 }
4647 type = MkClassType(className);
4648 }
4649 else
4650 {
4651 type = MkClassType(_class->fullName);
4652 }
4653 return type;
4654 }
4655
4656 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4657 {
4658 if(specs != (((void *)0)) && _class)
4659 {
4660 struct Specifier * spec;
4661
4662 for(spec = specs->first; spec; spec = spec->next)
4663 {
4664 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4665 {
4666 spec->type = 1;
4667 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4668 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4669 }
4670 }
4671 }
4672 }
4673
4674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4675
4676 struct __ecereNameSpace__ecere__com__GlobalFunction
4677 {
4678 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4679 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4680 const char *  name;
4681 int (*  function)();
4682 struct __ecereNameSpace__ecere__com__Instance * module;
4683 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4684 const char *  dataTypeString;
4685 struct Type * dataType;
4686 void *  symbol;
4687 } __attribute__ ((gcc_struct));
4688
4689 extern struct Context * globalContext;
4690
4691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4692
4693 struct FunctionImport
4694 {
4695 struct FunctionImport * prev;
4696 struct FunctionImport * next;
4697 char *  name;
4698 } __attribute__ ((gcc_struct));
4699
4700 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4701 {
4702 struct Symbol * symbol = function->symbol;
4703
4704 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4705 {
4706 unsigned int imported = 0;
4707 unsigned int dllImport = 0;
4708
4709 if(!function->dataType)
4710 {
4711 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4712 if(!function->dataType->__anon1.__anon2.thisClass)
4713 function->dataType->__anon1.__anon2.staticMethod = 1;
4714 }
4715 if(inCompiler)
4716 {
4717 if(!symbol)
4718 {
4719 struct ModuleImport * module = FindModule(function->module);
4720
4721 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4722 if(module->name)
4723 {
4724 if(!function->dataType->dllExport)
4725 {
4726 symbol->_import = (struct ClassImport *)__extension__ ({
4727 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4728
4729 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4730 });
4731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4732 }
4733 }
4734 {
4735 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4736 if(!symbol->type->__anon1.__anon2.thisClass)
4737 symbol->type->__anon1.__anon2.staticMethod = 1;
4738 }
4739 }
4740 imported = symbol->_import ? 1 : 0;
4741 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4742 dllImport = 1;
4743 }
4744 DeclareType(function->dataType, 1, 1);
4745 if(inCompiler)
4746 {
4747 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4748 {
4749 struct Declaration * decl;
4750 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4751 struct Declarator * d;
4752 struct Declarator * funcDecl;
4753 struct External * external;
4754
4755 specifiers = MkList();
4756 declarators = MkList();
4757 ListAdd(specifiers, MkSpecifier(EXTERN));
4758 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4759 if(dllImport)
4760 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4761 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4762 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4763 {
4764 struct Specifier * spec;
4765
4766 for(spec = (*specifiers).first; spec; spec = spec->next)
4767 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4768 {
4769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4770 FreeSpecifier(spec);
4771 break;
4772 }
4773 }
4774 funcDecl = GetFuncDecl(d);
4775 if(funcDecl && !funcDecl->__anon1.function.parameters)
4776 {
4777 funcDecl->__anon1.function.parameters = MkList();
4778 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4779 }
4780 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4781 {
4782 struct Context * oldCtx = curContext;
4783
4784 curContext = globalContext;
4785 decl = MkDeclaration(specifiers, declarators);
4786 curContext = oldCtx;
4787 }
4788 if(symbol->__anon2.__anon1.pointerExternal)
4789 {
4790 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4791
4792 {
4793 *functionSymbol = *symbol;
4794 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4795 if(functionSymbol->type)
4796 functionSymbol->type->refCount++;
4797 }
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4799 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4800 }
4801 external = MkExternalDeclaration(decl);
4802 if(curExternal)
4803 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4804 external->symbol = symbol;
4805 symbol->__anon2.__anon1.pointerExternal = external;
4806 }
4807 else
4808 {
4809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4810 }
4811 if(curExternal)
4812 symbol->id = curExternal->symbol->idCode;
4813 }
4814 }
4815 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4816 }
4817
4818 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4819
4820 struct GlobalData
4821 {
4822 uintptr_t key;
4823 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4824 struct __ecereNameSpace__ecere__sys__BTNode * left;
4825 struct __ecereNameSpace__ecere__sys__BTNode * right;
4826 int depth;
4827 struct __ecereNameSpace__ecere__com__Instance * module;
4828 char *  dataTypeString;
4829 struct Type * dataType;
4830 void *  symbol;
4831 char *  fullName;
4832 } __attribute__ ((gcc_struct));
4833
4834 void DeclareGlobalData(struct GlobalData * data)
4835 {
4836 struct Symbol * symbol = data->symbol;
4837
4838 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4839 {
4840 if(inCompiler)
4841 {
4842 if(!symbol)
4843 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4844 }
4845 if(!data->dataType)
4846 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4847 DeclareType(data->dataType, 1, 1);
4848 if(inCompiler)
4849 {
4850 if(!symbol->__anon2.__anon1.pointerExternal)
4851 {
4852 struct Declaration * decl;
4853 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4854 struct Declarator * d;
4855 struct External * external;
4856
4857 specifiers = MkList();
4858 declarators = MkList();
4859 ListAdd(specifiers, MkSpecifier(EXTERN));
4860 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4861 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4862 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4863 decl = MkDeclaration(specifiers, declarators);
4864 external = MkExternalDeclaration(decl);
4865 if(curExternal)
4866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4867 external->symbol = symbol;
4868 symbol->__anon2.__anon1.pointerExternal = external;
4869 }
4870 else
4871 {
4872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4873 }
4874 if(curExternal)
4875 symbol->id = curExternal->symbol->idCode;
4876 }
4877 }
4878 }
4879
4880 struct Conversion
4881 {
4882 struct Conversion * prev, * next;
4883 struct __ecereNameSpace__ecere__com__Property * convert;
4884 unsigned int isGet;
4885 struct Type * resultType;
4886 } __attribute__ ((gcc_struct));
4887
4888 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4889
4890 extern void Compiler_Warning(const char *  format, ...);
4891
4892 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4893 {
4894 unsigned int status = 1;
4895
4896 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))
4897 {
4898 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4899 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4900
4901 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4902 {
4903 struct Type * sourceType = source, * destType = dest;
4904
4905 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4906 sourceType = sourceType->__anon1.type;
4907 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4908 destType = destType->__anon1.type;
4909 if(!destType->constant && sourceType->constant)
4910 {
4911 status = 0;
4912 if(warn)
4913 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4914 }
4915 }
4916 }
4917 return status;
4918 }
4919
4920 extern void CopyTypeInto(struct Type * type, struct Type * src);
4921
4922 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4923
4924 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)
4925 {
4926 if(source && dest)
4927 {
4928 if(warnConst)
4929 CheckConstCompatibility(source, dest, 1);
4930 if(source->kind == 20 && dest->kind != 20)
4931 {
4932 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4933
4934 if(type)
4935 source = type;
4936 }
4937 if(dest->kind == 20 && source->kind != 20)
4938 {
4939 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4940
4941 if(type)
4942 dest = type;
4943 }
4944 if(dest->classObjectType == 2 && dest->kind != 11)
4945 {
4946 if(source->classObjectType != 3)
4947 return 1;
4948 else
4949 {
4950 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4951 {
4952 return 1;
4953 }
4954 }
4955 }
4956 else
4957 {
4958 if(source->kind != 11 && source->classObjectType == 3)
4959 return 1;
4960 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4961 return 1;
4962 }
4963 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4964 {
4965 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))
4966 return 1;
4967 }
4968 if(dest->kind == 14 && source->kind != 0)
4969 return 1;
4970 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))
4971 return 1;
4972 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))
4973 return 1;
4974 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4975 {
4976 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4977 {
4978 if(conversions != (((void *)0)))
4979 {
4980 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4981 return 1;
4982 }
4983 else
4984 {
4985 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4986
4987 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4988 ;
4989 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4990 ;
4991 if(sourceBase == destBase)
4992 return 1;
4993 }
4994 }
4995 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))
4996 return 1;
4997 else
4998 {
4999 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))
5000 {
5001 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
5002 {
5003 return 1;
5004 }
5005 }
5006 }
5007 }
5008 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
5009 return 1;
5010 if(doConversion)
5011 {
5012 if(source->kind == 8)
5013 {
5014 struct __ecereNameSpace__ecere__com__Class * _class;
5015
5016 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5017 {
5018 struct __ecereNameSpace__ecere__com__Property * convert;
5019
5020 for(convert = _class->conversions.first; convert; convert = convert->next)
5021 {
5022 if(convert->memberAccess == 1 || _class->module == privateModule)
5023 {
5024 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5025
5026 if(!convert->dataType)
5027 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5028 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 1 : 0, convert->dataType->kind == 8, 0, 1, warnConst))
5029 {
5030 if(!conversions && !convert->Get)
5031 return 1;
5032 else if(conversions != (((void *)0)))
5033 {
5034 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))
5035 return 1;
5036 else
5037 {
5038 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5039
5040 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5041 return 1;
5042 }
5043 }
5044 }
5045 }
5046 }
5047 }
5048 }
5049 if(dest->kind == 8)
5050 {
5051 struct __ecereNameSpace__ecere__com__Class * _class;
5052
5053 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5054 {
5055 struct __ecereNameSpace__ecere__com__Property * convert;
5056
5057 for(convert = _class->conversions.first; convert; convert = convert->next)
5058 {
5059 if(convert->memberAccess == 1 || _class->module == privateModule)
5060 {
5061 struct Type * constType = (((void *)0));
5062 unsigned int success = 0;
5063
5064 if(!convert->dataType)
5065 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5066 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5067 {
5068 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5069
5070 constType = __extension__ ({
5071 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5072
5073 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5074 });
5075 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5076 ptrType->constant = 1;
5077 }
5078 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5079 {
5080 if(!conversions && !convert->Set)
5081 success = 1;
5082 else if(conversions != (((void *)0)))
5083 {
5084 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))
5085 success = 1;
5086 else
5087 {
5088 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5089
5090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5091 success = 1;
5092 }
5093 }
5094 }
5095 if(constType)
5096 FreeType(constType);
5097 if(success)
5098 return 1;
5099 }
5100 }
5101 }
5102 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5103 {
5104 if(!dest->__anon1._class->__anon1.registered->dataType)
5105 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5106 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5107 {
5108 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5109 {
5110 return 1;
5111 }
5112 }
5113 }
5114 }
5115 if(source->kind == 8)
5116 {
5117 struct __ecereNameSpace__ecere__com__Class * _class;
5118
5119 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5120 {
5121 struct __ecereNameSpace__ecere__com__Property * convert;
5122
5123 for(convert = _class->conversions.first; convert; convert = convert->next)
5124 {
5125 if(convert->memberAccess == 1 || _class->module == privateModule)
5126 {
5127 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5128
5129 if(!convert->dataType)
5130 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5131 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0, 1, warnConst))
5132 {
5133 if(!conversions && !convert->Get)
5134 return 1;
5135 else if(conversions != (((void *)0)))
5136 {
5137 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))
5138 return 1;
5139 else
5140 {
5141 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5142
5143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5144 return 1;
5145 }
5146 }
5147 }
5148 }
5149 }
5150 }
5151 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5152 {
5153 if(!source->__anon1._class->__anon1.registered->dataType)
5154 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5155 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5156 {
5157 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5158 return 1;
5159 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5160 return 1;
5161 }
5162 }
5163 }
5164 }
5165 if(source->kind == 8 || source->kind == 19)
5166 ;
5167 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5168 return 1;
5169 else if(dest->kind == 7 && source->kind == 6)
5170 return 1;
5171 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5172 return 1;
5173 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5174 return 1;
5175 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5176 return 1;
5177 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5178 return 1;
5179 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5180 return 1;
5181 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))
5182 return 1;
5183 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))
5184 return 1;
5185 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)))
5186 {
5187 struct Type * paramSource, * paramDest;
5188
5189 if(dest->kind == 16)
5190 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5191 if(source->kind == 16)
5192 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5193 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5194 dest = dest->__anon1.type;
5195 if(source->kind == 13 && source->__anon1.type->kind == 11)
5196 source = source->__anon1.type;
5197 if(dest->kind == 16)
5198 dest = dest->__anon1.__anon3.method->dataType;
5199 if(source->kind == 16)
5200 source = source->__anon1.__anon3.method->dataType;
5201 paramSource = source->__anon1.__anon2.params.first;
5202 if(paramSource && paramSource->kind == 0)
5203 paramSource = (((void *)0));
5204 paramDest = dest->__anon1.__anon2.params.first;
5205 if(paramDest && paramDest->kind == 0)
5206 paramDest = (((void *)0));
5207 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5208 {
5209 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))))
5210 {
5211 if(paramDest && paramDest->kind == 8)
5212 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5213 else
5214 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5215 return 0;
5216 }
5217 paramDest = paramDest->next;
5218 }
5219 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5220 {
5221 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5222 {
5223 if(dest->__anon1.__anon2.thisClass)
5224 {
5225 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5226 {
5227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5228 return 0;
5229 }
5230 }
5231 else
5232 {
5233 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5234 {
5235 if(owningClassDest)
5236 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5237 else
5238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5239 return 0;
5240 }
5241 }
5242 paramSource = paramSource->next;
5243 }
5244 else
5245 {
5246 if(dest->__anon1.__anon2.thisClass)
5247 {
5248 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5249 {
5250 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5251 return 0;
5252 }
5253 }
5254 else
5255 {
5256 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5257 {
5258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5259 return 0;
5260 }
5261 }
5262 }
5263 }
5264 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5265 {
5266 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5267 return 0;
5268 }
5269 else
5270 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5271 for(; paramDest; paramDest = paramDest->next)
5272 {
5273 if(!paramSource)
5274 {
5275 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5276 return 0;
5277 }
5278 {
5279 struct Type * paramDestType = paramDest;
5280 struct Type * paramSourceType = paramSource;
5281 struct Type * type = paramDestType;
5282
5283 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5284 {
5285 int id = 0;
5286 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5287 struct __ecereNameSpace__ecere__com__Class * sClass;
5288
5289 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5290 {
5291 id = 0;
5292 if(sClass->templateClass)
5293 sClass = sClass->templateClass;
5294 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5295 {
5296 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5297 {
5298 for(sClass = sClass->base; sClass; sClass = sClass->base)
5299 {
5300 if(sClass->templateClass)
5301 sClass = sClass->templateClass;
5302 id += sClass->templateParams.count;
5303 }
5304 break;
5305 }
5306 id++;
5307 }
5308 if(curParam)
5309 break;
5310 }
5311 if(curParam)
5312 {
5313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5314
5315 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5316 }
5317 }
5318 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst)))
5319 {
5320 char type[1024];
5321
5322 type[0] = (char)0;
5323 PrintType(paramDest, type, 0, 1);
5324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5325 if(paramDestType != paramDest)
5326 FreeType(paramDestType);
5327 return 0;
5328 }
5329 if(paramDestType != paramDest)
5330 FreeType(paramDestType);
5331 }
5332 paramSource = paramSource->next;
5333 }
5334 if(paramSource)
5335 {
5336 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5337 return 0;
5338 }
5339 return 1;
5340 }
5341 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5342 {
5343 return 1;
5344 }
5345 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5346 {
5347 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5348 return 1;
5349 }
5350 }
5351 return 0;
5352 }
5353
5354 static void FreeConvert(struct Conversion * convert)
5355 {
5356 if(convert->resultType)
5357 FreeType(convert->resultType);
5358 }
5359
5360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5361
5362 struct __ecereNameSpace__ecere__com__BTNamedLink
5363 {
5364 const char *  name;
5365 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5366 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5367 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5368 int depth;
5369 void *  data;
5370 } __attribute__ ((gcc_struct));
5371
5372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5373
5374 struct __ecereNameSpace__ecere__com__EnumClassData
5375 {
5376 struct __ecereNameSpace__ecere__sys__OldList values;
5377 long long largest;
5378 } __attribute__ ((gcc_struct));
5379
5380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5381
5382 struct __ecereNameSpace__ecere__sys__NamedLink64
5383 {
5384 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5385 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5386 char *  name;
5387 long long data;
5388 } __attribute__ ((gcc_struct));
5389
5390 extern void FreeExpContents(struct Expression * exp);
5391
5392 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5393
5394 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5395
5396 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5397
5398 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5399
5400 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5401
5402 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5403 {
5404 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5405
5406 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)))
5407 {
5408 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5409
5410 if(_class->type == 4)
5411 {
5412 struct __ecereNameSpace__ecere__sys__OldList converts =
5413 {
5414 0, 0, 0, 0, 0
5415 };
5416 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5417
5418 type->kind = 8;
5419 if(!_class->symbol)
5420 _class->symbol = FindClass(_class->fullName);
5421 type->__anon1._class = _class->symbol;
5422 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5423 {
5424 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5425 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5426
5427 if(enumClass)
5428 {
5429 struct __ecereNameSpace__ecere__com__Class * baseClass;
5430
5431 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5432 {
5433 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5434
5435 for(value = e->values.first; value; value = value->next)
5436 {
5437 if(!strcmp(value->name, string))
5438 break;
5439 }
5440 if(value)
5441 {
5442 FreeExpContents(sourceExp);
5443 FreeType(sourceExp->expType);
5444 sourceExp->isConstant = 1;
5445 sourceExp->expType = MkClassType(baseClass->fullName);
5446 {
5447 char constant[256];
5448
5449 sourceExp->type = 2;
5450 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5451 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5452 else
5453 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5454 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5455 }
5456 while(converts.first)
5457 {
5458 struct Conversion * convert = converts.first;
5459
5460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5462 }
5463 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5464 return 1;
5465 }
5466 }
5467 }
5468 }
5469 if(converts.first)
5470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
5471 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5472 }
5473 }
5474 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)))
5475 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5476 return 1;
5477 return 0;
5478 }
5479
5480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5481
5482 struct __ecereNameSpace__ecere__com__SubModule
5483 {
5484 struct __ecereNameSpace__ecere__com__SubModule * prev;
5485 struct __ecereNameSpace__ecere__com__SubModule * next;
5486 struct __ecereNameSpace__ecere__com__Instance * module;
5487 int importMode;
5488 } __attribute__ ((gcc_struct));
5489
5490 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5491 {
5492 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5493
5494 if(searchFor == searchIn)
5495 return 1;
5496 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5497 {
5498 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5499 {
5500 if(ModuleVisibility(subModule->module, searchFor))
5501 return 1;
5502 }
5503 }
5504 return 0;
5505 }
5506
5507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5508
5509 struct __ecereNameSpace__ecere__com__Application
5510 {
5511 int argc;
5512 const char * *  argv;
5513 int exitCode;
5514 unsigned int isGUIApp;
5515 struct __ecereNameSpace__ecere__sys__OldList allModules;
5516 char *  parsedCommand;
5517 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5518 } __attribute__ ((gcc_struct));
5519
5520 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5521 {
5522 struct __ecereNameSpace__ecere__com__Instance * module;
5523
5524 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))
5525 return 1;
5526 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))
5527 return 1;
5528 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))
5529 return 1;
5530 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)
5531 {
5532 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5533 return 1;
5534 }
5535 return 0;
5536 }
5537
5538 extern struct Expression * CopyExpression(struct Expression * exp);
5539
5540 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5541
5542 void ReadString(char *  output, char *  string);
5543
5544 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5545
5546 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5547
5548 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5549
5550 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5551 {
5552 struct Type * source;
5553 struct Type * realDest = dest;
5554 struct Type * backupSourceExpType = (((void *)0));
5555 struct Expression * computedExp = sourceExp;
5556
5557 dest->refCount++;
5558 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)
5559 {
5560 computedExp = CopyExpression(sourceExp);
5561 ComputeExpression(computedExp);
5562 }
5563 source = sourceExp->expType;
5564 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5565 {
5566 if(computedExp != sourceExp)
5567 {
5568 FreeExpression(computedExp);
5569 computedExp = sourceExp;
5570 }
5571 FreeType(dest);
5572 return 1;
5573 }
5574 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5575 {
5576 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5577 {
5578 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5579
5580 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5581 ;
5582 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5583 ;
5584 if(sourceBase == destBase)
5585 {
5586 if(computedExp != sourceExp)
5587 {
5588 FreeExpression(computedExp);
5589 computedExp = sourceExp;
5590 }
5591 FreeType(dest);
5592 return 1;
5593 }
5594 }
5595 }
5596 if(source)
5597 {
5598 struct __ecereNameSpace__ecere__sys__OldList * specs;
5599 unsigned int flag = 0;
5600 long long value = (((int)0x7fffffff));
5601
5602 source->refCount++;
5603 if(computedExp->type == 2)
5604 {
5605 if(source->isSigned)
5606 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5607 else
5608 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5609 }
5610 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5611 {
5612 if(source->isSigned)
5613 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5614 else
5615 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5616 }
5617 if(computedExp != sourceExp)
5618 {
5619 FreeExpression(computedExp);
5620 computedExp = sourceExp;
5621 }
5622 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"))
5623 {
5624 FreeType(source);
5625 source = __extension__ ({
5626 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5627
5628 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5629 });
5630 }
5631 if(dest->kind == 8)
5632 {
5633 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5634
5635 if(_class && _class->type == 3)
5636 {
5637 if(source->kind != 8)
5638 {
5639 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5640 struct Type * tempDest, * tempSource;
5641
5642 for(; _class->base->type != 1000; _class = _class->base)
5643 ;
5644 tempSource = dest;
5645 tempDest = tempType;
5646 tempType->kind = 8;
5647 if(!_class->symbol)
5648 _class->symbol = FindClass(_class->fullName);
5649 tempType->__anon1._class = _class->symbol;
5650 tempType->truth = dest->truth;
5651 if(tempType->__anon1._class)
5652 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5653 backupSourceExpType = sourceExp->expType;
5654 sourceExp->expType = dest;
5655 dest->refCount++;
5656 flag = 1;
5657 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5658 }
5659 }
5660 if(_class && _class->type == 2 && source->kind != 8)
5661 {
5662 if(!dest->__anon1._class->__anon1.registered->dataType)
5663 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5664 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5665 {
5666 FreeType(source);
5667 FreeType(sourceExp->expType);
5668 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5669 source->refCount++;
5670 }
5671 }
5672 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5673 {
5674 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5675 struct Declarator * decl;
5676 char string[1024];
5677
5678 ReadString(string, sourceExp->__anon1.__anon2.string);
5679 decl = SpecDeclFromString(string, specs, (((void *)0)));
5680 FreeExpContents(sourceExp);
5681 FreeType(sourceExp->expType);
5682 sourceExp->type = 24;
5683 sourceExp->__anon1._classExp.specifiers = specs;
5684 sourceExp->__anon1._classExp.decl = decl;
5685 sourceExp->expType = dest;
5686 dest->refCount++;
5687 FreeType(source);
5688 FreeType(dest);
5689 if(backupSourceExpType)
5690 FreeType(backupSourceExpType);
5691 return 1;
5692 }
5693 }
5694 else if(source->kind == 8)
5695 {
5696 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5697
5698 if(_class && (_class->type == 3 || _class->type == 2))
5699 {
5700 if(dest->kind != 8)
5701 {
5702 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5703 struct Type * tempDest, * tempSource;
5704
5705 if(!source->__anon1._class->__anon1.registered->dataType)
5706 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5707 for(; _class->base->type != 1000; _class = _class->base)
5708 ;
5709 tempDest = source;
5710 tempSource = tempType;
5711 tempType->kind = 8;
5712 tempType->__anon1._class = FindClass(_class->fullName);
5713 tempType->truth = source->truth;
5714 tempType->classObjectType = source->classObjectType;
5715 if(tempType->__anon1._class)
5716 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5717 if(conversions->last)
5718 {
5719 ((struct Conversion *)conversions->last)->resultType = dest;
5720 dest->refCount++;
5721 }
5722 FreeType(sourceExp->expType);
5723 sourceExp->expType = MkClassType(_class->fullName);
5724 sourceExp->expType->truth = source->truth;
5725 sourceExp->expType->classObjectType = source->classObjectType;
5726 if(!sourceExp->destType)
5727 {
5728 FreeType(sourceExp->destType);
5729 sourceExp->destType = sourceExp->expType;
5730 if(sourceExp->expType)
5731 sourceExp->expType->refCount++;
5732 }
5733 if(!_class->dataType)
5734 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5735 FreeType(dest);
5736 dest = MkClassType(source->__anon1._class->string);
5737 dest->truth = source->truth;
5738 dest->classObjectType = source->classObjectType;
5739 FreeType(source);
5740 source = _class->dataType;
5741 source->refCount++;
5742 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5743 }
5744 }
5745 }
5746 if(!flag)
5747 {
5748 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5749 {
5750 FreeType(source);
5751 FreeType(dest);
5752 return 1;
5753 }
5754 }
5755 if(dest->kind == 8)
5756 {
5757 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5758 unsigned int fittingValue = 0;
5759
5760 if(_class && _class->type == 4)
5761 {
5762 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5763 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5764
5765 if(c && value >= 0 && value <= c->largest)
5766 fittingValue = 1;
5767 }
5768 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5769 {
5770 if(_class->type == 0 || _class->type == 5)
5771 {
5772 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5773
5774 *newExp = *sourceExp;
5775 if(sourceExp->destType)
5776 sourceExp->destType->refCount++;
5777 if(sourceExp->expType)
5778 sourceExp->expType->refCount++;
5779 sourceExp->type = 11;
5780 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5781 sourceExp->__anon1.cast.exp = newExp;
5782 FreeType(sourceExp->expType);
5783 sourceExp->expType = (((void *)0));
5784 ProcessExpressionType(sourceExp);
5785 if(!inCompiler)
5786 {
5787 FreeType(sourceExp->expType);
5788 sourceExp->expType = dest;
5789 }
5790 FreeType(source);
5791 if(inCompiler)
5792 FreeType(dest);
5793 if(backupSourceExpType)
5794 FreeType(backupSourceExpType);
5795 return 1;
5796 }
5797 if(!_class->dataType)
5798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5799 FreeType(dest);
5800 dest = _class->dataType;
5801 dest->refCount++;
5802 }
5803 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))
5804 {
5805 specs = MkListOne(MkSpecifier(DOUBLE));
5806 }
5807 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))
5808 {
5809 specs = MkListOne(MkSpecifier(FLOAT));
5810 }
5811 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))
5812 {
5813 specs = MkList();
5814 if(!dest->isSigned)
5815 ListAdd(specs, MkSpecifier(UNSIGNED));
5816 ListAdd(specs, MkSpecifier(INT64));
5817 }
5818 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5819 {
5820 specs = MkList();
5821 if(!dest->isSigned)
5822 ListAdd(specs, MkSpecifier(UNSIGNED));
5823 ListAdd(specs, MkSpecifier(INT));
5824 }
5825 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5826 {
5827 specs = MkList();
5828 if(!dest->isSigned)
5829 ListAdd(specs, MkSpecifier(UNSIGNED));
5830 ListAdd(specs, MkSpecifier(SHORT));
5831 }
5832 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5833 {
5834 specs = MkList();
5835 if(!dest->isSigned)
5836 ListAdd(specs, MkSpecifier(UNSIGNED));
5837 ListAdd(specs, MkSpecifier(CHAR));
5838 }
5839 else
5840 {
5841 FreeType(source);
5842 FreeType(dest);
5843 if(backupSourceExpType)
5844 {
5845 if(sourceExp->expType)
5846 FreeType(sourceExp->expType);
5847 sourceExp->expType = backupSourceExpType;
5848 }
5849 return 0;
5850 }
5851 }
5852 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))
5853 {
5854 specs = MkListOne(MkSpecifier(DOUBLE));
5855 }
5856 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))
5857 {
5858 specs = MkListOne(MkSpecifier(FLOAT));
5859 }
5860 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5861 {
5862 specs = MkList();
5863 ListAdd(specs, MkSpecifier(BOOL));
5864 }
5865 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)))
5866 {
5867 specs = MkList();
5868 if(!dest->isSigned)
5869 ListAdd(specs, MkSpecifier(UNSIGNED));
5870 ListAdd(specs, MkSpecifier(CHAR));
5871 }
5872 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)))))
5873 {
5874 specs = MkList();
5875 if(!dest->isSigned)
5876 ListAdd(specs, MkSpecifier(UNSIGNED));
5877 ListAdd(specs, MkSpecifier(SHORT));
5878 }
5879 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5880 {
5881 specs = MkList();
5882 if(!dest->isSigned)
5883 ListAdd(specs, MkSpecifier(UNSIGNED));
5884 ListAdd(specs, MkSpecifier(INT));
5885 }
5886 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5887 {
5888 specs = MkList();
5889 if(!dest->isSigned)
5890 ListAdd(specs, MkSpecifier(UNSIGNED));
5891 ListAdd(specs, MkSpecifier(INT64));
5892 }
5893 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5894 {
5895 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5896 }
5897 else
5898 {
5899 FreeType(source);
5900 FreeType(dest);
5901 if(backupSourceExpType)
5902 {
5903 if(sourceExp->expType)
5904 FreeType(sourceExp->expType);
5905 sourceExp->expType = backupSourceExpType;
5906 }
5907 return 0;
5908 }
5909 if(!flag && !sourceExp->opDestType)
5910 {
5911 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5912
5913 *newExp = *sourceExp;
5914 newExp->prev = (((void *)0));
5915 newExp->next = (((void *)0));
5916 if(sourceExp->destType)
5917 sourceExp->destType->refCount++;
5918 if(sourceExp->expType)
5919 sourceExp->expType->refCount++;
5920 sourceExp->type = 11;
5921 if(realDest->kind == 8)
5922 {
5923 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5924 FreeList(specs, (void *)(FreeSpecifier));
5925 }
5926 else
5927 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5928 if(newExp->type == 4)
5929 {
5930 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5931 }
5932 else
5933 sourceExp->__anon1.cast.exp = newExp;
5934 FreeType(sourceExp->expType);
5935 sourceExp->expType = (((void *)0));
5936 ProcessExpressionType(sourceExp);
5937 }
5938 else
5939 FreeList(specs, (void *)(FreeSpecifier));
5940 FreeType(dest);
5941 FreeType(source);
5942 if(backupSourceExpType)
5943 FreeType(backupSourceExpType);
5944 return 1;
5945 }
5946 else
5947 {
5948 if(computedExp != sourceExp)
5949 {
5950 FreeExpression(computedExp);
5951 computedExp = sourceExp;
5952 }
5953 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5954 sourceExp = (*sourceExp->__anon1.list).last;
5955 if(sourceExp->type == 0)
5956 {
5957 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5958
5959 if(dest->kind == 8)
5960 {
5961 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5962 {
5963 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5964 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5965
5966 if(enumClass)
5967 {
5968 for(; _class && _class->type == 4; _class = _class->base)
5969 {
5970 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5971 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5972
5973 for(value = e->values.first; value; value = value->next)
5974 {
5975 if(!strcmp(value->name, id->string))
5976 break;
5977 }
5978 if(value)
5979 {
5980 FreeExpContents(sourceExp);
5981 FreeType(sourceExp->expType);
5982 sourceExp->isConstant = 1;
5983 sourceExp->expType = MkClassType(_class->fullName);
5984 {
5985 sourceExp->type = 2;
5986 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5987 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5988 else
5989 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5990 }
5991 FreeType(dest);
5992 return 1;
5993 }
5994 }
5995 }
5996 }
5997 }
5998 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5999 {
6000 FreeType(dest);
6001 return 1;
6002 }
6003 }
6004 FreeType(dest);
6005 }
6006 return 0;
6007 }
6008
6009 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6010 {
6011 int value2 = op2->__anon1.i;
6012
6013 exp->type = 2;
6014 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6015 if(!exp->expType)
6016 {
6017 exp->expType = op1->type;
6018 if(op1->type)
6019 op1->type->refCount++;
6020 }
6021 return 1;
6022 }
6023
6024 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6025 {
6026 unsigned int value2 = op2->__anon1.ui;
6027
6028 exp->type = 2;
6029 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6030 if(!exp->expType)
6031 {
6032 exp->expType = op1->type;
6033 if(op1->type)
6034 op1->type->refCount++;
6035 }
6036 return 1;
6037 }
6038
6039 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6040 {
6041 long long value2 = op2->__anon1.i64;
6042
6043 exp->type = 2;
6044 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6045 if(!exp->expType)
6046 {
6047 exp->expType = op1->type;
6048 if(op1->type)
6049 op1->type->refCount++;
6050 }
6051 return 1;
6052 }
6053
6054 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6055 {
6056 uint64 value2 = op2->__anon1.ui64;
6057
6058 exp->type = 2;
6059 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6060 if(!exp->expType)
6061 {
6062 exp->expType = op1->type;
6063 if(op1->type)
6064 op1->type->refCount++;
6065 }
6066 return 1;
6067 }
6068
6069 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6070 {
6071 short value2 = op2->__anon1.s;
6072
6073 exp->type = 2;
6074 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6075 if(!exp->expType)
6076 {
6077 exp->expType = op1->type;
6078 if(op1->type)
6079 op1->type->refCount++;
6080 }
6081 return 1;
6082 }
6083
6084 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6085 {
6086 unsigned short value2 = op2->__anon1.us;
6087
6088 exp->type = 2;
6089 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6090 if(!exp->expType)
6091 {
6092 exp->expType = op1->type;
6093 if(op1->type)
6094 op1->type->refCount++;
6095 }
6096 return 1;
6097 }
6098
6099 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6100 {
6101 char value2 = op2->__anon1.c;
6102
6103 exp->type = 2;
6104 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6105 if(!exp->expType)
6106 {
6107 exp->expType = op1->type;
6108 if(op1->type)
6109 op1->type->refCount++;
6110 }
6111 return 1;
6112 }
6113
6114 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6115 {
6116 unsigned char value2 = op2->__anon1.uc;
6117
6118 exp->type = 2;
6119 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6120 if(!exp->expType)
6121 {
6122 exp->expType = op1->type;
6123 if(op1->type)
6124 op1->type->refCount++;
6125 }
6126 return 1;
6127 }
6128
6129 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6130 {
6131 float value2 = op2->__anon1.f;
6132
6133 exp->type = 2;
6134 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6135 if(!exp->expType)
6136 {
6137 exp->expType = op1->type;
6138 if(op1->type)
6139 op1->type->refCount++;
6140 }
6141 return 1;
6142 }
6143
6144 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6145 {
6146 double value2 = op2->__anon1.d;
6147
6148 exp->type = 2;
6149 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6150 if(!exp->expType)
6151 {
6152 exp->expType = op1->type;
6153 if(op1->type)
6154 op1->type->refCount++;
6155 }
6156 return 1;
6157 }
6158
6159 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6160 {
6161 int value2 = op2->__anon1.i;
6162
6163 exp->type = 2;
6164 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6165 if(!exp->expType)
6166 {
6167 exp->expType = op1->type;
6168 if(op1->type)
6169 op1->type->refCount++;
6170 }
6171 return 1;
6172 }
6173
6174 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6175 {
6176 unsigned int value2 = op2->__anon1.ui;
6177
6178 exp->type = 2;
6179 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6180 if(!exp->expType)
6181 {
6182 exp->expType = op1->type;
6183 if(op1->type)
6184 op1->type->refCount++;
6185 }
6186 return 1;
6187 }
6188
6189 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6190 {
6191 long long value2 = op2->__anon1.i64;
6192
6193 exp->type = 2;
6194 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6195 if(!exp->expType)
6196 {
6197 exp->expType = op1->type;
6198 if(op1->type)
6199 op1->type->refCount++;
6200 }
6201 return 1;
6202 }
6203
6204 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6205 {
6206 uint64 value2 = op2->__anon1.ui64;
6207
6208 exp->type = 2;
6209 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6210 if(!exp->expType)
6211 {
6212 exp->expType = op1->type;
6213 if(op1->type)
6214 op1->type->refCount++;
6215 }
6216 return 1;
6217 }
6218
6219 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6220 {
6221 short value2 = op2->__anon1.s;
6222
6223 exp->type = 2;
6224 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6225 if(!exp->expType)
6226 {
6227 exp->expType = op1->type;
6228 if(op1->type)
6229 op1->type->refCount++;
6230 }
6231 return 1;
6232 }
6233
6234 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6235 {
6236 unsigned short value2 = op2->__anon1.us;
6237
6238 exp->type = 2;
6239 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6240 if(!exp->expType)
6241 {
6242 exp->expType = op1->type;
6243 if(op1->type)
6244 op1->type->refCount++;
6245 }
6246 return 1;
6247 }
6248
6249 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6250 {
6251 char value2 = op2->__anon1.c;
6252
6253 exp->type = 2;
6254 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6255 if(!exp->expType)
6256 {
6257 exp->expType = op1->type;
6258 if(op1->type)
6259 op1->type->refCount++;
6260 }
6261 return 1;
6262 }
6263
6264 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6265 {
6266 unsigned char value2 = op2->__anon1.uc;
6267
6268 exp->type = 2;
6269 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6270 if(!exp->expType)
6271 {
6272 exp->expType = op1->type;
6273 if(op1->type)
6274 op1->type->refCount++;
6275 }
6276 return 1;
6277 }
6278
6279 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6280 {
6281 float value2 = op2->__anon1.f;
6282
6283 exp->type = 2;
6284 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6285 if(!exp->expType)
6286 {
6287 exp->expType = op1->type;
6288 if(op1->type)
6289 op1->type->refCount++;
6290 }
6291 return 1;
6292 }
6293
6294 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6295 {
6296 double value2 = op2->__anon1.d;
6297
6298 exp->type = 2;
6299 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6300 if(!exp->expType)
6301 {
6302 exp->expType = op1->type;
6303 if(op1->type)
6304 op1->type->refCount++;
6305 }
6306 return 1;
6307 }
6308
6309 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6310 {
6311 int value2 = op2->__anon1.i;
6312
6313 exp->type = 2;
6314 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6315 if(!exp->expType)
6316 {
6317 exp->expType = op1->type;
6318 if(op1->type)
6319 op1->type->refCount++;
6320 }
6321 return 1;
6322 }
6323
6324 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6325 {
6326 unsigned int value2 = op2->__anon1.ui;
6327
6328 exp->type = 2;
6329 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6330 if(!exp->expType)
6331 {
6332 exp->expType = op1->type;
6333 if(op1->type)
6334 op1->type->refCount++;
6335 }
6336 return 1;
6337 }
6338
6339 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6340 {
6341 long long value2 = op2->__anon1.i64;
6342
6343 exp->type = 2;
6344 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6345 if(!exp->expType)
6346 {
6347 exp->expType = op1->type;
6348 if(op1->type)
6349 op1->type->refCount++;
6350 }
6351 return 1;
6352 }
6353
6354 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6355 {
6356 uint64 value2 = op2->__anon1.ui64;
6357
6358 exp->type = 2;
6359 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6360 if(!exp->expType)
6361 {
6362 exp->expType = op1->type;
6363 if(op1->type)
6364 op1->type->refCount++;
6365 }
6366 return 1;
6367 }
6368
6369 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6370 {
6371 short value2 = op2->__anon1.s;
6372
6373 exp->type = 2;
6374 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6375 if(!exp->expType)
6376 {
6377 exp->expType = op1->type;
6378 if(op1->type)
6379 op1->type->refCount++;
6380 }
6381 return 1;
6382 }
6383
6384 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6385 {
6386 unsigned short value2 = op2->__anon1.us;
6387
6388 exp->type = 2;
6389 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6390 if(!exp->expType)
6391 {
6392 exp->expType = op1->type;
6393 if(op1->type)
6394 op1->type->refCount++;
6395 }
6396 return 1;
6397 }
6398
6399 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6400 {
6401 char value2 = op2->__anon1.c;
6402
6403 exp->type = 2;
6404 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6405 if(!exp->expType)
6406 {
6407 exp->expType = op1->type;
6408 if(op1->type)
6409 op1->type->refCount++;
6410 }
6411 return 1;
6412 }
6413
6414 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6415 {
6416 unsigned char value2 = op2->__anon1.uc;
6417
6418 exp->type = 2;
6419 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6420 if(!exp->expType)
6421 {
6422 exp->expType = op1->type;
6423 if(op1->type)
6424 op1->type->refCount++;
6425 }
6426 return 1;
6427 }
6428
6429 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6430 {
6431 float value2 = op2->__anon1.f;
6432
6433 exp->type = 2;
6434 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6435 if(!exp->expType)
6436 {
6437 exp->expType = op1->type;
6438 if(op1->type)
6439 op1->type->refCount++;
6440 }
6441 return 1;
6442 }
6443
6444 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6445 {
6446 double value2 = op2->__anon1.d;
6447
6448 exp->type = 2;
6449 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6450 if(!exp->expType)
6451 {
6452 exp->expType = op1->type;
6453 if(op1->type)
6454 op1->type->refCount++;
6455 }
6456 return 1;
6457 }
6458
6459 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6460 {
6461 int value2 = op2->__anon1.i;
6462
6463 exp->type = 2;
6464 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6465 if(!exp->expType)
6466 {
6467 exp->expType = op1->type;
6468 if(op1->type)
6469 op1->type->refCount++;
6470 }
6471 return 1;
6472 }
6473
6474 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6475 {
6476 unsigned int value2 = op2->__anon1.ui;
6477
6478 exp->type = 2;
6479 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6480 if(!exp->expType)
6481 {
6482 exp->expType = op1->type;
6483 if(op1->type)
6484 op1->type->refCount++;
6485 }
6486 return 1;
6487 }
6488
6489 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6490 {
6491 long long value2 = op2->__anon1.i64;
6492
6493 exp->type = 2;
6494 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6495 if(!exp->expType)
6496 {
6497 exp->expType = op1->type;
6498 if(op1->type)
6499 op1->type->refCount++;
6500 }
6501 return 1;
6502 }
6503
6504 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6505 {
6506 uint64 value2 = op2->__anon1.ui64;
6507
6508 exp->type = 2;
6509 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6510 if(!exp->expType)
6511 {
6512 exp->expType = op1->type;
6513 if(op1->type)
6514 op1->type->refCount++;
6515 }
6516 return 1;
6517 }
6518
6519 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6520 {
6521 short value2 = op2->__anon1.s;
6522
6523 exp->type = 2;
6524 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6525 if(!exp->expType)
6526 {
6527 exp->expType = op1->type;
6528 if(op1->type)
6529 op1->type->refCount++;
6530 }
6531 return 1;
6532 }
6533
6534 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6535 {
6536 unsigned short value2 = op2->__anon1.us;
6537
6538 exp->type = 2;
6539 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6540 if(!exp->expType)
6541 {
6542 exp->expType = op1->type;
6543 if(op1->type)
6544 op1->type->refCount++;
6545 }
6546 return 1;
6547 }
6548
6549 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6550 {
6551 char value2 = op2->__anon1.c;
6552
6553 exp->type = 2;
6554 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6555 if(!exp->expType)
6556 {
6557 exp->expType = op1->type;
6558 if(op1->type)
6559 op1->type->refCount++;
6560 }
6561 return 1;
6562 }
6563
6564 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6565 {
6566 unsigned char value2 = op2->__anon1.uc;
6567
6568 exp->type = 2;
6569 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6570 if(!exp->expType)
6571 {
6572 exp->expType = op1->type;
6573 if(op1->type)
6574 op1->type->refCount++;
6575 }
6576 return 1;
6577 }
6578
6579 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6580 {
6581 float value2 = op2->__anon1.f;
6582
6583 exp->type = 2;
6584 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6585 if(!exp->expType)
6586 {
6587 exp->expType = op1->type;
6588 if(op1->type)
6589 op1->type->refCount++;
6590 }
6591 return 1;
6592 }
6593
6594 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6595 {
6596 double value2 = op2->__anon1.d;
6597
6598 exp->type = 2;
6599 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6600 if(!exp->expType)
6601 {
6602 exp->expType = op1->type;
6603 if(op1->type)
6604 op1->type->refCount++;
6605 }
6606 return 1;
6607 }
6608
6609 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6610 {
6611 int value2 = op2->__anon1.i;
6612
6613 exp->type = 2;
6614 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6615 if(!exp->expType)
6616 {
6617 exp->expType = op1->type;
6618 if(op1->type)
6619 op1->type->refCount++;
6620 }
6621 return 1;
6622 }
6623
6624 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6625 {
6626 unsigned int value2 = op2->__anon1.ui;
6627
6628 exp->type = 2;
6629 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6630 if(!exp->expType)
6631 {
6632 exp->expType = op1->type;
6633 if(op1->type)
6634 op1->type->refCount++;
6635 }
6636 return 1;
6637 }
6638
6639 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6640 {
6641 long long value2 = op2->__anon1.i64;
6642
6643 exp->type = 2;
6644 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6645 if(!exp->expType)
6646 {
6647 exp->expType = op1->type;
6648 if(op1->type)
6649 op1->type->refCount++;
6650 }
6651 return 1;
6652 }
6653
6654 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6655 {
6656 uint64 value2 = op2->__anon1.ui64;
6657
6658 exp->type = 2;
6659 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6660 if(!exp->expType)
6661 {
6662 exp->expType = op1->type;
6663 if(op1->type)
6664 op1->type->refCount++;
6665 }
6666 return 1;
6667 }
6668
6669 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6670 {
6671 short value2 = op2->__anon1.s;
6672
6673 exp->type = 2;
6674 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6675 if(!exp->expType)
6676 {
6677 exp->expType = op1->type;
6678 if(op1->type)
6679 op1->type->refCount++;
6680 }
6681 return 1;
6682 }
6683
6684 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6685 {
6686 unsigned short value2 = op2->__anon1.us;
6687
6688 exp->type = 2;
6689 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6690 if(!exp->expType)
6691 {
6692 exp->expType = op1->type;
6693 if(op1->type)
6694 op1->type->refCount++;
6695 }
6696 return 1;
6697 }
6698
6699 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6700 {
6701 char value2 = op2->__anon1.c;
6702
6703 exp->type = 2;
6704 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6705 if(!exp->expType)
6706 {
6707 exp->expType = op1->type;
6708 if(op1->type)
6709 op1->type->refCount++;
6710 }
6711 return 1;
6712 }
6713
6714 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6715 {
6716 unsigned char value2 = op2->__anon1.uc;
6717
6718 exp->type = 2;
6719 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6720 if(!exp->expType)
6721 {
6722 exp->expType = op1->type;
6723 if(op1->type)
6724 op1->type->refCount++;
6725 }
6726 return 1;
6727 }
6728
6729 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6730 {
6731 exp->type = 2;
6732 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6733 if(!exp->expType)
6734 {
6735 exp->expType = op1->type;
6736 if(op1->type)
6737 op1->type->refCount++;
6738 }
6739 return 1;
6740 }
6741
6742 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6743 {
6744 exp->type = 2;
6745 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6746 if(!exp->expType)
6747 {
6748 exp->expType = op1->type;
6749 if(op1->type)
6750 op1->type->refCount++;
6751 }
6752 return 1;
6753 }
6754
6755 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6756 {
6757 exp->type = 2;
6758 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6759 if(!exp->expType)
6760 {
6761 exp->expType = op1->type;
6762 if(op1->type)
6763 op1->type->refCount++;
6764 }
6765 return 1;
6766 }
6767
6768 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6769 {
6770 exp->type = 2;
6771 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6772 if(!exp->expType)
6773 {
6774 exp->expType = op1->type;
6775 if(op1->type)
6776 op1->type->refCount++;
6777 }
6778 return 1;
6779 }
6780
6781 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6782 {
6783 exp->type = 2;
6784 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 1;
6792 }
6793
6794 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6795 {
6796 exp->type = 2;
6797 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6798 if(!exp->expType)
6799 {
6800 exp->expType = op1->type;
6801 if(op1->type)
6802 op1->type->refCount++;
6803 }
6804 return 1;
6805 }
6806
6807 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6808 {
6809 exp->type = 2;
6810 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6811 if(!exp->expType)
6812 {
6813 exp->expType = op1->type;
6814 if(op1->type)
6815 op1->type->refCount++;
6816 }
6817 return 1;
6818 }
6819
6820 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6821 {
6822 exp->type = 2;
6823 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6824 if(!exp->expType)
6825 {
6826 exp->expType = op1->type;
6827 if(op1->type)
6828 op1->type->refCount++;
6829 }
6830 return 1;
6831 }
6832
6833 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6834 {
6835 exp->type = 2;
6836 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 1;
6844 }
6845
6846 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6847 {
6848 exp->type = 2;
6849 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6850 if(!exp->expType)
6851 {
6852 exp->expType = op1->type;
6853 if(op1->type)
6854 op1->type->refCount++;
6855 }
6856 return 1;
6857 }
6858
6859 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6860 {
6861 exp->type = 2;
6862 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6863 if(!exp->expType)
6864 {
6865 exp->expType = op1->type;
6866 if(op1->type)
6867 op1->type->refCount++;
6868 }
6869 return 1;
6870 }
6871
6872 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6873 {
6874 exp->type = 2;
6875 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 1;
6883 }
6884
6885 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6886 {
6887 exp->type = 2;
6888 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 1;
6896 }
6897
6898 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6899 {
6900 exp->type = 2;
6901 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 1;
6909 }
6910
6911 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6912 {
6913 exp->type = 2;
6914 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6915 if(!exp->expType)
6916 {
6917 exp->expType = op1->type;
6918 if(op1->type)
6919 op1->type->refCount++;
6920 }
6921 return 1;
6922 }
6923
6924 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6925 {
6926 exp->type = 2;
6927 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6928 if(!exp->expType)
6929 {
6930 exp->expType = op1->type;
6931 if(op1->type)
6932 op1->type->refCount++;
6933 }
6934 return 1;
6935 }
6936
6937 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6938 {
6939 exp->type = 2;
6940 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6941 if(!exp->expType)
6942 {
6943 exp->expType = op1->type;
6944 if(op1->type)
6945 op1->type->refCount++;
6946 }
6947 return 1;
6948 }
6949
6950 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6951 {
6952 exp->type = 2;
6953 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6954 if(!exp->expType)
6955 {
6956 exp->expType = op1->type;
6957 if(op1->type)
6958 op1->type->refCount++;
6959 }
6960 return 1;
6961 }
6962
6963 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6964 {
6965 exp->type = 2;
6966 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6967 if(!exp->expType)
6968 {
6969 exp->expType = op1->type;
6970 if(op1->type)
6971 op1->type->refCount++;
6972 }
6973 return 1;
6974 }
6975
6976 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6977 {
6978 exp->type = 2;
6979 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6980 if(!exp->expType)
6981 {
6982 exp->expType = op1->type;
6983 if(op1->type)
6984 op1->type->refCount++;
6985 }
6986 return 1;
6987 }
6988
6989 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6990 {
6991 exp->type = 2;
6992 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6993 if(!exp->expType)
6994 {
6995 exp->expType = op1->type;
6996 if(op1->type)
6997 op1->type->refCount++;
6998 }
6999 return 1;
7000 }
7001
7002 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7003 {
7004 exp->type = 2;
7005 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7006 if(!exp->expType)
7007 {
7008 exp->expType = op1->type;
7009 if(op1->type)
7010 op1->type->refCount++;
7011 }
7012 return 1;
7013 }
7014
7015 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7016 {
7017 exp->type = 2;
7018 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7019 if(!exp->expType)
7020 {
7021 exp->expType = op1->type;
7022 if(op1->type)
7023 op1->type->refCount++;
7024 }
7025 return 1;
7026 }
7027
7028 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7029 {
7030 exp->type = 2;
7031 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 1;
7039 }
7040
7041 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7042 {
7043 exp->type = 2;
7044 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 1;
7052 }
7053
7054 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7055 {
7056 exp->type = 2;
7057 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7058 if(!exp->expType)
7059 {
7060 exp->expType = op1->type;
7061 if(op1->type)
7062 op1->type->refCount++;
7063 }
7064 return 1;
7065 }
7066
7067 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7068 {
7069 exp->type = 2;
7070 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 1;
7078 }
7079
7080 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7081 {
7082 exp->type = 2;
7083 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 1;
7091 }
7092
7093 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7094 {
7095 exp->type = 2;
7096 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 1;
7104 }
7105
7106 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7107 {
7108 exp->type = 2;
7109 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7110 if(!exp->expType)
7111 {
7112 exp->expType = op1->type;
7113 if(op1->type)
7114 op1->type->refCount++;
7115 }
7116 return 1;
7117 }
7118
7119 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7120 {
7121 int value2 = op2->__anon1.i;
7122
7123 exp->type = 2;
7124 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7125 if(!exp->expType)
7126 {
7127 exp->expType = op1->type;
7128 if(op1->type)
7129 op1->type->refCount++;
7130 }
7131 return 1;
7132 }
7133
7134 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7135 {
7136 unsigned int value2 = op2->__anon1.ui;
7137
7138 exp->type = 2;
7139 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7140 if(!exp->expType)
7141 {
7142 exp->expType = op1->type;
7143 if(op1->type)
7144 op1->type->refCount++;
7145 }
7146 return 1;
7147 }
7148
7149 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7150 {
7151 long long value2 = op2->__anon1.i64;
7152
7153 exp->type = 2;
7154 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7155 if(!exp->expType)
7156 {
7157 exp->expType = op1->type;
7158 if(op1->type)
7159 op1->type->refCount++;
7160 }
7161 return 1;
7162 }
7163
7164 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7165 {
7166 uint64 value2 = op2->__anon1.ui64;
7167
7168 exp->type = 2;
7169 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7170 if(!exp->expType)
7171 {
7172 exp->expType = op1->type;
7173 if(op1->type)
7174 op1->type->refCount++;
7175 }
7176 return 1;
7177 }
7178
7179 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7180 {
7181 short value2 = op2->__anon1.s;
7182
7183 exp->type = 2;
7184 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7185 if(!exp->expType)
7186 {
7187 exp->expType = op1->type;
7188 if(op1->type)
7189 op1->type->refCount++;
7190 }
7191 return 1;
7192 }
7193
7194 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7195 {
7196 unsigned short value2 = op2->__anon1.us;
7197
7198 exp->type = 2;
7199 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7200 if(!exp->expType)
7201 {
7202 exp->expType = op1->type;
7203 if(op1->type)
7204 op1->type->refCount++;
7205 }
7206 return 1;
7207 }
7208
7209 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7210 {
7211 char value2 = op2->__anon1.c;
7212
7213 exp->type = 2;
7214 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7215 if(!exp->expType)
7216 {
7217 exp->expType = op1->type;
7218 if(op1->type)
7219 op1->type->refCount++;
7220 }
7221 return 1;
7222 }
7223
7224 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7225 {
7226 unsigned char value2 = op2->__anon1.uc;
7227
7228 exp->type = 2;
7229 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7230 if(!exp->expType)
7231 {
7232 exp->expType = op1->type;
7233 if(op1->type)
7234 op1->type->refCount++;
7235 }
7236 return 1;
7237 }
7238
7239 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7240 {
7241 float value2 = op2->__anon1.f;
7242
7243 exp->type = 2;
7244 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7245 if(!exp->expType)
7246 {
7247 exp->expType = op1->type;
7248 if(op1->type)
7249 op1->type->refCount++;
7250 }
7251 return 1;
7252 }
7253
7254 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7255 {
7256 double value2 = op2->__anon1.d;
7257
7258 exp->type = 2;
7259 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7260 if(!exp->expType)
7261 {
7262 exp->expType = op1->type;
7263 if(op1->type)
7264 op1->type->refCount++;
7265 }
7266 return 1;
7267 }
7268
7269 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7270 {
7271 int value2 = op2->__anon1.i;
7272
7273 exp->type = 2;
7274 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7275 if(!exp->expType)
7276 {
7277 exp->expType = op1->type;
7278 if(op1->type)
7279 op1->type->refCount++;
7280 }
7281 return 1;
7282 }
7283
7284 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7285 {
7286 unsigned int value2 = op2->__anon1.ui;
7287
7288 exp->type = 2;
7289 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7290 if(!exp->expType)
7291 {
7292 exp->expType = op1->type;
7293 if(op1->type)
7294 op1->type->refCount++;
7295 }
7296 return 1;
7297 }
7298
7299 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7300 {
7301 long long value2 = op2->__anon1.i64;
7302
7303 exp->type = 2;
7304 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7305 if(!exp->expType)
7306 {
7307 exp->expType = op1->type;
7308 if(op1->type)
7309 op1->type->refCount++;
7310 }
7311 return 1;
7312 }
7313
7314 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7315 {
7316 uint64 value2 = op2->__anon1.ui64;
7317
7318 exp->type = 2;
7319 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7320 if(!exp->expType)
7321 {
7322 exp->expType = op1->type;
7323 if(op1->type)
7324 op1->type->refCount++;
7325 }
7326 return 1;
7327 }
7328
7329 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7330 {
7331 short value2 = op2->__anon1.s;
7332
7333 exp->type = 2;
7334 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7335 if(!exp->expType)
7336 {
7337 exp->expType = op1->type;
7338 if(op1->type)
7339 op1->type->refCount++;
7340 }
7341 return 1;
7342 }
7343
7344 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7345 {
7346 unsigned short value2 = op2->__anon1.us;
7347
7348 exp->type = 2;
7349 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7350 if(!exp->expType)
7351 {
7352 exp->expType = op1->type;
7353 if(op1->type)
7354 op1->type->refCount++;
7355 }
7356 return 1;
7357 }
7358
7359 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7360 {
7361 char value2 = op2->__anon1.c;
7362
7363 exp->type = 2;
7364 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7365 if(!exp->expType)
7366 {
7367 exp->expType = op1->type;
7368 if(op1->type)
7369 op1->type->refCount++;
7370 }
7371 return 1;
7372 }
7373
7374 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7375 {
7376 unsigned char value2 = op2->__anon1.uc;
7377
7378 exp->type = 2;
7379 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7380 if(!exp->expType)
7381 {
7382 exp->expType = op1->type;
7383 if(op1->type)
7384 op1->type->refCount++;
7385 }
7386 return 1;
7387 }
7388
7389 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7390 {
7391 float value2 = op2->__anon1.f;
7392
7393 exp->type = 2;
7394 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7395 if(!exp->expType)
7396 {
7397 exp->expType = op1->type;
7398 if(op1->type)
7399 op1->type->refCount++;
7400 }
7401 return 1;
7402 }
7403
7404 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7405 {
7406 double value2 = op2->__anon1.d;
7407
7408 exp->type = 2;
7409 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7410 if(!exp->expType)
7411 {
7412 exp->expType = op1->type;
7413 if(op1->type)
7414 op1->type->refCount++;
7415 }
7416 return 1;
7417 }
7418
7419 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7420 {
7421 int value2 = op2->__anon1.i;
7422
7423 exp->type = 2;
7424 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7425 if(!exp->expType)
7426 {
7427 exp->expType = op1->type;
7428 if(op1->type)
7429 op1->type->refCount++;
7430 }
7431 return 1;
7432 }
7433
7434 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7435 {
7436 unsigned int value2 = op2->__anon1.ui;
7437
7438 exp->type = 2;
7439 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7440 if(!exp->expType)
7441 {
7442 exp->expType = op1->type;
7443 if(op1->type)
7444 op1->type->refCount++;
7445 }
7446 return 1;
7447 }
7448
7449 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7450 {
7451 long long value2 = op2->__anon1.i64;
7452
7453 exp->type = 2;
7454 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7455 if(!exp->expType)
7456 {
7457 exp->expType = op1->type;
7458 if(op1->type)
7459 op1->type->refCount++;
7460 }
7461 return 1;
7462 }
7463
7464 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7465 {
7466 uint64 value2 = op2->__anon1.ui64;
7467
7468 exp->type = 2;
7469 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7470 if(!exp->expType)
7471 {
7472 exp->expType = op1->type;
7473 if(op1->type)
7474 op1->type->refCount++;
7475 }
7476 return 1;
7477 }
7478
7479 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7480 {
7481 short value2 = op2->__anon1.s;
7482
7483 exp->type = 2;
7484 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7485 if(!exp->expType)
7486 {
7487 exp->expType = op1->type;
7488 if(op1->type)
7489 op1->type->refCount++;
7490 }
7491 return 1;
7492 }
7493
7494 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7495 {
7496 unsigned short value2 = op2->__anon1.us;
7497
7498 exp->type = 2;
7499 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7500 if(!exp->expType)
7501 {
7502 exp->expType = op1->type;
7503 if(op1->type)
7504 op1->type->refCount++;
7505 }
7506 return 1;
7507 }
7508
7509 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7510 {
7511 char value2 = op2->__anon1.c;
7512
7513 exp->type = 2;
7514 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7515 if(!exp->expType)
7516 {
7517 exp->expType = op1->type;
7518 if(op1->type)
7519 op1->type->refCount++;
7520 }
7521 return 1;
7522 }
7523
7524 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7525 {
7526 unsigned char value2 = op2->__anon1.uc;
7527
7528 exp->type = 2;
7529 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7530 if(!exp->expType)
7531 {
7532 exp->expType = op1->type;
7533 if(op1->type)
7534 op1->type->refCount++;
7535 }
7536 return 1;
7537 }
7538
7539 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7540 {
7541 float value2 = op2->__anon1.f;
7542
7543 exp->type = 2;
7544 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7545 if(!exp->expType)
7546 {
7547 exp->expType = op1->type;
7548 if(op1->type)
7549 op1->type->refCount++;
7550 }
7551 return 1;
7552 }
7553
7554 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7555 {
7556 double value2 = op2->__anon1.d;
7557
7558 exp->type = 2;
7559 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7560 if(!exp->expType)
7561 {
7562 exp->expType = op1->type;
7563 if(op1->type)
7564 op1->type->refCount++;
7565 }
7566 return 1;
7567 }
7568
7569 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7570 {
7571 int value2 = op2->__anon1.i;
7572
7573 exp->type = 2;
7574 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7575 if(!exp->expType)
7576 {
7577 exp->expType = op1->type;
7578 if(op1->type)
7579 op1->type->refCount++;
7580 }
7581 return 1;
7582 }
7583
7584 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7585 {
7586 unsigned int value2 = op2->__anon1.ui;
7587
7588 exp->type = 2;
7589 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7590 if(!exp->expType)
7591 {
7592 exp->expType = op1->type;
7593 if(op1->type)
7594 op1->type->refCount++;
7595 }
7596 return 1;
7597 }
7598
7599 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7600 {
7601 long long value2 = op2->__anon1.i64;
7602
7603 exp->type = 2;
7604 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7605 if(!exp->expType)
7606 {
7607 exp->expType = op1->type;
7608 if(op1->type)
7609 op1->type->refCount++;
7610 }
7611 return 1;
7612 }
7613
7614 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7615 {
7616 uint64 value2 = op2->__anon1.ui64;
7617
7618 exp->type = 2;
7619 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7620 if(!exp->expType)
7621 {
7622 exp->expType = op1->type;
7623 if(op1->type)
7624 op1->type->refCount++;
7625 }
7626 return 1;
7627 }
7628
7629 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7630 {
7631 short value2 = op2->__anon1.s;
7632
7633 exp->type = 2;
7634 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7635 if(!exp->expType)
7636 {
7637 exp->expType = op1->type;
7638 if(op1->type)
7639 op1->type->refCount++;
7640 }
7641 return 1;
7642 }
7643
7644 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7645 {
7646 unsigned short value2 = op2->__anon1.us;
7647
7648 exp->type = 2;
7649 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7650 if(!exp->expType)
7651 {
7652 exp->expType = op1->type;
7653 if(op1->type)
7654 op1->type->refCount++;
7655 }
7656 return 1;
7657 }
7658
7659 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7660 {
7661 char value2 = op2->__anon1.c;
7662
7663 exp->type = 2;
7664 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7665 if(!exp->expType)
7666 {
7667 exp->expType = op1->type;
7668 if(op1->type)
7669 op1->type->refCount++;
7670 }
7671 return 1;
7672 }
7673
7674 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7675 {
7676 unsigned char value2 = op2->__anon1.uc;
7677
7678 exp->type = 2;
7679 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7680 if(!exp->expType)
7681 {
7682 exp->expType = op1->type;
7683 if(op1->type)
7684 op1->type->refCount++;
7685 }
7686 return 1;
7687 }
7688
7689 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7690 {
7691 float value2 = op2->__anon1.f;
7692
7693 exp->type = 2;
7694 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7695 if(!exp->expType)
7696 {
7697 exp->expType = op1->type;
7698 if(op1->type)
7699 op1->type->refCount++;
7700 }
7701 return 1;
7702 }
7703
7704 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7705 {
7706 double value2 = op2->__anon1.d;
7707
7708 exp->type = 2;
7709 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7710 if(!exp->expType)
7711 {
7712 exp->expType = op1->type;
7713 if(op1->type)
7714 op1->type->refCount++;
7715 }
7716 return 1;
7717 }
7718
7719 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7720 {
7721 int value2 = op2->__anon1.i;
7722
7723 exp->type = 2;
7724 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7725 if(!exp->expType)
7726 {
7727 exp->expType = op1->type;
7728 if(op1->type)
7729 op1->type->refCount++;
7730 }
7731 return 1;
7732 }
7733
7734 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7735 {
7736 unsigned int value2 = op2->__anon1.ui;
7737
7738 exp->type = 2;
7739 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7740 if(!exp->expType)
7741 {
7742 exp->expType = op1->type;
7743 if(op1->type)
7744 op1->type->refCount++;
7745 }
7746 return 1;
7747 }
7748
7749 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7750 {
7751 long long value2 = op2->__anon1.i64;
7752
7753 exp->type = 2;
7754 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7755 if(!exp->expType)
7756 {
7757 exp->expType = op1->type;
7758 if(op1->type)
7759 op1->type->refCount++;
7760 }
7761 return 1;
7762 }
7763
7764 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7765 {
7766 uint64 value2 = op2->__anon1.ui64;
7767
7768 exp->type = 2;
7769 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7770 if(!exp->expType)
7771 {
7772 exp->expType = op1->type;
7773 if(op1->type)
7774 op1->type->refCount++;
7775 }
7776 return 1;
7777 }
7778
7779 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7780 {
7781 short value2 = op2->__anon1.s;
7782
7783 exp->type = 2;
7784 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7785 if(!exp->expType)
7786 {
7787 exp->expType = op1->type;
7788 if(op1->type)
7789 op1->type->refCount++;
7790 }
7791 return 1;
7792 }
7793
7794 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7795 {
7796 unsigned short value2 = op2->__anon1.us;
7797
7798 exp->type = 2;
7799 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7800 if(!exp->expType)
7801 {
7802 exp->expType = op1->type;
7803 if(op1->type)
7804 op1->type->refCount++;
7805 }
7806 return 1;
7807 }
7808
7809 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7810 {
7811 char value2 = op2->__anon1.c;
7812
7813 exp->type = 2;
7814 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7815 if(!exp->expType)
7816 {
7817 exp->expType = op1->type;
7818 if(op1->type)
7819 op1->type->refCount++;
7820 }
7821 return 1;
7822 }
7823
7824 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7825 {
7826 unsigned char value2 = op2->__anon1.uc;
7827
7828 exp->type = 2;
7829 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7830 if(!exp->expType)
7831 {
7832 exp->expType = op1->type;
7833 if(op1->type)
7834 op1->type->refCount++;
7835 }
7836 return 1;
7837 }
7838
7839 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7840 {
7841 float value2 = op2->__anon1.f;
7842
7843 exp->type = 2;
7844 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7845 if(!exp->expType)
7846 {
7847 exp->expType = op1->type;
7848 if(op1->type)
7849 op1->type->refCount++;
7850 }
7851 return 1;
7852 }
7853
7854 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7855 {
7856 double value2 = op2->__anon1.d;
7857
7858 exp->type = 2;
7859 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7860 if(!exp->expType)
7861 {
7862 exp->expType = op1->type;
7863 if(op1->type)
7864 op1->type->refCount++;
7865 }
7866 return 1;
7867 }
7868
7869 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7870 {
7871 int value2 = op2->__anon1.i;
7872
7873 exp->type = 2;
7874 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7875 if(!exp->expType)
7876 {
7877 exp->expType = op1->type;
7878 if(op1->type)
7879 op1->type->refCount++;
7880 }
7881 return 1;
7882 }
7883
7884 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7885 {
7886 unsigned int value2 = op2->__anon1.ui;
7887
7888 exp->type = 2;
7889 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7890 if(!exp->expType)
7891 {
7892 exp->expType = op1->type;
7893 if(op1->type)
7894 op1->type->refCount++;
7895 }
7896 return 1;
7897 }
7898
7899 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7900 {
7901 long long value2 = op2->__anon1.i64;
7902
7903 exp->type = 2;
7904 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7905 if(!exp->expType)
7906 {
7907 exp->expType = op1->type;
7908 if(op1->type)
7909 op1->type->refCount++;
7910 }
7911 return 1;
7912 }
7913
7914 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7915 {
7916 uint64 value2 = op2->__anon1.ui64;
7917
7918 exp->type = 2;
7919 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7920 if(!exp->expType)
7921 {
7922 exp->expType = op1->type;
7923 if(op1->type)
7924 op1->type->refCount++;
7925 }
7926 return 1;
7927 }
7928
7929 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7930 {
7931 short value2 = op2->__anon1.s;
7932
7933 exp->type = 2;
7934 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7935 if(!exp->expType)
7936 {
7937 exp->expType = op1->type;
7938 if(op1->type)
7939 op1->type->refCount++;
7940 }
7941 return 1;
7942 }
7943
7944 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7945 {
7946 unsigned short value2 = op2->__anon1.us;
7947
7948 exp->type = 2;
7949 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7950 if(!exp->expType)
7951 {
7952 exp->expType = op1->type;
7953 if(op1->type)
7954 op1->type->refCount++;
7955 }
7956 return 1;
7957 }
7958
7959 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7960 {
7961 char value2 = op2->__anon1.c;
7962
7963 exp->type = 2;
7964 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7965 if(!exp->expType)
7966 {
7967 exp->expType = op1->type;
7968 if(op1->type)
7969 op1->type->refCount++;
7970 }
7971 return 1;
7972 }
7973
7974 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7975 {
7976 unsigned char value2 = op2->__anon1.uc;
7977
7978 exp->type = 2;
7979 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7980 if(!exp->expType)
7981 {
7982 exp->expType = op1->type;
7983 if(op1->type)
7984 op1->type->refCount++;
7985 }
7986 return 1;
7987 }
7988
7989 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7990 {
7991 int value2 = op2->__anon1.i;
7992
7993 exp->type = 2;
7994 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7995 if(!exp->expType)
7996 {
7997 exp->expType = op1->type;
7998 if(op1->type)
7999 op1->type->refCount++;
8000 }
8001 return 1;
8002 }
8003
8004 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8005 {
8006 unsigned int value2 = op2->__anon1.ui;
8007
8008 exp->type = 2;
8009 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8010 if(!exp->expType)
8011 {
8012 exp->expType = op1->type;
8013 if(op1->type)
8014 op1->type->refCount++;
8015 }
8016 return 1;
8017 }
8018
8019 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8020 {
8021 long long value2 = op2->__anon1.i64;
8022
8023 exp->type = 2;
8024 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8025 if(!exp->expType)
8026 {
8027 exp->expType = op1->type;
8028 if(op1->type)
8029 op1->type->refCount++;
8030 }
8031 return 1;
8032 }
8033
8034 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8035 {
8036 uint64 value2 = op2->__anon1.ui64;
8037
8038 exp->type = 2;
8039 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8040 if(!exp->expType)
8041 {
8042 exp->expType = op1->type;
8043 if(op1->type)
8044 op1->type->refCount++;
8045 }
8046 return 1;
8047 }
8048
8049 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8050 {
8051 short value2 = op2->__anon1.s;
8052
8053 exp->type = 2;
8054 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8055 if(!exp->expType)
8056 {
8057 exp->expType = op1->type;
8058 if(op1->type)
8059 op1->type->refCount++;
8060 }
8061 return 1;
8062 }
8063
8064 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8065 {
8066 unsigned short value2 = op2->__anon1.us;
8067
8068 exp->type = 2;
8069 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8070 if(!exp->expType)
8071 {
8072 exp->expType = op1->type;
8073 if(op1->type)
8074 op1->type->refCount++;
8075 }
8076 return 1;
8077 }
8078
8079 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8080 {
8081 char value2 = op2->__anon1.c;
8082
8083 exp->type = 2;
8084 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8085 if(!exp->expType)
8086 {
8087 exp->expType = op1->type;
8088 if(op1->type)
8089 op1->type->refCount++;
8090 }
8091 return 1;
8092 }
8093
8094 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8095 {
8096 unsigned char value2 = op2->__anon1.uc;
8097
8098 exp->type = 2;
8099 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8100 if(!exp->expType)
8101 {
8102 exp->expType = op1->type;
8103 if(op1->type)
8104 op1->type->refCount++;
8105 }
8106 return 1;
8107 }
8108
8109 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8110 {
8111 int value2 = op2->__anon1.i;
8112
8113 exp->type = 2;
8114 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8115 if(!exp->expType)
8116 {
8117 exp->expType = op1->type;
8118 if(op1->type)
8119 op1->type->refCount++;
8120 }
8121 return 1;
8122 }
8123
8124 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8125 {
8126 unsigned int value2 = op2->__anon1.ui;
8127
8128 exp->type = 2;
8129 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8130 if(!exp->expType)
8131 {
8132 exp->expType = op1->type;
8133 if(op1->type)
8134 op1->type->refCount++;
8135 }
8136 return 1;
8137 }
8138
8139 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8140 {
8141 long long value2 = op2->__anon1.i64;
8142
8143 exp->type = 2;
8144 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8145 if(!exp->expType)
8146 {
8147 exp->expType = op1->type;
8148 if(op1->type)
8149 op1->type->refCount++;
8150 }
8151 return 1;
8152 }
8153
8154 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8155 {
8156 uint64 value2 = op2->__anon1.ui64;
8157
8158 exp->type = 2;
8159 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8160 if(!exp->expType)
8161 {
8162 exp->expType = op1->type;
8163 if(op1->type)
8164 op1->type->refCount++;
8165 }
8166 return 1;
8167 }
8168
8169 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8170 {
8171 short value2 = op2->__anon1.s;
8172
8173 exp->type = 2;
8174 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8175 if(!exp->expType)
8176 {
8177 exp->expType = op1->type;
8178 if(op1->type)
8179 op1->type->refCount++;
8180 }
8181 return 1;
8182 }
8183
8184 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8185 {
8186 unsigned short value2 = op2->__anon1.us;
8187
8188 exp->type = 2;
8189 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8190 if(!exp->expType)
8191 {
8192 exp->expType = op1->type;
8193 if(op1->type)
8194 op1->type->refCount++;
8195 }
8196 return 1;
8197 }
8198
8199 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8200 {
8201 char value2 = op2->__anon1.c;
8202
8203 exp->type = 2;
8204 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8205 if(!exp->expType)
8206 {
8207 exp->expType = op1->type;
8208 if(op1->type)
8209 op1->type->refCount++;
8210 }
8211 return 1;
8212 }
8213
8214 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8215 {
8216 unsigned char value2 = op2->__anon1.uc;
8217
8218 exp->type = 2;
8219 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8220 if(!exp->expType)
8221 {
8222 exp->expType = op1->type;
8223 if(op1->type)
8224 op1->type->refCount++;
8225 }
8226 return 1;
8227 }
8228
8229 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8230 {
8231 int value2 = op2->__anon1.i;
8232
8233 exp->type = 2;
8234 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8235 if(!exp->expType)
8236 {
8237 exp->expType = op1->type;
8238 if(op1->type)
8239 op1->type->refCount++;
8240 }
8241 return 1;
8242 }
8243
8244 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8245 {
8246 unsigned int value2 = op2->__anon1.ui;
8247
8248 exp->type = 2;
8249 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8250 if(!exp->expType)
8251 {
8252 exp->expType = op1->type;
8253 if(op1->type)
8254 op1->type->refCount++;
8255 }
8256 return 1;
8257 }
8258
8259 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8260 {
8261 long long value2 = op2->__anon1.i64;
8262
8263 exp->type = 2;
8264 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8265 if(!exp->expType)
8266 {
8267 exp->expType = op1->type;
8268 if(op1->type)
8269 op1->type->refCount++;
8270 }
8271 return 1;
8272 }
8273
8274 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8275 {
8276 uint64 value2 = op2->__anon1.ui64;
8277
8278 exp->type = 2;
8279 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8280 if(!exp->expType)
8281 {
8282 exp->expType = op1->type;
8283 if(op1->type)
8284 op1->type->refCount++;
8285 }
8286 return 1;
8287 }
8288
8289 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8290 {
8291 short value2 = op2->__anon1.s;
8292
8293 exp->type = 2;
8294 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8295 if(!exp->expType)
8296 {
8297 exp->expType = op1->type;
8298 if(op1->type)
8299 op1->type->refCount++;
8300 }
8301 return 1;
8302 }
8303
8304 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8305 {
8306 unsigned short value2 = op2->__anon1.us;
8307
8308 exp->type = 2;
8309 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8310 if(!exp->expType)
8311 {
8312 exp->expType = op1->type;
8313 if(op1->type)
8314 op1->type->refCount++;
8315 }
8316 return 1;
8317 }
8318
8319 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8320 {
8321 char value2 = op2->__anon1.c;
8322
8323 exp->type = 2;
8324 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8325 if(!exp->expType)
8326 {
8327 exp->expType = op1->type;
8328 if(op1->type)
8329 op1->type->refCount++;
8330 }
8331 return 1;
8332 }
8333
8334 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8335 {
8336 unsigned char value2 = op2->__anon1.uc;
8337
8338 exp->type = 2;
8339 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8340 if(!exp->expType)
8341 {
8342 exp->expType = op1->type;
8343 if(op1->type)
8344 op1->type->refCount++;
8345 }
8346 return 1;
8347 }
8348
8349 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8350 {
8351 int value2 = op2->__anon1.i;
8352
8353 exp->type = 2;
8354 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8355 if(!exp->expType)
8356 {
8357 exp->expType = op1->type;
8358 if(op1->type)
8359 op1->type->refCount++;
8360 }
8361 return 1;
8362 }
8363
8364 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8365 {
8366 unsigned int value2 = op2->__anon1.ui;
8367
8368 exp->type = 2;
8369 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8370 if(!exp->expType)
8371 {
8372 exp->expType = op1->type;
8373 if(op1->type)
8374 op1->type->refCount++;
8375 }
8376 return 1;
8377 }
8378
8379 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8380 {
8381 long long value2 = op2->__anon1.i64;
8382
8383 exp->type = 2;
8384 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8385 if(!exp->expType)
8386 {
8387 exp->expType = op1->type;
8388 if(op1->type)
8389 op1->type->refCount++;
8390 }
8391 return 1;
8392 }
8393
8394 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8395 {
8396 uint64 value2 = op2->__anon1.ui64;
8397
8398 exp->type = 2;
8399 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8400 if(!exp->expType)
8401 {
8402 exp->expType = op1->type;
8403 if(op1->type)
8404 op1->type->refCount++;
8405 }
8406 return 1;
8407 }
8408
8409 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8410 {
8411 short value2 = op2->__anon1.s;
8412
8413 exp->type = 2;
8414 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8415 if(!exp->expType)
8416 {
8417 exp->expType = op1->type;
8418 if(op1->type)
8419 op1->type->refCount++;
8420 }
8421 return 1;
8422 }
8423
8424 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8425 {
8426 unsigned short value2 = op2->__anon1.us;
8427
8428 exp->type = 2;
8429 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8430 if(!exp->expType)
8431 {
8432 exp->expType = op1->type;
8433 if(op1->type)
8434 op1->type->refCount++;
8435 }
8436 return 1;
8437 }
8438
8439 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8440 {
8441 char value2 = op2->__anon1.c;
8442
8443 exp->type = 2;
8444 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8445 if(!exp->expType)
8446 {
8447 exp->expType = op1->type;
8448 if(op1->type)
8449 op1->type->refCount++;
8450 }
8451 return 1;
8452 }
8453
8454 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8455 {
8456 unsigned char value2 = op2->__anon1.uc;
8457
8458 exp->type = 2;
8459 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8460 if(!exp->expType)
8461 {
8462 exp->expType = op1->type;
8463 if(op1->type)
8464 op1->type->refCount++;
8465 }
8466 return 1;
8467 }
8468
8469 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8470 {
8471 int value2 = op2->__anon1.i;
8472
8473 exp->type = 2;
8474 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8475 if(!exp->expType)
8476 {
8477 exp->expType = op1->type;
8478 if(op1->type)
8479 op1->type->refCount++;
8480 }
8481 return 1;
8482 }
8483
8484 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8485 {
8486 unsigned int value2 = op2->__anon1.ui;
8487
8488 exp->type = 2;
8489 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8490 if(!exp->expType)
8491 {
8492 exp->expType = op1->type;
8493 if(op1->type)
8494 op1->type->refCount++;
8495 }
8496 return 1;
8497 }
8498
8499 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8500 {
8501 long long value2 = op2->__anon1.i64;
8502
8503 exp->type = 2;
8504 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8505 if(!exp->expType)
8506 {
8507 exp->expType = op1->type;
8508 if(op1->type)
8509 op1->type->refCount++;
8510 }
8511 return 1;
8512 }
8513
8514 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8515 {
8516 uint64 value2 = op2->__anon1.ui64;
8517
8518 exp->type = 2;
8519 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8520 if(!exp->expType)
8521 {
8522 exp->expType = op1->type;
8523 if(op1->type)
8524 op1->type->refCount++;
8525 }
8526 return 1;
8527 }
8528
8529 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8530 {
8531 short value2 = op2->__anon1.s;
8532
8533 exp->type = 2;
8534 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8535 if(!exp->expType)
8536 {
8537 exp->expType = op1->type;
8538 if(op1->type)
8539 op1->type->refCount++;
8540 }
8541 return 1;
8542 }
8543
8544 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8545 {
8546 unsigned short value2 = op2->__anon1.us;
8547
8548 exp->type = 2;
8549 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8550 if(!exp->expType)
8551 {
8552 exp->expType = op1->type;
8553 if(op1->type)
8554 op1->type->refCount++;
8555 }
8556 return 1;
8557 }
8558
8559 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8560 {
8561 char value2 = op2->__anon1.c;
8562
8563 exp->type = 2;
8564 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8565 if(!exp->expType)
8566 {
8567 exp->expType = op1->type;
8568 if(op1->type)
8569 op1->type->refCount++;
8570 }
8571 return 1;
8572 }
8573
8574 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8575 {
8576 unsigned char value2 = op2->__anon1.uc;
8577
8578 exp->type = 2;
8579 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8580 if(!exp->expType)
8581 {
8582 exp->expType = op1->type;
8583 if(op1->type)
8584 op1->type->refCount++;
8585 }
8586 return 1;
8587 }
8588
8589 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8590 {
8591 exp->type = 2;
8592 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8593 if(!exp->expType)
8594 {
8595 exp->expType = op1->type;
8596 if(op1->type)
8597 op1->type->refCount++;
8598 }
8599 return 1;
8600 }
8601
8602 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8603 {
8604 exp->type = 2;
8605 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8606 if(!exp->expType)
8607 {
8608 exp->expType = op1->type;
8609 if(op1->type)
8610 op1->type->refCount++;
8611 }
8612 return 1;
8613 }
8614
8615 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8616 {
8617 exp->type = 2;
8618 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 1;
8626 }
8627
8628 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8629 {
8630 exp->type = 2;
8631 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8632 if(!exp->expType)
8633 {
8634 exp->expType = op1->type;
8635 if(op1->type)
8636 op1->type->refCount++;
8637 }
8638 return 1;
8639 }
8640
8641 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8642 {
8643 exp->type = 2;
8644 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 1;
8652 }
8653
8654 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8655 {
8656 exp->type = 2;
8657 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 1;
8665 }
8666
8667 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8668 {
8669 exp->type = 2;
8670 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8671 if(!exp->expType)
8672 {
8673 exp->expType = op1->type;
8674 if(op1->type)
8675 op1->type->refCount++;
8676 }
8677 return 1;
8678 }
8679
8680 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8681 {
8682 exp->type = 2;
8683 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8684 if(!exp->expType)
8685 {
8686 exp->expType = op1->type;
8687 if(op1->type)
8688 op1->type->refCount++;
8689 }
8690 return 1;
8691 }
8692
8693 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8694 {
8695 int value2 = op2->__anon1.i;
8696
8697 exp->type = 2;
8698 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8699 if(!exp->expType)
8700 {
8701 exp->expType = op1->type;
8702 if(op1->type)
8703 op1->type->refCount++;
8704 }
8705 return 1;
8706 }
8707
8708 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8709 {
8710 unsigned int value2 = op2->__anon1.ui;
8711
8712 exp->type = 2;
8713 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8714 if(!exp->expType)
8715 {
8716 exp->expType = op1->type;
8717 if(op1->type)
8718 op1->type->refCount++;
8719 }
8720 return 1;
8721 }
8722
8723 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8724 {
8725 long long value2 = op2->__anon1.i64;
8726
8727 exp->type = 2;
8728 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8729 if(!exp->expType)
8730 {
8731 exp->expType = op1->type;
8732 if(op1->type)
8733 op1->type->refCount++;
8734 }
8735 return 1;
8736 }
8737
8738 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8739 {
8740 uint64 value2 = op2->__anon1.ui64;
8741
8742 exp->type = 2;
8743 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8744 if(!exp->expType)
8745 {
8746 exp->expType = op1->type;
8747 if(op1->type)
8748 op1->type->refCount++;
8749 }
8750 return 1;
8751 }
8752
8753 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8754 {
8755 short value2 = op2->__anon1.s;
8756
8757 exp->type = 2;
8758 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8759 if(!exp->expType)
8760 {
8761 exp->expType = op1->type;
8762 if(op1->type)
8763 op1->type->refCount++;
8764 }
8765 return 1;
8766 }
8767
8768 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8769 {
8770 unsigned short value2 = op2->__anon1.us;
8771
8772 exp->type = 2;
8773 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8774 if(!exp->expType)
8775 {
8776 exp->expType = op1->type;
8777 if(op1->type)
8778 op1->type->refCount++;
8779 }
8780 return 1;
8781 }
8782
8783 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8784 {
8785 char value2 = op2->__anon1.c;
8786
8787 exp->type = 2;
8788 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8789 if(!exp->expType)
8790 {
8791 exp->expType = op1->type;
8792 if(op1->type)
8793 op1->type->refCount++;
8794 }
8795 return 1;
8796 }
8797
8798 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8799 {
8800 unsigned char value2 = op2->__anon1.uc;
8801
8802 exp->type = 2;
8803 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8804 if(!exp->expType)
8805 {
8806 exp->expType = op1->type;
8807 if(op1->type)
8808 op1->type->refCount++;
8809 }
8810 return 1;
8811 }
8812
8813 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8814 {
8815 int value2 = op2->__anon1.i;
8816
8817 exp->type = 2;
8818 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8819 if(!exp->expType)
8820 {
8821 exp->expType = op1->type;
8822 if(op1->type)
8823 op1->type->refCount++;
8824 }
8825 return 1;
8826 }
8827
8828 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8829 {
8830 unsigned int value2 = op2->__anon1.ui;
8831
8832 exp->type = 2;
8833 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8834 if(!exp->expType)
8835 {
8836 exp->expType = op1->type;
8837 if(op1->type)
8838 op1->type->refCount++;
8839 }
8840 return 1;
8841 }
8842
8843 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8844 {
8845 long long value2 = op2->__anon1.i64;
8846
8847 exp->type = 2;
8848 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8849 if(!exp->expType)
8850 {
8851 exp->expType = op1->type;
8852 if(op1->type)
8853 op1->type->refCount++;
8854 }
8855 return 1;
8856 }
8857
8858 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8859 {
8860 uint64 value2 = op2->__anon1.ui64;
8861
8862 exp->type = 2;
8863 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8864 if(!exp->expType)
8865 {
8866 exp->expType = op1->type;
8867 if(op1->type)
8868 op1->type->refCount++;
8869 }
8870 return 1;
8871 }
8872
8873 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8874 {
8875 short value2 = op2->__anon1.s;
8876
8877 exp->type = 2;
8878 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8879 if(!exp->expType)
8880 {
8881 exp->expType = op1->type;
8882 if(op1->type)
8883 op1->type->refCount++;
8884 }
8885 return 1;
8886 }
8887
8888 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8889 {
8890 unsigned short value2 = op2->__anon1.us;
8891
8892 exp->type = 2;
8893 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8894 if(!exp->expType)
8895 {
8896 exp->expType = op1->type;
8897 if(op1->type)
8898 op1->type->refCount++;
8899 }
8900 return 1;
8901 }
8902
8903 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8904 {
8905 char value2 = op2->__anon1.c;
8906
8907 exp->type = 2;
8908 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8909 if(!exp->expType)
8910 {
8911 exp->expType = op1->type;
8912 if(op1->type)
8913 op1->type->refCount++;
8914 }
8915 return 1;
8916 }
8917
8918 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8919 {
8920 unsigned char value2 = op2->__anon1.uc;
8921
8922 exp->type = 2;
8923 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8924 if(!exp->expType)
8925 {
8926 exp->expType = op1->type;
8927 if(op1->type)
8928 op1->type->refCount++;
8929 }
8930 return 1;
8931 }
8932
8933 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8934 {
8935 int value2 = op2->__anon1.i;
8936
8937 exp->type = 2;
8938 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8939 if(!exp->expType)
8940 {
8941 exp->expType = op1->type;
8942 if(op1->type)
8943 op1->type->refCount++;
8944 }
8945 return 1;
8946 }
8947
8948 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8949 {
8950 unsigned int value2 = op2->__anon1.ui;
8951
8952 exp->type = 2;
8953 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8954 if(!exp->expType)
8955 {
8956 exp->expType = op1->type;
8957 if(op1->type)
8958 op1->type->refCount++;
8959 }
8960 return 1;
8961 }
8962
8963 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8964 {
8965 long long value2 = op2->__anon1.i64;
8966
8967 exp->type = 2;
8968 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8969 if(!exp->expType)
8970 {
8971 exp->expType = op1->type;
8972 if(op1->type)
8973 op1->type->refCount++;
8974 }
8975 return 1;
8976 }
8977
8978 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8979 {
8980 uint64 value2 = op2->__anon1.ui64;
8981
8982 exp->type = 2;
8983 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8984 if(!exp->expType)
8985 {
8986 exp->expType = op1->type;
8987 if(op1->type)
8988 op1->type->refCount++;
8989 }
8990 return 1;
8991 }
8992
8993 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8994 {
8995 short value2 = op2->__anon1.s;
8996
8997 exp->type = 2;
8998 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8999 if(!exp->expType)
9000 {
9001 exp->expType = op1->type;
9002 if(op1->type)
9003 op1->type->refCount++;
9004 }
9005 return 1;
9006 }
9007
9008 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9009 {
9010 unsigned short value2 = op2->__anon1.us;
9011
9012 exp->type = 2;
9013 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9014 if(!exp->expType)
9015 {
9016 exp->expType = op1->type;
9017 if(op1->type)
9018 op1->type->refCount++;
9019 }
9020 return 1;
9021 }
9022
9023 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9024 {
9025 char value2 = op2->__anon1.c;
9026
9027 exp->type = 2;
9028 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9029 if(!exp->expType)
9030 {
9031 exp->expType = op1->type;
9032 if(op1->type)
9033 op1->type->refCount++;
9034 }
9035 return 1;
9036 }
9037
9038 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9039 {
9040 unsigned char value2 = op2->__anon1.uc;
9041
9042 exp->type = 2;
9043 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9044 if(!exp->expType)
9045 {
9046 exp->expType = op1->type;
9047 if(op1->type)
9048 op1->type->refCount++;
9049 }
9050 return 1;
9051 }
9052
9053 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9054 {
9055 int value2 = op2->__anon1.i;
9056
9057 exp->type = 2;
9058 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9059 if(!exp->expType)
9060 {
9061 exp->expType = op1->type;
9062 if(op1->type)
9063 op1->type->refCount++;
9064 }
9065 return 1;
9066 }
9067
9068 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9069 {
9070 unsigned int value2 = op2->__anon1.ui;
9071
9072 exp->type = 2;
9073 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9074 if(!exp->expType)
9075 {
9076 exp->expType = op1->type;
9077 if(op1->type)
9078 op1->type->refCount++;
9079 }
9080 return 1;
9081 }
9082
9083 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9084 {
9085 long long value2 = op2->__anon1.i64;
9086
9087 exp->type = 2;
9088 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9089 if(!exp->expType)
9090 {
9091 exp->expType = op1->type;
9092 if(op1->type)
9093 op1->type->refCount++;
9094 }
9095 return 1;
9096 }
9097
9098 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9099 {
9100 uint64 value2 = op2->__anon1.ui64;
9101
9102 exp->type = 2;
9103 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9104 if(!exp->expType)
9105 {
9106 exp->expType = op1->type;
9107 if(op1->type)
9108 op1->type->refCount++;
9109 }
9110 return 1;
9111 }
9112
9113 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9114 {
9115 short value2 = op2->__anon1.s;
9116
9117 exp->type = 2;
9118 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9119 if(!exp->expType)
9120 {
9121 exp->expType = op1->type;
9122 if(op1->type)
9123 op1->type->refCount++;
9124 }
9125 return 1;
9126 }
9127
9128 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9129 {
9130 unsigned short value2 = op2->__anon1.us;
9131
9132 exp->type = 2;
9133 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9134 if(!exp->expType)
9135 {
9136 exp->expType = op1->type;
9137 if(op1->type)
9138 op1->type->refCount++;
9139 }
9140 return 1;
9141 }
9142
9143 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9144 {
9145 char value2 = op2->__anon1.c;
9146
9147 exp->type = 2;
9148 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9149 if(!exp->expType)
9150 {
9151 exp->expType = op1->type;
9152 if(op1->type)
9153 op1->type->refCount++;
9154 }
9155 return 1;
9156 }
9157
9158 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9159 {
9160 unsigned char value2 = op2->__anon1.uc;
9161
9162 exp->type = 2;
9163 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9164 if(!exp->expType)
9165 {
9166 exp->expType = op1->type;
9167 if(op1->type)
9168 op1->type->refCount++;
9169 }
9170 return 1;
9171 }
9172
9173 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9174 {
9175 int value2 = op2->__anon1.i;
9176
9177 exp->type = 2;
9178 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9179 if(!exp->expType)
9180 {
9181 exp->expType = op1->type;
9182 if(op1->type)
9183 op1->type->refCount++;
9184 }
9185 return 1;
9186 }
9187
9188 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9189 {
9190 unsigned int value2 = op2->__anon1.ui;
9191
9192 exp->type = 2;
9193 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9194 if(!exp->expType)
9195 {
9196 exp->expType = op1->type;
9197 if(op1->type)
9198 op1->type->refCount++;
9199 }
9200 return 1;
9201 }
9202
9203 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9204 {
9205 long long value2 = op2->__anon1.i64;
9206
9207 exp->type = 2;
9208 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9209 if(!exp->expType)
9210 {
9211 exp->expType = op1->type;
9212 if(op1->type)
9213 op1->type->refCount++;
9214 }
9215 return 1;
9216 }
9217
9218 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9219 {
9220 uint64 value2 = op2->__anon1.ui64;
9221
9222 exp->type = 2;
9223 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9224 if(!exp->expType)
9225 {
9226 exp->expType = op1->type;
9227 if(op1->type)
9228 op1->type->refCount++;
9229 }
9230 return 1;
9231 }
9232
9233 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9234 {
9235 short value2 = op2->__anon1.s;
9236
9237 exp->type = 2;
9238 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9239 if(!exp->expType)
9240 {
9241 exp->expType = op1->type;
9242 if(op1->type)
9243 op1->type->refCount++;
9244 }
9245 return 1;
9246 }
9247
9248 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9249 {
9250 unsigned short value2 = op2->__anon1.us;
9251
9252 exp->type = 2;
9253 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9254 if(!exp->expType)
9255 {
9256 exp->expType = op1->type;
9257 if(op1->type)
9258 op1->type->refCount++;
9259 }
9260 return 1;
9261 }
9262
9263 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9264 {
9265 char value2 = op2->__anon1.c;
9266
9267 exp->type = 2;
9268 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9269 if(!exp->expType)
9270 {
9271 exp->expType = op1->type;
9272 if(op1->type)
9273 op1->type->refCount++;
9274 }
9275 return 1;
9276 }
9277
9278 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9279 {
9280 unsigned char value2 = op2->__anon1.uc;
9281
9282 exp->type = 2;
9283 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9284 if(!exp->expType)
9285 {
9286 exp->expType = op1->type;
9287 if(op1->type)
9288 op1->type->refCount++;
9289 }
9290 return 1;
9291 }
9292
9293 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9294 {
9295 exp->type = 2;
9296 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9297 if(!exp->expType)
9298 {
9299 exp->expType = op1->type;
9300 if(op1->type)
9301 op1->type->refCount++;
9302 }
9303 return 1;
9304 }
9305
9306 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9307 {
9308 exp->type = 2;
9309 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9310 if(!exp->expType)
9311 {
9312 exp->expType = op1->type;
9313 if(op1->type)
9314 op1->type->refCount++;
9315 }
9316 return 1;
9317 }
9318
9319 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9320 {
9321 exp->type = 2;
9322 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9323 if(!exp->expType)
9324 {
9325 exp->expType = op1->type;
9326 if(op1->type)
9327 op1->type->refCount++;
9328 }
9329 return 1;
9330 }
9331
9332 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9333 {
9334 exp->type = 2;
9335 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9336 if(!exp->expType)
9337 {
9338 exp->expType = op1->type;
9339 if(op1->type)
9340 op1->type->refCount++;
9341 }
9342 return 1;
9343 }
9344
9345 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9346 {
9347 exp->type = 2;
9348 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9349 if(!exp->expType)
9350 {
9351 exp->expType = op1->type;
9352 if(op1->type)
9353 op1->type->refCount++;
9354 }
9355 return 1;
9356 }
9357
9358 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9359 {
9360 exp->type = 2;
9361 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9362 if(!exp->expType)
9363 {
9364 exp->expType = op1->type;
9365 if(op1->type)
9366 op1->type->refCount++;
9367 }
9368 return 1;
9369 }
9370
9371 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9372 {
9373 exp->type = 2;
9374 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9375 if(!exp->expType)
9376 {
9377 exp->expType = op1->type;
9378 if(op1->type)
9379 op1->type->refCount++;
9380 }
9381 return 1;
9382 }
9383
9384 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9385 {
9386 exp->type = 2;
9387 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9388 if(!exp->expType)
9389 {
9390 exp->expType = op1->type;
9391 if(op1->type)
9392 op1->type->refCount++;
9393 }
9394 return 1;
9395 }
9396
9397 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9398 {
9399 int value2 = op2->__anon1.i;
9400
9401 exp->type = 2;
9402 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9403 if(!exp->expType)
9404 {
9405 exp->expType = op1->type;
9406 if(op1->type)
9407 op1->type->refCount++;
9408 }
9409 return 1;
9410 }
9411
9412 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9413 {
9414 unsigned int value2 = op2->__anon1.ui;
9415
9416 exp->type = 2;
9417 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9418 if(!exp->expType)
9419 {
9420 exp->expType = op1->type;
9421 if(op1->type)
9422 op1->type->refCount++;
9423 }
9424 return 1;
9425 }
9426
9427 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9428 {
9429 long long value2 = op2->__anon1.i64;
9430
9431 exp->type = 2;
9432 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9433 if(!exp->expType)
9434 {
9435 exp->expType = op1->type;
9436 if(op1->type)
9437 op1->type->refCount++;
9438 }
9439 return 1;
9440 }
9441
9442 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9443 {
9444 uint64 value2 = op2->__anon1.ui64;
9445
9446 exp->type = 2;
9447 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9448 if(!exp->expType)
9449 {
9450 exp->expType = op1->type;
9451 if(op1->type)
9452 op1->type->refCount++;
9453 }
9454 return 1;
9455 }
9456
9457 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9458 {
9459 short value2 = op2->__anon1.s;
9460
9461 exp->type = 2;
9462 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9463 if(!exp->expType)
9464 {
9465 exp->expType = op1->type;
9466 if(op1->type)
9467 op1->type->refCount++;
9468 }
9469 return 1;
9470 }
9471
9472 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9473 {
9474 unsigned short value2 = op2->__anon1.us;
9475
9476 exp->type = 2;
9477 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9478 if(!exp->expType)
9479 {
9480 exp->expType = op1->type;
9481 if(op1->type)
9482 op1->type->refCount++;
9483 }
9484 return 1;
9485 }
9486
9487 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9488 {
9489 char value2 = op2->__anon1.c;
9490
9491 exp->type = 2;
9492 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9493 if(!exp->expType)
9494 {
9495 exp->expType = op1->type;
9496 if(op1->type)
9497 op1->type->refCount++;
9498 }
9499 return 1;
9500 }
9501
9502 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9503 {
9504 unsigned char value2 = op2->__anon1.uc;
9505
9506 exp->type = 2;
9507 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9508 if(!exp->expType)
9509 {
9510 exp->expType = op1->type;
9511 if(op1->type)
9512 op1->type->refCount++;
9513 }
9514 return 1;
9515 }
9516
9517 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9518 {
9519 float value2 = op2->__anon1.f;
9520
9521 exp->type = 2;
9522 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9523 if(!exp->expType)
9524 {
9525 exp->expType = op1->type;
9526 if(op1->type)
9527 op1->type->refCount++;
9528 }
9529 return 1;
9530 }
9531
9532 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9533 {
9534 double value2 = op2->__anon1.d;
9535
9536 exp->type = 2;
9537 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9538 if(!exp->expType)
9539 {
9540 exp->expType = op1->type;
9541 if(op1->type)
9542 op1->type->refCount++;
9543 }
9544 return 1;
9545 }
9546
9547 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9548 {
9549 int value2 = op2->__anon1.i;
9550
9551 exp->type = 2;
9552 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9553 if(!exp->expType)
9554 {
9555 exp->expType = op1->type;
9556 if(op1->type)
9557 op1->type->refCount++;
9558 }
9559 return 1;
9560 }
9561
9562 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9563 {
9564 unsigned int value2 = op2->__anon1.ui;
9565
9566 exp->type = 2;
9567 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9568 if(!exp->expType)
9569 {
9570 exp->expType = op1->type;
9571 if(op1->type)
9572 op1->type->refCount++;
9573 }
9574 return 1;
9575 }
9576
9577 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9578 {
9579 long long value2 = op2->__anon1.i64;
9580
9581 exp->type = 2;
9582 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9583 if(!exp->expType)
9584 {
9585 exp->expType = op1->type;
9586 if(op1->type)
9587 op1->type->refCount++;
9588 }
9589 return 1;
9590 }
9591
9592 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9593 {
9594 uint64 value2 = op2->__anon1.ui64;
9595
9596 exp->type = 2;
9597 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9598 if(!exp->expType)
9599 {
9600 exp->expType = op1->type;
9601 if(op1->type)
9602 op1->type->refCount++;
9603 }
9604 return 1;
9605 }
9606
9607 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9608 {
9609 short value2 = op2->__anon1.s;
9610
9611 exp->type = 2;
9612 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9613 if(!exp->expType)
9614 {
9615 exp->expType = op1->type;
9616 if(op1->type)
9617 op1->type->refCount++;
9618 }
9619 return 1;
9620 }
9621
9622 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9623 {
9624 unsigned short value2 = op2->__anon1.us;
9625
9626 exp->type = 2;
9627 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9628 if(!exp->expType)
9629 {
9630 exp->expType = op1->type;
9631 if(op1->type)
9632 op1->type->refCount++;
9633 }
9634 return 1;
9635 }
9636
9637 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9638 {
9639 char value2 = op2->__anon1.c;
9640
9641 exp->type = 2;
9642 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9643 if(!exp->expType)
9644 {
9645 exp->expType = op1->type;
9646 if(op1->type)
9647 op1->type->refCount++;
9648 }
9649 return 1;
9650 }
9651
9652 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9653 {
9654 unsigned char value2 = op2->__anon1.uc;
9655
9656 exp->type = 2;
9657 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9658 if(!exp->expType)
9659 {
9660 exp->expType = op1->type;
9661 if(op1->type)
9662 op1->type->refCount++;
9663 }
9664 return 1;
9665 }
9666
9667 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9668 {
9669 float value2 = op2->__anon1.f;
9670
9671 exp->type = 2;
9672 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9673 if(!exp->expType)
9674 {
9675 exp->expType = op1->type;
9676 if(op1->type)
9677 op1->type->refCount++;
9678 }
9679 return 1;
9680 }
9681
9682 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9683 {
9684 double value2 = op2->__anon1.d;
9685
9686 exp->type = 2;
9687 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9688 if(!exp->expType)
9689 {
9690 exp->expType = op1->type;
9691 if(op1->type)
9692 op1->type->refCount++;
9693 }
9694 return 1;
9695 }
9696
9697 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9698 {
9699 int value2 = op2->__anon1.i;
9700
9701 exp->type = 2;
9702 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9703 if(!exp->expType)
9704 {
9705 exp->expType = op1->type;
9706 if(op1->type)
9707 op1->type->refCount++;
9708 }
9709 return 1;
9710 }
9711
9712 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9713 {
9714 unsigned int value2 = op2->__anon1.ui;
9715
9716 exp->type = 2;
9717 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9718 if(!exp->expType)
9719 {
9720 exp->expType = op1->type;
9721 if(op1->type)
9722 op1->type->refCount++;
9723 }
9724 return 1;
9725 }
9726
9727 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9728 {
9729 long long value2 = op2->__anon1.i64;
9730
9731 exp->type = 2;
9732 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9733 if(!exp->expType)
9734 {
9735 exp->expType = op1->type;
9736 if(op1->type)
9737 op1->type->refCount++;
9738 }
9739 return 1;
9740 }
9741
9742 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9743 {
9744 uint64 value2 = op2->__anon1.ui64;
9745
9746 exp->type = 2;
9747 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9748 if(!exp->expType)
9749 {
9750 exp->expType = op1->type;
9751 if(op1->type)
9752 op1->type->refCount++;
9753 }
9754 return 1;
9755 }
9756
9757 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9758 {
9759 short value2 = op2->__anon1.s;
9760
9761 exp->type = 2;
9762 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9763 if(!exp->expType)
9764 {
9765 exp->expType = op1->type;
9766 if(op1->type)
9767 op1->type->refCount++;
9768 }
9769 return 1;
9770 }
9771
9772 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9773 {
9774 unsigned short value2 = op2->__anon1.us;
9775
9776 exp->type = 2;
9777 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9778 if(!exp->expType)
9779 {
9780 exp->expType = op1->type;
9781 if(op1->type)
9782 op1->type->refCount++;
9783 }
9784 return 1;
9785 }
9786
9787 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9788 {
9789 char value2 = op2->__anon1.c;
9790
9791 exp->type = 2;
9792 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9793 if(!exp->expType)
9794 {
9795 exp->expType = op1->type;
9796 if(op1->type)
9797 op1->type->refCount++;
9798 }
9799 return 1;
9800 }
9801
9802 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9803 {
9804 unsigned char value2 = op2->__anon1.uc;
9805
9806 exp->type = 2;
9807 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9808 if(!exp->expType)
9809 {
9810 exp->expType = op1->type;
9811 if(op1->type)
9812 op1->type->refCount++;
9813 }
9814 return 1;
9815 }
9816
9817 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9818 {
9819 float value2 = op2->__anon1.f;
9820
9821 exp->type = 2;
9822 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9823 if(!exp->expType)
9824 {
9825 exp->expType = op1->type;
9826 if(op1->type)
9827 op1->type->refCount++;
9828 }
9829 return 1;
9830 }
9831
9832 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9833 {
9834 double value2 = op2->__anon1.d;
9835
9836 exp->type = 2;
9837 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9838 if(!exp->expType)
9839 {
9840 exp->expType = op1->type;
9841 if(op1->type)
9842 op1->type->refCount++;
9843 }
9844 return 1;
9845 }
9846
9847 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9848 {
9849 int value2 = op2->__anon1.i;
9850
9851 exp->type = 2;
9852 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9853 if(!exp->expType)
9854 {
9855 exp->expType = op1->type;
9856 if(op1->type)
9857 op1->type->refCount++;
9858 }
9859 return 1;
9860 }
9861
9862 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9863 {
9864 unsigned int value2 = op2->__anon1.ui;
9865
9866 exp->type = 2;
9867 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9868 if(!exp->expType)
9869 {
9870 exp->expType = op1->type;
9871 if(op1->type)
9872 op1->type->refCount++;
9873 }
9874 return 1;
9875 }
9876
9877 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9878 {
9879 long long value2 = op2->__anon1.i64;
9880
9881 exp->type = 2;
9882 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9883 if(!exp->expType)
9884 {
9885 exp->expType = op1->type;
9886 if(op1->type)
9887 op1->type->refCount++;
9888 }
9889 return 1;
9890 }
9891
9892 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9893 {
9894 uint64 value2 = op2->__anon1.ui64;
9895
9896 exp->type = 2;
9897 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9898 if(!exp->expType)
9899 {
9900 exp->expType = op1->type;
9901 if(op1->type)
9902 op1->type->refCount++;
9903 }
9904 return 1;
9905 }
9906
9907 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9908 {
9909 short value2 = op2->__anon1.s;
9910
9911 exp->type = 2;
9912 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9913 if(!exp->expType)
9914 {
9915 exp->expType = op1->type;
9916 if(op1->type)
9917 op1->type->refCount++;
9918 }
9919 return 1;
9920 }
9921
9922 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9923 {
9924 unsigned short value2 = op2->__anon1.us;
9925
9926 exp->type = 2;
9927 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9928 if(!exp->expType)
9929 {
9930 exp->expType = op1->type;
9931 if(op1->type)
9932 op1->type->refCount++;
9933 }
9934 return 1;
9935 }
9936
9937 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9938 {
9939 char value2 = op2->__anon1.c;
9940
9941 exp->type = 2;
9942 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9943 if(!exp->expType)
9944 {
9945 exp->expType = op1->type;
9946 if(op1->type)
9947 op1->type->refCount++;
9948 }
9949 return 1;
9950 }
9951
9952 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9953 {
9954 unsigned char value2 = op2->__anon1.uc;
9955
9956 exp->type = 2;
9957 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9958 if(!exp->expType)
9959 {
9960 exp->expType = op1->type;
9961 if(op1->type)
9962 op1->type->refCount++;
9963 }
9964 return 1;
9965 }
9966
9967 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9968 {
9969 float value2 = op2->__anon1.f;
9970
9971 exp->type = 2;
9972 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9973 if(!exp->expType)
9974 {
9975 exp->expType = op1->type;
9976 if(op1->type)
9977 op1->type->refCount++;
9978 }
9979 return 1;
9980 }
9981
9982 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9983 {
9984 double value2 = op2->__anon1.d;
9985
9986 exp->type = 2;
9987 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9988 if(!exp->expType)
9989 {
9990 exp->expType = op1->type;
9991 if(op1->type)
9992 op1->type->refCount++;
9993 }
9994 return 1;
9995 }
9996
9997 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9998 {
9999 int value2 = op2->__anon1.i;
10000
10001 exp->type = 2;
10002 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10003 if(!exp->expType)
10004 {
10005 exp->expType = op1->type;
10006 if(op1->type)
10007 op1->type->refCount++;
10008 }
10009 return 1;
10010 }
10011
10012 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10013 {
10014 unsigned int value2 = op2->__anon1.ui;
10015
10016 exp->type = 2;
10017 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10018 if(!exp->expType)
10019 {
10020 exp->expType = op1->type;
10021 if(op1->type)
10022 op1->type->refCount++;
10023 }
10024 return 1;
10025 }
10026
10027 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10028 {
10029 long long value2 = op2->__anon1.i64;
10030
10031 exp->type = 2;
10032 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10033 if(!exp->expType)
10034 {
10035 exp->expType = op1->type;
10036 if(op1->type)
10037 op1->type->refCount++;
10038 }
10039 return 1;
10040 }
10041
10042 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10043 {
10044 uint64 value2 = op2->__anon1.ui64;
10045
10046 exp->type = 2;
10047 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10048 if(!exp->expType)
10049 {
10050 exp->expType = op1->type;
10051 if(op1->type)
10052 op1->type->refCount++;
10053 }
10054 return 1;
10055 }
10056
10057 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10058 {
10059 short value2 = op2->__anon1.s;
10060
10061 exp->type = 2;
10062 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10063 if(!exp->expType)
10064 {
10065 exp->expType = op1->type;
10066 if(op1->type)
10067 op1->type->refCount++;
10068 }
10069 return 1;
10070 }
10071
10072 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10073 {
10074 unsigned short value2 = op2->__anon1.us;
10075
10076 exp->type = 2;
10077 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10078 if(!exp->expType)
10079 {
10080 exp->expType = op1->type;
10081 if(op1->type)
10082 op1->type->refCount++;
10083 }
10084 return 1;
10085 }
10086
10087 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10088 {
10089 char value2 = op2->__anon1.c;
10090
10091 exp->type = 2;
10092 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10093 if(!exp->expType)
10094 {
10095 exp->expType = op1->type;
10096 if(op1->type)
10097 op1->type->refCount++;
10098 }
10099 return 1;
10100 }
10101
10102 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10103 {
10104 unsigned char value2 = op2->__anon1.uc;
10105
10106 exp->type = 2;
10107 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10108 if(!exp->expType)
10109 {
10110 exp->expType = op1->type;
10111 if(op1->type)
10112 op1->type->refCount++;
10113 }
10114 return 1;
10115 }
10116
10117 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10118 {
10119 float value2 = op2->__anon1.f;
10120
10121 exp->type = 2;
10122 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10123 if(!exp->expType)
10124 {
10125 exp->expType = op1->type;
10126 if(op1->type)
10127 op1->type->refCount++;
10128 }
10129 return 1;
10130 }
10131
10132 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10133 {
10134 double value2 = op2->__anon1.d;
10135
10136 exp->type = 2;
10137 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10138 if(!exp->expType)
10139 {
10140 exp->expType = op1->type;
10141 if(op1->type)
10142 op1->type->refCount++;
10143 }
10144 return 1;
10145 }
10146
10147 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10148 {
10149 int value2 = op2->__anon1.i;
10150
10151 exp->type = 2;
10152 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10153 if(!exp->expType)
10154 {
10155 exp->expType = op1->type;
10156 if(op1->type)
10157 op1->type->refCount++;
10158 }
10159 return 1;
10160 }
10161
10162 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10163 {
10164 unsigned int value2 = op2->__anon1.ui;
10165
10166 exp->type = 2;
10167 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10168 if(!exp->expType)
10169 {
10170 exp->expType = op1->type;
10171 if(op1->type)
10172 op1->type->refCount++;
10173 }
10174 return 1;
10175 }
10176
10177 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10178 {
10179 long long value2 = op2->__anon1.i64;
10180
10181 exp->type = 2;
10182 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10183 if(!exp->expType)
10184 {
10185 exp->expType = op1->type;
10186 if(op1->type)
10187 op1->type->refCount++;
10188 }
10189 return 1;
10190 }
10191
10192 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10193 {
10194 uint64 value2 = op2->__anon1.ui64;
10195
10196 exp->type = 2;
10197 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10198 if(!exp->expType)
10199 {
10200 exp->expType = op1->type;
10201 if(op1->type)
10202 op1->type->refCount++;
10203 }
10204 return 1;
10205 }
10206
10207 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10208 {
10209 short value2 = op2->__anon1.s;
10210
10211 exp->type = 2;
10212 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10213 if(!exp->expType)
10214 {
10215 exp->expType = op1->type;
10216 if(op1->type)
10217 op1->type->refCount++;
10218 }
10219 return 1;
10220 }
10221
10222 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10223 {
10224 unsigned short value2 = op2->__anon1.us;
10225
10226 exp->type = 2;
10227 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10228 if(!exp->expType)
10229 {
10230 exp->expType = op1->type;
10231 if(op1->type)
10232 op1->type->refCount++;
10233 }
10234 return 1;
10235 }
10236
10237 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10238 {
10239 char value2 = op2->__anon1.c;
10240
10241 exp->type = 2;
10242 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10243 if(!exp->expType)
10244 {
10245 exp->expType = op1->type;
10246 if(op1->type)
10247 op1->type->refCount++;
10248 }
10249 return 1;
10250 }
10251
10252 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10253 {
10254 unsigned char value2 = op2->__anon1.uc;
10255
10256 exp->type = 2;
10257 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10258 if(!exp->expType)
10259 {
10260 exp->expType = op1->type;
10261 if(op1->type)
10262 op1->type->refCount++;
10263 }
10264 return 1;
10265 }
10266
10267 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10268 {
10269 float value2 = op2->__anon1.f;
10270
10271 exp->type = 2;
10272 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10273 if(!exp->expType)
10274 {
10275 exp->expType = op1->type;
10276 if(op1->type)
10277 op1->type->refCount++;
10278 }
10279 return 1;
10280 }
10281
10282 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10283 {
10284 double value2 = op2->__anon1.d;
10285
10286 exp->type = 2;
10287 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10288 if(!exp->expType)
10289 {
10290 exp->expType = op1->type;
10291 if(op1->type)
10292 op1->type->refCount++;
10293 }
10294 return 1;
10295 }
10296
10297 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10298 {
10299 int value2 = op2->__anon1.i;
10300
10301 exp->type = 2;
10302 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10303 if(!exp->expType)
10304 {
10305 exp->expType = op1->type;
10306 if(op1->type)
10307 op1->type->refCount++;
10308 }
10309 return 1;
10310 }
10311
10312 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10313 {
10314 unsigned int value2 = op2->__anon1.ui;
10315
10316 exp->type = 2;
10317 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10318 if(!exp->expType)
10319 {
10320 exp->expType = op1->type;
10321 if(op1->type)
10322 op1->type->refCount++;
10323 }
10324 return 1;
10325 }
10326
10327 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10328 {
10329 long long value2 = op2->__anon1.i64;
10330
10331 exp->type = 2;
10332 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10333 if(!exp->expType)
10334 {
10335 exp->expType = op1->type;
10336 if(op1->type)
10337 op1->type->refCount++;
10338 }
10339 return 1;
10340 }
10341
10342 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10343 {
10344 uint64 value2 = op2->__anon1.ui64;
10345
10346 exp->type = 2;
10347 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10348 if(!exp->expType)
10349 {
10350 exp->expType = op1->type;
10351 if(op1->type)
10352 op1->type->refCount++;
10353 }
10354 return 1;
10355 }
10356
10357 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10358 {
10359 short value2 = op2->__anon1.s;
10360
10361 exp->type = 2;
10362 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10363 if(!exp->expType)
10364 {
10365 exp->expType = op1->type;
10366 if(op1->type)
10367 op1->type->refCount++;
10368 }
10369 return 1;
10370 }
10371
10372 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10373 {
10374 unsigned short value2 = op2->__anon1.us;
10375
10376 exp->type = 2;
10377 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10378 if(!exp->expType)
10379 {
10380 exp->expType = op1->type;
10381 if(op1->type)
10382 op1->type->refCount++;
10383 }
10384 return 1;
10385 }
10386
10387 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10388 {
10389 char value2 = op2->__anon1.c;
10390
10391 exp->type = 2;
10392 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10393 if(!exp->expType)
10394 {
10395 exp->expType = op1->type;
10396 if(op1->type)
10397 op1->type->refCount++;
10398 }
10399 return 1;
10400 }
10401
10402 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10403 {
10404 unsigned char value2 = op2->__anon1.uc;
10405
10406 exp->type = 2;
10407 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10408 if(!exp->expType)
10409 {
10410 exp->expType = op1->type;
10411 if(op1->type)
10412 op1->type->refCount++;
10413 }
10414 return 1;
10415 }
10416
10417 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10418 {
10419 float value2 = op2->__anon1.f;
10420
10421 exp->type = 2;
10422 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10423 if(!exp->expType)
10424 {
10425 exp->expType = op1->type;
10426 if(op1->type)
10427 op1->type->refCount++;
10428 }
10429 return 1;
10430 }
10431
10432 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10433 {
10434 double value2 = op2->__anon1.d;
10435
10436 exp->type = 2;
10437 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10438 if(!exp->expType)
10439 {
10440 exp->expType = op1->type;
10441 if(op1->type)
10442 op1->type->refCount++;
10443 }
10444 return 1;
10445 }
10446
10447 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10448 {
10449 int value2 = op2->__anon1.i;
10450
10451 exp->type = 2;
10452 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10453 if(!exp->expType)
10454 {
10455 exp->expType = op1->type;
10456 if(op1->type)
10457 op1->type->refCount++;
10458 }
10459 return 1;
10460 }
10461
10462 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10463 {
10464 unsigned int value2 = op2->__anon1.ui;
10465
10466 exp->type = 2;
10467 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10468 if(!exp->expType)
10469 {
10470 exp->expType = op1->type;
10471 if(op1->type)
10472 op1->type->refCount++;
10473 }
10474 return 1;
10475 }
10476
10477 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10478 {
10479 long long value2 = op2->__anon1.i64;
10480
10481 exp->type = 2;
10482 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10483 if(!exp->expType)
10484 {
10485 exp->expType = op1->type;
10486 if(op1->type)
10487 op1->type->refCount++;
10488 }
10489 return 1;
10490 }
10491
10492 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10493 {
10494 uint64 value2 = op2->__anon1.ui64;
10495
10496 exp->type = 2;
10497 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10498 if(!exp->expType)
10499 {
10500 exp->expType = op1->type;
10501 if(op1->type)
10502 op1->type->refCount++;
10503 }
10504 return 1;
10505 }
10506
10507 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10508 {
10509 short value2 = op2->__anon1.s;
10510
10511 exp->type = 2;
10512 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10513 if(!exp->expType)
10514 {
10515 exp->expType = op1->type;
10516 if(op1->type)
10517 op1->type->refCount++;
10518 }
10519 return 1;
10520 }
10521
10522 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10523 {
10524 unsigned short value2 = op2->__anon1.us;
10525
10526 exp->type = 2;
10527 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10528 if(!exp->expType)
10529 {
10530 exp->expType = op1->type;
10531 if(op1->type)
10532 op1->type->refCount++;
10533 }
10534 return 1;
10535 }
10536
10537 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10538 {
10539 char value2 = op2->__anon1.c;
10540
10541 exp->type = 2;
10542 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10543 if(!exp->expType)
10544 {
10545 exp->expType = op1->type;
10546 if(op1->type)
10547 op1->type->refCount++;
10548 }
10549 return 1;
10550 }
10551
10552 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10553 {
10554 unsigned char value2 = op2->__anon1.uc;
10555
10556 exp->type = 2;
10557 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10558 if(!exp->expType)
10559 {
10560 exp->expType = op1->type;
10561 if(op1->type)
10562 op1->type->refCount++;
10563 }
10564 return 1;
10565 }
10566
10567 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10568 {
10569 float value2 = op2->__anon1.f;
10570
10571 exp->type = 2;
10572 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10573 if(!exp->expType)
10574 {
10575 exp->expType = op1->type;
10576 if(op1->type)
10577 op1->type->refCount++;
10578 }
10579 return 1;
10580 }
10581
10582 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10583 {
10584 double value2 = op2->__anon1.d;
10585
10586 exp->type = 2;
10587 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10588 if(!exp->expType)
10589 {
10590 exp->expType = op1->type;
10591 if(op1->type)
10592 op1->type->refCount++;
10593 }
10594 return 1;
10595 }
10596
10597 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10598 {
10599 exp->type = 2;
10600 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10601 if(!exp->expType)
10602 {
10603 exp->expType = op1->type;
10604 if(op1->type)
10605 op1->type->refCount++;
10606 }
10607 return 1;
10608 }
10609
10610 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10611 {
10612 exp->type = 2;
10613 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10614 if(!exp->expType)
10615 {
10616 exp->expType = op1->type;
10617 if(op1->type)
10618 op1->type->refCount++;
10619 }
10620 return 1;
10621 }
10622
10623 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10624 {
10625 exp->type = 2;
10626 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10627 if(!exp->expType)
10628 {
10629 exp->expType = op1->type;
10630 if(op1->type)
10631 op1->type->refCount++;
10632 }
10633 return 1;
10634 }
10635
10636 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10637 {
10638 exp->type = 2;
10639 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10640 if(!exp->expType)
10641 {
10642 exp->expType = op1->type;
10643 if(op1->type)
10644 op1->type->refCount++;
10645 }
10646 return 1;
10647 }
10648
10649 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10650 {
10651 exp->type = 2;
10652 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10653 if(!exp->expType)
10654 {
10655 exp->expType = op1->type;
10656 if(op1->type)
10657 op1->type->refCount++;
10658 }
10659 return 1;
10660 }
10661
10662 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10663 {
10664 exp->type = 2;
10665 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10666 if(!exp->expType)
10667 {
10668 exp->expType = op1->type;
10669 if(op1->type)
10670 op1->type->refCount++;
10671 }
10672 return 1;
10673 }
10674
10675 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10676 {
10677 exp->type = 2;
10678 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10679 if(!exp->expType)
10680 {
10681 exp->expType = op1->type;
10682 if(op1->type)
10683 op1->type->refCount++;
10684 }
10685 return 1;
10686 }
10687
10688 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10689 {
10690 exp->type = 2;
10691 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10692 if(!exp->expType)
10693 {
10694 exp->expType = op1->type;
10695 if(op1->type)
10696 op1->type->refCount++;
10697 }
10698 return 1;
10699 }
10700
10701 struct OpTable intOps =
10702 {
10703 (void *)(IntAdd), (void *)(IntSub), (void *)(IntMul), (void *)(IntDiv), (void *)(IntMod), (void *)(IntNeg), (void *)(IntInc), (void *)(IntDec), (void *)(IntAsign), (void *)(IntAddAsign), (void *)(IntSubAsign), (void *)(IntMulAsign), (void *)(IntDivAsign), (void *)(IntModAsign), (void *)(IntBitAnd), (void *)(IntBitOr), (void *)(IntBitXor), (void *)(IntLShift), (void *)(IntRShift), (void *)(IntBitNot), (void *)(IntAndAsign), (void *)(IntOrAsign), (void *)(IntXorAsign), (void *)(IntLShiftAsign), (void *)(IntRShiftAsign), (void *)(IntNot), (void *)(IntEqu), (void *)(IntNqu), (void *)(IntAnd), (void *)(IntOr), (void *)(IntGrt), (void *)(IntSma), (void *)(IntGrtEqu), (void *)(IntSmaEqu), (void *)(IntCond)
10704 };
10705
10706 struct OpTable uintOps =
10707 {
10708 (void *)(UIntAdd), (void *)(UIntSub), (void *)(UIntMul), (void *)(UIntDiv), (void *)(UIntMod), (void *)(UIntNeg), (void *)(UIntInc), (void *)(UIntDec), (void *)(UIntAsign), (void *)(UIntAddAsign), (void *)(UIntSubAsign), (void *)(UIntMulAsign), (void *)(UIntDivAsign), (void *)(UIntModAsign), (void *)(UIntBitAnd), (void *)(UIntBitOr), (void *)(UIntBitXor), (void *)(UIntLShift), (void *)(UIntRShift), (void *)(UIntBitNot), (void *)(UIntAndAsign), (void *)(UIntOrAsign), (void *)(UIntXorAsign), (void *)(UIntLShiftAsign), (void *)(UIntRShiftAsign), (void *)(UIntNot), (void *)(UIntEqu), (void *)(UIntNqu), (void *)(UIntAnd), (void *)(UIntOr), (void *)(UIntGrt), (void *)(UIntSma), (void *)(UIntGrtEqu), (void *)(UIntSmaEqu), (void *)(UIntCond)
10709 };
10710
10711 struct OpTable int64Ops =
10712 {
10713 (void *)(Int64Add), (void *)(Int64Sub), (void *)(Int64Mul), (void *)(Int64Div), (void *)(Int64Mod), (void *)(Int64Neg), (void *)(Int64Inc), (void *)(Int64Dec), (void *)(Int64Asign), (void *)(Int64AddAsign), (void *)(Int64SubAsign), (void *)(Int64MulAsign), (void *)(Int64DivAsign), (void *)(Int64ModAsign), (void *)(Int64BitAnd), (void *)(Int64BitOr), (void *)(Int64BitXor), (void *)(Int64LShift), (void *)(Int64RShift), (void *)(Int64BitNot), (void *)(Int64AndAsign), (void *)(Int64OrAsign), (void *)(Int64XorAsign), (void *)(Int64LShiftAsign), (void *)(Int64RShiftAsign), (void *)(Int64Not), (void *)(Int64Equ), (void *)(Int64Nqu), (void *)(Int64And), (void *)(Int64Or), (void *)(Int64Grt), (void *)(Int64Sma), (void *)(Int64GrtEqu), (void *)(Int64SmaEqu), (void *)(Int64Cond)
10714 };
10715
10716 struct OpTable uint64Ops =
10717 {
10718 (void *)(UInt64Add), (void *)(UInt64Sub), (void *)(UInt64Mul), (void *)(UInt64Div), (void *)(UInt64Mod), (void *)(UInt64Neg), (void *)(UInt64Inc), (void *)(UInt64Dec), (void *)(UInt64Asign), (void *)(UInt64AddAsign), (void *)(UInt64SubAsign), (void *)(UInt64MulAsign), (void *)(UInt64DivAsign), (void *)(UInt64ModAsign), (void *)(UInt64BitAnd), (void *)(UInt64BitOr), (void *)(UInt64BitXor), (void *)(UInt64LShift), (void *)(UInt64RShift), (void *)(UInt64BitNot), (void *)(UInt64AndAsign), (void *)(UInt64OrAsign), (void *)(UInt64XorAsign), (void *)(UInt64LShiftAsign), (void *)(UInt64RShiftAsign), (void *)(UInt64Not), (void *)(UInt64Equ), (void *)(UInt64Nqu), (void *)(UInt64And), (void *)(UInt64Or), (void *)(UInt64Grt), (void *)(UInt64Sma), (void *)(UInt64GrtEqu), (void *)(UInt64SmaEqu), (void *)(UInt64Cond)
10719 };
10720
10721 struct OpTable shortOps =
10722 {
10723 (void *)(ShortAdd), (void *)(ShortSub), (void *)(ShortMul), (void *)(ShortDiv), (void *)(ShortMod), (void *)(ShortNeg), (void *)(ShortInc), (void *)(ShortDec), (void *)(ShortAsign), (void *)(ShortAddAsign), (void *)(ShortSubAsign), (void *)(ShortMulAsign), (void *)(ShortDivAsign), (void *)(ShortModAsign), (void *)(ShortBitAnd), (void *)(ShortBitOr), (void *)(ShortBitXor), (void *)(ShortLShift), (void *)(ShortRShift), (void *)(ShortBitNot), (void *)(ShortAndAsign), (void *)(ShortOrAsign), (void *)(ShortXorAsign), (void *)(ShortLShiftAsign), (void *)(ShortRShiftAsign), (void *)(ShortNot), (void *)(ShortEqu), (void *)(ShortNqu), (void *)(ShortAnd), (void *)(ShortOr), (void *)(ShortGrt), (void *)(ShortSma), (void *)(ShortGrtEqu), (void *)(ShortSmaEqu), (void *)(ShortCond)
10724 };
10725
10726 struct OpTable ushortOps =
10727 {
10728 (void *)(UShortAdd), (void *)(UShortSub), (void *)(UShortMul), (void *)(UShortDiv), (void *)(UShortMod), (void *)(UShortNeg), (void *)(UShortInc), (void *)(UShortDec), (void *)(UShortAsign), (void *)(UShortAddAsign), (void *)(UShortSubAsign), (void *)(UShortMulAsign), (void *)(UShortDivAsign), (void *)(UShortModAsign), (void *)(UShortBitAnd), (void *)(UShortBitOr), (void *)(UShortBitXor), (void *)(UShortLShift), (void *)(UShortRShift), (void *)(UShortBitNot), (void *)(UShortAndAsign), (void *)(UShortOrAsign), (void *)(UShortXorAsign), (void *)(UShortLShiftAsign), (void *)(UShortRShiftAsign), (void *)(UShortNot), (void *)(UShortEqu), (void *)(UShortNqu), (void *)(UShortAnd), (void *)(UShortOr), (void *)(UShortGrt), (void *)(UShortSma), (void *)(UShortGrtEqu), (void *)(UShortSmaEqu), (void *)(UShortCond)
10729 };
10730
10731 struct OpTable floatOps =
10732 {
10733 (void *)(FloatAdd), (void *)(FloatSub), (void *)(FloatMul), (void *)(FloatDiv), (((void *)0)), (void *)(FloatNeg), (void *)(FloatInc), (void *)(FloatDec), (void *)(FloatAsign), (void *)(FloatAddAsign), (void *)(FloatSubAsign), (void *)(FloatMulAsign), (void *)(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)), (void *)(FloatEqu), (void *)(FloatNqu), (void *)(FloatAnd), (void *)(FloatOr), (void *)(FloatGrt), (void *)(FloatSma), (void *)(FloatGrtEqu), (void *)(FloatSmaEqu)
10734 };
10735
10736 struct OpTable doubleOps =
10737 {
10738 (void *)(DoubleAdd), (void *)(DoubleSub), (void *)(DoubleMul), (void *)(DoubleDiv), (((void *)0)), (void *)(DoubleNeg), (void *)(DoubleInc), (void *)(DoubleDec), (void *)(DoubleAsign), (void *)(DoubleAddAsign), (void *)(DoubleSubAsign), (void *)(DoubleMulAsign), (void *)(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)), (void *)(DoubleEqu), (void *)(DoubleNqu), (void *)(DoubleAnd), (void *)(DoubleOr), (void *)(DoubleGrt), (void *)(DoubleSma), (void *)(DoubleGrtEqu), (void *)(DoubleSmaEqu)
10739 };
10740
10741 struct OpTable charOps =
10742 {
10743 (void *)(CharAdd), (void *)(CharSub), (void *)(CharMul), (void *)(CharDiv), (void *)(CharMod), (void *)(CharNeg), (void *)(CharInc), (void *)(CharDec), (void *)(CharAsign), (void *)(CharAddAsign), (void *)(CharSubAsign), (void *)(CharMulAsign), (void *)(CharDivAsign), (void *)(CharModAsign), (void *)(CharBitAnd), (void *)(CharBitOr), (void *)(CharBitXor), (void *)(CharLShift), (void *)(CharRShift), (void *)(CharBitNot), (void *)(CharAndAsign), (void *)(CharOrAsign), (void *)(CharXorAsign), (void *)(CharLShiftAsign), (void *)(CharRShiftAsign), (void *)(CharNot), (void *)(CharEqu), (void *)(CharNqu), (void *)(CharAnd), (void *)(CharOr), (void *)(CharGrt), (void *)(CharSma), (void *)(CharGrtEqu), (void *)(CharSmaEqu), (void *)(CharCond)
10744 };
10745
10746 struct OpTable ucharOps =
10747 {
10748 (void *)(UCharAdd), (void *)(UCharSub), (void *)(UCharMul), (void *)(UCharDiv), (void *)(UCharMod), (void *)(UCharNeg), (void *)(UCharInc), (void *)(UCharDec), (void *)(UCharAsign), (void *)(UCharAddAsign), (void *)(UCharSubAsign), (void *)(UCharMulAsign), (void *)(UCharDivAsign), (void *)(UCharModAsign), (void *)(UCharBitAnd), (void *)(UCharBitOr), (void *)(UCharBitXor), (void *)(UCharLShift), (void *)(UCharRShift), (void *)(UCharBitNot), (void *)(UCharAndAsign), (void *)(UCharOrAsign), (void *)(UCharXorAsign), (void *)(UCharLShiftAsign), (void *)(UCharRShiftAsign), (void *)(UCharNot), (void *)(UCharEqu), (void *)(UCharNqu), (void *)(UCharAnd), (void *)(UCharOr), (void *)(UCharGrt), (void *)(UCharSma), (void *)(UCharGrtEqu), (void *)(UCharSmaEqu), (void *)(UCharCond)
10749 };
10750
10751 void ReadString(char * output, char * string)
10752 {
10753 int len = strlen(string);
10754 int c, d = 0;
10755 unsigned int quoted = 0, escaped = 0;
10756
10757 for(c = 0; c < len; c++)
10758 {
10759 char ch = string[c];
10760
10761 if(escaped)
10762 {
10763 switch(ch)
10764 {
10765 case 'n':
10766 output[d] = '\n';
10767 break;
10768 case 't':
10769 output[d] = '\t';
10770 break;
10771 case 'a':
10772 output[d] = '\a';
10773 break;
10774 case 'b':
10775 output[d] = '\b';
10776 break;
10777 case 'f':
10778 output[d] = '\f';
10779 break;
10780 case 'r':
10781 output[d] = '\r';
10782 break;
10783 case 'v':
10784 output[d] = '\v';
10785 break;
10786 case '\\':
10787 output[d] = '\\';
10788 break;
10789 case '\"':
10790 output[d] = '\"';
10791 break;
10792 case '\'':
10793 output[d] = '\'';
10794 break;
10795 default:
10796 output[d] = ch;
10797 }
10798 d++;
10799 escaped = 0;
10800 }
10801 else
10802 {
10803 if(ch == '\"')
10804 quoted ^= 1;
10805 else if(quoted)
10806 {
10807 if(ch == '\\')
10808 escaped = 1;
10809 else
10810 output[d++] = ch;
10811 }
10812 }
10813 }
10814 output[d] = '\0';
10815 }
10816
10817 int UnescapeString(char * d, char * s, int len)
10818 {
10819 int j = 0, k = 0;
10820 char ch;
10821
10822 while(j < len && (ch = s[j]))
10823 {
10824 switch(ch)
10825 {
10826 case '\\':
10827 switch((ch = s[++j]))
10828 {
10829 case 'n':
10830 d[k] = '\n';
10831 break;
10832 case 't':
10833 d[k] = '\t';
10834 break;
10835 case 'a':
10836 d[k] = '\a';
10837 break;
10838 case 'b':
10839 d[k] = '\b';
10840 break;
10841 case 'f':
10842 d[k] = '\f';
10843 break;
10844 case 'r':
10845 d[k] = '\r';
10846 break;
10847 case 'v':
10848 d[k] = '\v';
10849 break;
10850 case '\\':
10851 d[k] = '\\';
10852 break;
10853 case '\"':
10854 d[k] = '\"';
10855 break;
10856 case '\'':
10857 d[k] = '\'';
10858 break;
10859 default:
10860 d[k] = '\\';
10861 d[k] = ch;
10862 }
10863 break;
10864 default:
10865 d[k] = ch;
10866 }
10867 j++, k++;
10868 }
10869 d[k] = '\0';
10870 return k;
10871 }
10872
10873 char * OffsetEscapedString(char * s, int len, int offset)
10874 {
10875 char ch;
10876 int j = 0, k = 0;
10877
10878 while(j < len && k < offset && (ch = s[j]))
10879 {
10880 if(ch == '\\')
10881 ++j;
10882 j++, k++;
10883 }
10884 return (k == offset) ? s + j : (((void *)0));
10885 }
10886
10887 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10888
10889 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10890
10891 extern double strtod(const char * , char * * );
10892
10893 extern float (* __ecereMethod_float_inf)(void);
10894
10895 extern float (* __ecereMethod_float_nan)(void);
10896
10897 extern double (* __ecereMethod_double_inf)(void);
10898
10899 extern double (* __ecereMethod_double_nan)(void);
10900
10901 struct Operand GetOperand(struct Expression * exp)
10902 {
10903 struct Operand op =
10904 {
10905 0, 0, 0,
10906 .__anon1 = {
10907 .c = 0
10908 },
10909 {
10910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10911 }
10912 };
10913 struct Type * type = exp->expType;
10914
10915 if(type)
10916 {
10917 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))
10918 {
10919 if(!type->__anon1._class->__anon1.registered->dataType)
10920 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10921 type = type->__anon1._class->__anon1.registered->dataType;
10922 }
10923 if(exp->type == 3 && op.kind == 13)
10924 {
10925 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10926 op.kind = 13;
10927 op.ops = uint64Ops;
10928 }
10929 else if(exp->isConstant && exp->type == 2)
10930 {
10931 op.kind = type->kind;
10932 op.type = type;
10933 switch(op.kind)
10934 {
10935 case 24:
10936 case 1:
10937 {
10938 if(exp->__anon1.__anon1.constant[0] == '\'')
10939 {
10940 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10941 op.ops = charOps;
10942 }
10943 else if(type->isSigned)
10944 {
10945 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10946 op.ops = charOps;
10947 }
10948 else
10949 {
10950 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10951 op.ops = ucharOps;
10952 }
10953 break;
10954 }
10955 case 2:
10956 if(type->isSigned)
10957 {
10958 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10959 op.ops = shortOps;
10960 }
10961 else
10962 {
10963 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10964 op.ops = ushortOps;
10965 }
10966 break;
10967 case 3:
10968 case 5:
10969 if(type->isSigned)
10970 {
10971 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10972 op.ops = intOps;
10973 }
10974 else
10975 {
10976 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10977 op.ops = uintOps;
10978 }
10979 op.kind = 3;
10980 break;
10981 case 4:
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 22:
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 23:
11008 if(type->isSigned)
11009 {
11010 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11011 op.ops = int64Ops;
11012 }
11013 else
11014 {
11015 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11016 op.ops = uint64Ops;
11017 }
11018 op.kind = 4;
11019 break;
11020 case 6:
11021 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11022 op.__anon1.f = __ecereMethod_float_inf();
11023 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11024 op.__anon1.f = -__ecereMethod_float_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11026 op.__anon1.f = __ecereMethod_float_nan();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11028 op.__anon1.f = -__ecereMethod_float_nan();
11029 else
11030 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11031 op.ops = floatOps;
11032 break;
11033 case 7:
11034 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11035 op.__anon1.d = __ecereMethod_double_inf();
11036 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11037 op.__anon1.d = -__ecereMethod_double_inf();
11038 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11039 op.__anon1.d = __ecereMethod_double_nan();
11040 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11041 op.__anon1.d = -__ecereMethod_double_nan();
11042 else
11043 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11044 op.ops = doubleOps;
11045 break;
11046 case 12:
11047 case 13:
11048 case 8:
11049 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11050 op.kind = 13;
11051 op.ops = uint64Ops;
11052 break;
11053 }
11054 }
11055 }
11056 return op;
11057 }
11058
11059 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11060 {
11061 long long v = 0;
11062
11063 switch(_class->typeSize)
11064 {
11065 case 8:
11066 if(!strcmp(_class->dataTypeString, "uint64"))
11067 v = (long long)*(uint64 *)ptr;
11068 else
11069 v = *(long long *)ptr;
11070 break;
11071 case 4:
11072 if(!strcmp(_class->dataTypeString, "uint"))
11073 v = (long long)*(unsigned int *)ptr;
11074 else
11075 v = (long long)*(int *)ptr;
11076 break;
11077 case 2:
11078 if(!strcmp(_class->dataTypeString, "uint16"))
11079 v = (long long)*(unsigned short *)ptr;
11080 else
11081 v = (long long)*(short *)ptr;
11082 break;
11083 case 1:
11084 if(!strcmp(_class->dataTypeString, "byte"))
11085 v = (long long)*(unsigned char *)ptr;
11086 else
11087 v = (long long)*(char *)ptr;
11088 break;
11089 }
11090 return v;
11091 }
11092
11093 int __ecereVMethodID_class_OnGetString;
11094
11095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11096
11097 static __attribute__((unused)) void UnusedFunction()
11098 {
11099 int a;
11100
11101 ((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);
11102 }
11103
11104 extern int __ecereVMethodID_class_OnGetString;
11105
11106 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11107 {
11108 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11109
11110 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11111 {
11112 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11113 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11114 else
11115 {
11116 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11117 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11118 struct Type * type;
11119 void * ptr = inst->data + dataMember->offset + offset;
11120 char * result = (((void *)0));
11121
11122 exp->loc = member->loc = inst->loc;
11123 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11124 if(!dataMember->dataType)
11125 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11126 type = dataMember->dataType;
11127 if(type->kind == 8)
11128 {
11129 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11130
11131 if(_class->type == 4)
11132 {
11133 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11134
11135 if(enumClass)
11136 {
11137 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11138 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11139
11140 for(item = e->values.first; item; item = item->next)
11141 {
11142 if(item->data == GetEnumValue(_class, ptr))
11143 {
11144 result = item->name;
11145 break;
11146 }
11147 }
11148 if(result)
11149 {
11150 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11151 exp->type = 0;
11152 exp->destType = MkClassType(_class->fullName);
11153 ProcessExpressionType(exp);
11154 }
11155 }
11156 }
11157 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11158 {
11159 if(!_class->dataType)
11160 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11161 type = _class->dataType;
11162 }
11163 }
11164 if(!result)
11165 {
11166 switch(type->kind)
11167 {
11168 case 6:
11169 {
11170 FreeExpContents(exp);
11171 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11172 exp->type = 2;
11173 break;
11174 }
11175 case 7:
11176 {
11177 FreeExpContents(exp);
11178 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11179 exp->type = 2;
11180 break;
11181 }
11182 case 3:
11183 {
11184 FreeExpContents(exp);
11185 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11186 exp->type = 2;
11187 break;
11188 }
11189 case 4:
11190 {
11191 FreeExpContents(exp);
11192 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11193 exp->type = 2;
11194 break;
11195 }
11196 case 22:
11197 {
11198 FreeExpContents(exp);
11199 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11200 exp->type = 2;
11201 break;
11202 }
11203 case 23:
11204 {
11205 FreeExpContents(exp);
11206 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11207 exp->type = 2;
11208 break;
11209 }
11210 default:
11211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11212 }
11213 }
11214 ListAdd(memberList, member);
11215 }
11216 if(parentDataMember->type == 1)
11217 break;
11218 }
11219 }
11220
11221 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11222
11223 void PopulateInstance(struct Instantiation * inst)
11224 {
11225 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11226 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11227 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11228 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11229
11230 if(!inst->members)
11231 inst->members = MkListOne(MkMembersInitList(memberList));
11232 else
11233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11234 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11235 {
11236 if(!dataMember->isProperty)
11237 {
11238 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11239 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11240 else
11241 {
11242 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11243 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11244 struct Type * type;
11245 void * ptr = inst->data + dataMember->offset;
11246 char * result = (((void *)0));
11247
11248 exp->loc = member->loc = inst->loc;
11249 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11250 if(!dataMember->dataType)
11251 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11252 type = dataMember->dataType;
11253 if(type->kind == 8)
11254 {
11255 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11256
11257 if(_class->type == 4)
11258 {
11259 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11260
11261 if(enumClass)
11262 {
11263 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11264 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11265
11266 for(item = e->values.first; item; item = item->next)
11267 {
11268 if(item->data == GetEnumValue(_class, ptr))
11269 {
11270 result = item->name;
11271 break;
11272 }
11273 }
11274 }
11275 if(result)
11276 {
11277 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11278 exp->type = 0;
11279 exp->destType = MkClassType(_class->fullName);
11280 ProcessExpressionType(exp);
11281 }
11282 }
11283 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11284 {
11285 if(!_class->dataType)
11286 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11287 type = _class->dataType;
11288 }
11289 }
11290 if(!result)
11291 {
11292 switch(type->kind)
11293 {
11294 case 6:
11295 {
11296 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11297 exp->type = 2;
11298 break;
11299 }
11300 case 7:
11301 {
11302 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11303 exp->type = 2;
11304 break;
11305 }
11306 case 3:
11307 {
11308 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11309 exp->type = 2;
11310 break;
11311 }
11312 case 4:
11313 {
11314 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11315 exp->type = 2;
11316 break;
11317 }
11318 case 22:
11319 {
11320 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11321 exp->type = 2;
11322 break;
11323 }
11324 default:
11325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11326 }
11327 }
11328 ListAdd(memberList, member);
11329 }
11330 }
11331 }
11332 }
11333
11334 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);
11335
11336 extern void FreeInstance(struct Instantiation * inst);
11337
11338 void ComputeInstantiation(struct Expression * exp)
11339 {
11340 struct Instantiation * inst = exp->__anon1.instance;
11341 struct MembersInit * members;
11342 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11343 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11344 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11345 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11346 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11347 int subMemberStackPos = 0;
11348 uint64 bits = 0;
11349
11350 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11351 {
11352 if(inst->data)
11353 return ;
11354 if(_class->type == 0 || _class->type == 5)
11355 {
11356 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11357 if(_class->type == 0)
11358 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11359 }
11360 else
11361 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11362 }
11363 if(inst->members)
11364 {
11365 for(members = (*inst->members).first; members; members = members->next)
11366 {
11367 switch(members->type)
11368 {
11369 case 0:
11370 {
11371 if(members->__anon1.dataMembers)
11372 {
11373 struct MemberInit * member;
11374
11375 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11376 {
11377 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11378 unsigned int found = 0;
11379 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11380 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11381 unsigned int dataMemberOffset;
11382
11383 if(!ident)
11384 {
11385 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11386 if(curMember)
11387 {
11388 if(curMember->isProperty)
11389 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11390 else
11391 {
11392 dataMember = curMember;
11393 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11394 if(_class->type == 0)
11395 dataMemberOffset += _class->base->structSize;
11396 }
11397 found = 1;
11398 }
11399 }
11400 else
11401 {
11402 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11403 if(prop)
11404 {
11405 found = 1;
11406 if(prop->memberAccess == 1)
11407 {
11408 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11409 curClass = prop->_class;
11410 }
11411 }
11412 else
11413 {
11414 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11415 int _subMemberStackPos = 0;
11416
11417 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11418 if(dataMember)
11419 {
11420 found = 1;
11421 if(dataMember->memberAccess == 1)
11422 {
11423 curMember = dataMember;
11424 curClass = dataMember->_class;
11425 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11426 subMemberStackPos = _subMemberStackPos;
11427 }
11428 }
11429 }
11430 }
11431 if(found && member->initializer && member->initializer->type == 0)
11432 {
11433 struct Expression * value = member->initializer->__anon1.exp;
11434 struct Type * type = (((void *)0));
11435 unsigned int deepMember = 0;
11436
11437 if(prop)
11438 {
11439 type = prop->dataType;
11440 }
11441 else if(dataMember)
11442 {
11443 if(!dataMember->dataType)
11444 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11445 type = dataMember->dataType;
11446 }
11447 if(ident && ident->next)
11448 {
11449 deepMember = 1;
11450 for(ident = ident->next; ident && type; ident = ident->next)
11451 {
11452 if(type->kind == 8)
11453 {
11454 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11455 if(prop)
11456 type = prop->dataType;
11457 else
11458 {
11459 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11460 if(dataMember)
11461 type = dataMember->dataType;
11462 }
11463 }
11464 else if(type->kind == 9 || type->kind == 10)
11465 {
11466 struct Type * memberType;
11467
11468 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11469 {
11470 if(!strcmp(memberType->name, ident->string))
11471 {
11472 type = memberType;
11473 break;
11474 }
11475 }
11476 }
11477 }
11478 }
11479 if(value)
11480 {
11481 FreeType(value->destType);
11482 value->destType = type;
11483 if(type)
11484 type->refCount++;
11485 ComputeExpression(value);
11486 }
11487 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11488 {
11489 if(type->kind == 8)
11490 {
11491 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11492
11493 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11494 {
11495 if(!_class->dataType)
11496 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11497 type = _class->dataType;
11498 }
11499 }
11500 if(dataMember)
11501 {
11502 void * ptr = inst->data + dataMemberOffset;
11503
11504 if(value->type == 2)
11505 {
11506 switch(type->kind)
11507 {
11508 case 3:
11509 {
11510 GetInt(value, (int *)ptr);
11511 break;
11512 }
11513 case 4:
11514 {
11515 GetInt64(value, (long long *)ptr);
11516 break;
11517 }
11518 case 22:
11519 {
11520 GetIntPtr(value, (intptr_t *)ptr);
11521 break;
11522 }
11523 case 23:
11524 {
11525 GetIntSize(value, (ssize_t *)ptr);
11526 break;
11527 }
11528 case 6:
11529 {
11530 GetFloat(value, (float *)ptr);
11531 break;
11532 }
11533 case 7:
11534 {
11535 GetDouble(value, (double *)ptr);
11536 break;
11537 }
11538 }
11539 }
11540 else if(value->type == 1)
11541 {
11542 if(type->kind == 8)
11543 {
11544 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11545
11546 if(_class->type == 1)
11547 {
11548 ComputeTypeSize(type);
11549 if(value->__anon1.instance->data)
11550 memcpy(ptr, value->__anon1.instance->data, type->size);
11551 }
11552 }
11553 }
11554 }
11555 else if(prop)
11556 {
11557 if(value->type == 1 && value->__anon1.instance->data)
11558 {
11559 if(type->kind == 8)
11560 {
11561 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11562
11563 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)))
11564 {
11565 void (* Set)(void *, void *) = (void *)prop->Set;
11566
11567 Set(inst->data, value->__anon1.instance->data);
11568 PopulateInstance(inst);
11569 }
11570 }
11571 }
11572 else if(value->type == 2)
11573 {
11574 switch(type->kind)
11575 {
11576 case 7:
11577 {
11578 void (* Set)(void *, double) = (void *)prop->Set;
11579
11580 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11581 break;
11582 }
11583 case 6:
11584 {
11585 void (* Set)(void *, float) = (void *)prop->Set;
11586
11587 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11588 break;
11589 }
11590 case 3:
11591 {
11592 void (* Set)(void *, int) = (void *)prop->Set;
11593
11594 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11595 break;
11596 }
11597 case 4:
11598 {
11599 void (* Set)(void *, long long) = (void *)prop->Set;
11600
11601 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11602 break;
11603 }
11604 case 22:
11605 {
11606 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11607
11608 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11609 break;
11610 }
11611 case 23:
11612 {
11613 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11614
11615 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11616 break;
11617 }
11618 }
11619 }
11620 else if(value->type == 3)
11621 {
11622 char temp[1024];
11623
11624 ReadString(temp, value->__anon1.__anon2.string);
11625 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11626 }
11627 }
11628 }
11629 else if(!deepMember && type && _class->type == 3)
11630 {
11631 if(prop)
11632 {
11633 if(value->type == 2)
11634 {
11635 if(type->kind == 8)
11636 {
11637 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11638
11639 if(_class->type == 3)
11640 {
11641 if(!_class->dataType)
11642 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11643 type = _class->dataType;
11644 }
11645 }
11646 switch(type->kind)
11647 {
11648 case 6:
11649 {
11650 float fValue;
11651 float (* Set)(float) = (void *)prop->Set;
11652
11653 GetFloat(member->initializer->__anon1.exp, &fValue);
11654 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11655 exp->type = 2;
11656 break;
11657 }
11658 case 7:
11659 {
11660 double dValue;
11661 double (* Set)(double) = (void *)prop->Set;
11662
11663 GetDouble(member->initializer->__anon1.exp, &dValue);
11664 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11665 exp->type = 2;
11666 break;
11667 }
11668 }
11669 }
11670 }
11671 }
11672 else if(!deepMember && type && _class->type == 2)
11673 {
11674 if(prop)
11675 {
11676 if(value->type == 1 && value->__anon1.instance->data)
11677 {
11678 unsigned int (* Set)(void *) = (void *)prop->Set;
11679
11680 bits = Set(value->__anon1.instance->data);
11681 }
11682 else if(value->type == 2)
11683 {
11684 }
11685 }
11686 else if(dataMember)
11687 {
11688 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11689 struct Type * type;
11690 uint64 part = 0;
11691
11692 bits = (bits & ~bitMember->mask);
11693 if(!bitMember->dataType)
11694 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11695 type = bitMember->dataType;
11696 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11697 {
11698 if(!type->__anon1._class->__anon1.registered->dataType)
11699 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11700 type = type->__anon1._class->__anon1.registered->dataType;
11701 }
11702 switch(type->kind)
11703 {
11704 case 24:
11705 case 1:
11706 {
11707 unsigned char v;
11708
11709 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11710 part = (uint64)v;
11711 break;
11712 }
11713 case 2:
11714 {
11715 unsigned short v;
11716
11717 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11718 part = (uint64)v;
11719 break;
11720 }
11721 case 3:
11722 case 5:
11723 {
11724 unsigned int v;
11725
11726 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11727 part = (uint64)v;
11728 break;
11729 }
11730 case 4:
11731 {
11732 uint64 v;
11733
11734 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11735 part = v;
11736 break;
11737 }
11738 case 22:
11739 {
11740 uintptr_t v;
11741
11742 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11743 part = (uint64)v;
11744 break;
11745 }
11746 case 23:
11747 {
11748 size_t v;
11749
11750 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11751 part = (uint64)v;
11752 break;
11753 }
11754 }
11755 bits |= part << bitMember->pos;
11756 }
11757 }
11758 }
11759 else
11760 {
11761 if(_class && _class->type == 3)
11762 {
11763 ComputeExpression(member->initializer->__anon1.exp);
11764 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11765 exp->type = 2;
11766 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11767 }
11768 }
11769 }
11770 }
11771 break;
11772 }
11773 }
11774 }
11775 }
11776 if(_class && _class->type == 2)
11777 {
11778 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11779 exp->type = 2;
11780 }
11781 if(exp->type != 1)
11782 {
11783 FreeInstance(inst);
11784 }
11785 }
11786
11787 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11788 {
11789 unsigned int result = 0;
11790
11791 switch(kind)
11792 {
11793 case 2:
11794 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11795 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11796 break;
11797 case 3:
11798 case 5:
11799 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11800 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11801 break;
11802 case 4:
11803 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11804 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11805 break;
11806 case 6:
11807 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)
11808 result = GetOpFloat(op, &op->__anon1.f);
11809 break;
11810 case 7:
11811 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)
11812 result = GetOpDouble(op, &op->__anon1.d);
11813 break;
11814 case 13:
11815 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)
11816 result = GetOpUInt64(op, &op->__anon1.ui64);
11817 break;
11818 case 15:
11819 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)
11820 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11821 break;
11822 case 22:
11823 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11824 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11825 break;
11826 case 23:
11827 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11828 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11829 break;
11830 }
11831 return result;
11832 }
11833
11834 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11835 {
11836 if(exp->__anon1.op.op == SIZEOF)
11837 {
11838 FreeExpContents(exp);
11839 exp->type = 2;
11840 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11841 }
11842 else
11843 {
11844 if(!exp->__anon1.op.exp1)
11845 {
11846 switch(exp->__anon1.op.op)
11847 {
11848 case '+':
11849 {
11850 struct Expression * exp2 = exp->__anon1.op.exp2;
11851
11852 exp->__anon1.op.exp2 = (((void *)0));
11853 FreeExpContents(exp);
11854 FreeType(exp->expType);
11855 FreeType(exp->destType);
11856 *exp = *exp2;
11857 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11858 break;
11859 }
11860 case '-':
11861 if(op1->ops.Neg)
11862 {
11863 FreeExpContents(exp);
11864 op1->ops.Neg(exp, op1);
11865 }
11866 break;
11867 case '~':
11868 if(op1->ops.BitNot)
11869 {
11870 FreeExpContents(exp);
11871 op1->ops.BitNot(exp, op1);
11872 }
11873 break;
11874 case '!':
11875 if(op1->ops.Not)
11876 {
11877 FreeExpContents(exp);
11878 op1->ops.Not(exp, op1);
11879 }
11880 break;
11881 }
11882 }
11883 else
11884 {
11885 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11886 {
11887 if(Promote(op2, op1->kind, op1->type->isSigned))
11888 op2->kind = op1->kind, op2->ops = op1->ops;
11889 else if(Promote(op1, op2->kind, op2->type->isSigned))
11890 op1->kind = op2->kind, op1->ops = op2->ops;
11891 }
11892 switch(exp->__anon1.op.op)
11893 {
11894 case '+':
11895 if(op1->ops.Add)
11896 {
11897 FreeExpContents(exp);
11898 op1->ops.Add(exp, op1, op2);
11899 }
11900 break;
11901 case '-':
11902 if(op1->ops.Sub)
11903 {
11904 FreeExpContents(exp);
11905 op1->ops.Sub(exp, op1, op2);
11906 }
11907 break;
11908 case '*':
11909 if(op1->ops.Mul)
11910 {
11911 FreeExpContents(exp);
11912 op1->ops.Mul(exp, op1, op2);
11913 }
11914 break;
11915 case '/':
11916 if(op1->ops.Div)
11917 {
11918 FreeExpContents(exp);
11919 op1->ops.Div(exp, op1, op2);
11920 }
11921 break;
11922 case '%':
11923 if(op1->ops.Mod)
11924 {
11925 FreeExpContents(exp);
11926 op1->ops.Mod(exp, op1, op2);
11927 }
11928 break;
11929 case '&':
11930 if(exp->__anon1.op.exp2)
11931 {
11932 if(op1->ops.BitAnd)
11933 {
11934 FreeExpContents(exp);
11935 op1->ops.BitAnd(exp, op1, op2);
11936 }
11937 }
11938 break;
11939 case '|':
11940 if(op1->ops.BitOr)
11941 {
11942 FreeExpContents(exp);
11943 op1->ops.BitOr(exp, op1, op2);
11944 }
11945 break;
11946 case '^':
11947 if(op1->ops.BitXor)
11948 {
11949 FreeExpContents(exp);
11950 op1->ops.BitXor(exp, op1, op2);
11951 }
11952 break;
11953 case LEFT_OP:
11954 if(op1->ops.LShift)
11955 {
11956 FreeExpContents(exp);
11957 op1->ops.LShift(exp, op1, op2);
11958 }
11959 break;
11960 case RIGHT_OP:
11961 if(op1->ops.RShift)
11962 {
11963 FreeExpContents(exp);
11964 op1->ops.RShift(exp, op1, op2);
11965 }
11966 break;
11967 case EQ_OP:
11968 if(op1->ops.Equ)
11969 {
11970 FreeExpContents(exp);
11971 op1->ops.Equ(exp, op1, op2);
11972 }
11973 break;
11974 case NE_OP:
11975 if(op1->ops.Nqu)
11976 {
11977 FreeExpContents(exp);
11978 op1->ops.Nqu(exp, op1, op2);
11979 }
11980 break;
11981 case AND_OP:
11982 if(op1->ops.And)
11983 {
11984 FreeExpContents(exp);
11985 op1->ops.And(exp, op1, op2);
11986 }
11987 break;
11988 case OR_OP:
11989 if(op1->ops.Or)
11990 {
11991 FreeExpContents(exp);
11992 op1->ops.Or(exp, op1, op2);
11993 }
11994 break;
11995 case '>':
11996 if(op1->ops.Grt)
11997 {
11998 FreeExpContents(exp);
11999 op1->ops.Grt(exp, op1, op2);
12000 }
12001 break;
12002 case '<':
12003 if(op1->ops.Sma)
12004 {
12005 FreeExpContents(exp);
12006 op1->ops.Sma(exp, op1, op2);
12007 }
12008 break;
12009 case GE_OP:
12010 if(op1->ops.GrtEqu)
12011 {
12012 FreeExpContents(exp);
12013 op1->ops.GrtEqu(exp, op1, op2);
12014 }
12015 break;
12016 case LE_OP:
12017 if(op1->ops.SmaEqu)
12018 {
12019 FreeExpContents(exp);
12020 op1->ops.SmaEqu(exp, op1, op2);
12021 }
12022 break;
12023 }
12024 }
12025 }
12026 }
12027
12028 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12029
12030 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12031
12032 void ComputeExpression(struct Expression * exp)
12033 {
12034 switch(exp->type)
12035 {
12036 case 1:
12037 {
12038 ComputeInstantiation(exp);
12039 break;
12040 }
12041 case 4:
12042 {
12043 struct Expression * exp1, * exp2 = (((void *)0));
12044 struct Operand op1 =
12045 {
12046 0, 0, 0,
12047 .__anon1 = {
12048 .c = 0
12049 },
12050 {
12051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12052 }
12053 };
12054 struct Operand op2 =
12055 {
12056 0, 0, 0,
12057 .__anon1 = {
12058 .c = 0
12059 },
12060 {
12061 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12062 }
12063 };
12064
12065 if(exp->__anon1.op.exp2)
12066 {
12067 struct Expression * e = exp->__anon1.op.exp2;
12068
12069 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12070 {
12071 if(e->type == 5 || e->type == 32 || e->type == 23)
12072 {
12073 if(e->type == 23)
12074 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12075 else
12076 e = (*e->__anon1.list).last;
12077 }
12078 }
12079 if(exp->__anon1.op.op == 261 && e && e->expType)
12080 {
12081 if(e->type == 3 && e->__anon1.__anon2.string)
12082 {
12083 char * string = e->__anon1.__anon2.string;
12084 int len = strlen(string);
12085 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12086
12087 len = UnescapeString(tmp, string + 1, len - 2);
12088 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12089 FreeExpContents(exp);
12090 exp->type = 2;
12091 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12092 }
12093 else
12094 {
12095 struct Type * type = e->expType;
12096
12097 type->refCount++;
12098 FreeExpContents(exp);
12099 exp->type = 2;
12100 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12101 FreeType(type);
12102 }
12103 break;
12104 }
12105 else
12106 ComputeExpression(exp->__anon1.op.exp2);
12107 }
12108 if(exp->__anon1.op.exp1)
12109 {
12110 ComputeExpression(exp->__anon1.op.exp1);
12111 exp1 = exp->__anon1.op.exp1;
12112 exp2 = exp->__anon1.op.exp2;
12113 op1 = GetOperand(exp1);
12114 if(op1.type)
12115 op1.type->refCount++;
12116 if(exp2)
12117 {
12118 op2 = GetOperand(exp2);
12119 if(op2.type)
12120 op2.type->refCount++;
12121 }
12122 }
12123 else
12124 {
12125 exp1 = exp->__anon1.op.exp2;
12126 op1 = GetOperand(exp1);
12127 if(op1.type)
12128 op1.type->refCount++;
12129 }
12130 CallOperator(exp, exp1, exp2, &op1, &op2);
12131 if(op1.type)
12132 FreeType(op1.type);
12133 if(op2.type)
12134 FreeType(op2.type);
12135 break;
12136 }
12137 case 5:
12138 case 32:
12139 {
12140 struct Expression * e, * n;
12141
12142 for(e = (*exp->__anon1.list).first; e; e = n)
12143 {
12144 n = e->next;
12145 if(!n)
12146 {
12147 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12148 struct Expression * prev = exp->prev;
12149 struct Expression * next = exp->next;
12150
12151 ComputeExpression(e);
12152 FreeType(exp->expType);
12153 FreeType(exp->destType);
12154 *exp = *e;
12155 exp->prev = prev;
12156 exp->next = next;
12157 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12158 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12159 }
12160 else
12161 {
12162 FreeExpression(e);
12163 }
12164 }
12165 break;
12166 }
12167 case 8:
12168 {
12169 struct Expression * memberExp = exp->__anon1.member.exp;
12170 struct Identifier * memberID = exp->__anon1.member.member;
12171 struct Type * type;
12172
12173 ComputeExpression(exp->__anon1.member.exp);
12174 type = exp->__anon1.member.exp->expType;
12175 if(type)
12176 {
12177 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)));
12178 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12179 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12180 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12181
12182 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12183 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12184 if(!_class)
12185 {
12186 char string[256];
12187 struct Symbol * classSym;
12188
12189 string[0] = '\0';
12190 PrintTypeNoConst(type, string, 0, 1);
12191 classSym = FindClass(string);
12192 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12193 }
12194 if(exp->__anon1.member.member)
12195 {
12196 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12197 if(!prop)
12198 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12199 }
12200 if(!prop && !member && _class && exp->__anon1.member.member)
12201 {
12202 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12203
12204 convertTo = _class;
12205 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12206 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12207 }
12208 if(prop)
12209 {
12210 if(prop->compiled)
12211 {
12212 struct Type * type = prop->dataType;
12213
12214 if(_class->type == 3)
12215 {
12216 if(type->kind == 8)
12217 {
12218 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12219
12220 if(_class->type == 3)
12221 {
12222 if(!_class->dataType)
12223 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12224 type = _class->dataType;
12225 }
12226 }
12227 switch(type->kind)
12228 {
12229 case 6:
12230 {
12231 float value;
12232 float (* Get)(float) = (void *)prop->Get;
12233
12234 GetFloat(exp->__anon1.member.exp, &value);
12235 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12236 exp->type = 2;
12237 break;
12238 }
12239 case 7:
12240 {
12241 double value;
12242 double (* Get)(double);
12243
12244 GetDouble(exp->__anon1.member.exp, &value);
12245 if(convertTo)
12246 Get = (void *)prop->Set;
12247 else
12248 Get = (void *)prop->Get;
12249 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12250 exp->type = 2;
12251 break;
12252 }
12253 }
12254 }
12255 else
12256 {
12257 if(convertTo)
12258 {
12259 struct Expression * value = exp->__anon1.member.exp;
12260 struct Type * type;
12261
12262 if(!prop->dataType)
12263 ProcessPropertyType(prop);
12264 type = prop->dataType;
12265 if(!type)
12266 {
12267 }
12268 else if(_class->type == 1)
12269 {
12270 switch(type->kind)
12271 {
12272 case 8:
12273 {
12274 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12275
12276 if(propertyClass->type == 1 && value->type == 1)
12277 {
12278 void (* Set)(void *, void *) = (void *)prop->Set;
12279
12280 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12281 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12282 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12283 exp->__anon1.instance->loc = exp->loc;
12284 exp->type = 1;
12285 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12286 PopulateInstance(exp->__anon1.instance);
12287 }
12288 break;
12289 }
12290 case 3:
12291 {
12292 int intValue;
12293 void (* Set)(void *, int) = (void *)prop->Set;
12294
12295 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12296 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12297 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12298 exp->__anon1.instance->loc = exp->loc;
12299 exp->type = 1;
12300 GetInt(value, &intValue);
12301 Set(exp->__anon1.instance->data, intValue);
12302 PopulateInstance(exp->__anon1.instance);
12303 break;
12304 }
12305 case 4:
12306 {
12307 long long intValue;
12308 void (* Set)(void *, long long) = (void *)prop->Set;
12309
12310 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12311 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12312 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12313 exp->__anon1.instance->loc = exp->loc;
12314 exp->type = 1;
12315 GetInt64(value, &intValue);
12316 Set(exp->__anon1.instance->data, intValue);
12317 PopulateInstance(exp->__anon1.instance);
12318 break;
12319 }
12320 case 22:
12321 {
12322 intptr_t intValue;
12323 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12324
12325 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12326 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12327 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12328 exp->__anon1.instance->loc = exp->loc;
12329 exp->type = 1;
12330 GetIntPtr(value, &intValue);
12331 Set(exp->__anon1.instance->data, intValue);
12332 PopulateInstance(exp->__anon1.instance);
12333 break;
12334 }
12335 case 23:
12336 {
12337 ssize_t intValue;
12338 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12339
12340 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12341 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12342 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12343 exp->__anon1.instance->loc = exp->loc;
12344 exp->type = 1;
12345 GetIntSize(value, &intValue);
12346 Set(exp->__anon1.instance->data, intValue);
12347 PopulateInstance(exp->__anon1.instance);
12348 break;
12349 }
12350 case 6:
12351 {
12352 float floatValue;
12353 void (* Set)(void *, float) = (void *)prop->Set;
12354
12355 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12356 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12357 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12358 exp->__anon1.instance->loc = exp->loc;
12359 exp->type = 1;
12360 GetFloat(value, &floatValue);
12361 Set(exp->__anon1.instance->data, floatValue);
12362 PopulateInstance(exp->__anon1.instance);
12363 break;
12364 }
12365 case 7:
12366 {
12367 double doubleValue;
12368 void (* Set)(void *, double) = (void *)prop->Set;
12369
12370 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12371 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12372 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12373 exp->__anon1.instance->loc = exp->loc;
12374 exp->type = 1;
12375 GetDouble(value, &doubleValue);
12376 Set(exp->__anon1.instance->data, doubleValue);
12377 PopulateInstance(exp->__anon1.instance);
12378 break;
12379 }
12380 }
12381 }
12382 else if(_class->type == 2)
12383 {
12384 switch(type->kind)
12385 {
12386 case 8:
12387 {
12388 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12389
12390 if(propertyClass->type == 1 && value->__anon1.instance->data)
12391 {
12392 unsigned int (* Set)(void *) = (void *)prop->Set;
12393 unsigned int bits = Set(value->__anon1.instance->data);
12394
12395 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12396 exp->type = 2;
12397 break;
12398 }
12399 else if(_class->type == 2)
12400 {
12401 unsigned int value;
12402 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12403 unsigned int bits;
12404
12405 GetUInt(exp->__anon1.member.exp, &value);
12406 bits = Set(value);
12407 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12408 exp->type = 2;
12409 }
12410 }
12411 }
12412 }
12413 }
12414 else
12415 {
12416 if(_class->type == 2)
12417 {
12418 unsigned int value;
12419
12420 GetUInt(exp->__anon1.member.exp, &value);
12421 switch(type->kind)
12422 {
12423 case 8:
12424 {
12425 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12426
12427 if(_class->type == 1)
12428 {
12429 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12430
12431 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12432 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12433 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12434 exp->__anon1.instance->loc = exp->loc;
12435 exp->type = 1;
12436 Get(value, exp->__anon1.instance->data);
12437 PopulateInstance(exp->__anon1.instance);
12438 }
12439 else if(_class->type == 2)
12440 {
12441 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12442 uint64 bits = Get(value);
12443
12444 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12445 exp->type = 2;
12446 }
12447 break;
12448 }
12449 }
12450 }
12451 else if(_class->type == 1)
12452 {
12453 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12454
12455 switch(type->kind)
12456 {
12457 case 8:
12458 {
12459 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12460
12461 if(_class->type == 1 && value)
12462 {
12463 void (* Get)(void *, void *) = (void *)prop->Get;
12464
12465 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12466 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12467 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12468 exp->__anon1.instance->loc = exp->loc;
12469 exp->type = 1;
12470 Get(value, exp->__anon1.instance->data);
12471 PopulateInstance(exp->__anon1.instance);
12472 }
12473 break;
12474 }
12475 }
12476 }
12477 }
12478 }
12479 }
12480 else
12481 {
12482 exp->isConstant = 0;
12483 }
12484 }
12485 else if(member)
12486 {
12487 }
12488 }
12489 if(exp->type != 8)
12490 {
12491 FreeExpression(memberExp);
12492 FreeIdentifier(memberID);
12493 }
12494 break;
12495 }
12496 case 10:
12497 {
12498 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12499
12500 FreeExpContents(exp);
12501 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12502 exp->type = 2;
12503 FreeType(type);
12504 break;
12505 }
12506 case 15:
12507 {
12508 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12509
12510 if(classSym && classSym->__anon1.registered)
12511 {
12512 if(classSym->__anon1.registered->fixed)
12513 {
12514 FreeSpecifier(exp->__anon1._class);
12515 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12516 exp->type = 2;
12517 }
12518 else
12519 {
12520 char className[1024];
12521
12522 strcpy(className, "__ecereClass_");
12523 FullClassNameCat(className, classSym->string, 1);
12524 DeclareClass(classSym, className);
12525 FreeExpContents(exp);
12526 exp->type = 9;
12527 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12528 exp->__anon1.member.member = MkIdentifier("structSize");
12529 }
12530 }
12531 break;
12532 }
12533 case 11:
12534 {
12535 struct Type * type;
12536 struct Expression * e = exp;
12537
12538 if(exp->type == 11)
12539 {
12540 if(exp->__anon1.cast.exp)
12541 ComputeExpression(exp->__anon1.cast.exp);
12542 e = exp->__anon1.cast.exp;
12543 }
12544 if(e && exp->expType)
12545 {
12546 type = exp->expType;
12547 if(type->kind == 8)
12548 {
12549 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12550
12551 if(_class && (_class->type == 3 || _class->type == 2))
12552 {
12553 if(!_class->dataType)
12554 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12555 type = _class->dataType;
12556 }
12557 }
12558 switch(type->kind)
12559 {
12560 case 24:
12561 case 1:
12562 if(type->isSigned)
12563 {
12564 char value = (char)0;
12565
12566 if(GetChar(e, &value))
12567 {
12568 FreeExpContents(exp);
12569 exp->__anon1.__anon1.constant = PrintChar(value);
12570 exp->type = 2;
12571 }
12572 }
12573 else
12574 {
12575 unsigned char value = (unsigned char)0;
12576
12577 if(GetUChar(e, &value))
12578 {
12579 FreeExpContents(exp);
12580 exp->__anon1.__anon1.constant = PrintUChar(value);
12581 exp->type = 2;
12582 }
12583 }
12584 break;
12585 case 2:
12586 if(type->isSigned)
12587 {
12588 short value = (short)0;
12589
12590 if(GetShort(e, &value))
12591 {
12592 FreeExpContents(exp);
12593 exp->__anon1.__anon1.constant = PrintShort(value);
12594 exp->type = 2;
12595 }
12596 }
12597 else
12598 {
12599 unsigned short value = (unsigned short)0;
12600
12601 if(GetUShort(e, &value))
12602 {
12603 FreeExpContents(exp);
12604 exp->__anon1.__anon1.constant = PrintUShort(value);
12605 exp->type = 2;
12606 }
12607 }
12608 break;
12609 case 3:
12610 if(type->isSigned)
12611 {
12612 int value = 0;
12613
12614 if(GetInt(e, &value))
12615 {
12616 FreeExpContents(exp);
12617 exp->__anon1.__anon1.constant = PrintInt(value);
12618 exp->type = 2;
12619 }
12620 }
12621 else
12622 {
12623 unsigned int value = 0;
12624
12625 if(GetUInt(e, &value))
12626 {
12627 FreeExpContents(exp);
12628 exp->__anon1.__anon1.constant = PrintUInt(value);
12629 exp->type = 2;
12630 }
12631 }
12632 break;
12633 case 4:
12634 if(type->isSigned)
12635 {
12636 long long value = 0;
12637
12638 if(GetInt64(e, &value))
12639 {
12640 FreeExpContents(exp);
12641 exp->__anon1.__anon1.constant = PrintInt64(value);
12642 exp->type = 2;
12643 }
12644 }
12645 else
12646 {
12647 uint64 value = 0;
12648
12649 if(GetUInt64(e, &value))
12650 {
12651 FreeExpContents(exp);
12652 exp->__anon1.__anon1.constant = PrintUInt64(value);
12653 exp->type = 2;
12654 }
12655 }
12656 break;
12657 case 22:
12658 if(type->isSigned)
12659 {
12660 intptr_t value = 0;
12661
12662 if(GetIntPtr(e, &value))
12663 {
12664 FreeExpContents(exp);
12665 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12666 exp->type = 2;
12667 }
12668 }
12669 else
12670 {
12671 uintptr_t value = 0;
12672
12673 if(GetUIntPtr(e, &value))
12674 {
12675 FreeExpContents(exp);
12676 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12677 exp->type = 2;
12678 }
12679 }
12680 break;
12681 case 23:
12682 if(type->isSigned)
12683 {
12684 ssize_t value = 0;
12685
12686 if(GetIntSize(e, &value))
12687 {
12688 FreeExpContents(exp);
12689 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12690 exp->type = 2;
12691 }
12692 }
12693 else
12694 {
12695 size_t value = 0;
12696
12697 if(GetUIntSize(e, &value))
12698 {
12699 FreeExpContents(exp);
12700 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12701 exp->type = 2;
12702 }
12703 }
12704 break;
12705 case 6:
12706 {
12707 float value = 0;
12708
12709 if(GetFloat(e, &value))
12710 {
12711 FreeExpContents(exp);
12712 exp->__anon1.__anon1.constant = PrintFloat(value);
12713 exp->type = 2;
12714 }
12715 break;
12716 }
12717 case 7:
12718 {
12719 double value = 0;
12720
12721 if(GetDouble(e, &value))
12722 {
12723 FreeExpContents(exp);
12724 exp->__anon1.__anon1.constant = PrintDouble(value);
12725 exp->type = 2;
12726 }
12727 break;
12728 }
12729 }
12730 }
12731 break;
12732 }
12733 case 12:
12734 {
12735 struct Operand op1 =
12736 {
12737 0, 0, 0,
12738 .__anon1 = {
12739 .c = 0
12740 },
12741 {
12742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12743 }
12744 };
12745 struct Operand op2 =
12746 {
12747 0, 0, 0,
12748 .__anon1 = {
12749 .c = 0
12750 },
12751 {
12752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12753 }
12754 };
12755 struct Operand op3 =
12756 {
12757 0, 0, 0,
12758 .__anon1 = {
12759 .c = 0
12760 },
12761 {
12762 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12763 }
12764 };
12765
12766 if(exp->__anon1.cond.exp)
12767 ComputeExpression((*exp->__anon1.cond.exp).last);
12768 if(exp->__anon1.cond.elseExp)
12769 ComputeExpression(exp->__anon1.cond.elseExp);
12770 if(exp->__anon1.cond.cond)
12771 ComputeExpression(exp->__anon1.cond.cond);
12772 op1 = GetOperand(exp->__anon1.cond.cond);
12773 if(op1.type)
12774 op1.type->refCount++;
12775 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12776 if(op2.type)
12777 op2.type->refCount++;
12778 op3 = GetOperand(exp->__anon1.cond.elseExp);
12779 if(op3.type)
12780 op3.type->refCount++;
12781 if(op1.ops.Cond)
12782 {
12783 FreeExpContents(exp);
12784 op1.ops.Cond(exp, &op1, &op2, &op3);
12785 }
12786 if(op1.type)
12787 FreeType(op1.type);
12788 if(op2.type)
12789 FreeType(op2.type);
12790 if(op3.type)
12791 FreeType(op3.type);
12792 break;
12793 }
12794 }
12795 }
12796
12797 void ApplyAnyObjectLogic(struct Expression * e);
12798
12799 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12800 {
12801 unsigned int result = 1;
12802
12803 if(destType)
12804 {
12805 struct __ecereNameSpace__ecere__sys__OldList converts =
12806 {
12807 0, 0, 0, 0, 0
12808 };
12809 struct Conversion * convert;
12810
12811 if(destType->kind == 0)
12812 return 0;
12813 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12814 result = 0;
12815 if(converts.count)
12816 {
12817 for(convert = converts.first; convert; convert = convert->next)
12818 {
12819 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12820
12821 if(!empty)
12822 {
12823 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12824 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12825
12826 *newExp = *exp;
12827 newExp->prev = (((void *)0));
12828 newExp->next = (((void *)0));
12829 newExp->destType = (((void *)0));
12830 if(convert->isGet)
12831 {
12832 exp->type = 8;
12833 exp->addedThis = 1;
12834 exp->__anon1.member.exp = newExp;
12835 FreeType(exp->__anon1.member.exp->expType);
12836 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12837 exp->__anon1.member.exp->expType->classObjectType = objectType;
12838 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12839 exp->__anon1.member.memberType = 1;
12840 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12841 exp->needCast = 1;
12842 if(exp->expType)
12843 exp->expType->refCount++;
12844 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12845 }
12846 else
12847 {
12848 {
12849 exp->type = 8;
12850 exp->addedThis = 1;
12851 exp->__anon1.member.exp = newExp;
12852 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)
12853 {
12854 newExp->byReference = 1;
12855 }
12856 FreeType(exp->__anon1.member.exp->expType);
12857 exp->__anon1.member.exp->expType = (((void *)0));
12858 if(convert->convert->dataType)
12859 {
12860 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12861 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12862 exp->__anon1.member.exp->expType->refCount = 1;
12863 exp->__anon1.member.exp->expType->classObjectType = objectType;
12864 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12865 }
12866 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12867 exp->__anon1.member.memberType = 4;
12868 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12869 exp->needCast = 1;
12870 if(convert->resultType)
12871 convert->resultType->refCount++;
12872 }
12873 }
12874 }
12875 else
12876 {
12877 FreeType(exp->expType);
12878 if(convert->isGet)
12879 {
12880 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12881 if(exp->destType->casted)
12882 exp->needCast = 1;
12883 if(exp->expType)
12884 exp->expType->refCount++;
12885 }
12886 else
12887 {
12888 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12889 if(exp->destType->casted)
12890 exp->needCast = 1;
12891 if(convert->resultType)
12892 convert->resultType->refCount++;
12893 }
12894 }
12895 }
12896 if(exp->isConstant && inCompiler)
12897 ComputeExpression(exp);
12898 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12899 }
12900 if(!result && exp->expType && converts.count)
12901 {
12902 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12903 }
12904 if(!result && exp->expType && exp->destType)
12905 {
12906 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))
12907 result = 1;
12908 }
12909 }
12910 return result;
12911 }
12912
12913 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12914
12915 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12916
12917 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12918
12919 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12920
12921 void CheckTemplateTypes(struct Expression * exp)
12922 {
12923 struct Expression * nbExp = GetNonBracketsExp(exp);
12924
12925 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12926 {
12927 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12928 struct Context * context;
12929
12930 *newExp = *exp;
12931 if(exp->destType)
12932 exp->destType->refCount++;
12933 if(exp->expType)
12934 exp->expType->refCount++;
12935 newExp->prev = (((void *)0));
12936 newExp->next = (((void *)0));
12937 switch(exp->expType->kind)
12938 {
12939 case 7:
12940 if(exp->destType->classObjectType)
12941 {
12942 if(exp->destType)
12943 exp->destType->refCount--;
12944 if(exp->expType)
12945 exp->expType->refCount--;
12946 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12947 }
12948 else
12949 {
12950 struct __ecereNameSpace__ecere__sys__OldList * specs;
12951 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12952 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12953
12954 context = PushContext();
12955 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12956 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12957 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12958 exp->type = 23;
12959 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12960 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12961 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12962 exp->__anon1.compound->__anon1.compound.context = context;
12963 PopContext(context);
12964 }
12965 break;
12966 default:
12967 exp->type = 11;
12968 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12969 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12970 exp->needCast = 1;
12971 break;
12972 }
12973 }
12974 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12975 {
12976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12977 struct Context * context;
12978
12979 *newExp = *exp;
12980 if(exp->destType)
12981 exp->destType->refCount++;
12982 if(exp->expType)
12983 exp->expType->refCount++;
12984 newExp->prev = (((void *)0));
12985 newExp->next = (((void *)0));
12986 switch(exp->expType->kind)
12987 {
12988 case 7:
12989 if(exp->destType->classObjectType)
12990 {
12991 if(exp->destType)
12992 exp->destType->refCount--;
12993 if(exp->expType)
12994 exp->expType->refCount--;
12995 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12996 }
12997 else
12998 {
12999 struct __ecereNameSpace__ecere__sys__OldList * specs;
13000 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13001 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13002
13003 context = PushContext();
13004 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13005 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13006 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13007 exp->type = 23;
13008 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13009 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13010 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13011 exp->__anon1.compound->__anon1.compound.context = context;
13012 PopContext(context);
13013 }
13014 break;
13015 case 8:
13016 {
13017 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13018 {
13019 exp->type = 5;
13020 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)));
13021 ProcessExpressionType((*exp->__anon1.list).first);
13022 break;
13023 }
13024 else
13025 {
13026 exp->type = 5;
13027 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13028 exp->needTemplateCast = 2;
13029 newExp->needCast = 1;
13030 newExp->needTemplateCast = 2;
13031 ProcessExpressionType((*exp->__anon1.list).first);
13032 break;
13033 }
13034 }
13035 default:
13036 {
13037 if(exp->expType->kind == 20)
13038 {
13039 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13040
13041 if(type)
13042 {
13043 FreeType(exp->destType);
13044 FreeType(exp->expType);
13045 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13046 break;
13047 }
13048 }
13049 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13050 {
13051 exp->type = 4;
13052 exp->__anon1.op.op = '*';
13053 exp->__anon1.op.exp1 = (((void *)0));
13054 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13055 }
13056 else
13057 {
13058 char typeString[1024];
13059 struct Declarator * decl;
13060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13061
13062 typeString[0] = '\0';
13063 PrintType(exp->expType, typeString, 0, 0);
13064 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13065 exp->type = 11;
13066 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13067 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13068 exp->__anon1.cast.exp->needCast = 1;
13069 }
13070 break;
13071 }
13072 }
13073 }
13074 }
13075
13076 extern int strncmp(const char * , const char * , size_t n);
13077
13078 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13079
13080 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13081 {
13082 int nsLen = strlen(nameSpace);
13083 struct Symbol * symbol;
13084
13085 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)))
13086 {
13087 char * s = symbol->string;
13088
13089 if(!strncmp(s, nameSpace, nsLen))
13090 {
13091 int c;
13092 char * namePart;
13093
13094 for(c = strlen(s) - 1; c >= 0; c--)
13095 if(s[c] == ':')
13096 break;
13097 namePart = s + c + 1;
13098 if(!strcmp(namePart, name))
13099 {
13100 return symbol;
13101 }
13102 }
13103 else
13104 break;
13105 }
13106 return (((void *)0));
13107 }
13108
13109 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13110 {
13111 int c;
13112 char nameSpace[1024];
13113 const char * namePart;
13114 unsigned int gotColon = 0;
13115
13116 nameSpace[0] = '\0';
13117 for(c = strlen(name) - 1; c >= 0; c--)
13118 if(name[c] == ':')
13119 {
13120 gotColon = 1;
13121 break;
13122 }
13123 namePart = name + c + 1;
13124 while(c >= 0 && name[c] == ':')
13125 c--;
13126 if(c >= 0)
13127 {
13128 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13129
13130 if(symbol)
13131 return symbol;
13132 memcpy(nameSpace, name, c + 1);
13133 nameSpace[c + 1] = (char)0;
13134 return ScanWithNameSpace(tree, nameSpace, namePart);
13135 }
13136 else if(gotColon)
13137 {
13138 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13139
13140 return symbol;
13141 }
13142 else
13143 {
13144 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13145
13146 if(symbol)
13147 return symbol;
13148 return ScanWithNameSpace(tree, "", namePart);
13149 }
13150 return (((void *)0));
13151 }
13152
13153 static void ProcessDeclaration(struct Declaration * decl);
13154
13155 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13156 {
13157 struct Context * ctx;
13158 struct Symbol * symbol = (((void *)0));
13159
13160 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13161 {
13162 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13163 {
13164 symbol = (((void *)0));
13165 if(thisNameSpace)
13166 {
13167 char curName[1024];
13168
13169 strcpy(curName, thisNameSpace);
13170 strcat(curName, "::");
13171 strcat(curName, name);
13172 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13173 }
13174 if(!symbol)
13175 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13176 }
13177 else
13178 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13179 if(symbol || ctx == endContext)
13180 break;
13181 }
13182 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13183 {
13184 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13185 {
13186 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13187 struct Context * tmpContext = curContext;
13188
13189 curContext = (((void *)0));
13190 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13191 curContext = tmpContext;
13192 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13193 DeclareType(symbol->type, 1, 1);
13194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13195 symbol->id = curExternal->symbol->idCode;
13196 }
13197 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13198 {
13199 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13200 symbol->id = curExternal->symbol->idCode;
13201 }
13202 }
13203 return symbol;
13204 }
13205
13206 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13207 {
13208 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13209 ListAdd(specs, MkSpecifier(UNSIGNED));
13210 switch(type->kind)
13211 {
13212 case 8:
13213 {
13214 if(type->__anon1._class->__anon1.registered)
13215 {
13216 if(!type->__anon1._class->__anon1.registered->dataType)
13217 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13218 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13219 }
13220 break;
13221 }
13222 case 7:
13223 ListAdd(specs, MkSpecifier(DOUBLE));
13224 break;
13225 case 6:
13226 ListAdd(specs, MkSpecifier(FLOAT));
13227 break;
13228 case 1:
13229 ListAdd(specs, MkSpecifier(CHAR));
13230 break;
13231 case 24:
13232 ListAdd(specs, MkSpecifier(_BOOL));
13233 break;
13234 case 2:
13235 ListAdd(specs, MkSpecifier(SHORT));
13236 break;
13237 case 4:
13238 ListAdd(specs, MkSpecifier(INT64));
13239 break;
13240 case 22:
13241 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13242 break;
13243 case 23:
13244 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13245 break;
13246 case 3:
13247 default:
13248 ListAdd(specs, MkSpecifier(INT));
13249 break;
13250 }
13251 }
13252
13253 static void PrintArraySize(struct Type * arrayType, char * string)
13254 {
13255 char size[256];
13256
13257 size[0] = '\0';
13258 strcat(size, "[");
13259 if(arrayType->__anon1.__anon4.enumClass)
13260 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13261 else if(arrayType->__anon1.__anon4.arraySizeExp)
13262 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13263 strcat(size, "]");
13264 strcat(string, size);
13265 }
13266
13267 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13268 {
13269 if(type)
13270 {
13271 if(printConst && type->constant)
13272 strcat(string, "const ");
13273 switch(type->kind)
13274 {
13275 case 8:
13276 {
13277 struct Symbol * c = type->__anon1._class;
13278
13279 if(type->classObjectType == 2)
13280 strcat(string, "typed_object");
13281 else if(type->classObjectType == 3)
13282 strcat(string, "any_object");
13283 else
13284 {
13285 if(c && c->string)
13286 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13287 }
13288 if(type->byReference)
13289 strcat(string, " &");
13290 break;
13291 }
13292 case 0:
13293 strcat(string, "void");
13294 break;
13295 case 3:
13296 strcat(string, type->isSigned ? "int" : "uint");
13297 break;
13298 case 4:
13299 strcat(string, type->isSigned ? "int64" : "uint64");
13300 break;
13301 case 22:
13302 strcat(string, type->isSigned ? "intptr" : "uintptr");
13303 break;
13304 case 23:
13305 strcat(string, type->isSigned ? "intsize" : "uintsize");
13306 break;
13307 case 1:
13308 strcat(string, type->isSigned ? "char" : "byte");
13309 break;
13310 case 24:
13311 strcat(string, "_Bool");
13312 break;
13313 case 2:
13314 strcat(string, type->isSigned ? "short" : "uint16");
13315 break;
13316 case 6:
13317 strcat(string, "float");
13318 break;
13319 case 7:
13320 strcat(string, "double");
13321 break;
13322 case 9:
13323 if(type->__anon1.__anon1.enumName)
13324 {
13325 strcat(string, "struct ");
13326 strcat(string, type->__anon1.__anon1.enumName);
13327 }
13328 else if(type->typeName)
13329 strcat(string, type->typeName);
13330 else
13331 {
13332 struct Type * member;
13333
13334 strcat(string, "struct { ");
13335 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13336 {
13337 PrintType(member, string, 1, fullName);
13338 strcat(string, "; ");
13339 }
13340 strcat(string, "}");
13341 }
13342 break;
13343 case 10:
13344 if(type->__anon1.__anon1.enumName)
13345 {
13346 strcat(string, "union ");
13347 strcat(string, type->__anon1.__anon1.enumName);
13348 }
13349 else if(type->typeName)
13350 strcat(string, type->typeName);
13351 else
13352 {
13353 strcat(string, "union ");
13354 strcat(string, "(unnamed)");
13355 }
13356 break;
13357 case 15:
13358 if(type->__anon1.__anon1.enumName)
13359 {
13360 strcat(string, "enum ");
13361 strcat(string, type->__anon1.__anon1.enumName);
13362 }
13363 else if(type->typeName)
13364 strcat(string, type->typeName);
13365 else
13366 strcat(string, "int");
13367 break;
13368 case 14:
13369 strcat(string, "...");
13370 break;
13371 case 19:
13372 strcat(string, "subclass(");
13373 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13374 strcat(string, ")");
13375 break;
13376 case 20:
13377 strcat(string, type->__anon1.templateParameter->identifier->string);
13378 break;
13379 case 21:
13380 strcat(string, "thisclass");
13381 break;
13382 case 17:
13383 strcat(string, "__builtin_va_list");
13384 break;
13385 }
13386 }
13387 }
13388
13389 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13390
13391 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13392 {
13393 if(type->name && type->name[0])
13394 {
13395 if(fullName)
13396 strcat(string, type->name);
13397 else
13398 {
13399 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13400
13401 if(name)
13402 name += 2;
13403 else
13404 name = type->name;
13405 strcat(string, name);
13406 }
13407 }
13408 }
13409
13410 static void PrintAttribs(struct Type * type, char * string)
13411 {
13412 if(type)
13413 {
13414 if(type->dllExport)
13415 strcat(string, "dllexport ");
13416 if(type->attrStdcall)
13417 strcat(string, "stdcall ");
13418 }
13419 }
13420
13421 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13422 {
13423 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13424 {
13425 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13426 PrintAttribs(type, string);
13427 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13428 strcat(string, " const");
13429 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13430 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13431 strcat(string, " (");
13432 if(type->kind == 13)
13433 {
13434 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13435 PrintAttribs(type->__anon1.type, string);
13436 }
13437 if(type->kind == 13)
13438 {
13439 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13440 strcat(string, "*");
13441 else
13442 strcat(string, " *");
13443 }
13444 if(printConst && type->constant && type->kind == 13)
13445 strcat(string, " const");
13446 }
13447 else
13448 PrintTypeSpecs(type, string, fullName, printConst);
13449 }
13450
13451 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13452 {
13453 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13454 strcat(string, ")");
13455 if(type->kind == 12)
13456 PrintArraySize(type, string);
13457 else if(type->kind == 11)
13458 {
13459 struct Type * param;
13460
13461 strcat(string, "(");
13462 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13463 {
13464 PrintType(param, string, 1, fullName);
13465 if(param->next)
13466 strcat(string, ", ");
13467 }
13468 strcat(string, ")");
13469 }
13470 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13471 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13472 }
13473
13474 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13475 {
13476 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13477 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13478 strcat(string, " ");
13479 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13480 {
13481 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13482
13483 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13484 {
13485 if(type->classObjectType == 1)
13486 strcat(string, "class");
13487 else
13488 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13489 }
13490 else if(_class && _class->string)
13491 {
13492 char * s = _class->string;
13493
13494 if(fullName)
13495 strcat(string, s);
13496 else
13497 {
13498 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13499
13500 if(name)
13501 name += 2;
13502 else
13503 name = s;
13504 strcat(string, name);
13505 }
13506 }
13507 strcat(string, "::");
13508 }
13509 if(printName && type->name)
13510 PrintName(type, string, fullName);
13511 PostPrintType(type, string, fullName);
13512 if(type->bitFieldCount)
13513 {
13514 char count[100];
13515
13516 sprintf(count, ":%d", type->bitFieldCount);
13517 strcat(string, count);
13518 }
13519 }
13520
13521 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13522 {
13523 _PrintType(type, string, printName, fullName, 1);
13524 }
13525
13526 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13527 {
13528 _PrintType(type, string, printName, fullName, 0);
13529 }
13530
13531 static struct Type * FindMember(struct Type * type, char * string)
13532 {
13533 struct Type * memberType;
13534
13535 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13536 {
13537 if(!memberType->name)
13538 {
13539 struct Type * subType = FindMember(memberType, string);
13540
13541 if(subType)
13542 return subType;
13543 }
13544 else if(!strcmp(memberType->name, string))
13545 return memberType;
13546 }
13547 return (((void *)0));
13548 }
13549
13550 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13551 {
13552 struct Type * memberType;
13553
13554 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13555 {
13556 if(!memberType->name)
13557 {
13558 struct Type * subType = FindMember(memberType, string);
13559
13560 if(subType)
13561 {
13562 *offset += memberType->offset;
13563 return subType;
13564 }
13565 }
13566 else if(!strcmp(memberType->name, string))
13567 {
13568 *offset += memberType->offset;
13569 return memberType;
13570 }
13571 }
13572 return (((void *)0));
13573 }
13574
13575 extern unsigned int parseError;
13576
13577 unsigned int GetParseError()
13578 {
13579 return parseError;
13580 }
13581
13582 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13583
13584 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13585
13586 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13587
13588 struct Expression * ParseExpressionString(char * expression)
13589 {
13590 parseError = 0;
13591 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13592 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13593 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13594
13595 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13596 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13597 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13598 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13599
13600 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13601 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13602 echoOn = 0;
13603 parsedExpression = (((void *)0));
13604 resetScanner();
13605 expression_yyparse();
13606 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13607 return parsedExpression;
13608 }
13609
13610 extern char *  QMkString(const char *  source);
13611
13612 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13613 {
13614 struct Identifier * id = exp->__anon1.__anon1.identifier;
13615 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13616 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13617 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13618 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13619
13620 if(_class && _class->type == 4)
13621 {
13622 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13623 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13624
13625 if(enumClass)
13626 {
13627 struct __ecereNameSpace__ecere__com__Class * baseClass;
13628
13629 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13630 {
13631 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13632
13633 for(value = e->values.first; value; value = value->next)
13634 {
13635 if(!strcmp(value->name, id->string))
13636 break;
13637 }
13638 if(value)
13639 {
13640 char constant[256];
13641
13642 FreeExpContents(exp);
13643 exp->type = 2;
13644 exp->isConstant = 1;
13645 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13646 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13647 else
13648 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13649 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13650 exp->expType = MkClassType(baseClass->fullName);
13651 break;
13652 }
13653 }
13654 }
13655 if(value)
13656 return 1;
13657 }
13658 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13659 {
13660 ProcessMethodType(method);
13661 exp->expType = __extension__ ({
13662 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13663
13664 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13665 });
13666 return 1;
13667 }
13668 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13669 {
13670 if(!prop->dataType)
13671 ProcessPropertyType(prop);
13672 exp->expType = prop->dataType;
13673 if(prop->dataType)
13674 prop->dataType->refCount++;
13675 return 1;
13676 }
13677 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13678 {
13679 if(!member->dataType)
13680 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13681 exp->expType = member->dataType;
13682 if(member->dataType)
13683 member->dataType->refCount++;
13684 return 1;
13685 }
13686 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13687 {
13688 if(!classProp->dataType)
13689 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13690 if(classProp->constant)
13691 {
13692 FreeExpContents(exp);
13693 exp->isConstant = 1;
13694 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13695 {
13696 exp->type = 3;
13697 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13698 }
13699 else
13700 {
13701 char constant[256];
13702
13703 exp->type = 2;
13704 sprintf(constant, "%d", (int)classProp->Get(_class));
13705 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13706 }
13707 }
13708 else
13709 {
13710 }
13711 exp->expType = classProp->dataType;
13712 if(classProp->dataType)
13713 classProp->dataType->refCount++;
13714 return 1;
13715 }
13716 return 0;
13717 }
13718
13719 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13720 {
13721 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13722 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13723 struct __ecereNameSpace__ecere__com__NameSpace * child;
13724
13725 if(!data)
13726 {
13727 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)))
13728 {
13729 data = ScanGlobalData(child, name);
13730 if(data)
13731 break;
13732 }
13733 }
13734 return data;
13735 }
13736
13737 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13738
13739 extern char *  strncpy(char * , const char * , size_t n);
13740
13741 static struct GlobalData * FindGlobalData(char * name)
13742 {
13743 int start = 0, c;
13744 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13745
13746 nameSpace = globalData;
13747 for(c = 0; name[c]; c++)
13748 {
13749 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13750 {
13751 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13752 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13753
13754 strncpy(spaceName, name + start, c - start);
13755 spaceName[c - start] = '\0';
13756 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13757 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13758 if(!newSpace)
13759 return (((void *)0));
13760 nameSpace = newSpace;
13761 if(name[c] == ':')
13762 c++;
13763 start = c + 1;
13764 }
13765 }
13766 if(c - start)
13767 {
13768 return ScanGlobalData(nameSpace, name + start);
13769 }
13770 return (((void *)0));
13771 }
13772
13773 static int definedExpStackPos;
13774
13775 static void * definedExpStack[512];
13776
13777 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13778 {
13779 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13780
13781 FreeExpContents(checkedExp);
13782 FreeType(checkedExp->expType);
13783 FreeType(checkedExp->destType);
13784 *checkedExp = *newExp;
13785 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13786 checkedExp->prev = prev;
13787 checkedExp->next = next;
13788 }
13789
13790 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13791
13792 extern int printf(const char * , ...);
13793
13794 void __ecereMethod_Expression_Clear();
13795
13796 void ApplyAnyObjectLogic(struct Expression * e)
13797 {
13798 struct Type * destType = e->destType;
13799
13800 if(destType && (destType->classObjectType == 3))
13801 {
13802 if(e && e->expType)
13803 {
13804 struct Type * type = e->expType;
13805 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13806
13807 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13808 {
13809 _class = type->__anon1._class->__anon1.registered;
13810 }
13811 else if(type->kind == 19)
13812 {
13813 _class = FindClass("ecere::com::Class")->__anon1.registered;
13814 }
13815 else
13816 {
13817 char string[1024] = "";
13818 struct Symbol * classSym;
13819
13820 PrintTypeNoConst(type, string, 0, 1);
13821 classSym = FindClass(string);
13822 if(classSym)
13823 _class = classSym->__anon1.registered;
13824 }
13825 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)))
13826 {
13827 if(!_class || strcmp(_class->fullName, "char *"))
13828 {
13829 struct Expression * checkedExp = e, * newExp;
13830
13831 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13832 {
13833 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13834 {
13835 if(checkedExp->type == 23)
13836 {
13837 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13838 }
13839 else
13840 checkedExp = (*checkedExp->__anon1.list).last;
13841 }
13842 else if(checkedExp->type == 11)
13843 checkedExp = checkedExp->__anon1.cast.exp;
13844 }
13845 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13846 {
13847 newExp = checkedExp->__anon1.op.exp2;
13848 checkedExp->__anon1.op.exp2 = (((void *)0));
13849 FreeExpContents(checkedExp);
13850 if(e->expType && e->expType->passAsTemplate)
13851 {
13852 char size[100];
13853
13854 ComputeTypeSize(e->expType);
13855 sprintf(size, "%d", e->expType->size);
13856 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))))));
13857 }
13858 ReplaceExpContents(checkedExp, newExp);
13859 e->byReference = 1;
13860 }
13861 else if(!e->byReference || (_class && _class->type == 5))
13862 {
13863 struct Expression * checkedExp;
13864
13865 {
13866 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;
13867
13868 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13869 {
13870 struct Context * context = PushContext();
13871 struct Declarator * decl;
13872 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13873 char typeString[1024];
13874 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13875
13876 typeString[0] = '\0';
13877 *newExp = *e;
13878 newExp->prev = (((void *)0));
13879 newExp->next = (((void *)0));
13880 newExp->expType = (((void *)0));
13881 PrintTypeNoConst(e->expType, typeString, 0, 1);
13882 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13883 newExp->destType = ProcessType(specs, decl);
13884 curContext = context;
13885 if(curCompound)
13886 {
13887 char name[100];
13888 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13889
13890 e->type = 23;
13891 sprintf(name, "__internalValue%03X", internalValueCounter++);
13892 if(!curCompound->__anon1.compound.declarations)
13893 curCompound->__anon1.compound.declarations = MkList();
13894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13895 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13896 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13897 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13898 }
13899 else
13900 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13901 {
13902 struct Type * type = e->destType;
13903
13904 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13905 CopyTypeInto(e->destType, type);
13906 e->destType->refCount = 1;
13907 e->destType->classObjectType = 0;
13908 FreeType(type);
13909 }
13910 e->__anon1.compound->__anon1.compound.context = context;
13911 PopContext(context);
13912 curContext = context->parent;
13913 }
13914 }
13915 checkedExp = e;
13916 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13917 {
13918 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13919 {
13920 if(checkedExp->type == 23)
13921 {
13922 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13923 }
13924 else
13925 checkedExp = (*checkedExp->__anon1.list).last;
13926 }
13927 else if(checkedExp->type == 11)
13928 checkedExp = checkedExp->__anon1.cast.exp;
13929 }
13930 {
13931 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13932
13933 *operand = *checkedExp;
13934 __ecereMethod_Expression_Clear(checkedExp);
13935 checkedExp->destType = ProcessTypeString("void *", 0);
13936 checkedExp->expType = checkedExp->destType;
13937 checkedExp->destType->refCount++;
13938 checkedExp->type = 4;
13939 checkedExp->__anon1.op.op = '&';
13940 checkedExp->__anon1.op.exp1 = (((void *)0));
13941 checkedExp->__anon1.op.exp2 = operand;
13942 }
13943 }
13944 }
13945 }
13946 }
13947 }
13948 {
13949 }
13950 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))))
13951 {
13952 if(e->expType->classObjectType && destType && destType->classObjectType)
13953 {
13954 return ;
13955 }
13956 else
13957 {
13958 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13959
13960 *thisExp = *e;
13961 thisExp->prev = (((void *)0));
13962 thisExp->next = (((void *)0));
13963 __ecereMethod_Expression_Clear(e);
13964 e->type = 5;
13965 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13966 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13967 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13968 {
13969 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13970 CopyTypeInto(e->expType, thisExp->expType);
13971 e->expType->byReference = 0;
13972 e->expType->refCount = 1;
13973 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))
13974 {
13975 e->expType->classObjectType = 0;
13976 }
13977 }
13978 }
13979 }
13980 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13981 {
13982 if(destType->kind == 14)
13983 {
13984 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13985 }
13986 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))
13987 {
13988 unsigned int byReference = e->expType->byReference;
13989 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13990 struct Declarator * decl;
13991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13992 char typeString[1024];
13993 struct Type * type;
13994 int backupClassObjectType;
13995 unsigned int backupByReference;
13996
13997 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13998 type = e->expType;
13999 else
14000 type = destType;
14001 backupClassObjectType = type->classObjectType;
14002 backupByReference = type->byReference;
14003 type->classObjectType = 0;
14004 type->byReference = 0;
14005 typeString[0] = '\0';
14006 PrintType(type, typeString, 0, 1);
14007 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14008 type->classObjectType = backupClassObjectType;
14009 type->byReference = backupByReference;
14010 *thisExp = *e;
14011 thisExp->prev = (((void *)0));
14012 thisExp->next = (((void *)0));
14013 __ecereMethod_Expression_Clear(e);
14014 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)))
14015 {
14016 e->type = 4;
14017 e->__anon1.op.op = '*';
14018 e->__anon1.op.exp1 = (((void *)0));
14019 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14020 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14021 CopyTypeInto(e->expType, type);
14022 e->expType->byReference = 0;
14023 e->expType->refCount = 1;
14024 }
14025 else
14026 {
14027 e->type = 11;
14028 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14029 e->__anon1.cast.exp = thisExp;
14030 e->byReference = 1;
14031 e->expType = type;
14032 type->refCount++;
14033 }
14034 e->destType = destType;
14035 destType->refCount++;
14036 }
14037 }
14038 }
14039
14040 void ApplyLocation(struct Expression * exp, struct Location * loc)
14041 {
14042 exp->loc = *loc;
14043 switch(exp->type)
14044 {
14045 case 4:
14046 if(exp->__anon1.op.exp1)
14047 ApplyLocation(exp->__anon1.op.exp1, loc);
14048 if(exp->__anon1.op.exp2)
14049 ApplyLocation(exp->__anon1.op.exp2, loc);
14050 break;
14051 case 5:
14052 if(exp->__anon1.list)
14053 {
14054 struct Expression * e;
14055
14056 for(e = (*exp->__anon1.list).first; e; e = e->next)
14057 ApplyLocation(e, loc);
14058 }
14059 break;
14060 case 6:
14061 if(exp->__anon1.index.index)
14062 {
14063 struct Expression * e;
14064
14065 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14066 ApplyLocation(e, loc);
14067 }
14068 if(exp->__anon1.index.exp)
14069 ApplyLocation(exp->__anon1.index.exp, loc);
14070 break;
14071 case 7:
14072 if(exp->__anon1.call.arguments)
14073 {
14074 struct Expression * arg;
14075
14076 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14077 ApplyLocation(arg, loc);
14078 }
14079 if(exp->__anon1.call.exp)
14080 ApplyLocation(exp->__anon1.call.exp, loc);
14081 break;
14082 case 8:
14083 case 9:
14084 if(exp->__anon1.member.exp)
14085 ApplyLocation(exp->__anon1.member.exp, loc);
14086 break;
14087 case 11:
14088 if(exp->__anon1.cast.exp)
14089 ApplyLocation(exp->__anon1.cast.exp, loc);
14090 break;
14091 case 12:
14092 if(exp->__anon1.cond.exp)
14093 {
14094 struct Expression * e;
14095
14096 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14097 ApplyLocation(e, loc);
14098 }
14099 if(exp->__anon1.cond.cond)
14100 ApplyLocation(exp->__anon1.cond.cond, loc);
14101 if(exp->__anon1.cond.elseExp)
14102 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14103 break;
14104 case 34:
14105 if(exp->__anon1.vaArg.exp)
14106 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14107 break;
14108 default:
14109 break;
14110 }
14111 }
14112
14113 extern char *  strstr(const char * , const char * );
14114
14115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14116
14117 struct __ecereNameSpace__ecere__com__DefinedExpression
14118 {
14119 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14120 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14121 const char *  name;
14122 const char *  value;
14123 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14124 } __attribute__ ((gcc_struct));
14125
14126 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14127
14128 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14129
14130 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14131
14132 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14133
14134 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14135
14136 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14137
14138 static void ProcessStatement(struct Statement * stmt);
14139
14140 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14141
14142 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14143
14144 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14145
14146 extern const char *  sourceFile;
14147
14148 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
14149
14150 extern struct Expression * MoveExpContents(struct Expression * exp);
14151
14152 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14153
14154 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
14155
14156 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14157
14158 void ProcessExpressionType(struct Expression * exp)
14159 {
14160 unsigned int unresolved = 0;
14161 struct Location oldyylloc = yylloc;
14162 unsigned int notByReference = 0;
14163
14164 if(!exp || exp->expType)
14165 return ;
14166 yylloc = exp->loc;
14167 switch(exp->type)
14168 {
14169 case 0:
14170 {
14171 struct Identifier * id = exp->__anon1.__anon1.identifier;
14172
14173 if(!id || !topContext)
14174 return ;
14175 if(id->_class && id->_class->__anon1.__anon1.name)
14176 {
14177 id->classSym = id->_class->__anon1.__anon1.symbol;
14178 }
14179 if(!strcmp(id->string, "__runtimePlatform"))
14180 {
14181 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14182 break;
14183 }
14184 else if(strstr(id->string, "__ecereClass") == id->string)
14185 {
14186 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14187 break;
14188 }
14189 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14190 {
14191 ReplaceClassMembers(exp, thisClass);
14192 if(exp->type != 0)
14193 {
14194 ProcessExpressionType(exp);
14195 break;
14196 }
14197 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14198 break;
14199 }
14200 else
14201 {
14202 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14203
14204 if(!symbol)
14205 {
14206 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14207 break;
14208 else
14209 {
14210 if(thisClass)
14211 {
14212 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14213 if(exp->type != 0)
14214 {
14215 ProcessExpressionType(exp);
14216 break;
14217 }
14218 }
14219 else if(currentClass && !id->_class)
14220 {
14221 if(ResolveIdWithClass(exp, currentClass, 1))
14222 break;
14223 }
14224 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14225 }
14226 }
14227 if(symbol)
14228 {
14229 struct Type * type = symbol->type;
14230 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14231
14232 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14233 {
14234 struct Context * context = SetupTemplatesContext(_class);
14235
14236 type = ReplaceThisClassType(_class);
14237 FinishTemplatesContext(context);
14238 if(type)
14239 type->refCount = 0;
14240 }
14241 FreeSpecifier(id->_class);
14242 id->_class = (((void *)0));
14243 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14244 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14245 id->classSym = (((void *)0));
14246 exp->expType = type;
14247 if(type)
14248 type->refCount++;
14249 if(type && (type->kind == 15))
14250 exp->isConstant = 1;
14251 if(symbol->isParam || !strcmp(id->string, "this"))
14252 {
14253 if(_class && _class->type == 1 && !type->declaredWithStruct)
14254 exp->byReference = 1;
14255 }
14256 if(symbol->isIterator)
14257 {
14258 if(symbol->isIterator == 3)
14259 {
14260 exp->type = 5;
14261 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14262 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14263 exp->expType = (((void *)0));
14264 ProcessExpressionType(exp);
14265 }
14266 else if(symbol->isIterator != 4)
14267 {
14268 exp->type = 8;
14269 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14270 exp->__anon1.member.exp->expType = exp->expType;
14271 exp->__anon1.member.member = MkIdentifier("data");
14272 exp->expType = (((void *)0));
14273 ProcessExpressionType(exp);
14274 }
14275 }
14276 break;
14277 }
14278 else
14279 {
14280 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14281
14282 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14283 {
14284 char name[1024];
14285
14286 strcpy(name, thisNameSpace);
14287 strcat(name, "::");
14288 strcat(name, id->string);
14289 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14290 }
14291 if(!definedExp)
14292 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14293 if(definedExp)
14294 {
14295 int c;
14296
14297 for(c = 0; c < definedExpStackPos; c++)
14298 if(definedExpStack[c] == definedExp)
14299 break;
14300 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14301 {
14302 struct Location backupYylloc = yylloc;
14303 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14304
14305 definedExpStack[definedExpStackPos++] = definedExp;
14306 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14307 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14308 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14309
14310 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14311 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14312 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14313 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14314
14315 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14316 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14317 echoOn = 0;
14318 parsedExpression = (((void *)0));
14319 resetScanner();
14320 expression_yyparse();
14321 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14322 if(backInput)
14323 fileInput = backInput;
14324 yylloc = backupYylloc;
14325 if(parsedExpression)
14326 {
14327 FreeIdentifier(id);
14328 exp->type = 5;
14329 exp->__anon1.list = MkListOne(parsedExpression);
14330 ApplyLocation(parsedExpression, &yylloc);
14331 ProcessExpressionType(exp);
14332 definedExpStackPos--;
14333 return ;
14334 }
14335 definedExpStackPos--;
14336 }
14337 else
14338 {
14339 if(inCompiler)
14340 {
14341 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14342 }
14343 }
14344 }
14345 else
14346 {
14347 struct GlobalData * data = (((void *)0));
14348
14349 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14350 {
14351 char name[1024];
14352
14353 strcpy(name, thisNameSpace);
14354 strcat(name, "::");
14355 strcat(name, id->string);
14356 data = FindGlobalData(name);
14357 }
14358 if(!data)
14359 data = FindGlobalData(id->string);
14360 if(data)
14361 {
14362 DeclareGlobalData(data);
14363 exp->expType = data->dataType;
14364 if(data->dataType)
14365 data->dataType->refCount++;
14366 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14367 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14368 FreeSpecifier(id->_class);
14369 id->_class = (((void *)0));
14370 break;
14371 }
14372 else
14373 {
14374 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14375
14376 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14377 {
14378 char name[1024];
14379
14380 strcpy(name, thisNameSpace);
14381 strcat(name, "::");
14382 strcat(name, id->string);
14383 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14384 }
14385 if(!function)
14386 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14387 if(function)
14388 {
14389 char name[1024];
14390
14391 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14392 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14393 name[0] = (char)0;
14394 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14395 strcpy(name, "__ecereFunction_");
14396 FullClassNameCat(name, id->string, 0);
14397 if(DeclareFunction(function, name))
14398 {
14399 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14400 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14401 }
14402 exp->expType = function->dataType;
14403 if(function->dataType)
14404 function->dataType->refCount++;
14405 FreeSpecifier(id->_class);
14406 id->_class = (((void *)0));
14407 break;
14408 }
14409 }
14410 }
14411 }
14412 }
14413 unresolved = 1;
14414 break;
14415 }
14416 case 1:
14417 {
14418 if(!exp->__anon1.instance->_class)
14419 {
14420 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14421 {
14422 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14423 }
14424 }
14425 ProcessInstantiationType(exp->__anon1.instance);
14426 exp->isConstant = exp->__anon1.instance->isConstant;
14427 if(exp->__anon1.instance->_class)
14428 {
14429 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14430 }
14431 break;
14432 }
14433 case 2:
14434 {
14435 if(!exp->expType)
14436 {
14437 char * constant = exp->__anon1.__anon1.constant;
14438 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14439
14440 exp->expType = type;
14441 if(constant[0] == '\'')
14442 {
14443 if((int)((unsigned char *)constant)[1] > 127)
14444 {
14445 int nb;
14446 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14447
14448 if(nb < 2)
14449 ch = constant[1];
14450 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14451 exp->__anon1.__anon1.constant = PrintUInt(ch);
14452 type->kind = 8;
14453 type->__anon1._class = FindClass("unichar");
14454 type->isSigned = 0;
14455 }
14456 else
14457 {
14458 type->kind = 1;
14459 type->isSigned = 1;
14460 }
14461 }
14462 else
14463 {
14464 char * dot = strchr(constant, '.');
14465 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14466 char * exponent;
14467
14468 if(isHex)
14469 {
14470 exponent = strchr(constant, 'p');
14471 if(!exponent)
14472 exponent = strchr(constant, 'P');
14473 }
14474 else
14475 {
14476 exponent = strchr(constant, 'e');
14477 if(!exponent)
14478 exponent = strchr(constant, 'E');
14479 }
14480 if(dot || exponent)
14481 {
14482 if(strchr(constant, 'f') || strchr(constant, 'F'))
14483 type->kind = 6;
14484 else
14485 type->kind = 7;
14486 type->isSigned = 1;
14487 }
14488 else
14489 {
14490 unsigned int isSigned = constant[0] == '-';
14491 char * endP = (((void *)0));
14492 long long i64 = strtoll(constant, &endP, 0);
14493 uint64 ui64 = strtoull(constant, &endP, 0);
14494 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14495
14496 if(isSigned)
14497 {
14498 if(i64 < (((int)0x80000000)))
14499 is64Bit = 1;
14500 }
14501 else
14502 {
14503 if(ui64 > (((int)0x7fffffff)))
14504 {
14505 if(ui64 > (0xffffffff))
14506 {
14507 is64Bit = 1;
14508 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14509 isSigned = 1;
14510 }
14511 }
14512 else if(constant[0] != '0' || !constant[1])
14513 isSigned = 1;
14514 }
14515 type->kind = is64Bit ? 4 : 3;
14516 type->isSigned = isSigned;
14517 }
14518 }
14519 exp->isConstant = 1;
14520 if(exp->destType && exp->destType->kind == 7)
14521 type->kind = 7;
14522 else if(exp->destType && exp->destType->kind == 6)
14523 type->kind = 6;
14524 else if(exp->destType && exp->destType->kind == 4)
14525 type->kind = 4;
14526 }
14527 break;
14528 }
14529 case 3:
14530 {
14531 exp->isConstant = 1;
14532 exp->expType = __extension__ ({
14533 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14534
14535 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14536 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14537
14538 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14539 }), __ecereInstance2;
14540 });
14541 break;
14542 }
14543 case 13:
14544 case 26:
14545 ProcessExpressionType(exp->__anon1._new.size);
14546 exp->expType = __extension__ ({
14547 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14548
14549 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14550 });
14551 DeclareType(exp->expType->__anon1.type, 0, 0);
14552 break;
14553 case 14:
14554 case 27:
14555 ProcessExpressionType(exp->__anon1._renew.size);
14556 ProcessExpressionType(exp->__anon1._renew.exp);
14557 exp->expType = __extension__ ({
14558 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14559
14560 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14561 });
14562 DeclareType(exp->expType->__anon1.type, 0, 0);
14563 break;
14564 case 4:
14565 {
14566 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14567 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14568 unsigned int useDestType = 0, useSideType = 0;
14569 struct Location oldyylloc = yylloc;
14570 unsigned int useSideUnit = 0;
14571 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14572 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14573
14574 switch(exp->__anon1.op.op)
14575 {
14576 case '=':
14577 case MUL_ASSIGN:
14578 case DIV_ASSIGN:
14579 case MOD_ASSIGN:
14580 case ADD_ASSIGN:
14581 case SUB_ASSIGN:
14582 case LEFT_ASSIGN:
14583 case RIGHT_ASSIGN:
14584 case AND_ASSIGN:
14585 case XOR_ASSIGN:
14586 case OR_ASSIGN:
14587 assign = 1;
14588 break;
14589 case '!':
14590 break;
14591 case AND_OP:
14592 case OR_OP:
14593 boolOps = 1;
14594 boolResult = 1;
14595 break;
14596 case EQ_OP:
14597 case '<':
14598 case '>':
14599 case LE_OP:
14600 case GE_OP:
14601 case NE_OP:
14602 boolResult = 1;
14603 useSideType = 1;
14604 break;
14605 case '+':
14606 case '-':
14607 useSideUnit = 1;
14608 useSideType = 1;
14609 useDestType = 1;
14610 break;
14611 case LEFT_OP:
14612 case RIGHT_OP:
14613 useSideType = 1;
14614 useDestType = 1;
14615 break;
14616 case '|':
14617 case '^':
14618 useSideType = 1;
14619 useDestType = 1;
14620 break;
14621 case '/':
14622 case '%':
14623 useSideType = 1;
14624 useDestType = 1;
14625 break;
14626 case '&':
14627 case '*':
14628 if(exp->__anon1.op.exp1)
14629 {
14630 useSideType = 1;
14631 useDestType = 1;
14632 }
14633 break;
14634 }
14635 if(exp->__anon1.op.op == '&')
14636 {
14637 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14638 {
14639 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14640 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14641
14642 if(symbol && symbol->isIterator == 2)
14643 {
14644 exp->type = 8;
14645 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14646 exp->__anon1.member.member = MkIdentifier("key");
14647 exp->expType = (((void *)0));
14648 exp->__anon1.op.exp2->expType = symbol->type;
14649 symbol->type->refCount++;
14650 ProcessExpressionType(exp);
14651 FreeType(dummy);
14652 break;
14653 }
14654 }
14655 }
14656 if(exp->__anon1.op.exp1)
14657 {
14658 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14659 useDestType = 0;
14660 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14661 {
14662 if(exp->__anon1.op.exp1->destType)
14663 FreeType(exp->__anon1.op.exp1->destType);
14664 exp->__anon1.op.exp1->destType = exp->destType;
14665 exp->__anon1.op.exp1->opDestType = 1;
14666 if(exp->destType)
14667 exp->destType->refCount++;
14668 }
14669 else if(!assign)
14670 {
14671 if(exp->__anon1.op.exp1->destType)
14672 FreeType(exp->__anon1.op.exp1->destType);
14673 exp->__anon1.op.exp1->destType = dummy;
14674 dummy->refCount++;
14675 }
14676 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14677 exp->__anon1.op.exp1->destType->count++;
14678 ProcessExpressionType(exp->__anon1.op.exp1);
14679 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14680 exp->__anon1.op.exp1->destType->count--;
14681 exp->__anon1.op.exp1->opDestType = 0;
14682 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)
14683 {
14684 exp->__anon1.op.exp2 = MkExpConstant("1");
14685 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14686 assign = 1;
14687 }
14688 if(exp->__anon1.op.exp1->destType == dummy)
14689 {
14690 FreeType(dummy);
14691 exp->__anon1.op.exp1->destType = (((void *)0));
14692 }
14693 type1 = exp->__anon1.op.exp1->expType;
14694 }
14695 if(exp->__anon1.op.exp2)
14696 {
14697 char expString[10240];
14698
14699 expString[0] = '\0';
14700 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14701 {
14702 if(exp->__anon1.op.exp1)
14703 {
14704 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14705 if(exp->__anon1.op.exp1->expType)
14706 exp->__anon1.op.exp1->expType->refCount++;
14707 }
14708 else
14709 {
14710 exp->__anon1.op.exp2->destType = exp->destType;
14711 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14712 exp->__anon1.op.exp2->opDestType = 1;
14713 if(exp->destType)
14714 exp->destType->refCount++;
14715 }
14716 if(type1)
14717 type1->refCount++;
14718 exp->expType = type1;
14719 }
14720 else if(assign)
14721 {
14722 if(inCompiler)
14723 PrintExpression(exp->__anon1.op.exp2, expString);
14724 if(type1 && type1->kind == 13)
14725 {
14726 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)
14727 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14728 else if(exp->__anon1.op.op == '=')
14729 {
14730 if(exp->__anon1.op.exp2->destType)
14731 FreeType(exp->__anon1.op.exp2->destType);
14732 exp->__anon1.op.exp2->destType = type1;
14733 if(type1)
14734 type1->refCount++;
14735 }
14736 }
14737 else
14738 {
14739 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)
14740 ;
14741 else
14742 {
14743 if(exp->__anon1.op.exp2->destType)
14744 FreeType(exp->__anon1.op.exp2->destType);
14745 exp->__anon1.op.exp2->destType = type1;
14746 if(type1)
14747 type1->refCount++;
14748 }
14749 }
14750 if(type1)
14751 type1->refCount++;
14752 exp->expType = type1;
14753 }
14754 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14755 {
14756 if(exp->__anon1.op.exp2->destType)
14757 FreeType(exp->__anon1.op.exp2->destType);
14758 exp->__anon1.op.exp2->destType = exp->destType;
14759 if(exp->__anon1.op.op != '&')
14760 exp->__anon1.op.exp2->opDestType = 1;
14761 if(exp->destType)
14762 exp->destType->refCount++;
14763 }
14764 else
14765 {
14766 if(exp->__anon1.op.exp2->destType)
14767 FreeType(exp->__anon1.op.exp2->destType);
14768 exp->__anon1.op.exp2->destType = dummy;
14769 dummy->refCount++;
14770 }
14771 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))
14772 {
14773 FreeType(exp->__anon1.op.exp2->destType);
14774 exp->__anon1.op.exp2->destType = type1;
14775 type1->refCount++;
14776 }
14777 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14778 exp->__anon1.op.exp2->destType->count++;
14779 if(exp->__anon1.op.op == SIZEOF)
14780 {
14781 struct Expression * e = exp->__anon1.op.exp2;
14782
14783 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14784 {
14785 if(e->type == 5 || e->type == 32 || e->type == 23)
14786 {
14787 if(e->type == 23)
14788 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14789 else
14790 e = (*e->__anon1.list).last;
14791 }
14792 }
14793 if(e->type == 11 && e->__anon1.cast.exp)
14794 e->__anon1.cast.exp->needCast = 1;
14795 }
14796 ProcessExpressionType(exp->__anon1.op.exp2);
14797 exp->__anon1.op.exp2->opDestType = 0;
14798 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14799 exp->__anon1.op.exp2->destType->count--;
14800 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14801 {
14802 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)
14803 {
14804 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14805 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14806 }
14807 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)))
14808 {
14809 if(exp->__anon1.op.op == ADD_ASSIGN)
14810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14811 }
14812 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))
14813 {
14814 if(exp->__anon1.op.op == ADD_ASSIGN)
14815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14816 }
14817 else if(inCompiler)
14818 {
14819 char type1String[1024];
14820 char type2String[1024];
14821
14822 type1String[0] = '\0';
14823 type2String[0] = '\0';
14824 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14825 PrintType(type1, type2String, 0, 1);
14826 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14827 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14828 }
14829 }
14830 if(exp->__anon1.op.exp2->destType == dummy)
14831 {
14832 FreeType(dummy);
14833 exp->__anon1.op.exp2->destType = (((void *)0));
14834 }
14835 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14836 {
14837 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14838 type2->refCount = 1;
14839 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14840 type2->isSigned = 1;
14841 }
14842 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))
14843 {
14844 type2 = __extension__ ({
14845 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14846
14847 __ecereInstance1->kind = 3, __ecereInstance1;
14848 });
14849 type2->refCount = 1;
14850 type2->isSigned = 1;
14851 }
14852 else
14853 {
14854 type2 = exp->__anon1.op.exp2->expType;
14855 if(type2)
14856 type2->refCount++;
14857 }
14858 }
14859 dummy->kind = 0;
14860 if(exp->__anon1.op.op == SIZEOF)
14861 {
14862 exp->expType = __extension__ ({
14863 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14864
14865 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14866 });
14867 exp->isConstant = 1;
14868 }
14869 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14870 {
14871 exp->expType = Dereference(type2);
14872 if(type2 && type2->kind == 8)
14873 notByReference = 1;
14874 }
14875 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14876 exp->expType = Reference(type2);
14877 else if(!assign)
14878 {
14879 if(boolOps)
14880 {
14881 if(exp->__anon1.op.exp1)
14882 {
14883 if(exp->__anon1.op.exp1->destType)
14884 FreeType(exp->__anon1.op.exp1->destType);
14885 exp->__anon1.op.exp1->destType = MkClassType("bool");
14886 exp->__anon1.op.exp1->destType->truth = 1;
14887 if(!exp->__anon1.op.exp1->expType)
14888 ProcessExpressionType(exp->__anon1.op.exp1);
14889 else
14890 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14891 FreeType(exp->__anon1.op.exp1->expType);
14892 exp->__anon1.op.exp1->expType = MkClassType("bool");
14893 exp->__anon1.op.exp1->expType->truth = 1;
14894 }
14895 if(exp->__anon1.op.exp2)
14896 {
14897 if(exp->__anon1.op.exp2->destType)
14898 FreeType(exp->__anon1.op.exp2->destType);
14899 exp->__anon1.op.exp2->destType = MkClassType("bool");
14900 exp->__anon1.op.exp2->destType->truth = 1;
14901 if(!exp->__anon1.op.exp2->expType)
14902 ProcessExpressionType(exp->__anon1.op.exp2);
14903 else
14904 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14905 FreeType(exp->__anon1.op.exp2->expType);
14906 exp->__anon1.op.exp2->expType = MkClassType("bool");
14907 exp->__anon1.op.exp2->expType->truth = 1;
14908 }
14909 }
14910 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")))))
14911 {
14912 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"))))
14913 {
14914 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)))
14915 {
14916 struct Type * intType;
14917
14918 if(!type1->__anon1._class->__anon1.registered->dataType)
14919 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14920 if(!type2->__anon1._class->__anon1.registered->dataType)
14921 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14922 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14923 if(exp->__anon1.op.exp1->destType)
14924 FreeType(exp->__anon1.op.exp1->destType);
14925 if(exp->__anon1.op.exp2->destType)
14926 FreeType(exp->__anon1.op.exp2->destType);
14927 exp->__anon1.op.exp1->destType = intType;
14928 exp->__anon1.op.exp2->destType = intType;
14929 intType->refCount++;
14930 }
14931 else
14932 {
14933 if(exp->__anon1.op.exp2->destType)
14934 FreeType(exp->__anon1.op.exp2->destType);
14935 exp->__anon1.op.exp2->destType = type1;
14936 type1->refCount++;
14937 if(exp->__anon1.op.exp1->destType)
14938 FreeType(exp->__anon1.op.exp1->destType);
14939 exp->__anon1.op.exp1->destType = type2;
14940 type2->refCount++;
14941 }
14942 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)
14943 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);
14944 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14945 {
14946 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14947
14948 if(argExp)
14949 {
14950 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14951
14952 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14953 ProcessExpressionType(exp->__anon1.op.exp1);
14954 if(type2->kind != 13)
14955 {
14956 ProcessExpressionType(classExp);
14957 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14958 if(!exp->__anon1.op.exp2->expType)
14959 {
14960 if(type2)
14961 FreeType(type2);
14962 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14963 type2->refCount++;
14964 }
14965 ProcessExpressionType(exp->__anon1.op.exp2);
14966 }
14967 }
14968 }
14969 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)))
14970 {
14971 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14973 exp->expType = type1;
14974 if(type1)
14975 type1->refCount++;
14976 }
14977 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)))
14978 {
14979 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14980 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14981 exp->expType = type2;
14982 if(type2)
14983 type2->refCount++;
14984 }
14985 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))
14986 {
14987 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14988 }
14989 else
14990 {
14991 unsigned int success = 0;
14992
14993 if(type1->kind == 13 && type2->kind == 13)
14994 {
14995 if(exp->__anon1.op.op == '+')
14996 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14997 else if(exp->__anon1.op.op == '-')
14998 {
14999 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
15000 {
15001 exp->expType = __extension__ ({
15002 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15003
15004 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15005 });
15006 success = 1;
15007 if(type1->__anon1.type->kind == 20)
15008 {
15009 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15010
15011 if(argExp)
15012 {
15013 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15014
15015 ProcessExpressionType(classExp);
15016 exp->type = 5;
15017 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"))));
15018 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15019 FreeType(dummy);
15020 return ;
15021 }
15022 }
15023 }
15024 }
15025 }
15026 if(!success && exp->__anon1.op.exp1->type == 2)
15027 {
15028 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15029 {
15030 if(exp->expType)
15031 FreeType(exp->expType);
15032 exp->expType = exp->__anon1.op.exp1->destType;
15033 if(exp->__anon1.op.exp1->destType)
15034 exp->__anon1.op.exp1->destType->refCount++;
15035 success = 1;
15036 }
15037 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15038 {
15039 if(exp->expType)
15040 FreeType(exp->expType);
15041 exp->expType = exp->__anon1.op.exp2->destType;
15042 if(exp->__anon1.op.exp2->destType)
15043 exp->__anon1.op.exp2->destType->refCount++;
15044 success = 1;
15045 }
15046 }
15047 else if(!success)
15048 {
15049 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15050 {
15051 if(exp->expType)
15052 FreeType(exp->expType);
15053 exp->expType = exp->__anon1.op.exp2->destType;
15054 if(exp->__anon1.op.exp2->destType)
15055 exp->__anon1.op.exp2->destType->refCount++;
15056 success = 1;
15057 }
15058 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15059 {
15060 if(exp->expType)
15061 FreeType(exp->expType);
15062 exp->expType = exp->__anon1.op.exp1->destType;
15063 if(exp->__anon1.op.exp1->destType)
15064 exp->__anon1.op.exp1->destType->refCount++;
15065 success = 1;
15066 }
15067 }
15068 if(!success)
15069 {
15070 char expString1[10240];
15071 char expString2[10240];
15072 char type1[1024];
15073 char type2[1024];
15074
15075 expString1[0] = '\0';
15076 expString2[0] = '\0';
15077 type1[0] = '\0';
15078 type2[0] = '\0';
15079 if(inCompiler)
15080 {
15081 PrintExpression(exp->__anon1.op.exp1, expString1);
15082 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15083 PrintExpression(exp->__anon1.op.exp2, expString2);
15084 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15085 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15086 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15087 }
15088 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15089 }
15090 }
15091 }
15092 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)
15093 {
15094 if(exp->__anon1.op.exp1->destType)
15095 FreeType(exp->__anon1.op.exp1->destType);
15096 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15097 if(type2->__anon1._class->__anon1.registered->dataType)
15098 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15099 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15100 exp->expType = type2;
15101 if(type2)
15102 type2->refCount++;
15103 }
15104 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)
15105 {
15106 if(exp->__anon1.op.exp2->destType)
15107 FreeType(exp->__anon1.op.exp2->destType);
15108 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15109 if(type1->__anon1._class->__anon1.registered->dataType)
15110 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15111 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15112 exp->expType = type1;
15113 if(type1)
15114 type1->refCount++;
15115 }
15116 else if(type1)
15117 {
15118 unsigned int valid = 0;
15119
15120 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15121 {
15122 if(exp->__anon1.op.exp2->destType)
15123 FreeType(exp->__anon1.op.exp2->destType);
15124 if(!type1->__anon1._class->__anon1.registered->dataType)
15125 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15126 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15127 exp->__anon1.op.exp2->destType->refCount++;
15128 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15129 if(type2)
15130 FreeType(type2);
15131 type2 = exp->__anon1.op.exp2->destType;
15132 if(type2)
15133 type2->refCount++;
15134 exp->expType = type2;
15135 type2->refCount++;
15136 }
15137 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15138 {
15139 if(exp->__anon1.op.exp1->destType)
15140 FreeType(exp->__anon1.op.exp1->destType);
15141 if(!type2->__anon1._class->__anon1.registered->dataType)
15142 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15143 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15144 exp->__anon1.op.exp1->destType->refCount++;
15145 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15146 type1 = exp->__anon1.op.exp1->destType;
15147 exp->expType = type1;
15148 type1->refCount++;
15149 }
15150 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15151 {
15152 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15153 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15154
15155 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15156 {
15157 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15158 {
15159 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15160 {
15161 if(exp->expType)
15162 FreeType(exp->expType);
15163 exp->expType = exp->__anon1.op.exp2->expType;
15164 if(exp->__anon1.op.exp2->expType)
15165 exp->__anon1.op.exp2->expType->refCount++;
15166 valid = 1;
15167 }
15168 }
15169 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15170 {
15171 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15172 {
15173 if(exp->expType)
15174 FreeType(exp->expType);
15175 exp->expType = exp->__anon1.op.exp1->expType;
15176 if(exp->__anon1.op.exp1->expType)
15177 exp->__anon1.op.exp1->expType->refCount++;
15178 valid = 1;
15179 }
15180 }
15181 }
15182 else
15183 {
15184 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15185 {
15186 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15187 {
15188 if(exp->expType)
15189 FreeType(exp->expType);
15190 exp->expType = exp->__anon1.op.exp1->expType;
15191 if(exp->__anon1.op.exp1->expType)
15192 exp->__anon1.op.exp1->expType->refCount++;
15193 valid = 1;
15194 }
15195 }
15196 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15197 {
15198 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15199 {
15200 if(exp->expType)
15201 FreeType(exp->expType);
15202 exp->expType = exp->__anon1.op.exp2->expType;
15203 if(exp->__anon1.op.exp2->expType)
15204 exp->__anon1.op.exp2->expType->refCount++;
15205 valid = 1;
15206 }
15207 }
15208 }
15209 }
15210 if(!valid)
15211 {
15212 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))
15213 {
15214 if(exp->__anon1.op.exp1->destType)
15215 FreeType(exp->__anon1.op.exp1->destType);
15216 exp->__anon1.op.exp1->destType = type2;
15217 type2->refCount++;
15218 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15219 {
15220 if(exp->expType)
15221 FreeType(exp->expType);
15222 exp->expType = exp->__anon1.op.exp1->destType;
15223 if(exp->__anon1.op.exp1->destType)
15224 exp->__anon1.op.exp1->destType->refCount++;
15225 }
15226 }
15227 else
15228 {
15229 if(exp->__anon1.op.exp2->destType)
15230 FreeType(exp->__anon1.op.exp2->destType);
15231 exp->__anon1.op.exp2->destType = type1;
15232 type1->refCount++;
15233 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15234 {
15235 if(exp->expType)
15236 FreeType(exp->expType);
15237 exp->expType = exp->__anon1.op.exp2->destType;
15238 if(exp->__anon1.op.exp2->destType)
15239 exp->__anon1.op.exp2->destType->refCount++;
15240 }
15241 else if(type1 && type2)
15242 {
15243 char expString1[10240];
15244 char expString2[10240];
15245 char type1String[1024];
15246 char type2String[1024];
15247
15248 expString1[0] = '\0';
15249 expString2[0] = '\0';
15250 type1String[0] = '\0';
15251 type2String[0] = '\0';
15252 if(inCompiler)
15253 {
15254 PrintExpression(exp->__anon1.op.exp1, expString1);
15255 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15256 PrintExpression(exp->__anon1.op.exp2, expString2);
15257 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15258 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15259 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15260 }
15261 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15262 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15263 {
15264 exp->expType = exp->__anon1.op.exp1->expType;
15265 if(exp->__anon1.op.exp1->expType)
15266 exp->__anon1.op.exp1->expType->refCount++;
15267 }
15268 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15269 {
15270 exp->expType = exp->__anon1.op.exp2->expType;
15271 if(exp->__anon1.op.exp2->expType)
15272 exp->__anon1.op.exp2->expType->refCount++;
15273 }
15274 }
15275 }
15276 }
15277 }
15278 else if(type2)
15279 {
15280 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15281 {
15282 struct Type * oldType = exp->__anon1.op.exp1->expType;
15283
15284 exp->__anon1.op.exp1->expType = (((void *)0));
15285 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15286 FreeType(oldType);
15287 else
15288 exp->__anon1.op.exp1->expType = oldType;
15289 }
15290 if(exp->__anon1.op.exp1->destType)
15291 FreeType(exp->__anon1.op.exp1->destType);
15292 exp->__anon1.op.exp1->destType = type2;
15293 type2->refCount++;
15294 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15295 {
15296 if(exp->expType)
15297 FreeType(exp->expType);
15298 exp->expType = exp->__anon1.op.exp1->destType;
15299 if(exp->__anon1.op.exp1->destType)
15300 exp->__anon1.op.exp1->destType->refCount++;
15301 }
15302 }
15303 }
15304 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15305 {
15306 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15307 {
15308 if(exp->__anon1.op.exp1->destType)
15309 FreeType(exp->__anon1.op.exp1->destType);
15310 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15311 if(type2->__anon1._class->__anon1.registered->dataType)
15312 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15313 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15314 }
15315 if(exp->__anon1.op.op == '!')
15316 {
15317 exp->expType = MkClassType("bool");
15318 exp->expType->truth = 1;
15319 }
15320 else
15321 {
15322 exp->expType = type2;
15323 if(type2)
15324 type2->refCount++;
15325 }
15326 }
15327 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15328 {
15329 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15330 {
15331 if(exp->__anon1.op.exp2->destType)
15332 FreeType(exp->__anon1.op.exp2->destType);
15333 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15334 if(type1->__anon1._class->__anon1.registered->dataType)
15335 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15336 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15337 }
15338 exp->expType = type1;
15339 if(type1)
15340 type1->refCount++;
15341 }
15342 }
15343 yylloc = exp->loc;
15344 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15345 {
15346 char expString[10000];
15347
15348 expString[0] = '\0';
15349 if(inCompiler)
15350 {
15351 PrintExpression(exp->__anon1.op.exp1, expString);
15352 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15353 }
15354 if(expString[0])
15355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15356 }
15357 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15358 {
15359 char expString[10240];
15360
15361 expString[0] = '\0';
15362 if(inCompiler)
15363 {
15364 PrintExpression(exp->__anon1.op.exp2, expString);
15365 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15366 }
15367 if(expString[0])
15368 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15369 }
15370 if(boolResult)
15371 {
15372 FreeType(exp->expType);
15373 exp->expType = MkClassType("bool");
15374 exp->expType->truth = 1;
15375 }
15376 if(exp->__anon1.op.op != SIZEOF)
15377 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15378 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15379 {
15380 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15381 }
15382 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15383 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15384 yylloc = oldyylloc;
15385 FreeType(dummy);
15386 if(type2)
15387 FreeType(type2);
15388 break;
15389 }
15390 case 5:
15391 case 32:
15392 {
15393 struct Expression * e;
15394
15395 exp->isConstant = 1;
15396 for(e = (*exp->__anon1.list).first; e; e = e->next)
15397 {
15398 unsigned int inced = 0;
15399
15400 if(!e->next)
15401 {
15402 FreeType(e->destType);
15403 e->opDestType = exp->opDestType;
15404 e->destType = exp->destType;
15405 if(e->destType)
15406 {
15407 exp->destType->refCount++;
15408 e->destType->count++;
15409 inced = 1;
15410 }
15411 }
15412 ProcessExpressionType(e);
15413 if(inced)
15414 exp->destType->count--;
15415 if(!exp->expType && !e->next)
15416 {
15417 exp->expType = e->expType;
15418 if(e->expType)
15419 e->expType->refCount++;
15420 }
15421 if(!e->isConstant)
15422 exp->isConstant = 0;
15423 }
15424 e = (*exp->__anon1.list).first;
15425 if(!e->next && e->type == 8)
15426 {
15427 struct Expression * next = exp->next, * prev = exp->prev;
15428
15429 FreeType(exp->expType);
15430 FreeType(exp->destType);
15431 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15432 *exp = *e;
15433 exp->prev = prev;
15434 exp->next = next;
15435 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15436 ProcessExpressionType(exp);
15437 }
15438 break;
15439 }
15440 case 6:
15441 {
15442 struct Expression * e;
15443
15444 exp->isConstant = 1;
15445 ProcessExpressionType(exp->__anon1.index.exp);
15446 if(!exp->__anon1.index.exp->isConstant)
15447 exp->isConstant = 0;
15448 if(exp->__anon1.index.exp->expType)
15449 {
15450 struct Type * source = exp->__anon1.index.exp->expType;
15451
15452 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15453 {
15454 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15455 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15456
15457 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15458 {
15459 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15460 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15461 {
15462 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15463
15464 if(type->kind == 8)
15465 type->constant = 1;
15466 else if(type->kind == 13)
15467 {
15468 struct Type * t = type;
15469
15470 while(t->kind == 13)
15471 t = t->__anon1.type;
15472 t->constant = 1;
15473 }
15474 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15475 }
15476 }
15477 }
15478 }
15479 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15480 {
15481 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15482 {
15483 if(e->destType)
15484 FreeType(e->destType);
15485 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15486 }
15487 ProcessExpressionType(e);
15488 if(!e->next)
15489 {
15490 }
15491 if(!e->isConstant)
15492 exp->isConstant = 0;
15493 }
15494 if(!exp->expType)
15495 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15496 if(exp->expType)
15497 DeclareType(exp->expType, 0, 0);
15498 break;
15499 }
15500 case 7:
15501 {
15502 struct Expression * e;
15503 struct Type * functionType;
15504 struct Type * methodType = (((void *)0));
15505 char name[1024];
15506
15507 name[0] = '\0';
15508 if(inCompiler)
15509 {
15510 PrintExpression(exp->__anon1.call.exp, name);
15511 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15512 {
15513 PrintExpression(exp->__anon1.call.exp, name);
15514 }
15515 }
15516 if(exp->__anon1.call.exp->type == 0)
15517 {
15518 struct Expression * idExp = exp->__anon1.call.exp;
15519 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15520
15521 if(!strcmp(id->string, "__builtin_frame_address"))
15522 {
15523 exp->expType = ProcessTypeString("void *", 1);
15524 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15525 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15526 break;
15527 }
15528 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15529 {
15530 exp->expType = ProcessTypeString("int", 1);
15531 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15532 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15533 break;
15534 }
15535 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15536 {
15537 struct Expression * a = (((void *)0));
15538 struct Expression * b = (((void *)0));
15539 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15540
15541 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15542 {
15543 a = (*exp->__anon1.call.arguments).first;
15544 b = (*exp->__anon1.call.arguments).last;
15545 tempExp1 = a;
15546 tempExp2 = b;
15547 }
15548 else if((*exp->__anon1.call.arguments).count == 1)
15549 {
15550 a = (*exp->__anon1.call.arguments).first;
15551 tempExp1 = a;
15552 }
15553 if(a)
15554 {
15555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15556 idExp->__anon1.__anon1.identifier = (((void *)0));
15557 FreeExpContents(exp);
15558 ProcessExpressionType(a);
15559 if(b)
15560 ProcessExpressionType(b);
15561 exp->type = 5;
15562 exp->__anon1.list = MkList();
15563 if(a->expType && (!b || b->expType))
15564 {
15565 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15566 {
15567 if(inCompiler)
15568 {
15569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15570 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15571 struct Declaration * decl;
15572 char temp1[1024], temp2[1024];
15573
15574 GetTypeSpecs(a->expType, specs);
15575 if(a && !a->isConstant && a->type != 0)
15576 {
15577 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15578 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15579 tempExp1 = QMkExpId(temp1);
15580 tempExp1->expType = a->expType;
15581 if(a->expType)
15582 a->expType->refCount++;
15583 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15584 }
15585 if(b && !b->isConstant && b->type != 0)
15586 {
15587 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15588 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15589 tempExp2 = QMkExpId(temp2);
15590 tempExp2->expType = b->expType;
15591 if(b->expType)
15592 b->expType->refCount++;
15593 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15594 }
15595 decl = MkDeclaration(specs, decls);
15596 if(!curCompound->__anon1.compound.declarations)
15597 curCompound->__anon1.compound.declarations = MkList();
15598 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15599 }
15600 }
15601 }
15602 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15603 {
15604 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15605
15606 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15607 exp->expType = a->expType;
15608 if(a->expType)
15609 a->expType->refCount++;
15610 }
15611 else if(!strcmp(id->string, "Abs"))
15612 {
15613 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15614 exp->expType = a->expType;
15615 if(a->expType)
15616 a->expType->refCount++;
15617 }
15618 else if(!strcmp(id->string, "Sgn"))
15619 {
15620 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"))))));
15621 exp->expType = ProcessTypeString("int", 0);
15622 }
15623 FreeExpression(tempExp1);
15624 if(tempExp2)
15625 FreeExpression(tempExp2);
15626 FreeIdentifier(id);
15627 break;
15628 }
15629 }
15630 }
15631 {
15632 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15633
15634 if(!exp->__anon1.call.exp->destType)
15635 {
15636 exp->__anon1.call.exp->destType = dummy;
15637 dummy->refCount++;
15638 }
15639 ProcessExpressionType(exp->__anon1.call.exp);
15640 if(exp->__anon1.call.exp->destType == dummy)
15641 {
15642 FreeType(dummy);
15643 exp->__anon1.call.exp->destType = (((void *)0));
15644 }
15645 FreeType(dummy);
15646 }
15647 functionType = exp->__anon1.call.exp->expType;
15648 if(functionType && functionType->kind == 16)
15649 {
15650 methodType = functionType;
15651 functionType = methodType->__anon1.__anon3.method->dataType;
15652 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15653 {
15654 char typeString[1024];
15655
15656 typeString[0] = '\0';
15657 {
15658 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15659
15660 functionType->__anon1.__anon2.thisClass = (((void *)0));
15661 PrintType(functionType, typeString, 1, 1);
15662 functionType->__anon1.__anon2.thisClass = back;
15663 }
15664 if(strstr(typeString, "thisclass"))
15665 {
15666 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15667 struct Declarator * decl;
15668
15669 {
15670 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15671
15672 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15673 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))
15674 thisClassParams = 0;
15675 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15676 {
15677 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15678
15679 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15680 ProcessDeclarator(decl);
15681 thisClass = backupThisClass;
15682 }
15683 thisClassParams = 1;
15684 functionType = ProcessType(specs, decl);
15685 functionType->refCount = 0;
15686 FinishTemplatesContext(context);
15687 }
15688 FreeList(specs, (void *)(FreeSpecifier));
15689 FreeDeclarator(decl);
15690 }
15691 }
15692 }
15693 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15694 {
15695 struct Type * type = functionType->__anon1.type;
15696
15697 if(!functionType->refCount)
15698 {
15699 functionType->__anon1.type = (((void *)0));
15700 FreeType(functionType);
15701 }
15702 functionType = type;
15703 }
15704 if(functionType && functionType->kind != 11)
15705 {
15706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15707 }
15708 else if(functionType)
15709 {
15710 unsigned int emptyParams = 0, noParams = 0;
15711 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15712 struct Type * type = functionType->__anon1.__anon2.params.first;
15713 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15714 int extra = 0;
15715 struct Location oldyylloc = yylloc;
15716
15717 if(!type)
15718 emptyParams = 1;
15719 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15720 {
15721 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15722 e = e->next;
15723 }
15724 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15725 {
15726 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)
15727 {
15728 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15729 if(e)
15730 {
15731 e->destType = type;
15732 e = e->next;
15733 type = functionType->__anon1.__anon2.params.first;
15734 }
15735 else
15736 type->refCount = 0;
15737 }
15738 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15739 {
15740 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15741 type->byReference = functionType->byReference;
15742 type->typedByReference = functionType->typedByReference;
15743 if(e)
15744 {
15745 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15746 e = e->next;
15747 e->destType = type;
15748 e = e->next;
15749 type = functionType->__anon1.__anon2.params.first;
15750 }
15751 else
15752 type->refCount = 0;
15753 }
15754 }
15755 if(type && type->kind == 0)
15756 {
15757 noParams = 1;
15758 if(!type->refCount)
15759 FreeType(type);
15760 type = (((void *)0));
15761 }
15762 for(; e; e = e->next)
15763 {
15764 if(!type && !emptyParams)
15765 {
15766 yylloc = e->loc;
15767 if(methodType && methodType->__anon1.__anon3.methodClass)
15768 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);
15769 else
15770 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);
15771 break;
15772 }
15773 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15774 {
15775 struct Type * templatedType = (((void *)0));
15776 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15777 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15778 int id = 0;
15779
15780 if(_class && _class->templateArgs)
15781 {
15782 struct __ecereNameSpace__ecere__com__Class * sClass;
15783
15784 for(sClass = _class; sClass; sClass = sClass->base)
15785 {
15786 if(sClass->templateClass)
15787 sClass = sClass->templateClass;
15788 id = 0;
15789 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15790 {
15791 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15792 {
15793 struct __ecereNameSpace__ecere__com__Class * nextClass;
15794
15795 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15796 {
15797 if(nextClass->templateClass)
15798 nextClass = nextClass->templateClass;
15799 id += nextClass->templateParams.count;
15800 }
15801 break;
15802 }
15803 id++;
15804 }
15805 if(curParam)
15806 break;
15807 }
15808 }
15809 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15810 {
15811 unsigned int constant = type->constant;
15812 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15813
15814 {
15815 struct Context * context = SetupTemplatesContext(_class);
15816
15817 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15818 FinishTemplatesContext(context);
15819 }
15820 if(templatedType->kind == 8 && constant)
15821 templatedType->constant = 1;
15822 else if(templatedType->kind == 13)
15823 {
15824 struct Type * t = templatedType->__anon1.type;
15825
15826 while(t->kind == 13)
15827 t = t->__anon1.type;
15828 if(constant)
15829 t->constant = constant;
15830 }
15831 e->destType = templatedType;
15832 if(templatedType)
15833 {
15834 templatedType->passAsTemplate = 1;
15835 }
15836 }
15837 else
15838 {
15839 e->destType = type;
15840 if(type)
15841 type->refCount++;
15842 }
15843 }
15844 else
15845 {
15846 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15847 {
15848 e->destType = type->prev;
15849 e->destType->refCount++;
15850 }
15851 else
15852 {
15853 e->destType = type;
15854 if(type)
15855 type->refCount++;
15856 }
15857 }
15858 if(type && type->kind != 14)
15859 {
15860 struct Type * next = type->next;
15861
15862 if(!type->refCount)
15863 FreeType(type);
15864 type = next;
15865 }
15866 }
15867 if(type && type->kind != 14)
15868 {
15869 if(methodType && methodType->__anon1.__anon3.methodClass)
15870 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);
15871 else
15872 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);
15873 }
15874 yylloc = oldyylloc;
15875 if(type && !type->refCount)
15876 FreeType(type);
15877 }
15878 else
15879 {
15880 functionType = __extension__ ({
15881 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15882
15883 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15884 });
15885 if(exp->__anon1.call.exp->type == 0)
15886 {
15887 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15888
15889 if(inCompiler)
15890 {
15891 struct Symbol * symbol;
15892 struct Location oldyylloc = yylloc;
15893
15894 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15895 if(strstr(string, "__builtin_") == string)
15896 {
15897 if(exp->destType)
15898 {
15899 functionType->__anon1.__anon2.returnType = exp->destType;
15900 exp->destType->refCount++;
15901 }
15902 }
15903 else
15904 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15905 symbol = __extension__ ({
15906 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15907
15908 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15909 });
15910 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15911 if(strstr(symbol->string, "::"))
15912 globalContext->hasNameSpace = 1;
15913 yylloc = oldyylloc;
15914 }
15915 }
15916 else if(exp->__anon1.call.exp->type == 8)
15917 {
15918 }
15919 else
15920 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15921 if(!functionType->__anon1.__anon2.returnType)
15922 {
15923 functionType->__anon1.__anon2.returnType = __extension__ ({
15924 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15925
15926 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15927 });
15928 }
15929 }
15930 if(functionType && functionType->kind == 11)
15931 {
15932 exp->expType = functionType->__anon1.__anon2.returnType;
15933 if(functionType->__anon1.__anon2.returnType)
15934 functionType->__anon1.__anon2.returnType->refCount++;
15935 if(!functionType->refCount)
15936 FreeType(functionType);
15937 }
15938 if(exp->__anon1.call.arguments)
15939 {
15940 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15941 ProcessExpressionType(e);
15942 }
15943 break;
15944 }
15945 case 8:
15946 {
15947 struct Type * type;
15948 struct Location oldyylloc = yylloc;
15949 unsigned int thisPtr;
15950 struct Expression * checkExp = exp->__anon1.member.exp;
15951
15952 while(checkExp)
15953 {
15954 if(checkExp->type == 11)
15955 checkExp = checkExp->__anon1.cast.exp;
15956 else if(checkExp->type == 5)
15957 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15958 else
15959 break;
15960 }
15961 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15962 exp->thisPtr = thisPtr;
15963 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15964 {
15965 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15966 }
15967 ProcessExpressionType(exp->__anon1.member.exp);
15968 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)
15969 {
15970 exp->isConstant = 0;
15971 }
15972 else
15973 exp->isConstant = exp->__anon1.member.exp->isConstant;
15974 type = exp->__anon1.member.exp->expType;
15975 yylloc = exp->loc;
15976 if(type && (type->kind == 20))
15977 {
15978 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15979 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15980
15981 if(_class)
15982 {
15983 for(param = _class->templateParams.first; param; param = param->next)
15984 {
15985 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15986 break;
15987 }
15988 }
15989 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15990 {
15991 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15992
15993 if(argExp)
15994 {
15995 struct Expression * expMember = exp->__anon1.member.exp;
15996 struct Declarator * decl;
15997 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15998 char thisClassTypeString[1024];
15999
16000 FreeIdentifier(exp->__anon1.member.member);
16001 ProcessExpressionType(argExp);
16002 {
16003 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16004
16005 if(colon)
16006 {
16007 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16008 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16009 }
16010 else
16011 strcpy(thisClassTypeString, _class->fullName);
16012 }
16013 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16014 exp->expType = ProcessType(specs, decl);
16015 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16016 {
16017 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16018 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16019 int paramCount = 0;
16020 int lastParam = -1;
16021 char templateString[1024];
16022 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16023
16024 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16025 for(cClass = expClass; cClass; cClass = cClass->base)
16026 {
16027 int p = 0;
16028
16029 for(param = cClass->templateParams.first; param; param = param->next)
16030 {
16031 int id = p;
16032 struct __ecereNameSpace__ecere__com__Class * sClass;
16033 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16034
16035 for(sClass = cClass->base; sClass; sClass = sClass->base)
16036 id += sClass->templateParams.count;
16037 arg = expClass->templateArgs[id];
16038 for(sClass = _class; sClass; sClass = sClass->base)
16039 {
16040 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16041 int p = 0;
16042 struct __ecereNameSpace__ecere__com__Class * nextClass;
16043
16044 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16045 p += nextClass->templateParams.count;
16046 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16047 {
16048 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16049 {
16050 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16051 {
16052 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16053 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16054 break;
16055 }
16056 }
16057 }
16058 }
16059 {
16060 char argument[256];
16061
16062 argument[0] = '\0';
16063 switch(param->type)
16064 {
16065 case 2:
16066 {
16067 char expString[1024];
16068 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16069 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16070 struct Expression * exp;
16071 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16072
16073 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16074 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16075 ProcessExpressionType(exp);
16076 ComputeExpression(exp);
16077 expString[0] = '\0';
16078 PrintExpression(exp, expString);
16079 strcat(argument, expString);
16080 FreeExpression(exp);
16081 break;
16082 }
16083 case 1:
16084 {
16085 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16086 break;
16087 }
16088 case 0:
16089 {
16090 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16091 {
16092 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16093 strcat(argument, thisClassTypeString);
16094 else
16095 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16096 }
16097 break;
16098 }
16099 }
16100 if(argument[0])
16101 {
16102 if(paramCount)
16103 strcat(templateString, ", ");
16104 if(lastParam != p - 1)
16105 {
16106 strcat(templateString, param->name);
16107 strcat(templateString, " = ");
16108 }
16109 strcat(templateString, argument);
16110 paramCount++;
16111 lastParam = p;
16112 }
16113 p++;
16114 }
16115 }
16116 }
16117 {
16118 int len = strlen(templateString);
16119
16120 if(templateString[len - 1] == '>')
16121 templateString[len++] = ' ';
16122 templateString[len++] = '>';
16123 templateString[len++] = '\0';
16124 }
16125 {
16126 struct Context * context = SetupTemplatesContext(_class);
16127
16128 FreeType(exp->expType);
16129 exp->expType = ProcessTypeString(templateString, 0);
16130 FinishTemplatesContext(context);
16131 }
16132 }
16133 exp->type = 5;
16134 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")))))))));
16135 }
16136 }
16137 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16138 {
16139 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16140 }
16141 }
16142 if(type && (type->kind == 20))
16143 ;
16144 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)))
16145 {
16146 struct Identifier * id = exp->__anon1.member.member;
16147 int typeKind = type->kind;
16148 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));
16149
16150 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16151 {
16152 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16153 typeKind = 8;
16154 }
16155 if(id)
16156 {
16157 if(typeKind == 3 || typeKind == 15)
16158 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16159 else if(!_class)
16160 {
16161 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16162 {
16163 _class = type->__anon1._class->__anon1.registered;
16164 }
16165 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16166 {
16167 _class = FindClass("char *")->__anon1.registered;
16168 }
16169 else if(type->kind == 13)
16170 {
16171 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16172 FreeType(exp->expType);
16173 exp->expType = ProcessTypeString("uintptr", 0);
16174 exp->byReference = 1;
16175 }
16176 else
16177 {
16178 char string[1024] = "";
16179 struct Symbol * classSym;
16180
16181 PrintTypeNoConst(type, string, 0, 1);
16182 classSym = FindClass(string);
16183 if(classSym)
16184 _class = classSym->__anon1.registered;
16185 }
16186 }
16187 }
16188 if(_class && id)
16189 {
16190 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16191 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16192 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16193 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16194 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16195
16196 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16197 exp->__anon1.member.memberType = 1;
16198 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16200 if(typeKind != 19)
16201 {
16202 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16203 {
16204 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16205 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16206 {
16207 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16208 if(prop)
16209 member = (((void *)0));
16210 }
16211 if(!member && !prop)
16212 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16213 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16214 exp->__anon1.member.thisPtr = 1;
16215 }
16216 else
16217 {
16218 unsigned int useMemberForNonConst = 0;
16219
16220 if(!id->classSym)
16221 {
16222 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16223 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);
16224 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16225 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16226 }
16227 if((!prop || useMemberForNonConst) && !member)
16228 {
16229 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16230 if(!method)
16231 {
16232 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16233 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);
16234 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16235 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16236 }
16237 }
16238 if(member && prop)
16239 {
16240 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16241 prop = (((void *)0));
16242 else
16243 member = (((void *)0));
16244 }
16245 }
16246 }
16247 if(!prop && !member && !method)
16248 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16249 if(!prop && !member && !method)
16250 {
16251 if(typeKind == 19)
16252 {
16253 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16254 if(classProp)
16255 {
16256 exp->__anon1.member.memberType = 5;
16257 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16258 }
16259 else
16260 {
16261 char structName[1024];
16262 struct Identifier * id = exp->__anon1.member.member;
16263 struct Expression * classExp = exp->__anon1.member.exp;
16264
16265 type->refCount++;
16266 FreeType(classExp->expType);
16267 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16268 strcpy(structName, "__ecereClassData_");
16269 FullClassNameCat(structName, type->__anon1._class->string, 0);
16270 exp->type = 9;
16271 exp->__anon1.member.member = id;
16272 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"))))))));
16273 FreeType(type);
16274 ProcessExpressionType(exp);
16275 return ;
16276 }
16277 }
16278 else
16279 {
16280 struct Symbol * classSym = FindClass(id->string);
16281
16282 if(classSym)
16283 {
16284 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16285
16286 if(convertClass)
16287 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16288 }
16289 }
16290 }
16291 if(exp->__anon1.member.exp->destType)
16292 FreeType(exp->__anon1.member.exp->destType);
16293 {
16294 if(method && !method->_class->symbol)
16295 method->_class->symbol = FindClass(method->_class->fullName);
16296 if(prop && !prop->_class->symbol)
16297 prop->_class->symbol = FindClass(prop->_class->fullName);
16298 exp->__anon1.member.exp->destType = __extension__ ({
16299 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16300
16301 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16302 });
16303 }
16304 if(prop)
16305 {
16306 exp->__anon1.member.memberType = 1;
16307 if(!prop->dataType)
16308 ProcessPropertyType(prop);
16309 exp->expType = prop->dataType;
16310 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16311 {
16312 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16313
16314 CopyTypeInto(type, exp->expType);
16315 type->refCount = 1;
16316 type->constant = 1;
16317 exp->expType = type;
16318 }
16319 else if(prop->dataType)
16320 prop->dataType->refCount++;
16321 }
16322 else if(member)
16323 {
16324 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16325 {
16326 FreeExpContents(exp);
16327 exp->type = 0;
16328 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16329 ProcessExpressionType(exp);
16330 return ;
16331 }
16332 exp->__anon1.member.memberType = 3;
16333 DeclareStruct(_class->fullName, 0);
16334 if(!member->dataType)
16335 {
16336 struct Context * context = SetupTemplatesContext(_class);
16337
16338 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16339 FinishTemplatesContext(context);
16340 }
16341 exp->expType = member->dataType;
16342 if(member->dataType)
16343 member->dataType->refCount++;
16344 }
16345 else if(revConvert)
16346 {
16347 exp->__anon1.member.memberType = 4;
16348 exp->expType = MkClassType(revConvert->_class->fullName);
16349 }
16350 else if(method)
16351 {
16352 {
16353 exp->__anon1.member.memberType = 2;
16354 }
16355 if(!method->dataType)
16356 ProcessMethodType(method);
16357 exp->expType = __extension__ ({
16358 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16359
16360 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16361 });
16362 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16363 exp->expType->__anon1.__anon3.usedClass = _class;
16364 }
16365 else if(!classProp)
16366 {
16367 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16368 {
16369 FreeExpContents(exp);
16370 exp->type = 0;
16371 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16372 FreeType(exp->expType);
16373 exp->expType = MkClassType("ecere::com::Class");
16374 return ;
16375 }
16376 yylloc = exp->__anon1.member.member->loc;
16377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16378 if(inCompiler)
16379 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16380 }
16381 if(_class && exp->expType)
16382 {
16383 struct __ecereNameSpace__ecere__com__Class * tClass;
16384
16385 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16386 while(tClass && !tClass->templateClass)
16387 tClass = tClass->base;
16388 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16389 {
16390 int id = 0;
16391 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16392 struct __ecereNameSpace__ecere__com__Class * sClass;
16393
16394 for(sClass = tClass; sClass; sClass = sClass->base)
16395 {
16396 id = 0;
16397 if(sClass->templateClass)
16398 sClass = sClass->templateClass;
16399 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16400 {
16401 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16402 {
16403 for(sClass = sClass->base; sClass; sClass = sClass->base)
16404 id += sClass->templateParams.count;
16405 break;
16406 }
16407 id++;
16408 }
16409 if(curParam)
16410 break;
16411 }
16412 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16413 {
16414 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16415 struct Context * context = SetupTemplatesContext(tClass);
16416 unsigned int constant = exp->expType->constant;
16417
16418 FreeType(exp->expType);
16419 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16420 if(exp->expType->kind == 8 && constant)
16421 exp->expType->constant = 1;
16422 else if(exp->expType->kind == 13)
16423 {
16424 struct Type * t = exp->expType->__anon1.type;
16425
16426 while(t->kind == 13)
16427 t = t->__anon1.type;
16428 if(constant)
16429 t->constant = constant;
16430 }
16431 if(exp->expType)
16432 {
16433 if(exp->expType->kind == 21)
16434 {
16435 FreeType(exp->expType);
16436 exp->expType = ReplaceThisClassType(_class);
16437 }
16438 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16439 exp->expType->passAsTemplate = 1;
16440 if(!exp->destType)
16441 {
16442 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16443 if(exp->destType->kind == 8 && constant)
16444 exp->destType->constant = 1;
16445 else if(exp->destType->kind == 13)
16446 {
16447 struct Type * t = exp->destType->__anon1.type;
16448
16449 while(t->kind == 13)
16450 t = t->__anon1.type;
16451 if(constant)
16452 t->constant = constant;
16453 }
16454 if(exp->destType->kind == 21)
16455 {
16456 FreeType(exp->destType);
16457 exp->destType = ReplaceThisClassType(_class);
16458 }
16459 }
16460 }
16461 FinishTemplatesContext(context);
16462 }
16463 }
16464 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)
16465 {
16466 int id = 0;
16467 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16468 struct __ecereNameSpace__ecere__com__Class * sClass;
16469
16470 for(sClass = tClass; sClass; sClass = sClass->base)
16471 {
16472 id = 0;
16473 if(sClass->templateClass)
16474 sClass = sClass->templateClass;
16475 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16476 {
16477 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16478 {
16479 for(sClass = sClass->base; sClass; sClass = sClass->base)
16480 id += sClass->templateParams.count;
16481 break;
16482 }
16483 id++;
16484 }
16485 if(curParam)
16486 break;
16487 }
16488 if(curParam)
16489 {
16490 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16491 struct Context * context = SetupTemplatesContext(tClass);
16492 struct Type * basicType;
16493
16494 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16495 if(basicType)
16496 {
16497 if(basicType->kind == 21)
16498 {
16499 FreeType(basicType);
16500 basicType = ReplaceThisClassType(_class);
16501 }
16502 FreeType(exp->expType);
16503 exp->expType = __extension__ ({
16504 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16505
16506 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16507 });
16508 if(!exp->destType)
16509 {
16510 exp->destType = exp->expType;
16511 exp->destType->refCount++;
16512 }
16513 {
16514 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16515 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16516 struct Declarator * decl;
16517
16518 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16519 *newExp = *exp;
16520 if(exp->destType)
16521 exp->destType->refCount++;
16522 if(exp->expType)
16523 exp->expType->refCount++;
16524 exp->type = 11;
16525 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16526 exp->__anon1.cast.exp = newExp;
16527 }
16528 }
16529 FinishTemplatesContext(context);
16530 }
16531 }
16532 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16533 {
16534 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16535
16536 if(expClass)
16537 {
16538 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16539 int p = 0;
16540 int paramCount = 0;
16541 int lastParam = -1;
16542 char templateString[1024];
16543 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16544
16545 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16546 while(cClass != expClass)
16547 {
16548 struct __ecereNameSpace__ecere__com__Class * sClass;
16549
16550 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16551 ;
16552 cClass = sClass;
16553 for(param = cClass->templateParams.first; param; param = param->next)
16554 {
16555 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16556 int cp = 0;
16557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16558 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16559
16560 while(cClassCur != tClass && !paramCur)
16561 {
16562 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16563
16564 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16565 ;
16566 cClassCur = sClassCur;
16567 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16568 {
16569 if(!strcmp(paramCur->name, param->name))
16570 {
16571 break;
16572 }
16573 cp++;
16574 }
16575 }
16576 if(paramCur && paramCur->type == 0)
16577 arg = tClass->templateArgs[cp];
16578 else
16579 arg = expClass->templateArgs[p];
16580 {
16581 char argument[256];
16582
16583 argument[0] = '\0';
16584 switch(param->type)
16585 {
16586 case 2:
16587 {
16588 char expString[1024];
16589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16590 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16591 struct Expression * exp;
16592 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16593
16594 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16595 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16596 ProcessExpressionType(exp);
16597 ComputeExpression(exp);
16598 expString[0] = '\0';
16599 PrintExpression(exp, expString);
16600 strcat(argument, expString);
16601 FreeExpression(exp);
16602 break;
16603 }
16604 case 1:
16605 {
16606 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16607 break;
16608 }
16609 case 0:
16610 {
16611 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16612 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16613 break;
16614 }
16615 }
16616 if(argument[0])
16617 {
16618 if(paramCount)
16619 strcat(templateString, ", ");
16620 if(lastParam != p - 1)
16621 {
16622 strcat(templateString, param->name);
16623 strcat(templateString, " = ");
16624 }
16625 strcat(templateString, argument);
16626 paramCount++;
16627 lastParam = p;
16628 }
16629 }
16630 p++;
16631 }
16632 }
16633 {
16634 int len = strlen(templateString);
16635
16636 if(templateString[len - 1] == '>')
16637 templateString[len++] = ' ';
16638 templateString[len++] = '>';
16639 templateString[len++] = '\0';
16640 }
16641 FreeType(exp->expType);
16642 {
16643 struct Context * context = SetupTemplatesContext(tClass);
16644
16645 exp->expType = ProcessTypeString(templateString, 0);
16646 FinishTemplatesContext(context);
16647 }
16648 }
16649 }
16650 }
16651 }
16652 else
16653 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)");
16654 }
16655 else if(type && (type->kind == 9 || type->kind == 10))
16656 {
16657 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16658
16659 if(memberType)
16660 {
16661 exp->expType = memberType;
16662 if(memberType)
16663 memberType->refCount++;
16664 }
16665 }
16666 else
16667 {
16668 char expString[10240];
16669
16670 expString[0] = '\0';
16671 if(inCompiler)
16672 {
16673 PrintExpression(exp, expString);
16674 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16675 }
16676 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16677 }
16678 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16679 {
16680 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16681 {
16682 struct Identifier * id = exp->__anon1.member.member;
16683 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));
16684
16685 if(_class)
16686 {
16687 FreeType(exp->expType);
16688 exp->expType = ReplaceThisClassType(_class);
16689 }
16690 }
16691 }
16692 yylloc = oldyylloc;
16693 break;
16694 }
16695 case 9:
16696 {
16697 struct Type * destType = exp->destType;
16698
16699 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16700 {
16701 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16702 }
16703 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16704 exp->type = 8;
16705 if(destType)
16706 destType->count++;
16707 ProcessExpressionType(exp);
16708 if(destType)
16709 destType->count--;
16710 break;
16711 }
16712 case 15:
16713 {
16714 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16715
16716 if(classSym && classSym->__anon1.registered)
16717 {
16718 if(classSym->__anon1.registered->type == 5)
16719 {
16720 char name[1024];
16721
16722 name[0] = '\0';
16723 DeclareStruct(classSym->string, 0);
16724 FreeSpecifier(exp->__anon1._class);
16725 exp->type = 10;
16726 FullClassNameCat(name, classSym->string, 0);
16727 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16728 }
16729 else
16730 {
16731 if(classSym->__anon1.registered->fixed)
16732 {
16733 FreeSpecifier(exp->__anon1._class);
16734 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16735 exp->type = 2;
16736 }
16737 else
16738 {
16739 char className[1024];
16740
16741 strcpy(className, "__ecereClass_");
16742 FullClassNameCat(className, classSym->string, 1);
16743 DeclareClass(classSym, className);
16744 FreeExpContents(exp);
16745 exp->type = 9;
16746 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16747 exp->__anon1.member.member = MkIdentifier("structSize");
16748 }
16749 }
16750 }
16751 exp->expType = __extension__ ({
16752 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16753
16754 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16755 });
16756 break;
16757 }
16758 case 10:
16759 {
16760 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16761
16762 exp->expType = __extension__ ({
16763 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16764
16765 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16766 });
16767 exp->isConstant = 1;
16768 DeclareType(type, 0, 0);
16769 FreeType(type);
16770 break;
16771 }
16772 case 11:
16773 {
16774 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16775
16776 type->count = 1;
16777 FreeType(exp->__anon1.cast.exp->destType);
16778 exp->__anon1.cast.exp->destType = type;
16779 type->refCount++;
16780 type->casted = 1;
16781 ProcessExpressionType(exp->__anon1.cast.exp);
16782 type->casted = 0;
16783 type->count = 0;
16784 exp->expType = type;
16785 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16786 {
16787 void * prev = exp->prev, * next = exp->next;
16788 struct Type * expType = exp->__anon1.cast.exp->destType;
16789 struct Expression * castExp = exp->__anon1.cast.exp;
16790 struct Type * destType = exp->destType;
16791
16792 if(expType)
16793 expType->refCount++;
16794 FreeType(exp->expType);
16795 FreeTypeName(exp->__anon1.cast.typeName);
16796 *exp = *castExp;
16797 FreeType(exp->expType);
16798 FreeType(exp->destType);
16799 exp->expType = expType;
16800 exp->destType = destType;
16801 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16802 exp->prev = prev;
16803 exp->next = next;
16804 }
16805 else
16806 {
16807 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16808 }
16809 break;
16810 }
16811 case 33:
16812 {
16813 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16814
16815 exp->expType = type;
16816 break;
16817 }
16818 case 34:
16819 {
16820 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16821
16822 ProcessExpressionType(exp->__anon1.vaArg.exp);
16823 exp->expType = type;
16824 break;
16825 }
16826 case 12:
16827 {
16828 struct Expression * e;
16829
16830 exp->isConstant = 1;
16831 FreeType(exp->__anon1.cond.cond->destType);
16832 exp->__anon1.cond.cond->destType = MkClassType("bool");
16833 exp->__anon1.cond.cond->destType->truth = 1;
16834 ProcessExpressionType(exp->__anon1.cond.cond);
16835 if(!exp->__anon1.cond.cond->isConstant)
16836 exp->isConstant = 0;
16837 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16838 {
16839 if(!e->next)
16840 {
16841 FreeType(e->destType);
16842 e->destType = exp->destType;
16843 if(e->destType)
16844 e->destType->refCount++;
16845 }
16846 ProcessExpressionType(e);
16847 if(!e->next)
16848 {
16849 exp->expType = e->expType;
16850 if(e->expType)
16851 e->expType->refCount++;
16852 }
16853 if(!e->isConstant)
16854 exp->isConstant = 0;
16855 }
16856 FreeType(exp->__anon1.cond.elseExp->destType);
16857 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16858 if(exp->__anon1.cond.elseExp->destType)
16859 exp->__anon1.cond.elseExp->destType->refCount++;
16860 ProcessExpressionType(exp->__anon1.cond.elseExp);
16861 if(!exp->__anon1.cond.elseExp->isConstant)
16862 exp->isConstant = 0;
16863 break;
16864 }
16865 case 23:
16866 {
16867 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16868 {
16869 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16870
16871 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16872 {
16873 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16874 if(exp->destType)
16875 exp->destType->refCount++;
16876 }
16877 ProcessStatement(exp->__anon1.compound);
16878 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16879 if(exp->expType)
16880 exp->expType->refCount++;
16881 }
16882 break;
16883 }
16884 case 24:
16885 {
16886 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16887
16888 if(spec && spec->type == 1)
16889 {
16890 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16891 exp->expType->kind = 19;
16892 exp->byReference = 1;
16893 }
16894 else
16895 {
16896 exp->expType = MkClassType("ecere::com::Class");
16897 exp->byReference = 1;
16898 }
16899 break;
16900 }
16901 case 25:
16902 {
16903 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16904
16905 if(_class)
16906 {
16907 struct Identifier * id = exp->__anon1.classData.id;
16908 char structName[1024];
16909 struct Expression * classExp;
16910
16911 strcpy(structName, "__ecereClassData_");
16912 FullClassNameCat(structName, _class->fullName, 0);
16913 exp->type = 9;
16914 exp->__anon1.member.member = id;
16915 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16916 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16917 else
16918 classExp = MkExpIdentifier(MkIdentifier("class"));
16919 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"))))))));
16920 ProcessExpressionType(exp);
16921 return ;
16922 }
16923 break;
16924 }
16925 case 35:
16926 {
16927 struct Type * type = (((void *)0));
16928 const char * typeString = (((void *)0));
16929 char typeStringBuf[1024];
16930
16931 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))
16932 {
16933 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16934
16935 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16936 }
16937 else if(exp->__anon1.list)
16938 {
16939 struct Expression * e;
16940
16941 for(e = (*exp->__anon1.list).first; e; e = e->next)
16942 {
16943 ProcessExpressionType(e);
16944 if(e->expType)
16945 {
16946 if(!type)
16947 {
16948 type = e->expType;
16949 type->refCount++;
16950 }
16951 else
16952 {
16953 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16954 {
16955 FreeType(type);
16956 type = e->expType;
16957 e->expType = (((void *)0));
16958 e = (*exp->__anon1.list).first;
16959 ProcessExpressionType(e);
16960 if(e->expType)
16961 {
16962 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16963 {
16964 FreeType(e->expType);
16965 e->expType = (((void *)0));
16966 FreeType(type);
16967 type = (((void *)0));
16968 break;
16969 }
16970 }
16971 }
16972 }
16973 if(e->expType)
16974 {
16975 FreeType(e->expType);
16976 e->expType = (((void *)0));
16977 }
16978 }
16979 }
16980 if(type)
16981 {
16982 typeStringBuf[0] = '\0';
16983 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16984 typeString = typeStringBuf;
16985 FreeType(type);
16986 type = (((void *)0));
16987 }
16988 }
16989 if(typeString)
16990 {
16991 char templateString[1024];
16992 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16993 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16994 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16995 struct Expression * expExt;
16996 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16997
16998 sprintf(templateString, "Container<%s>", typeString);
16999 if(exp->__anon1.list)
17000 {
17001 struct Expression * e;
17002
17003 type = ProcessTypeString(typeString, 0);
17004 while((e = (*exp->__anon1.list).first))
17005 {
17006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17007 e->destType = type;
17008 type->refCount++;
17009 ProcessExpressionType(e);
17010 ListAdd(initializers, MkInitializerAssignment(e));
17011 }
17012 FreeType(type);
17013 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17014 }
17015 DeclareStruct("ecere::com::BuiltInContainer", 0);
17016 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17017 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17018 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17019 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17020 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17021 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17022 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17023 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17024 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17025 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17026
17027 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17028 })));
17029 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17030 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
17031 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17032 exp->expType = ProcessTypeString(templateString, 0);
17033 exp->type = 5;
17034 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17035 ProcessExpressionType(expExt);
17036 }
17037 else
17038 {
17039 exp->expType = ProcessTypeString("Container", 0);
17040 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17041 }
17042 break;
17043 }
17044 }
17045 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17046 {
17047 FreeType(exp->expType);
17048 exp->expType = ReplaceThisClassType(thisClass);
17049 }
17050 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)
17051 {
17052 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17053
17054 if(symbol)
17055 {
17056 if(exp->expType->kind != 15)
17057 {
17058 struct Type * member;
17059 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17060
17061 FreeType(exp->expType);
17062 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17063 exp->expType->kind = symbol->type->kind;
17064 exp->expType->refCount++;
17065 exp->expType->__anon1.__anon1.enumName = enumName;
17066 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17067 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17068 member->refCount++;
17069 }
17070 else
17071 {
17072 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17073
17074 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17075 {
17076 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17077
17078 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17079 }
17080 }
17081 }
17082 }
17083 yylloc = exp->loc;
17084 if(exp->destType && (exp->destType->kind == 18))
17085 ;
17086 else if(exp->destType && !exp->destType->keepCast)
17087 {
17088 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17089 exp->needTemplateCast = 1;
17090 if(exp->destType->kind == 0)
17091 ;
17092 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17093 {
17094 if(!exp->destType->count || unresolved)
17095 {
17096 if(!exp->expType)
17097 {
17098 yylloc = exp->loc;
17099 if(exp->destType->kind != 14)
17100 {
17101 char type2[1024];
17102
17103 type2[0] = '\0';
17104 if(inCompiler)
17105 {
17106 char expString[10240];
17107
17108 expString[0] = '\0';
17109 PrintType(exp->destType, type2, 0, 1);
17110 if(inCompiler)
17111 {
17112 PrintExpression(exp, expString);
17113 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17114 }
17115 if(unresolved)
17116 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17117 else if(exp->type != 16)
17118 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17119 }
17120 }
17121 else
17122 {
17123 char expString[10240];
17124
17125 expString[0] = '\0';
17126 if(inCompiler)
17127 {
17128 PrintExpression(exp, expString);
17129 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17130 }
17131 if(unresolved)
17132 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17133 else if(exp->type != 16)
17134 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17135 }
17136 }
17137 else
17138 {
17139 char type1[1024];
17140 char type2[1024];
17141
17142 type1[0] = '\0';
17143 type2[0] = '\0';
17144 if(inCompiler)
17145 {
17146 PrintType(exp->expType, type1, 0, 1);
17147 PrintType(exp->destType, type2, 0, 1);
17148 }
17149 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)))
17150 ;
17151 else
17152 {
17153 char expString[10240];
17154
17155 expString[0] = '\0';
17156 if(inCompiler)
17157 {
17158 PrintExpression(exp, expString);
17159 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17160 }
17161 if(!sourceFile || (!strstr(sourceFile, "src\\lexer.ec") && !strstr(sourceFile, "src/lexer.ec") && !strstr(sourceFile, "src\\grammar.ec") && !strstr(sourceFile, "src/grammar.ec") && !strstr(sourceFile, "src\\type.ec") && !strstr(sourceFile, "src/type.ec") && !strstr(sourceFile, "src\\expression.ec") && !strstr(sourceFile, "src/expression.ec")))
17162 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17163 FreeType(exp->expType);
17164 exp->destType->refCount++;
17165 exp->expType = exp->destType;
17166 }
17167 }
17168 }
17169 }
17170 else if(exp->destType && exp->destType->kind == 13 && exp->destType->__anon1.type && exp->destType->__anon1.type->kind == 11 && exp->expType && (exp->expType->kind == 11 || exp->expType->kind == 16))
17171 {
17172 struct Expression * nbExp = GetNonBracketsExp(exp);
17173
17174 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
17175 {
17176 struct Expression * e = MoveExpContents(exp);
17177
17178 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
17179 exp->type = 11;
17180 exp->__anon1.cast.exp->destType = exp->destType;
17181 if(exp->destType)
17182 exp->destType->refCount++;
17183 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
17184 }
17185 }
17186 }
17187 else if(unresolved)
17188 {
17189 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17190 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);
17191 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17192 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17193 }
17194 else if(!exp->expType && exp->type != 16)
17195 {
17196 char expString[10240];
17197
17198 expString[0] = '\0';
17199 if(inCompiler)
17200 {
17201 PrintExpression(exp, expString);
17202 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17203 }
17204 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17205 }
17206 if(inCompiler)
17207 ApplyAnyObjectLogic(exp);
17208 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)))
17209 {
17210 exp->byReference = 1;
17211 }
17212 yylloc = oldyylloc;
17213 }
17214
17215 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)
17216 {
17217 if(*curMember)
17218 {
17219 *curMember = (*curMember)->next;
17220 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17221 {
17222 *curMember = subMemberStack[--(*subMemberStackPos)];
17223 *curMember = (*curMember)->next;
17224 }
17225 while((*curMember) && (*curMember)->isProperty)
17226 *curMember = (*curMember)->next;
17227 if(subMemberStackPos)
17228 {
17229 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17230 {
17231 subMemberStack[(*subMemberStackPos)++] = *curMember;
17232 *curMember = (*curMember)->members.first;
17233 while(*curMember && (*curMember)->isProperty)
17234 *curMember = (*curMember)->next;
17235 }
17236 }
17237 }
17238 while(!*curMember)
17239 {
17240 if(!*curMember)
17241 {
17242 if(subMemberStackPos && *subMemberStackPos)
17243 {
17244 *curMember = subMemberStack[--(*subMemberStackPos)];
17245 *curMember = (*curMember)->next;
17246 }
17247 else
17248 {
17249 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17250
17251 if(*curClass == _class)
17252 break;
17253 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17254 ;
17255 *curMember = (*curClass)->membersAndProperties.first;
17256 }
17257 while((*curMember) && (*curMember)->isProperty)
17258 *curMember = (*curMember)->next;
17259 if(subMemberStackPos)
17260 {
17261 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17262 {
17263 subMemberStack[(*subMemberStackPos)++] = *curMember;
17264 *curMember = (*curMember)->members.first;
17265 while(*curMember && (*curMember)->isProperty)
17266 *curMember = (*curMember)->next;
17267 }
17268 }
17269 }
17270 }
17271 }
17272
17273 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17274 {
17275 switch(init->type)
17276 {
17277 case 0:
17278 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17279 {
17280 if(init->__anon1.exp && !init->__anon1.exp->destType)
17281 {
17282 FreeType(init->__anon1.exp->destType);
17283 init->__anon1.exp->destType = type;
17284 if(type)
17285 type->refCount++;
17286 }
17287 if(init->__anon1.exp)
17288 {
17289 ProcessExpressionType(init->__anon1.exp);
17290 init->isConstant = init->__anon1.exp->isConstant;
17291 }
17292 break;
17293 }
17294 else
17295 {
17296 struct Expression * exp = init->__anon1.exp;
17297 struct Instantiation * inst = exp->__anon1.instance;
17298 struct MembersInit * members;
17299
17300 init->type = 1;
17301 init->__anon1.list = MkList();
17302 if(inst->members)
17303 {
17304 for(members = (*inst->members).first; members; members = members->next)
17305 {
17306 if(members->type == 0)
17307 {
17308 struct MemberInit * member;
17309
17310 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17311 {
17312 ListAdd(init->__anon1.list, member->initializer);
17313 member->initializer = (((void *)0));
17314 }
17315 }
17316 }
17317 }
17318 FreeExpression(exp);
17319 }
17320 case 1:
17321 {
17322 struct Initializer * i;
17323 struct Type * initializerType = (((void *)0));
17324 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17325 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17326 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17327 int subMemberStackPos = 0;
17328
17329 if(type && type->kind == 12)
17330 initializerType = Dereference(type);
17331 else if(type && (type->kind == 9 || type->kind == 10))
17332 initializerType = type->__anon1.__anon1.members.first;
17333 for(i = (*init->__anon1.list).first; i; i = i->next)
17334 {
17335 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17336 {
17337 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17338 if(curMember)
17339 {
17340 if(!curMember->dataType)
17341 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17342 initializerType = curMember->dataType;
17343 }
17344 }
17345 ProcessInitializer(i, initializerType);
17346 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17347 initializerType = initializerType->next;
17348 if(!i->isConstant)
17349 init->isConstant = 0;
17350 }
17351 if(type && type->kind == 12)
17352 FreeType(initializerType);
17353 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))
17354 {
17355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17356 }
17357 break;
17358 }
17359 }
17360 }
17361
17362 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17363
17364 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17365
17366 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17367 {
17368 switch(spec->type)
17369 {
17370 case 0:
17371 {
17372 if(spec->__anon1.specifier == THISCLASS)
17373 {
17374 if(thisClass)
17375 {
17376 spec->type = 1;
17377 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17378 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17379 ProcessSpecifier(spec, declareStruct);
17380 }
17381 }
17382 break;
17383 }
17384 case 1:
17385 {
17386 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17387
17388 if(symbol)
17389 DeclareType(symbol->type, 1, 1);
17390 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17391 DeclareStruct(spec->__anon1.__anon1.name, 0);
17392 break;
17393 }
17394 case 2:
17395 {
17396 struct Enumerator * e;
17397
17398 if(spec->__anon1.__anon2.list)
17399 {
17400 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17401 {
17402 if(e->exp)
17403 ProcessExpressionType(e->exp);
17404 }
17405 }
17406 break;
17407 }
17408 case 3:
17409 case 4:
17410 {
17411 if(spec->__anon1.__anon2.definitions)
17412 {
17413 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17414
17415 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17416 }
17417 break;
17418 }
17419 }
17420 }
17421
17422 static void ProcessDeclarator(struct Declarator * decl)
17423 {
17424 switch(decl->type)
17425 {
17426 case 1:
17427 if(decl->__anon1.identifier->classSym)
17428 {
17429 FreeSpecifier(decl->__anon1.identifier->_class);
17430 decl->__anon1.identifier->_class = (((void *)0));
17431 }
17432 break;
17433 case 3:
17434 if(decl->__anon1.array.exp)
17435 ProcessExpressionType(decl->__anon1.array.exp);
17436 case 0:
17437 case 2:
17438 case 4:
17439 case 5:
17440 case 6:
17441 case 7:
17442 if(decl->declarator)
17443 ProcessDeclarator(decl->declarator);
17444 if(decl->type == 4)
17445 {
17446 struct Identifier * id = GetDeclId(decl);
17447
17448 if(id && id->_class)
17449 {
17450 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17451
17452 if(!decl->__anon1.function.parameters)
17453 decl->__anon1.function.parameters = MkList();
17454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17455 id->_class = (((void *)0));
17456 }
17457 if(decl->__anon1.function.parameters)
17458 {
17459 struct TypeName * param;
17460
17461 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17462 {
17463 if(param->qualifiers && (*param->qualifiers).first)
17464 {
17465 struct Specifier * spec = (*param->qualifiers).first;
17466
17467 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17468 {
17469 struct Declarator * d = param->declarator;
17470 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);
17471
17472 if(d->type != 5)
17473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17474 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17475 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17476 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17478 param = newParam;
17479 }
17480 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17481 {
17482 struct Declarator * d = param->declarator;
17483
17484 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17485 param->qualifiers = MkListOne(MkSpecifier(VOID));
17486 if(d->type != 5)
17487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17488 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17489 }
17490 else if(spec->__anon1.specifier == THISCLASS)
17491 {
17492 if(thisClass)
17493 {
17494 spec->type = 1;
17495 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17496 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17497 ProcessSpecifier(spec, 0);
17498 }
17499 }
17500 }
17501 if(param->declarator)
17502 ProcessDeclarator(param->declarator);
17503 }
17504 }
17505 }
17506 break;
17507 }
17508 }
17509
17510 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17511
17512 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17513
17514 static void ProcessDeclaration(struct Declaration * decl)
17515 {
17516 yylloc = decl->loc;
17517 switch(decl->type)
17518 {
17519 case 1:
17520 {
17521 unsigned int declareStruct = 0;
17522
17523 if(decl->__anon1.__anon1.declarators)
17524 {
17525 struct InitDeclarator * d;
17526
17527 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17528 {
17529 struct Type * type, * subType;
17530
17531 ProcessDeclarator(d->declarator);
17532 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17533 if(d->initializer)
17534 {
17535 ProcessInitializer(d->initializer, type);
17536 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17537 {
17538 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17539 {
17540 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17541
17542 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17543 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17544 if(decl->__anon1.__anon1.specifiers)
17545 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
17546 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
17547 d = (((void *)0));
17548 decl->type = 2;
17549 decl->__anon1.inst = inst;
17550 }
17551 }
17552 }
17553 for(subType = type; subType; )
17554 {
17555 if(subType->kind == 8)
17556 {
17557 declareStruct = 1;
17558 break;
17559 }
17560 else if(subType->kind == 13)
17561 break;
17562 else if(subType->kind == 12)
17563 subType = subType->__anon1.__anon4.arrayType;
17564 else
17565 break;
17566 }
17567 FreeType(type);
17568 if(!d)
17569 break;
17570 }
17571 }
17572 if(decl->__anon1.__anon1.specifiers)
17573 {
17574 struct Specifier * s;
17575
17576 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17577 {
17578 ProcessSpecifier(s, declareStruct);
17579 }
17580 }
17581 break;
17582 }
17583 case 2:
17584 {
17585 ProcessInstantiationType(decl->__anon1.inst);
17586 break;
17587 }
17588 case 0:
17589 {
17590 struct Specifier * spec;
17591 struct Declarator * d;
17592 unsigned int declareStruct = 0;
17593
17594 if(decl->__anon1.__anon1.declarators)
17595 {
17596 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17597 {
17598 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17599 struct Type * subType;
17600
17601 ProcessDeclarator(d);
17602 for(subType = type; subType; )
17603 {
17604 if(subType->kind == 8)
17605 {
17606 declareStruct = 1;
17607 break;
17608 }
17609 else if(subType->kind == 13)
17610 break;
17611 else if(subType->kind == 12)
17612 subType = subType->__anon1.__anon4.arrayType;
17613 else
17614 break;
17615 }
17616 FreeType(type);
17617 }
17618 }
17619 if(decl->__anon1.__anon1.specifiers)
17620 {
17621 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17622 ProcessSpecifier(spec, declareStruct);
17623 }
17624 break;
17625 }
17626 }
17627 }
17628
17629 static struct FunctionDefinition * curFunction;
17630
17631 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17632 {
17633 char propName[1024], propNameM[1024];
17634 char getName[1024], setName[1024];
17635 struct __ecereNameSpace__ecere__sys__OldList * args;
17636
17637 DeclareProperty(prop, setName, getName);
17638 strcpy(propName, "__ecereProp_");
17639 FullClassNameCat(propName, prop->_class->fullName, 0);
17640 strcat(propName, "_");
17641 FullClassNameCat(propName, prop->name, 1);
17642 strcpy(propNameM, "__ecerePropM_");
17643 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17644 strcat(propNameM, "_");
17645 FullClassNameCat(propNameM, prop->name, 1);
17646 if(prop->isWatchable)
17647 {
17648 args = MkList();
17649 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17650 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17651 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17652 args = MkList();
17653 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17654 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17655 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17656 }
17657 {
17658 args = MkList();
17659 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17660 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17661 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17662 args = MkList();
17663 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17664 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17665 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17666 }
17667 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17668 curFunction->propSet->fireWatchersDone = 1;
17669 }
17670
17671 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17672
17673 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17674
17675 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17676
17677 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17678
17679 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17680
17681 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17682
17683 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17684
17685 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17686
17687 static void ProcessStatement(struct Statement * stmt)
17688 {
17689 yylloc = stmt->loc;
17690 switch(stmt->type)
17691 {
17692 case 0:
17693 ProcessStatement(stmt->__anon1.labeled.stmt);
17694 break;
17695 case 1:
17696 if(stmt->__anon1.caseStmt.exp)
17697 {
17698 FreeType(stmt->__anon1.caseStmt.exp->destType);
17699 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17700 if(curSwitchType)
17701 curSwitchType->refCount++;
17702 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17703 ComputeExpression(stmt->__anon1.caseStmt.exp);
17704 }
17705 if(stmt->__anon1.caseStmt.stmt)
17706 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17707 break;
17708 case 2:
17709 {
17710 if(stmt->__anon1.compound.context)
17711 {
17712 struct Declaration * decl;
17713 struct Statement * s;
17714 struct Statement * prevCompound = curCompound;
17715 struct Context * prevContext = curContext;
17716
17717 if(!stmt->__anon1.compound.isSwitch)
17718 curCompound = stmt;
17719 curContext = stmt->__anon1.compound.context;
17720 if(stmt->__anon1.compound.declarations)
17721 {
17722 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17723 ProcessDeclaration(decl);
17724 }
17725 if(stmt->__anon1.compound.statements)
17726 {
17727 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17728 ProcessStatement(s);
17729 }
17730 curContext = prevContext;
17731 curCompound = prevCompound;
17732 }
17733 break;
17734 }
17735 case 3:
17736 {
17737 struct Expression * exp;
17738
17739 if(stmt->__anon1.expressions)
17740 {
17741 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17742 ProcessExpressionType(exp);
17743 }
17744 break;
17745 }
17746 case 4:
17747 {
17748 struct Expression * exp;
17749
17750 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17751 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17752 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17753 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17754 {
17755 ProcessExpressionType(exp);
17756 }
17757 if(stmt->__anon1.ifStmt.stmt)
17758 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17759 if(stmt->__anon1.ifStmt.elseStmt)
17760 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17761 break;
17762 }
17763 case 5:
17764 {
17765 struct Type * oldSwitchType = curSwitchType;
17766
17767 if(stmt->__anon1.switchStmt.exp)
17768 {
17769 struct Expression * exp;
17770
17771 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17772 {
17773 if(!exp->next)
17774 {
17775 ProcessExpressionType(exp);
17776 }
17777 if(!exp->next)
17778 curSwitchType = exp->expType;
17779 }
17780 }
17781 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17782 curSwitchType = oldSwitchType;
17783 break;
17784 }
17785 case 6:
17786 {
17787 if(stmt->__anon1.whileStmt.exp)
17788 {
17789 struct Expression * exp;
17790
17791 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17792 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17793 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17794 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17795 {
17796 ProcessExpressionType(exp);
17797 }
17798 }
17799 if(stmt->__anon1.whileStmt.stmt)
17800 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17801 break;
17802 }
17803 case 7:
17804 {
17805 if(stmt->__anon1.doWhile.exp)
17806 {
17807 struct Expression * exp;
17808
17809 if((*stmt->__anon1.doWhile.exp).last)
17810 {
17811 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17812 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17813 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17814 }
17815 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17816 {
17817 ProcessExpressionType(exp);
17818 }
17819 }
17820 if(stmt->__anon1.doWhile.stmt)
17821 ProcessStatement(stmt->__anon1.doWhile.stmt);
17822 break;
17823 }
17824 case 8:
17825 {
17826 struct Expression * exp;
17827
17828 if(stmt->__anon1.forStmt.init)
17829 ProcessStatement(stmt->__anon1.forStmt.init);
17830 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17831 {
17832 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17833 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17834 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17835 }
17836 if(stmt->__anon1.forStmt.check)
17837 ProcessStatement(stmt->__anon1.forStmt.check);
17838 if(stmt->__anon1.forStmt.increment)
17839 {
17840 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17841 ProcessExpressionType(exp);
17842 }
17843 if(stmt->__anon1.forStmt.stmt)
17844 ProcessStatement(stmt->__anon1.forStmt.stmt);
17845 break;
17846 }
17847 case 18:
17848 {
17849 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17850 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17851 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17852 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17853 char iteratorType[1024];
17854 struct Type * source;
17855 struct Expression * e;
17856 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));
17857 struct Expression * arrayExp;
17858 const char * typeString = (((void *)0));
17859 int builtinCount = 0;
17860
17861 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17862 {
17863 if(!e->next)
17864 {
17865 FreeType(e->destType);
17866 e->destType = ProcessTypeString("Container", 0);
17867 }
17868 if(!isBuiltin || e->next)
17869 ProcessExpressionType(e);
17870 }
17871 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17872 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)))
17873 {
17874 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17875 struct Symbol * symbol;
17876 struct Expression * expIt = (((void *)0));
17877 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17878 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17879 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17880 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17881
17882 stmt->type = 2;
17883 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17884 stmt->__anon1.compound.context->parent = curContext;
17885 curContext = stmt->__anon1.compound.context;
17886 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17887 {
17888 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17889
17890 isCustomAVLTree = 1;
17891 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17892 isMap = 1;
17893 }
17894 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17895 isArray = 1;
17896 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17897 {
17898 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17899
17900 isLinkList = 1;
17901 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17902 }
17903 if(isArray)
17904 {
17905 struct Declarator * decl;
17906 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17907
17908 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17909 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17910 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17911 }
17912 else if(isBuiltin)
17913 {
17914 struct Type * type = (((void *)0));
17915 char typeStringBuf[1024];
17916
17917 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17918 if(((struct Expression *)(*exp).last)->type == 11)
17919 {
17920 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17921
17922 if(typeName)
17923 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17924 }
17925 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)
17926 {
17927 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17928
17929 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17930 }
17931 else if(arrayExp->__anon1.list)
17932 {
17933 struct Expression * e;
17934
17935 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17936 {
17937 ProcessExpressionType(e);
17938 if(e->expType)
17939 {
17940 if(!type)
17941 {
17942 type = e->expType;
17943 type->refCount++;
17944 }
17945 else
17946 {
17947 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17948 {
17949 FreeType(type);
17950 type = e->expType;
17951 e->expType = (((void *)0));
17952 e = (*arrayExp->__anon1.list).first;
17953 ProcessExpressionType(e);
17954 if(e->expType)
17955 {
17956 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17957 {
17958 FreeType(e->expType);
17959 e->expType = (((void *)0));
17960 FreeType(type);
17961 type = (((void *)0));
17962 break;
17963 }
17964 }
17965 }
17966 }
17967 if(e->expType)
17968 {
17969 FreeType(e->expType);
17970 e->expType = (((void *)0));
17971 }
17972 }
17973 }
17974 if(type)
17975 {
17976 typeStringBuf[0] = '\0';
17977 PrintType(type, typeStringBuf, 0, 1);
17978 typeString = typeStringBuf;
17979 FreeType(type);
17980 }
17981 }
17982 if(typeString)
17983 {
17984 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17985 struct Declarator * decl;
17986 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17987
17988 if(arrayExp->__anon1.list)
17989 {
17990 struct Expression * e;
17991
17992 builtinCount = (*arrayExp->__anon1.list).count;
17993 type = ProcessTypeString(typeString, 0);
17994 while((e = (*arrayExp->__anon1.list).first))
17995 {
17996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17997 e->destType = type;
17998 type->refCount++;
17999 ProcessExpressionType(e);
18000 ListAdd(initializers, MkInitializerAssignment(e));
18001 }
18002 FreeType(type);
18003 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
18004 }
18005 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
18006 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
18007 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
18008 FreeList(exp, (void *)(FreeExpression));
18009 }
18010 else
18011 {
18012 arrayExp->expType = ProcessTypeString("Container", 0);
18013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18014 }
18015 }
18016 else if(isLinkList && !isList)
18017 {
18018 struct Declarator * decl;
18019 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18020
18021 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18022 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18023 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18024 }
18025 else if(_class->templateArgs)
18026 {
18027 if(isMap)
18028 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18029 else
18030 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18031 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)))))))));
18032 }
18033 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18034 if(block)
18035 {
18036 switch(block->type)
18037 {
18038 case 2:
18039 if(block->__anon1.compound.context)
18040 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18041 break;
18042 case 4:
18043 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18044 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18045 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18046 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18047 break;
18048 case 5:
18049 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18050 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18051 break;
18052 case 6:
18053 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18054 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18055 break;
18056 case 7:
18057 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18058 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18059 break;
18060 case 8:
18061 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18062 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18063 break;
18064 case 18:
18065 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18066 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18067 break;
18068 }
18069 }
18070 if(filter)
18071 {
18072 block = MkIfStmt(filter, block, (((void *)0)));
18073 }
18074 if(isArray)
18075 {
18076 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));
18077 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18078 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18079 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18080 }
18081 else if(isBuiltin)
18082 {
18083 char count[128];
18084
18085 sprintf(count, "%d", builtinCount);
18086 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));
18087 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18088 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18089 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18090 }
18091 else if(isLinkList && !isList)
18092 {
18093 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18094 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18095
18096 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18097 {
18098 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));
18099 }
18100 else
18101 {
18102 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18103 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18104
18105 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));
18106 }
18107 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18108 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18109 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18110 }
18111 else
18112 {
18113 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18114 }
18115 ProcessExpressionType(expIt);
18116 if((*stmt->__anon1.compound.declarations).first)
18117 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18118 if(symbol)
18119 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18120 ProcessStatement(stmt);
18121 curContext = stmt->__anon1.compound.context->parent;
18122 break;
18123 }
18124 else
18125 {
18126 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18127 }
18128 break;
18129 }
18130 case 9:
18131 break;
18132 case 10:
18133 break;
18134 case 11:
18135 break;
18136 case 12:
18137 {
18138 struct Expression * exp;
18139
18140 if(stmt->__anon1.expressions)
18141 {
18142 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18143 {
18144 if(!exp->next)
18145 {
18146 if(curFunction && !curFunction->type)
18147 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18148 FreeType(exp->destType);
18149 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18150 if(exp->destType)
18151 exp->destType->refCount++;
18152 }
18153 ProcessExpressionType(exp);
18154 }
18155 }
18156 break;
18157 }
18158 case 14:
18159 {
18160 ProcessDeclaration(stmt->__anon1.decl);
18161 break;
18162 }
18163 case 13:
18164 {
18165 struct AsmField * field;
18166
18167 if(stmt->__anon1.asmStmt.inputFields)
18168 {
18169 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18170 if(field->expression)
18171 ProcessExpressionType(field->expression);
18172 }
18173 if(stmt->__anon1.asmStmt.outputFields)
18174 {
18175 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18176 if(field->expression)
18177 ProcessExpressionType(field->expression);
18178 }
18179 if(stmt->__anon1.asmStmt.clobberedFields)
18180 {
18181 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18182 {
18183 if(field->expression)
18184 ProcessExpressionType(field->expression);
18185 }
18186 }
18187 break;
18188 }
18189 case 17:
18190 {
18191 struct PropertyWatch * propWatch;
18192 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18193 struct Expression * object = stmt->__anon1._watch.object;
18194 struct Expression * watcher = stmt->__anon1._watch.watcher;
18195
18196 if(watcher)
18197 ProcessExpressionType(watcher);
18198 if(object)
18199 ProcessExpressionType(object);
18200 if(inCompiler)
18201 {
18202 if(watcher || thisClass)
18203 {
18204 struct External * external = curExternal;
18205 struct Context * context = curContext;
18206
18207 stmt->type = 3;
18208 stmt->__anon1.expressions = MkList();
18209 curExternal = external->prev;
18210 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18211 {
18212 struct ClassFunction * func;
18213 char watcherName[1024];
18214 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;
18215 struct External * createdExternal;
18216 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18217
18218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18219 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18220 if(propWatch->deleteWatch)
18221 strcat(watcherName, "_delete");
18222 else
18223 {
18224 struct Identifier * propID;
18225
18226 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18227 {
18228 strcat(watcherName, "_");
18229 strcat(watcherName, propID->string);
18230 }
18231 }
18232 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18233 {
18234 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)));
18235 ProcessClassFunctionBody(func, propWatch->compound);
18236 propWatch->compound = (((void *)0));
18237 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18238 createdExternal->symbol->idCode = external->symbol->idCode;
18239 curExternal = createdExternal;
18240 ProcessFunction(createdExternal->__anon1.function);
18241 {
18242 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18243
18244 externalDecl->__anon1.declaration = decl;
18245 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18246 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18247 }
18248 if(propWatch->deleteWatch)
18249 {
18250 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18251
18252 ListAdd(args, CopyExpression(object));
18253 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18254 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18255 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18256 }
18257 else
18258 {
18259 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18260 struct Identifier * propID;
18261
18262 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18263 {
18264 char propName[1024];
18265 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18266
18267 if(prop)
18268 {
18269 char getName[1024], setName[1024];
18270 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18271
18272 DeclareProperty(prop, setName, getName);
18273 strcpy(propName, "__ecereProp_");
18274 FullClassNameCat(propName, prop->_class->fullName, 0);
18275 strcat(propName, "_");
18276 FullClassNameCat(propName, prop->name, 1);
18277 ListAdd(args, CopyExpression(object));
18278 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18279 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18280 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
18281 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18282 }
18283 else
18284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18285 }
18286 }
18287 }
18288 else
18289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18290 }
18291 curExternal = external;
18292 curContext = context;
18293 if(watcher)
18294 FreeExpression(watcher);
18295 if(object)
18296 FreeExpression(object);
18297 FreeList(watches, (void *)(FreePropertyWatch));
18298 }
18299 else
18300 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18301 }
18302 else
18303 {
18304 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18305 {
18306 ProcessStatement(propWatch->compound);
18307 }
18308 }
18309 break;
18310 }
18311 case 15:
18312 {
18313 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18314 struct Expression * object = stmt->__anon1._watch.object;
18315 struct __ecereNameSpace__ecere__com__Class * _class;
18316
18317 if(object)
18318 ProcessExpressionType(object);
18319 if(inCompiler)
18320 {
18321 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18322 if(_class)
18323 {
18324 struct Identifier * propID;
18325
18326 stmt->type = 3;
18327 stmt->__anon1.expressions = MkList();
18328 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18329 {
18330 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18331 }
18332 else if(!watches)
18333 {
18334 }
18335 if(watches)
18336 {
18337 for(propID = (*watches).first; propID; propID = propID->next)
18338 {
18339 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18340
18341 if(prop)
18342 {
18343 CreateFireWatcher(prop, object, stmt);
18344 }
18345 else
18346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18347 }
18348 }
18349 else
18350 {
18351 struct __ecereNameSpace__ecere__com__Property * prop;
18352 struct __ecereNameSpace__ecere__com__Class * base;
18353
18354 for(base = _class; base; base = base->base)
18355 {
18356 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18357 {
18358 if(prop->isProperty && prop->isWatchable)
18359 {
18360 CreateFireWatcher(prop, object, stmt);
18361 }
18362 }
18363 }
18364 }
18365 if(object)
18366 FreeExpression(object);
18367 FreeList(watches, (void *)(FreeIdentifier));
18368 }
18369 else
18370 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18371 }
18372 break;
18373 }
18374 case 16:
18375 {
18376 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18377 struct Expression * object = stmt->__anon1._watch.object;
18378 struct Expression * watcher = stmt->__anon1._watch.watcher;
18379 struct __ecereNameSpace__ecere__com__Class * _class;
18380
18381 if(object)
18382 ProcessExpressionType(object);
18383 if(watcher)
18384 ProcessExpressionType(watcher);
18385 if(inCompiler)
18386 {
18387 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18388 if(watcher || thisClass)
18389 {
18390 if(_class)
18391 {
18392 struct Identifier * propID;
18393
18394 stmt->type = 3;
18395 stmt->__anon1.expressions = MkList();
18396 if(!watches)
18397 {
18398 struct __ecereNameSpace__ecere__sys__OldList * args;
18399
18400 args = MkList();
18401 ListAdd(args, CopyExpression(object));
18402 ListAdd(args, MkExpConstant("0"));
18403 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18404 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18405 }
18406 else
18407 {
18408 for(propID = (*watches).first; propID; propID = propID->next)
18409 {
18410 char propName[1024];
18411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18412
18413 if(prop)
18414 {
18415 char getName[1024], setName[1024];
18416 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18417
18418 DeclareProperty(prop, setName, getName);
18419 strcpy(propName, "__ecereProp_");
18420 FullClassNameCat(propName, prop->_class->fullName, 0);
18421 strcat(propName, "_");
18422 FullClassNameCat(propName, prop->name, 1);
18423 ListAdd(args, CopyExpression(object));
18424 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18425 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18426 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18427 }
18428 else
18429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18430 }
18431 }
18432 if(object)
18433 FreeExpression(object);
18434 if(watcher)
18435 FreeExpression(watcher);
18436 FreeList(watches, (void *)(FreeIdentifier));
18437 }
18438 else
18439 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18440 }
18441 else
18442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18443 }
18444 break;
18445 }
18446 }
18447 }
18448
18449 extern struct Expression * QBrackets(struct Expression * exp);
18450
18451 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18452
18453 extern struct Declarator * QMkPtrDecl(const char *  id);
18454
18455 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18456
18457 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18458
18459 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18460
18461 static void ProcessFunction(struct FunctionDefinition * function)
18462 {
18463 struct Identifier * id = GetDeclId(function->declarator);
18464 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18465 struct Type * type = symbol ? symbol->type : (((void *)0));
18466 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18467 struct Context * oldTopContext = topContext;
18468
18469 yylloc = function->loc;
18470 if(type && type->__anon1.__anon2.thisClass)
18471 {
18472 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18473 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18474 char className[1024];
18475 char structName[1024];
18476 struct Declarator * funcDecl;
18477 struct Symbol * thisSymbol;
18478 unsigned int typedObject = 0;
18479
18480 if(_class && !_class->base)
18481 {
18482 _class = currentClass;
18483 if(_class && !_class->symbol)
18484 _class->symbol = FindClass(_class->fullName);
18485 classSym = _class ? _class->symbol : (((void *)0));
18486 typedObject = 1;
18487 }
18488 thisClass = _class;
18489 if(inCompiler && _class)
18490 {
18491 if(type->kind == 11)
18492 {
18493 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18494 {
18495 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18496
18497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18498 FreeType(param);
18499 }
18500 if(type->classObjectType != 1)
18501 {
18502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18503 symbol->type->__anon1.__anon2.staticMethod = 1;
18504 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18505 symbol->type->extraParam = 0;
18506 }
18507 }
18508 strcpy(className, "__ecereClass_");
18509 FullClassNameCat(className, _class->fullName, 1);
18510 structName[0] = (char)0;
18511 FullClassNameCat(structName, _class->fullName, 0);
18512 funcDecl = GetFuncDecl(function->declarator);
18513 if(funcDecl)
18514 {
18515 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18516 {
18517 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18518
18519 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18520 {
18521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18522 FreeTypeName(param);
18523 }
18524 }
18525 if(!function->propertyNoThis)
18526 {
18527 struct TypeName * thisParam = (((void *)0));
18528
18529 if(type->classObjectType != 1)
18530 {
18531 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18532 if(!funcDecl->__anon1.function.parameters)
18533 funcDecl->__anon1.function.parameters = MkList();
18534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18535 }
18536 if(typedObject)
18537 {
18538 if(type->classObjectType != 1)
18539 {
18540 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18541 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18542 }
18543 thisParam = __extension__ ({
18544 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18545
18546 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18547 });
18548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18549 }
18550 }
18551 }
18552 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18553 {
18554 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18555
18556 funcDecl = GetFuncDecl(initDecl->declarator);
18557 if(funcDecl)
18558 {
18559 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18560 {
18561 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18562
18563 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18564 {
18565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18566 FreeTypeName(param);
18567 }
18568 }
18569 if(type->classObjectType != 1)
18570 {
18571 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18572 {
18573 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18574
18575 if(!funcDecl->__anon1.function.parameters)
18576 funcDecl->__anon1.function.parameters = MkList();
18577 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18578 }
18579 }
18580 }
18581 }
18582 }
18583 if(function->body)
18584 {
18585 if(type->classObjectType != 1)
18586 {
18587 thisSymbol = __extension__ ({
18588 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18589
18590 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18591 });
18592 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18593 if(typedObject && thisSymbol->type)
18594 {
18595 thisSymbol->type->classObjectType = 2;
18596 thisSymbol->type->byReference = type->byReference;
18597 thisSymbol->type->typedByReference = type->byReference;
18598 }
18599 }
18600 }
18601 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18602 {
18603 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18604
18605 {
18606 struct __ecereNameSpace__ecere__com__Class * base;
18607
18608 for(base = _class; base && base->type != 1000; base = base->next)
18609 {
18610 for(member = base->membersAndProperties.first; member; member = member->next)
18611 if(!member->isProperty)
18612 break;
18613 if(member)
18614 break;
18615 }
18616 }
18617 for(member = _class->membersAndProperties.first; member; member = member->next)
18618 if(!member->isProperty)
18619 break;
18620 if(member)
18621 {
18622 char pointerName[1024];
18623 struct Declaration * decl;
18624 struct Initializer * initializer;
18625 struct Expression * exp, * bytePtr;
18626
18627 strcpy(pointerName, "__ecerePointer_");
18628 FullClassNameCat(pointerName, _class->fullName, 0);
18629 {
18630 char className[1024];
18631
18632 strcpy(className, "__ecereClass_");
18633 FullClassNameCat(className, classSym->string, 1);
18634 DeclareClass(classSym, className);
18635 }
18636 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18637 if(_class->fixed)
18638 {
18639 char string[256];
18640
18641 sprintf(string, "%d", _class->offset);
18642 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18643 }
18644 else
18645 {
18646 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18647 }
18648 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18649 exp->expType = __extension__ ({
18650 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18651
18652 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18653 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18654
18655 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18656 }), __ecereInstance2;
18657 });
18658 if(function->body)
18659 {
18660 yylloc = function->body->loc;
18661 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18662 {
18663 struct Context * prevContext = curContext;
18664 struct __ecereNameSpace__ecere__sys__OldList * list;
18665
18666 curContext = function->body->__anon1.compound.context;
18667 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18668 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18669 curContext = prevContext;
18670 }
18671 decl->symbol = (((void *)0));
18672 if(!function->body->__anon1.compound.declarations)
18673 function->body->__anon1.compound.declarations = MkList();
18674 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18675 }
18676 }
18677 }
18678 }
18679 else
18680 thisClass = (((void *)0));
18681 if(id)
18682 {
18683 FreeSpecifier(id->_class);
18684 id->_class = (((void *)0));
18685 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18686 {
18687 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18688
18689 id = GetDeclId(initDecl->declarator);
18690 FreeSpecifier(id->_class);
18691 id->_class = (((void *)0));
18692 }
18693 }
18694 if(function->body)
18695 topContext = function->body->__anon1.compound.context;
18696 {
18697 struct FunctionDefinition * oldFunction = curFunction;
18698
18699 curFunction = function;
18700 if(function->body)
18701 ProcessStatement(function->body);
18702 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18703 {
18704 struct Statement * prevCompound = curCompound;
18705 struct Context * prevContext = curContext;
18706 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18707
18708 if(!function->body->__anon1.compound.statements)
18709 function->body->__anon1.compound.statements = MkList();
18710 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18711 curCompound = function->body;
18712 curContext = function->body->__anon1.compound.context;
18713 ProcessStatement(fireWatchers);
18714 curContext = prevContext;
18715 curCompound = prevCompound;
18716 }
18717 curFunction = oldFunction;
18718 }
18719 if(function->declarator)
18720 {
18721 ProcessDeclarator(function->declarator);
18722 }
18723 topContext = oldTopContext;
18724 thisClass = oldThisClass;
18725 }
18726
18727 extern void FreeSymbol(struct Symbol * symbol);
18728
18729 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18730
18731 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18732 {
18733 struct ClassDef * def;
18734 struct External * external = curExternal;
18735 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18736
18737 for(def = definitions->first; def; def = def->next)
18738 {
18739 if(def->type == 0)
18740 {
18741 if(def->__anon1.function->declarator)
18742 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18743 else
18744 curExternal = external;
18745 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18746 }
18747 else if(def->type == 2)
18748 {
18749 if(def->__anon1.decl->type == 2)
18750 {
18751 thisClass = regClass;
18752 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18753 thisClass = (((void *)0));
18754 }
18755 else
18756 {
18757 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18758
18759 if(regClass)
18760 thisClass = regClass;
18761 ProcessDeclaration(def->__anon1.decl);
18762 thisClass = backThisClass;
18763 }
18764 }
18765 else if(def->type == 1 && def->__anon1.defProperties)
18766 {
18767 struct MemberInit * defProperty;
18768 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);
18769
18770 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18771 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18772 {
18773 thisClass = regClass;
18774 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18775 thisClass = (((void *)0));
18776 }
18777 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18778 FreeSymbol(thisSymbol);
18779 }
18780 else if(def->type == 3 && def->__anon1.propertyDef)
18781 {
18782 struct PropertyDef * prop = def->__anon1.propertyDef;
18783
18784 thisClass = regClass;
18785 if(prop->setStmt)
18786 {
18787 if(regClass)
18788 {
18789 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18790
18791 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18792 }
18793 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18794 ProcessStatement(prop->setStmt);
18795 }
18796 if(prop->getStmt)
18797 {
18798 if(regClass)
18799 {
18800 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18801
18802 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18803 }
18804 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18805 ProcessStatement(prop->getStmt);
18806 }
18807 if(prop->issetStmt)
18808 {
18809 if(regClass)
18810 {
18811 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18812
18813 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18814 }
18815 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18816 ProcessStatement(prop->issetStmt);
18817 }
18818 thisClass = (((void *)0));
18819 }
18820 else if(def->type == 4 && def->__anon1.propertyWatch)
18821 {
18822 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18823
18824 thisClass = regClass;
18825 if(propertyWatch->compound)
18826 {
18827 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);
18828
18829 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18830 curExternal = (((void *)0));
18831 ProcessStatement(propertyWatch->compound);
18832 }
18833 thisClass = (((void *)0));
18834 }
18835 }
18836 }
18837
18838 void DeclareFunctionUtil(const char * s)
18839 {
18840 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18841
18842 if(function)
18843 {
18844 char name[1024];
18845
18846 name[0] = (char)0;
18847 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18848 strcpy(name, "__ecereFunction_");
18849 FullClassNameCat(name, s, 0);
18850 DeclareFunction(function, name);
18851 }
18852 }
18853
18854 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18855
18856 void ComputeDataTypes()
18857 {
18858 struct External * external;
18859 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18860 struct External * after = (((void *)0));
18861
18862 currentClass = (((void *)0));
18863 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18864 for(external = (*ast).first; external; external = external->next)
18865 {
18866 if(external->type == 1)
18867 {
18868 struct Declaration * decl = external->__anon1.declaration;
18869
18870 if(decl)
18871 {
18872 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18873
18874 if(decls)
18875 {
18876 struct InitDeclarator * initDecl = (*decls).first;
18877
18878 if(initDecl)
18879 {
18880 struct Declarator * declarator = initDecl->declarator;
18881
18882 if(declarator && declarator->type == 1)
18883 {
18884 struct Identifier * id = declarator->__anon1.identifier;
18885
18886 if(id && id->string)
18887 {
18888 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18889 {
18890 external->symbol->id = -1001, external->symbol->idCode = -1001;
18891 after = external;
18892 }
18893 }
18894 }
18895 }
18896 }
18897 }
18898 }
18899 }
18900 {
18901 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18902
18903 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18904 after = e;
18905 }
18906 temp->symbol = __extension__ ({
18907 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18908
18909 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18910 });
18911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18912 curExternal = temp;
18913 DeclareFunctionUtil("eSystem_New");
18914 DeclareFunctionUtil("eSystem_New0");
18915 DeclareFunctionUtil("eSystem_Renew");
18916 DeclareFunctionUtil("eSystem_Renew0");
18917 DeclareFunctionUtil("eSystem_Delete");
18918 DeclareFunctionUtil("eClass_GetProperty");
18919 DeclareFunctionUtil("eClass_SetProperty");
18920 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18921 DeclareFunctionUtil("eInstance_SetMethod");
18922 DeclareFunctionUtil("eInstance_IncRef");
18923 DeclareFunctionUtil("eInstance_StopWatching");
18924 DeclareFunctionUtil("eInstance_Watch");
18925 DeclareFunctionUtil("eInstance_FireWatchers");
18926 DeclareStruct("ecere::com::Class", 0);
18927 DeclareStruct("ecere::com::Instance", 0);
18928 DeclareStruct("ecere::com::Property", 0);
18929 DeclareStruct("ecere::com::DataMember", 0);
18930 DeclareStruct("ecere::com::Method", 0);
18931 DeclareStruct("ecere::com::SerialBuffer", 0);
18932 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18934 for(external = (*ast).first; external; external = external->next)
18935 {
18936 afterExternal = curExternal = external;
18937 if(external->type == 0)
18938 {
18939 currentClass = external->__anon1.function->_class;
18940 ProcessFunction(external->__anon1.function);
18941 }
18942 else if(external->type == 1)
18943 {
18944 currentClass = (((void *)0));
18945 if(external->__anon1.declaration)
18946 ProcessDeclaration(external->__anon1.declaration);
18947 }
18948 else if(external->type == 2)
18949 {
18950 struct ClassDefinition * _class = external->__anon1._class;
18951
18952 currentClass = external->symbol->__anon1.registered;
18953 if(_class->definitions)
18954 {
18955 ProcessClass(_class->definitions, _class->symbol);
18956 }
18957 if(inCompiler)
18958 {
18959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18960 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18961 }
18962 }
18963 else if(external->type == 4)
18964 {
18965 thisNameSpace = external->__anon1.id->string;
18966 }
18967 }
18968 currentClass = (((void *)0));
18969 thisNameSpace = (((void *)0));
18970 curExternal = (((void *)0));
18971 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18972 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18973 }
18974
18975 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);
18976
18977 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);
18978
18979 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18980
18981 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18982 {
18983 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18984
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19034 __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);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19038 __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);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19051 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19052 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19053 __ecereClass_Conversion = class;
19054 __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);
19055 __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);
19056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19057 __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);
19058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19080 }
19081
19082 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19083 {
19084
19085 }
19086