compiler/libec: Fixed warnings in generated code for incompatible pointer types
[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 unsigned int wideString;
409 } __attribute__ ((gcc_struct)) __anon2;
410 struct __ecereNameSpace__ecere__sys__OldList *  list;
411 struct
412 {
413 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
414 struct Declarator * decl;
415 } __attribute__ ((gcc_struct)) _classExp;
416 struct
417 {
418 struct Identifier * id;
419 } __attribute__ ((gcc_struct)) classData;
420 struct
421 {
422 struct Expression * exp;
423 struct __ecereNameSpace__ecere__sys__OldList * arguments;
424 struct Location argLoc;
425 } __attribute__ ((gcc_struct)) call;
426 struct
427 {
428 struct Expression * exp;
429 struct __ecereNameSpace__ecere__sys__OldList * index;
430 } __attribute__ ((gcc_struct)) index;
431 struct
432 {
433 struct Expression * exp;
434 struct Identifier * member;
435 int memberType;
436 unsigned int thisPtr;
437 } __attribute__ ((gcc_struct)) member;
438 struct
439 {
440 int op;
441 struct Expression * exp1;
442 struct Expression * exp2;
443 } __attribute__ ((gcc_struct)) op;
444 struct TypeName * typeName;
445 struct Specifier * _class;
446 struct
447 {
448 struct TypeName * typeName;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) cast;
451 struct
452 {
453 struct Expression * cond;
454 struct __ecereNameSpace__ecere__sys__OldList * exp;
455 struct Expression * elseExp;
456 } __attribute__ ((gcc_struct)) cond;
457 struct
458 {
459 struct TypeName * typeName;
460 struct Expression * size;
461 } __attribute__ ((gcc_struct)) _new;
462 struct
463 {
464 struct TypeName * typeName;
465 struct Expression * size;
466 struct Expression * exp;
467 } __attribute__ ((gcc_struct)) _renew;
468 struct
469 {
470 char * table;
471 struct Identifier * id;
472 } __attribute__ ((gcc_struct)) db;
473 struct
474 {
475 struct Expression * ds;
476 struct Expression * name;
477 } __attribute__ ((gcc_struct)) dbopen;
478 struct
479 {
480 struct TypeName * typeName;
481 struct Initializer * initializer;
482 } __attribute__ ((gcc_struct)) initializer;
483 struct
484 {
485 struct Expression * exp;
486 struct TypeName * typeName;
487 } __attribute__ ((gcc_struct)) vaArg;
488 } __attribute__ ((gcc_struct)) __anon1;
489 unsigned int debugValue;
490 struct __ecereNameSpace__ecere__com__DataValue val;
491 uint64 address;
492 unsigned int hasAddress;
493 struct Type * expType;
494 struct Type * destType;
495 unsigned int usage;
496 int tempCount;
497 unsigned int byReference;
498 unsigned int isConstant;
499 unsigned int addedThis;
500 unsigned int needCast;
501 unsigned int thisPtr;
502 unsigned int opDestType;
503 unsigned int needTemplateCast;
504 } __attribute__ ((gcc_struct));
505
506 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
507
508 struct TemplateDatatype
509 {
510 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
511 struct Declarator * decl;
512 } __attribute__ ((gcc_struct));
513
514 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
515
516 struct TemplateArgument;
517
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
519
520 struct TemplateParameter
521 {
522 struct TemplateParameter * prev;
523 struct TemplateParameter * next;
524 struct Location loc;
525 int type;
526 struct Identifier * identifier;
527 union
528 {
529 struct TemplateDatatype * dataType;
530 int memberType;
531 } __attribute__ ((gcc_struct)) __anon1;
532 struct TemplateArgument * defaultArgument;
533 const char *  dataTypeString;
534 struct Type * baseType;
535 } __attribute__ ((gcc_struct));
536
537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
538
539 struct Specifier
540 {
541 struct Specifier * prev;
542 struct Specifier * next;
543 struct Location loc;
544 int type;
545 union
546 {
547 int specifier;
548 struct
549 {
550 struct ExtDecl * extDecl;
551 char *  name;
552 struct Symbol * symbol;
553 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
554 } __attribute__ ((gcc_struct)) __anon1;
555 struct
556 {
557 struct Identifier * id;
558 struct __ecereNameSpace__ecere__sys__OldList *  list;
559 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
560 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
561 unsigned int addNameSpace;
562 struct Context * ctx;
563 struct ExtDecl * extDeclStruct;
564 } __attribute__ ((gcc_struct)) __anon2;
565 struct Expression * expression;
566 struct Specifier * _class;
567 struct TemplateParameter * templateParameter;
568 } __attribute__ ((gcc_struct)) __anon1;
569 } __attribute__ ((gcc_struct));
570
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
572
573 struct Identifier
574 {
575 struct Identifier * prev;
576 struct Identifier * next;
577 struct Location loc;
578 struct Symbol * classSym;
579 struct Specifier * _class;
580 char *  string;
581 struct Identifier * badID;
582 } __attribute__ ((gcc_struct));
583
584 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
585
586 struct Pointer;
587
588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
589
590 struct Declarator
591 {
592 struct Declarator * prev;
593 struct Declarator * next;
594 struct Location loc;
595 int type;
596 struct Symbol * symbol;
597 struct Declarator * declarator;
598 union
599 {
600 struct Identifier * identifier;
601 struct
602 {
603 struct Expression * exp;
604 struct Expression * posExp;
605 struct Attrib * attrib;
606 } __attribute__ ((gcc_struct)) structDecl;
607 struct
608 {
609 struct Expression * exp;
610 struct Specifier * enumClass;
611 } __attribute__ ((gcc_struct)) array;
612 struct
613 {
614 struct __ecereNameSpace__ecere__sys__OldList * parameters;
615 } __attribute__ ((gcc_struct)) function;
616 struct
617 {
618 struct Pointer * pointer;
619 } __attribute__ ((gcc_struct)) pointer;
620 struct
621 {
622 struct ExtDecl * extended;
623 } __attribute__ ((gcc_struct)) extended;
624 } __attribute__ ((gcc_struct)) __anon1;
625 } __attribute__ ((gcc_struct));
626
627 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
628
629 struct FunctionDefinition
630 {
631 struct FunctionDefinition * prev;
632 struct FunctionDefinition * next;
633 struct Location loc;
634 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
635 struct Declarator * declarator;
636 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
637 struct Statement * body;
638 struct __ecereNameSpace__ecere__com__Class * _class;
639 struct __ecereNameSpace__ecere__sys__OldList attached;
640 int declMode;
641 struct Type * type;
642 struct Symbol * propSet;
643 int tempCount;
644 unsigned int propertyNoThis;
645 } __attribute__ ((gcc_struct));
646
647 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
648
649 struct DBTableDef;
650
651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
652
653 struct External
654 {
655 struct External * prev;
656 struct External * next;
657 struct Location loc;
658 int type;
659 struct Symbol * symbol;
660 union
661 {
662 struct FunctionDefinition * function;
663 struct ClassDefinition * _class;
664 struct Declaration * declaration;
665 char *  importString;
666 struct Identifier * id;
667 struct DBTableDef * table;
668 } __attribute__ ((gcc_struct)) __anon1;
669 int importType;
670 } __attribute__ ((gcc_struct));
671
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
673
674 struct ModuleImport
675 {
676 struct ModuleImport * prev;
677 struct ModuleImport * next;
678 char *  name;
679 struct __ecereNameSpace__ecere__sys__OldList classes;
680 struct __ecereNameSpace__ecere__sys__OldList functions;
681 int importType;
682 int importAccess;
683 } __attribute__ ((gcc_struct));
684
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
686
687 struct ClassImport
688 {
689 struct ClassImport * prev;
690 struct ClassImport * next;
691 char *  name;
692 struct __ecereNameSpace__ecere__sys__OldList methods;
693 struct __ecereNameSpace__ecere__sys__OldList properties;
694 unsigned int itself;
695 int isRemote;
696 } __attribute__ ((gcc_struct));
697
698 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
699
700 struct Symbol
701 {
702 char *  string;
703 struct Symbol * parent;
704 struct Symbol * left;
705 struct Symbol * right;
706 int depth;
707 struct Type * type;
708 union
709 {
710 struct __ecereNameSpace__ecere__com__Method * method;
711 struct __ecereNameSpace__ecere__com__Property * _property;
712 struct __ecereNameSpace__ecere__com__Class * registered;
713 } __attribute__ ((gcc_struct)) __anon1;
714 int id;
715 int idCode;
716 union
717 {
718 struct
719 {
720 struct External * pointerExternal;
721 struct External * structExternal;
722 } __attribute__ ((gcc_struct)) __anon1;
723 struct
724 {
725 struct External * externalGet;
726 struct External * externalSet;
727 struct External * externalPtr;
728 struct External * externalIsSet;
729 } __attribute__ ((gcc_struct)) __anon2;
730 struct
731 {
732 struct External * methodExternal;
733 struct External * methodCodeExternal;
734 } __attribute__ ((gcc_struct)) __anon3;
735 } __attribute__ ((gcc_struct)) __anon2;
736 unsigned int imported;
737 unsigned int declaredStructSym;
738 struct __ecereNameSpace__ecere__com__Class * _class;
739 unsigned int declaredStruct;
740 unsigned int needConstructor;
741 unsigned int needDestructor;
742 char *  constructorName;
743 char *  structName;
744 char *  className;
745 char *  destructorName;
746 struct ModuleImport * module;
747 struct ClassImport * _import;
748 struct Location nameLoc;
749 unsigned int isParam;
750 unsigned int isRemote;
751 unsigned int isStruct;
752 unsigned int fireWatchersDone;
753 int declaring;
754 unsigned int classData;
755 unsigned int isStatic;
756 char *  shortName;
757 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
758 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
759 struct Context * ctx;
760 int isIterator;
761 struct Expression * propCategory;
762 } __attribute__ ((gcc_struct));
763
764 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
765
766 struct Type
767 {
768 struct Type * prev;
769 struct Type * next;
770 int refCount;
771 union
772 {
773 struct Symbol * _class;
774 struct
775 {
776 struct __ecereNameSpace__ecere__sys__OldList members;
777 char *  enumName;
778 } __attribute__ ((gcc_struct)) __anon1;
779 struct
780 {
781 struct Type * returnType;
782 struct __ecereNameSpace__ecere__sys__OldList params;
783 struct Symbol * thisClass;
784 unsigned int staticMethod;
785 struct TemplateParameter * thisClassTemplate;
786 } __attribute__ ((gcc_struct)) __anon2;
787 struct
788 {
789 struct __ecereNameSpace__ecere__com__Method * method;
790 struct __ecereNameSpace__ecere__com__Class * methodClass;
791 struct __ecereNameSpace__ecere__com__Class * usedClass;
792 } __attribute__ ((gcc_struct)) __anon3;
793 struct
794 {
795 struct Type * arrayType;
796 int arraySize;
797 struct Expression * arraySizeExp;
798 unsigned int freeExp;
799 struct Symbol * enumClass;
800 } __attribute__ ((gcc_struct)) __anon4;
801 struct Type * type;
802 struct TemplateParameter * templateParameter;
803 } __attribute__ ((gcc_struct)) __anon1;
804 int kind;
805 unsigned int size;
806 char *  name;
807 char *  typeName;
808 int classObjectType;
809 int alignment;
810 unsigned int offset;
811 int bitFieldCount;
812 int count;
813 unsigned int isSigned : 1;
814 unsigned int constant : 1;
815 unsigned int truth : 1;
816 unsigned int byReference : 1;
817 unsigned int extraParam : 1;
818 unsigned int directClassAccess : 1;
819 unsigned int computing : 1;
820 unsigned int keepCast : 1;
821 unsigned int passAsTemplate : 1;
822 unsigned int dllExport : 1;
823 unsigned int attrStdcall : 1;
824 unsigned int declaredWithStruct : 1;
825 unsigned int typedByReference : 1;
826 unsigned int casted : 1;
827 } __attribute__ ((gcc_struct));
828
829 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
830
831 struct __ecereNameSpace__ecere__com__Class
832 {
833 struct __ecereNameSpace__ecere__com__Class * prev;
834 struct __ecereNameSpace__ecere__com__Class * next;
835 const char *  name;
836 int offset;
837 int structSize;
838 void * *  _vTbl;
839 int vTblSize;
840 unsigned int (*  Constructor)(void * );
841 void (*  Destructor)(void * );
842 int offsetClass;
843 int sizeClass;
844 struct __ecereNameSpace__ecere__com__Class * base;
845 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
846 struct __ecereNameSpace__ecere__sys__BinaryTree members;
847 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
848 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
849 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
850 struct __ecereNameSpace__ecere__sys__OldList derivatives;
851 int memberID;
852 int startMemberID;
853 int type;
854 struct __ecereNameSpace__ecere__com__Instance * module;
855 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
856 const char *  dataTypeString;
857 struct Type * dataType;
858 int typeSize;
859 int defaultAlignment;
860 void (*  Initialize)();
861 int memberOffset;
862 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
863 const char *  designerClass;
864 unsigned int noExpansion;
865 const char *  defaultProperty;
866 unsigned int comRedefinition;
867 int count;
868 int isRemote;
869 unsigned int internalDecl;
870 void *  data;
871 unsigned int computeSize;
872 int structAlignment;
873 int destructionWatchOffset;
874 unsigned int fixed;
875 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
876 int inheritanceAccess;
877 const char *  fullName;
878 void *  symbol;
879 struct __ecereNameSpace__ecere__sys__OldList conversions;
880 struct __ecereNameSpace__ecere__sys__OldList templateParams;
881 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
882 struct __ecereNameSpace__ecere__com__Class * templateClass;
883 struct __ecereNameSpace__ecere__sys__OldList templatized;
884 int numParams;
885 unsigned int isInstanceClass;
886 unsigned int byValueSystemClass;
887 } __attribute__ ((gcc_struct));
888
889 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
890
891 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
892
893 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
894
895 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
896
897 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
898
899 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);
900
901 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
902
903 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
904
905 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
906
907 struct __ecereNameSpace__ecere__com__Instance
908 {
909 void * *  _vTbl;
910 struct __ecereNameSpace__ecere__com__Class * _class;
911 int _refCount;
912 } __attribute__ ((gcc_struct));
913
914 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
915
916 struct __ecereNameSpace__ecere__com__DataMember
917 {
918 struct __ecereNameSpace__ecere__com__DataMember * prev;
919 struct __ecereNameSpace__ecere__com__DataMember * next;
920 const char *  name;
921 unsigned int isProperty;
922 int memberAccess;
923 int id;
924 struct __ecereNameSpace__ecere__com__Class * _class;
925 const char *  dataTypeString;
926 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
927 struct Type * dataType;
928 int type;
929 int offset;
930 int memberID;
931 struct __ecereNameSpace__ecere__sys__OldList members;
932 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
933 int memberOffset;
934 int structAlignment;
935 } __attribute__ ((gcc_struct));
936
937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
938
939 struct __ecereNameSpace__ecere__com__SerialBuffer
940 {
941 unsigned char *  _buffer;
942 unsigned int count;
943 unsigned int _size;
944 unsigned int pos;
945 } __attribute__ ((gcc_struct));
946
947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
948
949 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
950 {
951 union
952 {
953 struct
954 {
955 const char *  dataTypeString;
956 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
957 } __attribute__ ((gcc_struct)) __anon1;
958 struct __ecereNameSpace__ecere__com__DataValue expression;
959 struct
960 {
961 const char *  memberString;
962 union
963 {
964 struct __ecereNameSpace__ecere__com__DataMember * member;
965 struct __ecereNameSpace__ecere__com__Property * prop;
966 struct __ecereNameSpace__ecere__com__Method * method;
967 } __attribute__ ((gcc_struct)) __anon1;
968 } __attribute__ ((gcc_struct)) __anon2;
969 } __attribute__ ((gcc_struct)) __anon1;
970 } __attribute__ ((gcc_struct));
971
972 void exit(int status);
973
974 void * calloc(size_t nmemb, size_t size);
975
976 void free(void * ptr);
977
978 void * malloc(size_t size);
979
980 void * realloc(void * ptr, size_t size);
981
982 long int strtol(const char * nptr, char ** endptr, int base);
983
984 long long int strtoll(const char * nptr, char ** endptr, int base);
985
986 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
987
988 enum yytokentype
989 {
990 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, WIDE_STRING_LITERAL = 373
991 };
992
993 typedef union YYSTYPE
994 {
995 int specifierType;
996 int i;
997 int declMode;
998 struct Identifier * id;
999 struct Expression * exp;
1000 struct Specifier * specifier;
1001 struct __ecereNameSpace__ecere__sys__OldList * list;
1002 struct Enumerator * enumerator;
1003 struct Declarator * declarator;
1004 struct Pointer * pointer;
1005 struct Initializer * initializer;
1006 struct InitDeclarator * initDeclarator;
1007 struct TypeName * typeName;
1008 struct Declaration * declaration;
1009 struct Statement * stmt;
1010 struct FunctionDefinition * function;
1011 struct External * external;
1012 struct Context * context;
1013 struct AsmField * asmField;
1014 struct Attrib * attrib;
1015 struct ExtDecl * extDecl;
1016 struct Attribute * attribute;
1017 struct Instantiation * instance;
1018 struct MembersInit * membersInit;
1019 struct MemberInit * memberInit;
1020 struct ClassFunction * classFunction;
1021 struct ClassDefinition * _class;
1022 struct ClassDef * classDef;
1023 struct PropertyDef * prop;
1024 char * string;
1025 struct Symbol * symbol;
1026 struct PropertyWatch * propertyWatch;
1027 struct TemplateParameter * templateParameter;
1028 struct TemplateArgument * templateArgument;
1029 struct TemplateDatatype * templateDatatype;
1030 struct DBTableEntry * dbtableEntry;
1031 struct DBIndexItem * dbindexItem;
1032 struct DBTableDef * dbtableDef;
1033 } __attribute__ ((gcc_struct)) YYSTYPE;
1034
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1036
1037 struct Enumerator
1038 {
1039 struct Enumerator * prev;
1040 struct Enumerator * next;
1041 struct Location loc;
1042 struct Identifier * id;
1043 struct Expression * exp;
1044 } __attribute__ ((gcc_struct));
1045
1046 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1047
1048 struct InitDeclarator
1049 {
1050 struct InitDeclarator * prev;
1051 struct InitDeclarator * next;
1052 struct Location loc;
1053 struct Declarator * declarator;
1054 struct Initializer * initializer;
1055 } __attribute__ ((gcc_struct));
1056
1057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1058
1059 struct AsmField
1060 {
1061 struct AsmField * prev;
1062 struct AsmField * next;
1063 struct Location loc;
1064 char *  command;
1065 struct Expression * expression;
1066 struct Identifier * symbolic;
1067 } __attribute__ ((gcc_struct));
1068
1069 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1070
1071 struct Attribute;
1072
1073 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1074
1075 struct ClassFunction
1076 {
1077 struct ClassFunction * prev;
1078 struct ClassFunction * next;
1079 struct Location loc;
1080 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1081 struct Declarator * declarator;
1082 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1083 struct Statement * body;
1084 struct __ecereNameSpace__ecere__com__Class * _class;
1085 struct __ecereNameSpace__ecere__sys__OldList attached;
1086 int declMode;
1087 struct Type * type;
1088 struct Symbol * propSet;
1089 unsigned int isVirtual;
1090 unsigned int isConstructor;
1091 unsigned int isDestructor;
1092 unsigned int dontMangle;
1093 int id;
1094 int idCode;
1095 } __attribute__ ((gcc_struct));
1096
1097 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1098
1099 struct MembersInit
1100 {
1101 struct MembersInit * prev;
1102 struct MembersInit * next;
1103 struct Location loc;
1104 int type;
1105 union
1106 {
1107 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1108 struct ClassFunction * function;
1109 } __attribute__ ((gcc_struct)) __anon1;
1110 } __attribute__ ((gcc_struct));
1111
1112 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1113
1114 struct MemberInit
1115 {
1116 struct MemberInit * prev;
1117 struct MemberInit * next;
1118 struct Location loc;
1119 struct Location realLoc;
1120 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1121 struct Initializer * initializer;
1122 unsigned int used;
1123 unsigned int variable;
1124 unsigned int takeOutExp;
1125 } __attribute__ ((gcc_struct));
1126
1127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1128
1129 struct PropertyDef
1130 {
1131 struct PropertyDef * prev;
1132 struct PropertyDef * next;
1133 struct Location loc;
1134 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1135 struct Declarator * declarator;
1136 struct Identifier * id;
1137 struct Statement * getStmt;
1138 struct Statement * setStmt;
1139 struct Statement * issetStmt;
1140 struct Symbol * symbol;
1141 struct Expression * category;
1142 struct
1143 {
1144 unsigned int conversion : 1;
1145 unsigned int isWatchable : 1;
1146 unsigned int isDBProp : 1;
1147 } __attribute__ ((gcc_struct)) __anon1;
1148 } __attribute__ ((gcc_struct));
1149
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1151
1152 struct PropertyWatch
1153 {
1154 struct PropertyWatch * prev;
1155 struct PropertyWatch * next;
1156 struct Location loc;
1157 struct Statement * compound;
1158 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1159 unsigned int deleteWatch;
1160 } __attribute__ ((gcc_struct));
1161
1162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1163
1164 struct ClassDef
1165 {
1166 struct ClassDef * prev;
1167 struct ClassDef * next;
1168 struct Location loc;
1169 int type;
1170 union
1171 {
1172 struct Declaration * decl;
1173 struct ClassFunction * function;
1174 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1175 struct PropertyDef * propertyDef;
1176 struct PropertyWatch * propertyWatch;
1177 char *  designer;
1178 struct Identifier * defaultProperty;
1179 struct
1180 {
1181 struct Identifier * id;
1182 struct Initializer * initializer;
1183 } __attribute__ ((gcc_struct)) __anon1;
1184 } __attribute__ ((gcc_struct)) __anon1;
1185 int memberAccess;
1186 void *  object;
1187 } __attribute__ ((gcc_struct));
1188
1189 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1190
1191 struct DBTableEntry;
1192
1193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1194
1195 struct DBIndexItem;
1196
1197 extern YYSTYPE yylval;
1198
1199 extern struct Location yylloc;
1200
1201 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1202
1203 extern int returnCode;
1204
1205 extern struct Expression * parsedExpression;
1206
1207 extern unsigned int yydebug;
1208
1209 void SetYydebug(unsigned int b)
1210 {
1211 yydebug = b;
1212 }
1213
1214 extern unsigned int echoOn;
1215
1216 void resetScanner();
1217
1218 int propWatcherID;
1219
1220 int expression_yyparse();
1221
1222 static struct Statement * curCompound;
1223
1224 struct External * curExternal, * afterExternal;
1225
1226 static struct Type * curSwitchType;
1227
1228 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1229
1230 struct __ecereNameSpace__ecere__com__Class * thisClass;
1231
1232 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1233 {
1234 thisClass = c;
1235 }
1236
1237 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1238 {
1239 return thisClass;
1240 }
1241
1242 static char * thisNameSpace;
1243
1244 struct __ecereNameSpace__ecere__com__Class * containerClass;
1245
1246 unsigned int thisClassParams = 1;
1247
1248 unsigned int internalValueCounter;
1249
1250 extern unsigned int outputLineNumbers;
1251
1252 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1253
1254 extern size_t strlen(const char * );
1255
1256 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1257
1258 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1259
1260 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1261
1262 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1263
1264 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1265
1266 void PrintExpression(struct Expression * exp, char * string)
1267 {
1268 {
1269 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1270 int count;
1271 unsigned int backOutputLineNumbers = outputLineNumbers;
1272
1273 outputLineNumbers = 0;
1274 if(exp)
1275 OutputExpression(exp, f);
1276 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1277 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1278
1279 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1280 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1281 count = strlen(string);
1282 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1283 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1284
1285 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1286 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1287 string[count] = '\0';
1288 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1289 outputLineNumbers = backOutputLineNumbers;
1290 }
1291 }
1292
1293 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1294
1295 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1296
1297 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1298 {
1299 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1300 {
1301 if(!param->baseType)
1302 {
1303 if(param->dataTypeString)
1304 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1305 else
1306 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1307 }
1308 return param->baseType;
1309 }
1310 return (((void *)0));
1311 }
1312
1313 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1314 {
1315 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1316 return 1;
1317 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1318 {
1319 return 0;
1320 }
1321 if(type1->kind == type2->kind)
1322 {
1323 switch(type1->kind)
1324 {
1325 case 24:
1326 case 1:
1327 case 2:
1328 case 3:
1329 case 4:
1330 case 22:
1331 case 23:
1332 if(type1->passAsTemplate && !type2->passAsTemplate)
1333 return 1;
1334 return type1->isSigned != type2->isSigned;
1335 case 8:
1336 return type1->__anon1._class != type2->__anon1._class;
1337 case 13:
1338 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1339 default:
1340 return 1;
1341 }
1342 }
1343 return 1;
1344 }
1345
1346 extern int strcmp(const char * , const char * );
1347
1348 extern struct Context * curContext;
1349
1350 extern struct Context * topContext;
1351
1352 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1353
1354 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);
1355
1356 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1357
1358 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);
1359
1360 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);
1361
1362 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1363
1364 struct __ecereNameSpace__ecere__com__ClassProperty
1365 {
1366 const char *  name;
1367 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1368 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1369 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1370 int depth;
1371 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1372 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1373 const char *  dataTypeString;
1374 struct Type * dataType;
1375 unsigned int constant;
1376 } __attribute__ ((gcc_struct));
1377
1378 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1379
1380 extern struct Expression * QMkExpId(const char *  id);
1381
1382 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1383
1384 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1385 {
1386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1387 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1388 const char *  name;
1389 int type;
1390 union
1391 {
1392 const char *  dataTypeString;
1393 int memberType;
1394 } __attribute__ ((gcc_struct)) __anon1;
1395 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1396 void *  param;
1397 } __attribute__ ((gcc_struct));
1398
1399 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1400
1401 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1402
1403 extern void FreeIdentifier(struct Identifier * id);
1404
1405 void ProcessExpressionType(struct Expression * exp);
1406
1407 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1408
1409 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1410
1411 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1412
1413 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1414
1415 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1416
1417 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1418
1419 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1420
1421 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1422
1423 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1424 {
1425 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1426 {
1427 struct Identifier * id = exp->__anon1.__anon1.identifier;
1428 struct Context * ctx;
1429 struct Symbol * symbol = (((void *)0));
1430
1431 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1432 {
1433 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1434 {
1435 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1436 if(symbol)
1437 break;
1438 }
1439 }
1440 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))))
1441 {
1442 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1443 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1444 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1445 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1446
1447 if(!prop)
1448 {
1449 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1450 }
1451 if(!prop && !method)
1452 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1453 if(!prop && !method && !member)
1454 {
1455 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1456 }
1457 if(prop || method || member || classProp)
1458 {
1459 exp->type = 8;
1460 exp->__anon1.member.member = id;
1461 exp->__anon1.member.memberType = 0;
1462 exp->__anon1.member.exp = QMkExpId("this");
1463 exp->addedThis = 1;
1464 }
1465 else if(_class && _class->templateParams.first)
1466 {
1467 struct __ecereNameSpace__ecere__com__Class * sClass;
1468
1469 for(sClass = _class; sClass; sClass = sClass->base)
1470 {
1471 if(sClass->templateParams.first)
1472 {
1473 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1474
1475 for(param = sClass->templateParams.first; param; param = param->next)
1476 {
1477 if(param->type == 2 && !strcmp(param->name, id->string))
1478 {
1479 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1480
1481 if(argExp)
1482 {
1483 struct Declarator * decl;
1484 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1485
1486 FreeIdentifier(exp->__anon1.member.member);
1487 ProcessExpressionType(argExp);
1488 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1489 exp->expType = ProcessType(specs, decl);
1490 exp->type = 5;
1491 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1492 }
1493 }
1494 }
1495 }
1496 }
1497 }
1498 }
1499 }
1500 }
1501
1502 extern int sprintf(char * , const char * , ...);
1503
1504 extern char *  strcat(char * , const char * );
1505
1506 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1507
1508 char * PrintInt(long long result)
1509 {
1510 char temp[100];
1511
1512 if(result > (((int)0x7fffffff)))
1513 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1514 else
1515 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1516 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1517 strcat(temp, "LL");
1518 return __ecereNameSpace__ecere__sys__CopyString(temp);
1519 }
1520
1521 char * PrintUInt(uint64 result)
1522 {
1523 char temp[100];
1524
1525 if(result > (0xffffffff))
1526 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1527 else if(result > (((int)0x7fffffff)))
1528 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1529 else
1530 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1531 return __ecereNameSpace__ecere__sys__CopyString(temp);
1532 }
1533
1534 char * PrintInt64(long long result)
1535 {
1536 char temp[100];
1537
1538 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1539 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
1540 else
1541 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1542 return __ecereNameSpace__ecere__sys__CopyString(temp);
1543 }
1544
1545 char * PrintUInt64(uint64 result)
1546 {
1547 char temp[100];
1548
1549 if(result > (0xffffffff))
1550 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1551 else if(result > (((int)0x7fffffff)))
1552 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1553 else
1554 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1555 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 }
1557
1558 char * PrintHexUInt(uint64 result)
1559 {
1560 char temp[100];
1561
1562 if(result > (0xffffffff))
1563 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1564 else
1565 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1566 if(result > (0xffffffff))
1567 strcat(temp, "LL");
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1569 }
1570
1571 char * PrintHexUInt64(uint64 result)
1572 {
1573 char temp[100];
1574
1575 if(result > (0xffffffff))
1576 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1577 else
1578 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 }
1581
1582 char * PrintShort(short result)
1583 {
1584 char temp[100];
1585
1586 sprintf(temp, "%d", (unsigned short)result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 }
1589
1590 char * PrintUShort(unsigned short result)
1591 {
1592 char temp[100];
1593
1594 if(result > (unsigned short)32767)
1595 sprintf(temp, "0x%X", (int)result);
1596 else
1597 sprintf(temp, "%d", (int)result);
1598 return __ecereNameSpace__ecere__sys__CopyString(temp);
1599 }
1600
1601 extern int isprint(int c);
1602
1603 char * PrintChar(char result)
1604 {
1605 char temp[100];
1606
1607 if(result > (char)0 && isprint(result))
1608 sprintf(temp, "'%c'", result);
1609 else if(result < (char)0)
1610 sprintf(temp, "%d", (int)result);
1611 else
1612 sprintf(temp, "0x%X", (unsigned char)result);
1613 return __ecereNameSpace__ecere__sys__CopyString(temp);
1614 }
1615
1616 char * PrintUChar(unsigned char result)
1617 {
1618 char temp[100];
1619
1620 sprintf(temp, "0x%X", result);
1621 return __ecereNameSpace__ecere__sys__CopyString(temp);
1622 }
1623
1624 extern char *  strcpy(char * , const char * );
1625
1626 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1627
1628 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
1629
1630 extern int (* __ecereProp_float_Get_signBit)(float this);
1631
1632 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
1633
1634 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1635
1636 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
1637
1638 char * PrintFloat(float result)
1639 {
1640 char temp[350];
1641
1642 if(__ecereProp_float_Get_isInf(result))
1643 {
1644 if(__ecereProp_float_Get_signBit(result))
1645 strcpy(temp, "-inf");
1646 else
1647 strcpy(temp, "inf");
1648 }
1649 else if(__ecereProp_float_Get_isNan(result))
1650 {
1651 if(__ecereProp_float_Get_signBit(result))
1652 strcpy(temp, "-nan");
1653 else
1654 strcpy(temp, "nan");
1655 }
1656 else
1657 sprintf(temp, "%.16ff", result);
1658 return __ecereNameSpace__ecere__sys__CopyString(temp);
1659 }
1660
1661 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1662
1663 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
1664
1665 extern int (* __ecereProp_double_Get_signBit)(double this);
1666
1667 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
1668
1669 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1670
1671 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
1672
1673 char * PrintDouble(double result)
1674 {
1675 char temp[350];
1676
1677 if(__ecereProp_double_Get_isInf(result))
1678 {
1679 if(__ecereProp_double_Get_signBit(result))
1680 strcpy(temp, "-inf");
1681 else
1682 strcpy(temp, "inf");
1683 }
1684 else if(__ecereProp_double_Get_isNan(result))
1685 {
1686 if(__ecereProp_double_Get_signBit(result))
1687 strcpy(temp, "-nan");
1688 else
1689 strcpy(temp, "nan");
1690 }
1691 else
1692 sprintf(temp, "%.16f", result);
1693 return __ecereNameSpace__ecere__sys__CopyString(temp);
1694 }
1695
1696 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1697
1698 struct OpTable
1699 {
1700 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1706 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1707 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1708 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1720 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1725 unsigned int (*  Not)(struct Expression *, struct Operand *);
1726 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1728 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1729 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1730 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1731 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1732 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1733 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1734 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1735 } __attribute__ ((gcc_struct));
1736
1737 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1738
1739 struct Operand
1740 {
1741 int kind;
1742 struct Type * type;
1743 unsigned int ptrSize;
1744 union
1745 {
1746 char c;
1747 unsigned char uc;
1748 short s;
1749 unsigned short us;
1750 int i;
1751 unsigned int ui;
1752 float f;
1753 double d;
1754 long long i64;
1755 uint64 ui64;
1756 } __attribute__ ((gcc_struct)) __anon1;
1757 struct OpTable ops;
1758 } __attribute__ ((gcc_struct));
1759
1760 unsigned int GetOpInt(struct Operand * op2, int * value2)
1761 {
1762 if(op2->kind == 3 && op2->type->isSigned)
1763 *value2 = op2->__anon1.i;
1764 else if(op2->kind == 3)
1765 *value2 = (int)op2->__anon1.ui;
1766 else if(op2->kind == 4 && op2->type->isSigned)
1767 *value2 = (int)op2->__anon1.i64;
1768 else if(op2->kind == 4)
1769 *value2 = (int)op2->__anon1.ui64;
1770 else if(op2->kind == 23 && op2->type->isSigned)
1771 *value2 = (int)op2->__anon1.i64;
1772 else if(op2->kind == 23)
1773 *value2 = (int)op2->__anon1.ui64;
1774 else if(op2->kind == 22 && op2->type->isSigned)
1775 *value2 = (int)op2->__anon1.i64;
1776 else if(op2->kind == 22)
1777 *value2 = (int)op2->__anon1.ui64;
1778 else if(op2->kind == 2 && op2->type->isSigned)
1779 *value2 = (int)op2->__anon1.s;
1780 else if(op2->kind == 2)
1781 *value2 = (int)op2->__anon1.us;
1782 else if(op2->kind == 1 && op2->type->isSigned)
1783 *value2 = (int)op2->__anon1.c;
1784 else if(op2->kind == 24 || op2->kind == 1)
1785 *value2 = (int)op2->__anon1.uc;
1786 else if(op2->kind == 6)
1787 *value2 = (int)op2->__anon1.f;
1788 else if(op2->kind == 7)
1789 *value2 = (int)op2->__anon1.d;
1790 else if(op2->kind == 13)
1791 *value2 = (int)op2->__anon1.ui64;
1792 else
1793 return 0;
1794 return 1;
1795 }
1796
1797 struct Operand GetOperand(struct Expression * exp);
1798
1799 unsigned int GetInt(struct Expression * exp, int * value2)
1800 {
1801 struct Operand op2 = GetOperand(exp);
1802
1803 return GetOpInt(&op2, value2);
1804 }
1805
1806 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1807 {
1808 if(op2->kind == 3 && op2->type->isSigned)
1809 *value2 = (unsigned int)op2->__anon1.i;
1810 else if(op2->kind == 3)
1811 *value2 = op2->__anon1.ui;
1812 else if(op2->kind == 4 && op2->type->isSigned)
1813 *value2 = (unsigned int)op2->__anon1.i64;
1814 else if(op2->kind == 4)
1815 *value2 = (unsigned int)op2->__anon1.ui64;
1816 else if(op2->kind == 23 && op2->type->isSigned)
1817 *value2 = (unsigned int)op2->__anon1.i64;
1818 else if(op2->kind == 23)
1819 *value2 = (unsigned int)op2->__anon1.ui64;
1820 else if(op2->kind == 22 && op2->type->isSigned)
1821 *value2 = (unsigned int)op2->__anon1.i64;
1822 else if(op2->kind == 22)
1823 *value2 = (unsigned int)op2->__anon1.ui64;
1824 else if(op2->kind == 2 && op2->type->isSigned)
1825 *value2 = (unsigned int)op2->__anon1.s;
1826 else if(op2->kind == 2)
1827 *value2 = (unsigned int)op2->__anon1.us;
1828 else if(op2->kind == 1 && op2->type->isSigned)
1829 *value2 = (unsigned int)op2->__anon1.c;
1830 else if(op2->kind == 24 || op2->kind == 1)
1831 *value2 = (unsigned int)op2->__anon1.uc;
1832 else if(op2->kind == 6)
1833 *value2 = (unsigned int)op2->__anon1.f;
1834 else if(op2->kind == 7)
1835 *value2 = (unsigned int)op2->__anon1.d;
1836 else if(op2->kind == 13)
1837 *value2 = (unsigned int)op2->__anon1.ui64;
1838 else
1839 return 0;
1840 return 1;
1841 }
1842
1843 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1844 {
1845 struct Operand op2 = GetOperand(exp);
1846
1847 return GetOpUInt(&op2, value2);
1848 }
1849
1850 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1851 {
1852 if(op2->kind == 3 && op2->type->isSigned)
1853 *value2 = (long long)op2->__anon1.i;
1854 else if(op2->kind == 3)
1855 *value2 = (long long)op2->__anon1.ui;
1856 else if(op2->kind == 4 && op2->type->isSigned)
1857 *value2 = op2->__anon1.i64;
1858 else if(op2->kind == 4)
1859 *value2 = (long long)op2->__anon1.ui64;
1860 else if(op2->kind == 23 && op2->type->isSigned)
1861 *value2 = op2->__anon1.i64;
1862 else if(op2->kind == 23)
1863 *value2 = (long long)op2->__anon1.ui64;
1864 else if(op2->kind == 22 && op2->type->isSigned)
1865 *value2 = op2->__anon1.i64;
1866 else if(op2->kind == 22)
1867 *value2 = (long long)op2->__anon1.ui64;
1868 else if(op2->kind == 2 && op2->type->isSigned)
1869 *value2 = (long long)op2->__anon1.s;
1870 else if(op2->kind == 2)
1871 *value2 = (long long)op2->__anon1.us;
1872 else if(op2->kind == 1 && op2->type->isSigned)
1873 *value2 = (long long)op2->__anon1.c;
1874 else if(op2->kind == 24 || op2->kind == 1)
1875 *value2 = (long long)op2->__anon1.uc;
1876 else if(op2->kind == 6)
1877 *value2 = (long long)op2->__anon1.f;
1878 else if(op2->kind == 7)
1879 *value2 = (long long)op2->__anon1.d;
1880 else if(op2->kind == 13)
1881 *value2 = (long long)op2->__anon1.ui64;
1882 else
1883 return 0;
1884 return 1;
1885 }
1886
1887 unsigned int GetInt64(struct Expression * exp, long long * value2)
1888 {
1889 struct Operand op2 = GetOperand(exp);
1890
1891 return GetOpInt64(&op2, value2);
1892 }
1893
1894 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1895 {
1896 if(op2->kind == 3 && op2->type->isSigned)
1897 *value2 = (uint64)op2->__anon1.i;
1898 else if(op2->kind == 3)
1899 *value2 = (uint64)op2->__anon1.ui;
1900 else if(op2->kind == 4 && op2->type->isSigned)
1901 *value2 = (uint64)op2->__anon1.i64;
1902 else if(op2->kind == 4)
1903 *value2 = op2->__anon1.ui64;
1904 else if(op2->kind == 23 && op2->type->isSigned)
1905 *value2 = (uint64)op2->__anon1.i64;
1906 else if(op2->kind == 23)
1907 *value2 = op2->__anon1.ui64;
1908 else if(op2->kind == 22 && op2->type->isSigned)
1909 *value2 = (uint64)op2->__anon1.i64;
1910 else if(op2->kind == 22)
1911 *value2 = op2->__anon1.ui64;
1912 else if(op2->kind == 2 && op2->type->isSigned)
1913 *value2 = (uint64)op2->__anon1.s;
1914 else if(op2->kind == 2)
1915 *value2 = (uint64)op2->__anon1.us;
1916 else if(op2->kind == 1 && op2->type->isSigned)
1917 *value2 = (uint64)op2->__anon1.c;
1918 else if(op2->kind == 24 || op2->kind == 1)
1919 *value2 = (uint64)op2->__anon1.uc;
1920 else if(op2->kind == 6)
1921 *value2 = (uint64)op2->__anon1.f;
1922 else if(op2->kind == 7)
1923 *value2 = (uint64)op2->__anon1.d;
1924 else if(op2->kind == 13)
1925 *value2 = op2->__anon1.ui64;
1926 else
1927 return 0;
1928 return 1;
1929 }
1930
1931 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1932 {
1933 struct Operand op2 = GetOperand(exp);
1934
1935 return GetOpUInt64(&op2, value2);
1936 }
1937
1938 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1939 {
1940 if(op2->kind == 3 && op2->type->isSigned)
1941 *value2 = (intptr_t)op2->__anon1.i;
1942 else if(op2->kind == 3)
1943 *value2 = (intptr_t)op2->__anon1.ui;
1944 else if(op2->kind == 4 && op2->type->isSigned)
1945 *value2 = (intptr_t)op2->__anon1.i64;
1946 else if(op2->kind == 4)
1947 *value2 = (intptr_t)op2->__anon1.ui64;
1948 else if(op2->kind == 23 && op2->type->isSigned)
1949 *value2 = (intptr_t)op2->__anon1.i64;
1950 else if(op2->kind == 23)
1951 *value2 = (intptr_t)op2->__anon1.ui64;
1952 else if(op2->kind == 22 && op2->type->isSigned)
1953 *value2 = (intptr_t)op2->__anon1.i64;
1954 else if(op2->kind == 22)
1955 *value2 = (intptr_t)op2->__anon1.ui64;
1956 else if(op2->kind == 2 && op2->type->isSigned)
1957 *value2 = (intptr_t)op2->__anon1.s;
1958 else if(op2->kind == 2)
1959 *value2 = (intptr_t)op2->__anon1.us;
1960 else if(op2->kind == 1 && op2->type->isSigned)
1961 *value2 = (intptr_t)op2->__anon1.c;
1962 else if(op2->kind == 24 || op2->kind == 1)
1963 *value2 = (intptr_t)op2->__anon1.uc;
1964 else if(op2->kind == 6)
1965 *value2 = (intptr_t)op2->__anon1.f;
1966 else if(op2->kind == 7)
1967 *value2 = (intptr_t)op2->__anon1.d;
1968 else if(op2->kind == 13)
1969 *value2 = (intptr_t)op2->__anon1.ui64;
1970 else
1971 return 0;
1972 return 1;
1973 }
1974
1975 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1976 {
1977 struct Operand op2 = GetOperand(exp);
1978
1979 return GetOpIntPtr(&op2, value2);
1980 }
1981
1982 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1983 {
1984 if(op2->kind == 3 && op2->type->isSigned)
1985 *value2 = (uintptr_t)op2->__anon1.i;
1986 else if(op2->kind == 3)
1987 *value2 = (uintptr_t)op2->__anon1.ui;
1988 else if(op2->kind == 4 && op2->type->isSigned)
1989 *value2 = (uintptr_t)op2->__anon1.i64;
1990 else if(op2->kind == 4)
1991 *value2 = (uintptr_t)op2->__anon1.ui64;
1992 else if(op2->kind == 23 && op2->type->isSigned)
1993 *value2 = (uintptr_t)op2->__anon1.i64;
1994 else if(op2->kind == 23)
1995 *value2 = (uintptr_t)op2->__anon1.ui64;
1996 else if(op2->kind == 22 && op2->type->isSigned)
1997 *value2 = (uintptr_t)op2->__anon1.i64;
1998 else if(op2->kind == 22)
1999 *value2 = (uintptr_t)op2->__anon1.ui64;
2000 else if(op2->kind == 2 && op2->type->isSigned)
2001 *value2 = (uintptr_t)op2->__anon1.s;
2002 else if(op2->kind == 2)
2003 *value2 = (uintptr_t)op2->__anon1.us;
2004 else if(op2->kind == 1 && op2->type->isSigned)
2005 *value2 = (uintptr_t)op2->__anon1.c;
2006 else if(op2->kind == 24 || op2->kind == 1)
2007 *value2 = (uintptr_t)op2->__anon1.uc;
2008 else if(op2->kind == 6)
2009 *value2 = (uintptr_t)op2->__anon1.f;
2010 else if(op2->kind == 7)
2011 *value2 = (uintptr_t)op2->__anon1.d;
2012 else if(op2->kind == 13)
2013 *value2 = (uintptr_t)op2->__anon1.ui64;
2014 else
2015 return 0;
2016 return 1;
2017 }
2018
2019 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2020 {
2021 struct Operand op2 = GetOperand(exp);
2022
2023 return GetOpUIntPtr(&op2, value2);
2024 }
2025
2026 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2027 {
2028 if(op2->kind == 3 && op2->type->isSigned)
2029 *value2 = (ssize_t)op2->__anon1.i;
2030 else if(op2->kind == 3)
2031 *value2 = (ssize_t)op2->__anon1.ui;
2032 else if(op2->kind == 4 && op2->type->isSigned)
2033 *value2 = (ssize_t)op2->__anon1.i64;
2034 else if(op2->kind == 4)
2035 *value2 = (ssize_t)op2->__anon1.ui64;
2036 else if(op2->kind == 23 && op2->type->isSigned)
2037 *value2 = (ssize_t)op2->__anon1.i64;
2038 else if(op2->kind == 23)
2039 *value2 = (ssize_t)op2->__anon1.ui64;
2040 else if(op2->kind == 22 && op2->type->isSigned)
2041 *value2 = (ssize_t)op2->__anon1.i64;
2042 else if(op2->kind == 22)
2043 *value2 = (ssize_t)op2->__anon1.ui64;
2044 else if(op2->kind == 2 && op2->type->isSigned)
2045 *value2 = (ssize_t)op2->__anon1.s;
2046 else if(op2->kind == 2)
2047 *value2 = (ssize_t)op2->__anon1.us;
2048 else if(op2->kind == 1 && op2->type->isSigned)
2049 *value2 = (ssize_t)op2->__anon1.c;
2050 else if(op2->kind == 24 || op2->kind == 1)
2051 *value2 = (ssize_t)op2->__anon1.uc;
2052 else if(op2->kind == 6)
2053 *value2 = (ssize_t)op2->__anon1.f;
2054 else if(op2->kind == 7)
2055 *value2 = (ssize_t)op2->__anon1.d;
2056 else if(op2->kind == 13)
2057 *value2 = (ssize_t)op2->__anon1.ui64;
2058 else
2059 return 0;
2060 return 1;
2061 }
2062
2063 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2064 {
2065 struct Operand op2 = GetOperand(exp);
2066
2067 return GetOpIntSize(&op2, value2);
2068 }
2069
2070 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2071 {
2072 if(op2->kind == 3 && op2->type->isSigned)
2073 *value2 = (size_t)op2->__anon1.i;
2074 else if(op2->kind == 3)
2075 *value2 = (size_t)op2->__anon1.ui;
2076 else if(op2->kind == 4 && op2->type->isSigned)
2077 *value2 = (size_t)op2->__anon1.i64;
2078 else if(op2->kind == 4)
2079 *value2 = (size_t)op2->__anon1.ui64;
2080 else if(op2->kind == 23 && op2->type->isSigned)
2081 *value2 = (size_t)op2->__anon1.i64;
2082 else if(op2->kind == 23)
2083 *value2 = (size_t)op2->__anon1.ui64;
2084 else if(op2->kind == 22 && op2->type->isSigned)
2085 *value2 = (size_t)op2->__anon1.i64;
2086 else if(op2->kind == 22)
2087 *value2 = (size_t)op2->__anon1.ui64;
2088 else if(op2->kind == 2 && op2->type->isSigned)
2089 *value2 = (size_t)op2->__anon1.s;
2090 else if(op2->kind == 2)
2091 *value2 = (size_t)op2->__anon1.us;
2092 else if(op2->kind == 1 && op2->type->isSigned)
2093 *value2 = (size_t)op2->__anon1.c;
2094 else if(op2->kind == 24 || op2->kind == 1)
2095 *value2 = (size_t)op2->__anon1.uc;
2096 else if(op2->kind == 6)
2097 *value2 = (size_t)op2->__anon1.f;
2098 else if(op2->kind == 7)
2099 *value2 = (size_t)op2->__anon1.d;
2100 else if(op2->kind == 13)
2101 *value2 = (size_t)op2->__anon1.ui64;
2102 else
2103 return 0;
2104 return 1;
2105 }
2106
2107 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2108 {
2109 struct Operand op2 = GetOperand(exp);
2110
2111 return GetOpUIntSize(&op2, value2);
2112 }
2113
2114 unsigned int GetOpShort(struct Operand * op2, short * value2)
2115 {
2116 if(op2->kind == 3 && op2->type->isSigned)
2117 *value2 = (short)op2->__anon1.i;
2118 else if(op2->kind == 3)
2119 *value2 = (short)op2->__anon1.ui;
2120 else if(op2->kind == 4 && op2->type->isSigned)
2121 *value2 = (short)op2->__anon1.i64;
2122 else if(op2->kind == 4)
2123 *value2 = (short)op2->__anon1.ui64;
2124 else if(op2->kind == 23 && op2->type->isSigned)
2125 *value2 = (short)op2->__anon1.i64;
2126 else if(op2->kind == 23)
2127 *value2 = (short)op2->__anon1.ui64;
2128 else if(op2->kind == 22 && op2->type->isSigned)
2129 *value2 = (short)op2->__anon1.i64;
2130 else if(op2->kind == 22)
2131 *value2 = (short)op2->__anon1.ui64;
2132 else if(op2->kind == 2 && op2->type->isSigned)
2133 *value2 = op2->__anon1.s;
2134 else if(op2->kind == 2)
2135 *value2 = (short)op2->__anon1.us;
2136 else if(op2->kind == 1 && op2->type->isSigned)
2137 *value2 = (short)op2->__anon1.c;
2138 else if(op2->kind == 24 || op2->kind == 1)
2139 *value2 = (short)op2->__anon1.uc;
2140 else if(op2->kind == 6)
2141 *value2 = (short)op2->__anon1.f;
2142 else if(op2->kind == 7)
2143 *value2 = (short)op2->__anon1.d;
2144 else if(op2->kind == 13)
2145 *value2 = (short)op2->__anon1.ui64;
2146 else
2147 return 0;
2148 return 1;
2149 }
2150
2151 unsigned int GetShort(struct Expression * exp, short * value2)
2152 {
2153 struct Operand op2 = GetOperand(exp);
2154
2155 return GetOpShort(&op2, value2);
2156 }
2157
2158 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2159 {
2160 if(op2->kind == 3 && op2->type->isSigned)
2161 *value2 = (unsigned short)op2->__anon1.i;
2162 else if(op2->kind == 3)
2163 *value2 = (unsigned short)op2->__anon1.ui;
2164 else if(op2->kind == 4 && op2->type->isSigned)
2165 *value2 = (unsigned short)op2->__anon1.i64;
2166 else if(op2->kind == 4)
2167 *value2 = (unsigned short)op2->__anon1.ui64;
2168 else if(op2->kind == 23 && op2->type->isSigned)
2169 *value2 = (unsigned short)op2->__anon1.i64;
2170 else if(op2->kind == 23)
2171 *value2 = (unsigned short)op2->__anon1.ui64;
2172 else if(op2->kind == 22 && op2->type->isSigned)
2173 *value2 = (unsigned short)op2->__anon1.i64;
2174 else if(op2->kind == 22)
2175 *value2 = (unsigned short)op2->__anon1.ui64;
2176 else if(op2->kind == 2 && op2->type->isSigned)
2177 *value2 = (unsigned short)op2->__anon1.s;
2178 else if(op2->kind == 2)
2179 *value2 = op2->__anon1.us;
2180 else if(op2->kind == 1 && op2->type->isSigned)
2181 *value2 = (unsigned short)op2->__anon1.c;
2182 else if(op2->kind == 24 || op2->kind == 1)
2183 *value2 = (unsigned short)op2->__anon1.uc;
2184 else if(op2->kind == 6)
2185 *value2 = (unsigned short)op2->__anon1.f;
2186 else if(op2->kind == 7)
2187 *value2 = (unsigned short)op2->__anon1.d;
2188 else if(op2->kind == 13)
2189 *value2 = (unsigned short)op2->__anon1.ui64;
2190 else
2191 return 0;
2192 return 1;
2193 }
2194
2195 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2196 {
2197 struct Operand op2 = GetOperand(exp);
2198
2199 return GetOpUShort(&op2, value2);
2200 }
2201
2202 unsigned int GetOpChar(struct Operand * op2, char * value2)
2203 {
2204 if(op2->kind == 3 && op2->type->isSigned)
2205 *value2 = (char)op2->__anon1.i;
2206 else if(op2->kind == 3)
2207 *value2 = (char)op2->__anon1.ui;
2208 else if(op2->kind == 4 && op2->type->isSigned)
2209 *value2 = (char)op2->__anon1.i64;
2210 else if(op2->kind == 4)
2211 *value2 = (char)op2->__anon1.ui64;
2212 else if(op2->kind == 23 && op2->type->isSigned)
2213 *value2 = (char)op2->__anon1.i64;
2214 else if(op2->kind == 23)
2215 *value2 = (char)op2->__anon1.ui64;
2216 else if(op2->kind == 22 && op2->type->isSigned)
2217 *value2 = (char)op2->__anon1.i64;
2218 else if(op2->kind == 22)
2219 *value2 = (char)op2->__anon1.ui64;
2220 else if(op2->kind == 2 && op2->type->isSigned)
2221 *value2 = (char)op2->__anon1.s;
2222 else if(op2->kind == 2)
2223 *value2 = (char)op2->__anon1.us;
2224 else if(op2->kind == 1 && op2->type->isSigned)
2225 *value2 = op2->__anon1.c;
2226 else if(op2->kind == 24 || op2->kind == 1)
2227 *value2 = (char)op2->__anon1.uc;
2228 else if(op2->kind == 6)
2229 *value2 = (char)op2->__anon1.f;
2230 else if(op2->kind == 7)
2231 *value2 = (char)op2->__anon1.d;
2232 else if(op2->kind == 13)
2233 *value2 = (char)op2->__anon1.ui64;
2234 else
2235 return 0;
2236 return 1;
2237 }
2238
2239 unsigned int GetChar(struct Expression * exp, char * value2)
2240 {
2241 struct Operand op2 = GetOperand(exp);
2242
2243 return GetOpChar(&op2, value2);
2244 }
2245
2246 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2247 {
2248 if(op2->kind == 3 && op2->type->isSigned)
2249 *value2 = (unsigned char)op2->__anon1.i;
2250 else if(op2->kind == 3)
2251 *value2 = (unsigned char)op2->__anon1.ui;
2252 else if(op2->kind == 4 && op2->type->isSigned)
2253 *value2 = (unsigned char)op2->__anon1.i64;
2254 else if(op2->kind == 4)
2255 *value2 = (unsigned char)op2->__anon1.ui64;
2256 else if(op2->kind == 23 && op2->type->isSigned)
2257 *value2 = (unsigned char)op2->__anon1.i64;
2258 else if(op2->kind == 23)
2259 *value2 = (unsigned char)op2->__anon1.ui64;
2260 else if(op2->kind == 22 && op2->type->isSigned)
2261 *value2 = (unsigned char)op2->__anon1.i64;
2262 else if(op2->kind == 22)
2263 *value2 = (unsigned char)op2->__anon1.ui64;
2264 else if(op2->kind == 2 && op2->type->isSigned)
2265 *value2 = (unsigned char)op2->__anon1.s;
2266 else if(op2->kind == 2)
2267 *value2 = (unsigned char)op2->__anon1.us;
2268 else if(op2->kind == 1 && op2->type->isSigned)
2269 *value2 = (unsigned char)op2->__anon1.c;
2270 else if(op2->kind == 24 || op2->kind == 1)
2271 *value2 = op2->__anon1.uc;
2272 else if(op2->kind == 6)
2273 *value2 = (unsigned char)op2->__anon1.f;
2274 else if(op2->kind == 7)
2275 *value2 = (unsigned char)op2->__anon1.d;
2276 else if(op2->kind == 13)
2277 *value2 = (unsigned char)op2->__anon1.ui64;
2278 else
2279 return 0;
2280 return 1;
2281 }
2282
2283 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2284 {
2285 struct Operand op2 = GetOperand(exp);
2286
2287 return GetOpUChar(&op2, value2);
2288 }
2289
2290 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2291 {
2292 if(op2->kind == 3 && op2->type->isSigned)
2293 *value2 = (float)(float)op2->__anon1.i;
2294 else if(op2->kind == 3)
2295 *value2 = (float)(float)op2->__anon1.ui;
2296 else if(op2->kind == 4 && op2->type->isSigned)
2297 *value2 = (float)(float)op2->__anon1.i64;
2298 else if(op2->kind == 4)
2299 *value2 = (float)(float)op2->__anon1.ui64;
2300 else if(op2->kind == 23 && op2->type->isSigned)
2301 *value2 = (float)(float)op2->__anon1.i64;
2302 else if(op2->kind == 23)
2303 *value2 = (float)(float)op2->__anon1.ui64;
2304 else if(op2->kind == 22 && op2->type->isSigned)
2305 *value2 = (float)(float)op2->__anon1.i64;
2306 else if(op2->kind == 22)
2307 *value2 = (float)(float)op2->__anon1.ui64;
2308 else if(op2->kind == 2 && op2->type->isSigned)
2309 *value2 = (float)(float)op2->__anon1.s;
2310 else if(op2->kind == 2)
2311 *value2 = (float)(float)op2->__anon1.us;
2312 else if(op2->kind == 1 && op2->type->isSigned)
2313 *value2 = (float)(float)op2->__anon1.c;
2314 else if(op2->kind == 24 || op2->kind == 1)
2315 *value2 = (float)(float)op2->__anon1.uc;
2316 else if(op2->kind == 6)
2317 *value2 = (float)op2->__anon1.f;
2318 else if(op2->kind == 7)
2319 *value2 = (float)op2->__anon1.d;
2320 else if(op2->kind == 13)
2321 *value2 = (float)(float)op2->__anon1.ui64;
2322 else
2323 return 0;
2324 return 1;
2325 }
2326
2327 unsigned int GetFloat(struct Expression * exp, float * value2)
2328 {
2329 struct Operand op2 = GetOperand(exp);
2330
2331 return GetOpFloat(&op2, value2);
2332 }
2333
2334 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2335 {
2336 if(op2->kind == 3 && op2->type->isSigned)
2337 *value2 = (double)(double)op2->__anon1.i;
2338 else if(op2->kind == 3)
2339 *value2 = (double)(double)op2->__anon1.ui;
2340 else if(op2->kind == 4 && op2->type->isSigned)
2341 *value2 = (double)(double)op2->__anon1.i64;
2342 else if(op2->kind == 4)
2343 *value2 = (double)(double)op2->__anon1.ui64;
2344 else if(op2->kind == 23 && op2->type->isSigned)
2345 *value2 = (double)(double)op2->__anon1.i64;
2346 else if(op2->kind == 23)
2347 *value2 = (double)(double)op2->__anon1.ui64;
2348 else if(op2->kind == 22 && op2->type->isSigned)
2349 *value2 = (double)(double)op2->__anon1.i64;
2350 else if(op2->kind == 22)
2351 *value2 = (double)(double)op2->__anon1.ui64;
2352 else if(op2->kind == 2 && op2->type->isSigned)
2353 *value2 = (double)(double)op2->__anon1.s;
2354 else if(op2->kind == 2)
2355 *value2 = (double)(double)op2->__anon1.us;
2356 else if(op2->kind == 1 && op2->type->isSigned)
2357 *value2 = (double)(double)op2->__anon1.c;
2358 else if(op2->kind == 24 || op2->kind == 1)
2359 *value2 = (double)(double)op2->__anon1.uc;
2360 else if(op2->kind == 6)
2361 *value2 = (double)op2->__anon1.f;
2362 else if(op2->kind == 7)
2363 *value2 = (double)op2->__anon1.d;
2364 else if(op2->kind == 13)
2365 *value2 = (double)(double)op2->__anon1.ui64;
2366 else
2367 return 0;
2368 return 1;
2369 }
2370
2371 unsigned int GetDouble(struct Expression * exp, double * value2)
2372 {
2373 struct Operand op2 = GetOperand(exp);
2374
2375 return GetOpDouble(&op2, value2);
2376 }
2377
2378 void ComputeExpression(struct Expression * exp);
2379
2380 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2381
2382 extern int targetBits;
2383
2384 int ComputeTypeSize(struct Type * type);
2385
2386 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2387
2388 struct __ecereNameSpace__ecere__com__BitMember
2389 {
2390 struct __ecereNameSpace__ecere__com__BitMember * prev;
2391 struct __ecereNameSpace__ecere__com__BitMember * next;
2392 const char *  name;
2393 unsigned int isProperty;
2394 int memberAccess;
2395 int id;
2396 struct __ecereNameSpace__ecere__com__Class * _class;
2397 const char *  dataTypeString;
2398 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2399 struct Type * dataType;
2400 int type;
2401 int size;
2402 int pos;
2403 uint64 mask;
2404 } __attribute__ ((gcc_struct));
2405
2406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2407
2408 struct __ecereNameSpace__ecere__sys__OldLink
2409 {
2410 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2411 struct __ecereNameSpace__ecere__sys__OldLink * next;
2412 void *  data;
2413 } __attribute__ ((gcc_struct));
2414
2415 void FinishTemplatesContext(struct Context * context);
2416
2417 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2418 {
2419 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2420 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2421
2422 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))
2423 {
2424 int unionMemberOffset = 0;
2425 int bitFields = 0;
2426
2427 if(member)
2428 {
2429 member->memberOffset = 0;
2430 if(targetBits < sizeof(void *) * 8)
2431 member->structAlignment = 0;
2432 }
2433 else if(targetBits < sizeof(void *) * 8)
2434 _class->structAlignment = 0;
2435 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2436 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2437 if(!member && _class->destructionWatchOffset)
2438 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2439 {
2440 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2441
2442 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2443 {
2444 if(!dataMember->isProperty)
2445 {
2446 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2447 {
2448 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
2449 }
2450 }
2451 }
2452 }
2453 {
2454 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2455
2456 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2457 {
2458 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2459 {
2460 if(!isMember && _class->type == 2 && dataMember->dataType)
2461 {
2462 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2463 uint64 mask = 0;
2464 int d;
2465
2466 ComputeTypeSize(dataMember->dataType);
2467 if(bitMember->pos == -1)
2468 bitMember->pos = _class->memberOffset;
2469 if(!bitMember->size)
2470 bitMember->size = dataMember->dataType->size * 8;
2471 _class->memberOffset = bitMember->pos + bitMember->size;
2472 for(d = 0; d < bitMember->size; d++)
2473 {
2474 if(d)
2475 mask <<= 1;
2476 mask |= 1;
2477 }
2478 bitMember->mask = mask << bitMember->pos;
2479 }
2480 else if(dataMember->type == 0 && dataMember->dataType)
2481 {
2482 int size;
2483 int alignment = 0;
2484
2485 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)))
2486 ComputeTypeSize(dataMember->dataType);
2487 if(dataMember->dataType->bitFieldCount)
2488 {
2489 bitFields += dataMember->dataType->bitFieldCount;
2490 size = 0;
2491 }
2492 else
2493 {
2494 if(bitFields)
2495 {
2496 int size = (bitFields + 7) / 8;
2497
2498 if(isMember)
2499 {
2500 int __simpleStruct0;
2501
2502 if(alignment)
2503 {
2504 int __simpleStruct0;
2505
2506 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2507 if(member->memberOffset % alignment)
2508 member->memberOffset += alignment - (member->memberOffset % alignment);
2509 }
2510 dataMember->offset = member->memberOffset;
2511 if(member->type == 1)
2512 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2513 else
2514 {
2515 member->memberOffset += size;
2516 }
2517 }
2518 else
2519 {
2520 if(alignment)
2521 {
2522 int __simpleStruct0;
2523
2524 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2525 if(_class->memberOffset % alignment)
2526 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2527 }
2528 dataMember->offset = _class->memberOffset;
2529 _class->memberOffset += size;
2530 }
2531 bitFields = 0;
2532 }
2533 size = dataMember->dataType->size;
2534 alignment = dataMember->dataType->alignment;
2535 }
2536 if(isMember)
2537 {
2538 int __simpleStruct0;
2539
2540 if(alignment)
2541 {
2542 int __simpleStruct0;
2543
2544 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2545 if(member->memberOffset % alignment)
2546 member->memberOffset += alignment - (member->memberOffset % alignment);
2547 }
2548 dataMember->offset = member->memberOffset;
2549 if(member->type == 1)
2550 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2551 else
2552 {
2553 member->memberOffset += size;
2554 }
2555 }
2556 else
2557 {
2558 if(alignment)
2559 {
2560 int __simpleStruct0;
2561
2562 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2563 if(_class->memberOffset % alignment)
2564 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2565 }
2566 dataMember->offset = _class->memberOffset;
2567 _class->memberOffset += size;
2568 }
2569 }
2570 else
2571 {
2572 int alignment;
2573
2574 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
2575 alignment = dataMember->structAlignment;
2576 if(isMember)
2577 {
2578 int __simpleStruct0;
2579
2580 if(alignment)
2581 {
2582 int __simpleStruct0;
2583
2584 if(member->memberOffset % alignment)
2585 member->memberOffset += alignment - (member->memberOffset % alignment);
2586 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2587 }
2588 dataMember->offset = member->memberOffset;
2589 if(member->type == 1)
2590 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2591 else
2592 member->memberOffset += dataMember->memberOffset;
2593 }
2594 else
2595 {
2596 if(alignment)
2597 {
2598 int __simpleStruct0;
2599
2600 if(_class->memberOffset % alignment)
2601 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2602 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2603 }
2604 dataMember->offset = _class->memberOffset;
2605 _class->memberOffset += dataMember->memberOffset;
2606 }
2607 }
2608 }
2609 }
2610 if(bitFields)
2611 {
2612 int alignment = 0;
2613 int size = (bitFields + 7) / 8;
2614
2615 if(isMember)
2616 {
2617 int __simpleStruct0;
2618
2619 if(alignment)
2620 {
2621 int __simpleStruct0;
2622
2623 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2624 if(member->memberOffset % alignment)
2625 member->memberOffset += alignment - (member->memberOffset % alignment);
2626 }
2627 if(member->type == 1)
2628 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2629 else
2630 {
2631 member->memberOffset += size;
2632 }
2633 }
2634 else
2635 {
2636 if(alignment)
2637 {
2638 int __simpleStruct0;
2639
2640 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2641 if(_class->memberOffset % alignment)
2642 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2643 }
2644 _class->memberOffset += size;
2645 }
2646 bitFields = 0;
2647 }
2648 }
2649 if(member && member->type == 1)
2650 {
2651 member->memberOffset = unionMemberOffset;
2652 }
2653 if(!isMember)
2654 {
2655 if(_class->type != 2)
2656 {
2657 int extra = 0;
2658
2659 if(_class->structAlignment)
2660 {
2661 if(_class->memberOffset % _class->structAlignment)
2662 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2663 }
2664 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2665 if(!member)
2666 {
2667 struct __ecereNameSpace__ecere__com__Property * prop;
2668
2669 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2670 {
2671 if(prop->isProperty && prop->isWatchable)
2672 {
2673 prop->watcherOffset = _class->structSize;
2674 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2675 }
2676 }
2677 }
2678 {
2679 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2680
2681 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2682 {
2683 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2684
2685 if(deriv->computeSize)
2686 {
2687 deriv->offset = _class->structSize;
2688 deriv->memberOffset = 0;
2689 deriv->structSize = deriv->offset;
2690 ComputeClassMembers(deriv, 0);
2691 }
2692 }
2693 }
2694 }
2695 }
2696 }
2697 if(context)
2698 FinishTemplatesContext(context);
2699 }
2700
2701 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2702
2703 struct __ecereNameSpace__ecere__com__NameSpace
2704 {
2705 const char *  name;
2706 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2707 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2708 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2709 int depth;
2710 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2711 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2712 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2713 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2714 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2715 } __attribute__ ((gcc_struct));
2716
2717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2718
2719 struct __ecereNameSpace__ecere__com__Module
2720 {
2721 struct __ecereNameSpace__ecere__com__Instance * application;
2722 struct __ecereNameSpace__ecere__sys__OldList classes;
2723 struct __ecereNameSpace__ecere__sys__OldList defines;
2724 struct __ecereNameSpace__ecere__sys__OldList functions;
2725 struct __ecereNameSpace__ecere__sys__OldList modules;
2726 struct __ecereNameSpace__ecere__com__Instance * prev;
2727 struct __ecereNameSpace__ecere__com__Instance * next;
2728 const char *  name;
2729 void *  library;
2730 void *  Unload;
2731 int importType;
2732 int origImportType;
2733 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2734 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2735 } __attribute__ ((gcc_struct));
2736
2737 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2738 {
2739 struct __ecereNameSpace__ecere__com__Class * _class;
2740 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2741
2742 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2743 ComputeModuleClasses(subModule->data);
2744 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2745 ComputeClassMembers(_class, 0);
2746 }
2747
2748 extern unsigned int inCompiler;
2749
2750 extern void Compiler_Error(const char *  format, ...);
2751
2752 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2753
2754 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
2755
2756 int ComputeTypeSize(struct Type * type)
2757 {
2758 unsigned int size = type ? type->size : 0;
2759
2760 if(!size && type && !type->computing)
2761 {
2762 type->computing = 1;
2763 switch(type->kind)
2764 {
2765 case 24:
2766 type->alignment = size = sizeof(char);
2767 break;
2768 case 1:
2769 type->alignment = size = sizeof(char);
2770 break;
2771 case 3:
2772 type->alignment = size = sizeof(int);
2773 break;
2774 case 4:
2775 type->alignment = size = sizeof(long long);
2776 break;
2777 case 22:
2778 type->alignment = size = targetBits / 8;
2779 break;
2780 case 23:
2781 type->alignment = size = targetBits / 8;
2782 break;
2783 case 5:
2784 type->alignment = size = sizeof(long);
2785 break;
2786 case 2:
2787 type->alignment = size = sizeof(short);
2788 break;
2789 case 6:
2790 type->alignment = size = sizeof(float);
2791 break;
2792 case 7:
2793 type->alignment = size = sizeof(double);
2794 break;
2795 case 8:
2796 {
2797 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2798
2799 if(_class && _class->type == 1)
2800 {
2801 ComputeClassMembers(_class, 0);
2802 type->alignment = _class->structAlignment;
2803 size = _class->structSize;
2804 if(type->alignment && size % type->alignment)
2805 size += type->alignment - (size % type->alignment);
2806 }
2807 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2808 {
2809 if(!_class->dataType)
2810 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
2811 size = type->alignment = ComputeTypeSize(_class->dataType);
2812 }
2813 else
2814 size = type->alignment = targetBits / 8;
2815 break;
2816 }
2817 case 13:
2818 case 19:
2819 size = type->alignment = targetBits / 8;
2820 break;
2821 case 12:
2822 if(type->__anon1.__anon4.arraySizeExp)
2823 {
2824 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2825 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2826 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)))
2827 {
2828 struct Location oldLoc = yylloc;
2829 char expression[10240];
2830
2831 expression[0] = '\0';
2832 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2833 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2834 if(inCompiler)
2835 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2836 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2837 yylloc = oldLoc;
2838 }
2839 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2840 }
2841 else if(type->__anon1.__anon4.enumClass)
2842 {
2843 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2844 {
2845 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2846 }
2847 else
2848 type->__anon1.__anon4.arraySize = 0;
2849 }
2850 else
2851 {
2852 type->__anon1.__anon4.arraySize = 0;
2853 }
2854 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2855 if(type->__anon1.type)
2856 type->alignment = type->__anon1.type->alignment;
2857 break;
2858 case 9:
2859 {
2860 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
2861 {
2862 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
2863
2864 if(symbol && symbol->type)
2865 {
2866 ComputeTypeSize(symbol->type);
2867 size = symbol->type->size;
2868 }
2869 }
2870 else
2871 {
2872 struct Type * member;
2873
2874 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2875 {
2876 int __simpleStruct0, __simpleStruct1;
2877 unsigned int addSize = ComputeTypeSize(member);
2878
2879 member->offset = size;
2880 if(member->alignment && size % member->alignment)
2881 member->offset += member->alignment - (size % member->alignment);
2882 size = member->offset;
2883 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2884 size += addSize;
2885 }
2886 if(type->alignment && size % type->alignment)
2887 size += type->alignment - (size % type->alignment);
2888 }
2889 break;
2890 }
2891 case 10:
2892 {
2893 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
2894 {
2895 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
2896
2897 if(symbol && symbol->type)
2898 {
2899 ComputeTypeSize(symbol->type);
2900 size = symbol->type->size;
2901 }
2902 }
2903 else
2904 {
2905 struct Type * member;
2906
2907 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2908 {
2909 int __simpleStruct0, __simpleStruct1;
2910 unsigned int addSize = ComputeTypeSize(member);
2911
2912 member->offset = size;
2913 if(member->alignment && size % member->alignment)
2914 member->offset += member->alignment - (size % member->alignment);
2915 size = member->offset;
2916 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2917 size = ((size > addSize) ? size : addSize);
2918 }
2919 if(type->alignment && size % type->alignment)
2920 size += type->alignment - (size % type->alignment);
2921 }
2922 break;
2923 }
2924 case 20:
2925 {
2926 struct TemplateParameter * param = type->__anon1.templateParameter;
2927 struct Type * baseType = ProcessTemplateParameterType(param);
2928
2929 if(baseType)
2930 {
2931 size = ComputeTypeSize(baseType);
2932 type->alignment = baseType->alignment;
2933 }
2934 else
2935 type->alignment = size = sizeof(uint64);
2936 break;
2937 }
2938 case 15:
2939 {
2940 type->alignment = size = sizeof(enum
2941 {
2942 test
2943 });
2944 break;
2945 }
2946 case 21:
2947 {
2948 type->alignment = size = targetBits / 8;
2949 break;
2950 }
2951 }
2952 type->size = size;
2953 type->computing = 0;
2954 }
2955 return size;
2956 }
2957
2958 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2959
2960 extern struct Identifier * MkIdentifier(const char *  string);
2961
2962 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2963
2964 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2965
2966 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2967
2968 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2969
2970 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2971
2972 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2973
2974 extern void FreeType(struct Type * type);
2975
2976 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2977
2978 extern struct Specifier * MkSpecifier(int specifier);
2979
2980 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2981
2982 extern struct Expression * MkExpConstant(const char *  string);
2983
2984 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)
2985 {
2986 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2987 unsigned int totalSize = 0;
2988 unsigned int maxSize = 0;
2989 int alignment;
2990 unsigned int size;
2991 struct __ecereNameSpace__ecere__com__DataMember * member;
2992 int anonID = 1;
2993 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2994
2995 if(addedPadding)
2996 *addedPadding = 0;
2997 if(!isMember && _class->base)
2998 {
2999 maxSize = _class->structSize;
3000 {
3001 if(_class->type == 1 || _class->type == 5)
3002 AddMembers(declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
3003 else
3004 {
3005 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
3006
3007 if(maxSize > baseSize)
3008 maxSize -= baseSize;
3009 else
3010 maxSize = 0;
3011 }
3012 }
3013 }
3014 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3015 {
3016 if(!member->isProperty)
3017 {
3018 switch(member->type)
3019 {
3020 case 0:
3021 {
3022 if(member->dataTypeString)
3023 {
3024 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
3025 struct Declarator * decl;
3026
3027 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
3028 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
3029 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
3030 if(!member->dataType)
3031 member->dataType = ProcessType(specs, decl);
3032 ReplaceThisClassSpecifiers(specs, topClass);
3033 {
3034 struct Type * type = ProcessType(specs, decl);
3035
3036 DeclareType(member->dataType, 0, 0);
3037 FreeType(type);
3038 }
3039 ComputeTypeSize(member->dataType);
3040 size = member->dataType->size;
3041 alignment = member->dataType->alignment;
3042 if(alignment)
3043 {
3044 if(totalSize % alignment)
3045 totalSize += alignment - (totalSize % alignment);
3046 }
3047 totalSize += size;
3048 }
3049 break;
3050 }
3051 case 1:
3052 case 2:
3053 {
3054 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3055 char id[100];
3056
3057 sprintf(id, "__anon%d", anonID++);
3058 size = 0;
3059 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
3060 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3061 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3062 alignment = member->structAlignment;
3063 if(alignment)
3064 {
3065 if(totalSize % alignment)
3066 totalSize += alignment - (totalSize % alignment);
3067 }
3068 totalSize += size;
3069 break;
3070 }
3071 }
3072 }
3073 }
3074 if(retSize)
3075 {
3076 unsigned int __simpleStruct0;
3077
3078 if(topMember && topMember->type == 1)
3079 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3080 else
3081 *retSize += totalSize;
3082 }
3083 else if(totalSize < maxSize && _class->type != 1000)
3084 {
3085 int autoPadding = 0;
3086
3087 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3088 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3089 if(totalSize + autoPadding < maxSize)
3090 {
3091 char sizeString[50];
3092
3093 sprintf(sizeString, "%d", maxSize - totalSize);
3094 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3095 if(addedPadding)
3096 *addedPadding = 1;
3097 }
3098 }
3099 if(context)
3100 FinishTemplatesContext(context);
3101 return topMember ? topMember->memberID : _class->memberID;
3102 }
3103
3104 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3105 {
3106 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3107 struct __ecereNameSpace__ecere__com__DataMember * member;
3108 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3109
3110 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3111 DeclareMembers(_class->base, 0);
3112 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3113 {
3114 if(!member->isProperty)
3115 {
3116 switch(member->type)
3117 {
3118 case 0:
3119 {
3120 if(!member->dataType && member->dataTypeString)
3121 member->dataType = ProcessTypeString(member->dataTypeString, 0);
3122 if(member->dataType)
3123 DeclareType(member->dataType, 0, 0);
3124 break;
3125 }
3126 case 1:
3127 case 2:
3128 {
3129 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 1);
3130 break;
3131 }
3132 }
3133 }
3134 }
3135 if(context)
3136 FinishTemplatesContext(context);
3137 return topMember ? topMember->memberID : _class->memberID;
3138 }
3139
3140 extern struct Identifier * GetDeclId(struct Declarator * decl);
3141
3142 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3143 {
3144 struct ClassDef * def;
3145 int anonID = 1;
3146
3147 for(def = (*definitions).first; def; def = def->next)
3148 {
3149 if(def->type == 2)
3150 {
3151 struct Declaration * decl = def->__anon1.decl;
3152
3153 if(decl && decl->__anon1.__anon1.specifiers)
3154 {
3155 struct Specifier * spec;
3156 unsigned int isStruct = 0;
3157
3158 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3159 {
3160 if(spec->type == 3 || spec->type == 4)
3161 {
3162 if(spec->__anon1.__anon2.definitions)
3163 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3164 isStruct = 1;
3165 }
3166 }
3167 if(isStruct)
3168 {
3169 struct Declarator * d = (((void *)0));
3170
3171 if(decl->__anon1.__anon1.declarators)
3172 {
3173 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3174 {
3175 struct Identifier * idDecl = GetDeclId(d);
3176
3177 if(idDecl)
3178 break;
3179 }
3180 }
3181 if(!d)
3182 {
3183 char id[100];
3184
3185 sprintf(id, "__anon%d", anonID++);
3186 if(!decl->__anon1.__anon1.declarators)
3187 decl->__anon1.__anon1.declarators = MkList();
3188 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3189 }
3190 }
3191 }
3192 }
3193 }
3194 }
3195
3196 extern struct Symbol * FindClass(const char *  name);
3197
3198 extern char *  strchr(const char * , int);
3199
3200 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3201
3202 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3203
3204 extern void FreeClassDef(struct ClassDef * def);
3205
3206 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3207
3208 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3209
3210 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3211
3212 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3213
3214 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3215
3216 void DeclareStruct(const char * name, unsigned int skipNoHead)
3217 {
3218 struct External * external = (((void *)0));
3219 struct Symbol * classSym = FindClass(name);
3220
3221 if(!inCompiler || !classSym)
3222 return ;
3223 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3224 return ;
3225 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3226 {
3227 struct Declaration * decl;
3228 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3229 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3230 char structName[1024];
3231 struct Specifier * spec = (((void *)0));
3232
3233 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3234 classSym->declaring++;
3235 if(strchr(classSym->string, '<'))
3236 {
3237 if(classSym->__anon1.registered->templateClass)
3238 {
3239 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3240 classSym->declaring--;
3241 }
3242 return ;
3243 }
3244 DeclareMembers(classSym->__anon1.registered, 0);
3245 structName[0] = (char)0;
3246 FullClassNameCat(structName, name, 0);
3247 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3248 {
3249 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3250 {
3251 if(spec->type == 3 || spec->type == 4)
3252 break;
3253 }
3254 }
3255 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3256 {
3257 unsigned int addedPadding = 0;
3258
3259 classSym->declaredStructSym = 1;
3260 declarations = MkList();
3261 AddMembers(declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3262 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3263 {
3264 FreeList(declarations, (void *)(FreeClassDef));
3265 declarations = (((void *)0));
3266 }
3267 }
3268 if(skipNoHead || declarations)
3269 {
3270 if(spec)
3271 {
3272 if(declarations)
3273 spec->__anon1.__anon2.definitions = declarations;
3274 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3275 {
3276 if(classSym->__anon2.__anon1.structExternal)
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3278 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3279 classSym->id = curExternal->symbol->idCode;
3280 classSym->idCode = curExternal->symbol->idCode;
3281 }
3282 }
3283 else
3284 {
3285 if(!external)
3286 external = MkExternalDeclaration((((void *)0)));
3287 specifiers = MkList();
3288 declarators = MkList();
3289 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3290 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3291 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3292 decl->symbol->__anon2.__anon1.pointerExternal = external;
3293 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3294 {
3295 char className[1024];
3296
3297 strcpy(className, "__ecereClass_");
3298 FullClassNameCat(className, classSym->string, 1);
3299 DeclareClass(classSym, className);
3300 external->symbol = classSym;
3301 classSym->__anon2.__anon1.pointerExternal = external;
3302 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3303 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3304 }
3305 else
3306 {
3307 char className[1024];
3308
3309 strcpy(className, "__ecereClass_");
3310 FullClassNameCat(className, classSym->string, 1);
3311 classSym->__anon2.__anon1.structExternal = external;
3312 DeclareClass(classSym, className);
3313 external->symbol = classSym;
3314 }
3315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3316 }
3317 }
3318 classSym->declaring--;
3319 }
3320 else
3321 {
3322 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3323 {
3324 struct Specifier * spec;
3325
3326 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3327 {
3328 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3329 }
3330 }
3331 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3332 {
3333 classSym->declaring++;
3334 {
3335 if(classSym->__anon1.registered)
3336 DeclareMembers(classSym->__anon1.registered, 0);
3337 }
3338 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3339 {
3340 if(classSym->__anon2.__anon1.structExternal)
3341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3342 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3343 classSym->id = curExternal->symbol->idCode;
3344 classSym->idCode = curExternal->symbol->idCode;
3345 }
3346 classSym->declaring--;
3347 }
3348 }
3349 }
3350
3351 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3352
3353 extern struct ModuleImport * mainModule;
3354
3355 extern struct Specifier * MkSpecifierName(const char *  name);
3356
3357 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3358
3359 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3360
3361 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3362
3363 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3364
3365 extern void FreeDeclarator(struct Declarator * decl);
3366
3367 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
3368
3369 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
3370
3371 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
3372
3373 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
3374
3375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3376
3377 struct PropertyImport
3378 {
3379 struct PropertyImport * prev;
3380 struct PropertyImport * next;
3381 char *  name;
3382 unsigned int isVirtual;
3383 unsigned int hasSet;
3384 unsigned int hasGet;
3385 } __attribute__ ((gcc_struct));
3386
3387 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3388
3389 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3390 {
3391 struct Symbol * symbol = prop->symbol;
3392
3393 strcpy(setName, "__ecereProp_");
3394 FullClassNameCat(setName, prop->_class->fullName, 0);
3395 strcat(setName, "_Set_");
3396 FullClassNameCat(setName, prop->name, 1);
3397 strcpy(getName, "__ecereProp_");
3398 FullClassNameCat(getName, prop->_class->fullName, 0);
3399 strcat(getName, "_Get_");
3400 FullClassNameCat(getName, prop->name, 1);
3401 if(prop->_class->type == 1)
3402 DeclareStruct(prop->_class->fullName, 0);
3403 if(!symbol || curExternal->symbol->idCode < symbol->id)
3404 {
3405 unsigned int imported = 0;
3406 unsigned int dllImport = 0;
3407
3408 if(!symbol || symbol->_import)
3409 {
3410 if(!symbol)
3411 {
3412 struct Symbol * classSym;
3413
3414 if(!prop->_class->symbol)
3415 prop->_class->symbol = FindClass(prop->_class->fullName);
3416 classSym = prop->_class->symbol;
3417 if(classSym && !classSym->_import)
3418 {
3419 struct ModuleImport * module;
3420
3421 if(prop->_class->module)
3422 module = FindModule(prop->_class->module);
3423 else
3424 module = mainModule;
3425 classSym->_import = __extension__ ({
3426 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3427
3428 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3429 });
3430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3431 }
3432 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3433 symbol->_import = (struct ClassImport *)__extension__ ({
3434 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3435
3436 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3437 });
3438 if(classSym)
3439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3440 }
3441 imported = 1;
3442 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)
3443 dllImport = 1;
3444 }
3445 if(!symbol->type)
3446 {
3447 struct Context * context = SetupTemplatesContext(prop->_class);
3448
3449 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3450 FinishTemplatesContext(context);
3451 }
3452 if(prop->Get)
3453 {
3454 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3455 {
3456 struct Declaration * decl;
3457 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3458 struct Declarator * d;
3459 struct __ecereNameSpace__ecere__sys__OldList * params;
3460 struct Specifier * spec;
3461 struct External * external;
3462 struct Declarator * typeDecl;
3463 unsigned int simple = 0;
3464
3465 specifiers = MkList();
3466 declarators = MkList();
3467 params = MkList();
3468 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3469 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3470 if(dllImport)
3471 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3472 {
3473 struct Context * context = SetupTemplatesContext(prop->_class);
3474
3475 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3476 FinishTemplatesContext(context);
3477 }
3478 for(spec = (*specifiers).first; spec; spec = spec->next)
3479 {
3480 if(spec->type == 1)
3481 {
3482 if((!typeDecl || typeDecl->type == 1))
3483 {
3484 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3485
3486 symbol->_class = classSym->__anon1.registered;
3487 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3488 {
3489 DeclareStruct(spec->__anon1.__anon1.name, 0);
3490 simple = 1;
3491 }
3492 }
3493 }
3494 }
3495 if(!simple)
3496 d = PlugDeclarator(typeDecl, d);
3497 else
3498 {
3499 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3500 specifiers = MkList();
3501 }
3502 d = MkDeclaratorFunction(d, params);
3503 if(dllImport)
3504 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3505 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3507 if(simple)
3508 ListAdd(specifiers, MkSpecifier(VOID));
3509 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3510 decl = MkDeclaration(specifiers, declarators);
3511 external = MkExternalDeclaration(decl);
3512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3513 external->symbol = symbol;
3514 symbol->__anon2.__anon2.externalGet = external;
3515 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3516 if(typeDecl)
3517 FreeDeclarator(typeDecl);
3518 }
3519 else
3520 {
3521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3522 }
3523 }
3524 if(prop->Set)
3525 {
3526 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3527 {
3528 struct Declaration * decl;
3529 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3530 struct Declarator * d;
3531 struct __ecereNameSpace__ecere__sys__OldList * params;
3532 struct Specifier * spec;
3533 struct External * external;
3534 struct Declarator * typeDecl;
3535
3536 declarators = MkList();
3537 params = MkList();
3538 if(!prop->conversion || prop->_class->type == 1)
3539 {
3540 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3541 }
3542 specifiers = MkList();
3543 {
3544 struct Context * context = SetupTemplatesContext(prop->_class);
3545
3546 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3547 FinishTemplatesContext(context);
3548 }
3549 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3551 ListAdd(params, MkTypeName(specifiers, d));
3552 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3553 if(dllImport)
3554 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3555 d = MkDeclaratorFunction(d, params);
3556 for(spec = (*specifiers).first; spec; spec = spec->next)
3557 {
3558 if(spec->type == 1)
3559 {
3560 if((!typeDecl || typeDecl->type == 1))
3561 {
3562 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3563
3564 symbol->_class = classSym->__anon1.registered;
3565 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3566 DeclareStruct(spec->__anon1.__anon1.name, 0);
3567 }
3568 }
3569 }
3570 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3571 specifiers = MkList();
3572 if(dllImport)
3573 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3574 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3576 if(!prop->conversion || prop->_class->type == 1)
3577 ListAdd(specifiers, MkSpecifier(VOID));
3578 else
3579 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3580 decl = MkDeclaration(specifiers, declarators);
3581 external = MkExternalDeclaration(decl);
3582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3583 external->symbol = symbol;
3584 symbol->__anon2.__anon2.externalSet = external;
3585 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3586 }
3587 else
3588 {
3589 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3590 }
3591 }
3592 if(!symbol->__anon2.__anon2.externalPtr)
3593 {
3594 struct Declaration * decl;
3595 struct External * external;
3596 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3597 char propName[1024];
3598
3599 if(imported)
3600 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3601 else
3602 {
3603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
3605 }
3606 ListAdd(specifiers, MkSpecifierName("Property"));
3607 strcpy(propName, "__ecereProp_");
3608 FullClassNameCat(propName, prop->_class->fullName, 0);
3609 strcat(propName, "_");
3610 FullClassNameCat(propName, prop->name, 1);
3611 {
3612 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3613
3614 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3615 if(!imported)
3616 {
3617 strcpy(propName, "__ecerePropM_");
3618 FullClassNameCat(propName, prop->_class->fullName, 0);
3619 strcat(propName, "_");
3620 FullClassNameCat(propName, prop->name, 1);
3621 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
3622 }
3623 decl = MkDeclaration(specifiers, list);
3624 }
3625 external = MkExternalDeclaration(decl);
3626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3627 external->symbol = symbol;
3628 symbol->__anon2.__anon2.externalPtr = external;
3629 }
3630 else
3631 {
3632 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3633 }
3634 symbol->id = curExternal->symbol->idCode;
3635 }
3636 }
3637
3638 struct Type * Dereference(struct Type * source)
3639 {
3640 struct Type * type = (((void *)0));
3641
3642 if(source)
3643 {
3644 if(source->kind == 13 || source->kind == 12)
3645 {
3646 type = source->__anon1.type;
3647 source->__anon1.type->refCount++;
3648 }
3649 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3650 {
3651 type = __extension__ ({
3652 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3653
3654 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3655 });
3656 }
3657 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3658 {
3659 type = source;
3660 source->refCount++;
3661 }
3662 else
3663 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3664 }
3665 return type;
3666 }
3667
3668 static struct Type * Reference(struct Type * source)
3669 {
3670 struct Type * type = (((void *)0));
3671
3672 if(source)
3673 {
3674 type = __extension__ ({
3675 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3676
3677 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3678 });
3679 source->refCount++;
3680 }
3681 return type;
3682 }
3683
3684 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);
3685
3686 extern void *  memcpy(void * , const void * , size_t size);
3687
3688 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3689
3690 extern void FreeExpression(struct Expression * exp);
3691
3692 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3693
3694 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);
3695
3696 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3697
3698 extern struct Type * MkClassType(const char *  name);
3699
3700 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);
3701
3702 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)
3703 {
3704 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3705 unsigned int found = 0;
3706 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3707 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3708 unsigned int freeType = 0;
3709
3710 yylloc = member->loc;
3711 if(!ident)
3712 {
3713 if(curMember)
3714 {
3715 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3716 if(*curMember)
3717 {
3718 found = 1;
3719 dataMember = *curMember;
3720 }
3721 }
3722 }
3723 else
3724 {
3725 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3726 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3727 int _subMemberStackPos = 0;
3728
3729 if(!thisMember)
3730 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3731 if(thisMember)
3732 {
3733 dataMember = thisMember;
3734 if(curMember && thisMember->memberAccess == 1)
3735 {
3736 *curMember = thisMember;
3737 *curClass = thisMember->_class;
3738 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3739 *subMemberStackPos = _subMemberStackPos;
3740 }
3741 found = 1;
3742 }
3743 else
3744 {
3745 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3746 if(method && method->type == 1)
3747 found = 1;
3748 else
3749 method = (((void *)0));
3750 }
3751 }
3752 if(found)
3753 {
3754 struct Type * type = (((void *)0));
3755
3756 if(dataMember)
3757 {
3758 if(!dataMember->dataType && dataMember->dataTypeString)
3759 {
3760 struct Context * context = SetupTemplatesContext(_class);
3761
3762 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3763 FinishTemplatesContext(context);
3764 }
3765 type = dataMember->dataType;
3766 }
3767 else if(method)
3768 {
3769 if(!method->dataType)
3770 ProcessMethodType(method);
3771 type = method->dataType;
3772 }
3773 if(ident && ident->next)
3774 {
3775 for(ident = ident->next; ident && type; ident = ident->next)
3776 {
3777 if(type->kind == 8)
3778 {
3779 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3780 if(!dataMember)
3781 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3782 if(dataMember)
3783 type = dataMember->dataType;
3784 }
3785 else if(type->kind == 9 || type->kind == 10)
3786 {
3787 struct Type * memberType;
3788
3789 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3790 {
3791 if(!strcmp(memberType->name, ident->string))
3792 {
3793 type = memberType;
3794 break;
3795 }
3796 }
3797 }
3798 }
3799 }
3800 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3801 {
3802 int id = 0;
3803 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3804 struct __ecereNameSpace__ecere__com__Class * sClass;
3805
3806 for(sClass = _class; sClass; sClass = sClass->base)
3807 {
3808 id = 0;
3809 if(sClass->templateClass)
3810 sClass = sClass->templateClass;
3811 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3812 {
3813 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3814 {
3815 for(sClass = sClass->base; sClass; sClass = sClass->base)
3816 {
3817 if(sClass->templateClass)
3818 sClass = sClass->templateClass;
3819 id += sClass->templateParams.count;
3820 }
3821 break;
3822 }
3823 id++;
3824 }
3825 if(curParam)
3826 break;
3827 }
3828 if(curParam)
3829 {
3830 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3831
3832 if(arg.__anon1.__anon1.dataTypeString)
3833 {
3834 unsigned int constant = type->constant;
3835
3836 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3837 if(type->kind == 8 && constant)
3838 type->constant = 1;
3839 else if(type->kind == 13)
3840 {
3841 struct Type * t = type->__anon1.type;
3842
3843 while(t->kind == 13)
3844 t = t->__anon1.type;
3845 if(constant)
3846 t->constant = constant;
3847 }
3848 freeType = 1;
3849 if(type && _class->templateClass)
3850 type->passAsTemplate = 1;
3851 if(type)
3852 {
3853 }
3854 }
3855 }
3856 }
3857 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3858 {
3859 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3860 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3861 int paramCount = 0;
3862 int lastParam = -1;
3863 char templateString[1024];
3864 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3865
3866 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3867 for(cClass = expClass; cClass; cClass = cClass->base)
3868 {
3869 int p = 0;
3870
3871 if(cClass->templateClass)
3872 cClass = cClass->templateClass;
3873 for(param = cClass->templateParams.first; param; param = param->next)
3874 {
3875 int id = p;
3876 struct __ecereNameSpace__ecere__com__Class * sClass;
3877 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3878
3879 for(sClass = cClass->base; sClass; sClass = sClass->base)
3880 {
3881 if(sClass->templateClass)
3882 sClass = sClass->templateClass;
3883 id += sClass->templateParams.count;
3884 }
3885 arg = expClass->templateArgs[id];
3886 for(sClass = _class; sClass; sClass = sClass->base)
3887 {
3888 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3889 int p = 0;
3890 struct __ecereNameSpace__ecere__com__Class * nextClass;
3891
3892 if(sClass->templateClass)
3893 sClass = sClass->templateClass;
3894 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3895 {
3896 if(nextClass->templateClass)
3897 nextClass = nextClass->templateClass;
3898 p += nextClass->templateParams.count;
3899 }
3900 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3901 {
3902 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3903 {
3904 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3905 {
3906 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3907 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3908 break;
3909 }
3910 }
3911 }
3912 }
3913 {
3914 char argument[256];
3915
3916 argument[0] = '\0';
3917 switch(param->type)
3918 {
3919 case 2:
3920 {
3921 char expString[1024];
3922 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3923 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3924 struct Expression * exp;
3925 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3926
3927 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3928 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3929 ProcessExpressionType(exp);
3930 ComputeExpression(exp);
3931 expString[0] = '\0';
3932 PrintExpression(exp, expString);
3933 strcat(argument, expString);
3934 FreeExpression(exp);
3935 break;
3936 }
3937 case 1:
3938 {
3939 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3940 break;
3941 }
3942 case 0:
3943 {
3944 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3945 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3946 break;
3947 }
3948 }
3949 if(argument[0])
3950 {
3951 if(paramCount)
3952 strcat(templateString, ", ");
3953 if(lastParam != p - 1)
3954 {
3955 strcat(templateString, param->name);
3956 strcat(templateString, " = ");
3957 }
3958 strcat(templateString, argument);
3959 paramCount++;
3960 lastParam = p;
3961 }
3962 p++;
3963 }
3964 }
3965 }
3966 {
3967 int len = strlen(templateString);
3968
3969 if(templateString[len - 1] == '<')
3970 len--;
3971 else
3972 {
3973 if(templateString[len - 1] == '>')
3974 templateString[len++] = ' ';
3975 templateString[len++] = '>';
3976 }
3977 templateString[len++] = '\0';
3978 }
3979 {
3980 struct Context * context = SetupTemplatesContext(_class);
3981
3982 if(freeType)
3983 FreeType(type);
3984 type = ProcessTypeString(templateString, 0);
3985 freeType = 1;
3986 FinishTemplatesContext(context);
3987 }
3988 }
3989 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3990 {
3991 ProcessExpressionType(member->initializer->__anon1.exp);
3992 if(!member->initializer->__anon1.exp->expType)
3993 {
3994 if(inCompiler)
3995 {
3996 char expString[10240];
3997
3998 expString[0] = '\0';
3999 PrintExpression(member->initializer->__anon1.exp, expString);
4000 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
4001 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
4002 }
4003 }
4004 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
4005 {
4006 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
4007 }
4008 }
4009 else if(member->initializer)
4010 {
4011 ProcessInitializer(member->initializer, type);
4012 }
4013 if(freeType)
4014 FreeType(type);
4015 }
4016 else
4017 {
4018 if(_class && _class->type == 3)
4019 {
4020 if(member->initializer)
4021 {
4022 struct Type * type = MkClassType(_class->fullName);
4023
4024 ProcessInitializer(member->initializer, type);
4025 FreeType(type);
4026 }
4027 }
4028 else
4029 {
4030 if(member->initializer)
4031 {
4032 ProcessInitializer(member->initializer, (((void *)0)));
4033 }
4034 if(ident)
4035 {
4036 if(method)
4037 {
4038 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4039 }
4040 else if(_class)
4041 {
4042 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4043 if(inCompiler)
4044 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4045 }
4046 }
4047 else if(_class)
4048 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4049 }
4050 }
4051 }
4052
4053 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);
4054
4055 extern void FreeSpecifier(struct Specifier * spec);
4056
4057 static void ProcessFunction(struct FunctionDefinition * function);
4058
4059 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4060
4061 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4062
4063 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4064
4065 extern void FreeClassFunction(struct ClassFunction * func);
4066
4067 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4068
4069 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4070
4071 void ProcessInstantiationType(struct Instantiation * inst)
4072 {
4073 yylloc = inst->loc;
4074 if(inst->_class)
4075 {
4076 struct MembersInit * members;
4077 struct Symbol * classSym;
4078 struct __ecereNameSpace__ecere__com__Class * _class;
4079
4080 classSym = inst->_class->__anon1.__anon1.symbol;
4081 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4082 if(!_class || _class->type != 5)
4083 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4084 afterExternal = afterExternal ? afterExternal : curExternal;
4085 if(inst->exp)
4086 ProcessExpressionType(inst->exp);
4087 inst->isConstant = 1;
4088 if(inst->members)
4089 {
4090 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4091 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4092 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4093 int subMemberStackPos = 0;
4094
4095 for(members = (*inst->members).first; members; members = members->next)
4096 {
4097 switch(members->type)
4098 {
4099 case 1:
4100 {
4101 char name[1024];
4102 static unsigned int instMethodID = 0;
4103 struct External * external = curExternal;
4104 struct Context * context = curContext;
4105 struct Declarator * declarator = members->__anon1.function->declarator;
4106 struct Identifier * nameID = GetDeclId(declarator);
4107 char * unmangled = nameID ? nameID->string : (((void *)0));
4108 struct Expression * exp;
4109 struct External * createdExternal = (((void *)0));
4110
4111 if(inCompiler)
4112 {
4113 char number[16];
4114
4115 strcpy(name, "__ecereInstMeth_");
4116 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4117 strcat(name, "_");
4118 strcat(name, nameID->string);
4119 strcat(name, "_");
4120 sprintf(number, "_%08d", instMethodID++);
4121 strcat(name, number);
4122 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4123 }
4124 if(declarator)
4125 {
4126 struct Symbol * symbol = declarator->symbol;
4127 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4128
4129 if(method && method->type == 1)
4130 {
4131 symbol->__anon1.method = method;
4132 ProcessMethodType(method);
4133 if(!symbol->type->__anon1.__anon2.thisClass)
4134 {
4135 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4136 {
4137 if(!currentClass->symbol)
4138 currentClass->symbol = FindClass(currentClass->fullName);
4139 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4140 }
4141 else
4142 {
4143 if(!_class->symbol)
4144 _class->symbol = FindClass(_class->fullName);
4145 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4146 }
4147 }
4148 DeclareType(symbol->type, 1, 1);
4149 }
4150 else if(classSym)
4151 {
4152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4153 }
4154 }
4155 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4156 if(nameID)
4157 {
4158 FreeSpecifier(nameID->_class);
4159 nameID->_class = (((void *)0));
4160 }
4161 if(inCompiler)
4162 {
4163 struct External * oldExternal = curExternal;
4164
4165 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4166 {
4167 struct External * externalDecl;
4168
4169 externalDecl = MkExternalDeclaration((((void *)0)));
4170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4171 if(createdExternal->__anon1.function)
4172 {
4173 ProcessFunction(createdExternal->__anon1.function);
4174 {
4175 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4176
4177 externalDecl->__anon1.declaration = decl;
4178 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4179 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4180 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4181 }
4182 }
4183 }
4184 }
4185 else if(declarator)
4186 {
4187 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4188 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4189 }
4190 curExternal = external;
4191 curContext = context;
4192 if(inCompiler)
4193 {
4194 FreeClassFunction(members->__anon1.function);
4195 exp = QMkExpId(name);
4196 members->type = 0;
4197 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4198 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4199 }
4200 break;
4201 }
4202 case 0:
4203 {
4204 if(members->__anon1.dataMembers && classSym)
4205 {
4206 struct MemberInit * member;
4207 struct Location oldyyloc = yylloc;
4208
4209 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4210 {
4211 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4212 if(member->initializer && !member->initializer->isConstant)
4213 inst->isConstant = 0;
4214 }
4215 yylloc = oldyyloc;
4216 }
4217 break;
4218 }
4219 }
4220 }
4221 }
4222 }
4223 }
4224
4225 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4226 {
4227 if(inCompiler)
4228 {
4229 if(type->kind == 11)
4230 {
4231 struct Type * param;
4232
4233 if(declareParams)
4234 {
4235 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4236 DeclareType(param, declarePointers, 1);
4237 }
4238 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4239 }
4240 else if(type->kind == 13 && declarePointers)
4241 DeclareType(type->__anon1.type, declarePointers, 0);
4242 else if(type->kind == 8)
4243 {
4244 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4245 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4246 }
4247 else if(type->kind == 9 || type->kind == 10)
4248 {
4249 struct Type * member;
4250
4251 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4252 DeclareType(member, 0, 0);
4253 }
4254 else if(type->kind == 12)
4255 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4256 }
4257 }
4258
4259 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4260
4261 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4262 {
4263 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4264 int id = 0;
4265 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4266 struct __ecereNameSpace__ecere__com__Class * sClass;
4267
4268 for(sClass = _class; sClass; sClass = sClass->base)
4269 {
4270 id = 0;
4271 if(sClass->templateClass)
4272 sClass = sClass->templateClass;
4273 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4274 {
4275 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4276 {
4277 for(sClass = sClass->base; sClass; sClass = sClass->base)
4278 {
4279 if(sClass->templateClass)
4280 sClass = sClass->templateClass;
4281 id += sClass->templateParams.count;
4282 }
4283 break;
4284 }
4285 id++;
4286 }
4287 if(curParam)
4288 break;
4289 }
4290 if(curParam)
4291 {
4292 arg = &_class->templateArgs[id];
4293 if(arg && param->type == 0)
4294 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4295 }
4296 return arg;
4297 }
4298
4299 extern struct Context * PushContext(void);
4300
4301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4302
4303 struct TemplatedType
4304 {
4305 uintptr_t key;
4306 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4307 struct __ecereNameSpace__ecere__sys__BTNode * left;
4308 struct __ecereNameSpace__ecere__sys__BTNode * right;
4309 int depth;
4310 struct TemplateParameter * param;
4311 } __attribute__ ((gcc_struct));
4312
4313 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4314
4315 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4316 {
4317 struct Context * context = PushContext();
4318
4319 context->templateTypesOnly = 1;
4320 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4321 {
4322 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4323
4324 for(; param; param = param->next)
4325 {
4326 if(param->type == 0 && param->identifier)
4327 {
4328 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4329
4330 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4331 }
4332 }
4333 }
4334 else if(_class)
4335 {
4336 struct __ecereNameSpace__ecere__com__Class * sClass;
4337
4338 for(sClass = _class; sClass; sClass = sClass->base)
4339 {
4340 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4341
4342 for(p = sClass->templateParams.first; p; p = p->next)
4343 {
4344 if(p->type == 0)
4345 {
4346 struct TemplateParameter * param = p->param;
4347 struct TemplatedType * type;
4348
4349 if(!param)
4350 {
4351 p->param = param = __extension__ ({
4352 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4353
4354 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4355 });
4356 }
4357 type = __extension__ ({
4358 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4359
4360 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4361 });
4362 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4363 }
4364 }
4365 }
4366 }
4367 return context;
4368 }
4369
4370 extern void PopContext(struct Context * ctx);
4371
4372 extern void FreeContext(struct Context * context);
4373
4374 void FinishTemplatesContext(struct Context * context)
4375 {
4376 PopContext(context);
4377 FreeContext(context);
4378 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4379 }
4380
4381 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4382 {
4383 if(!method->dataType)
4384 {
4385 struct Context * context = SetupTemplatesContext(method->_class);
4386
4387 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4388 FinishTemplatesContext(context);
4389 if(method->type != 1 && method->dataType)
4390 {
4391 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4392 {
4393 if(!method->_class->symbol)
4394 method->_class->symbol = FindClass(method->_class->fullName);
4395 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4396 }
4397 }
4398 }
4399 }
4400
4401 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4402 {
4403 if(!prop->dataType)
4404 {
4405 struct Context * context = SetupTemplatesContext(prop->_class);
4406
4407 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4408 FinishTemplatesContext(context);
4409 }
4410 }
4411
4412 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4413
4414 extern void FreeTypeName(struct TypeName * typeName);
4415
4416 static void ProcessDeclarator(struct Declarator * decl);
4417
4418 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4419
4420 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4421
4422 struct MethodImport
4423 {
4424 struct MethodImport * prev;
4425 struct MethodImport * next;
4426 char *  name;
4427 unsigned int isVirtual;
4428 } __attribute__ ((gcc_struct));
4429
4430 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4431
4432 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4433 {
4434 struct Symbol * symbol = method->symbol;
4435
4436 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4437 {
4438 unsigned int dllImport = 0;
4439
4440 if(!method->dataType)
4441 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4442 if(!symbol || symbol->_import || method->type == 1)
4443 {
4444 if(!symbol || method->type == 1)
4445 {
4446 struct Symbol * classSym;
4447
4448 if(!method->_class->symbol)
4449 method->_class->symbol = FindClass(method->_class->fullName);
4450 classSym = method->_class->symbol;
4451 if(!classSym->_import)
4452 {
4453 struct ModuleImport * module;
4454
4455 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4456 module = FindModule(method->_class->module);
4457 else
4458 module = mainModule;
4459 classSym->_import = __extension__ ({
4460 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4461
4462 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4463 });
4464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4465 }
4466 if(!symbol)
4467 {
4468 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4469 }
4470 if(!symbol->_import)
4471 {
4472 symbol->_import = (struct ClassImport *)__extension__ ({
4473 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4474
4475 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4476 });
4477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4478 }
4479 if(!symbol)
4480 {
4481 symbol->type = method->dataType;
4482 if(symbol->type)
4483 symbol->type->refCount++;
4484 }
4485 }
4486 if(!method->dataType->dllExport)
4487 {
4488 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)
4489 dllImport = 1;
4490 }
4491 }
4492 if(method->type != 1 && method->dataType)
4493 DeclareType(method->dataType, 1, 1);
4494 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4495 {
4496 struct Declaration * decl;
4497 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4498 struct Declarator * d;
4499 struct Declarator * funcDecl;
4500 struct External * external;
4501
4502 specifiers = MkList();
4503 declarators = MkList();
4504 if(dllImport)
4505 ListAdd(specifiers, MkSpecifier(EXTERN));
4506 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4507 ListAdd(specifiers, MkSpecifier(STATIC));
4508 if(method->type == 1)
4509 {
4510 ListAdd(specifiers, MkSpecifier(INT));
4511 d = MkDeclaratorIdentifier(MkIdentifier(name));
4512 }
4513 else
4514 {
4515 d = MkDeclaratorIdentifier(MkIdentifier(name));
4516 if(dllImport)
4517 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4518 {
4519 struct Context * context = SetupTemplatesContext(method->_class);
4520
4521 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4522 FinishTemplatesContext(context);
4523 }
4524 funcDecl = GetFuncDecl(d);
4525 if(dllImport)
4526 {
4527 struct Specifier * spec, * next;
4528
4529 for(spec = (*specifiers).first; spec; spec = next)
4530 {
4531 next = spec->next;
4532 if(spec->type == 5)
4533 {
4534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4535 FreeSpecifier(spec);
4536 }
4537 }
4538 }
4539 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4540 {
4541 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4542 {
4543 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4544 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")));
4545 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4546 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4547
4548 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4549 {
4550 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4551
4552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4553 FreeTypeName(param);
4554 }
4555 if(!funcDecl->__anon1.function.parameters)
4556 funcDecl->__anon1.function.parameters = MkList();
4557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4558 }
4559 }
4560 }
4561 ProcessDeclarator(d);
4562 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4563 decl = MkDeclaration(specifiers, declarators);
4564 ReplaceThisClassSpecifiers(specifiers, method->_class);
4565 if(symbol->__anon2.__anon1.pointerExternal)
4566 {
4567 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4568
4569 {
4570 *functionSymbol = *symbol;
4571 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4572 if(functionSymbol->type)
4573 functionSymbol->type->refCount++;
4574 }
4575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4576 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4577 }
4578 external = MkExternalDeclaration(decl);
4579 if(curExternal)
4580 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4581 external->symbol = symbol;
4582 symbol->__anon2.__anon1.pointerExternal = external;
4583 }
4584 else if(ast)
4585 {
4586 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4587 }
4588 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4589 }
4590 }
4591
4592 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4593 {
4594 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4595 {
4596 unsigned int first = 1;
4597 int p = 0;
4598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4599 int lastParam = -1;
4600 char className[1024];
4601
4602 strcpy(className, _class->fullName);
4603 for(param = _class->templateParams.first; param; param = param->next)
4604 {
4605 {
4606 if(first)
4607 strcat(className, "<");
4608 if(!first)
4609 strcat(className, ", ");
4610 if(lastParam + 1 != p)
4611 {
4612 strcat(className, param->name);
4613 strcat(className, " = ");
4614 }
4615 strcat(className, param->name);
4616 first = 0;
4617 lastParam = p;
4618 }
4619 p++;
4620 }
4621 if(!first)
4622 {
4623 int len = strlen(className);
4624
4625 if(className[len - 1] == '>')
4626 className[len++] = ' ';
4627 className[len++] = '>';
4628 className[len++] = '\0';
4629 }
4630 return __ecereNameSpace__ecere__sys__CopyString(className);
4631 }
4632 else
4633 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4634 }
4635
4636 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4637 {
4638 struct Type * type;
4639
4640 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4641 {
4642 unsigned int first = 1;
4643 int p = 0;
4644 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4645 int lastParam = -1;
4646 char className[1024];
4647
4648 strcpy(className, _class->fullName);
4649 for(param = _class->templateParams.first; param; param = param->next)
4650 {
4651 {
4652 if(first)
4653 strcat(className, "<");
4654 if(!first)
4655 strcat(className, ", ");
4656 if(lastParam + 1 != p)
4657 {
4658 strcat(className, param->name);
4659 strcat(className, " = ");
4660 }
4661 strcat(className, param->name);
4662 first = 0;
4663 lastParam = p;
4664 }
4665 p++;
4666 }
4667 if(!first)
4668 {
4669 int len = strlen(className);
4670
4671 if(className[len - 1] == '>')
4672 className[len++] = ' ';
4673 className[len++] = '>';
4674 className[len++] = '\0';
4675 }
4676 type = MkClassType(className);
4677 }
4678 else
4679 {
4680 type = MkClassType(_class->fullName);
4681 }
4682 return type;
4683 }
4684
4685 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4686 {
4687 if(specs != (((void *)0)) && _class)
4688 {
4689 struct Specifier * spec;
4690
4691 for(spec = specs->first; spec; spec = spec->next)
4692 {
4693 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4694 {
4695 spec->type = 1;
4696 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4697 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4698 }
4699 }
4700 }
4701 }
4702
4703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4704
4705 struct __ecereNameSpace__ecere__com__GlobalFunction
4706 {
4707 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4708 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4709 const char *  name;
4710 int (*  function)();
4711 struct __ecereNameSpace__ecere__com__Instance * module;
4712 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4713 const char *  dataTypeString;
4714 struct Type * dataType;
4715 void *  symbol;
4716 } __attribute__ ((gcc_struct));
4717
4718 extern struct Context * globalContext;
4719
4720 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4721
4722 struct FunctionImport
4723 {
4724 struct FunctionImport * prev;
4725 struct FunctionImport * next;
4726 char *  name;
4727 } __attribute__ ((gcc_struct));
4728
4729 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4730 {
4731 struct Symbol * symbol = function->symbol;
4732
4733 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4734 {
4735 unsigned int imported = 0;
4736 unsigned int dllImport = 0;
4737
4738 if(!function->dataType)
4739 {
4740 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4741 if(!function->dataType->__anon1.__anon2.thisClass)
4742 function->dataType->__anon1.__anon2.staticMethod = 1;
4743 }
4744 if(inCompiler)
4745 {
4746 if(!symbol)
4747 {
4748 struct ModuleImport * module = FindModule(function->module);
4749
4750 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4751 if(module->name)
4752 {
4753 if(!function->dataType->dllExport)
4754 {
4755 symbol->_import = (struct ClassImport *)__extension__ ({
4756 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4757
4758 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4759 });
4760 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4761 }
4762 }
4763 {
4764 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4765 if(!symbol->type->__anon1.__anon2.thisClass)
4766 symbol->type->__anon1.__anon2.staticMethod = 1;
4767 }
4768 }
4769 imported = symbol->_import ? 1 : 0;
4770 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4771 dllImport = 1;
4772 }
4773 DeclareType(function->dataType, 1, 1);
4774 if(inCompiler)
4775 {
4776 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4777 {
4778 struct Declaration * decl;
4779 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4780 struct Declarator * d;
4781 struct Declarator * funcDecl;
4782 struct External * external;
4783
4784 specifiers = MkList();
4785 declarators = MkList();
4786 ListAdd(specifiers, MkSpecifier(EXTERN));
4787 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4788 if(dllImport)
4789 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4790 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4791 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4792 {
4793 struct Specifier * spec;
4794
4795 for(spec = (*specifiers).first; spec; spec = spec->next)
4796 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4797 {
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4799 FreeSpecifier(spec);
4800 break;
4801 }
4802 }
4803 funcDecl = GetFuncDecl(d);
4804 if(funcDecl && !funcDecl->__anon1.function.parameters)
4805 {
4806 funcDecl->__anon1.function.parameters = MkList();
4807 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4808 }
4809 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4810 {
4811 struct Context * oldCtx = curContext;
4812
4813 curContext = globalContext;
4814 decl = MkDeclaration(specifiers, declarators);
4815 curContext = oldCtx;
4816 }
4817 if(symbol->__anon2.__anon1.pointerExternal)
4818 {
4819 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4820
4821 {
4822 *functionSymbol = *symbol;
4823 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4824 if(functionSymbol->type)
4825 functionSymbol->type->refCount++;
4826 }
4827 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4828 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4829 }
4830 external = MkExternalDeclaration(decl);
4831 if(curExternal)
4832 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4833 external->symbol = symbol;
4834 symbol->__anon2.__anon1.pointerExternal = external;
4835 }
4836 else
4837 {
4838 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4839 }
4840 if(curExternal)
4841 symbol->id = curExternal->symbol->idCode;
4842 }
4843 }
4844 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4845 }
4846
4847 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4848
4849 struct GlobalData
4850 {
4851 uintptr_t key;
4852 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4853 struct __ecereNameSpace__ecere__sys__BTNode * left;
4854 struct __ecereNameSpace__ecere__sys__BTNode * right;
4855 int depth;
4856 struct __ecereNameSpace__ecere__com__Instance * module;
4857 char *  dataTypeString;
4858 struct Type * dataType;
4859 void *  symbol;
4860 char *  fullName;
4861 } __attribute__ ((gcc_struct));
4862
4863 void DeclareGlobalData(struct GlobalData * data)
4864 {
4865 struct Symbol * symbol = data->symbol;
4866
4867 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4868 {
4869 if(inCompiler)
4870 {
4871 if(!symbol)
4872 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4873 }
4874 if(!data->dataType)
4875 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4876 DeclareType(data->dataType, 1, 1);
4877 if(inCompiler)
4878 {
4879 if(!symbol->__anon2.__anon1.pointerExternal)
4880 {
4881 struct Declaration * decl;
4882 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4883 struct Declarator * d;
4884 struct External * external;
4885
4886 specifiers = MkList();
4887 declarators = MkList();
4888 ListAdd(specifiers, MkSpecifier(EXTERN));
4889 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4890 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4891 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4892 decl = MkDeclaration(specifiers, declarators);
4893 external = MkExternalDeclaration(decl);
4894 if(curExternal)
4895 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4896 external->symbol = symbol;
4897 symbol->__anon2.__anon1.pointerExternal = external;
4898 }
4899 else
4900 {
4901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4902 }
4903 if(curExternal)
4904 symbol->id = curExternal->symbol->idCode;
4905 }
4906 }
4907 }
4908
4909 struct Conversion
4910 {
4911 struct Conversion * prev, * next;
4912 struct __ecereNameSpace__ecere__com__Property * convert;
4913 unsigned int isGet;
4914 struct Type * resultType;
4915 } __attribute__ ((gcc_struct));
4916
4917 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4918
4919 extern void Compiler_Warning(const char *  format, ...);
4920
4921 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4922 {
4923 unsigned int status = 1;
4924
4925 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))
4926 {
4927 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4928 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4929
4930 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4931 {
4932 struct Type * sourceType = source, * destType = dest;
4933
4934 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4935 sourceType = sourceType->__anon1.type;
4936 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4937 destType = destType->__anon1.type;
4938 if(!destType->constant && sourceType->constant)
4939 {
4940 status = 0;
4941 if(warn)
4942 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4943 }
4944 }
4945 }
4946 return status;
4947 }
4948
4949 extern void CopyTypeInto(struct Type * type, struct Type * src);
4950
4951 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4952
4953 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)
4954 {
4955 if(source && dest)
4956 {
4957 if(warnConst)
4958 CheckConstCompatibility(source, dest, 1);
4959 if(source->kind == 20 && dest->kind != 20)
4960 {
4961 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4962
4963 if(type)
4964 source = type;
4965 }
4966 if(dest->kind == 20 && source->kind != 20)
4967 {
4968 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4969
4970 if(type)
4971 dest = type;
4972 }
4973 if(dest->classObjectType == 2 && dest->kind != 11)
4974 {
4975 if(source->classObjectType != 3)
4976 return 1;
4977 else
4978 {
4979 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4980 {
4981 return 1;
4982 }
4983 }
4984 }
4985 else
4986 {
4987 if(source->kind != 11 && source->classObjectType == 3)
4988 return 1;
4989 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4990 return 1;
4991 }
4992 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4993 {
4994 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))
4995 return 1;
4996 }
4997 if(dest->kind == 14 && source->kind != 0)
4998 return 1;
4999 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))
5000 return 1;
5001 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))
5002 return 1;
5003 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
5004 {
5005 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5006 {
5007 if(conversions != (((void *)0)))
5008 {
5009 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
5010 return 1;
5011 }
5012 else
5013 {
5014 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5015
5016 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5017 ;
5018 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
5019 ;
5020 if(sourceBase == destBase)
5021 return 1;
5022 }
5023 }
5024 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))
5025 return 1;
5026 else
5027 {
5028 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))
5029 {
5030 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
5031 {
5032 return 1;
5033 }
5034 }
5035 }
5036 }
5037 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
5038 return 1;
5039 if(doConversion)
5040 {
5041 if(source->kind == 8)
5042 {
5043 struct __ecereNameSpace__ecere__com__Class * _class;
5044
5045 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5046 {
5047 struct __ecereNameSpace__ecere__com__Property * convert;
5048
5049 for(convert = _class->conversions.first; convert; convert = convert->next)
5050 {
5051 if(convert->memberAccess == 1 || _class->module == privateModule)
5052 {
5053 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5054
5055 if(!convert->dataType)
5056 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5057 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))
5058 {
5059 if(!conversions && !convert->Get)
5060 return 1;
5061 else if(conversions != (((void *)0)))
5062 {
5063 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5064 return 1;
5065 else
5066 {
5067 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5068
5069 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5070 return 1;
5071 }
5072 }
5073 }
5074 }
5075 }
5076 }
5077 }
5078 if(dest->kind == 8)
5079 {
5080 struct __ecereNameSpace__ecere__com__Class * _class;
5081
5082 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5083 {
5084 struct __ecereNameSpace__ecere__com__Property * convert;
5085
5086 for(convert = _class->conversions.first; convert; convert = convert->next)
5087 {
5088 if(convert->memberAccess == 1 || _class->module == privateModule)
5089 {
5090 struct Type * constType = (((void *)0));
5091 unsigned int success = 0;
5092
5093 if(!convert->dataType)
5094 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5095 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5096 {
5097 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5098
5099 constType = __extension__ ({
5100 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5101
5102 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5103 });
5104 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5105 ptrType->constant = 1;
5106 }
5107 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5108 {
5109 if(!conversions && !convert->Set)
5110 success = 1;
5111 else if(conversions != (((void *)0)))
5112 {
5113 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))
5114 success = 1;
5115 else
5116 {
5117 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5118
5119 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5120 success = 1;
5121 }
5122 }
5123 }
5124 if(constType)
5125 FreeType(constType);
5126 if(success)
5127 return 1;
5128 }
5129 }
5130 }
5131 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5132 {
5133 if(!dest->__anon1._class->__anon1.registered->dataType)
5134 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5135 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5136 {
5137 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))
5138 {
5139 return 1;
5140 }
5141 }
5142 }
5143 }
5144 if(source->kind == 8)
5145 {
5146 struct __ecereNameSpace__ecere__com__Class * _class;
5147
5148 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5149 {
5150 struct __ecereNameSpace__ecere__com__Property * convert;
5151
5152 for(convert = _class->conversions.first; convert; convert = convert->next)
5153 {
5154 if(convert->memberAccess == 1 || _class->module == privateModule)
5155 {
5156 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5157
5158 if(!convert->dataType)
5159 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5160 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))
5161 {
5162 if(!conversions && !convert->Get)
5163 return 1;
5164 else if(conversions != (((void *)0)))
5165 {
5166 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))
5167 return 1;
5168 else
5169 {
5170 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5171
5172 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5173 return 1;
5174 }
5175 }
5176 }
5177 }
5178 }
5179 }
5180 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5181 {
5182 if(!source->__anon1._class->__anon1.registered->dataType)
5183 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5184 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5185 {
5186 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))
5187 return 1;
5188 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5189 return 1;
5190 }
5191 }
5192 }
5193 }
5194 if(source->kind == 8 || source->kind == 19)
5195 ;
5196 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5197 return 1;
5198 else if(dest->kind == 7 && source->kind == 6)
5199 return 1;
5200 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5201 return 1;
5202 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5203 return 1;
5204 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5205 return 1;
5206 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5207 return 1;
5208 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5209 return 1;
5210 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))
5211 return 1;
5212 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))
5213 return 1;
5214 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)))
5215 {
5216 struct Type * paramSource, * paramDest;
5217
5218 if(dest->kind == 16)
5219 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5220 if(source->kind == 16)
5221 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5222 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5223 dest = dest->__anon1.type;
5224 if(source->kind == 13 && source->__anon1.type->kind == 11)
5225 source = source->__anon1.type;
5226 if(dest->kind == 16)
5227 dest = dest->__anon1.__anon3.method->dataType;
5228 if(source->kind == 16)
5229 source = source->__anon1.__anon3.method->dataType;
5230 paramSource = source->__anon1.__anon2.params.first;
5231 if(paramSource && paramSource->kind == 0)
5232 paramSource = (((void *)0));
5233 paramDest = dest->__anon1.__anon2.params.first;
5234 if(paramDest && paramDest->kind == 0)
5235 paramDest = (((void *)0));
5236 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5237 {
5238 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))))
5239 {
5240 if(paramDest && paramDest->kind == 8)
5241 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5242 else
5243 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5244 return 0;
5245 }
5246 paramDest = paramDest->next;
5247 }
5248 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5249 {
5250 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5251 {
5252 if(dest->__anon1.__anon2.thisClass)
5253 {
5254 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5255 {
5256 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5257 return 0;
5258 }
5259 }
5260 else
5261 {
5262 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5263 {
5264 if(owningClassDest)
5265 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5266 else
5267 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5268 return 0;
5269 }
5270 }
5271 paramSource = paramSource->next;
5272 }
5273 else
5274 {
5275 if(dest->__anon1.__anon2.thisClass)
5276 {
5277 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5278 {
5279 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5280 return 0;
5281 }
5282 }
5283 else
5284 {
5285 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5286 {
5287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5288 return 0;
5289 }
5290 }
5291 }
5292 }
5293 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5294 {
5295 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5296 return 0;
5297 }
5298 else
5299 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5300 for(; paramDest; paramDest = paramDest->next)
5301 {
5302 if(!paramSource)
5303 {
5304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5305 return 0;
5306 }
5307 {
5308 struct Type * paramDestType = paramDest;
5309 struct Type * paramSourceType = paramSource;
5310 struct Type * type = paramDestType;
5311
5312 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5313 {
5314 int id = 0;
5315 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5316 struct __ecereNameSpace__ecere__com__Class * sClass;
5317
5318 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5319 {
5320 id = 0;
5321 if(sClass->templateClass)
5322 sClass = sClass->templateClass;
5323 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5324 {
5325 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5326 {
5327 for(sClass = sClass->base; sClass; sClass = sClass->base)
5328 {
5329 if(sClass->templateClass)
5330 sClass = sClass->templateClass;
5331 id += sClass->templateParams.count;
5332 }
5333 break;
5334 }
5335 id++;
5336 }
5337 if(curParam)
5338 break;
5339 }
5340 if(curParam)
5341 {
5342 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5343
5344 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5345 }
5346 }
5347 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)))
5348 {
5349 char type[1024];
5350
5351 type[0] = (char)0;
5352 PrintType(paramDest, type, 0, 1);
5353 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5354 if(paramDestType != paramDest)
5355 FreeType(paramDestType);
5356 return 0;
5357 }
5358 if(paramDestType != paramDest)
5359 FreeType(paramDestType);
5360 }
5361 paramSource = paramSource->next;
5362 }
5363 if(paramSource)
5364 {
5365 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5366 return 0;
5367 }
5368 return 1;
5369 }
5370 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5371 {
5372 return 1;
5373 }
5374 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5375 {
5376 ComputeTypeSize(source->__anon1.type);
5377 ComputeTypeSize(dest->__anon1.type);
5378 if(source->__anon1.type->size == dest->__anon1.type->size && MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5379 return 1;
5380 }
5381 }
5382 return 0;
5383 }
5384
5385 static void FreeConvert(struct Conversion * convert)
5386 {
5387 if(convert->resultType)
5388 FreeType(convert->resultType);
5389 }
5390
5391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5392
5393 struct __ecereNameSpace__ecere__com__BTNamedLink
5394 {
5395 const char *  name;
5396 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5397 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5398 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5399 int depth;
5400 void *  data;
5401 } __attribute__ ((gcc_struct));
5402
5403 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5404
5405 struct __ecereNameSpace__ecere__com__EnumClassData
5406 {
5407 struct __ecereNameSpace__ecere__sys__OldList values;
5408 long long largest;
5409 } __attribute__ ((gcc_struct));
5410
5411 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5412
5413 struct __ecereNameSpace__ecere__sys__NamedLink64
5414 {
5415 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5416 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5417 char *  name;
5418 long long data;
5419 } __attribute__ ((gcc_struct));
5420
5421 extern void FreeExpContents(struct Expression * exp);
5422
5423 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5424
5425 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5426
5427 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5428
5429 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5430
5431 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5432
5433 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5434 {
5435 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5436
5437 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)))
5438 {
5439 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5440
5441 if(_class->type == 4)
5442 {
5443 struct __ecereNameSpace__ecere__sys__OldList converts =
5444 {
5445 0, 0, 0, 0, 0
5446 };
5447 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5448
5449 type->kind = 8;
5450 if(!_class->symbol)
5451 _class->symbol = FindClass(_class->fullName);
5452 type->__anon1._class = _class->symbol;
5453 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5454 {
5455 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5456 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5457
5458 if(enumClass)
5459 {
5460 struct __ecereNameSpace__ecere__com__Class * baseClass;
5461
5462 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5463 {
5464 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5465
5466 for(value = e->values.first; value; value = value->next)
5467 {
5468 if(!strcmp(value->name, string))
5469 break;
5470 }
5471 if(value)
5472 {
5473 FreeExpContents(sourceExp);
5474 FreeType(sourceExp->expType);
5475 sourceExp->isConstant = 1;
5476 sourceExp->expType = MkClassType(baseClass->fullName);
5477 {
5478 char constant[256];
5479
5480 sourceExp->type = 2;
5481 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5482 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5483 else
5484 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5485 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5486 }
5487 while(converts.first)
5488 {
5489 struct Conversion * convert = converts.first;
5490
5491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5493 }
5494 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5495 return 1;
5496 }
5497 }
5498 }
5499 }
5500 if(converts.first)
5501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
5502 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5503 }
5504 }
5505 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)))
5506 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5507 return 1;
5508 return 0;
5509 }
5510
5511 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5512
5513 struct __ecereNameSpace__ecere__com__SubModule
5514 {
5515 struct __ecereNameSpace__ecere__com__SubModule * prev;
5516 struct __ecereNameSpace__ecere__com__SubModule * next;
5517 struct __ecereNameSpace__ecere__com__Instance * module;
5518 int importMode;
5519 } __attribute__ ((gcc_struct));
5520
5521 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5522 {
5523 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5524
5525 if(searchFor == searchIn)
5526 return 1;
5527 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5528 {
5529 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5530 {
5531 if(ModuleVisibility(subModule->module, searchFor))
5532 return 1;
5533 }
5534 }
5535 return 0;
5536 }
5537
5538 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5539
5540 struct __ecereNameSpace__ecere__com__Application
5541 {
5542 int argc;
5543 const char * *  argv;
5544 int exitCode;
5545 unsigned int isGUIApp;
5546 struct __ecereNameSpace__ecere__sys__OldList allModules;
5547 char *  parsedCommand;
5548 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5549 } __attribute__ ((gcc_struct));
5550
5551 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5552 {
5553 struct __ecereNameSpace__ecere__com__Instance * module;
5554
5555 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))
5556 return 1;
5557 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))
5558 return 1;
5559 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))
5560 return 1;
5561 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)
5562 {
5563 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5564 return 1;
5565 }
5566 return 0;
5567 }
5568
5569 extern struct Expression * CopyExpression(struct Expression * exp);
5570
5571 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5572
5573 void ReadString(char *  output, char *  string);
5574
5575 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5576
5577 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5578
5579 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5580
5581 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5582 {
5583 struct Type * source;
5584 struct Type * realDest = dest;
5585 struct Type * backupSourceExpType = (((void *)0));
5586 struct Expression * computedExp = sourceExp;
5587
5588 dest->refCount++;
5589 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)
5590 {
5591 computedExp = CopyExpression(sourceExp);
5592 ComputeExpression(computedExp);
5593 }
5594 source = sourceExp->expType;
5595 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5596 {
5597 if(computedExp != sourceExp)
5598 {
5599 FreeExpression(computedExp);
5600 computedExp = sourceExp;
5601 }
5602 FreeType(dest);
5603 return 1;
5604 }
5605 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5606 {
5607 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5608 {
5609 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5610
5611 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5612 ;
5613 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5614 ;
5615 if(sourceBase == destBase)
5616 {
5617 if(computedExp != sourceExp)
5618 {
5619 FreeExpression(computedExp);
5620 computedExp = sourceExp;
5621 }
5622 FreeType(dest);
5623 return 1;
5624 }
5625 }
5626 }
5627 if(source)
5628 {
5629 struct __ecereNameSpace__ecere__sys__OldList * specs;
5630 unsigned int flag = 0;
5631 long long value = (((int)0x7fffffff));
5632
5633 source->refCount++;
5634 if(computedExp->type == 2)
5635 {
5636 if(source->isSigned)
5637 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5638 else
5639 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5640 }
5641 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5642 {
5643 if(source->isSigned)
5644 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5645 else
5646 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5647 }
5648 if(computedExp != sourceExp)
5649 {
5650 FreeExpression(computedExp);
5651 computedExp = sourceExp;
5652 }
5653 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"))
5654 {
5655 FreeType(source);
5656 source = __extension__ ({
5657 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5658
5659 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5660 });
5661 }
5662 if(dest->kind == 8)
5663 {
5664 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5665
5666 if(_class && _class->type == 3)
5667 {
5668 if(source->kind != 8)
5669 {
5670 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5671 struct Type * tempDest, * tempSource;
5672
5673 for(; _class->base->type != 1000; _class = _class->base)
5674 ;
5675 tempSource = dest;
5676 tempDest = tempType;
5677 tempType->kind = 8;
5678 if(!_class->symbol)
5679 _class->symbol = FindClass(_class->fullName);
5680 tempType->__anon1._class = _class->symbol;
5681 tempType->truth = dest->truth;
5682 if(tempType->__anon1._class)
5683 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5684 backupSourceExpType = sourceExp->expType;
5685 sourceExp->expType = dest;
5686 dest->refCount++;
5687 flag = 1;
5688 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5689 }
5690 }
5691 if(_class && _class->type == 2 && source->kind != 8)
5692 {
5693 if(!dest->__anon1._class->__anon1.registered->dataType)
5694 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5695 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5696 {
5697 FreeType(source);
5698 FreeType(sourceExp->expType);
5699 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5700 source->refCount++;
5701 }
5702 }
5703 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5704 {
5705 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5706 struct Declarator * decl;
5707 char string[1024];
5708
5709 ReadString(string, sourceExp->__anon1.__anon2.string);
5710 decl = SpecDeclFromString(string, specs, (((void *)0)));
5711 FreeExpContents(sourceExp);
5712 FreeType(sourceExp->expType);
5713 sourceExp->type = 24;
5714 sourceExp->__anon1._classExp.specifiers = specs;
5715 sourceExp->__anon1._classExp.decl = decl;
5716 sourceExp->expType = dest;
5717 dest->refCount++;
5718 FreeType(source);
5719 FreeType(dest);
5720 if(backupSourceExpType)
5721 FreeType(backupSourceExpType);
5722 return 1;
5723 }
5724 }
5725 else if(source->kind == 8)
5726 {
5727 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5728
5729 if(_class && (_class->type == 3 || _class->type == 2))
5730 {
5731 if(dest->kind != 8)
5732 {
5733 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5734 struct Type * tempDest, * tempSource;
5735
5736 if(!source->__anon1._class->__anon1.registered->dataType)
5737 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5738 for(; _class->base->type != 1000; _class = _class->base)
5739 ;
5740 tempDest = source;
5741 tempSource = tempType;
5742 tempType->kind = 8;
5743 tempType->__anon1._class = FindClass(_class->fullName);
5744 tempType->truth = source->truth;
5745 tempType->classObjectType = source->classObjectType;
5746 if(tempType->__anon1._class)
5747 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5748 if(conversions->last)
5749 {
5750 ((struct Conversion *)conversions->last)->resultType = dest;
5751 dest->refCount++;
5752 }
5753 FreeType(sourceExp->expType);
5754 sourceExp->expType = MkClassType(_class->fullName);
5755 sourceExp->expType->truth = source->truth;
5756 sourceExp->expType->classObjectType = source->classObjectType;
5757 if(!sourceExp->destType)
5758 {
5759 FreeType(sourceExp->destType);
5760 sourceExp->destType = sourceExp->expType;
5761 if(sourceExp->expType)
5762 sourceExp->expType->refCount++;
5763 }
5764 if(!_class->dataType)
5765 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5766 FreeType(dest);
5767 dest = MkClassType(source->__anon1._class->string);
5768 dest->truth = source->truth;
5769 dest->classObjectType = source->classObjectType;
5770 FreeType(source);
5771 source = _class->dataType;
5772 source->refCount++;
5773 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5774 }
5775 }
5776 }
5777 if(!flag)
5778 {
5779 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5780 {
5781 FreeType(source);
5782 FreeType(dest);
5783 return 1;
5784 }
5785 }
5786 if(dest->kind == 8)
5787 {
5788 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5789 unsigned int fittingValue = 0;
5790
5791 if(_class && _class->type == 4)
5792 {
5793 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5794 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5795
5796 if(c && value >= 0 && value <= c->largest)
5797 fittingValue = 1;
5798 }
5799 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5800 {
5801 if(_class->type == 0 || _class->type == 5)
5802 {
5803 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5804
5805 *newExp = *sourceExp;
5806 if(sourceExp->destType)
5807 sourceExp->destType->refCount++;
5808 if(sourceExp->expType)
5809 sourceExp->expType->refCount++;
5810 sourceExp->type = 11;
5811 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5812 sourceExp->__anon1.cast.exp = newExp;
5813 FreeType(sourceExp->expType);
5814 sourceExp->expType = (((void *)0));
5815 ProcessExpressionType(sourceExp);
5816 if(!inCompiler)
5817 {
5818 FreeType(sourceExp->expType);
5819 sourceExp->expType = dest;
5820 }
5821 FreeType(source);
5822 if(inCompiler)
5823 FreeType(dest);
5824 if(backupSourceExpType)
5825 FreeType(backupSourceExpType);
5826 return 1;
5827 }
5828 if(!_class->dataType)
5829 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5830 FreeType(dest);
5831 dest = _class->dataType;
5832 dest->refCount++;
5833 }
5834 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))
5835 {
5836 specs = MkListOne(MkSpecifier(DOUBLE));
5837 }
5838 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))
5839 {
5840 specs = MkListOne(MkSpecifier(FLOAT));
5841 }
5842 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))
5843 {
5844 specs = MkList();
5845 if(!dest->isSigned)
5846 ListAdd(specs, MkSpecifier(UNSIGNED));
5847 ListAdd(specs, MkSpecifier(INT64));
5848 }
5849 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5850 {
5851 specs = MkList();
5852 if(!dest->isSigned)
5853 ListAdd(specs, MkSpecifier(UNSIGNED));
5854 ListAdd(specs, MkSpecifier(INT));
5855 }
5856 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5857 {
5858 specs = MkList();
5859 if(!dest->isSigned)
5860 ListAdd(specs, MkSpecifier(UNSIGNED));
5861 ListAdd(specs, MkSpecifier(SHORT));
5862 }
5863 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5864 {
5865 specs = MkList();
5866 if(!dest->isSigned)
5867 ListAdd(specs, MkSpecifier(UNSIGNED));
5868 ListAdd(specs, MkSpecifier(CHAR));
5869 }
5870 else
5871 {
5872 FreeType(source);
5873 FreeType(dest);
5874 if(backupSourceExpType)
5875 {
5876 if(sourceExp->expType)
5877 FreeType(sourceExp->expType);
5878 sourceExp->expType = backupSourceExpType;
5879 }
5880 return 0;
5881 }
5882 }
5883 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))
5884 {
5885 specs = MkListOne(MkSpecifier(DOUBLE));
5886 }
5887 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))
5888 {
5889 specs = MkListOne(MkSpecifier(FLOAT));
5890 }
5891 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5892 {
5893 specs = MkList();
5894 ListAdd(specs, MkSpecifier(BOOL));
5895 }
5896 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)))
5897 {
5898 specs = MkList();
5899 if(!dest->isSigned)
5900 ListAdd(specs, MkSpecifier(UNSIGNED));
5901 ListAdd(specs, MkSpecifier(CHAR));
5902 }
5903 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)))))
5904 {
5905 specs = MkList();
5906 if(!dest->isSigned)
5907 ListAdd(specs, MkSpecifier(UNSIGNED));
5908 ListAdd(specs, MkSpecifier(SHORT));
5909 }
5910 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5911 {
5912 specs = MkList();
5913 if(!dest->isSigned)
5914 ListAdd(specs, MkSpecifier(UNSIGNED));
5915 ListAdd(specs, MkSpecifier(INT));
5916 }
5917 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5918 {
5919 specs = MkList();
5920 if(!dest->isSigned)
5921 ListAdd(specs, MkSpecifier(UNSIGNED));
5922 ListAdd(specs, MkSpecifier(INT64));
5923 }
5924 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5925 {
5926 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5927 }
5928 else
5929 {
5930 FreeType(source);
5931 FreeType(dest);
5932 if(backupSourceExpType)
5933 {
5934 if(sourceExp->expType)
5935 FreeType(sourceExp->expType);
5936 sourceExp->expType = backupSourceExpType;
5937 }
5938 return 0;
5939 }
5940 if(!flag && !sourceExp->opDestType)
5941 {
5942 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5943
5944 *newExp = *sourceExp;
5945 newExp->prev = (((void *)0));
5946 newExp->next = (((void *)0));
5947 if(sourceExp->destType)
5948 sourceExp->destType->refCount++;
5949 if(sourceExp->expType)
5950 sourceExp->expType->refCount++;
5951 sourceExp->type = 11;
5952 if(realDest->kind == 8)
5953 {
5954 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5955 FreeList(specs, (void *)(FreeSpecifier));
5956 }
5957 else
5958 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5959 if(newExp->type == 4)
5960 {
5961 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5962 }
5963 else
5964 sourceExp->__anon1.cast.exp = newExp;
5965 FreeType(sourceExp->expType);
5966 sourceExp->expType = (((void *)0));
5967 ProcessExpressionType(sourceExp);
5968 }
5969 else
5970 FreeList(specs, (void *)(FreeSpecifier));
5971 FreeType(dest);
5972 FreeType(source);
5973 if(backupSourceExpType)
5974 FreeType(backupSourceExpType);
5975 return 1;
5976 }
5977 else
5978 {
5979 if(computedExp != sourceExp)
5980 {
5981 FreeExpression(computedExp);
5982 computedExp = sourceExp;
5983 }
5984 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5985 sourceExp = (*sourceExp->__anon1.list).last;
5986 if(sourceExp->type == 0)
5987 {
5988 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5989
5990 if(dest->kind == 8)
5991 {
5992 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5993 {
5994 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5995 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5996
5997 if(enumClass)
5998 {
5999 for(; _class && _class->type == 4; _class = _class->base)
6000 {
6001 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
6002 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
6003
6004 for(value = e->values.first; value; value = value->next)
6005 {
6006 if(!strcmp(value->name, id->string))
6007 break;
6008 }
6009 if(value)
6010 {
6011 FreeExpContents(sourceExp);
6012 FreeType(sourceExp->expType);
6013 sourceExp->isConstant = 1;
6014 sourceExp->expType = MkClassType(_class->fullName);
6015 {
6016 sourceExp->type = 2;
6017 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
6018 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
6019 else
6020 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
6021 }
6022 FreeType(dest);
6023 return 1;
6024 }
6025 }
6026 }
6027 }
6028 }
6029 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
6030 {
6031 FreeType(dest);
6032 return 1;
6033 }
6034 }
6035 FreeType(dest);
6036 }
6037 return 0;
6038 }
6039
6040 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6041 {
6042 int value2 = op2->__anon1.i;
6043
6044 exp->type = 2;
6045 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6046 if(!exp->expType)
6047 {
6048 exp->expType = op1->type;
6049 if(op1->type)
6050 op1->type->refCount++;
6051 }
6052 return 1;
6053 }
6054
6055 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6056 {
6057 unsigned int value2 = op2->__anon1.ui;
6058
6059 exp->type = 2;
6060 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6061 if(!exp->expType)
6062 {
6063 exp->expType = op1->type;
6064 if(op1->type)
6065 op1->type->refCount++;
6066 }
6067 return 1;
6068 }
6069
6070 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6071 {
6072 long long value2 = op2->__anon1.i64;
6073
6074 exp->type = 2;
6075 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6076 if(!exp->expType)
6077 {
6078 exp->expType = op1->type;
6079 if(op1->type)
6080 op1->type->refCount++;
6081 }
6082 return 1;
6083 }
6084
6085 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6086 {
6087 uint64 value2 = op2->__anon1.ui64;
6088
6089 exp->type = 2;
6090 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6091 if(!exp->expType)
6092 {
6093 exp->expType = op1->type;
6094 if(op1->type)
6095 op1->type->refCount++;
6096 }
6097 return 1;
6098 }
6099
6100 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6101 {
6102 short value2 = op2->__anon1.s;
6103
6104 exp->type = 2;
6105 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6106 if(!exp->expType)
6107 {
6108 exp->expType = op1->type;
6109 if(op1->type)
6110 op1->type->refCount++;
6111 }
6112 return 1;
6113 }
6114
6115 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6116 {
6117 unsigned short value2 = op2->__anon1.us;
6118
6119 exp->type = 2;
6120 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6121 if(!exp->expType)
6122 {
6123 exp->expType = op1->type;
6124 if(op1->type)
6125 op1->type->refCount++;
6126 }
6127 return 1;
6128 }
6129
6130 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6131 {
6132 char value2 = op2->__anon1.c;
6133
6134 exp->type = 2;
6135 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6136 if(!exp->expType)
6137 {
6138 exp->expType = op1->type;
6139 if(op1->type)
6140 op1->type->refCount++;
6141 }
6142 return 1;
6143 }
6144
6145 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6146 {
6147 unsigned char value2 = op2->__anon1.uc;
6148
6149 exp->type = 2;
6150 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6151 if(!exp->expType)
6152 {
6153 exp->expType = op1->type;
6154 if(op1->type)
6155 op1->type->refCount++;
6156 }
6157 return 1;
6158 }
6159
6160 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6161 {
6162 float value2 = op2->__anon1.f;
6163
6164 exp->type = 2;
6165 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6166 if(!exp->expType)
6167 {
6168 exp->expType = op1->type;
6169 if(op1->type)
6170 op1->type->refCount++;
6171 }
6172 return 1;
6173 }
6174
6175 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6176 {
6177 double value2 = op2->__anon1.d;
6178
6179 exp->type = 2;
6180 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6181 if(!exp->expType)
6182 {
6183 exp->expType = op1->type;
6184 if(op1->type)
6185 op1->type->refCount++;
6186 }
6187 return 1;
6188 }
6189
6190 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6191 {
6192 int value2 = op2->__anon1.i;
6193
6194 exp->type = 2;
6195 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6196 if(!exp->expType)
6197 {
6198 exp->expType = op1->type;
6199 if(op1->type)
6200 op1->type->refCount++;
6201 }
6202 return 1;
6203 }
6204
6205 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6206 {
6207 unsigned int value2 = op2->__anon1.ui;
6208
6209 exp->type = 2;
6210 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6211 if(!exp->expType)
6212 {
6213 exp->expType = op1->type;
6214 if(op1->type)
6215 op1->type->refCount++;
6216 }
6217 return 1;
6218 }
6219
6220 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6221 {
6222 long long value2 = op2->__anon1.i64;
6223
6224 exp->type = 2;
6225 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6226 if(!exp->expType)
6227 {
6228 exp->expType = op1->type;
6229 if(op1->type)
6230 op1->type->refCount++;
6231 }
6232 return 1;
6233 }
6234
6235 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6236 {
6237 uint64 value2 = op2->__anon1.ui64;
6238
6239 exp->type = 2;
6240 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6241 if(!exp->expType)
6242 {
6243 exp->expType = op1->type;
6244 if(op1->type)
6245 op1->type->refCount++;
6246 }
6247 return 1;
6248 }
6249
6250 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6251 {
6252 short value2 = op2->__anon1.s;
6253
6254 exp->type = 2;
6255 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6256 if(!exp->expType)
6257 {
6258 exp->expType = op1->type;
6259 if(op1->type)
6260 op1->type->refCount++;
6261 }
6262 return 1;
6263 }
6264
6265 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6266 {
6267 unsigned short value2 = op2->__anon1.us;
6268
6269 exp->type = 2;
6270 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6271 if(!exp->expType)
6272 {
6273 exp->expType = op1->type;
6274 if(op1->type)
6275 op1->type->refCount++;
6276 }
6277 return 1;
6278 }
6279
6280 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6281 {
6282 char value2 = op2->__anon1.c;
6283
6284 exp->type = 2;
6285 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6286 if(!exp->expType)
6287 {
6288 exp->expType = op1->type;
6289 if(op1->type)
6290 op1->type->refCount++;
6291 }
6292 return 1;
6293 }
6294
6295 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6296 {
6297 unsigned char value2 = op2->__anon1.uc;
6298
6299 exp->type = 2;
6300 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6301 if(!exp->expType)
6302 {
6303 exp->expType = op1->type;
6304 if(op1->type)
6305 op1->type->refCount++;
6306 }
6307 return 1;
6308 }
6309
6310 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6311 {
6312 float value2 = op2->__anon1.f;
6313
6314 exp->type = 2;
6315 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6316 if(!exp->expType)
6317 {
6318 exp->expType = op1->type;
6319 if(op1->type)
6320 op1->type->refCount++;
6321 }
6322 return 1;
6323 }
6324
6325 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6326 {
6327 double value2 = op2->__anon1.d;
6328
6329 exp->type = 2;
6330 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6331 if(!exp->expType)
6332 {
6333 exp->expType = op1->type;
6334 if(op1->type)
6335 op1->type->refCount++;
6336 }
6337 return 1;
6338 }
6339
6340 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6341 {
6342 int value2 = op2->__anon1.i;
6343
6344 exp->type = 2;
6345 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6346 if(!exp->expType)
6347 {
6348 exp->expType = op1->type;
6349 if(op1->type)
6350 op1->type->refCount++;
6351 }
6352 return 1;
6353 }
6354
6355 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6356 {
6357 unsigned int value2 = op2->__anon1.ui;
6358
6359 exp->type = 2;
6360 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6361 if(!exp->expType)
6362 {
6363 exp->expType = op1->type;
6364 if(op1->type)
6365 op1->type->refCount++;
6366 }
6367 return 1;
6368 }
6369
6370 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6371 {
6372 long long value2 = op2->__anon1.i64;
6373
6374 exp->type = 2;
6375 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6376 if(!exp->expType)
6377 {
6378 exp->expType = op1->type;
6379 if(op1->type)
6380 op1->type->refCount++;
6381 }
6382 return 1;
6383 }
6384
6385 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6386 {
6387 uint64 value2 = op2->__anon1.ui64;
6388
6389 exp->type = 2;
6390 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6391 if(!exp->expType)
6392 {
6393 exp->expType = op1->type;
6394 if(op1->type)
6395 op1->type->refCount++;
6396 }
6397 return 1;
6398 }
6399
6400 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6401 {
6402 short value2 = op2->__anon1.s;
6403
6404 exp->type = 2;
6405 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6406 if(!exp->expType)
6407 {
6408 exp->expType = op1->type;
6409 if(op1->type)
6410 op1->type->refCount++;
6411 }
6412 return 1;
6413 }
6414
6415 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6416 {
6417 unsigned short value2 = op2->__anon1.us;
6418
6419 exp->type = 2;
6420 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6421 if(!exp->expType)
6422 {
6423 exp->expType = op1->type;
6424 if(op1->type)
6425 op1->type->refCount++;
6426 }
6427 return 1;
6428 }
6429
6430 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6431 {
6432 char value2 = op2->__anon1.c;
6433
6434 exp->type = 2;
6435 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6436 if(!exp->expType)
6437 {
6438 exp->expType = op1->type;
6439 if(op1->type)
6440 op1->type->refCount++;
6441 }
6442 return 1;
6443 }
6444
6445 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6446 {
6447 unsigned char value2 = op2->__anon1.uc;
6448
6449 exp->type = 2;
6450 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6451 if(!exp->expType)
6452 {
6453 exp->expType = op1->type;
6454 if(op1->type)
6455 op1->type->refCount++;
6456 }
6457 return 1;
6458 }
6459
6460 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6461 {
6462 float value2 = op2->__anon1.f;
6463
6464 exp->type = 2;
6465 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6466 if(!exp->expType)
6467 {
6468 exp->expType = op1->type;
6469 if(op1->type)
6470 op1->type->refCount++;
6471 }
6472 return 1;
6473 }
6474
6475 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6476 {
6477 double value2 = op2->__anon1.d;
6478
6479 exp->type = 2;
6480 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6481 if(!exp->expType)
6482 {
6483 exp->expType = op1->type;
6484 if(op1->type)
6485 op1->type->refCount++;
6486 }
6487 return 1;
6488 }
6489
6490 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6491 {
6492 int value2 = op2->__anon1.i;
6493
6494 exp->type = 2;
6495 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6496 if(!exp->expType)
6497 {
6498 exp->expType = op1->type;
6499 if(op1->type)
6500 op1->type->refCount++;
6501 }
6502 return 1;
6503 }
6504
6505 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6506 {
6507 unsigned int value2 = op2->__anon1.ui;
6508
6509 exp->type = 2;
6510 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6511 if(!exp->expType)
6512 {
6513 exp->expType = op1->type;
6514 if(op1->type)
6515 op1->type->refCount++;
6516 }
6517 return 1;
6518 }
6519
6520 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6521 {
6522 long long value2 = op2->__anon1.i64;
6523
6524 exp->type = 2;
6525 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6526 if(!exp->expType)
6527 {
6528 exp->expType = op1->type;
6529 if(op1->type)
6530 op1->type->refCount++;
6531 }
6532 return 1;
6533 }
6534
6535 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6536 {
6537 uint64 value2 = op2->__anon1.ui64;
6538
6539 exp->type = 2;
6540 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6541 if(!exp->expType)
6542 {
6543 exp->expType = op1->type;
6544 if(op1->type)
6545 op1->type->refCount++;
6546 }
6547 return 1;
6548 }
6549
6550 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6551 {
6552 short value2 = op2->__anon1.s;
6553
6554 exp->type = 2;
6555 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6556 if(!exp->expType)
6557 {
6558 exp->expType = op1->type;
6559 if(op1->type)
6560 op1->type->refCount++;
6561 }
6562 return 1;
6563 }
6564
6565 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6566 {
6567 unsigned short value2 = op2->__anon1.us;
6568
6569 exp->type = 2;
6570 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6571 if(!exp->expType)
6572 {
6573 exp->expType = op1->type;
6574 if(op1->type)
6575 op1->type->refCount++;
6576 }
6577 return 1;
6578 }
6579
6580 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6581 {
6582 char value2 = op2->__anon1.c;
6583
6584 exp->type = 2;
6585 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6586 if(!exp->expType)
6587 {
6588 exp->expType = op1->type;
6589 if(op1->type)
6590 op1->type->refCount++;
6591 }
6592 return 1;
6593 }
6594
6595 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6596 {
6597 unsigned char value2 = op2->__anon1.uc;
6598
6599 exp->type = 2;
6600 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6601 if(!exp->expType)
6602 {
6603 exp->expType = op1->type;
6604 if(op1->type)
6605 op1->type->refCount++;
6606 }
6607 return 1;
6608 }
6609
6610 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6611 {
6612 float value2 = op2->__anon1.f;
6613
6614 exp->type = 2;
6615 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6616 if(!exp->expType)
6617 {
6618 exp->expType = op1->type;
6619 if(op1->type)
6620 op1->type->refCount++;
6621 }
6622 return 1;
6623 }
6624
6625 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6626 {
6627 double value2 = op2->__anon1.d;
6628
6629 exp->type = 2;
6630 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6631 if(!exp->expType)
6632 {
6633 exp->expType = op1->type;
6634 if(op1->type)
6635 op1->type->refCount++;
6636 }
6637 return 1;
6638 }
6639
6640 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6641 {
6642 int value2 = op2->__anon1.i;
6643
6644 exp->type = 2;
6645 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6646 if(!exp->expType)
6647 {
6648 exp->expType = op1->type;
6649 if(op1->type)
6650 op1->type->refCount++;
6651 }
6652 return 1;
6653 }
6654
6655 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6656 {
6657 unsigned int value2 = op2->__anon1.ui;
6658
6659 exp->type = 2;
6660 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6661 if(!exp->expType)
6662 {
6663 exp->expType = op1->type;
6664 if(op1->type)
6665 op1->type->refCount++;
6666 }
6667 return 1;
6668 }
6669
6670 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6671 {
6672 long long value2 = op2->__anon1.i64;
6673
6674 exp->type = 2;
6675 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6676 if(!exp->expType)
6677 {
6678 exp->expType = op1->type;
6679 if(op1->type)
6680 op1->type->refCount++;
6681 }
6682 return 1;
6683 }
6684
6685 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6686 {
6687 uint64 value2 = op2->__anon1.ui64;
6688
6689 exp->type = 2;
6690 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6691 if(!exp->expType)
6692 {
6693 exp->expType = op1->type;
6694 if(op1->type)
6695 op1->type->refCount++;
6696 }
6697 return 1;
6698 }
6699
6700 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6701 {
6702 short value2 = op2->__anon1.s;
6703
6704 exp->type = 2;
6705 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6706 if(!exp->expType)
6707 {
6708 exp->expType = op1->type;
6709 if(op1->type)
6710 op1->type->refCount++;
6711 }
6712 return 1;
6713 }
6714
6715 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6716 {
6717 unsigned short value2 = op2->__anon1.us;
6718
6719 exp->type = 2;
6720 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6721 if(!exp->expType)
6722 {
6723 exp->expType = op1->type;
6724 if(op1->type)
6725 op1->type->refCount++;
6726 }
6727 return 1;
6728 }
6729
6730 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6731 {
6732 char value2 = op2->__anon1.c;
6733
6734 exp->type = 2;
6735 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6736 if(!exp->expType)
6737 {
6738 exp->expType = op1->type;
6739 if(op1->type)
6740 op1->type->refCount++;
6741 }
6742 return 1;
6743 }
6744
6745 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6746 {
6747 unsigned char value2 = op2->__anon1.uc;
6748
6749 exp->type = 2;
6750 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6751 if(!exp->expType)
6752 {
6753 exp->expType = op1->type;
6754 if(op1->type)
6755 op1->type->refCount++;
6756 }
6757 return 1;
6758 }
6759
6760 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6761 {
6762 exp->type = 2;
6763 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6764 if(!exp->expType)
6765 {
6766 exp->expType = op1->type;
6767 if(op1->type)
6768 op1->type->refCount++;
6769 }
6770 return 1;
6771 }
6772
6773 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6774 {
6775 exp->type = 2;
6776 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6777 if(!exp->expType)
6778 {
6779 exp->expType = op1->type;
6780 if(op1->type)
6781 op1->type->refCount++;
6782 }
6783 return 1;
6784 }
6785
6786 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6787 {
6788 exp->type = 2;
6789 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6790 if(!exp->expType)
6791 {
6792 exp->expType = op1->type;
6793 if(op1->type)
6794 op1->type->refCount++;
6795 }
6796 return 1;
6797 }
6798
6799 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6800 {
6801 exp->type = 2;
6802 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6803 if(!exp->expType)
6804 {
6805 exp->expType = op1->type;
6806 if(op1->type)
6807 op1->type->refCount++;
6808 }
6809 return 1;
6810 }
6811
6812 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6813 {
6814 exp->type = 2;
6815 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6816 if(!exp->expType)
6817 {
6818 exp->expType = op1->type;
6819 if(op1->type)
6820 op1->type->refCount++;
6821 }
6822 return 1;
6823 }
6824
6825 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6826 {
6827 exp->type = 2;
6828 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6829 if(!exp->expType)
6830 {
6831 exp->expType = op1->type;
6832 if(op1->type)
6833 op1->type->refCount++;
6834 }
6835 return 1;
6836 }
6837
6838 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6839 {
6840 exp->type = 2;
6841 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6842 if(!exp->expType)
6843 {
6844 exp->expType = op1->type;
6845 if(op1->type)
6846 op1->type->refCount++;
6847 }
6848 return 1;
6849 }
6850
6851 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6852 {
6853 exp->type = 2;
6854 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6855 if(!exp->expType)
6856 {
6857 exp->expType = op1->type;
6858 if(op1->type)
6859 op1->type->refCount++;
6860 }
6861 return 1;
6862 }
6863
6864 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6865 {
6866 exp->type = 2;
6867 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6868 if(!exp->expType)
6869 {
6870 exp->expType = op1->type;
6871 if(op1->type)
6872 op1->type->refCount++;
6873 }
6874 return 1;
6875 }
6876
6877 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6878 {
6879 exp->type = 2;
6880 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6881 if(!exp->expType)
6882 {
6883 exp->expType = op1->type;
6884 if(op1->type)
6885 op1->type->refCount++;
6886 }
6887 return 1;
6888 }
6889
6890 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6891 {
6892 exp->type = 2;
6893 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6894 if(!exp->expType)
6895 {
6896 exp->expType = op1->type;
6897 if(op1->type)
6898 op1->type->refCount++;
6899 }
6900 return 1;
6901 }
6902
6903 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6904 {
6905 exp->type = 2;
6906 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6907 if(!exp->expType)
6908 {
6909 exp->expType = op1->type;
6910 if(op1->type)
6911 op1->type->refCount++;
6912 }
6913 return 1;
6914 }
6915
6916 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6917 {
6918 exp->type = 2;
6919 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6920 if(!exp->expType)
6921 {
6922 exp->expType = op1->type;
6923 if(op1->type)
6924 op1->type->refCount++;
6925 }
6926 return 1;
6927 }
6928
6929 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6930 {
6931 exp->type = 2;
6932 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6933 if(!exp->expType)
6934 {
6935 exp->expType = op1->type;
6936 if(op1->type)
6937 op1->type->refCount++;
6938 }
6939 return 1;
6940 }
6941
6942 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6943 {
6944 exp->type = 2;
6945 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6946 if(!exp->expType)
6947 {
6948 exp->expType = op1->type;
6949 if(op1->type)
6950 op1->type->refCount++;
6951 }
6952 return 1;
6953 }
6954
6955 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6956 {
6957 exp->type = 2;
6958 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6959 if(!exp->expType)
6960 {
6961 exp->expType = op1->type;
6962 if(op1->type)
6963 op1->type->refCount++;
6964 }
6965 return 1;
6966 }
6967
6968 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6969 {
6970 exp->type = 2;
6971 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6972 if(!exp->expType)
6973 {
6974 exp->expType = op1->type;
6975 if(op1->type)
6976 op1->type->refCount++;
6977 }
6978 return 1;
6979 }
6980
6981 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6982 {
6983 exp->type = 2;
6984 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6985 if(!exp->expType)
6986 {
6987 exp->expType = op1->type;
6988 if(op1->type)
6989 op1->type->refCount++;
6990 }
6991 return 1;
6992 }
6993
6994 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6995 {
6996 exp->type = 2;
6997 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6998 if(!exp->expType)
6999 {
7000 exp->expType = op1->type;
7001 if(op1->type)
7002 op1->type->refCount++;
7003 }
7004 return 1;
7005 }
7006
7007 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
7008 {
7009 exp->type = 2;
7010 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
7011 if(!exp->expType)
7012 {
7013 exp->expType = op1->type;
7014 if(op1->type)
7015 op1->type->refCount++;
7016 }
7017 return 1;
7018 }
7019
7020 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
7021 {
7022 exp->type = 2;
7023 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
7024 if(!exp->expType)
7025 {
7026 exp->expType = op1->type;
7027 if(op1->type)
7028 op1->type->refCount++;
7029 }
7030 return 1;
7031 }
7032
7033 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7034 {
7035 exp->type = 2;
7036 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7037 if(!exp->expType)
7038 {
7039 exp->expType = op1->type;
7040 if(op1->type)
7041 op1->type->refCount++;
7042 }
7043 return 1;
7044 }
7045
7046 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7047 {
7048 exp->type = 2;
7049 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7050 if(!exp->expType)
7051 {
7052 exp->expType = op1->type;
7053 if(op1->type)
7054 op1->type->refCount++;
7055 }
7056 return 1;
7057 }
7058
7059 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7060 {
7061 exp->type = 2;
7062 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7063 if(!exp->expType)
7064 {
7065 exp->expType = op1->type;
7066 if(op1->type)
7067 op1->type->refCount++;
7068 }
7069 return 1;
7070 }
7071
7072 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7073 {
7074 exp->type = 2;
7075 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7076 if(!exp->expType)
7077 {
7078 exp->expType = op1->type;
7079 if(op1->type)
7080 op1->type->refCount++;
7081 }
7082 return 1;
7083 }
7084
7085 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7086 {
7087 exp->type = 2;
7088 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7089 if(!exp->expType)
7090 {
7091 exp->expType = op1->type;
7092 if(op1->type)
7093 op1->type->refCount++;
7094 }
7095 return 1;
7096 }
7097
7098 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7099 {
7100 exp->type = 2;
7101 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7102 if(!exp->expType)
7103 {
7104 exp->expType = op1->type;
7105 if(op1->type)
7106 op1->type->refCount++;
7107 }
7108 return 1;
7109 }
7110
7111 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7112 {
7113 exp->type = 2;
7114 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7115 if(!exp->expType)
7116 {
7117 exp->expType = op1->type;
7118 if(op1->type)
7119 op1->type->refCount++;
7120 }
7121 return 1;
7122 }
7123
7124 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7125 {
7126 exp->type = 2;
7127 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7128 if(!exp->expType)
7129 {
7130 exp->expType = op1->type;
7131 if(op1->type)
7132 op1->type->refCount++;
7133 }
7134 return 1;
7135 }
7136
7137 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7138 {
7139 exp->type = 2;
7140 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7141 if(!exp->expType)
7142 {
7143 exp->expType = op1->type;
7144 if(op1->type)
7145 op1->type->refCount++;
7146 }
7147 return 1;
7148 }
7149
7150 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7151 {
7152 int value2 = op2->__anon1.i;
7153
7154 exp->type = 2;
7155 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7156 if(!exp->expType)
7157 {
7158 exp->expType = op1->type;
7159 if(op1->type)
7160 op1->type->refCount++;
7161 }
7162 return 1;
7163 }
7164
7165 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7166 {
7167 unsigned int value2 = op2->__anon1.ui;
7168
7169 exp->type = 2;
7170 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7171 if(!exp->expType)
7172 {
7173 exp->expType = op1->type;
7174 if(op1->type)
7175 op1->type->refCount++;
7176 }
7177 return 1;
7178 }
7179
7180 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7181 {
7182 long long value2 = op2->__anon1.i64;
7183
7184 exp->type = 2;
7185 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7186 if(!exp->expType)
7187 {
7188 exp->expType = op1->type;
7189 if(op1->type)
7190 op1->type->refCount++;
7191 }
7192 return 1;
7193 }
7194
7195 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7196 {
7197 uint64 value2 = op2->__anon1.ui64;
7198
7199 exp->type = 2;
7200 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7201 if(!exp->expType)
7202 {
7203 exp->expType = op1->type;
7204 if(op1->type)
7205 op1->type->refCount++;
7206 }
7207 return 1;
7208 }
7209
7210 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7211 {
7212 short value2 = op2->__anon1.s;
7213
7214 exp->type = 2;
7215 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7216 if(!exp->expType)
7217 {
7218 exp->expType = op1->type;
7219 if(op1->type)
7220 op1->type->refCount++;
7221 }
7222 return 1;
7223 }
7224
7225 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7226 {
7227 unsigned short value2 = op2->__anon1.us;
7228
7229 exp->type = 2;
7230 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7231 if(!exp->expType)
7232 {
7233 exp->expType = op1->type;
7234 if(op1->type)
7235 op1->type->refCount++;
7236 }
7237 return 1;
7238 }
7239
7240 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7241 {
7242 char value2 = op2->__anon1.c;
7243
7244 exp->type = 2;
7245 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7246 if(!exp->expType)
7247 {
7248 exp->expType = op1->type;
7249 if(op1->type)
7250 op1->type->refCount++;
7251 }
7252 return 1;
7253 }
7254
7255 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7256 {
7257 unsigned char value2 = op2->__anon1.uc;
7258
7259 exp->type = 2;
7260 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7261 if(!exp->expType)
7262 {
7263 exp->expType = op1->type;
7264 if(op1->type)
7265 op1->type->refCount++;
7266 }
7267 return 1;
7268 }
7269
7270 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7271 {
7272 float value2 = op2->__anon1.f;
7273
7274 exp->type = 2;
7275 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7276 if(!exp->expType)
7277 {
7278 exp->expType = op1->type;
7279 if(op1->type)
7280 op1->type->refCount++;
7281 }
7282 return 1;
7283 }
7284
7285 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7286 {
7287 double value2 = op2->__anon1.d;
7288
7289 exp->type = 2;
7290 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7291 if(!exp->expType)
7292 {
7293 exp->expType = op1->type;
7294 if(op1->type)
7295 op1->type->refCount++;
7296 }
7297 return 1;
7298 }
7299
7300 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7301 {
7302 int value2 = op2->__anon1.i;
7303
7304 exp->type = 2;
7305 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7306 if(!exp->expType)
7307 {
7308 exp->expType = op1->type;
7309 if(op1->type)
7310 op1->type->refCount++;
7311 }
7312 return 1;
7313 }
7314
7315 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7316 {
7317 unsigned int value2 = op2->__anon1.ui;
7318
7319 exp->type = 2;
7320 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7321 if(!exp->expType)
7322 {
7323 exp->expType = op1->type;
7324 if(op1->type)
7325 op1->type->refCount++;
7326 }
7327 return 1;
7328 }
7329
7330 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7331 {
7332 long long value2 = op2->__anon1.i64;
7333
7334 exp->type = 2;
7335 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7336 if(!exp->expType)
7337 {
7338 exp->expType = op1->type;
7339 if(op1->type)
7340 op1->type->refCount++;
7341 }
7342 return 1;
7343 }
7344
7345 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7346 {
7347 uint64 value2 = op2->__anon1.ui64;
7348
7349 exp->type = 2;
7350 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7351 if(!exp->expType)
7352 {
7353 exp->expType = op1->type;
7354 if(op1->type)
7355 op1->type->refCount++;
7356 }
7357 return 1;
7358 }
7359
7360 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7361 {
7362 short value2 = op2->__anon1.s;
7363
7364 exp->type = 2;
7365 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7366 if(!exp->expType)
7367 {
7368 exp->expType = op1->type;
7369 if(op1->type)
7370 op1->type->refCount++;
7371 }
7372 return 1;
7373 }
7374
7375 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7376 {
7377 unsigned short value2 = op2->__anon1.us;
7378
7379 exp->type = 2;
7380 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7381 if(!exp->expType)
7382 {
7383 exp->expType = op1->type;
7384 if(op1->type)
7385 op1->type->refCount++;
7386 }
7387 return 1;
7388 }
7389
7390 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7391 {
7392 char value2 = op2->__anon1.c;
7393
7394 exp->type = 2;
7395 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7396 if(!exp->expType)
7397 {
7398 exp->expType = op1->type;
7399 if(op1->type)
7400 op1->type->refCount++;
7401 }
7402 return 1;
7403 }
7404
7405 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7406 {
7407 unsigned char value2 = op2->__anon1.uc;
7408
7409 exp->type = 2;
7410 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7411 if(!exp->expType)
7412 {
7413 exp->expType = op1->type;
7414 if(op1->type)
7415 op1->type->refCount++;
7416 }
7417 return 1;
7418 }
7419
7420 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7421 {
7422 float value2 = op2->__anon1.f;
7423
7424 exp->type = 2;
7425 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7426 if(!exp->expType)
7427 {
7428 exp->expType = op1->type;
7429 if(op1->type)
7430 op1->type->refCount++;
7431 }
7432 return 1;
7433 }
7434
7435 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7436 {
7437 double value2 = op2->__anon1.d;
7438
7439 exp->type = 2;
7440 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7441 if(!exp->expType)
7442 {
7443 exp->expType = op1->type;
7444 if(op1->type)
7445 op1->type->refCount++;
7446 }
7447 return 1;
7448 }
7449
7450 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7451 {
7452 int value2 = op2->__anon1.i;
7453
7454 exp->type = 2;
7455 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7456 if(!exp->expType)
7457 {
7458 exp->expType = op1->type;
7459 if(op1->type)
7460 op1->type->refCount++;
7461 }
7462 return 1;
7463 }
7464
7465 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7466 {
7467 unsigned int value2 = op2->__anon1.ui;
7468
7469 exp->type = 2;
7470 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7471 if(!exp->expType)
7472 {
7473 exp->expType = op1->type;
7474 if(op1->type)
7475 op1->type->refCount++;
7476 }
7477 return 1;
7478 }
7479
7480 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7481 {
7482 long long value2 = op2->__anon1.i64;
7483
7484 exp->type = 2;
7485 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7486 if(!exp->expType)
7487 {
7488 exp->expType = op1->type;
7489 if(op1->type)
7490 op1->type->refCount++;
7491 }
7492 return 1;
7493 }
7494
7495 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7496 {
7497 uint64 value2 = op2->__anon1.ui64;
7498
7499 exp->type = 2;
7500 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7501 if(!exp->expType)
7502 {
7503 exp->expType = op1->type;
7504 if(op1->type)
7505 op1->type->refCount++;
7506 }
7507 return 1;
7508 }
7509
7510 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7511 {
7512 short value2 = op2->__anon1.s;
7513
7514 exp->type = 2;
7515 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7516 if(!exp->expType)
7517 {
7518 exp->expType = op1->type;
7519 if(op1->type)
7520 op1->type->refCount++;
7521 }
7522 return 1;
7523 }
7524
7525 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7526 {
7527 unsigned short value2 = op2->__anon1.us;
7528
7529 exp->type = 2;
7530 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7531 if(!exp->expType)
7532 {
7533 exp->expType = op1->type;
7534 if(op1->type)
7535 op1->type->refCount++;
7536 }
7537 return 1;
7538 }
7539
7540 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7541 {
7542 char value2 = op2->__anon1.c;
7543
7544 exp->type = 2;
7545 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7546 if(!exp->expType)
7547 {
7548 exp->expType = op1->type;
7549 if(op1->type)
7550 op1->type->refCount++;
7551 }
7552 return 1;
7553 }
7554
7555 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7556 {
7557 unsigned char value2 = op2->__anon1.uc;
7558
7559 exp->type = 2;
7560 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7561 if(!exp->expType)
7562 {
7563 exp->expType = op1->type;
7564 if(op1->type)
7565 op1->type->refCount++;
7566 }
7567 return 1;
7568 }
7569
7570 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7571 {
7572 float value2 = op2->__anon1.f;
7573
7574 exp->type = 2;
7575 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7576 if(!exp->expType)
7577 {
7578 exp->expType = op1->type;
7579 if(op1->type)
7580 op1->type->refCount++;
7581 }
7582 return 1;
7583 }
7584
7585 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7586 {
7587 double value2 = op2->__anon1.d;
7588
7589 exp->type = 2;
7590 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7591 if(!exp->expType)
7592 {
7593 exp->expType = op1->type;
7594 if(op1->type)
7595 op1->type->refCount++;
7596 }
7597 return 1;
7598 }
7599
7600 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7601 {
7602 int value2 = op2->__anon1.i;
7603
7604 exp->type = 2;
7605 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7606 if(!exp->expType)
7607 {
7608 exp->expType = op1->type;
7609 if(op1->type)
7610 op1->type->refCount++;
7611 }
7612 return 1;
7613 }
7614
7615 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7616 {
7617 unsigned int value2 = op2->__anon1.ui;
7618
7619 exp->type = 2;
7620 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7621 if(!exp->expType)
7622 {
7623 exp->expType = op1->type;
7624 if(op1->type)
7625 op1->type->refCount++;
7626 }
7627 return 1;
7628 }
7629
7630 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7631 {
7632 long long value2 = op2->__anon1.i64;
7633
7634 exp->type = 2;
7635 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7636 if(!exp->expType)
7637 {
7638 exp->expType = op1->type;
7639 if(op1->type)
7640 op1->type->refCount++;
7641 }
7642 return 1;
7643 }
7644
7645 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7646 {
7647 uint64 value2 = op2->__anon1.ui64;
7648
7649 exp->type = 2;
7650 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7651 if(!exp->expType)
7652 {
7653 exp->expType = op1->type;
7654 if(op1->type)
7655 op1->type->refCount++;
7656 }
7657 return 1;
7658 }
7659
7660 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7661 {
7662 short value2 = op2->__anon1.s;
7663
7664 exp->type = 2;
7665 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7666 if(!exp->expType)
7667 {
7668 exp->expType = op1->type;
7669 if(op1->type)
7670 op1->type->refCount++;
7671 }
7672 return 1;
7673 }
7674
7675 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7676 {
7677 unsigned short value2 = op2->__anon1.us;
7678
7679 exp->type = 2;
7680 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7681 if(!exp->expType)
7682 {
7683 exp->expType = op1->type;
7684 if(op1->type)
7685 op1->type->refCount++;
7686 }
7687 return 1;
7688 }
7689
7690 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7691 {
7692 char value2 = op2->__anon1.c;
7693
7694 exp->type = 2;
7695 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7696 if(!exp->expType)
7697 {
7698 exp->expType = op1->type;
7699 if(op1->type)
7700 op1->type->refCount++;
7701 }
7702 return 1;
7703 }
7704
7705 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7706 {
7707 unsigned char value2 = op2->__anon1.uc;
7708
7709 exp->type = 2;
7710 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7711 if(!exp->expType)
7712 {
7713 exp->expType = op1->type;
7714 if(op1->type)
7715 op1->type->refCount++;
7716 }
7717 return 1;
7718 }
7719
7720 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7721 {
7722 float value2 = op2->__anon1.f;
7723
7724 exp->type = 2;
7725 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7726 if(!exp->expType)
7727 {
7728 exp->expType = op1->type;
7729 if(op1->type)
7730 op1->type->refCount++;
7731 }
7732 return 1;
7733 }
7734
7735 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7736 {
7737 double value2 = op2->__anon1.d;
7738
7739 exp->type = 2;
7740 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7741 if(!exp->expType)
7742 {
7743 exp->expType = op1->type;
7744 if(op1->type)
7745 op1->type->refCount++;
7746 }
7747 return 1;
7748 }
7749
7750 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7751 {
7752 int value2 = op2->__anon1.i;
7753
7754 exp->type = 2;
7755 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7756 if(!exp->expType)
7757 {
7758 exp->expType = op1->type;
7759 if(op1->type)
7760 op1->type->refCount++;
7761 }
7762 return 1;
7763 }
7764
7765 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7766 {
7767 unsigned int value2 = op2->__anon1.ui;
7768
7769 exp->type = 2;
7770 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7771 if(!exp->expType)
7772 {
7773 exp->expType = op1->type;
7774 if(op1->type)
7775 op1->type->refCount++;
7776 }
7777 return 1;
7778 }
7779
7780 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7781 {
7782 long long value2 = op2->__anon1.i64;
7783
7784 exp->type = 2;
7785 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7786 if(!exp->expType)
7787 {
7788 exp->expType = op1->type;
7789 if(op1->type)
7790 op1->type->refCount++;
7791 }
7792 return 1;
7793 }
7794
7795 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7796 {
7797 uint64 value2 = op2->__anon1.ui64;
7798
7799 exp->type = 2;
7800 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7801 if(!exp->expType)
7802 {
7803 exp->expType = op1->type;
7804 if(op1->type)
7805 op1->type->refCount++;
7806 }
7807 return 1;
7808 }
7809
7810 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7811 {
7812 short value2 = op2->__anon1.s;
7813
7814 exp->type = 2;
7815 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7816 if(!exp->expType)
7817 {
7818 exp->expType = op1->type;
7819 if(op1->type)
7820 op1->type->refCount++;
7821 }
7822 return 1;
7823 }
7824
7825 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7826 {
7827 unsigned short value2 = op2->__anon1.us;
7828
7829 exp->type = 2;
7830 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7831 if(!exp->expType)
7832 {
7833 exp->expType = op1->type;
7834 if(op1->type)
7835 op1->type->refCount++;
7836 }
7837 return 1;
7838 }
7839
7840 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7841 {
7842 char value2 = op2->__anon1.c;
7843
7844 exp->type = 2;
7845 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7846 if(!exp->expType)
7847 {
7848 exp->expType = op1->type;
7849 if(op1->type)
7850 op1->type->refCount++;
7851 }
7852 return 1;
7853 }
7854
7855 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7856 {
7857 unsigned char value2 = op2->__anon1.uc;
7858
7859 exp->type = 2;
7860 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7861 if(!exp->expType)
7862 {
7863 exp->expType = op1->type;
7864 if(op1->type)
7865 op1->type->refCount++;
7866 }
7867 return 1;
7868 }
7869
7870 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7871 {
7872 float value2 = op2->__anon1.f;
7873
7874 exp->type = 2;
7875 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7876 if(!exp->expType)
7877 {
7878 exp->expType = op1->type;
7879 if(op1->type)
7880 op1->type->refCount++;
7881 }
7882 return 1;
7883 }
7884
7885 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7886 {
7887 double value2 = op2->__anon1.d;
7888
7889 exp->type = 2;
7890 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7891 if(!exp->expType)
7892 {
7893 exp->expType = op1->type;
7894 if(op1->type)
7895 op1->type->refCount++;
7896 }
7897 return 1;
7898 }
7899
7900 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7901 {
7902 int value2 = op2->__anon1.i;
7903
7904 exp->type = 2;
7905 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7906 if(!exp->expType)
7907 {
7908 exp->expType = op1->type;
7909 if(op1->type)
7910 op1->type->refCount++;
7911 }
7912 return 1;
7913 }
7914
7915 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7916 {
7917 unsigned int value2 = op2->__anon1.ui;
7918
7919 exp->type = 2;
7920 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7921 if(!exp->expType)
7922 {
7923 exp->expType = op1->type;
7924 if(op1->type)
7925 op1->type->refCount++;
7926 }
7927 return 1;
7928 }
7929
7930 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7931 {
7932 long long value2 = op2->__anon1.i64;
7933
7934 exp->type = 2;
7935 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7936 if(!exp->expType)
7937 {
7938 exp->expType = op1->type;
7939 if(op1->type)
7940 op1->type->refCount++;
7941 }
7942 return 1;
7943 }
7944
7945 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7946 {
7947 uint64 value2 = op2->__anon1.ui64;
7948
7949 exp->type = 2;
7950 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7951 if(!exp->expType)
7952 {
7953 exp->expType = op1->type;
7954 if(op1->type)
7955 op1->type->refCount++;
7956 }
7957 return 1;
7958 }
7959
7960 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7961 {
7962 short value2 = op2->__anon1.s;
7963
7964 exp->type = 2;
7965 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7966 if(!exp->expType)
7967 {
7968 exp->expType = op1->type;
7969 if(op1->type)
7970 op1->type->refCount++;
7971 }
7972 return 1;
7973 }
7974
7975 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7976 {
7977 unsigned short value2 = op2->__anon1.us;
7978
7979 exp->type = 2;
7980 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7981 if(!exp->expType)
7982 {
7983 exp->expType = op1->type;
7984 if(op1->type)
7985 op1->type->refCount++;
7986 }
7987 return 1;
7988 }
7989
7990 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7991 {
7992 char value2 = op2->__anon1.c;
7993
7994 exp->type = 2;
7995 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7996 if(!exp->expType)
7997 {
7998 exp->expType = op1->type;
7999 if(op1->type)
8000 op1->type->refCount++;
8001 }
8002 return 1;
8003 }
8004
8005 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8006 {
8007 unsigned char value2 = op2->__anon1.uc;
8008
8009 exp->type = 2;
8010 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
8011 if(!exp->expType)
8012 {
8013 exp->expType = op1->type;
8014 if(op1->type)
8015 op1->type->refCount++;
8016 }
8017 return 1;
8018 }
8019
8020 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8021 {
8022 int value2 = op2->__anon1.i;
8023
8024 exp->type = 2;
8025 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
8026 if(!exp->expType)
8027 {
8028 exp->expType = op1->type;
8029 if(op1->type)
8030 op1->type->refCount++;
8031 }
8032 return 1;
8033 }
8034
8035 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8036 {
8037 unsigned int value2 = op2->__anon1.ui;
8038
8039 exp->type = 2;
8040 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8041 if(!exp->expType)
8042 {
8043 exp->expType = op1->type;
8044 if(op1->type)
8045 op1->type->refCount++;
8046 }
8047 return 1;
8048 }
8049
8050 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8051 {
8052 long long value2 = op2->__anon1.i64;
8053
8054 exp->type = 2;
8055 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8056 if(!exp->expType)
8057 {
8058 exp->expType = op1->type;
8059 if(op1->type)
8060 op1->type->refCount++;
8061 }
8062 return 1;
8063 }
8064
8065 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8066 {
8067 uint64 value2 = op2->__anon1.ui64;
8068
8069 exp->type = 2;
8070 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8071 if(!exp->expType)
8072 {
8073 exp->expType = op1->type;
8074 if(op1->type)
8075 op1->type->refCount++;
8076 }
8077 return 1;
8078 }
8079
8080 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8081 {
8082 short value2 = op2->__anon1.s;
8083
8084 exp->type = 2;
8085 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8086 if(!exp->expType)
8087 {
8088 exp->expType = op1->type;
8089 if(op1->type)
8090 op1->type->refCount++;
8091 }
8092 return 1;
8093 }
8094
8095 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8096 {
8097 unsigned short value2 = op2->__anon1.us;
8098
8099 exp->type = 2;
8100 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8101 if(!exp->expType)
8102 {
8103 exp->expType = op1->type;
8104 if(op1->type)
8105 op1->type->refCount++;
8106 }
8107 return 1;
8108 }
8109
8110 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8111 {
8112 char value2 = op2->__anon1.c;
8113
8114 exp->type = 2;
8115 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8116 if(!exp->expType)
8117 {
8118 exp->expType = op1->type;
8119 if(op1->type)
8120 op1->type->refCount++;
8121 }
8122 return 1;
8123 }
8124
8125 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8126 {
8127 unsigned char value2 = op2->__anon1.uc;
8128
8129 exp->type = 2;
8130 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8131 if(!exp->expType)
8132 {
8133 exp->expType = op1->type;
8134 if(op1->type)
8135 op1->type->refCount++;
8136 }
8137 return 1;
8138 }
8139
8140 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8141 {
8142 int value2 = op2->__anon1.i;
8143
8144 exp->type = 2;
8145 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8146 if(!exp->expType)
8147 {
8148 exp->expType = op1->type;
8149 if(op1->type)
8150 op1->type->refCount++;
8151 }
8152 return 1;
8153 }
8154
8155 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8156 {
8157 unsigned int value2 = op2->__anon1.ui;
8158
8159 exp->type = 2;
8160 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8161 if(!exp->expType)
8162 {
8163 exp->expType = op1->type;
8164 if(op1->type)
8165 op1->type->refCount++;
8166 }
8167 return 1;
8168 }
8169
8170 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8171 {
8172 long long value2 = op2->__anon1.i64;
8173
8174 exp->type = 2;
8175 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8176 if(!exp->expType)
8177 {
8178 exp->expType = op1->type;
8179 if(op1->type)
8180 op1->type->refCount++;
8181 }
8182 return 1;
8183 }
8184
8185 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8186 {
8187 uint64 value2 = op2->__anon1.ui64;
8188
8189 exp->type = 2;
8190 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8191 if(!exp->expType)
8192 {
8193 exp->expType = op1->type;
8194 if(op1->type)
8195 op1->type->refCount++;
8196 }
8197 return 1;
8198 }
8199
8200 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8201 {
8202 short value2 = op2->__anon1.s;
8203
8204 exp->type = 2;
8205 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8206 if(!exp->expType)
8207 {
8208 exp->expType = op1->type;
8209 if(op1->type)
8210 op1->type->refCount++;
8211 }
8212 return 1;
8213 }
8214
8215 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8216 {
8217 unsigned short value2 = op2->__anon1.us;
8218
8219 exp->type = 2;
8220 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8221 if(!exp->expType)
8222 {
8223 exp->expType = op1->type;
8224 if(op1->type)
8225 op1->type->refCount++;
8226 }
8227 return 1;
8228 }
8229
8230 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8231 {
8232 char value2 = op2->__anon1.c;
8233
8234 exp->type = 2;
8235 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8236 if(!exp->expType)
8237 {
8238 exp->expType = op1->type;
8239 if(op1->type)
8240 op1->type->refCount++;
8241 }
8242 return 1;
8243 }
8244
8245 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8246 {
8247 unsigned char value2 = op2->__anon1.uc;
8248
8249 exp->type = 2;
8250 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8251 if(!exp->expType)
8252 {
8253 exp->expType = op1->type;
8254 if(op1->type)
8255 op1->type->refCount++;
8256 }
8257 return 1;
8258 }
8259
8260 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8261 {
8262 int value2 = op2->__anon1.i;
8263
8264 exp->type = 2;
8265 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8266 if(!exp->expType)
8267 {
8268 exp->expType = op1->type;
8269 if(op1->type)
8270 op1->type->refCount++;
8271 }
8272 return 1;
8273 }
8274
8275 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8276 {
8277 unsigned int value2 = op2->__anon1.ui;
8278
8279 exp->type = 2;
8280 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8281 if(!exp->expType)
8282 {
8283 exp->expType = op1->type;
8284 if(op1->type)
8285 op1->type->refCount++;
8286 }
8287 return 1;
8288 }
8289
8290 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8291 {
8292 long long value2 = op2->__anon1.i64;
8293
8294 exp->type = 2;
8295 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8296 if(!exp->expType)
8297 {
8298 exp->expType = op1->type;
8299 if(op1->type)
8300 op1->type->refCount++;
8301 }
8302 return 1;
8303 }
8304
8305 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8306 {
8307 uint64 value2 = op2->__anon1.ui64;
8308
8309 exp->type = 2;
8310 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8311 if(!exp->expType)
8312 {
8313 exp->expType = op1->type;
8314 if(op1->type)
8315 op1->type->refCount++;
8316 }
8317 return 1;
8318 }
8319
8320 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8321 {
8322 short value2 = op2->__anon1.s;
8323
8324 exp->type = 2;
8325 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8326 if(!exp->expType)
8327 {
8328 exp->expType = op1->type;
8329 if(op1->type)
8330 op1->type->refCount++;
8331 }
8332 return 1;
8333 }
8334
8335 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8336 {
8337 unsigned short value2 = op2->__anon1.us;
8338
8339 exp->type = 2;
8340 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8341 if(!exp->expType)
8342 {
8343 exp->expType = op1->type;
8344 if(op1->type)
8345 op1->type->refCount++;
8346 }
8347 return 1;
8348 }
8349
8350 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8351 {
8352 char value2 = op2->__anon1.c;
8353
8354 exp->type = 2;
8355 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8356 if(!exp->expType)
8357 {
8358 exp->expType = op1->type;
8359 if(op1->type)
8360 op1->type->refCount++;
8361 }
8362 return 1;
8363 }
8364
8365 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8366 {
8367 unsigned char value2 = op2->__anon1.uc;
8368
8369 exp->type = 2;
8370 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8371 if(!exp->expType)
8372 {
8373 exp->expType = op1->type;
8374 if(op1->type)
8375 op1->type->refCount++;
8376 }
8377 return 1;
8378 }
8379
8380 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8381 {
8382 int value2 = op2->__anon1.i;
8383
8384 exp->type = 2;
8385 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8386 if(!exp->expType)
8387 {
8388 exp->expType = op1->type;
8389 if(op1->type)
8390 op1->type->refCount++;
8391 }
8392 return 1;
8393 }
8394
8395 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8396 {
8397 unsigned int value2 = op2->__anon1.ui;
8398
8399 exp->type = 2;
8400 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8401 if(!exp->expType)
8402 {
8403 exp->expType = op1->type;
8404 if(op1->type)
8405 op1->type->refCount++;
8406 }
8407 return 1;
8408 }
8409
8410 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8411 {
8412 long long value2 = op2->__anon1.i64;
8413
8414 exp->type = 2;
8415 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8416 if(!exp->expType)
8417 {
8418 exp->expType = op1->type;
8419 if(op1->type)
8420 op1->type->refCount++;
8421 }
8422 return 1;
8423 }
8424
8425 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8426 {
8427 uint64 value2 = op2->__anon1.ui64;
8428
8429 exp->type = 2;
8430 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8431 if(!exp->expType)
8432 {
8433 exp->expType = op1->type;
8434 if(op1->type)
8435 op1->type->refCount++;
8436 }
8437 return 1;
8438 }
8439
8440 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8441 {
8442 short value2 = op2->__anon1.s;
8443
8444 exp->type = 2;
8445 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8446 if(!exp->expType)
8447 {
8448 exp->expType = op1->type;
8449 if(op1->type)
8450 op1->type->refCount++;
8451 }
8452 return 1;
8453 }
8454
8455 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8456 {
8457 unsigned short value2 = op2->__anon1.us;
8458
8459 exp->type = 2;
8460 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8461 if(!exp->expType)
8462 {
8463 exp->expType = op1->type;
8464 if(op1->type)
8465 op1->type->refCount++;
8466 }
8467 return 1;
8468 }
8469
8470 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8471 {
8472 char value2 = op2->__anon1.c;
8473
8474 exp->type = 2;
8475 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8476 if(!exp->expType)
8477 {
8478 exp->expType = op1->type;
8479 if(op1->type)
8480 op1->type->refCount++;
8481 }
8482 return 1;
8483 }
8484
8485 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8486 {
8487 unsigned char value2 = op2->__anon1.uc;
8488
8489 exp->type = 2;
8490 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8491 if(!exp->expType)
8492 {
8493 exp->expType = op1->type;
8494 if(op1->type)
8495 op1->type->refCount++;
8496 }
8497 return 1;
8498 }
8499
8500 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8501 {
8502 int value2 = op2->__anon1.i;
8503
8504 exp->type = 2;
8505 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8506 if(!exp->expType)
8507 {
8508 exp->expType = op1->type;
8509 if(op1->type)
8510 op1->type->refCount++;
8511 }
8512 return 1;
8513 }
8514
8515 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8516 {
8517 unsigned int value2 = op2->__anon1.ui;
8518
8519 exp->type = 2;
8520 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8521 if(!exp->expType)
8522 {
8523 exp->expType = op1->type;
8524 if(op1->type)
8525 op1->type->refCount++;
8526 }
8527 return 1;
8528 }
8529
8530 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8531 {
8532 long long value2 = op2->__anon1.i64;
8533
8534 exp->type = 2;
8535 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8536 if(!exp->expType)
8537 {
8538 exp->expType = op1->type;
8539 if(op1->type)
8540 op1->type->refCount++;
8541 }
8542 return 1;
8543 }
8544
8545 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8546 {
8547 uint64 value2 = op2->__anon1.ui64;
8548
8549 exp->type = 2;
8550 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8551 if(!exp->expType)
8552 {
8553 exp->expType = op1->type;
8554 if(op1->type)
8555 op1->type->refCount++;
8556 }
8557 return 1;
8558 }
8559
8560 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8561 {
8562 short value2 = op2->__anon1.s;
8563
8564 exp->type = 2;
8565 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8566 if(!exp->expType)
8567 {
8568 exp->expType = op1->type;
8569 if(op1->type)
8570 op1->type->refCount++;
8571 }
8572 return 1;
8573 }
8574
8575 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8576 {
8577 unsigned short value2 = op2->__anon1.us;
8578
8579 exp->type = 2;
8580 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8581 if(!exp->expType)
8582 {
8583 exp->expType = op1->type;
8584 if(op1->type)
8585 op1->type->refCount++;
8586 }
8587 return 1;
8588 }
8589
8590 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8591 {
8592 char value2 = op2->__anon1.c;
8593
8594 exp->type = 2;
8595 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8596 if(!exp->expType)
8597 {
8598 exp->expType = op1->type;
8599 if(op1->type)
8600 op1->type->refCount++;
8601 }
8602 return 1;
8603 }
8604
8605 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8606 {
8607 unsigned char value2 = op2->__anon1.uc;
8608
8609 exp->type = 2;
8610 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8611 if(!exp->expType)
8612 {
8613 exp->expType = op1->type;
8614 if(op1->type)
8615 op1->type->refCount++;
8616 }
8617 return 1;
8618 }
8619
8620 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8621 {
8622 exp->type = 2;
8623 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8624 if(!exp->expType)
8625 {
8626 exp->expType = op1->type;
8627 if(op1->type)
8628 op1->type->refCount++;
8629 }
8630 return 1;
8631 }
8632
8633 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8634 {
8635 exp->type = 2;
8636 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8637 if(!exp->expType)
8638 {
8639 exp->expType = op1->type;
8640 if(op1->type)
8641 op1->type->refCount++;
8642 }
8643 return 1;
8644 }
8645
8646 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8647 {
8648 exp->type = 2;
8649 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8650 if(!exp->expType)
8651 {
8652 exp->expType = op1->type;
8653 if(op1->type)
8654 op1->type->refCount++;
8655 }
8656 return 1;
8657 }
8658
8659 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8660 {
8661 exp->type = 2;
8662 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8663 if(!exp->expType)
8664 {
8665 exp->expType = op1->type;
8666 if(op1->type)
8667 op1->type->refCount++;
8668 }
8669 return 1;
8670 }
8671
8672 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8673 {
8674 exp->type = 2;
8675 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8676 if(!exp->expType)
8677 {
8678 exp->expType = op1->type;
8679 if(op1->type)
8680 op1->type->refCount++;
8681 }
8682 return 1;
8683 }
8684
8685 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8686 {
8687 exp->type = 2;
8688 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8689 if(!exp->expType)
8690 {
8691 exp->expType = op1->type;
8692 if(op1->type)
8693 op1->type->refCount++;
8694 }
8695 return 1;
8696 }
8697
8698 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8699 {
8700 exp->type = 2;
8701 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8702 if(!exp->expType)
8703 {
8704 exp->expType = op1->type;
8705 if(op1->type)
8706 op1->type->refCount++;
8707 }
8708 return 1;
8709 }
8710
8711 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8712 {
8713 exp->type = 2;
8714 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8715 if(!exp->expType)
8716 {
8717 exp->expType = op1->type;
8718 if(op1->type)
8719 op1->type->refCount++;
8720 }
8721 return 1;
8722 }
8723
8724 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8725 {
8726 int value2 = op2->__anon1.i;
8727
8728 exp->type = 2;
8729 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8730 if(!exp->expType)
8731 {
8732 exp->expType = op1->type;
8733 if(op1->type)
8734 op1->type->refCount++;
8735 }
8736 return 1;
8737 }
8738
8739 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8740 {
8741 unsigned int value2 = op2->__anon1.ui;
8742
8743 exp->type = 2;
8744 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8745 if(!exp->expType)
8746 {
8747 exp->expType = op1->type;
8748 if(op1->type)
8749 op1->type->refCount++;
8750 }
8751 return 1;
8752 }
8753
8754 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8755 {
8756 long long value2 = op2->__anon1.i64;
8757
8758 exp->type = 2;
8759 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8760 if(!exp->expType)
8761 {
8762 exp->expType = op1->type;
8763 if(op1->type)
8764 op1->type->refCount++;
8765 }
8766 return 1;
8767 }
8768
8769 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8770 {
8771 uint64 value2 = op2->__anon1.ui64;
8772
8773 exp->type = 2;
8774 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8775 if(!exp->expType)
8776 {
8777 exp->expType = op1->type;
8778 if(op1->type)
8779 op1->type->refCount++;
8780 }
8781 return 1;
8782 }
8783
8784 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8785 {
8786 short value2 = op2->__anon1.s;
8787
8788 exp->type = 2;
8789 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8790 if(!exp->expType)
8791 {
8792 exp->expType = op1->type;
8793 if(op1->type)
8794 op1->type->refCount++;
8795 }
8796 return 1;
8797 }
8798
8799 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8800 {
8801 unsigned short value2 = op2->__anon1.us;
8802
8803 exp->type = 2;
8804 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8805 if(!exp->expType)
8806 {
8807 exp->expType = op1->type;
8808 if(op1->type)
8809 op1->type->refCount++;
8810 }
8811 return 1;
8812 }
8813
8814 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8815 {
8816 char value2 = op2->__anon1.c;
8817
8818 exp->type = 2;
8819 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8820 if(!exp->expType)
8821 {
8822 exp->expType = op1->type;
8823 if(op1->type)
8824 op1->type->refCount++;
8825 }
8826 return 1;
8827 }
8828
8829 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8830 {
8831 unsigned char value2 = op2->__anon1.uc;
8832
8833 exp->type = 2;
8834 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8835 if(!exp->expType)
8836 {
8837 exp->expType = op1->type;
8838 if(op1->type)
8839 op1->type->refCount++;
8840 }
8841 return 1;
8842 }
8843
8844 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8845 {
8846 int value2 = op2->__anon1.i;
8847
8848 exp->type = 2;
8849 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8850 if(!exp->expType)
8851 {
8852 exp->expType = op1->type;
8853 if(op1->type)
8854 op1->type->refCount++;
8855 }
8856 return 1;
8857 }
8858
8859 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8860 {
8861 unsigned int value2 = op2->__anon1.ui;
8862
8863 exp->type = 2;
8864 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8865 if(!exp->expType)
8866 {
8867 exp->expType = op1->type;
8868 if(op1->type)
8869 op1->type->refCount++;
8870 }
8871 return 1;
8872 }
8873
8874 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8875 {
8876 long long value2 = op2->__anon1.i64;
8877
8878 exp->type = 2;
8879 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8880 if(!exp->expType)
8881 {
8882 exp->expType = op1->type;
8883 if(op1->type)
8884 op1->type->refCount++;
8885 }
8886 return 1;
8887 }
8888
8889 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8890 {
8891 uint64 value2 = op2->__anon1.ui64;
8892
8893 exp->type = 2;
8894 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8895 if(!exp->expType)
8896 {
8897 exp->expType = op1->type;
8898 if(op1->type)
8899 op1->type->refCount++;
8900 }
8901 return 1;
8902 }
8903
8904 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8905 {
8906 short value2 = op2->__anon1.s;
8907
8908 exp->type = 2;
8909 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8910 if(!exp->expType)
8911 {
8912 exp->expType = op1->type;
8913 if(op1->type)
8914 op1->type->refCount++;
8915 }
8916 return 1;
8917 }
8918
8919 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8920 {
8921 unsigned short value2 = op2->__anon1.us;
8922
8923 exp->type = 2;
8924 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8925 if(!exp->expType)
8926 {
8927 exp->expType = op1->type;
8928 if(op1->type)
8929 op1->type->refCount++;
8930 }
8931 return 1;
8932 }
8933
8934 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8935 {
8936 char value2 = op2->__anon1.c;
8937
8938 exp->type = 2;
8939 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8940 if(!exp->expType)
8941 {
8942 exp->expType = op1->type;
8943 if(op1->type)
8944 op1->type->refCount++;
8945 }
8946 return 1;
8947 }
8948
8949 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8950 {
8951 unsigned char value2 = op2->__anon1.uc;
8952
8953 exp->type = 2;
8954 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8955 if(!exp->expType)
8956 {
8957 exp->expType = op1->type;
8958 if(op1->type)
8959 op1->type->refCount++;
8960 }
8961 return 1;
8962 }
8963
8964 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8965 {
8966 int value2 = op2->__anon1.i;
8967
8968 exp->type = 2;
8969 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8970 if(!exp->expType)
8971 {
8972 exp->expType = op1->type;
8973 if(op1->type)
8974 op1->type->refCount++;
8975 }
8976 return 1;
8977 }
8978
8979 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8980 {
8981 unsigned int value2 = op2->__anon1.ui;
8982
8983 exp->type = 2;
8984 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8985 if(!exp->expType)
8986 {
8987 exp->expType = op1->type;
8988 if(op1->type)
8989 op1->type->refCount++;
8990 }
8991 return 1;
8992 }
8993
8994 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8995 {
8996 long long value2 = op2->__anon1.i64;
8997
8998 exp->type = 2;
8999 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
9000 if(!exp->expType)
9001 {
9002 exp->expType = op1->type;
9003 if(op1->type)
9004 op1->type->refCount++;
9005 }
9006 return 1;
9007 }
9008
9009 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9010 {
9011 uint64 value2 = op2->__anon1.ui64;
9012
9013 exp->type = 2;
9014 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
9015 if(!exp->expType)
9016 {
9017 exp->expType = op1->type;
9018 if(op1->type)
9019 op1->type->refCount++;
9020 }
9021 return 1;
9022 }
9023
9024 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9025 {
9026 short value2 = op2->__anon1.s;
9027
9028 exp->type = 2;
9029 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
9030 if(!exp->expType)
9031 {
9032 exp->expType = op1->type;
9033 if(op1->type)
9034 op1->type->refCount++;
9035 }
9036 return 1;
9037 }
9038
9039 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9040 {
9041 unsigned short value2 = op2->__anon1.us;
9042
9043 exp->type = 2;
9044 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9045 if(!exp->expType)
9046 {
9047 exp->expType = op1->type;
9048 if(op1->type)
9049 op1->type->refCount++;
9050 }
9051 return 1;
9052 }
9053
9054 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9055 {
9056 char value2 = op2->__anon1.c;
9057
9058 exp->type = 2;
9059 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9060 if(!exp->expType)
9061 {
9062 exp->expType = op1->type;
9063 if(op1->type)
9064 op1->type->refCount++;
9065 }
9066 return 1;
9067 }
9068
9069 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9070 {
9071 unsigned char value2 = op2->__anon1.uc;
9072
9073 exp->type = 2;
9074 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9075 if(!exp->expType)
9076 {
9077 exp->expType = op1->type;
9078 if(op1->type)
9079 op1->type->refCount++;
9080 }
9081 return 1;
9082 }
9083
9084 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9085 {
9086 int value2 = op2->__anon1.i;
9087
9088 exp->type = 2;
9089 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9090 if(!exp->expType)
9091 {
9092 exp->expType = op1->type;
9093 if(op1->type)
9094 op1->type->refCount++;
9095 }
9096 return 1;
9097 }
9098
9099 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9100 {
9101 unsigned int value2 = op2->__anon1.ui;
9102
9103 exp->type = 2;
9104 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9105 if(!exp->expType)
9106 {
9107 exp->expType = op1->type;
9108 if(op1->type)
9109 op1->type->refCount++;
9110 }
9111 return 1;
9112 }
9113
9114 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9115 {
9116 long long value2 = op2->__anon1.i64;
9117
9118 exp->type = 2;
9119 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9120 if(!exp->expType)
9121 {
9122 exp->expType = op1->type;
9123 if(op1->type)
9124 op1->type->refCount++;
9125 }
9126 return 1;
9127 }
9128
9129 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9130 {
9131 uint64 value2 = op2->__anon1.ui64;
9132
9133 exp->type = 2;
9134 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9135 if(!exp->expType)
9136 {
9137 exp->expType = op1->type;
9138 if(op1->type)
9139 op1->type->refCount++;
9140 }
9141 return 1;
9142 }
9143
9144 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9145 {
9146 short value2 = op2->__anon1.s;
9147
9148 exp->type = 2;
9149 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9150 if(!exp->expType)
9151 {
9152 exp->expType = op1->type;
9153 if(op1->type)
9154 op1->type->refCount++;
9155 }
9156 return 1;
9157 }
9158
9159 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9160 {
9161 unsigned short value2 = op2->__anon1.us;
9162
9163 exp->type = 2;
9164 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9165 if(!exp->expType)
9166 {
9167 exp->expType = op1->type;
9168 if(op1->type)
9169 op1->type->refCount++;
9170 }
9171 return 1;
9172 }
9173
9174 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9175 {
9176 char value2 = op2->__anon1.c;
9177
9178 exp->type = 2;
9179 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9180 if(!exp->expType)
9181 {
9182 exp->expType = op1->type;
9183 if(op1->type)
9184 op1->type->refCount++;
9185 }
9186 return 1;
9187 }
9188
9189 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9190 {
9191 unsigned char value2 = op2->__anon1.uc;
9192
9193 exp->type = 2;
9194 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9195 if(!exp->expType)
9196 {
9197 exp->expType = op1->type;
9198 if(op1->type)
9199 op1->type->refCount++;
9200 }
9201 return 1;
9202 }
9203
9204 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9205 {
9206 int value2 = op2->__anon1.i;
9207
9208 exp->type = 2;
9209 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9210 if(!exp->expType)
9211 {
9212 exp->expType = op1->type;
9213 if(op1->type)
9214 op1->type->refCount++;
9215 }
9216 return 1;
9217 }
9218
9219 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9220 {
9221 unsigned int value2 = op2->__anon1.ui;
9222
9223 exp->type = 2;
9224 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9225 if(!exp->expType)
9226 {
9227 exp->expType = op1->type;
9228 if(op1->type)
9229 op1->type->refCount++;
9230 }
9231 return 1;
9232 }
9233
9234 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9235 {
9236 long long value2 = op2->__anon1.i64;
9237
9238 exp->type = 2;
9239 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9240 if(!exp->expType)
9241 {
9242 exp->expType = op1->type;
9243 if(op1->type)
9244 op1->type->refCount++;
9245 }
9246 return 1;
9247 }
9248
9249 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9250 {
9251 uint64 value2 = op2->__anon1.ui64;
9252
9253 exp->type = 2;
9254 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9255 if(!exp->expType)
9256 {
9257 exp->expType = op1->type;
9258 if(op1->type)
9259 op1->type->refCount++;
9260 }
9261 return 1;
9262 }
9263
9264 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9265 {
9266 short value2 = op2->__anon1.s;
9267
9268 exp->type = 2;
9269 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9270 if(!exp->expType)
9271 {
9272 exp->expType = op1->type;
9273 if(op1->type)
9274 op1->type->refCount++;
9275 }
9276 return 1;
9277 }
9278
9279 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9280 {
9281 unsigned short value2 = op2->__anon1.us;
9282
9283 exp->type = 2;
9284 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9285 if(!exp->expType)
9286 {
9287 exp->expType = op1->type;
9288 if(op1->type)
9289 op1->type->refCount++;
9290 }
9291 return 1;
9292 }
9293
9294 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9295 {
9296 char value2 = op2->__anon1.c;
9297
9298 exp->type = 2;
9299 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9300 if(!exp->expType)
9301 {
9302 exp->expType = op1->type;
9303 if(op1->type)
9304 op1->type->refCount++;
9305 }
9306 return 1;
9307 }
9308
9309 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9310 {
9311 unsigned char value2 = op2->__anon1.uc;
9312
9313 exp->type = 2;
9314 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9315 if(!exp->expType)
9316 {
9317 exp->expType = op1->type;
9318 if(op1->type)
9319 op1->type->refCount++;
9320 }
9321 return 1;
9322 }
9323
9324 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9325 {
9326 exp->type = 2;
9327 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9328 if(!exp->expType)
9329 {
9330 exp->expType = op1->type;
9331 if(op1->type)
9332 op1->type->refCount++;
9333 }
9334 return 1;
9335 }
9336
9337 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9338 {
9339 exp->type = 2;
9340 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9341 if(!exp->expType)
9342 {
9343 exp->expType = op1->type;
9344 if(op1->type)
9345 op1->type->refCount++;
9346 }
9347 return 1;
9348 }
9349
9350 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9351 {
9352 exp->type = 2;
9353 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9354 if(!exp->expType)
9355 {
9356 exp->expType = op1->type;
9357 if(op1->type)
9358 op1->type->refCount++;
9359 }
9360 return 1;
9361 }
9362
9363 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9364 {
9365 exp->type = 2;
9366 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9367 if(!exp->expType)
9368 {
9369 exp->expType = op1->type;
9370 if(op1->type)
9371 op1->type->refCount++;
9372 }
9373 return 1;
9374 }
9375
9376 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9377 {
9378 exp->type = 2;
9379 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9380 if(!exp->expType)
9381 {
9382 exp->expType = op1->type;
9383 if(op1->type)
9384 op1->type->refCount++;
9385 }
9386 return 1;
9387 }
9388
9389 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9390 {
9391 exp->type = 2;
9392 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9393 if(!exp->expType)
9394 {
9395 exp->expType = op1->type;
9396 if(op1->type)
9397 op1->type->refCount++;
9398 }
9399 return 1;
9400 }
9401
9402 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9403 {
9404 exp->type = 2;
9405 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9406 if(!exp->expType)
9407 {
9408 exp->expType = op1->type;
9409 if(op1->type)
9410 op1->type->refCount++;
9411 }
9412 return 1;
9413 }
9414
9415 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9416 {
9417 exp->type = 2;
9418 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9419 if(!exp->expType)
9420 {
9421 exp->expType = op1->type;
9422 if(op1->type)
9423 op1->type->refCount++;
9424 }
9425 return 1;
9426 }
9427
9428 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9429 {
9430 int value2 = op2->__anon1.i;
9431
9432 exp->type = 2;
9433 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9434 if(!exp->expType)
9435 {
9436 exp->expType = op1->type;
9437 if(op1->type)
9438 op1->type->refCount++;
9439 }
9440 return 1;
9441 }
9442
9443 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9444 {
9445 unsigned int value2 = op2->__anon1.ui;
9446
9447 exp->type = 2;
9448 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9449 if(!exp->expType)
9450 {
9451 exp->expType = op1->type;
9452 if(op1->type)
9453 op1->type->refCount++;
9454 }
9455 return 1;
9456 }
9457
9458 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9459 {
9460 long long value2 = op2->__anon1.i64;
9461
9462 exp->type = 2;
9463 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9464 if(!exp->expType)
9465 {
9466 exp->expType = op1->type;
9467 if(op1->type)
9468 op1->type->refCount++;
9469 }
9470 return 1;
9471 }
9472
9473 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9474 {
9475 uint64 value2 = op2->__anon1.ui64;
9476
9477 exp->type = 2;
9478 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9479 if(!exp->expType)
9480 {
9481 exp->expType = op1->type;
9482 if(op1->type)
9483 op1->type->refCount++;
9484 }
9485 return 1;
9486 }
9487
9488 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9489 {
9490 short value2 = op2->__anon1.s;
9491
9492 exp->type = 2;
9493 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9494 if(!exp->expType)
9495 {
9496 exp->expType = op1->type;
9497 if(op1->type)
9498 op1->type->refCount++;
9499 }
9500 return 1;
9501 }
9502
9503 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9504 {
9505 unsigned short value2 = op2->__anon1.us;
9506
9507 exp->type = 2;
9508 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9509 if(!exp->expType)
9510 {
9511 exp->expType = op1->type;
9512 if(op1->type)
9513 op1->type->refCount++;
9514 }
9515 return 1;
9516 }
9517
9518 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9519 {
9520 char value2 = op2->__anon1.c;
9521
9522 exp->type = 2;
9523 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9524 if(!exp->expType)
9525 {
9526 exp->expType = op1->type;
9527 if(op1->type)
9528 op1->type->refCount++;
9529 }
9530 return 1;
9531 }
9532
9533 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9534 {
9535 unsigned char value2 = op2->__anon1.uc;
9536
9537 exp->type = 2;
9538 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9539 if(!exp->expType)
9540 {
9541 exp->expType = op1->type;
9542 if(op1->type)
9543 op1->type->refCount++;
9544 }
9545 return 1;
9546 }
9547
9548 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9549 {
9550 float value2 = op2->__anon1.f;
9551
9552 exp->type = 2;
9553 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9554 if(!exp->expType)
9555 {
9556 exp->expType = op1->type;
9557 if(op1->type)
9558 op1->type->refCount++;
9559 }
9560 return 1;
9561 }
9562
9563 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9564 {
9565 double value2 = op2->__anon1.d;
9566
9567 exp->type = 2;
9568 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9569 if(!exp->expType)
9570 {
9571 exp->expType = op1->type;
9572 if(op1->type)
9573 op1->type->refCount++;
9574 }
9575 return 1;
9576 }
9577
9578 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9579 {
9580 int value2 = op2->__anon1.i;
9581
9582 exp->type = 2;
9583 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9584 if(!exp->expType)
9585 {
9586 exp->expType = op1->type;
9587 if(op1->type)
9588 op1->type->refCount++;
9589 }
9590 return 1;
9591 }
9592
9593 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9594 {
9595 unsigned int value2 = op2->__anon1.ui;
9596
9597 exp->type = 2;
9598 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9599 if(!exp->expType)
9600 {
9601 exp->expType = op1->type;
9602 if(op1->type)
9603 op1->type->refCount++;
9604 }
9605 return 1;
9606 }
9607
9608 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9609 {
9610 long long value2 = op2->__anon1.i64;
9611
9612 exp->type = 2;
9613 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9614 if(!exp->expType)
9615 {
9616 exp->expType = op1->type;
9617 if(op1->type)
9618 op1->type->refCount++;
9619 }
9620 return 1;
9621 }
9622
9623 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9624 {
9625 uint64 value2 = op2->__anon1.ui64;
9626
9627 exp->type = 2;
9628 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9629 if(!exp->expType)
9630 {
9631 exp->expType = op1->type;
9632 if(op1->type)
9633 op1->type->refCount++;
9634 }
9635 return 1;
9636 }
9637
9638 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9639 {
9640 short value2 = op2->__anon1.s;
9641
9642 exp->type = 2;
9643 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9644 if(!exp->expType)
9645 {
9646 exp->expType = op1->type;
9647 if(op1->type)
9648 op1->type->refCount++;
9649 }
9650 return 1;
9651 }
9652
9653 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9654 {
9655 unsigned short value2 = op2->__anon1.us;
9656
9657 exp->type = 2;
9658 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9659 if(!exp->expType)
9660 {
9661 exp->expType = op1->type;
9662 if(op1->type)
9663 op1->type->refCount++;
9664 }
9665 return 1;
9666 }
9667
9668 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9669 {
9670 char value2 = op2->__anon1.c;
9671
9672 exp->type = 2;
9673 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9674 if(!exp->expType)
9675 {
9676 exp->expType = op1->type;
9677 if(op1->type)
9678 op1->type->refCount++;
9679 }
9680 return 1;
9681 }
9682
9683 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9684 {
9685 unsigned char value2 = op2->__anon1.uc;
9686
9687 exp->type = 2;
9688 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9689 if(!exp->expType)
9690 {
9691 exp->expType = op1->type;
9692 if(op1->type)
9693 op1->type->refCount++;
9694 }
9695 return 1;
9696 }
9697
9698 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9699 {
9700 float value2 = op2->__anon1.f;
9701
9702 exp->type = 2;
9703 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9704 if(!exp->expType)
9705 {
9706 exp->expType = op1->type;
9707 if(op1->type)
9708 op1->type->refCount++;
9709 }
9710 return 1;
9711 }
9712
9713 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9714 {
9715 double value2 = op2->__anon1.d;
9716
9717 exp->type = 2;
9718 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9719 if(!exp->expType)
9720 {
9721 exp->expType = op1->type;
9722 if(op1->type)
9723 op1->type->refCount++;
9724 }
9725 return 1;
9726 }
9727
9728 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9729 {
9730 int value2 = op2->__anon1.i;
9731
9732 exp->type = 2;
9733 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9734 if(!exp->expType)
9735 {
9736 exp->expType = op1->type;
9737 if(op1->type)
9738 op1->type->refCount++;
9739 }
9740 return 1;
9741 }
9742
9743 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9744 {
9745 unsigned int value2 = op2->__anon1.ui;
9746
9747 exp->type = 2;
9748 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9749 if(!exp->expType)
9750 {
9751 exp->expType = op1->type;
9752 if(op1->type)
9753 op1->type->refCount++;
9754 }
9755 return 1;
9756 }
9757
9758 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9759 {
9760 long long value2 = op2->__anon1.i64;
9761
9762 exp->type = 2;
9763 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9764 if(!exp->expType)
9765 {
9766 exp->expType = op1->type;
9767 if(op1->type)
9768 op1->type->refCount++;
9769 }
9770 return 1;
9771 }
9772
9773 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9774 {
9775 uint64 value2 = op2->__anon1.ui64;
9776
9777 exp->type = 2;
9778 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9779 if(!exp->expType)
9780 {
9781 exp->expType = op1->type;
9782 if(op1->type)
9783 op1->type->refCount++;
9784 }
9785 return 1;
9786 }
9787
9788 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9789 {
9790 short value2 = op2->__anon1.s;
9791
9792 exp->type = 2;
9793 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9794 if(!exp->expType)
9795 {
9796 exp->expType = op1->type;
9797 if(op1->type)
9798 op1->type->refCount++;
9799 }
9800 return 1;
9801 }
9802
9803 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9804 {
9805 unsigned short value2 = op2->__anon1.us;
9806
9807 exp->type = 2;
9808 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9809 if(!exp->expType)
9810 {
9811 exp->expType = op1->type;
9812 if(op1->type)
9813 op1->type->refCount++;
9814 }
9815 return 1;
9816 }
9817
9818 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9819 {
9820 char value2 = op2->__anon1.c;
9821
9822 exp->type = 2;
9823 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9824 if(!exp->expType)
9825 {
9826 exp->expType = op1->type;
9827 if(op1->type)
9828 op1->type->refCount++;
9829 }
9830 return 1;
9831 }
9832
9833 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9834 {
9835 unsigned char value2 = op2->__anon1.uc;
9836
9837 exp->type = 2;
9838 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9839 if(!exp->expType)
9840 {
9841 exp->expType = op1->type;
9842 if(op1->type)
9843 op1->type->refCount++;
9844 }
9845 return 1;
9846 }
9847
9848 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9849 {
9850 float value2 = op2->__anon1.f;
9851
9852 exp->type = 2;
9853 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9854 if(!exp->expType)
9855 {
9856 exp->expType = op1->type;
9857 if(op1->type)
9858 op1->type->refCount++;
9859 }
9860 return 1;
9861 }
9862
9863 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9864 {
9865 double value2 = op2->__anon1.d;
9866
9867 exp->type = 2;
9868 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9869 if(!exp->expType)
9870 {
9871 exp->expType = op1->type;
9872 if(op1->type)
9873 op1->type->refCount++;
9874 }
9875 return 1;
9876 }
9877
9878 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9879 {
9880 int value2 = op2->__anon1.i;
9881
9882 exp->type = 2;
9883 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9884 if(!exp->expType)
9885 {
9886 exp->expType = op1->type;
9887 if(op1->type)
9888 op1->type->refCount++;
9889 }
9890 return 1;
9891 }
9892
9893 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9894 {
9895 unsigned int value2 = op2->__anon1.ui;
9896
9897 exp->type = 2;
9898 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9899 if(!exp->expType)
9900 {
9901 exp->expType = op1->type;
9902 if(op1->type)
9903 op1->type->refCount++;
9904 }
9905 return 1;
9906 }
9907
9908 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9909 {
9910 long long value2 = op2->__anon1.i64;
9911
9912 exp->type = 2;
9913 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9914 if(!exp->expType)
9915 {
9916 exp->expType = op1->type;
9917 if(op1->type)
9918 op1->type->refCount++;
9919 }
9920 return 1;
9921 }
9922
9923 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9924 {
9925 uint64 value2 = op2->__anon1.ui64;
9926
9927 exp->type = 2;
9928 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9929 if(!exp->expType)
9930 {
9931 exp->expType = op1->type;
9932 if(op1->type)
9933 op1->type->refCount++;
9934 }
9935 return 1;
9936 }
9937
9938 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9939 {
9940 short value2 = op2->__anon1.s;
9941
9942 exp->type = 2;
9943 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9944 if(!exp->expType)
9945 {
9946 exp->expType = op1->type;
9947 if(op1->type)
9948 op1->type->refCount++;
9949 }
9950 return 1;
9951 }
9952
9953 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9954 {
9955 unsigned short value2 = op2->__anon1.us;
9956
9957 exp->type = 2;
9958 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9959 if(!exp->expType)
9960 {
9961 exp->expType = op1->type;
9962 if(op1->type)
9963 op1->type->refCount++;
9964 }
9965 return 1;
9966 }
9967
9968 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9969 {
9970 char value2 = op2->__anon1.c;
9971
9972 exp->type = 2;
9973 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9974 if(!exp->expType)
9975 {
9976 exp->expType = op1->type;
9977 if(op1->type)
9978 op1->type->refCount++;
9979 }
9980 return 1;
9981 }
9982
9983 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9984 {
9985 unsigned char value2 = op2->__anon1.uc;
9986
9987 exp->type = 2;
9988 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9989 if(!exp->expType)
9990 {
9991 exp->expType = op1->type;
9992 if(op1->type)
9993 op1->type->refCount++;
9994 }
9995 return 1;
9996 }
9997
9998 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9999 {
10000 float value2 = op2->__anon1.f;
10001
10002 exp->type = 2;
10003 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
10004 if(!exp->expType)
10005 {
10006 exp->expType = op1->type;
10007 if(op1->type)
10008 op1->type->refCount++;
10009 }
10010 return 1;
10011 }
10012
10013 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10014 {
10015 double value2 = op2->__anon1.d;
10016
10017 exp->type = 2;
10018 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
10019 if(!exp->expType)
10020 {
10021 exp->expType = op1->type;
10022 if(op1->type)
10023 op1->type->refCount++;
10024 }
10025 return 1;
10026 }
10027
10028 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10029 {
10030 int value2 = op2->__anon1.i;
10031
10032 exp->type = 2;
10033 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10034 if(!exp->expType)
10035 {
10036 exp->expType = op1->type;
10037 if(op1->type)
10038 op1->type->refCount++;
10039 }
10040 return 1;
10041 }
10042
10043 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10044 {
10045 unsigned int value2 = op2->__anon1.ui;
10046
10047 exp->type = 2;
10048 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10049 if(!exp->expType)
10050 {
10051 exp->expType = op1->type;
10052 if(op1->type)
10053 op1->type->refCount++;
10054 }
10055 return 1;
10056 }
10057
10058 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10059 {
10060 long long value2 = op2->__anon1.i64;
10061
10062 exp->type = 2;
10063 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10064 if(!exp->expType)
10065 {
10066 exp->expType = op1->type;
10067 if(op1->type)
10068 op1->type->refCount++;
10069 }
10070 return 1;
10071 }
10072
10073 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10074 {
10075 uint64 value2 = op2->__anon1.ui64;
10076
10077 exp->type = 2;
10078 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10079 if(!exp->expType)
10080 {
10081 exp->expType = op1->type;
10082 if(op1->type)
10083 op1->type->refCount++;
10084 }
10085 return 1;
10086 }
10087
10088 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10089 {
10090 short value2 = op2->__anon1.s;
10091
10092 exp->type = 2;
10093 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10094 if(!exp->expType)
10095 {
10096 exp->expType = op1->type;
10097 if(op1->type)
10098 op1->type->refCount++;
10099 }
10100 return 1;
10101 }
10102
10103 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10104 {
10105 unsigned short value2 = op2->__anon1.us;
10106
10107 exp->type = 2;
10108 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10109 if(!exp->expType)
10110 {
10111 exp->expType = op1->type;
10112 if(op1->type)
10113 op1->type->refCount++;
10114 }
10115 return 1;
10116 }
10117
10118 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10119 {
10120 char value2 = op2->__anon1.c;
10121
10122 exp->type = 2;
10123 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10124 if(!exp->expType)
10125 {
10126 exp->expType = op1->type;
10127 if(op1->type)
10128 op1->type->refCount++;
10129 }
10130 return 1;
10131 }
10132
10133 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10134 {
10135 unsigned char value2 = op2->__anon1.uc;
10136
10137 exp->type = 2;
10138 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10139 if(!exp->expType)
10140 {
10141 exp->expType = op1->type;
10142 if(op1->type)
10143 op1->type->refCount++;
10144 }
10145 return 1;
10146 }
10147
10148 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10149 {
10150 float value2 = op2->__anon1.f;
10151
10152 exp->type = 2;
10153 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10154 if(!exp->expType)
10155 {
10156 exp->expType = op1->type;
10157 if(op1->type)
10158 op1->type->refCount++;
10159 }
10160 return 1;
10161 }
10162
10163 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10164 {
10165 double value2 = op2->__anon1.d;
10166
10167 exp->type = 2;
10168 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10169 if(!exp->expType)
10170 {
10171 exp->expType = op1->type;
10172 if(op1->type)
10173 op1->type->refCount++;
10174 }
10175 return 1;
10176 }
10177
10178 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10179 {
10180 int value2 = op2->__anon1.i;
10181
10182 exp->type = 2;
10183 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10184 if(!exp->expType)
10185 {
10186 exp->expType = op1->type;
10187 if(op1->type)
10188 op1->type->refCount++;
10189 }
10190 return 1;
10191 }
10192
10193 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10194 {
10195 unsigned int value2 = op2->__anon1.ui;
10196
10197 exp->type = 2;
10198 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10199 if(!exp->expType)
10200 {
10201 exp->expType = op1->type;
10202 if(op1->type)
10203 op1->type->refCount++;
10204 }
10205 return 1;
10206 }
10207
10208 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10209 {
10210 long long value2 = op2->__anon1.i64;
10211
10212 exp->type = 2;
10213 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10214 if(!exp->expType)
10215 {
10216 exp->expType = op1->type;
10217 if(op1->type)
10218 op1->type->refCount++;
10219 }
10220 return 1;
10221 }
10222
10223 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10224 {
10225 uint64 value2 = op2->__anon1.ui64;
10226
10227 exp->type = 2;
10228 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10229 if(!exp->expType)
10230 {
10231 exp->expType = op1->type;
10232 if(op1->type)
10233 op1->type->refCount++;
10234 }
10235 return 1;
10236 }
10237
10238 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10239 {
10240 short value2 = op2->__anon1.s;
10241
10242 exp->type = 2;
10243 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10244 if(!exp->expType)
10245 {
10246 exp->expType = op1->type;
10247 if(op1->type)
10248 op1->type->refCount++;
10249 }
10250 return 1;
10251 }
10252
10253 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10254 {
10255 unsigned short value2 = op2->__anon1.us;
10256
10257 exp->type = 2;
10258 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10259 if(!exp->expType)
10260 {
10261 exp->expType = op1->type;
10262 if(op1->type)
10263 op1->type->refCount++;
10264 }
10265 return 1;
10266 }
10267
10268 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10269 {
10270 char value2 = op2->__anon1.c;
10271
10272 exp->type = 2;
10273 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10274 if(!exp->expType)
10275 {
10276 exp->expType = op1->type;
10277 if(op1->type)
10278 op1->type->refCount++;
10279 }
10280 return 1;
10281 }
10282
10283 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10284 {
10285 unsigned char value2 = op2->__anon1.uc;
10286
10287 exp->type = 2;
10288 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10289 if(!exp->expType)
10290 {
10291 exp->expType = op1->type;
10292 if(op1->type)
10293 op1->type->refCount++;
10294 }
10295 return 1;
10296 }
10297
10298 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10299 {
10300 float value2 = op2->__anon1.f;
10301
10302 exp->type = 2;
10303 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10304 if(!exp->expType)
10305 {
10306 exp->expType = op1->type;
10307 if(op1->type)
10308 op1->type->refCount++;
10309 }
10310 return 1;
10311 }
10312
10313 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10314 {
10315 double value2 = op2->__anon1.d;
10316
10317 exp->type = 2;
10318 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10319 if(!exp->expType)
10320 {
10321 exp->expType = op1->type;
10322 if(op1->type)
10323 op1->type->refCount++;
10324 }
10325 return 1;
10326 }
10327
10328 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10329 {
10330 int value2 = op2->__anon1.i;
10331
10332 exp->type = 2;
10333 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10334 if(!exp->expType)
10335 {
10336 exp->expType = op1->type;
10337 if(op1->type)
10338 op1->type->refCount++;
10339 }
10340 return 1;
10341 }
10342
10343 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10344 {
10345 unsigned int value2 = op2->__anon1.ui;
10346
10347 exp->type = 2;
10348 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10349 if(!exp->expType)
10350 {
10351 exp->expType = op1->type;
10352 if(op1->type)
10353 op1->type->refCount++;
10354 }
10355 return 1;
10356 }
10357
10358 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10359 {
10360 long long value2 = op2->__anon1.i64;
10361
10362 exp->type = 2;
10363 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10364 if(!exp->expType)
10365 {
10366 exp->expType = op1->type;
10367 if(op1->type)
10368 op1->type->refCount++;
10369 }
10370 return 1;
10371 }
10372
10373 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10374 {
10375 uint64 value2 = op2->__anon1.ui64;
10376
10377 exp->type = 2;
10378 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10379 if(!exp->expType)
10380 {
10381 exp->expType = op1->type;
10382 if(op1->type)
10383 op1->type->refCount++;
10384 }
10385 return 1;
10386 }
10387
10388 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10389 {
10390 short value2 = op2->__anon1.s;
10391
10392 exp->type = 2;
10393 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10394 if(!exp->expType)
10395 {
10396 exp->expType = op1->type;
10397 if(op1->type)
10398 op1->type->refCount++;
10399 }
10400 return 1;
10401 }
10402
10403 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10404 {
10405 unsigned short value2 = op2->__anon1.us;
10406
10407 exp->type = 2;
10408 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10409 if(!exp->expType)
10410 {
10411 exp->expType = op1->type;
10412 if(op1->type)
10413 op1->type->refCount++;
10414 }
10415 return 1;
10416 }
10417
10418 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10419 {
10420 char value2 = op2->__anon1.c;
10421
10422 exp->type = 2;
10423 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10424 if(!exp->expType)
10425 {
10426 exp->expType = op1->type;
10427 if(op1->type)
10428 op1->type->refCount++;
10429 }
10430 return 1;
10431 }
10432
10433 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10434 {
10435 unsigned char value2 = op2->__anon1.uc;
10436
10437 exp->type = 2;
10438 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10439 if(!exp->expType)
10440 {
10441 exp->expType = op1->type;
10442 if(op1->type)
10443 op1->type->refCount++;
10444 }
10445 return 1;
10446 }
10447
10448 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10449 {
10450 float value2 = op2->__anon1.f;
10451
10452 exp->type = 2;
10453 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10454 if(!exp->expType)
10455 {
10456 exp->expType = op1->type;
10457 if(op1->type)
10458 op1->type->refCount++;
10459 }
10460 return 1;
10461 }
10462
10463 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10464 {
10465 double value2 = op2->__anon1.d;
10466
10467 exp->type = 2;
10468 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10469 if(!exp->expType)
10470 {
10471 exp->expType = op1->type;
10472 if(op1->type)
10473 op1->type->refCount++;
10474 }
10475 return 1;
10476 }
10477
10478 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10479 {
10480 int value2 = op2->__anon1.i;
10481
10482 exp->type = 2;
10483 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10484 if(!exp->expType)
10485 {
10486 exp->expType = op1->type;
10487 if(op1->type)
10488 op1->type->refCount++;
10489 }
10490 return 1;
10491 }
10492
10493 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10494 {
10495 unsigned int value2 = op2->__anon1.ui;
10496
10497 exp->type = 2;
10498 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10499 if(!exp->expType)
10500 {
10501 exp->expType = op1->type;
10502 if(op1->type)
10503 op1->type->refCount++;
10504 }
10505 return 1;
10506 }
10507
10508 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10509 {
10510 long long value2 = op2->__anon1.i64;
10511
10512 exp->type = 2;
10513 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10514 if(!exp->expType)
10515 {
10516 exp->expType = op1->type;
10517 if(op1->type)
10518 op1->type->refCount++;
10519 }
10520 return 1;
10521 }
10522
10523 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10524 {
10525 uint64 value2 = op2->__anon1.ui64;
10526
10527 exp->type = 2;
10528 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10529 if(!exp->expType)
10530 {
10531 exp->expType = op1->type;
10532 if(op1->type)
10533 op1->type->refCount++;
10534 }
10535 return 1;
10536 }
10537
10538 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10539 {
10540 short value2 = op2->__anon1.s;
10541
10542 exp->type = 2;
10543 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10544 if(!exp->expType)
10545 {
10546 exp->expType = op1->type;
10547 if(op1->type)
10548 op1->type->refCount++;
10549 }
10550 return 1;
10551 }
10552
10553 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10554 {
10555 unsigned short value2 = op2->__anon1.us;
10556
10557 exp->type = 2;
10558 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10559 if(!exp->expType)
10560 {
10561 exp->expType = op1->type;
10562 if(op1->type)
10563 op1->type->refCount++;
10564 }
10565 return 1;
10566 }
10567
10568 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10569 {
10570 char value2 = op2->__anon1.c;
10571
10572 exp->type = 2;
10573 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10574 if(!exp->expType)
10575 {
10576 exp->expType = op1->type;
10577 if(op1->type)
10578 op1->type->refCount++;
10579 }
10580 return 1;
10581 }
10582
10583 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10584 {
10585 unsigned char value2 = op2->__anon1.uc;
10586
10587 exp->type = 2;
10588 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10589 if(!exp->expType)
10590 {
10591 exp->expType = op1->type;
10592 if(op1->type)
10593 op1->type->refCount++;
10594 }
10595 return 1;
10596 }
10597
10598 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10599 {
10600 float value2 = op2->__anon1.f;
10601
10602 exp->type = 2;
10603 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10604 if(!exp->expType)
10605 {
10606 exp->expType = op1->type;
10607 if(op1->type)
10608 op1->type->refCount++;
10609 }
10610 return 1;
10611 }
10612
10613 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10614 {
10615 double value2 = op2->__anon1.d;
10616
10617 exp->type = 2;
10618 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10619 if(!exp->expType)
10620 {
10621 exp->expType = op1->type;
10622 if(op1->type)
10623 op1->type->refCount++;
10624 }
10625 return 1;
10626 }
10627
10628 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10629 {
10630 exp->type = 2;
10631 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10632 if(!exp->expType)
10633 {
10634 exp->expType = op1->type;
10635 if(op1->type)
10636 op1->type->refCount++;
10637 }
10638 return 1;
10639 }
10640
10641 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10642 {
10643 exp->type = 2;
10644 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10645 if(!exp->expType)
10646 {
10647 exp->expType = op1->type;
10648 if(op1->type)
10649 op1->type->refCount++;
10650 }
10651 return 1;
10652 }
10653
10654 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10655 {
10656 exp->type = 2;
10657 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10658 if(!exp->expType)
10659 {
10660 exp->expType = op1->type;
10661 if(op1->type)
10662 op1->type->refCount++;
10663 }
10664 return 1;
10665 }
10666
10667 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10668 {
10669 exp->type = 2;
10670 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10671 if(!exp->expType)
10672 {
10673 exp->expType = op1->type;
10674 if(op1->type)
10675 op1->type->refCount++;
10676 }
10677 return 1;
10678 }
10679
10680 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10681 {
10682 exp->type = 2;
10683 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10684 if(!exp->expType)
10685 {
10686 exp->expType = op1->type;
10687 if(op1->type)
10688 op1->type->refCount++;
10689 }
10690 return 1;
10691 }
10692
10693 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10694 {
10695 exp->type = 2;
10696 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10697 if(!exp->expType)
10698 {
10699 exp->expType = op1->type;
10700 if(op1->type)
10701 op1->type->refCount++;
10702 }
10703 return 1;
10704 }
10705
10706 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10707 {
10708 exp->type = 2;
10709 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10710 if(!exp->expType)
10711 {
10712 exp->expType = op1->type;
10713 if(op1->type)
10714 op1->type->refCount++;
10715 }
10716 return 1;
10717 }
10718
10719 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10720 {
10721 exp->type = 2;
10722 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10723 if(!exp->expType)
10724 {
10725 exp->expType = op1->type;
10726 if(op1->type)
10727 op1->type->refCount++;
10728 }
10729 return 1;
10730 }
10731
10732 struct OpTable intOps =
10733 {
10734 (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)
10735 };
10736
10737 struct OpTable uintOps =
10738 {
10739 (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)
10740 };
10741
10742 struct OpTable int64Ops =
10743 {
10744 (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)
10745 };
10746
10747 struct OpTable uint64Ops =
10748 {
10749 (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)
10750 };
10751
10752 struct OpTable shortOps =
10753 {
10754 (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)
10755 };
10756
10757 struct OpTable ushortOps =
10758 {
10759 (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)
10760 };
10761
10762 struct OpTable floatOps =
10763 {
10764 (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)
10765 };
10766
10767 struct OpTable doubleOps =
10768 {
10769 (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)
10770 };
10771
10772 struct OpTable charOps =
10773 {
10774 (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)
10775 };
10776
10777 struct OpTable ucharOps =
10778 {
10779 (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)
10780 };
10781
10782 void ReadString(char * output, char * string)
10783 {
10784 int len = strlen(string);
10785 int c, d = 0;
10786 unsigned int quoted = 0, escaped = 0;
10787
10788 for(c = 0; c < len; c++)
10789 {
10790 char ch = string[c];
10791
10792 if(escaped)
10793 {
10794 switch(ch)
10795 {
10796 case 'n':
10797 output[d] = '\n';
10798 break;
10799 case 't':
10800 output[d] = '\t';
10801 break;
10802 case 'a':
10803 output[d] = '\a';
10804 break;
10805 case 'b':
10806 output[d] = '\b';
10807 break;
10808 case 'f':
10809 output[d] = '\f';
10810 break;
10811 case 'r':
10812 output[d] = '\r';
10813 break;
10814 case 'v':
10815 output[d] = '\v';
10816 break;
10817 case '\\':
10818 output[d] = '\\';
10819 break;
10820 case '\"':
10821 output[d] = '\"';
10822 break;
10823 case '\'':
10824 output[d] = '\'';
10825 break;
10826 default:
10827 output[d] = ch;
10828 }
10829 d++;
10830 escaped = 0;
10831 }
10832 else
10833 {
10834 if(ch == '\"')
10835 quoted ^= 1;
10836 else if(quoted)
10837 {
10838 if(ch == '\\')
10839 escaped = 1;
10840 else
10841 output[d++] = ch;
10842 }
10843 }
10844 }
10845 output[d] = '\0';
10846 }
10847
10848 int UnescapeString(char * d, char * s, int len)
10849 {
10850 int j = 0, k = 0;
10851 char ch;
10852
10853 while(j < len && (ch = s[j]))
10854 {
10855 switch(ch)
10856 {
10857 case '\\':
10858 switch((ch = s[++j]))
10859 {
10860 case 'n':
10861 d[k] = '\n';
10862 break;
10863 case 't':
10864 d[k] = '\t';
10865 break;
10866 case 'a':
10867 d[k] = '\a';
10868 break;
10869 case 'b':
10870 d[k] = '\b';
10871 break;
10872 case 'f':
10873 d[k] = '\f';
10874 break;
10875 case 'r':
10876 d[k] = '\r';
10877 break;
10878 case 'v':
10879 d[k] = '\v';
10880 break;
10881 case '\\':
10882 d[k] = '\\';
10883 break;
10884 case '\"':
10885 d[k] = '\"';
10886 break;
10887 case '\'':
10888 d[k] = '\'';
10889 break;
10890 default:
10891 d[k] = '\\';
10892 d[k] = ch;
10893 }
10894 break;
10895 default:
10896 d[k] = ch;
10897 }
10898 j++, k++;
10899 }
10900 d[k] = '\0';
10901 return k;
10902 }
10903
10904 char * OffsetEscapedString(char * s, int len, int offset)
10905 {
10906 char ch;
10907 int j = 0, k = 0;
10908
10909 while(j < len && k < offset && (ch = s[j]))
10910 {
10911 if(ch == '\\')
10912 ++j;
10913 j++, k++;
10914 }
10915 return (k == offset) ? s + j : (((void *)0));
10916 }
10917
10918 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10919
10920 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10921
10922 extern double strtod(const char * , char * * );
10923
10924 extern float (* __ecereMethod_float_inf)(void);
10925
10926 extern float (* __ecereMethod_float_nan)(void);
10927
10928 extern double (* __ecereMethod_double_inf)(void);
10929
10930 extern double (* __ecereMethod_double_nan)(void);
10931
10932 struct Operand GetOperand(struct Expression * exp)
10933 {
10934 struct Operand op =
10935 {
10936 0, 0, 0,
10937 .__anon1 = {
10938 .c = 0
10939 },
10940 {
10941 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10942 }
10943 };
10944 struct Type * type = exp->expType;
10945
10946 if(type)
10947 {
10948 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))
10949 {
10950 if(!type->__anon1._class->__anon1.registered->dataType)
10951 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10952 type = type->__anon1._class->__anon1.registered->dataType;
10953 }
10954 if(exp->type == 3 && op.kind == 13)
10955 {
10956 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10957 op.kind = 13;
10958 op.ops = uint64Ops;
10959 }
10960 else if(exp->isConstant && exp->type == 2)
10961 {
10962 op.kind = type->kind;
10963 op.type = type;
10964 switch(op.kind)
10965 {
10966 case 24:
10967 case 1:
10968 {
10969 if(exp->__anon1.__anon1.constant[0] == '\'')
10970 {
10971 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10972 op.ops = charOps;
10973 }
10974 else if(type->isSigned)
10975 {
10976 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10977 op.ops = charOps;
10978 }
10979 else
10980 {
10981 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10982 op.ops = ucharOps;
10983 }
10984 break;
10985 }
10986 case 2:
10987 if(type->isSigned)
10988 {
10989 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10990 op.ops = shortOps;
10991 }
10992 else
10993 {
10994 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10995 op.ops = ushortOps;
10996 }
10997 break;
10998 case 3:
10999 case 5:
11000 if(type->isSigned)
11001 {
11002 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11003 op.ops = intOps;
11004 }
11005 else
11006 {
11007 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11008 op.ops = uintOps;
11009 }
11010 op.kind = 3;
11011 break;
11012 case 4:
11013 if(type->isSigned)
11014 {
11015 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11016 op.ops = int64Ops;
11017 }
11018 else
11019 {
11020 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11021 op.ops = uint64Ops;
11022 }
11023 op.kind = 4;
11024 break;
11025 case 22:
11026 if(type->isSigned)
11027 {
11028 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11029 op.ops = int64Ops;
11030 }
11031 else
11032 {
11033 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11034 op.ops = uint64Ops;
11035 }
11036 op.kind = 4;
11037 break;
11038 case 23:
11039 if(type->isSigned)
11040 {
11041 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11042 op.ops = int64Ops;
11043 }
11044 else
11045 {
11046 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11047 op.ops = uint64Ops;
11048 }
11049 op.kind = 4;
11050 break;
11051 case 6:
11052 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11053 op.__anon1.f = __ecereMethod_float_inf();
11054 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11055 op.__anon1.f = -__ecereMethod_float_inf();
11056 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11057 op.__anon1.f = __ecereMethod_float_nan();
11058 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11059 op.__anon1.f = -__ecereMethod_float_nan();
11060 else
11061 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11062 op.ops = floatOps;
11063 break;
11064 case 7:
11065 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11066 op.__anon1.d = __ecereMethod_double_inf();
11067 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11068 op.__anon1.d = -__ecereMethod_double_inf();
11069 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11070 op.__anon1.d = __ecereMethod_double_nan();
11071 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11072 op.__anon1.d = -__ecereMethod_double_nan();
11073 else
11074 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11075 op.ops = doubleOps;
11076 break;
11077 case 12:
11078 case 13:
11079 case 8:
11080 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11081 op.kind = 13;
11082 op.ops = uint64Ops;
11083 break;
11084 }
11085 }
11086 }
11087 return op;
11088 }
11089
11090 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11091 {
11092 long long v = 0;
11093
11094 switch(_class->typeSize)
11095 {
11096 case 8:
11097 if(!strcmp(_class->dataTypeString, "uint64"))
11098 v = (long long)*(uint64 *)ptr;
11099 else
11100 v = *(long long *)ptr;
11101 break;
11102 case 4:
11103 if(!strcmp(_class->dataTypeString, "uint"))
11104 v = (long long)*(unsigned int *)ptr;
11105 else
11106 v = (long long)*(int *)ptr;
11107 break;
11108 case 2:
11109 if(!strcmp(_class->dataTypeString, "uint16"))
11110 v = (long long)*(unsigned short *)ptr;
11111 else
11112 v = (long long)*(short *)ptr;
11113 break;
11114 case 1:
11115 if(!strcmp(_class->dataTypeString, "byte"))
11116 v = (long long)*(unsigned char *)ptr;
11117 else
11118 v = (long long)*(char *)ptr;
11119 break;
11120 }
11121 return v;
11122 }
11123
11124 int __ecereVMethodID_class_OnGetString;
11125
11126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11127
11128 static __attribute__((unused)) void UnusedFunction()
11129 {
11130 int a;
11131
11132 ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, (void *)&a, 0, 0, 0);
11133 }
11134
11135 extern int __ecereVMethodID_class_OnGetString;
11136
11137 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11138 {
11139 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11140
11141 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11142 {
11143 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11144 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11145 else
11146 {
11147 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11148 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11149 struct Type * type;
11150 void * ptr = inst->data + dataMember->offset + offset;
11151 char * result = (((void *)0));
11152
11153 exp->loc = member->loc = inst->loc;
11154 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11155 if(!dataMember->dataType)
11156 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11157 type = dataMember->dataType;
11158 if(type->kind == 8)
11159 {
11160 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11161
11162 if(_class->type == 4)
11163 {
11164 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11165
11166 if(enumClass)
11167 {
11168 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11169 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11170
11171 for(item = e->values.first; item; item = item->next)
11172 {
11173 if(item->data == GetEnumValue(_class, ptr))
11174 {
11175 result = item->name;
11176 break;
11177 }
11178 }
11179 if(result)
11180 {
11181 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11182 exp->type = 0;
11183 exp->destType = MkClassType(_class->fullName);
11184 ProcessExpressionType(exp);
11185 }
11186 }
11187 }
11188 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11189 {
11190 if(!_class->dataType)
11191 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11192 type = _class->dataType;
11193 }
11194 }
11195 if(!result)
11196 {
11197 switch(type->kind)
11198 {
11199 case 6:
11200 {
11201 FreeExpContents(exp);
11202 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11203 exp->type = 2;
11204 break;
11205 }
11206 case 7:
11207 {
11208 FreeExpContents(exp);
11209 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11210 exp->type = 2;
11211 break;
11212 }
11213 case 3:
11214 {
11215 FreeExpContents(exp);
11216 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11217 exp->type = 2;
11218 break;
11219 }
11220 case 4:
11221 {
11222 FreeExpContents(exp);
11223 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11224 exp->type = 2;
11225 break;
11226 }
11227 case 22:
11228 {
11229 FreeExpContents(exp);
11230 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11231 exp->type = 2;
11232 break;
11233 }
11234 case 23:
11235 {
11236 FreeExpContents(exp);
11237 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11238 exp->type = 2;
11239 break;
11240 }
11241 default:
11242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11243 }
11244 }
11245 ListAdd(memberList, member);
11246 }
11247 if(parentDataMember->type == 1)
11248 break;
11249 }
11250 }
11251
11252 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11253
11254 void PopulateInstance(struct Instantiation * inst)
11255 {
11256 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11257 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11258 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11259 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11260
11261 if(!inst->members)
11262 inst->members = MkListOne(MkMembersInitList(memberList));
11263 else
11264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11265 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11266 {
11267 if(!dataMember->isProperty)
11268 {
11269 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11270 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11271 else
11272 {
11273 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11274 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11275 struct Type * type;
11276 void * ptr = inst->data + dataMember->offset;
11277 char * result = (((void *)0));
11278
11279 exp->loc = member->loc = inst->loc;
11280 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11281 if(!dataMember->dataType)
11282 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11283 type = dataMember->dataType;
11284 if(type->kind == 8)
11285 {
11286 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11287
11288 if(_class->type == 4)
11289 {
11290 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11291
11292 if(enumClass)
11293 {
11294 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11295 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11296
11297 for(item = e->values.first; item; item = item->next)
11298 {
11299 if(item->data == GetEnumValue(_class, ptr))
11300 {
11301 result = item->name;
11302 break;
11303 }
11304 }
11305 }
11306 if(result)
11307 {
11308 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11309 exp->type = 0;
11310 exp->destType = MkClassType(_class->fullName);
11311 ProcessExpressionType(exp);
11312 }
11313 }
11314 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11315 {
11316 if(!_class->dataType)
11317 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11318 type = _class->dataType;
11319 }
11320 }
11321 if(!result)
11322 {
11323 switch(type->kind)
11324 {
11325 case 6:
11326 {
11327 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11328 exp->type = 2;
11329 break;
11330 }
11331 case 7:
11332 {
11333 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11334 exp->type = 2;
11335 break;
11336 }
11337 case 3:
11338 {
11339 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11340 exp->type = 2;
11341 break;
11342 }
11343 case 4:
11344 {
11345 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11346 exp->type = 2;
11347 break;
11348 }
11349 case 22:
11350 {
11351 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11352 exp->type = 2;
11353 break;
11354 }
11355 default:
11356 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11357 }
11358 }
11359 ListAdd(memberList, member);
11360 }
11361 }
11362 }
11363 }
11364
11365 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);
11366
11367 extern void FreeInstance(struct Instantiation * inst);
11368
11369 void ComputeInstantiation(struct Expression * exp)
11370 {
11371 struct Instantiation * inst = exp->__anon1.instance;
11372 struct MembersInit * members;
11373 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11374 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11375 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11376 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11377 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11378 int subMemberStackPos = 0;
11379 uint64 bits = 0;
11380
11381 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11382 {
11383 if(inst->data)
11384 return ;
11385 if(_class->type == 0 || _class->type == 5)
11386 {
11387 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11388 if(_class->type == 0)
11389 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11390 }
11391 else
11392 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11393 }
11394 if(inst->members)
11395 {
11396 for(members = (*inst->members).first; members; members = members->next)
11397 {
11398 switch(members->type)
11399 {
11400 case 0:
11401 {
11402 if(members->__anon1.dataMembers)
11403 {
11404 struct MemberInit * member;
11405
11406 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11407 {
11408 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11409 unsigned int found = 0;
11410 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11411 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11412 unsigned int dataMemberOffset;
11413
11414 if(!ident)
11415 {
11416 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11417 if(curMember)
11418 {
11419 if(curMember->isProperty)
11420 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11421 else
11422 {
11423 dataMember = curMember;
11424 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11425 if(_class->type == 0)
11426 dataMemberOffset += _class->base->structSize;
11427 }
11428 found = 1;
11429 }
11430 }
11431 else
11432 {
11433 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11434 if(prop)
11435 {
11436 found = 1;
11437 if(prop->memberAccess == 1)
11438 {
11439 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11440 curClass = prop->_class;
11441 }
11442 }
11443 else
11444 {
11445 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11446 int _subMemberStackPos = 0;
11447
11448 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11449 if(dataMember)
11450 {
11451 found = 1;
11452 if(dataMember->memberAccess == 1)
11453 {
11454 curMember = dataMember;
11455 curClass = dataMember->_class;
11456 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11457 subMemberStackPos = _subMemberStackPos;
11458 }
11459 }
11460 }
11461 }
11462 if(found && member->initializer && member->initializer->type == 0)
11463 {
11464 struct Expression * value = member->initializer->__anon1.exp;
11465 struct Type * type = (((void *)0));
11466 unsigned int deepMember = 0;
11467
11468 if(prop)
11469 {
11470 type = prop->dataType;
11471 }
11472 else if(dataMember)
11473 {
11474 if(!dataMember->dataType)
11475 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11476 type = dataMember->dataType;
11477 }
11478 if(ident && ident->next)
11479 {
11480 deepMember = 1;
11481 for(ident = ident->next; ident && type; ident = ident->next)
11482 {
11483 if(type->kind == 8)
11484 {
11485 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11486 if(prop)
11487 type = prop->dataType;
11488 else
11489 {
11490 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11491 if(dataMember)
11492 type = dataMember->dataType;
11493 }
11494 }
11495 else if(type->kind == 9 || type->kind == 10)
11496 {
11497 struct Type * memberType;
11498
11499 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11500 {
11501 if(!strcmp(memberType->name, ident->string))
11502 {
11503 type = memberType;
11504 break;
11505 }
11506 }
11507 }
11508 }
11509 }
11510 if(value)
11511 {
11512 FreeType(value->destType);
11513 value->destType = type;
11514 if(type)
11515 type->refCount++;
11516 ComputeExpression(value);
11517 }
11518 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11519 {
11520 if(type->kind == 8)
11521 {
11522 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11523
11524 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11525 {
11526 if(!_class->dataType)
11527 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11528 type = _class->dataType;
11529 }
11530 }
11531 if(dataMember)
11532 {
11533 void * ptr = inst->data + dataMemberOffset;
11534
11535 if(value->type == 2)
11536 {
11537 switch(type->kind)
11538 {
11539 case 3:
11540 {
11541 GetInt(value, (int *)ptr);
11542 break;
11543 }
11544 case 4:
11545 {
11546 GetInt64(value, (long long *)ptr);
11547 break;
11548 }
11549 case 22:
11550 {
11551 GetIntPtr(value, (intptr_t *)ptr);
11552 break;
11553 }
11554 case 23:
11555 {
11556 GetIntSize(value, (ssize_t *)ptr);
11557 break;
11558 }
11559 case 6:
11560 {
11561 GetFloat(value, (float *)ptr);
11562 break;
11563 }
11564 case 7:
11565 {
11566 GetDouble(value, (double *)ptr);
11567 break;
11568 }
11569 }
11570 }
11571 else if(value->type == 1)
11572 {
11573 if(type->kind == 8)
11574 {
11575 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11576
11577 if(_class->type == 1)
11578 {
11579 ComputeTypeSize(type);
11580 if(value->__anon1.instance->data)
11581 memcpy(ptr, value->__anon1.instance->data, type->size);
11582 }
11583 }
11584 }
11585 }
11586 else if(prop)
11587 {
11588 if(value->type == 1 && value->__anon1.instance->data)
11589 {
11590 if(type->kind == 8)
11591 {
11592 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11593
11594 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)))
11595 {
11596 void (* Set)(void *, void *) = (void *)prop->Set;
11597
11598 Set(inst->data, value->__anon1.instance->data);
11599 PopulateInstance(inst);
11600 }
11601 }
11602 }
11603 else if(value->type == 2)
11604 {
11605 switch(type->kind)
11606 {
11607 case 7:
11608 {
11609 void (* Set)(void *, double) = (void *)prop->Set;
11610
11611 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11612 break;
11613 }
11614 case 6:
11615 {
11616 void (* Set)(void *, float) = (void *)prop->Set;
11617
11618 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11619 break;
11620 }
11621 case 3:
11622 {
11623 void (* Set)(void *, int) = (void *)prop->Set;
11624
11625 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11626 break;
11627 }
11628 case 4:
11629 {
11630 void (* Set)(void *, long long) = (void *)prop->Set;
11631
11632 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11633 break;
11634 }
11635 case 22:
11636 {
11637 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11638
11639 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11640 break;
11641 }
11642 case 23:
11643 {
11644 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11645
11646 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11647 break;
11648 }
11649 }
11650 }
11651 else if(value->type == 3)
11652 {
11653 char temp[1024];
11654
11655 ReadString(temp, value->__anon1.__anon2.string);
11656 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11657 }
11658 }
11659 }
11660 else if(!deepMember && type && _class->type == 3)
11661 {
11662 if(prop)
11663 {
11664 if(value->type == 2)
11665 {
11666 if(type->kind == 8)
11667 {
11668 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11669
11670 if(_class->type == 3)
11671 {
11672 if(!_class->dataType)
11673 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11674 type = _class->dataType;
11675 }
11676 }
11677 switch(type->kind)
11678 {
11679 case 6:
11680 {
11681 float fValue;
11682 float (* Set)(float) = (void *)prop->Set;
11683
11684 GetFloat(member->initializer->__anon1.exp, &fValue);
11685 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11686 exp->type = 2;
11687 break;
11688 }
11689 case 7:
11690 {
11691 double dValue;
11692 double (* Set)(double) = (void *)prop->Set;
11693
11694 GetDouble(member->initializer->__anon1.exp, &dValue);
11695 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11696 exp->type = 2;
11697 break;
11698 }
11699 }
11700 }
11701 }
11702 }
11703 else if(!deepMember && type && _class->type == 2)
11704 {
11705 if(prop)
11706 {
11707 if(value->type == 1 && value->__anon1.instance->data)
11708 {
11709 unsigned int (* Set)(void *) = (void *)prop->Set;
11710
11711 bits = Set(value->__anon1.instance->data);
11712 }
11713 else if(value->type == 2)
11714 {
11715 }
11716 }
11717 else if(dataMember)
11718 {
11719 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11720 struct Type * type;
11721 uint64 part = 0;
11722
11723 bits = (bits & ~bitMember->mask);
11724 if(!bitMember->dataType)
11725 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11726 type = bitMember->dataType;
11727 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11728 {
11729 if(!type->__anon1._class->__anon1.registered->dataType)
11730 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11731 type = type->__anon1._class->__anon1.registered->dataType;
11732 }
11733 switch(type->kind)
11734 {
11735 case 24:
11736 case 1:
11737 {
11738 unsigned char v;
11739
11740 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11741 part = (uint64)v;
11742 break;
11743 }
11744 case 2:
11745 {
11746 unsigned short v;
11747
11748 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11749 part = (uint64)v;
11750 break;
11751 }
11752 case 3:
11753 case 5:
11754 {
11755 unsigned int v;
11756
11757 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11758 part = (uint64)v;
11759 break;
11760 }
11761 case 4:
11762 {
11763 uint64 v;
11764
11765 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11766 part = v;
11767 break;
11768 }
11769 case 22:
11770 {
11771 uintptr_t v;
11772
11773 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11774 part = (uint64)v;
11775 break;
11776 }
11777 case 23:
11778 {
11779 size_t v;
11780
11781 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11782 part = (uint64)v;
11783 break;
11784 }
11785 }
11786 bits |= part << bitMember->pos;
11787 }
11788 }
11789 }
11790 else
11791 {
11792 if(_class && _class->type == 3)
11793 {
11794 ComputeExpression(member->initializer->__anon1.exp);
11795 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11796 exp->type = 2;
11797 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11798 }
11799 }
11800 }
11801 }
11802 break;
11803 }
11804 }
11805 }
11806 }
11807 if(_class && _class->type == 2)
11808 {
11809 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11810 exp->type = 2;
11811 }
11812 if(exp->type != 1)
11813 {
11814 FreeInstance(inst);
11815 }
11816 }
11817
11818 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11819 {
11820 unsigned int result = 0;
11821
11822 switch(kind)
11823 {
11824 case 2:
11825 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11826 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11827 break;
11828 case 3:
11829 case 5:
11830 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11831 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11832 break;
11833 case 4:
11834 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)
11835 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11836 break;
11837 case 6:
11838 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)
11839 result = GetOpFloat(op, &op->__anon1.f);
11840 break;
11841 case 7:
11842 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)
11843 result = GetOpDouble(op, &op->__anon1.d);
11844 break;
11845 case 13:
11846 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)
11847 result = GetOpUInt64(op, &op->__anon1.ui64);
11848 break;
11849 case 15:
11850 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)
11851 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11852 break;
11853 case 22:
11854 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11855 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11856 break;
11857 case 23:
11858 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11859 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11860 break;
11861 }
11862 return result;
11863 }
11864
11865 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11866 {
11867 if(exp->__anon1.op.op == SIZEOF)
11868 {
11869 FreeExpContents(exp);
11870 exp->type = 2;
11871 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11872 }
11873 else
11874 {
11875 if(!exp->__anon1.op.exp1)
11876 {
11877 switch(exp->__anon1.op.op)
11878 {
11879 case '+':
11880 {
11881 struct Expression * exp2 = exp->__anon1.op.exp2;
11882
11883 exp->__anon1.op.exp2 = (((void *)0));
11884 FreeExpContents(exp);
11885 FreeType(exp->expType);
11886 FreeType(exp->destType);
11887 *exp = *exp2;
11888 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11889 break;
11890 }
11891 case '-':
11892 if(op1->ops.Neg)
11893 {
11894 FreeExpContents(exp);
11895 op1->ops.Neg(exp, op1);
11896 }
11897 break;
11898 case '~':
11899 if(op1->ops.BitNot)
11900 {
11901 FreeExpContents(exp);
11902 op1->ops.BitNot(exp, op1);
11903 }
11904 break;
11905 case '!':
11906 if(op1->ops.Not)
11907 {
11908 FreeExpContents(exp);
11909 op1->ops.Not(exp, op1);
11910 }
11911 break;
11912 }
11913 }
11914 else
11915 {
11916 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11917 {
11918 if(Promote(op2, op1->kind, op1->type->isSigned))
11919 op2->kind = op1->kind, op2->ops = op1->ops;
11920 else if(Promote(op1, op2->kind, op2->type->isSigned))
11921 op1->kind = op2->kind, op1->ops = op2->ops;
11922 }
11923 switch(exp->__anon1.op.op)
11924 {
11925 case '+':
11926 if(op1->ops.Add)
11927 {
11928 FreeExpContents(exp);
11929 op1->ops.Add(exp, op1, op2);
11930 }
11931 break;
11932 case '-':
11933 if(op1->ops.Sub)
11934 {
11935 FreeExpContents(exp);
11936 op1->ops.Sub(exp, op1, op2);
11937 }
11938 break;
11939 case '*':
11940 if(op1->ops.Mul)
11941 {
11942 FreeExpContents(exp);
11943 op1->ops.Mul(exp, op1, op2);
11944 }
11945 break;
11946 case '/':
11947 if(op1->ops.Div)
11948 {
11949 FreeExpContents(exp);
11950 op1->ops.Div(exp, op1, op2);
11951 }
11952 break;
11953 case '%':
11954 if(op1->ops.Mod)
11955 {
11956 FreeExpContents(exp);
11957 op1->ops.Mod(exp, op1, op2);
11958 }
11959 break;
11960 case '&':
11961 if(exp->__anon1.op.exp2)
11962 {
11963 if(op1->ops.BitAnd)
11964 {
11965 FreeExpContents(exp);
11966 op1->ops.BitAnd(exp, op1, op2);
11967 }
11968 }
11969 break;
11970 case '|':
11971 if(op1->ops.BitOr)
11972 {
11973 FreeExpContents(exp);
11974 op1->ops.BitOr(exp, op1, op2);
11975 }
11976 break;
11977 case '^':
11978 if(op1->ops.BitXor)
11979 {
11980 FreeExpContents(exp);
11981 op1->ops.BitXor(exp, op1, op2);
11982 }
11983 break;
11984 case LEFT_OP:
11985 if(op1->ops.LShift)
11986 {
11987 FreeExpContents(exp);
11988 op1->ops.LShift(exp, op1, op2);
11989 }
11990 break;
11991 case RIGHT_OP:
11992 if(op1->ops.RShift)
11993 {
11994 FreeExpContents(exp);
11995 op1->ops.RShift(exp, op1, op2);
11996 }
11997 break;
11998 case EQ_OP:
11999 if(op1->ops.Equ)
12000 {
12001 FreeExpContents(exp);
12002 op1->ops.Equ(exp, op1, op2);
12003 }
12004 break;
12005 case NE_OP:
12006 if(op1->ops.Nqu)
12007 {
12008 FreeExpContents(exp);
12009 op1->ops.Nqu(exp, op1, op2);
12010 }
12011 break;
12012 case AND_OP:
12013 if(op1->ops.And)
12014 {
12015 FreeExpContents(exp);
12016 op1->ops.And(exp, op1, op2);
12017 }
12018 break;
12019 case OR_OP:
12020 if(op1->ops.Or)
12021 {
12022 FreeExpContents(exp);
12023 op1->ops.Or(exp, op1, op2);
12024 }
12025 break;
12026 case '>':
12027 if(op1->ops.Grt)
12028 {
12029 FreeExpContents(exp);
12030 op1->ops.Grt(exp, op1, op2);
12031 }
12032 break;
12033 case '<':
12034 if(op1->ops.Sma)
12035 {
12036 FreeExpContents(exp);
12037 op1->ops.Sma(exp, op1, op2);
12038 }
12039 break;
12040 case GE_OP:
12041 if(op1->ops.GrtEqu)
12042 {
12043 FreeExpContents(exp);
12044 op1->ops.GrtEqu(exp, op1, op2);
12045 }
12046 break;
12047 case LE_OP:
12048 if(op1->ops.SmaEqu)
12049 {
12050 FreeExpContents(exp);
12051 op1->ops.SmaEqu(exp, op1, op2);
12052 }
12053 break;
12054 }
12055 }
12056 }
12057 }
12058
12059 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12060
12061 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12062
12063 void ComputeExpression(struct Expression * exp)
12064 {
12065 switch(exp->type)
12066 {
12067 case 1:
12068 {
12069 ComputeInstantiation(exp);
12070 break;
12071 }
12072 case 4:
12073 {
12074 struct Expression * exp1, * exp2 = (((void *)0));
12075 struct Operand op1 =
12076 {
12077 0, 0, 0,
12078 .__anon1 = {
12079 .c = 0
12080 },
12081 {
12082 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12083 }
12084 };
12085 struct Operand op2 =
12086 {
12087 0, 0, 0,
12088 .__anon1 = {
12089 .c = 0
12090 },
12091 {
12092 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12093 }
12094 };
12095
12096 if(exp->__anon1.op.exp2)
12097 {
12098 struct Expression * e = exp->__anon1.op.exp2;
12099
12100 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12101 {
12102 if(e->type == 5 || e->type == 32 || e->type == 23)
12103 {
12104 if(e->type == 23)
12105 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12106 else
12107 e = (*e->__anon1.list).last;
12108 }
12109 }
12110 if(exp->__anon1.op.op == 261 && e && e->expType)
12111 {
12112 if(e->type == 3 && e->__anon1.__anon2.string)
12113 {
12114 char * string = e->__anon1.__anon2.string;
12115 int len = strlen(string);
12116 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12117
12118 len = UnescapeString(tmp, string + 1, len - 2);
12119 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12120 FreeExpContents(exp);
12121 exp->type = 2;
12122 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12123 }
12124 else
12125 {
12126 struct Type * type = e->expType;
12127
12128 type->refCount++;
12129 FreeExpContents(exp);
12130 exp->type = 2;
12131 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12132 FreeType(type);
12133 }
12134 break;
12135 }
12136 else
12137 ComputeExpression(exp->__anon1.op.exp2);
12138 }
12139 if(exp->__anon1.op.exp1)
12140 {
12141 ComputeExpression(exp->__anon1.op.exp1);
12142 exp1 = exp->__anon1.op.exp1;
12143 exp2 = exp->__anon1.op.exp2;
12144 op1 = GetOperand(exp1);
12145 if(op1.type)
12146 op1.type->refCount++;
12147 if(exp2)
12148 {
12149 op2 = GetOperand(exp2);
12150 if(op2.type)
12151 op2.type->refCount++;
12152 }
12153 }
12154 else
12155 {
12156 exp1 = exp->__anon1.op.exp2;
12157 op1 = GetOperand(exp1);
12158 if(op1.type)
12159 op1.type->refCount++;
12160 }
12161 CallOperator(exp, exp1, exp2, &op1, &op2);
12162 if(op1.type)
12163 FreeType(op1.type);
12164 if(op2.type)
12165 FreeType(op2.type);
12166 break;
12167 }
12168 case 5:
12169 case 32:
12170 {
12171 struct Expression * e, * n;
12172
12173 for(e = (*exp->__anon1.list).first; e; e = n)
12174 {
12175 n = e->next;
12176 if(!n)
12177 {
12178 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12179 struct Expression * prev = exp->prev;
12180 struct Expression * next = exp->next;
12181
12182 ComputeExpression(e);
12183 FreeType(exp->expType);
12184 FreeType(exp->destType);
12185 *exp = *e;
12186 exp->prev = prev;
12187 exp->next = next;
12188 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12189 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12190 }
12191 else
12192 {
12193 FreeExpression(e);
12194 }
12195 }
12196 break;
12197 }
12198 case 8:
12199 {
12200 struct Expression * memberExp = exp->__anon1.member.exp;
12201 struct Identifier * memberID = exp->__anon1.member.member;
12202 struct Type * type;
12203
12204 ComputeExpression(exp->__anon1.member.exp);
12205 type = exp->__anon1.member.exp->expType;
12206 if(type)
12207 {
12208 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)));
12209 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12210 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12211 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12212
12213 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12214 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12215 if(!_class)
12216 {
12217 char string[256];
12218 struct Symbol * classSym;
12219
12220 string[0] = '\0';
12221 PrintTypeNoConst(type, string, 0, 1);
12222 classSym = FindClass(string);
12223 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12224 }
12225 if(exp->__anon1.member.member)
12226 {
12227 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12228 if(!prop)
12229 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12230 }
12231 if(!prop && !member && _class && exp->__anon1.member.member)
12232 {
12233 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12234
12235 convertTo = _class;
12236 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12237 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12238 }
12239 if(prop)
12240 {
12241 if(prop->compiled)
12242 {
12243 struct Type * type = prop->dataType;
12244
12245 if(_class->type == 3)
12246 {
12247 if(type->kind == 8)
12248 {
12249 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12250
12251 if(_class->type == 3)
12252 {
12253 if(!_class->dataType)
12254 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12255 type = _class->dataType;
12256 }
12257 }
12258 switch(type->kind)
12259 {
12260 case 6:
12261 {
12262 float value;
12263 float (* Get)(float) = (void *)prop->Get;
12264
12265 GetFloat(exp->__anon1.member.exp, &value);
12266 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12267 exp->type = 2;
12268 break;
12269 }
12270 case 7:
12271 {
12272 double value;
12273 double (* Get)(double);
12274
12275 GetDouble(exp->__anon1.member.exp, &value);
12276 if(convertTo)
12277 Get = (void *)prop->Set;
12278 else
12279 Get = (void *)prop->Get;
12280 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12281 exp->type = 2;
12282 break;
12283 }
12284 }
12285 }
12286 else
12287 {
12288 if(convertTo)
12289 {
12290 struct Expression * value = exp->__anon1.member.exp;
12291 struct Type * type;
12292
12293 if(!prop->dataType)
12294 ProcessPropertyType(prop);
12295 type = prop->dataType;
12296 if(!type)
12297 {
12298 }
12299 else if(_class->type == 1)
12300 {
12301 switch(type->kind)
12302 {
12303 case 8:
12304 {
12305 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12306
12307 if(propertyClass->type == 1 && value->type == 1)
12308 {
12309 void (* Set)(void *, void *) = (void *)prop->Set;
12310
12311 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12312 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12313 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12314 exp->__anon1.instance->loc = exp->loc;
12315 exp->type = 1;
12316 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12317 PopulateInstance(exp->__anon1.instance);
12318 }
12319 break;
12320 }
12321 case 3:
12322 {
12323 int intValue;
12324 void (* Set)(void *, int) = (void *)prop->Set;
12325
12326 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12327 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12328 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12329 exp->__anon1.instance->loc = exp->loc;
12330 exp->type = 1;
12331 GetInt(value, &intValue);
12332 Set(exp->__anon1.instance->data, intValue);
12333 PopulateInstance(exp->__anon1.instance);
12334 break;
12335 }
12336 case 4:
12337 {
12338 long long intValue;
12339 void (* Set)(void *, long long) = (void *)prop->Set;
12340
12341 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12342 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12343 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12344 exp->__anon1.instance->loc = exp->loc;
12345 exp->type = 1;
12346 GetInt64(value, &intValue);
12347 Set(exp->__anon1.instance->data, intValue);
12348 PopulateInstance(exp->__anon1.instance);
12349 break;
12350 }
12351 case 22:
12352 {
12353 intptr_t intValue;
12354 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12355
12356 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12357 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12358 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12359 exp->__anon1.instance->loc = exp->loc;
12360 exp->type = 1;
12361 GetIntPtr(value, &intValue);
12362 Set(exp->__anon1.instance->data, intValue);
12363 PopulateInstance(exp->__anon1.instance);
12364 break;
12365 }
12366 case 23:
12367 {
12368 ssize_t intValue;
12369 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12370
12371 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12372 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12373 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12374 exp->__anon1.instance->loc = exp->loc;
12375 exp->type = 1;
12376 GetIntSize(value, &intValue);
12377 Set(exp->__anon1.instance->data, intValue);
12378 PopulateInstance(exp->__anon1.instance);
12379 break;
12380 }
12381 case 6:
12382 {
12383 float floatValue;
12384 void (* Set)(void *, float) = (void *)prop->Set;
12385
12386 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12387 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12388 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12389 exp->__anon1.instance->loc = exp->loc;
12390 exp->type = 1;
12391 GetFloat(value, &floatValue);
12392 Set(exp->__anon1.instance->data, floatValue);
12393 PopulateInstance(exp->__anon1.instance);
12394 break;
12395 }
12396 case 7:
12397 {
12398 double doubleValue;
12399 void (* Set)(void *, double) = (void *)prop->Set;
12400
12401 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12402 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12403 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12404 exp->__anon1.instance->loc = exp->loc;
12405 exp->type = 1;
12406 GetDouble(value, &doubleValue);
12407 Set(exp->__anon1.instance->data, doubleValue);
12408 PopulateInstance(exp->__anon1.instance);
12409 break;
12410 }
12411 }
12412 }
12413 else if(_class->type == 2)
12414 {
12415 switch(type->kind)
12416 {
12417 case 8:
12418 {
12419 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12420
12421 if(propertyClass->type == 1 && value->__anon1.instance->data)
12422 {
12423 unsigned int (* Set)(void *) = (void *)prop->Set;
12424 unsigned int bits = Set(value->__anon1.instance->data);
12425
12426 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12427 exp->type = 2;
12428 break;
12429 }
12430 else if(_class->type == 2)
12431 {
12432 unsigned int value;
12433 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12434 unsigned int bits;
12435
12436 GetUInt(exp->__anon1.member.exp, &value);
12437 bits = Set(value);
12438 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12439 exp->type = 2;
12440 }
12441 }
12442 }
12443 }
12444 }
12445 else
12446 {
12447 if(_class->type == 2)
12448 {
12449 unsigned int value;
12450
12451 GetUInt(exp->__anon1.member.exp, &value);
12452 switch(type->kind)
12453 {
12454 case 8:
12455 {
12456 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12457
12458 if(_class->type == 1)
12459 {
12460 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12461
12462 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12463 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12464 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12465 exp->__anon1.instance->loc = exp->loc;
12466 exp->type = 1;
12467 Get(value, exp->__anon1.instance->data);
12468 PopulateInstance(exp->__anon1.instance);
12469 }
12470 else if(_class->type == 2)
12471 {
12472 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12473 uint64 bits = Get(value);
12474
12475 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12476 exp->type = 2;
12477 }
12478 break;
12479 }
12480 }
12481 }
12482 else if(_class->type == 1)
12483 {
12484 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12485
12486 switch(type->kind)
12487 {
12488 case 8:
12489 {
12490 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12491
12492 if(_class->type == 1 && value)
12493 {
12494 void (* Get)(void *, void *) = (void *)prop->Get;
12495
12496 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12497 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12498 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12499 exp->__anon1.instance->loc = exp->loc;
12500 exp->type = 1;
12501 Get(value, exp->__anon1.instance->data);
12502 PopulateInstance(exp->__anon1.instance);
12503 }
12504 break;
12505 }
12506 }
12507 }
12508 }
12509 }
12510 }
12511 else
12512 {
12513 exp->isConstant = 0;
12514 }
12515 }
12516 else if(member)
12517 {
12518 }
12519 }
12520 if(exp->type != 8)
12521 {
12522 FreeExpression(memberExp);
12523 FreeIdentifier(memberID);
12524 }
12525 break;
12526 }
12527 case 10:
12528 {
12529 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12530
12531 FreeExpContents(exp);
12532 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12533 exp->type = 2;
12534 FreeType(type);
12535 break;
12536 }
12537 case 15:
12538 {
12539 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12540
12541 if(classSym && classSym->__anon1.registered)
12542 {
12543 if(classSym->__anon1.registered->fixed)
12544 {
12545 FreeSpecifier(exp->__anon1._class);
12546 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12547 exp->type = 2;
12548 }
12549 else
12550 {
12551 char className[1024];
12552
12553 strcpy(className, "__ecereClass_");
12554 FullClassNameCat(className, classSym->string, 1);
12555 DeclareClass(classSym, className);
12556 FreeExpContents(exp);
12557 exp->type = 9;
12558 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12559 exp->__anon1.member.member = MkIdentifier("structSize");
12560 }
12561 }
12562 break;
12563 }
12564 case 11:
12565 {
12566 struct Type * type;
12567 struct Expression * e = exp;
12568
12569 if(exp->type == 11)
12570 {
12571 if(exp->__anon1.cast.exp)
12572 ComputeExpression(exp->__anon1.cast.exp);
12573 e = exp->__anon1.cast.exp;
12574 }
12575 if(e && exp->expType)
12576 {
12577 type = exp->expType;
12578 if(type->kind == 8)
12579 {
12580 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12581
12582 if(_class && (_class->type == 3 || _class->type == 2))
12583 {
12584 if(!_class->dataType)
12585 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12586 type = _class->dataType;
12587 }
12588 }
12589 switch(type->kind)
12590 {
12591 case 24:
12592 case 1:
12593 if(type->isSigned)
12594 {
12595 char value = (char)0;
12596
12597 if(GetChar(e, &value))
12598 {
12599 FreeExpContents(exp);
12600 exp->__anon1.__anon1.constant = PrintChar(value);
12601 exp->type = 2;
12602 }
12603 }
12604 else
12605 {
12606 unsigned char value = (unsigned char)0;
12607
12608 if(GetUChar(e, &value))
12609 {
12610 FreeExpContents(exp);
12611 exp->__anon1.__anon1.constant = PrintUChar(value);
12612 exp->type = 2;
12613 }
12614 }
12615 break;
12616 case 2:
12617 if(type->isSigned)
12618 {
12619 short value = (short)0;
12620
12621 if(GetShort(e, &value))
12622 {
12623 FreeExpContents(exp);
12624 exp->__anon1.__anon1.constant = PrintShort(value);
12625 exp->type = 2;
12626 }
12627 }
12628 else
12629 {
12630 unsigned short value = (unsigned short)0;
12631
12632 if(GetUShort(e, &value))
12633 {
12634 FreeExpContents(exp);
12635 exp->__anon1.__anon1.constant = PrintUShort(value);
12636 exp->type = 2;
12637 }
12638 }
12639 break;
12640 case 3:
12641 if(type->isSigned)
12642 {
12643 int value = 0;
12644
12645 if(GetInt(e, &value))
12646 {
12647 FreeExpContents(exp);
12648 exp->__anon1.__anon1.constant = PrintInt(value);
12649 exp->type = 2;
12650 }
12651 }
12652 else
12653 {
12654 unsigned int value = 0;
12655
12656 if(GetUInt(e, &value))
12657 {
12658 FreeExpContents(exp);
12659 exp->__anon1.__anon1.constant = PrintUInt(value);
12660 exp->type = 2;
12661 }
12662 }
12663 break;
12664 case 4:
12665 if(type->isSigned)
12666 {
12667 long long value = 0;
12668
12669 if(GetInt64(e, &value))
12670 {
12671 FreeExpContents(exp);
12672 exp->__anon1.__anon1.constant = PrintInt64(value);
12673 exp->type = 2;
12674 }
12675 }
12676 else
12677 {
12678 uint64 value = 0;
12679
12680 if(GetUInt64(e, &value))
12681 {
12682 FreeExpContents(exp);
12683 exp->__anon1.__anon1.constant = PrintUInt64(value);
12684 exp->type = 2;
12685 }
12686 }
12687 break;
12688 case 22:
12689 if(type->isSigned)
12690 {
12691 intptr_t value = 0;
12692
12693 if(GetIntPtr(e, &value))
12694 {
12695 FreeExpContents(exp);
12696 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12697 exp->type = 2;
12698 }
12699 }
12700 else
12701 {
12702 uintptr_t value = 0;
12703
12704 if(GetUIntPtr(e, &value))
12705 {
12706 FreeExpContents(exp);
12707 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12708 exp->type = 2;
12709 }
12710 }
12711 break;
12712 case 23:
12713 if(type->isSigned)
12714 {
12715 ssize_t value = 0;
12716
12717 if(GetIntSize(e, &value))
12718 {
12719 FreeExpContents(exp);
12720 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12721 exp->type = 2;
12722 }
12723 }
12724 else
12725 {
12726 size_t value = 0;
12727
12728 if(GetUIntSize(e, &value))
12729 {
12730 FreeExpContents(exp);
12731 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12732 exp->type = 2;
12733 }
12734 }
12735 break;
12736 case 6:
12737 {
12738 float value = 0;
12739
12740 if(GetFloat(e, &value))
12741 {
12742 FreeExpContents(exp);
12743 exp->__anon1.__anon1.constant = PrintFloat(value);
12744 exp->type = 2;
12745 }
12746 break;
12747 }
12748 case 7:
12749 {
12750 double value = 0;
12751
12752 if(GetDouble(e, &value))
12753 {
12754 FreeExpContents(exp);
12755 exp->__anon1.__anon1.constant = PrintDouble(value);
12756 exp->type = 2;
12757 }
12758 break;
12759 }
12760 }
12761 }
12762 break;
12763 }
12764 case 12:
12765 {
12766 struct Operand op1 =
12767 {
12768 0, 0, 0,
12769 .__anon1 = {
12770 .c = 0
12771 },
12772 {
12773 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12774 }
12775 };
12776 struct Operand op2 =
12777 {
12778 0, 0, 0,
12779 .__anon1 = {
12780 .c = 0
12781 },
12782 {
12783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12784 }
12785 };
12786 struct Operand op3 =
12787 {
12788 0, 0, 0,
12789 .__anon1 = {
12790 .c = 0
12791 },
12792 {
12793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12794 }
12795 };
12796
12797 if(exp->__anon1.cond.exp)
12798 ComputeExpression((*exp->__anon1.cond.exp).last);
12799 if(exp->__anon1.cond.elseExp)
12800 ComputeExpression(exp->__anon1.cond.elseExp);
12801 if(exp->__anon1.cond.cond)
12802 ComputeExpression(exp->__anon1.cond.cond);
12803 op1 = GetOperand(exp->__anon1.cond.cond);
12804 if(op1.type)
12805 op1.type->refCount++;
12806 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12807 if(op2.type)
12808 op2.type->refCount++;
12809 op3 = GetOperand(exp->__anon1.cond.elseExp);
12810 if(op3.type)
12811 op3.type->refCount++;
12812 if(op1.ops.Cond)
12813 {
12814 FreeExpContents(exp);
12815 op1.ops.Cond(exp, &op1, &op2, &op3);
12816 }
12817 if(op1.type)
12818 FreeType(op1.type);
12819 if(op2.type)
12820 FreeType(op2.type);
12821 if(op3.type)
12822 FreeType(op3.type);
12823 break;
12824 }
12825 }
12826 }
12827
12828 void ApplyAnyObjectLogic(struct Expression * e);
12829
12830 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12831 {
12832 unsigned int result = 1;
12833
12834 if(destType)
12835 {
12836 struct __ecereNameSpace__ecere__sys__OldList converts =
12837 {
12838 0, 0, 0, 0, 0
12839 };
12840 struct Conversion * convert;
12841
12842 if(destType->kind == 0)
12843 return 0;
12844 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12845 result = 0;
12846 if(converts.count)
12847 {
12848 for(convert = converts.first; convert; convert = convert->next)
12849 {
12850 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12851
12852 if(!empty)
12853 {
12854 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12855 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12856
12857 *newExp = *exp;
12858 newExp->prev = (((void *)0));
12859 newExp->next = (((void *)0));
12860 newExp->destType = (((void *)0));
12861 if(convert->isGet)
12862 {
12863 exp->type = 8;
12864 exp->addedThis = 1;
12865 exp->__anon1.member.exp = newExp;
12866 FreeType(exp->__anon1.member.exp->expType);
12867 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12868 exp->__anon1.member.exp->expType->classObjectType = objectType;
12869 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12870 exp->__anon1.member.memberType = 1;
12871 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12872 exp->needCast = 1;
12873 if(exp->expType)
12874 exp->expType->refCount++;
12875 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12876 }
12877 else
12878 {
12879 {
12880 exp->type = 8;
12881 exp->addedThis = 1;
12882 exp->__anon1.member.exp = newExp;
12883 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)
12884 {
12885 newExp->byReference = 1;
12886 }
12887 FreeType(exp->__anon1.member.exp->expType);
12888 exp->__anon1.member.exp->expType = (((void *)0));
12889 if(convert->convert->dataType)
12890 {
12891 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12892 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12893 exp->__anon1.member.exp->expType->refCount = 1;
12894 exp->__anon1.member.exp->expType->classObjectType = objectType;
12895 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12896 }
12897 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12898 exp->__anon1.member.memberType = 4;
12899 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12900 exp->needCast = 1;
12901 if(convert->resultType)
12902 convert->resultType->refCount++;
12903 }
12904 }
12905 }
12906 else
12907 {
12908 FreeType(exp->expType);
12909 if(convert->isGet)
12910 {
12911 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12912 if(exp->destType->casted)
12913 exp->needCast = 1;
12914 if(exp->expType)
12915 exp->expType->refCount++;
12916 }
12917 else
12918 {
12919 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12920 if(exp->destType->casted)
12921 exp->needCast = 1;
12922 if(convert->resultType)
12923 convert->resultType->refCount++;
12924 }
12925 }
12926 }
12927 if(exp->isConstant && inCompiler)
12928 ComputeExpression(exp);
12929 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12930 }
12931 if(!result && exp->expType && converts.count)
12932 {
12933 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12934 }
12935 if(!result && exp->expType && exp->destType)
12936 {
12937 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))
12938 result = 1;
12939 }
12940 }
12941 return result;
12942 }
12943
12944 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12945
12946 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12947
12948 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12949
12950 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12951
12952 void CheckTemplateTypes(struct Expression * exp)
12953 {
12954 struct Expression * nbExp = GetNonBracketsExp(exp);
12955
12956 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12957 {
12958 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12959 struct Context * context;
12960
12961 *newExp = *exp;
12962 if(exp->destType)
12963 exp->destType->refCount++;
12964 if(exp->expType)
12965 exp->expType->refCount++;
12966 newExp->prev = (((void *)0));
12967 newExp->next = (((void *)0));
12968 switch(exp->expType->kind)
12969 {
12970 case 7:
12971 if(exp->destType->classObjectType)
12972 {
12973 if(exp->destType)
12974 exp->destType->refCount--;
12975 if(exp->expType)
12976 exp->expType->refCount--;
12977 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12978 }
12979 else
12980 {
12981 struct __ecereNameSpace__ecere__sys__OldList * specs;
12982 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12983 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12984
12985 context = PushContext();
12986 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12987 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12988 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12989 exp->type = 23;
12990 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12991 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12992 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12993 exp->__anon1.compound->__anon1.compound.context = context;
12994 PopContext(context);
12995 }
12996 break;
12997 default:
12998 exp->type = 11;
12999 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
13000 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13001 exp->needCast = 1;
13002 break;
13003 }
13004 }
13005 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
13006 {
13007 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13008 struct Context * context;
13009
13010 *newExp = *exp;
13011 if(exp->destType)
13012 exp->destType->refCount++;
13013 if(exp->expType)
13014 exp->expType->refCount++;
13015 newExp->prev = (((void *)0));
13016 newExp->next = (((void *)0));
13017 switch(exp->expType->kind)
13018 {
13019 case 7:
13020 if(exp->destType->classObjectType)
13021 {
13022 if(exp->destType)
13023 exp->destType->refCount--;
13024 if(exp->expType)
13025 exp->expType->refCount--;
13026 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13027 }
13028 else
13029 {
13030 struct __ecereNameSpace__ecere__sys__OldList * specs;
13031 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13032 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13033
13034 context = PushContext();
13035 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13036 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13037 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13038 exp->type = 23;
13039 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13040 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13041 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13042 exp->__anon1.compound->__anon1.compound.context = context;
13043 PopContext(context);
13044 }
13045 break;
13046 case 8:
13047 {
13048 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13049 {
13050 exp->type = 5;
13051 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)));
13052 ProcessExpressionType((*exp->__anon1.list).first);
13053 break;
13054 }
13055 else
13056 {
13057 exp->type = 5;
13058 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13059 exp->needTemplateCast = 2;
13060 newExp->needCast = 1;
13061 newExp->needTemplateCast = 2;
13062 ProcessExpressionType((*exp->__anon1.list).first);
13063 break;
13064 }
13065 }
13066 default:
13067 {
13068 if(exp->expType->kind == 20)
13069 {
13070 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13071
13072 if(type)
13073 {
13074 FreeType(exp->destType);
13075 FreeType(exp->expType);
13076 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13077 break;
13078 }
13079 }
13080 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13081 {
13082 exp->type = 4;
13083 exp->__anon1.op.op = '*';
13084 exp->__anon1.op.exp1 = (((void *)0));
13085 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13086 }
13087 else
13088 {
13089 char typeString[1024];
13090 struct Declarator * decl;
13091 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13092
13093 typeString[0] = '\0';
13094 PrintType(exp->expType, typeString, 0, 0);
13095 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13096 exp->type = 11;
13097 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13098 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13099 exp->__anon1.cast.exp->needCast = 1;
13100 }
13101 break;
13102 }
13103 }
13104 }
13105 }
13106
13107 extern int strncmp(const char * , const char * , size_t n);
13108
13109 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13110
13111 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13112 {
13113 int nsLen = strlen(nameSpace);
13114 struct Symbol * symbol;
13115
13116 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)))
13117 {
13118 char * s = symbol->string;
13119
13120 if(!strncmp(s, nameSpace, nsLen))
13121 {
13122 int c;
13123 char * namePart;
13124
13125 for(c = strlen(s) - 1; c >= 0; c--)
13126 if(s[c] == ':')
13127 break;
13128 namePart = s + c + 1;
13129 if(!strcmp(namePart, name))
13130 {
13131 return symbol;
13132 }
13133 }
13134 else
13135 break;
13136 }
13137 return (((void *)0));
13138 }
13139
13140 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13141 {
13142 int c;
13143 char nameSpace[1024];
13144 const char * namePart;
13145 unsigned int gotColon = 0;
13146
13147 nameSpace[0] = '\0';
13148 for(c = strlen(name) - 1; c >= 0; c--)
13149 if(name[c] == ':')
13150 {
13151 gotColon = 1;
13152 break;
13153 }
13154 namePart = name + c + 1;
13155 while(c >= 0 && name[c] == ':')
13156 c--;
13157 if(c >= 0)
13158 {
13159 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13160
13161 if(symbol)
13162 return symbol;
13163 memcpy(nameSpace, name, c + 1);
13164 nameSpace[c + 1] = (char)0;
13165 return ScanWithNameSpace(tree, nameSpace, namePart);
13166 }
13167 else if(gotColon)
13168 {
13169 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13170
13171 return symbol;
13172 }
13173 else
13174 {
13175 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13176
13177 if(symbol)
13178 return symbol;
13179 return ScanWithNameSpace(tree, "", namePart);
13180 }
13181 return (((void *)0));
13182 }
13183
13184 static void ProcessDeclaration(struct Declaration * decl);
13185
13186 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13187 {
13188 struct Context * ctx;
13189 struct Symbol * symbol = (((void *)0));
13190
13191 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13192 {
13193 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13194 {
13195 symbol = (((void *)0));
13196 if(thisNameSpace)
13197 {
13198 char curName[1024];
13199
13200 strcpy(curName, thisNameSpace);
13201 strcat(curName, "::");
13202 strcat(curName, name);
13203 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13204 }
13205 if(!symbol)
13206 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13207 }
13208 else
13209 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13210 if(symbol || ctx == endContext)
13211 break;
13212 }
13213 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13214 {
13215 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13216 {
13217 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13218 struct Context * tmpContext = curContext;
13219
13220 curContext = (((void *)0));
13221 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13222 curContext = tmpContext;
13223 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13224 DeclareType(symbol->type, 1, 1);
13225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13226 symbol->id = curExternal->symbol->idCode;
13227 }
13228 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13229 {
13230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13231 symbol->id = curExternal->symbol->idCode;
13232 }
13233 }
13234 return symbol;
13235 }
13236
13237 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13238 {
13239 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13240 ListAdd(specs, MkSpecifier(UNSIGNED));
13241 switch(type->kind)
13242 {
13243 case 8:
13244 {
13245 if(type->__anon1._class->__anon1.registered)
13246 {
13247 if(!type->__anon1._class->__anon1.registered->dataType)
13248 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13249 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13250 }
13251 break;
13252 }
13253 case 7:
13254 ListAdd(specs, MkSpecifier(DOUBLE));
13255 break;
13256 case 6:
13257 ListAdd(specs, MkSpecifier(FLOAT));
13258 break;
13259 case 1:
13260 ListAdd(specs, MkSpecifier(CHAR));
13261 break;
13262 case 24:
13263 ListAdd(specs, MkSpecifier(_BOOL));
13264 break;
13265 case 2:
13266 ListAdd(specs, MkSpecifier(SHORT));
13267 break;
13268 case 4:
13269 ListAdd(specs, MkSpecifier(INT64));
13270 break;
13271 case 22:
13272 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13273 break;
13274 case 23:
13275 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13276 break;
13277 case 3:
13278 default:
13279 ListAdd(specs, MkSpecifier(INT));
13280 break;
13281 }
13282 }
13283
13284 static void PrintArraySize(struct Type * arrayType, char * string)
13285 {
13286 char size[256];
13287
13288 size[0] = '\0';
13289 strcat(size, "[");
13290 if(arrayType->__anon1.__anon4.enumClass)
13291 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13292 else if(arrayType->__anon1.__anon4.arraySizeExp)
13293 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13294 strcat(size, "]");
13295 strcat(string, size);
13296 }
13297
13298 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13299 {
13300 if(type)
13301 {
13302 if(printConst && type->constant)
13303 strcat(string, "const ");
13304 switch(type->kind)
13305 {
13306 case 8:
13307 {
13308 struct Symbol * c = type->__anon1._class;
13309
13310 if(type->classObjectType == 2)
13311 strcat(string, "typed_object");
13312 else if(type->classObjectType == 3)
13313 strcat(string, "any_object");
13314 else
13315 {
13316 if(c && c->string)
13317 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13318 }
13319 if(type->byReference)
13320 strcat(string, " &");
13321 break;
13322 }
13323 case 0:
13324 strcat(string, "void");
13325 break;
13326 case 3:
13327 strcat(string, type->isSigned ? "int" : "uint");
13328 break;
13329 case 4:
13330 strcat(string, type->isSigned ? "int64" : "uint64");
13331 break;
13332 case 22:
13333 strcat(string, type->isSigned ? "intptr" : "uintptr");
13334 break;
13335 case 23:
13336 strcat(string, type->isSigned ? "intsize" : "uintsize");
13337 break;
13338 case 1:
13339 strcat(string, type->isSigned ? "char" : "byte");
13340 break;
13341 case 24:
13342 strcat(string, "_Bool");
13343 break;
13344 case 2:
13345 strcat(string, type->isSigned ? "short" : "uint16");
13346 break;
13347 case 6:
13348 strcat(string, "float");
13349 break;
13350 case 7:
13351 strcat(string, "double");
13352 break;
13353 case 9:
13354 if(type->__anon1.__anon1.enumName)
13355 {
13356 strcat(string, "struct ");
13357 strcat(string, type->__anon1.__anon1.enumName);
13358 }
13359 else if(type->typeName)
13360 strcat(string, type->typeName);
13361 else
13362 {
13363 struct Type * member;
13364
13365 strcat(string, "struct { ");
13366 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13367 {
13368 PrintType(member, string, 1, fullName);
13369 strcat(string, "; ");
13370 }
13371 strcat(string, "}");
13372 }
13373 break;
13374 case 10:
13375 if(type->__anon1.__anon1.enumName)
13376 {
13377 strcat(string, "union ");
13378 strcat(string, type->__anon1.__anon1.enumName);
13379 }
13380 else if(type->typeName)
13381 strcat(string, type->typeName);
13382 else
13383 {
13384 strcat(string, "union ");
13385 strcat(string, "(unnamed)");
13386 }
13387 break;
13388 case 15:
13389 if(type->__anon1.__anon1.enumName)
13390 {
13391 strcat(string, "enum ");
13392 strcat(string, type->__anon1.__anon1.enumName);
13393 }
13394 else if(type->typeName)
13395 strcat(string, type->typeName);
13396 else
13397 strcat(string, "int");
13398 break;
13399 case 14:
13400 strcat(string, "...");
13401 break;
13402 case 19:
13403 strcat(string, "subclass(");
13404 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13405 strcat(string, ")");
13406 break;
13407 case 20:
13408 strcat(string, type->__anon1.templateParameter->identifier->string);
13409 break;
13410 case 21:
13411 strcat(string, "thisclass");
13412 break;
13413 case 17:
13414 strcat(string, "__builtin_va_list");
13415 break;
13416 }
13417 }
13418 }
13419
13420 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13421
13422 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13423 {
13424 if(type->name && type->name[0])
13425 {
13426 if(fullName)
13427 strcat(string, type->name);
13428 else
13429 {
13430 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13431
13432 if(name)
13433 name += 2;
13434 else
13435 name = type->name;
13436 strcat(string, name);
13437 }
13438 }
13439 }
13440
13441 static void PrintAttribs(struct Type * type, char * string)
13442 {
13443 if(type)
13444 {
13445 if(type->dllExport)
13446 strcat(string, "dllexport ");
13447 if(type->attrStdcall)
13448 strcat(string, "stdcall ");
13449 }
13450 }
13451
13452 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13453 {
13454 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13455 {
13456 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13457 PrintAttribs(type, string);
13458 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13459 strcat(string, " const");
13460 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13461 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13462 strcat(string, " (");
13463 if(type->kind == 13)
13464 {
13465 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13466 PrintAttribs(type->__anon1.type, string);
13467 }
13468 if(type->kind == 13)
13469 {
13470 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13471 strcat(string, "*");
13472 else
13473 strcat(string, " *");
13474 }
13475 if(printConst && type->constant && type->kind == 13)
13476 strcat(string, " const");
13477 }
13478 else
13479 PrintTypeSpecs(type, string, fullName, printConst);
13480 }
13481
13482 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13483 {
13484 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13485 strcat(string, ")");
13486 if(type->kind == 12)
13487 PrintArraySize(type, string);
13488 else if(type->kind == 11)
13489 {
13490 struct Type * param;
13491
13492 strcat(string, "(");
13493 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13494 {
13495 PrintType(param, string, 1, fullName);
13496 if(param->next)
13497 strcat(string, ", ");
13498 }
13499 strcat(string, ")");
13500 }
13501 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13502 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13503 }
13504
13505 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13506 {
13507 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13508 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13509 strcat(string, " ");
13510 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13511 {
13512 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13513
13514 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13515 {
13516 if(type->classObjectType == 1)
13517 strcat(string, "class");
13518 else
13519 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13520 }
13521 else if(_class && _class->string)
13522 {
13523 char * s = _class->string;
13524
13525 if(fullName)
13526 strcat(string, s);
13527 else
13528 {
13529 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13530
13531 if(name)
13532 name += 2;
13533 else
13534 name = s;
13535 strcat(string, name);
13536 }
13537 }
13538 strcat(string, "::");
13539 }
13540 if(printName && type->name)
13541 PrintName(type, string, fullName);
13542 PostPrintType(type, string, fullName);
13543 if(type->bitFieldCount)
13544 {
13545 char count[100];
13546
13547 sprintf(count, ":%d", type->bitFieldCount);
13548 strcat(string, count);
13549 }
13550 }
13551
13552 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13553 {
13554 _PrintType(type, string, printName, fullName, 1);
13555 }
13556
13557 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13558 {
13559 _PrintType(type, string, printName, fullName, 0);
13560 }
13561
13562 static struct Type * FindMember(struct Type * type, char * string)
13563 {
13564 struct Type * memberType;
13565
13566 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13567 {
13568 if(!memberType->name)
13569 {
13570 struct Type * subType = FindMember(memberType, string);
13571
13572 if(subType)
13573 return subType;
13574 }
13575 else if(!strcmp(memberType->name, string))
13576 return memberType;
13577 }
13578 return (((void *)0));
13579 }
13580
13581 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13582 {
13583 struct Type * memberType;
13584
13585 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13586 {
13587 if(!memberType->name)
13588 {
13589 struct Type * subType = FindMember(memberType, string);
13590
13591 if(subType)
13592 {
13593 *offset += memberType->offset;
13594 return subType;
13595 }
13596 }
13597 else if(!strcmp(memberType->name, string))
13598 {
13599 *offset += memberType->offset;
13600 return memberType;
13601 }
13602 }
13603 return (((void *)0));
13604 }
13605
13606 extern unsigned int parseError;
13607
13608 unsigned int GetParseError()
13609 {
13610 return parseError;
13611 }
13612
13613 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13614
13615 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13616
13617 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13618
13619 struct Expression * ParseExpressionString(char * expression)
13620 {
13621 parseError = 0;
13622 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13623 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13624 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13625
13626 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13627 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13628 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13629 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13630
13631 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13632 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13633 echoOn = 0;
13634 parsedExpression = (((void *)0));
13635 resetScanner();
13636 expression_yyparse();
13637 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13638 return parsedExpression;
13639 }
13640
13641 extern char *  QMkString(const char *  source);
13642
13643 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13644 {
13645 struct Identifier * id = exp->__anon1.__anon1.identifier;
13646 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13647 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13648 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13649 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13650
13651 if(_class && _class->type == 4)
13652 {
13653 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13654 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13655
13656 if(enumClass)
13657 {
13658 struct __ecereNameSpace__ecere__com__Class * baseClass;
13659
13660 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13661 {
13662 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13663
13664 for(value = e->values.first; value; value = value->next)
13665 {
13666 if(!strcmp(value->name, id->string))
13667 break;
13668 }
13669 if(value)
13670 {
13671 char constant[256];
13672
13673 FreeExpContents(exp);
13674 exp->type = 2;
13675 exp->isConstant = 1;
13676 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13677 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13678 else
13679 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13680 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13681 exp->expType = MkClassType(baseClass->fullName);
13682 break;
13683 }
13684 }
13685 }
13686 if(value)
13687 return 1;
13688 }
13689 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13690 {
13691 ProcessMethodType(method);
13692 exp->expType = __extension__ ({
13693 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13694
13695 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13696 });
13697 return 1;
13698 }
13699 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13700 {
13701 if(!prop->dataType)
13702 ProcessPropertyType(prop);
13703 exp->expType = prop->dataType;
13704 if(prop->dataType)
13705 prop->dataType->refCount++;
13706 return 1;
13707 }
13708 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13709 {
13710 if(!member->dataType)
13711 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13712 exp->expType = member->dataType;
13713 if(member->dataType)
13714 member->dataType->refCount++;
13715 return 1;
13716 }
13717 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13718 {
13719 if(!classProp->dataType)
13720 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13721 if(classProp->constant)
13722 {
13723 FreeExpContents(exp);
13724 exp->isConstant = 1;
13725 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13726 {
13727 exp->type = 3;
13728 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13729 }
13730 else
13731 {
13732 char constant[256];
13733
13734 exp->type = 2;
13735 sprintf(constant, "%d", (int)classProp->Get(_class));
13736 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13737 }
13738 }
13739 else
13740 {
13741 }
13742 exp->expType = classProp->dataType;
13743 if(classProp->dataType)
13744 classProp->dataType->refCount++;
13745 return 1;
13746 }
13747 return 0;
13748 }
13749
13750 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13751 {
13752 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13753 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13754 struct __ecereNameSpace__ecere__com__NameSpace * child;
13755
13756 if(!data)
13757 {
13758 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)))
13759 {
13760 data = ScanGlobalData(child, name);
13761 if(data)
13762 break;
13763 }
13764 }
13765 return data;
13766 }
13767
13768 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13769
13770 extern char *  strncpy(char * , const char * , size_t n);
13771
13772 static struct GlobalData * FindGlobalData(char * name)
13773 {
13774 int start = 0, c;
13775 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13776
13777 nameSpace = globalData;
13778 for(c = 0; name[c]; c++)
13779 {
13780 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13781 {
13782 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13783 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13784
13785 strncpy(spaceName, name + start, c - start);
13786 spaceName[c - start] = '\0';
13787 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13788 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13789 if(!newSpace)
13790 return (((void *)0));
13791 nameSpace = newSpace;
13792 if(name[c] == ':')
13793 c++;
13794 start = c + 1;
13795 }
13796 }
13797 if(c - start)
13798 {
13799 return ScanGlobalData(nameSpace, name + start);
13800 }
13801 return (((void *)0));
13802 }
13803
13804 static int definedExpStackPos;
13805
13806 static void * definedExpStack[512];
13807
13808 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13809 {
13810 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13811
13812 FreeExpContents(checkedExp);
13813 FreeType(checkedExp->expType);
13814 FreeType(checkedExp->destType);
13815 *checkedExp = *newExp;
13816 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13817 checkedExp->prev = prev;
13818 checkedExp->next = next;
13819 }
13820
13821 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13822
13823 extern int printf(const char * , ...);
13824
13825 void __ecereMethod_Expression_Clear();
13826
13827 void ApplyAnyObjectLogic(struct Expression * e)
13828 {
13829 struct Type * destType = e->destType;
13830
13831 if(destType && (destType->classObjectType == 3))
13832 {
13833 if(e && e->expType)
13834 {
13835 struct Type * type = e->expType;
13836 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13837
13838 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13839 {
13840 _class = type->__anon1._class->__anon1.registered;
13841 }
13842 else if(type->kind == 19)
13843 {
13844 _class = FindClass("ecere::com::Class")->__anon1.registered;
13845 }
13846 else
13847 {
13848 char string[1024] = "";
13849 struct Symbol * classSym;
13850
13851 PrintTypeNoConst(type, string, 0, 1);
13852 classSym = FindClass(string);
13853 if(classSym)
13854 _class = classSym->__anon1.registered;
13855 }
13856 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)))
13857 {
13858 if(!_class || strcmp(_class->fullName, "char *"))
13859 {
13860 struct Expression * checkedExp = e, * newExp;
13861
13862 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13863 {
13864 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13865 {
13866 if(checkedExp->type == 23)
13867 {
13868 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13869 }
13870 else
13871 checkedExp = (*checkedExp->__anon1.list).last;
13872 }
13873 else if(checkedExp->type == 11)
13874 checkedExp = checkedExp->__anon1.cast.exp;
13875 }
13876 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13877 {
13878 newExp = checkedExp->__anon1.op.exp2;
13879 checkedExp->__anon1.op.exp2 = (((void *)0));
13880 FreeExpContents(checkedExp);
13881 if(e->expType && e->expType->passAsTemplate)
13882 {
13883 char size[100];
13884
13885 ComputeTypeSize(e->expType);
13886 sprintf(size, "%d", e->expType->size);
13887 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))))));
13888 }
13889 ReplaceExpContents(checkedExp, newExp);
13890 e->byReference = 1;
13891 }
13892 else if(!e->byReference || (_class && _class->type == 5))
13893 {
13894 struct Expression * checkedExp;
13895
13896 {
13897 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;
13898
13899 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13900 {
13901 struct Context * context = PushContext();
13902 struct Declarator * decl;
13903 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13904 char typeString[1024];
13905 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13906
13907 typeString[0] = '\0';
13908 *newExp = *e;
13909 newExp->prev = (((void *)0));
13910 newExp->next = (((void *)0));
13911 newExp->expType = (((void *)0));
13912 PrintTypeNoConst(e->expType, typeString, 0, 1);
13913 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13914 newExp->destType = ProcessType(specs, decl);
13915 curContext = context;
13916 if(curCompound)
13917 {
13918 char name[100];
13919 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13920
13921 e->type = 23;
13922 sprintf(name, "__internalValue%03X", internalValueCounter++);
13923 if(!curCompound->__anon1.compound.declarations)
13924 curCompound->__anon1.compound.declarations = MkList();
13925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13926 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13927 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13928 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13929 }
13930 else
13931 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13932 {
13933 struct Type * type = e->destType;
13934
13935 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13936 CopyTypeInto(e->destType, type);
13937 e->destType->refCount = 1;
13938 e->destType->classObjectType = 0;
13939 FreeType(type);
13940 }
13941 e->__anon1.compound->__anon1.compound.context = context;
13942 PopContext(context);
13943 curContext = context->parent;
13944 }
13945 }
13946 checkedExp = e;
13947 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13948 {
13949 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13950 {
13951 if(checkedExp->type == 23)
13952 {
13953 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13954 }
13955 else
13956 checkedExp = (*checkedExp->__anon1.list).last;
13957 }
13958 else if(checkedExp->type == 11)
13959 checkedExp = checkedExp->__anon1.cast.exp;
13960 }
13961 {
13962 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13963
13964 *operand = *checkedExp;
13965 __ecereMethod_Expression_Clear(checkedExp);
13966 checkedExp->destType = ProcessTypeString("void *", 0);
13967 checkedExp->expType = checkedExp->destType;
13968 checkedExp->destType->refCount++;
13969 checkedExp->type = 4;
13970 checkedExp->__anon1.op.op = '&';
13971 checkedExp->__anon1.op.exp1 = (((void *)0));
13972 checkedExp->__anon1.op.exp2 = operand;
13973 }
13974 }
13975 }
13976 }
13977 }
13978 }
13979 {
13980 }
13981 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))))
13982 {
13983 if(e->expType->classObjectType && destType && destType->classObjectType)
13984 {
13985 return ;
13986 }
13987 else
13988 {
13989 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13990
13991 *thisExp = *e;
13992 thisExp->prev = (((void *)0));
13993 thisExp->next = (((void *)0));
13994 __ecereMethod_Expression_Clear(e);
13995 e->type = 5;
13996 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13997 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13998 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13999 {
14000 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14001 CopyTypeInto(e->expType, thisExp->expType);
14002 e->expType->byReference = 0;
14003 e->expType->refCount = 1;
14004 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))
14005 {
14006 e->expType->classObjectType = 0;
14007 }
14008 }
14009 }
14010 }
14011 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
14012 {
14013 if(destType->kind == 14)
14014 {
14015 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
14016 }
14017 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))
14018 {
14019 unsigned int byReference = e->expType->byReference;
14020 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14021 struct Declarator * decl;
14022 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14023 char typeString[1024];
14024 struct Type * type;
14025 int backupClassObjectType;
14026 unsigned int backupByReference;
14027
14028 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
14029 type = e->expType;
14030 else
14031 type = destType;
14032 backupClassObjectType = type->classObjectType;
14033 backupByReference = type->byReference;
14034 type->classObjectType = 0;
14035 type->byReference = 0;
14036 typeString[0] = '\0';
14037 PrintType(type, typeString, 0, 1);
14038 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14039 type->classObjectType = backupClassObjectType;
14040 type->byReference = backupByReference;
14041 *thisExp = *e;
14042 thisExp->prev = (((void *)0));
14043 thisExp->next = (((void *)0));
14044 __ecereMethod_Expression_Clear(e);
14045 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)))
14046 {
14047 e->type = 4;
14048 e->__anon1.op.op = '*';
14049 e->__anon1.op.exp1 = (((void *)0));
14050 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14051 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14052 CopyTypeInto(e->expType, type);
14053 e->expType->byReference = 0;
14054 e->expType->refCount = 1;
14055 }
14056 else
14057 {
14058 e->type = 11;
14059 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14060 e->__anon1.cast.exp = thisExp;
14061 e->byReference = 1;
14062 e->expType = type;
14063 type->refCount++;
14064 }
14065 e->destType = destType;
14066 destType->refCount++;
14067 }
14068 }
14069 }
14070
14071 void ApplyLocation(struct Expression * exp, struct Location * loc)
14072 {
14073 exp->loc = *loc;
14074 switch(exp->type)
14075 {
14076 case 4:
14077 if(exp->__anon1.op.exp1)
14078 ApplyLocation(exp->__anon1.op.exp1, loc);
14079 if(exp->__anon1.op.exp2)
14080 ApplyLocation(exp->__anon1.op.exp2, loc);
14081 break;
14082 case 5:
14083 if(exp->__anon1.list)
14084 {
14085 struct Expression * e;
14086
14087 for(e = (*exp->__anon1.list).first; e; e = e->next)
14088 ApplyLocation(e, loc);
14089 }
14090 break;
14091 case 6:
14092 if(exp->__anon1.index.index)
14093 {
14094 struct Expression * e;
14095
14096 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14097 ApplyLocation(e, loc);
14098 }
14099 if(exp->__anon1.index.exp)
14100 ApplyLocation(exp->__anon1.index.exp, loc);
14101 break;
14102 case 7:
14103 if(exp->__anon1.call.arguments)
14104 {
14105 struct Expression * arg;
14106
14107 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14108 ApplyLocation(arg, loc);
14109 }
14110 if(exp->__anon1.call.exp)
14111 ApplyLocation(exp->__anon1.call.exp, loc);
14112 break;
14113 case 8:
14114 case 9:
14115 if(exp->__anon1.member.exp)
14116 ApplyLocation(exp->__anon1.member.exp, loc);
14117 break;
14118 case 11:
14119 if(exp->__anon1.cast.exp)
14120 ApplyLocation(exp->__anon1.cast.exp, loc);
14121 break;
14122 case 12:
14123 if(exp->__anon1.cond.exp)
14124 {
14125 struct Expression * e;
14126
14127 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14128 ApplyLocation(e, loc);
14129 }
14130 if(exp->__anon1.cond.cond)
14131 ApplyLocation(exp->__anon1.cond.cond, loc);
14132 if(exp->__anon1.cond.elseExp)
14133 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14134 break;
14135 case 34:
14136 if(exp->__anon1.vaArg.exp)
14137 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14138 break;
14139 default:
14140 break;
14141 }
14142 }
14143
14144 extern char *  strstr(const char * , const char * );
14145
14146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14147
14148 struct __ecereNameSpace__ecere__com__DefinedExpression
14149 {
14150 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14151 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14152 const char *  name;
14153 const char *  value;
14154 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14155 } __attribute__ ((gcc_struct));
14156
14157 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14158
14159 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14160
14161 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14162
14163 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14164
14165 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14166
14167 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14168
14169 static void ProcessStatement(struct Statement * stmt);
14170
14171 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14172
14173 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14174
14175 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14176
14177 extern const char *  sourceFile;
14178
14179 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
14180
14181 extern struct Expression * MoveExpContents(struct Expression * exp);
14182
14183 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14184
14185 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
14186
14187 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14188
14189 void ProcessExpressionType(struct Expression * exp)
14190 {
14191 unsigned int unresolved = 0;
14192 struct Location oldyylloc = yylloc;
14193 unsigned int notByReference = 0;
14194
14195 if(!exp || exp->expType)
14196 return ;
14197 yylloc = exp->loc;
14198 switch(exp->type)
14199 {
14200 case 0:
14201 {
14202 struct Identifier * id = exp->__anon1.__anon1.identifier;
14203
14204 if(!id || !topContext)
14205 return ;
14206 if(id->_class && id->_class->__anon1.__anon1.name)
14207 {
14208 id->classSym = id->_class->__anon1.__anon1.symbol;
14209 }
14210 if(!strcmp(id->string, "__runtimePlatform"))
14211 {
14212 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14213 break;
14214 }
14215 else if(strstr(id->string, "__ecereClass") == id->string)
14216 {
14217 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14218 break;
14219 }
14220 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14221 {
14222 ReplaceClassMembers(exp, thisClass);
14223 if(exp->type != 0)
14224 {
14225 ProcessExpressionType(exp);
14226 break;
14227 }
14228 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14229 break;
14230 }
14231 else
14232 {
14233 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14234
14235 if(!symbol)
14236 {
14237 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14238 break;
14239 else
14240 {
14241 if(thisClass)
14242 {
14243 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14244 if(exp->type != 0)
14245 {
14246 ProcessExpressionType(exp);
14247 break;
14248 }
14249 }
14250 else if(currentClass && !id->_class)
14251 {
14252 if(ResolveIdWithClass(exp, currentClass, 1))
14253 break;
14254 }
14255 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14256 }
14257 }
14258 if(symbol)
14259 {
14260 struct Type * type = symbol->type;
14261 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14262
14263 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14264 {
14265 struct Context * context = SetupTemplatesContext(_class);
14266
14267 type = ReplaceThisClassType(_class);
14268 FinishTemplatesContext(context);
14269 if(type)
14270 type->refCount = 0;
14271 }
14272 FreeSpecifier(id->_class);
14273 id->_class = (((void *)0));
14274 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14275 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14276 id->classSym = (((void *)0));
14277 exp->expType = type;
14278 if(type)
14279 type->refCount++;
14280 if(type && (type->kind == 15))
14281 exp->isConstant = 1;
14282 if(symbol->isParam || !strcmp(id->string, "this"))
14283 {
14284 if(_class && _class->type == 1 && !type->declaredWithStruct)
14285 exp->byReference = 1;
14286 }
14287 if(symbol->isIterator)
14288 {
14289 if(symbol->isIterator == 3)
14290 {
14291 exp->type = 5;
14292 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14293 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14294 exp->expType = (((void *)0));
14295 ProcessExpressionType(exp);
14296 }
14297 else if(symbol->isIterator != 4)
14298 {
14299 exp->type = 8;
14300 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14301 exp->__anon1.member.exp->expType = exp->expType;
14302 exp->__anon1.member.member = MkIdentifier("data");
14303 exp->expType = (((void *)0));
14304 ProcessExpressionType(exp);
14305 }
14306 }
14307 break;
14308 }
14309 else
14310 {
14311 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14312
14313 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14314 {
14315 char name[1024];
14316
14317 strcpy(name, thisNameSpace);
14318 strcat(name, "::");
14319 strcat(name, id->string);
14320 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14321 }
14322 if(!definedExp)
14323 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14324 if(definedExp)
14325 {
14326 int c;
14327
14328 for(c = 0; c < definedExpStackPos; c++)
14329 if(definedExpStack[c] == definedExp)
14330 break;
14331 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14332 {
14333 struct Location backupYylloc = yylloc;
14334 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14335
14336 definedExpStack[definedExpStackPos++] = definedExp;
14337 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14338 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14339 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14340
14341 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14342 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14343 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14344 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14345
14346 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14347 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14348 echoOn = 0;
14349 parsedExpression = (((void *)0));
14350 resetScanner();
14351 expression_yyparse();
14352 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14353 if(backInput)
14354 fileInput = backInput;
14355 yylloc = backupYylloc;
14356 if(parsedExpression)
14357 {
14358 FreeIdentifier(id);
14359 exp->type = 5;
14360 exp->__anon1.list = MkListOne(parsedExpression);
14361 ApplyLocation(parsedExpression, &yylloc);
14362 ProcessExpressionType(exp);
14363 definedExpStackPos--;
14364 return ;
14365 }
14366 definedExpStackPos--;
14367 }
14368 else
14369 {
14370 if(inCompiler)
14371 {
14372 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14373 }
14374 }
14375 }
14376 else
14377 {
14378 struct GlobalData * data = (((void *)0));
14379
14380 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14381 {
14382 char name[1024];
14383
14384 strcpy(name, thisNameSpace);
14385 strcat(name, "::");
14386 strcat(name, id->string);
14387 data = FindGlobalData(name);
14388 }
14389 if(!data)
14390 data = FindGlobalData(id->string);
14391 if(data)
14392 {
14393 DeclareGlobalData(data);
14394 exp->expType = data->dataType;
14395 if(data->dataType)
14396 data->dataType->refCount++;
14397 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14398 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14399 FreeSpecifier(id->_class);
14400 id->_class = (((void *)0));
14401 break;
14402 }
14403 else
14404 {
14405 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14406
14407 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14408 {
14409 char name[1024];
14410
14411 strcpy(name, thisNameSpace);
14412 strcat(name, "::");
14413 strcat(name, id->string);
14414 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14415 }
14416 if(!function)
14417 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14418 if(function)
14419 {
14420 char name[1024];
14421
14422 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14423 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14424 name[0] = (char)0;
14425 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14426 strcpy(name, "__ecereFunction_");
14427 FullClassNameCat(name, id->string, 0);
14428 if(DeclareFunction(function, name))
14429 {
14430 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14431 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14432 }
14433 exp->expType = function->dataType;
14434 if(function->dataType)
14435 function->dataType->refCount++;
14436 FreeSpecifier(id->_class);
14437 id->_class = (((void *)0));
14438 break;
14439 }
14440 }
14441 }
14442 }
14443 }
14444 unresolved = 1;
14445 break;
14446 }
14447 case 1:
14448 {
14449 if(!exp->__anon1.instance->_class)
14450 {
14451 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14452 {
14453 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14454 }
14455 }
14456 ProcessInstantiationType(exp->__anon1.instance);
14457 exp->isConstant = exp->__anon1.instance->isConstant;
14458 if(exp->__anon1.instance->_class)
14459 {
14460 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14461 }
14462 break;
14463 }
14464 case 2:
14465 {
14466 if(!exp->expType)
14467 {
14468 char * constant = exp->__anon1.__anon1.constant;
14469 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14470
14471 exp->expType = type;
14472 if(constant[0] == '\'')
14473 {
14474 if((int)((unsigned char *)constant)[1] > 127)
14475 {
14476 int nb;
14477 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14478
14479 if(nb < 2)
14480 ch = constant[1];
14481 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14482 exp->__anon1.__anon1.constant = PrintUInt(ch);
14483 type->kind = 8;
14484 type->__anon1._class = FindClass("unichar");
14485 type->isSigned = 0;
14486 }
14487 else
14488 {
14489 type->kind = 1;
14490 type->isSigned = 1;
14491 }
14492 }
14493 else
14494 {
14495 char * dot = strchr(constant, '.');
14496 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14497 char * exponent;
14498
14499 if(isHex)
14500 {
14501 exponent = strchr(constant, 'p');
14502 if(!exponent)
14503 exponent = strchr(constant, 'P');
14504 }
14505 else
14506 {
14507 exponent = strchr(constant, 'e');
14508 if(!exponent)
14509 exponent = strchr(constant, 'E');
14510 }
14511 if(dot || exponent)
14512 {
14513 if(strchr(constant, 'f') || strchr(constant, 'F'))
14514 type->kind = 6;
14515 else
14516 type->kind = 7;
14517 type->isSigned = 1;
14518 }
14519 else
14520 {
14521 unsigned int isSigned = constant[0] == '-';
14522 char * endP = (((void *)0));
14523 long long i64 = strtoll(constant, &endP, 0);
14524 uint64 ui64 = strtoull(constant, &endP, 0);
14525 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14526
14527 if(isSigned)
14528 {
14529 if(i64 < (((int)0x80000000)))
14530 is64Bit = 1;
14531 }
14532 else
14533 {
14534 if(ui64 > (((int)0x7fffffff)))
14535 {
14536 if(ui64 > (0xffffffff))
14537 {
14538 is64Bit = 1;
14539 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14540 isSigned = 1;
14541 }
14542 }
14543 else if(constant[0] != '0' || !constant[1])
14544 isSigned = 1;
14545 }
14546 type->kind = is64Bit ? 4 : 3;
14547 type->isSigned = isSigned;
14548 }
14549 }
14550 exp->isConstant = 1;
14551 if(exp->destType && exp->destType->kind == 7)
14552 type->kind = 7;
14553 else if(exp->destType && exp->destType->kind == 6)
14554 type->kind = 6;
14555 else if(exp->destType && exp->destType->kind == 4)
14556 type->kind = 4;
14557 }
14558 break;
14559 }
14560 case 3:
14561 {
14562 exp->isConstant = 1;
14563 exp->expType = __extension__ ({
14564 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14565
14566 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14567 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14568
14569 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
14570 }), __ecereInstance2;
14571 });
14572 break;
14573 }
14574 case 13:
14575 case 26:
14576 ProcessExpressionType(exp->__anon1._new.size);
14577 exp->expType = __extension__ ({
14578 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14579
14580 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14581 });
14582 DeclareType(exp->expType->__anon1.type, 0, 0);
14583 break;
14584 case 14:
14585 case 27:
14586 ProcessExpressionType(exp->__anon1._renew.size);
14587 ProcessExpressionType(exp->__anon1._renew.exp);
14588 exp->expType = __extension__ ({
14589 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14590
14591 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14592 });
14593 DeclareType(exp->expType->__anon1.type, 0, 0);
14594 break;
14595 case 4:
14596 {
14597 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14598 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14599 unsigned int useDestType = 0, useSideType = 0;
14600 struct Location oldyylloc = yylloc;
14601 unsigned int useSideUnit = 0;
14602 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14603 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14604
14605 switch(exp->__anon1.op.op)
14606 {
14607 case '=':
14608 case MUL_ASSIGN:
14609 case DIV_ASSIGN:
14610 case MOD_ASSIGN:
14611 case ADD_ASSIGN:
14612 case SUB_ASSIGN:
14613 case LEFT_ASSIGN:
14614 case RIGHT_ASSIGN:
14615 case AND_ASSIGN:
14616 case XOR_ASSIGN:
14617 case OR_ASSIGN:
14618 assign = 1;
14619 break;
14620 case '!':
14621 break;
14622 case AND_OP:
14623 case OR_OP:
14624 boolOps = 1;
14625 boolResult = 1;
14626 break;
14627 case EQ_OP:
14628 case '<':
14629 case '>':
14630 case LE_OP:
14631 case GE_OP:
14632 case NE_OP:
14633 boolResult = 1;
14634 useSideType = 1;
14635 break;
14636 case '+':
14637 case '-':
14638 useSideUnit = 1;
14639 useSideType = 1;
14640 useDestType = 1;
14641 break;
14642 case LEFT_OP:
14643 case RIGHT_OP:
14644 useSideType = 1;
14645 useDestType = 1;
14646 break;
14647 case '|':
14648 case '^':
14649 useSideType = 1;
14650 useDestType = 1;
14651 break;
14652 case '/':
14653 case '%':
14654 useSideType = 1;
14655 useDestType = 1;
14656 break;
14657 case '&':
14658 case '*':
14659 if(exp->__anon1.op.exp1)
14660 {
14661 useSideType = 1;
14662 useDestType = 1;
14663 }
14664 break;
14665 }
14666 if(exp->__anon1.op.op == '&')
14667 {
14668 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14669 {
14670 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14671 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14672
14673 if(symbol && symbol->isIterator == 2)
14674 {
14675 exp->type = 8;
14676 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14677 exp->__anon1.member.member = MkIdentifier("key");
14678 exp->expType = (((void *)0));
14679 exp->__anon1.op.exp2->expType = symbol->type;
14680 symbol->type->refCount++;
14681 ProcessExpressionType(exp);
14682 FreeType(dummy);
14683 break;
14684 }
14685 }
14686 }
14687 if(exp->__anon1.op.exp1)
14688 {
14689 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14690 useDestType = 0;
14691 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14692 {
14693 if(exp->__anon1.op.exp1->destType)
14694 FreeType(exp->__anon1.op.exp1->destType);
14695 exp->__anon1.op.exp1->destType = exp->destType;
14696 exp->__anon1.op.exp1->opDestType = 1;
14697 if(exp->destType)
14698 exp->destType->refCount++;
14699 }
14700 else if(!assign)
14701 {
14702 if(exp->__anon1.op.exp1->destType)
14703 FreeType(exp->__anon1.op.exp1->destType);
14704 exp->__anon1.op.exp1->destType = dummy;
14705 dummy->refCount++;
14706 }
14707 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14708 exp->__anon1.op.exp1->destType->count++;
14709 ProcessExpressionType(exp->__anon1.op.exp1);
14710 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14711 exp->__anon1.op.exp1->destType->count--;
14712 exp->__anon1.op.exp1->opDestType = 0;
14713 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)
14714 {
14715 exp->__anon1.op.exp2 = MkExpConstant("1");
14716 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14717 assign = 1;
14718 }
14719 if(exp->__anon1.op.exp1->destType == dummy)
14720 {
14721 FreeType(dummy);
14722 exp->__anon1.op.exp1->destType = (((void *)0));
14723 }
14724 type1 = exp->__anon1.op.exp1->expType;
14725 }
14726 if(exp->__anon1.op.exp2)
14727 {
14728 char expString[10240];
14729
14730 expString[0] = '\0';
14731 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14732 {
14733 if(exp->__anon1.op.exp1)
14734 {
14735 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14736 if(exp->__anon1.op.exp1->expType)
14737 exp->__anon1.op.exp1->expType->refCount++;
14738 }
14739 else
14740 {
14741 exp->__anon1.op.exp2->destType = exp->destType;
14742 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14743 exp->__anon1.op.exp2->opDestType = 1;
14744 if(exp->destType)
14745 exp->destType->refCount++;
14746 }
14747 if(type1)
14748 type1->refCount++;
14749 exp->expType = type1;
14750 }
14751 else if(assign)
14752 {
14753 if(inCompiler)
14754 PrintExpression(exp->__anon1.op.exp2, expString);
14755 if(type1 && type1->kind == 13)
14756 {
14757 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)
14758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14759 else if(exp->__anon1.op.op == '=')
14760 {
14761 if(exp->__anon1.op.exp2->destType)
14762 FreeType(exp->__anon1.op.exp2->destType);
14763 exp->__anon1.op.exp2->destType = type1;
14764 if(type1)
14765 type1->refCount++;
14766 }
14767 }
14768 else
14769 {
14770 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)
14771 ;
14772 else
14773 {
14774 if(exp->__anon1.op.exp2->destType)
14775 FreeType(exp->__anon1.op.exp2->destType);
14776 exp->__anon1.op.exp2->destType = type1;
14777 if(type1)
14778 type1->refCount++;
14779 }
14780 }
14781 if(type1)
14782 type1->refCount++;
14783 exp->expType = type1;
14784 }
14785 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14786 {
14787 if(exp->__anon1.op.exp2->destType)
14788 FreeType(exp->__anon1.op.exp2->destType);
14789 exp->__anon1.op.exp2->destType = exp->destType;
14790 if(exp->__anon1.op.op != '&')
14791 exp->__anon1.op.exp2->opDestType = 1;
14792 if(exp->destType)
14793 exp->destType->refCount++;
14794 }
14795 else
14796 {
14797 if(exp->__anon1.op.exp2->destType)
14798 FreeType(exp->__anon1.op.exp2->destType);
14799 exp->__anon1.op.exp2->destType = dummy;
14800 dummy->refCount++;
14801 }
14802 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))
14803 {
14804 FreeType(exp->__anon1.op.exp2->destType);
14805 exp->__anon1.op.exp2->destType = type1;
14806 type1->refCount++;
14807 }
14808 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14809 exp->__anon1.op.exp2->destType->count++;
14810 if(exp->__anon1.op.op == SIZEOF)
14811 {
14812 struct Expression * e = exp->__anon1.op.exp2;
14813
14814 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14815 {
14816 if(e->type == 5 || e->type == 32 || e->type == 23)
14817 {
14818 if(e->type == 23)
14819 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14820 else
14821 e = (*e->__anon1.list).last;
14822 }
14823 }
14824 if(e->type == 11 && e->__anon1.cast.exp)
14825 e->__anon1.cast.exp->needCast = 1;
14826 }
14827 ProcessExpressionType(exp->__anon1.op.exp2);
14828 exp->__anon1.op.exp2->opDestType = 0;
14829 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14830 exp->__anon1.op.exp2->destType->count--;
14831 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14832 {
14833 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)
14834 {
14835 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14836 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14837 }
14838 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)))
14839 {
14840 if(exp->__anon1.op.op == ADD_ASSIGN)
14841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14842 }
14843 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))
14844 {
14845 if(exp->__anon1.op.op == ADD_ASSIGN)
14846 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14847 }
14848 else if(inCompiler)
14849 {
14850 char type1String[1024];
14851 char type2String[1024];
14852
14853 type1String[0] = '\0';
14854 type2String[0] = '\0';
14855 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14856 PrintType(type1, type2String, 0, 1);
14857 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14858 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14859 }
14860 }
14861 if(exp->__anon1.op.exp2->destType == dummy)
14862 {
14863 FreeType(dummy);
14864 exp->__anon1.op.exp2->destType = (((void *)0));
14865 }
14866 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14867 {
14868 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14869 type2->refCount = 1;
14870 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14871 type2->isSigned = 1;
14872 }
14873 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))
14874 {
14875 type2 = __extension__ ({
14876 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14877
14878 __ecereInstance1->kind = 3, __ecereInstance1;
14879 });
14880 type2->refCount = 1;
14881 type2->isSigned = 1;
14882 }
14883 else
14884 {
14885 type2 = exp->__anon1.op.exp2->expType;
14886 if(type2)
14887 type2->refCount++;
14888 }
14889 }
14890 dummy->kind = 0;
14891 if(exp->__anon1.op.op == SIZEOF)
14892 {
14893 exp->expType = __extension__ ({
14894 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14895
14896 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14897 });
14898 exp->isConstant = 1;
14899 }
14900 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14901 {
14902 exp->expType = Dereference(type2);
14903 if(type2 && type2->kind == 8)
14904 notByReference = 1;
14905 }
14906 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14907 exp->expType = Reference(type2);
14908 else if(!assign)
14909 {
14910 if(boolOps)
14911 {
14912 if(exp->__anon1.op.exp1)
14913 {
14914 if(exp->__anon1.op.exp1->destType)
14915 FreeType(exp->__anon1.op.exp1->destType);
14916 exp->__anon1.op.exp1->destType = MkClassType("bool");
14917 exp->__anon1.op.exp1->destType->truth = 1;
14918 if(!exp->__anon1.op.exp1->expType)
14919 ProcessExpressionType(exp->__anon1.op.exp1);
14920 else
14921 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14922 FreeType(exp->__anon1.op.exp1->expType);
14923 exp->__anon1.op.exp1->expType = MkClassType("bool");
14924 exp->__anon1.op.exp1->expType->truth = 1;
14925 }
14926 if(exp->__anon1.op.exp2)
14927 {
14928 if(exp->__anon1.op.exp2->destType)
14929 FreeType(exp->__anon1.op.exp2->destType);
14930 exp->__anon1.op.exp2->destType = MkClassType("bool");
14931 exp->__anon1.op.exp2->destType->truth = 1;
14932 if(!exp->__anon1.op.exp2->expType)
14933 ProcessExpressionType(exp->__anon1.op.exp2);
14934 else
14935 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14936 FreeType(exp->__anon1.op.exp2->expType);
14937 exp->__anon1.op.exp2->expType = MkClassType("bool");
14938 exp->__anon1.op.exp2->expType->truth = 1;
14939 }
14940 }
14941 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")))))
14942 {
14943 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"))))
14944 {
14945 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)))
14946 {
14947 struct Type * intType;
14948
14949 if(!type1->__anon1._class->__anon1.registered->dataType)
14950 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14951 if(!type2->__anon1._class->__anon1.registered->dataType)
14952 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14953 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14954 if(exp->__anon1.op.exp1->destType)
14955 FreeType(exp->__anon1.op.exp1->destType);
14956 if(exp->__anon1.op.exp2->destType)
14957 FreeType(exp->__anon1.op.exp2->destType);
14958 exp->__anon1.op.exp1->destType = intType;
14959 exp->__anon1.op.exp2->destType = intType;
14960 intType->refCount++;
14961 }
14962 else
14963 {
14964 if(exp->__anon1.op.exp2->destType)
14965 FreeType(exp->__anon1.op.exp2->destType);
14966 exp->__anon1.op.exp2->destType = type1;
14967 type1->refCount++;
14968 if(exp->__anon1.op.exp1->destType)
14969 FreeType(exp->__anon1.op.exp1->destType);
14970 exp->__anon1.op.exp1->destType = type2;
14971 type2->refCount++;
14972 }
14973 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)
14974 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);
14975 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14976 {
14977 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14978
14979 if(argExp)
14980 {
14981 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14982
14983 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14984 ProcessExpressionType(exp->__anon1.op.exp1);
14985 if(type2->kind != 13)
14986 {
14987 ProcessExpressionType(classExp);
14988 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14989 if(!exp->__anon1.op.exp2->expType)
14990 {
14991 if(type2)
14992 FreeType(type2);
14993 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14994 type2->refCount++;
14995 }
14996 ProcessExpressionType(exp->__anon1.op.exp2);
14997 }
14998 }
14999 }
15000 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)))
15001 {
15002 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
15003 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15004 exp->expType = type1;
15005 if(type1)
15006 type1->refCount++;
15007 }
15008 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)))
15009 {
15010 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
15011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15012 exp->expType = type2;
15013 if(type2)
15014 type2->refCount++;
15015 }
15016 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))
15017 {
15018 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
15019 }
15020 else
15021 {
15022 unsigned int success = 0;
15023
15024 if(type1->kind == 13 && type2->kind == 13)
15025 {
15026 if(exp->__anon1.op.op == '+')
15027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
15028 else if(exp->__anon1.op.op == '-')
15029 {
15030 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
15031 {
15032 exp->expType = __extension__ ({
15033 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15034
15035 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15036 });
15037 success = 1;
15038 if(type1->__anon1.type->kind == 20)
15039 {
15040 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15041
15042 if(argExp)
15043 {
15044 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15045
15046 ProcessExpressionType(classExp);
15047 exp->type = 5;
15048 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"))));
15049 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15050 FreeType(dummy);
15051 return ;
15052 }
15053 }
15054 }
15055 }
15056 }
15057 if(!success && exp->__anon1.op.exp1->type == 2)
15058 {
15059 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15060 {
15061 if(exp->expType)
15062 FreeType(exp->expType);
15063 exp->expType = exp->__anon1.op.exp1->destType;
15064 if(exp->__anon1.op.exp1->destType)
15065 exp->__anon1.op.exp1->destType->refCount++;
15066 success = 1;
15067 }
15068 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15069 {
15070 if(exp->expType)
15071 FreeType(exp->expType);
15072 exp->expType = exp->__anon1.op.exp2->destType;
15073 if(exp->__anon1.op.exp2->destType)
15074 exp->__anon1.op.exp2->destType->refCount++;
15075 success = 1;
15076 }
15077 }
15078 else if(!success)
15079 {
15080 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15081 {
15082 if(exp->expType)
15083 FreeType(exp->expType);
15084 exp->expType = exp->__anon1.op.exp2->destType;
15085 if(exp->__anon1.op.exp2->destType)
15086 exp->__anon1.op.exp2->destType->refCount++;
15087 success = 1;
15088 }
15089 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15090 {
15091 if(exp->expType)
15092 FreeType(exp->expType);
15093 exp->expType = exp->__anon1.op.exp1->destType;
15094 if(exp->__anon1.op.exp1->destType)
15095 exp->__anon1.op.exp1->destType->refCount++;
15096 success = 1;
15097 }
15098 }
15099 if(!success)
15100 {
15101 char expString1[10240];
15102 char expString2[10240];
15103 char type1[1024];
15104 char type2[1024];
15105
15106 expString1[0] = '\0';
15107 expString2[0] = '\0';
15108 type1[0] = '\0';
15109 type2[0] = '\0';
15110 if(inCompiler)
15111 {
15112 PrintExpression(exp->__anon1.op.exp1, expString1);
15113 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15114 PrintExpression(exp->__anon1.op.exp2, expString2);
15115 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15116 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15117 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15118 }
15119 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15120 }
15121 }
15122 }
15123 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)
15124 {
15125 if(exp->__anon1.op.exp1->destType)
15126 FreeType(exp->__anon1.op.exp1->destType);
15127 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15128 if(type2->__anon1._class->__anon1.registered->dataType)
15129 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15130 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15131 exp->expType = type2;
15132 if(type2)
15133 type2->refCount++;
15134 }
15135 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)
15136 {
15137 if(exp->__anon1.op.exp2->destType)
15138 FreeType(exp->__anon1.op.exp2->destType);
15139 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15140 if(type1->__anon1._class->__anon1.registered->dataType)
15141 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15142 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15143 exp->expType = type1;
15144 if(type1)
15145 type1->refCount++;
15146 }
15147 else if(type1)
15148 {
15149 unsigned int valid = 0;
15150
15151 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15152 {
15153 if(exp->__anon1.op.exp2->destType)
15154 FreeType(exp->__anon1.op.exp2->destType);
15155 if(!type1->__anon1._class->__anon1.registered->dataType)
15156 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15157 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15158 exp->__anon1.op.exp2->destType->refCount++;
15159 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15160 if(type2)
15161 FreeType(type2);
15162 type2 = exp->__anon1.op.exp2->destType;
15163 if(type2)
15164 type2->refCount++;
15165 exp->expType = type2;
15166 type2->refCount++;
15167 }
15168 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15169 {
15170 if(exp->__anon1.op.exp1->destType)
15171 FreeType(exp->__anon1.op.exp1->destType);
15172 if(!type2->__anon1._class->__anon1.registered->dataType)
15173 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15174 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15175 exp->__anon1.op.exp1->destType->refCount++;
15176 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15177 type1 = exp->__anon1.op.exp1->destType;
15178 exp->expType = type1;
15179 type1->refCount++;
15180 }
15181 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15182 {
15183 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15184 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15185
15186 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15187 {
15188 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15189 {
15190 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15191 {
15192 if(exp->expType)
15193 FreeType(exp->expType);
15194 exp->expType = exp->__anon1.op.exp2->expType;
15195 if(exp->__anon1.op.exp2->expType)
15196 exp->__anon1.op.exp2->expType->refCount++;
15197 valid = 1;
15198 }
15199 }
15200 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15201 {
15202 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15203 {
15204 if(exp->expType)
15205 FreeType(exp->expType);
15206 exp->expType = exp->__anon1.op.exp1->expType;
15207 if(exp->__anon1.op.exp1->expType)
15208 exp->__anon1.op.exp1->expType->refCount++;
15209 valid = 1;
15210 }
15211 }
15212 }
15213 else
15214 {
15215 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15216 {
15217 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15218 {
15219 if(exp->expType)
15220 FreeType(exp->expType);
15221 exp->expType = exp->__anon1.op.exp1->expType;
15222 if(exp->__anon1.op.exp1->expType)
15223 exp->__anon1.op.exp1->expType->refCount++;
15224 valid = 1;
15225 }
15226 }
15227 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15228 {
15229 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15230 {
15231 if(exp->expType)
15232 FreeType(exp->expType);
15233 exp->expType = exp->__anon1.op.exp2->expType;
15234 if(exp->__anon1.op.exp2->expType)
15235 exp->__anon1.op.exp2->expType->refCount++;
15236 valid = 1;
15237 }
15238 }
15239 }
15240 }
15241 if(!valid)
15242 {
15243 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))
15244 {
15245 if(exp->__anon1.op.exp1->destType)
15246 FreeType(exp->__anon1.op.exp1->destType);
15247 exp->__anon1.op.exp1->destType = type2;
15248 type2->refCount++;
15249 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15250 {
15251 if(exp->expType)
15252 FreeType(exp->expType);
15253 exp->expType = exp->__anon1.op.exp1->destType;
15254 if(exp->__anon1.op.exp1->destType)
15255 exp->__anon1.op.exp1->destType->refCount++;
15256 }
15257 }
15258 else
15259 {
15260 if(exp->__anon1.op.exp2->destType)
15261 FreeType(exp->__anon1.op.exp2->destType);
15262 exp->__anon1.op.exp2->destType = type1;
15263 type1->refCount++;
15264 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15265 {
15266 if(exp->expType)
15267 FreeType(exp->expType);
15268 exp->expType = exp->__anon1.op.exp2->destType;
15269 if(exp->__anon1.op.exp2->destType)
15270 exp->__anon1.op.exp2->destType->refCount++;
15271 }
15272 else if(type1 && type2)
15273 {
15274 char expString1[10240];
15275 char expString2[10240];
15276 char type1String[1024];
15277 char type2String[1024];
15278
15279 expString1[0] = '\0';
15280 expString2[0] = '\0';
15281 type1String[0] = '\0';
15282 type2String[0] = '\0';
15283 if(inCompiler)
15284 {
15285 PrintExpression(exp->__anon1.op.exp1, expString1);
15286 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15287 PrintExpression(exp->__anon1.op.exp2, expString2);
15288 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15289 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15290 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15291 }
15292 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15293 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15294 {
15295 exp->expType = exp->__anon1.op.exp1->expType;
15296 if(exp->__anon1.op.exp1->expType)
15297 exp->__anon1.op.exp1->expType->refCount++;
15298 }
15299 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15300 {
15301 exp->expType = exp->__anon1.op.exp2->expType;
15302 if(exp->__anon1.op.exp2->expType)
15303 exp->__anon1.op.exp2->expType->refCount++;
15304 }
15305 }
15306 }
15307 }
15308 }
15309 else if(type2)
15310 {
15311 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15312 {
15313 struct Type * oldType = exp->__anon1.op.exp1->expType;
15314
15315 exp->__anon1.op.exp1->expType = (((void *)0));
15316 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15317 FreeType(oldType);
15318 else
15319 exp->__anon1.op.exp1->expType = oldType;
15320 }
15321 if(exp->__anon1.op.exp1->destType)
15322 FreeType(exp->__anon1.op.exp1->destType);
15323 exp->__anon1.op.exp1->destType = type2;
15324 type2->refCount++;
15325 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15326 {
15327 if(exp->expType)
15328 FreeType(exp->expType);
15329 exp->expType = exp->__anon1.op.exp1->destType;
15330 if(exp->__anon1.op.exp1->destType)
15331 exp->__anon1.op.exp1->destType->refCount++;
15332 }
15333 }
15334 }
15335 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15336 {
15337 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15338 {
15339 if(exp->__anon1.op.exp1->destType)
15340 FreeType(exp->__anon1.op.exp1->destType);
15341 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15342 if(type2->__anon1._class->__anon1.registered->dataType)
15343 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15344 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15345 }
15346 if(exp->__anon1.op.op == '!')
15347 {
15348 exp->expType = MkClassType("bool");
15349 exp->expType->truth = 1;
15350 }
15351 else
15352 {
15353 exp->expType = type2;
15354 if(type2)
15355 type2->refCount++;
15356 }
15357 }
15358 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15359 {
15360 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15361 {
15362 if(exp->__anon1.op.exp2->destType)
15363 FreeType(exp->__anon1.op.exp2->destType);
15364 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15365 if(type1->__anon1._class->__anon1.registered->dataType)
15366 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15367 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15368 }
15369 exp->expType = type1;
15370 if(type1)
15371 type1->refCount++;
15372 }
15373 }
15374 yylloc = exp->loc;
15375 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15376 {
15377 char expString[10000];
15378
15379 expString[0] = '\0';
15380 if(inCompiler)
15381 {
15382 PrintExpression(exp->__anon1.op.exp1, expString);
15383 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15384 }
15385 if(expString[0])
15386 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15387 }
15388 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15389 {
15390 char expString[10240];
15391
15392 expString[0] = '\0';
15393 if(inCompiler)
15394 {
15395 PrintExpression(exp->__anon1.op.exp2, expString);
15396 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15397 }
15398 if(expString[0])
15399 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15400 }
15401 if(boolResult)
15402 {
15403 FreeType(exp->expType);
15404 exp->expType = MkClassType("bool");
15405 exp->expType->truth = 1;
15406 }
15407 if(exp->__anon1.op.op != SIZEOF)
15408 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15409 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15410 {
15411 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15412 }
15413 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15414 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15415 yylloc = oldyylloc;
15416 FreeType(dummy);
15417 if(type2)
15418 FreeType(type2);
15419 break;
15420 }
15421 case 5:
15422 case 32:
15423 {
15424 struct Expression * e;
15425
15426 exp->isConstant = 1;
15427 for(e = (*exp->__anon1.list).first; e; e = e->next)
15428 {
15429 unsigned int inced = 0;
15430
15431 if(!e->next)
15432 {
15433 FreeType(e->destType);
15434 e->opDestType = exp->opDestType;
15435 e->destType = exp->destType;
15436 if(e->destType)
15437 {
15438 exp->destType->refCount++;
15439 e->destType->count++;
15440 inced = 1;
15441 }
15442 }
15443 ProcessExpressionType(e);
15444 if(inced)
15445 exp->destType->count--;
15446 if(!exp->expType && !e->next)
15447 {
15448 exp->expType = e->expType;
15449 if(e->expType)
15450 e->expType->refCount++;
15451 }
15452 if(!e->isConstant)
15453 exp->isConstant = 0;
15454 }
15455 e = (*exp->__anon1.list).first;
15456 if(!e->next && e->type == 8)
15457 {
15458 struct Expression * next = exp->next, * prev = exp->prev;
15459
15460 FreeType(exp->expType);
15461 FreeType(exp->destType);
15462 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15463 *exp = *e;
15464 exp->prev = prev;
15465 exp->next = next;
15466 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15467 ProcessExpressionType(exp);
15468 }
15469 break;
15470 }
15471 case 6:
15472 {
15473 struct Expression * e;
15474
15475 exp->isConstant = 1;
15476 ProcessExpressionType(exp->__anon1.index.exp);
15477 if(!exp->__anon1.index.exp->isConstant)
15478 exp->isConstant = 0;
15479 if(exp->__anon1.index.exp->expType)
15480 {
15481 struct Type * source = exp->__anon1.index.exp->expType;
15482
15483 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15484 {
15485 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15486 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15487
15488 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15489 {
15490 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15491 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15492 {
15493 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15494
15495 if(type->kind == 8)
15496 type->constant = 1;
15497 else if(type->kind == 13)
15498 {
15499 struct Type * t = type;
15500
15501 while(t->kind == 13)
15502 t = t->__anon1.type;
15503 t->constant = 1;
15504 }
15505 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15506 }
15507 }
15508 }
15509 }
15510 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15511 {
15512 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15513 {
15514 if(e->destType)
15515 FreeType(e->destType);
15516 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15517 }
15518 ProcessExpressionType(e);
15519 if(!e->next)
15520 {
15521 }
15522 if(!e->isConstant)
15523 exp->isConstant = 0;
15524 }
15525 if(!exp->expType)
15526 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15527 if(exp->expType)
15528 DeclareType(exp->expType, 0, 0);
15529 break;
15530 }
15531 case 7:
15532 {
15533 struct Expression * e;
15534 struct Type * functionType;
15535 struct Type * methodType = (((void *)0));
15536 char name[1024];
15537
15538 name[0] = '\0';
15539 if(inCompiler)
15540 {
15541 PrintExpression(exp->__anon1.call.exp, name);
15542 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15543 {
15544 PrintExpression(exp->__anon1.call.exp, name);
15545 }
15546 }
15547 if(exp->__anon1.call.exp->type == 0)
15548 {
15549 struct Expression * idExp = exp->__anon1.call.exp;
15550 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15551
15552 if(!strcmp(id->string, "__builtin_frame_address"))
15553 {
15554 exp->expType = ProcessTypeString("void *", 1);
15555 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15556 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15557 break;
15558 }
15559 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15560 {
15561 exp->expType = ProcessTypeString("int", 1);
15562 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15563 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15564 break;
15565 }
15566 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15567 {
15568 struct Expression * a = (((void *)0));
15569 struct Expression * b = (((void *)0));
15570 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15571
15572 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15573 {
15574 a = (*exp->__anon1.call.arguments).first;
15575 b = (*exp->__anon1.call.arguments).last;
15576 tempExp1 = a;
15577 tempExp2 = b;
15578 }
15579 else if((*exp->__anon1.call.arguments).count == 1)
15580 {
15581 a = (*exp->__anon1.call.arguments).first;
15582 tempExp1 = a;
15583 }
15584 if(a)
15585 {
15586 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15587 idExp->__anon1.__anon1.identifier = (((void *)0));
15588 FreeExpContents(exp);
15589 ProcessExpressionType(a);
15590 if(b)
15591 ProcessExpressionType(b);
15592 exp->type = 5;
15593 exp->__anon1.list = MkList();
15594 if(a->expType && (!b || b->expType))
15595 {
15596 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15597 {
15598 if(inCompiler)
15599 {
15600 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15601 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15602 struct Declaration * decl;
15603 char temp1[1024], temp2[1024];
15604
15605 GetTypeSpecs(a->expType, specs);
15606 if(a && !a->isConstant && a->type != 0)
15607 {
15608 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15609 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15610 tempExp1 = QMkExpId(temp1);
15611 tempExp1->expType = a->expType;
15612 if(a->expType)
15613 a->expType->refCount++;
15614 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15615 }
15616 if(b && !b->isConstant && b->type != 0)
15617 {
15618 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15619 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15620 tempExp2 = QMkExpId(temp2);
15621 tempExp2->expType = b->expType;
15622 if(b->expType)
15623 b->expType->refCount++;
15624 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15625 }
15626 decl = MkDeclaration(specs, decls);
15627 if(!curCompound->__anon1.compound.declarations)
15628 curCompound->__anon1.compound.declarations = MkList();
15629 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15630 }
15631 }
15632 }
15633 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15634 {
15635 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15636
15637 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15638 exp->expType = a->expType;
15639 if(a->expType)
15640 a->expType->refCount++;
15641 }
15642 else if(!strcmp(id->string, "Abs"))
15643 {
15644 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15645 exp->expType = a->expType;
15646 if(a->expType)
15647 a->expType->refCount++;
15648 }
15649 else if(!strcmp(id->string, "Sgn"))
15650 {
15651 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"))))));
15652 exp->expType = ProcessTypeString("int", 0);
15653 }
15654 FreeExpression(tempExp1);
15655 if(tempExp2)
15656 FreeExpression(tempExp2);
15657 FreeIdentifier(id);
15658 break;
15659 }
15660 }
15661 }
15662 {
15663 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15664
15665 if(!exp->__anon1.call.exp->destType)
15666 {
15667 exp->__anon1.call.exp->destType = dummy;
15668 dummy->refCount++;
15669 }
15670 ProcessExpressionType(exp->__anon1.call.exp);
15671 if(exp->__anon1.call.exp->destType == dummy)
15672 {
15673 FreeType(dummy);
15674 exp->__anon1.call.exp->destType = (((void *)0));
15675 }
15676 FreeType(dummy);
15677 }
15678 functionType = exp->__anon1.call.exp->expType;
15679 if(functionType && functionType->kind == 16)
15680 {
15681 methodType = functionType;
15682 functionType = methodType->__anon1.__anon3.method->dataType;
15683 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15684 {
15685 char typeString[1024];
15686
15687 typeString[0] = '\0';
15688 {
15689 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15690
15691 functionType->__anon1.__anon2.thisClass = (((void *)0));
15692 PrintType(functionType, typeString, 1, 1);
15693 functionType->__anon1.__anon2.thisClass = back;
15694 }
15695 if(strstr(typeString, "thisclass"))
15696 {
15697 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15698 struct Declarator * decl;
15699
15700 {
15701 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15702
15703 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15704 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))
15705 thisClassParams = 0;
15706 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15707 {
15708 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15709
15710 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15711 ProcessDeclarator(decl);
15712 thisClass = backupThisClass;
15713 }
15714 thisClassParams = 1;
15715 functionType = ProcessType(specs, decl);
15716 functionType->refCount = 0;
15717 FinishTemplatesContext(context);
15718 }
15719 FreeList(specs, (void *)(FreeSpecifier));
15720 FreeDeclarator(decl);
15721 }
15722 }
15723 }
15724 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15725 {
15726 struct Type * type = functionType->__anon1.type;
15727
15728 if(!functionType->refCount)
15729 {
15730 functionType->__anon1.type = (((void *)0));
15731 FreeType(functionType);
15732 }
15733 functionType = type;
15734 }
15735 if(functionType && functionType->kind != 11)
15736 {
15737 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15738 }
15739 else if(functionType)
15740 {
15741 unsigned int emptyParams = 0, noParams = 0;
15742 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15743 struct Type * type = functionType->__anon1.__anon2.params.first;
15744 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15745 int extra = 0;
15746 struct Location oldyylloc = yylloc;
15747
15748 if(!type)
15749 emptyParams = 1;
15750 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15751 {
15752 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15753 e = e->next;
15754 }
15755 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15756 {
15757 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)
15758 {
15759 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15760 if(e)
15761 {
15762 e->destType = type;
15763 e = e->next;
15764 type = functionType->__anon1.__anon2.params.first;
15765 }
15766 else
15767 type->refCount = 0;
15768 }
15769 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15770 {
15771 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15772 type->byReference = functionType->byReference;
15773 type->typedByReference = functionType->typedByReference;
15774 if(e)
15775 {
15776 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15777 e = e->next;
15778 e->destType = type;
15779 e = e->next;
15780 type = functionType->__anon1.__anon2.params.first;
15781 }
15782 else
15783 type->refCount = 0;
15784 }
15785 }
15786 if(type && type->kind == 0)
15787 {
15788 noParams = 1;
15789 if(!type->refCount)
15790 FreeType(type);
15791 type = (((void *)0));
15792 }
15793 for(; e; e = e->next)
15794 {
15795 if(!type && !emptyParams)
15796 {
15797 yylloc = e->loc;
15798 if(methodType && methodType->__anon1.__anon3.methodClass)
15799 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);
15800 else
15801 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);
15802 break;
15803 }
15804 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15805 {
15806 struct Type * templatedType = (((void *)0));
15807 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15808 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15809 int id = 0;
15810
15811 if(_class && _class->templateArgs)
15812 {
15813 struct __ecereNameSpace__ecere__com__Class * sClass;
15814
15815 for(sClass = _class; sClass; sClass = sClass->base)
15816 {
15817 if(sClass->templateClass)
15818 sClass = sClass->templateClass;
15819 id = 0;
15820 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15821 {
15822 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15823 {
15824 struct __ecereNameSpace__ecere__com__Class * nextClass;
15825
15826 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15827 {
15828 if(nextClass->templateClass)
15829 nextClass = nextClass->templateClass;
15830 id += nextClass->templateParams.count;
15831 }
15832 break;
15833 }
15834 id++;
15835 }
15836 if(curParam)
15837 break;
15838 }
15839 }
15840 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15841 {
15842 unsigned int constant = type->constant;
15843 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15844
15845 {
15846 struct Context * context = SetupTemplatesContext(_class);
15847
15848 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15849 FinishTemplatesContext(context);
15850 }
15851 if(templatedType->kind == 8 && constant)
15852 templatedType->constant = 1;
15853 else if(templatedType->kind == 13)
15854 {
15855 struct Type * t = templatedType->__anon1.type;
15856
15857 while(t->kind == 13)
15858 t = t->__anon1.type;
15859 if(constant)
15860 t->constant = constant;
15861 }
15862 e->destType = templatedType;
15863 if(templatedType)
15864 {
15865 templatedType->passAsTemplate = 1;
15866 }
15867 }
15868 else
15869 {
15870 e->destType = type;
15871 if(type)
15872 type->refCount++;
15873 }
15874 }
15875 else
15876 {
15877 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15878 {
15879 e->destType = type->prev;
15880 e->destType->refCount++;
15881 }
15882 else
15883 {
15884 e->destType = type;
15885 if(type)
15886 type->refCount++;
15887 }
15888 }
15889 if(type && type->kind != 14)
15890 {
15891 struct Type * next = type->next;
15892
15893 if(!type->refCount)
15894 FreeType(type);
15895 type = next;
15896 }
15897 }
15898 if(type && type->kind != 14)
15899 {
15900 if(methodType && methodType->__anon1.__anon3.methodClass)
15901 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);
15902 else
15903 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);
15904 }
15905 yylloc = oldyylloc;
15906 if(type && !type->refCount)
15907 FreeType(type);
15908 }
15909 else
15910 {
15911 functionType = __extension__ ({
15912 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15913
15914 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15915 });
15916 if(exp->__anon1.call.exp->type == 0)
15917 {
15918 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15919
15920 if(inCompiler)
15921 {
15922 struct Symbol * symbol;
15923 struct Location oldyylloc = yylloc;
15924
15925 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15926 if(strstr(string, "__builtin_") == string)
15927 {
15928 if(exp->destType)
15929 {
15930 functionType->__anon1.__anon2.returnType = exp->destType;
15931 exp->destType->refCount++;
15932 }
15933 }
15934 else
15935 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15936 symbol = __extension__ ({
15937 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15938
15939 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15940 });
15941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15942 if(strstr(symbol->string, "::"))
15943 globalContext->hasNameSpace = 1;
15944 yylloc = oldyylloc;
15945 }
15946 }
15947 else if(exp->__anon1.call.exp->type == 8)
15948 {
15949 }
15950 else
15951 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15952 if(!functionType->__anon1.__anon2.returnType)
15953 {
15954 functionType->__anon1.__anon2.returnType = __extension__ ({
15955 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15956
15957 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15958 });
15959 }
15960 }
15961 if(functionType && functionType->kind == 11)
15962 {
15963 exp->expType = functionType->__anon1.__anon2.returnType;
15964 if(functionType->__anon1.__anon2.returnType)
15965 functionType->__anon1.__anon2.returnType->refCount++;
15966 if(!functionType->refCount)
15967 FreeType(functionType);
15968 }
15969 if(exp->__anon1.call.arguments)
15970 {
15971 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15972 ProcessExpressionType(e);
15973 }
15974 break;
15975 }
15976 case 8:
15977 {
15978 struct Type * type;
15979 struct Location oldyylloc = yylloc;
15980 unsigned int thisPtr;
15981 struct Expression * checkExp = exp->__anon1.member.exp;
15982
15983 while(checkExp)
15984 {
15985 if(checkExp->type == 11)
15986 checkExp = checkExp->__anon1.cast.exp;
15987 else if(checkExp->type == 5)
15988 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15989 else
15990 break;
15991 }
15992 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15993 exp->thisPtr = thisPtr;
15994 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15995 {
15996 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15997 }
15998 ProcessExpressionType(exp->__anon1.member.exp);
15999 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)
16000 {
16001 exp->isConstant = 0;
16002 }
16003 else
16004 exp->isConstant = exp->__anon1.member.exp->isConstant;
16005 type = exp->__anon1.member.exp->expType;
16006 yylloc = exp->loc;
16007 if(type && (type->kind == 20))
16008 {
16009 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16010 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
16011
16012 if(_class)
16013 {
16014 for(param = _class->templateParams.first; param; param = param->next)
16015 {
16016 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
16017 break;
16018 }
16019 }
16020 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
16021 {
16022 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
16023
16024 if(argExp)
16025 {
16026 struct Expression * expMember = exp->__anon1.member.exp;
16027 struct Declarator * decl;
16028 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16029 char thisClassTypeString[1024];
16030
16031 FreeIdentifier(exp->__anon1.member.member);
16032 ProcessExpressionType(argExp);
16033 {
16034 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16035
16036 if(colon)
16037 {
16038 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16039 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16040 }
16041 else
16042 strcpy(thisClassTypeString, _class->fullName);
16043 }
16044 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16045 exp->expType = ProcessType(specs, decl);
16046 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16047 {
16048 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16049 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16050 int paramCount = 0;
16051 int lastParam = -1;
16052 char templateString[1024];
16053 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16054
16055 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16056 for(cClass = expClass; cClass; cClass = cClass->base)
16057 {
16058 int p = 0;
16059
16060 for(param = cClass->templateParams.first; param; param = param->next)
16061 {
16062 int id = p;
16063 struct __ecereNameSpace__ecere__com__Class * sClass;
16064 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16065
16066 for(sClass = cClass->base; sClass; sClass = sClass->base)
16067 id += sClass->templateParams.count;
16068 arg = expClass->templateArgs[id];
16069 for(sClass = _class; sClass; sClass = sClass->base)
16070 {
16071 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16072 int p = 0;
16073 struct __ecereNameSpace__ecere__com__Class * nextClass;
16074
16075 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16076 p += nextClass->templateParams.count;
16077 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16078 {
16079 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16080 {
16081 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16082 {
16083 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16084 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16085 break;
16086 }
16087 }
16088 }
16089 }
16090 {
16091 char argument[256];
16092
16093 argument[0] = '\0';
16094 switch(param->type)
16095 {
16096 case 2:
16097 {
16098 char expString[1024];
16099 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16100 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16101 struct Expression * exp;
16102 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16103
16104 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16105 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16106 ProcessExpressionType(exp);
16107 ComputeExpression(exp);
16108 expString[0] = '\0';
16109 PrintExpression(exp, expString);
16110 strcat(argument, expString);
16111 FreeExpression(exp);
16112 break;
16113 }
16114 case 1:
16115 {
16116 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16117 break;
16118 }
16119 case 0:
16120 {
16121 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16122 {
16123 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16124 strcat(argument, thisClassTypeString);
16125 else
16126 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16127 }
16128 break;
16129 }
16130 }
16131 if(argument[0])
16132 {
16133 if(paramCount)
16134 strcat(templateString, ", ");
16135 if(lastParam != p - 1)
16136 {
16137 strcat(templateString, param->name);
16138 strcat(templateString, " = ");
16139 }
16140 strcat(templateString, argument);
16141 paramCount++;
16142 lastParam = p;
16143 }
16144 p++;
16145 }
16146 }
16147 }
16148 {
16149 int len = strlen(templateString);
16150
16151 if(templateString[len - 1] == '>')
16152 templateString[len++] = ' ';
16153 templateString[len++] = '>';
16154 templateString[len++] = '\0';
16155 }
16156 {
16157 struct Context * context = SetupTemplatesContext(_class);
16158
16159 FreeType(exp->expType);
16160 exp->expType = ProcessTypeString(templateString, 0);
16161 FinishTemplatesContext(context);
16162 }
16163 }
16164 exp->type = 5;
16165 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")))))))));
16166 }
16167 }
16168 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16169 {
16170 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16171 }
16172 }
16173 if(type && (type->kind == 20))
16174 ;
16175 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)))
16176 {
16177 struct Identifier * id = exp->__anon1.member.member;
16178 int typeKind = type->kind;
16179 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));
16180
16181 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16182 {
16183 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16184 typeKind = 8;
16185 }
16186 if(id)
16187 {
16188 if(typeKind == 3 || typeKind == 15)
16189 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16190 else if(!_class)
16191 {
16192 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16193 {
16194 _class = type->__anon1._class->__anon1.registered;
16195 }
16196 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16197 {
16198 _class = FindClass("char *")->__anon1.registered;
16199 }
16200 else if(type->kind == 13)
16201 {
16202 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16203 FreeType(exp->expType);
16204 exp->expType = ProcessTypeString("uintptr", 0);
16205 exp->byReference = 1;
16206 }
16207 else
16208 {
16209 char string[1024] = "";
16210 struct Symbol * classSym;
16211
16212 PrintTypeNoConst(type, string, 0, 1);
16213 classSym = FindClass(string);
16214 if(classSym)
16215 _class = classSym->__anon1.registered;
16216 }
16217 }
16218 }
16219 if(_class && id)
16220 {
16221 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16222 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16223 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16224 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16225 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16226
16227 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16228 exp->__anon1.member.memberType = 1;
16229 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16230 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16231 if(typeKind != 19)
16232 {
16233 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16234 {
16235 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16236 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16237 {
16238 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16239 if(prop)
16240 member = (((void *)0));
16241 }
16242 if(!member && !prop)
16243 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16244 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16245 exp->__anon1.member.thisPtr = 1;
16246 }
16247 else
16248 {
16249 unsigned int useMemberForNonConst = 0;
16250
16251 if(!id->classSym)
16252 {
16253 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16254 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);
16255 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16256 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16257 }
16258 if((!prop || useMemberForNonConst) && !member)
16259 {
16260 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16261 if(!method)
16262 {
16263 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16264 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);
16265 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16266 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16267 }
16268 }
16269 if(member && prop)
16270 {
16271 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16272 prop = (((void *)0));
16273 else
16274 member = (((void *)0));
16275 }
16276 }
16277 }
16278 if(!prop && !member && !method)
16279 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16280 if(!prop && !member && !method)
16281 {
16282 if(typeKind == 19)
16283 {
16284 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16285 if(classProp)
16286 {
16287 exp->__anon1.member.memberType = 5;
16288 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16289 }
16290 else
16291 {
16292 char structName[1024];
16293 struct Identifier * id = exp->__anon1.member.member;
16294 struct Expression * classExp = exp->__anon1.member.exp;
16295
16296 type->refCount++;
16297 FreeType(classExp->expType);
16298 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16299 strcpy(structName, "__ecereClassData_");
16300 FullClassNameCat(structName, type->__anon1._class->string, 0);
16301 exp->type = 9;
16302 exp->__anon1.member.member = id;
16303 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"))))))));
16304 FreeType(type);
16305 ProcessExpressionType(exp);
16306 return ;
16307 }
16308 }
16309 else
16310 {
16311 struct Symbol * classSym = FindClass(id->string);
16312
16313 if(classSym)
16314 {
16315 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16316
16317 if(convertClass)
16318 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16319 }
16320 }
16321 }
16322 if(exp->__anon1.member.exp->destType)
16323 FreeType(exp->__anon1.member.exp->destType);
16324 {
16325 if(method && !method->_class->symbol)
16326 method->_class->symbol = FindClass(method->_class->fullName);
16327 if(prop && !prop->_class->symbol)
16328 prop->_class->symbol = FindClass(prop->_class->fullName);
16329 exp->__anon1.member.exp->destType = __extension__ ({
16330 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16331
16332 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16333 });
16334 }
16335 if(prop)
16336 {
16337 exp->__anon1.member.memberType = 1;
16338 if(!prop->dataType)
16339 ProcessPropertyType(prop);
16340 exp->expType = prop->dataType;
16341 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16342 {
16343 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16344
16345 CopyTypeInto(type, exp->expType);
16346 type->refCount = 1;
16347 type->constant = 1;
16348 exp->expType = type;
16349 }
16350 else if(prop->dataType)
16351 prop->dataType->refCount++;
16352 }
16353 else if(member)
16354 {
16355 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16356 {
16357 FreeExpContents(exp);
16358 exp->type = 0;
16359 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16360 ProcessExpressionType(exp);
16361 return ;
16362 }
16363 exp->__anon1.member.memberType = 3;
16364 DeclareStruct(_class->fullName, 0);
16365 if(!member->dataType)
16366 {
16367 struct Context * context = SetupTemplatesContext(_class);
16368
16369 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16370 FinishTemplatesContext(context);
16371 }
16372 exp->expType = member->dataType;
16373 if(member->dataType)
16374 member->dataType->refCount++;
16375 }
16376 else if(revConvert)
16377 {
16378 exp->__anon1.member.memberType = 4;
16379 exp->expType = MkClassType(revConvert->_class->fullName);
16380 }
16381 else if(method)
16382 {
16383 {
16384 exp->__anon1.member.memberType = 2;
16385 }
16386 if(!method->dataType)
16387 ProcessMethodType(method);
16388 exp->expType = __extension__ ({
16389 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16390
16391 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16392 });
16393 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16394 exp->expType->__anon1.__anon3.usedClass = _class;
16395 }
16396 else if(!classProp)
16397 {
16398 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16399 {
16400 FreeExpContents(exp);
16401 exp->type = 0;
16402 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16403 FreeType(exp->expType);
16404 exp->expType = MkClassType("ecere::com::Class");
16405 return ;
16406 }
16407 yylloc = exp->__anon1.member.member->loc;
16408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16409 if(inCompiler)
16410 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16411 }
16412 if(_class && exp->expType)
16413 {
16414 struct __ecereNameSpace__ecere__com__Class * tClass;
16415
16416 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16417 while(tClass && !tClass->templateClass)
16418 tClass = tClass->base;
16419 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16420 {
16421 int id = 0;
16422 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16423 struct __ecereNameSpace__ecere__com__Class * sClass;
16424
16425 for(sClass = tClass; sClass; sClass = sClass->base)
16426 {
16427 id = 0;
16428 if(sClass->templateClass)
16429 sClass = sClass->templateClass;
16430 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16431 {
16432 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16433 {
16434 for(sClass = sClass->base; sClass; sClass = sClass->base)
16435 id += sClass->templateParams.count;
16436 break;
16437 }
16438 id++;
16439 }
16440 if(curParam)
16441 break;
16442 }
16443 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16444 {
16445 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16446 struct Context * context = SetupTemplatesContext(tClass);
16447 unsigned int constant = exp->expType->constant;
16448
16449 FreeType(exp->expType);
16450 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16451 if(exp->expType->kind == 8 && constant)
16452 exp->expType->constant = 1;
16453 else if(exp->expType->kind == 13)
16454 {
16455 struct Type * t = exp->expType->__anon1.type;
16456
16457 while(t->kind == 13)
16458 t = t->__anon1.type;
16459 if(constant)
16460 t->constant = constant;
16461 }
16462 if(exp->expType)
16463 {
16464 if(exp->expType->kind == 21)
16465 {
16466 FreeType(exp->expType);
16467 exp->expType = ReplaceThisClassType(_class);
16468 }
16469 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16470 exp->expType->passAsTemplate = 1;
16471 if(!exp->destType)
16472 {
16473 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16474 if(exp->destType->kind == 8 && constant)
16475 exp->destType->constant = 1;
16476 else if(exp->destType->kind == 13)
16477 {
16478 struct Type * t = exp->destType->__anon1.type;
16479
16480 while(t->kind == 13)
16481 t = t->__anon1.type;
16482 if(constant)
16483 t->constant = constant;
16484 }
16485 if(exp->destType->kind == 21)
16486 {
16487 FreeType(exp->destType);
16488 exp->destType = ReplaceThisClassType(_class);
16489 }
16490 }
16491 }
16492 FinishTemplatesContext(context);
16493 }
16494 }
16495 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)
16496 {
16497 int id = 0;
16498 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16499 struct __ecereNameSpace__ecere__com__Class * sClass;
16500
16501 for(sClass = tClass; sClass; sClass = sClass->base)
16502 {
16503 id = 0;
16504 if(sClass->templateClass)
16505 sClass = sClass->templateClass;
16506 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16507 {
16508 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16509 {
16510 for(sClass = sClass->base; sClass; sClass = sClass->base)
16511 id += sClass->templateParams.count;
16512 break;
16513 }
16514 id++;
16515 }
16516 if(curParam)
16517 break;
16518 }
16519 if(curParam)
16520 {
16521 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16522 struct Context * context = SetupTemplatesContext(tClass);
16523 struct Type * basicType;
16524
16525 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16526 if(basicType)
16527 {
16528 if(basicType->kind == 21)
16529 {
16530 FreeType(basicType);
16531 basicType = ReplaceThisClassType(_class);
16532 }
16533 FreeType(exp->expType);
16534 exp->expType = __extension__ ({
16535 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16536
16537 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16538 });
16539 if(!exp->destType)
16540 {
16541 exp->destType = exp->expType;
16542 exp->destType->refCount++;
16543 }
16544 {
16545 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16546 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16547 struct Declarator * decl;
16548
16549 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16550 *newExp = *exp;
16551 if(exp->destType)
16552 exp->destType->refCount++;
16553 if(exp->expType)
16554 exp->expType->refCount++;
16555 exp->type = 11;
16556 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16557 exp->__anon1.cast.exp = newExp;
16558 }
16559 }
16560 FinishTemplatesContext(context);
16561 }
16562 }
16563 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16564 {
16565 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16566
16567 if(expClass)
16568 {
16569 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16570 int p = 0;
16571 int paramCount = 0;
16572 int lastParam = -1;
16573 char templateString[1024];
16574 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16575
16576 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16577 while(cClass != expClass)
16578 {
16579 struct __ecereNameSpace__ecere__com__Class * sClass;
16580
16581 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16582 ;
16583 cClass = sClass;
16584 for(param = cClass->templateParams.first; param; param = param->next)
16585 {
16586 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16587 int cp = 0;
16588 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16589 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16590
16591 while(cClassCur != tClass && !paramCur)
16592 {
16593 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16594
16595 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16596 ;
16597 cClassCur = sClassCur;
16598 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16599 {
16600 if(!strcmp(paramCur->name, param->name))
16601 {
16602 break;
16603 }
16604 cp++;
16605 }
16606 }
16607 if(paramCur && paramCur->type == 0)
16608 arg = tClass->templateArgs[cp];
16609 else
16610 arg = expClass->templateArgs[p];
16611 {
16612 char argument[256];
16613
16614 argument[0] = '\0';
16615 switch(param->type)
16616 {
16617 case 2:
16618 {
16619 char expString[1024];
16620 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16621 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16622 struct Expression * exp;
16623 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16624
16625 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16626 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16627 ProcessExpressionType(exp);
16628 ComputeExpression(exp);
16629 expString[0] = '\0';
16630 PrintExpression(exp, expString);
16631 strcat(argument, expString);
16632 FreeExpression(exp);
16633 break;
16634 }
16635 case 1:
16636 {
16637 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16638 break;
16639 }
16640 case 0:
16641 {
16642 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16643 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16644 break;
16645 }
16646 }
16647 if(argument[0])
16648 {
16649 if(paramCount)
16650 strcat(templateString, ", ");
16651 if(lastParam != p - 1)
16652 {
16653 strcat(templateString, param->name);
16654 strcat(templateString, " = ");
16655 }
16656 strcat(templateString, argument);
16657 paramCount++;
16658 lastParam = p;
16659 }
16660 }
16661 p++;
16662 }
16663 }
16664 {
16665 int len = strlen(templateString);
16666
16667 if(templateString[len - 1] == '>')
16668 templateString[len++] = ' ';
16669 templateString[len++] = '>';
16670 templateString[len++] = '\0';
16671 }
16672 FreeType(exp->expType);
16673 {
16674 struct Context * context = SetupTemplatesContext(tClass);
16675
16676 exp->expType = ProcessTypeString(templateString, 0);
16677 FinishTemplatesContext(context);
16678 }
16679 }
16680 }
16681 }
16682 }
16683 else
16684 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)");
16685 }
16686 else if(type && (type->kind == 9 || type->kind == 10))
16687 {
16688 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16689
16690 if(memberType)
16691 {
16692 exp->expType = memberType;
16693 if(memberType)
16694 memberType->refCount++;
16695 }
16696 }
16697 else
16698 {
16699 char expString[10240];
16700
16701 expString[0] = '\0';
16702 if(inCompiler)
16703 {
16704 PrintExpression(exp, expString);
16705 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16706 }
16707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16708 }
16709 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16710 {
16711 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16712 {
16713 struct Identifier * id = exp->__anon1.member.member;
16714 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));
16715
16716 if(_class)
16717 {
16718 FreeType(exp->expType);
16719 exp->expType = ReplaceThisClassType(_class);
16720 }
16721 }
16722 }
16723 yylloc = oldyylloc;
16724 break;
16725 }
16726 case 9:
16727 {
16728 struct Type * destType = exp->destType;
16729
16730 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16731 {
16732 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16733 }
16734 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16735 exp->type = 8;
16736 if(destType)
16737 destType->count++;
16738 ProcessExpressionType(exp);
16739 if(destType)
16740 destType->count--;
16741 break;
16742 }
16743 case 15:
16744 {
16745 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16746
16747 if(classSym && classSym->__anon1.registered)
16748 {
16749 if(classSym->__anon1.registered->type == 5)
16750 {
16751 char name[1024];
16752
16753 name[0] = '\0';
16754 DeclareStruct(classSym->string, 0);
16755 FreeSpecifier(exp->__anon1._class);
16756 exp->type = 10;
16757 FullClassNameCat(name, classSym->string, 0);
16758 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16759 }
16760 else
16761 {
16762 if(classSym->__anon1.registered->fixed)
16763 {
16764 FreeSpecifier(exp->__anon1._class);
16765 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16766 exp->type = 2;
16767 }
16768 else
16769 {
16770 char className[1024];
16771
16772 strcpy(className, "__ecereClass_");
16773 FullClassNameCat(className, classSym->string, 1);
16774 DeclareClass(classSym, className);
16775 FreeExpContents(exp);
16776 exp->type = 9;
16777 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16778 exp->__anon1.member.member = MkIdentifier("structSize");
16779 }
16780 }
16781 }
16782 exp->expType = __extension__ ({
16783 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16784
16785 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16786 });
16787 break;
16788 }
16789 case 10:
16790 {
16791 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16792
16793 exp->expType = __extension__ ({
16794 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16795
16796 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16797 });
16798 exp->isConstant = 1;
16799 DeclareType(type, 0, 0);
16800 FreeType(type);
16801 break;
16802 }
16803 case 11:
16804 {
16805 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16806
16807 type->count = 1;
16808 FreeType(exp->__anon1.cast.exp->destType);
16809 exp->__anon1.cast.exp->destType = type;
16810 type->refCount++;
16811 type->casted = 1;
16812 ProcessExpressionType(exp->__anon1.cast.exp);
16813 type->casted = 0;
16814 type->count = 0;
16815 exp->expType = type;
16816 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16817 {
16818 void * prev = exp->prev, * next = exp->next;
16819 struct Type * expType = exp->__anon1.cast.exp->destType;
16820 struct Expression * castExp = exp->__anon1.cast.exp;
16821 struct Type * destType = exp->destType;
16822
16823 if(expType)
16824 expType->refCount++;
16825 FreeType(exp->expType);
16826 FreeTypeName(exp->__anon1.cast.typeName);
16827 *exp = *castExp;
16828 FreeType(exp->expType);
16829 FreeType(exp->destType);
16830 exp->expType = expType;
16831 exp->destType = destType;
16832 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16833 exp->prev = prev;
16834 exp->next = next;
16835 }
16836 else
16837 {
16838 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16839 }
16840 break;
16841 }
16842 case 33:
16843 {
16844 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16845
16846 exp->expType = type;
16847 break;
16848 }
16849 case 34:
16850 {
16851 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16852
16853 ProcessExpressionType(exp->__anon1.vaArg.exp);
16854 exp->expType = type;
16855 break;
16856 }
16857 case 12:
16858 {
16859 struct Expression * e;
16860
16861 exp->isConstant = 1;
16862 FreeType(exp->__anon1.cond.cond->destType);
16863 exp->__anon1.cond.cond->destType = MkClassType("bool");
16864 exp->__anon1.cond.cond->destType->truth = 1;
16865 ProcessExpressionType(exp->__anon1.cond.cond);
16866 if(!exp->__anon1.cond.cond->isConstant)
16867 exp->isConstant = 0;
16868 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16869 {
16870 if(!e->next)
16871 {
16872 FreeType(e->destType);
16873 e->destType = exp->destType;
16874 if(e->destType)
16875 e->destType->refCount++;
16876 }
16877 ProcessExpressionType(e);
16878 if(!e->next)
16879 {
16880 exp->expType = e->expType;
16881 if(e->expType)
16882 e->expType->refCount++;
16883 }
16884 if(!e->isConstant)
16885 exp->isConstant = 0;
16886 }
16887 FreeType(exp->__anon1.cond.elseExp->destType);
16888 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16889 if(exp->__anon1.cond.elseExp->destType)
16890 exp->__anon1.cond.elseExp->destType->refCount++;
16891 ProcessExpressionType(exp->__anon1.cond.elseExp);
16892 if(!exp->__anon1.cond.elseExp->isConstant)
16893 exp->isConstant = 0;
16894 break;
16895 }
16896 case 23:
16897 {
16898 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16899 {
16900 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16901
16902 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16903 {
16904 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16905 if(exp->destType)
16906 exp->destType->refCount++;
16907 }
16908 ProcessStatement(exp->__anon1.compound);
16909 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16910 if(exp->expType)
16911 exp->expType->refCount++;
16912 }
16913 break;
16914 }
16915 case 24:
16916 {
16917 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16918
16919 if(spec && spec->type == 1)
16920 {
16921 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16922 exp->expType->kind = 19;
16923 exp->byReference = 1;
16924 }
16925 else
16926 {
16927 exp->expType = MkClassType("ecere::com::Class");
16928 exp->byReference = 1;
16929 }
16930 break;
16931 }
16932 case 25:
16933 {
16934 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16935
16936 if(_class)
16937 {
16938 struct Identifier * id = exp->__anon1.classData.id;
16939 char structName[1024];
16940 struct Expression * classExp;
16941
16942 strcpy(structName, "__ecereClassData_");
16943 FullClassNameCat(structName, _class->fullName, 0);
16944 exp->type = 9;
16945 exp->__anon1.member.member = id;
16946 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16947 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16948 else
16949 classExp = MkExpIdentifier(MkIdentifier("class"));
16950 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"))))))));
16951 ProcessExpressionType(exp);
16952 return ;
16953 }
16954 break;
16955 }
16956 case 35:
16957 {
16958 struct Type * type = (((void *)0));
16959 const char * typeString = (((void *)0));
16960 char typeStringBuf[1024];
16961
16962 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))
16963 {
16964 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16965
16966 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16967 }
16968 else if(exp->__anon1.list)
16969 {
16970 struct Expression * e;
16971
16972 for(e = (*exp->__anon1.list).first; e; e = e->next)
16973 {
16974 ProcessExpressionType(e);
16975 if(e->expType)
16976 {
16977 if(!type)
16978 {
16979 type = e->expType;
16980 type->refCount++;
16981 }
16982 else
16983 {
16984 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16985 {
16986 FreeType(type);
16987 type = e->expType;
16988 e->expType = (((void *)0));
16989 e = (*exp->__anon1.list).first;
16990 ProcessExpressionType(e);
16991 if(e->expType)
16992 {
16993 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16994 {
16995 FreeType(e->expType);
16996 e->expType = (((void *)0));
16997 FreeType(type);
16998 type = (((void *)0));
16999 break;
17000 }
17001 }
17002 }
17003 }
17004 if(e->expType)
17005 {
17006 FreeType(e->expType);
17007 e->expType = (((void *)0));
17008 }
17009 }
17010 }
17011 if(type)
17012 {
17013 typeStringBuf[0] = '\0';
17014 PrintTypeNoConst(type, typeStringBuf, 0, 1);
17015 typeString = typeStringBuf;
17016 FreeType(type);
17017 type = (((void *)0));
17018 }
17019 }
17020 if(typeString)
17021 {
17022 char templateString[1024];
17023 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17024 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
17025 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17026 struct Expression * expExt;
17027 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17028
17029 sprintf(templateString, "Container<%s>", typeString);
17030 if(exp->__anon1.list)
17031 {
17032 struct Expression * e;
17033
17034 type = ProcessTypeString(typeString, 0);
17035 while((e = (*exp->__anon1.list).first))
17036 {
17037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17038 e->destType = type;
17039 type->refCount++;
17040 ProcessExpressionType(e);
17041 ListAdd(initializers, MkInitializerAssignment(e));
17042 }
17043 FreeType(type);
17044 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17045 }
17046 DeclareStruct("ecere::com::BuiltInContainer", 0);
17047 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17048 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17049 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17050 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17051 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17052 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17053 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17054 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17055 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17056 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17057
17058 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
17059 })));
17060 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17061 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
17062 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17063 exp->expType = ProcessTypeString(templateString, 0);
17064 exp->type = 5;
17065 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17066 ProcessExpressionType(expExt);
17067 }
17068 else
17069 {
17070 exp->expType = ProcessTypeString("Container", 0);
17071 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17072 }
17073 break;
17074 }
17075 }
17076 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17077 {
17078 FreeType(exp->expType);
17079 exp->expType = ReplaceThisClassType(thisClass);
17080 }
17081 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)
17082 {
17083 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17084
17085 if(symbol)
17086 {
17087 if(exp->expType->kind != 15)
17088 {
17089 struct Type * member;
17090 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17091
17092 FreeType(exp->expType);
17093 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17094 exp->expType->kind = symbol->type->kind;
17095 exp->expType->refCount++;
17096 exp->expType->__anon1.__anon1.enumName = enumName;
17097 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17098 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17099 member->refCount++;
17100 }
17101 else
17102 {
17103 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17104
17105 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17106 {
17107 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17108
17109 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17110 }
17111 }
17112 }
17113 }
17114 yylloc = exp->loc;
17115 if(exp->destType && (exp->destType->kind == 18))
17116 ;
17117 else if(exp->destType && !exp->destType->keepCast)
17118 {
17119 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17120 exp->needTemplateCast = 1;
17121 if(exp->destType->kind == 0)
17122 ;
17123 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17124 {
17125 if(!exp->destType->count || unresolved)
17126 {
17127 if(!exp->expType)
17128 {
17129 yylloc = exp->loc;
17130 if(exp->destType->kind != 14)
17131 {
17132 char type2[1024];
17133
17134 type2[0] = '\0';
17135 if(inCompiler)
17136 {
17137 char expString[10240];
17138
17139 expString[0] = '\0';
17140 PrintType(exp->destType, type2, 0, 1);
17141 if(inCompiler)
17142 {
17143 PrintExpression(exp, expString);
17144 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17145 }
17146 if(unresolved)
17147 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17148 else if(exp->type != 16)
17149 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17150 }
17151 }
17152 else
17153 {
17154 char expString[10240];
17155
17156 expString[0] = '\0';
17157 if(inCompiler)
17158 {
17159 PrintExpression(exp, expString);
17160 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17161 }
17162 if(unresolved)
17163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17164 else if(exp->type != 16)
17165 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17166 }
17167 }
17168 else
17169 {
17170 char type1[1024];
17171 char type2[1024];
17172
17173 type1[0] = '\0';
17174 type2[0] = '\0';
17175 if(inCompiler)
17176 {
17177 PrintType(exp->expType, type1, 0, 1);
17178 PrintType(exp->destType, type2, 0, 1);
17179 }
17180 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)))
17181 ;
17182 else
17183 {
17184 char expString[10240];
17185
17186 expString[0] = '\0';
17187 if(inCompiler)
17188 {
17189 PrintExpression(exp, expString);
17190 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17191 }
17192 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")))
17193 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17194 FreeType(exp->expType);
17195 exp->destType->refCount++;
17196 exp->expType = exp->destType;
17197 }
17198 }
17199 }
17200 }
17201 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))
17202 {
17203 struct Expression * nbExp = GetNonBracketsExp(exp);
17204
17205 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
17206 {
17207 struct Expression * e = MoveExpContents(exp);
17208
17209 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
17210 exp->type = 11;
17211 exp->__anon1.cast.exp->destType = exp->destType;
17212 if(exp->destType)
17213 exp->destType->refCount++;
17214 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
17215 }
17216 }
17217 }
17218 else if(unresolved)
17219 {
17220 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17221 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);
17222 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17224 }
17225 else if(!exp->expType && exp->type != 16)
17226 {
17227 char expString[10240];
17228
17229 expString[0] = '\0';
17230 if(inCompiler)
17231 {
17232 PrintExpression(exp, expString);
17233 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17234 }
17235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17236 }
17237 if(inCompiler)
17238 ApplyAnyObjectLogic(exp);
17239 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)))
17240 {
17241 exp->byReference = 1;
17242 }
17243 yylloc = oldyylloc;
17244 }
17245
17246 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)
17247 {
17248 if(*curMember)
17249 {
17250 *curMember = (*curMember)->next;
17251 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17252 {
17253 *curMember = subMemberStack[--(*subMemberStackPos)];
17254 *curMember = (*curMember)->next;
17255 }
17256 while((*curMember) && (*curMember)->isProperty)
17257 *curMember = (*curMember)->next;
17258 if(subMemberStackPos)
17259 {
17260 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17261 {
17262 subMemberStack[(*subMemberStackPos)++] = *curMember;
17263 *curMember = (*curMember)->members.first;
17264 while(*curMember && (*curMember)->isProperty)
17265 *curMember = (*curMember)->next;
17266 }
17267 }
17268 }
17269 while(!*curMember)
17270 {
17271 if(!*curMember)
17272 {
17273 if(subMemberStackPos && *subMemberStackPos)
17274 {
17275 *curMember = subMemberStack[--(*subMemberStackPos)];
17276 *curMember = (*curMember)->next;
17277 }
17278 else
17279 {
17280 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17281
17282 if(*curClass == _class)
17283 break;
17284 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17285 ;
17286 *curMember = (*curClass)->membersAndProperties.first;
17287 }
17288 while((*curMember) && (*curMember)->isProperty)
17289 *curMember = (*curMember)->next;
17290 if(subMemberStackPos)
17291 {
17292 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17293 {
17294 subMemberStack[(*subMemberStackPos)++] = *curMember;
17295 *curMember = (*curMember)->members.first;
17296 while(*curMember && (*curMember)->isProperty)
17297 *curMember = (*curMember)->next;
17298 }
17299 }
17300 }
17301 }
17302 }
17303
17304 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17305 {
17306 switch(init->type)
17307 {
17308 case 0:
17309 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17310 {
17311 if(init->__anon1.exp && !init->__anon1.exp->destType)
17312 {
17313 FreeType(init->__anon1.exp->destType);
17314 init->__anon1.exp->destType = type;
17315 if(type)
17316 type->refCount++;
17317 }
17318 if(init->__anon1.exp)
17319 {
17320 ProcessExpressionType(init->__anon1.exp);
17321 init->isConstant = init->__anon1.exp->isConstant;
17322 }
17323 break;
17324 }
17325 else
17326 {
17327 struct Expression * exp = init->__anon1.exp;
17328 struct Instantiation * inst = exp->__anon1.instance;
17329 struct MembersInit * members;
17330
17331 init->type = 1;
17332 init->__anon1.list = MkList();
17333 if(inst->members)
17334 {
17335 for(members = (*inst->members).first; members; members = members->next)
17336 {
17337 if(members->type == 0)
17338 {
17339 struct MemberInit * member;
17340
17341 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17342 {
17343 ListAdd(init->__anon1.list, member->initializer);
17344 member->initializer = (((void *)0));
17345 }
17346 }
17347 }
17348 }
17349 FreeExpression(exp);
17350 }
17351 case 1:
17352 {
17353 struct Initializer * i;
17354 struct Type * initializerType = (((void *)0));
17355 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17356 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17357 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17358 int subMemberStackPos = 0;
17359
17360 if(type && type->kind == 12)
17361 initializerType = Dereference(type);
17362 else if(type && (type->kind == 9 || type->kind == 10))
17363 initializerType = type->__anon1.__anon1.members.first;
17364 for(i = (*init->__anon1.list).first; i; i = i->next)
17365 {
17366 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17367 {
17368 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17369 if(curMember)
17370 {
17371 if(!curMember->dataType)
17372 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17373 initializerType = curMember->dataType;
17374 }
17375 }
17376 ProcessInitializer(i, initializerType);
17377 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17378 initializerType = initializerType->next;
17379 if(!i->isConstant)
17380 init->isConstant = 0;
17381 }
17382 if(type && type->kind == 12)
17383 FreeType(initializerType);
17384 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))
17385 {
17386 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17387 }
17388 break;
17389 }
17390 }
17391 }
17392
17393 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17394
17395 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17396
17397 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17398 {
17399 switch(spec->type)
17400 {
17401 case 0:
17402 {
17403 if(spec->__anon1.specifier == THISCLASS)
17404 {
17405 if(thisClass)
17406 {
17407 spec->type = 1;
17408 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17409 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17410 ProcessSpecifier(spec, declareStruct);
17411 }
17412 }
17413 break;
17414 }
17415 case 1:
17416 {
17417 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17418
17419 if(symbol)
17420 DeclareType(symbol->type, 1, 1);
17421 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17422 DeclareStruct(spec->__anon1.__anon1.name, 0);
17423 break;
17424 }
17425 case 2:
17426 {
17427 struct Enumerator * e;
17428
17429 if(spec->__anon1.__anon2.list)
17430 {
17431 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17432 {
17433 if(e->exp)
17434 ProcessExpressionType(e->exp);
17435 }
17436 }
17437 break;
17438 }
17439 case 3:
17440 case 4:
17441 {
17442 if(spec->__anon1.__anon2.definitions)
17443 {
17444 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17445
17446 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17447 }
17448 break;
17449 }
17450 }
17451 }
17452
17453 static void ProcessDeclarator(struct Declarator * decl)
17454 {
17455 switch(decl->type)
17456 {
17457 case 1:
17458 if(decl->__anon1.identifier->classSym)
17459 {
17460 FreeSpecifier(decl->__anon1.identifier->_class);
17461 decl->__anon1.identifier->_class = (((void *)0));
17462 }
17463 break;
17464 case 3:
17465 if(decl->__anon1.array.exp)
17466 ProcessExpressionType(decl->__anon1.array.exp);
17467 case 0:
17468 case 2:
17469 case 4:
17470 case 5:
17471 case 6:
17472 case 7:
17473 if(decl->declarator)
17474 ProcessDeclarator(decl->declarator);
17475 if(decl->type == 4)
17476 {
17477 struct Identifier * id = GetDeclId(decl);
17478
17479 if(id && id->_class)
17480 {
17481 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17482
17483 if(!decl->__anon1.function.parameters)
17484 decl->__anon1.function.parameters = MkList();
17485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17486 id->_class = (((void *)0));
17487 }
17488 if(decl->__anon1.function.parameters)
17489 {
17490 struct TypeName * param;
17491
17492 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17493 {
17494 if(param->qualifiers && (*param->qualifiers).first)
17495 {
17496 struct Specifier * spec = (*param->qualifiers).first;
17497
17498 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17499 {
17500 struct Declarator * d = param->declarator;
17501 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);
17502
17503 if(d->type != 5)
17504 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17505 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17506 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17507 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17508 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17509 param = newParam;
17510 }
17511 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17512 {
17513 struct Declarator * d = param->declarator;
17514
17515 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17516 param->qualifiers = MkListOne(MkSpecifier(VOID));
17517 if(d->type != 5)
17518 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17519 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17520 }
17521 else if(spec->__anon1.specifier == THISCLASS)
17522 {
17523 if(thisClass)
17524 {
17525 spec->type = 1;
17526 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17527 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17528 ProcessSpecifier(spec, 0);
17529 }
17530 }
17531 }
17532 if(param->declarator)
17533 ProcessDeclarator(param->declarator);
17534 }
17535 }
17536 }
17537 break;
17538 }
17539 }
17540
17541 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17542
17543 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17544
17545 static void ProcessDeclaration(struct Declaration * decl)
17546 {
17547 yylloc = decl->loc;
17548 switch(decl->type)
17549 {
17550 case 1:
17551 {
17552 unsigned int declareStruct = 0;
17553
17554 if(decl->__anon1.__anon1.declarators)
17555 {
17556 struct InitDeclarator * d;
17557
17558 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17559 {
17560 struct Type * type, * subType;
17561
17562 ProcessDeclarator(d->declarator);
17563 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17564 if(d->initializer)
17565 {
17566 ProcessInitializer(d->initializer, type);
17567 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17568 {
17569 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17570 {
17571 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17572
17573 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17574 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17575 if(decl->__anon1.__anon1.specifiers)
17576 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
17577 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
17578 d = (((void *)0));
17579 decl->type = 2;
17580 decl->__anon1.inst = inst;
17581 }
17582 }
17583 }
17584 for(subType = type; subType; )
17585 {
17586 if(subType->kind == 8)
17587 {
17588 declareStruct = 1;
17589 break;
17590 }
17591 else if(subType->kind == 13)
17592 break;
17593 else if(subType->kind == 12)
17594 subType = subType->__anon1.__anon4.arrayType;
17595 else
17596 break;
17597 }
17598 FreeType(type);
17599 if(!d)
17600 break;
17601 }
17602 }
17603 if(decl->__anon1.__anon1.specifiers)
17604 {
17605 struct Specifier * s;
17606
17607 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17608 {
17609 ProcessSpecifier(s, declareStruct);
17610 }
17611 }
17612 break;
17613 }
17614 case 2:
17615 {
17616 ProcessInstantiationType(decl->__anon1.inst);
17617 break;
17618 }
17619 case 0:
17620 {
17621 struct Specifier * spec;
17622 struct Declarator * d;
17623 unsigned int declareStruct = 0;
17624
17625 if(decl->__anon1.__anon1.declarators)
17626 {
17627 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17628 {
17629 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17630 struct Type * subType;
17631
17632 ProcessDeclarator(d);
17633 for(subType = type; subType; )
17634 {
17635 if(subType->kind == 8)
17636 {
17637 declareStruct = 1;
17638 break;
17639 }
17640 else if(subType->kind == 13)
17641 break;
17642 else if(subType->kind == 12)
17643 subType = subType->__anon1.__anon4.arrayType;
17644 else
17645 break;
17646 }
17647 FreeType(type);
17648 }
17649 }
17650 if(decl->__anon1.__anon1.specifiers)
17651 {
17652 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17653 ProcessSpecifier(spec, declareStruct);
17654 }
17655 break;
17656 }
17657 }
17658 }
17659
17660 static struct FunctionDefinition * curFunction;
17661
17662 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17663 {
17664 char propName[1024], propNameM[1024];
17665 char getName[1024], setName[1024];
17666 struct __ecereNameSpace__ecere__sys__OldList * args;
17667
17668 DeclareProperty(prop, setName, getName);
17669 strcpy(propName, "__ecereProp_");
17670 FullClassNameCat(propName, prop->_class->fullName, 0);
17671 strcat(propName, "_");
17672 FullClassNameCat(propName, prop->name, 1);
17673 strcpy(propNameM, "__ecerePropM_");
17674 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17675 strcat(propNameM, "_");
17676 FullClassNameCat(propNameM, prop->name, 1);
17677 if(prop->isWatchable)
17678 {
17679 args = MkList();
17680 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17681 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17682 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17683 args = MkList();
17684 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17685 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17686 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17687 }
17688 {
17689 args = MkList();
17690 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17691 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17692 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17693 args = MkList();
17694 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17695 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17696 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17697 }
17698 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17699 curFunction->propSet->fireWatchersDone = 1;
17700 }
17701
17702 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17703
17704 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17705
17706 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17707
17708 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17709
17710 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17711
17712 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17713
17714 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17715
17716 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17717
17718 static void ProcessStatement(struct Statement * stmt)
17719 {
17720 yylloc = stmt->loc;
17721 switch(stmt->type)
17722 {
17723 case 0:
17724 ProcessStatement(stmt->__anon1.labeled.stmt);
17725 break;
17726 case 1:
17727 if(stmt->__anon1.caseStmt.exp)
17728 {
17729 FreeType(stmt->__anon1.caseStmt.exp->destType);
17730 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17731 if(curSwitchType)
17732 curSwitchType->refCount++;
17733 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17734 ComputeExpression(stmt->__anon1.caseStmt.exp);
17735 }
17736 if(stmt->__anon1.caseStmt.stmt)
17737 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17738 break;
17739 case 2:
17740 {
17741 if(stmt->__anon1.compound.context)
17742 {
17743 struct Declaration * decl;
17744 struct Statement * s;
17745 struct Statement * prevCompound = curCompound;
17746 struct Context * prevContext = curContext;
17747
17748 if(!stmt->__anon1.compound.isSwitch)
17749 curCompound = stmt;
17750 curContext = stmt->__anon1.compound.context;
17751 if(stmt->__anon1.compound.declarations)
17752 {
17753 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17754 ProcessDeclaration(decl);
17755 }
17756 if(stmt->__anon1.compound.statements)
17757 {
17758 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17759 ProcessStatement(s);
17760 }
17761 curContext = prevContext;
17762 curCompound = prevCompound;
17763 }
17764 break;
17765 }
17766 case 3:
17767 {
17768 struct Expression * exp;
17769
17770 if(stmt->__anon1.expressions)
17771 {
17772 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17773 ProcessExpressionType(exp);
17774 }
17775 break;
17776 }
17777 case 4:
17778 {
17779 struct Expression * exp;
17780
17781 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17782 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17783 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17784 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17785 {
17786 ProcessExpressionType(exp);
17787 }
17788 if(stmt->__anon1.ifStmt.stmt)
17789 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17790 if(stmt->__anon1.ifStmt.elseStmt)
17791 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17792 break;
17793 }
17794 case 5:
17795 {
17796 struct Type * oldSwitchType = curSwitchType;
17797
17798 if(stmt->__anon1.switchStmt.exp)
17799 {
17800 struct Expression * exp;
17801
17802 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17803 {
17804 if(!exp->next)
17805 {
17806 ProcessExpressionType(exp);
17807 }
17808 if(!exp->next)
17809 curSwitchType = exp->expType;
17810 }
17811 }
17812 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17813 curSwitchType = oldSwitchType;
17814 break;
17815 }
17816 case 6:
17817 {
17818 if(stmt->__anon1.whileStmt.exp)
17819 {
17820 struct Expression * exp;
17821
17822 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17823 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17824 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17825 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17826 {
17827 ProcessExpressionType(exp);
17828 }
17829 }
17830 if(stmt->__anon1.whileStmt.stmt)
17831 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17832 break;
17833 }
17834 case 7:
17835 {
17836 if(stmt->__anon1.doWhile.exp)
17837 {
17838 struct Expression * exp;
17839
17840 if((*stmt->__anon1.doWhile.exp).last)
17841 {
17842 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17843 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17844 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17845 }
17846 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17847 {
17848 ProcessExpressionType(exp);
17849 }
17850 }
17851 if(stmt->__anon1.doWhile.stmt)
17852 ProcessStatement(stmt->__anon1.doWhile.stmt);
17853 break;
17854 }
17855 case 8:
17856 {
17857 struct Expression * exp;
17858
17859 if(stmt->__anon1.forStmt.init)
17860 ProcessStatement(stmt->__anon1.forStmt.init);
17861 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17862 {
17863 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17864 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17865 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17866 }
17867 if(stmt->__anon1.forStmt.check)
17868 ProcessStatement(stmt->__anon1.forStmt.check);
17869 if(stmt->__anon1.forStmt.increment)
17870 {
17871 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17872 ProcessExpressionType(exp);
17873 }
17874 if(stmt->__anon1.forStmt.stmt)
17875 ProcessStatement(stmt->__anon1.forStmt.stmt);
17876 break;
17877 }
17878 case 18:
17879 {
17880 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17881 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17882 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17883 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17884 char iteratorType[1024];
17885 struct Type * source;
17886 struct Expression * e;
17887 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));
17888 struct Expression * arrayExp;
17889 const char * typeString = (((void *)0));
17890 int builtinCount = 0;
17891
17892 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17893 {
17894 if(!e->next)
17895 {
17896 FreeType(e->destType);
17897 e->destType = ProcessTypeString("Container", 0);
17898 }
17899 if(!isBuiltin || e->next)
17900 ProcessExpressionType(e);
17901 }
17902 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17903 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)))
17904 {
17905 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17906 struct Symbol * symbol;
17907 struct Expression * expIt = (((void *)0));
17908 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17909 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17910 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17911 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17912
17913 stmt->type = 2;
17914 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17915 stmt->__anon1.compound.context->parent = curContext;
17916 curContext = stmt->__anon1.compound.context;
17917 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17918 {
17919 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17920
17921 isCustomAVLTree = 1;
17922 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17923 isMap = 1;
17924 }
17925 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17926 isArray = 1;
17927 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17928 {
17929 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17930
17931 isLinkList = 1;
17932 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17933 }
17934 if(isArray)
17935 {
17936 struct Declarator * decl;
17937 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17938
17939 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17940 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17941 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17942 }
17943 else if(isBuiltin)
17944 {
17945 struct Type * type = (((void *)0));
17946 char typeStringBuf[1024];
17947
17948 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17949 if(((struct Expression *)(*exp).last)->type == 11)
17950 {
17951 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17952
17953 if(typeName)
17954 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17955 }
17956 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)
17957 {
17958 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17959
17960 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17961 }
17962 else if(arrayExp->__anon1.list)
17963 {
17964 struct Expression * e;
17965
17966 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17967 {
17968 ProcessExpressionType(e);
17969 if(e->expType)
17970 {
17971 if(!type)
17972 {
17973 type = e->expType;
17974 type->refCount++;
17975 }
17976 else
17977 {
17978 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17979 {
17980 FreeType(type);
17981 type = e->expType;
17982 e->expType = (((void *)0));
17983 e = (*arrayExp->__anon1.list).first;
17984 ProcessExpressionType(e);
17985 if(e->expType)
17986 {
17987 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17988 {
17989 FreeType(e->expType);
17990 e->expType = (((void *)0));
17991 FreeType(type);
17992 type = (((void *)0));
17993 break;
17994 }
17995 }
17996 }
17997 }
17998 if(e->expType)
17999 {
18000 FreeType(e->expType);
18001 e->expType = (((void *)0));
18002 }
18003 }
18004 }
18005 if(type)
18006 {
18007 typeStringBuf[0] = '\0';
18008 PrintType(type, typeStringBuf, 0, 1);
18009 typeString = typeStringBuf;
18010 FreeType(type);
18011 }
18012 }
18013 if(typeString)
18014 {
18015 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18016 struct Declarator * decl;
18017 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18018
18019 if(arrayExp->__anon1.list)
18020 {
18021 struct Expression * e;
18022
18023 builtinCount = (*arrayExp->__anon1.list).count;
18024 type = ProcessTypeString(typeString, 0);
18025 while((e = (*arrayExp->__anon1.list).first))
18026 {
18027 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
18028 e->destType = type;
18029 type->refCount++;
18030 ProcessExpressionType(e);
18031 ListAdd(initializers, MkInitializerAssignment(e));
18032 }
18033 FreeType(type);
18034 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
18035 }
18036 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
18037 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
18038 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
18039 FreeList(exp, (void *)(FreeExpression));
18040 }
18041 else
18042 {
18043 arrayExp->expType = ProcessTypeString("Container", 0);
18044 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18045 }
18046 }
18047 else if(isLinkList && !isList)
18048 {
18049 struct Declarator * decl;
18050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18051
18052 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18053 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18054 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18055 }
18056 else if(_class->templateArgs)
18057 {
18058 if(isMap)
18059 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18060 else
18061 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18062 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)))))))));
18063 }
18064 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18065 if(block)
18066 {
18067 switch(block->type)
18068 {
18069 case 2:
18070 if(block->__anon1.compound.context)
18071 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18072 break;
18073 case 4:
18074 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18075 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18076 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18077 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18078 break;
18079 case 5:
18080 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18081 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18082 break;
18083 case 6:
18084 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18085 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18086 break;
18087 case 7:
18088 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18089 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18090 break;
18091 case 8:
18092 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18093 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18094 break;
18095 case 18:
18096 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18097 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18098 break;
18099 }
18100 }
18101 if(filter)
18102 {
18103 block = MkIfStmt(filter, block, (((void *)0)));
18104 }
18105 if(isArray)
18106 {
18107 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));
18108 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18109 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18110 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18111 }
18112 else if(isBuiltin)
18113 {
18114 char count[128];
18115
18116 sprintf(count, "%d", builtinCount);
18117 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));
18118 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18119 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18120 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18121 }
18122 else if(isLinkList && !isList)
18123 {
18124 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18125 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18126
18127 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18128 {
18129 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));
18130 }
18131 else
18132 {
18133 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18134 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18135
18136 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));
18137 }
18138 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18139 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18140 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18141 }
18142 else
18143 {
18144 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18145 }
18146 ProcessExpressionType(expIt);
18147 if((*stmt->__anon1.compound.declarations).first)
18148 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18149 if(symbol)
18150 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18151 ProcessStatement(stmt);
18152 curContext = stmt->__anon1.compound.context->parent;
18153 break;
18154 }
18155 else
18156 {
18157 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18158 }
18159 break;
18160 }
18161 case 9:
18162 break;
18163 case 10:
18164 break;
18165 case 11:
18166 break;
18167 case 12:
18168 {
18169 struct Expression * exp;
18170
18171 if(stmt->__anon1.expressions)
18172 {
18173 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18174 {
18175 if(!exp->next)
18176 {
18177 if(curFunction && !curFunction->type)
18178 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18179 FreeType(exp->destType);
18180 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18181 if(exp->destType)
18182 exp->destType->refCount++;
18183 }
18184 ProcessExpressionType(exp);
18185 }
18186 }
18187 break;
18188 }
18189 case 14:
18190 {
18191 ProcessDeclaration(stmt->__anon1.decl);
18192 break;
18193 }
18194 case 13:
18195 {
18196 struct AsmField * field;
18197
18198 if(stmt->__anon1.asmStmt.inputFields)
18199 {
18200 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18201 if(field->expression)
18202 ProcessExpressionType(field->expression);
18203 }
18204 if(stmt->__anon1.asmStmt.outputFields)
18205 {
18206 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18207 if(field->expression)
18208 ProcessExpressionType(field->expression);
18209 }
18210 if(stmt->__anon1.asmStmt.clobberedFields)
18211 {
18212 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18213 {
18214 if(field->expression)
18215 ProcessExpressionType(field->expression);
18216 }
18217 }
18218 break;
18219 }
18220 case 17:
18221 {
18222 struct PropertyWatch * propWatch;
18223 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18224 struct Expression * object = stmt->__anon1._watch.object;
18225 struct Expression * watcher = stmt->__anon1._watch.watcher;
18226
18227 if(watcher)
18228 ProcessExpressionType(watcher);
18229 if(object)
18230 ProcessExpressionType(object);
18231 if(inCompiler)
18232 {
18233 if(watcher || thisClass)
18234 {
18235 struct External * external = curExternal;
18236 struct Context * context = curContext;
18237
18238 stmt->type = 3;
18239 stmt->__anon1.expressions = MkList();
18240 curExternal = external->prev;
18241 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18242 {
18243 struct ClassFunction * func;
18244 char watcherName[1024];
18245 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;
18246 struct External * createdExternal;
18247 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18248
18249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18250 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18251 if(propWatch->deleteWatch)
18252 strcat(watcherName, "_delete");
18253 else
18254 {
18255 struct Identifier * propID;
18256
18257 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18258 {
18259 strcat(watcherName, "_");
18260 strcat(watcherName, propID->string);
18261 }
18262 }
18263 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18264 {
18265 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)));
18266 ProcessClassFunctionBody(func, propWatch->compound);
18267 propWatch->compound = (((void *)0));
18268 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18269 createdExternal->symbol->idCode = external->symbol->idCode;
18270 curExternal = createdExternal;
18271 ProcessFunction(createdExternal->__anon1.function);
18272 {
18273 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18274
18275 externalDecl->__anon1.declaration = decl;
18276 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18277 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18278 }
18279 if(propWatch->deleteWatch)
18280 {
18281 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18282
18283 ListAdd(args, CopyExpression(object));
18284 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18285 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18286 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18287 }
18288 else
18289 {
18290 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18291 struct Identifier * propID;
18292
18293 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18294 {
18295 char propName[1024];
18296 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18297
18298 if(prop)
18299 {
18300 char getName[1024], setName[1024];
18301 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18302
18303 DeclareProperty(prop, setName, getName);
18304 strcpy(propName, "__ecereProp_");
18305 FullClassNameCat(propName, prop->_class->fullName, 0);
18306 strcat(propName, "_");
18307 FullClassNameCat(propName, prop->name, 1);
18308 ListAdd(args, CopyExpression(object));
18309 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18310 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18311 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
18312 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18313 }
18314 else
18315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18316 }
18317 }
18318 }
18319 else
18320 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18321 }
18322 curExternal = external;
18323 curContext = context;
18324 if(watcher)
18325 FreeExpression(watcher);
18326 if(object)
18327 FreeExpression(object);
18328 FreeList(watches, (void *)(FreePropertyWatch));
18329 }
18330 else
18331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18332 }
18333 else
18334 {
18335 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18336 {
18337 ProcessStatement(propWatch->compound);
18338 }
18339 }
18340 break;
18341 }
18342 case 15:
18343 {
18344 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18345 struct Expression * object = stmt->__anon1._watch.object;
18346 struct __ecereNameSpace__ecere__com__Class * _class;
18347
18348 if(object)
18349 ProcessExpressionType(object);
18350 if(inCompiler)
18351 {
18352 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18353 if(_class)
18354 {
18355 struct Identifier * propID;
18356
18357 stmt->type = 3;
18358 stmt->__anon1.expressions = MkList();
18359 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18360 {
18361 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18362 }
18363 else if(!watches)
18364 {
18365 }
18366 if(watches)
18367 {
18368 for(propID = (*watches).first; propID; propID = propID->next)
18369 {
18370 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18371
18372 if(prop)
18373 {
18374 CreateFireWatcher(prop, object, stmt);
18375 }
18376 else
18377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18378 }
18379 }
18380 else
18381 {
18382 struct __ecereNameSpace__ecere__com__Property * prop;
18383 struct __ecereNameSpace__ecere__com__Class * base;
18384
18385 for(base = _class; base; base = base->base)
18386 {
18387 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18388 {
18389 if(prop->isProperty && prop->isWatchable)
18390 {
18391 CreateFireWatcher(prop, object, stmt);
18392 }
18393 }
18394 }
18395 }
18396 if(object)
18397 FreeExpression(object);
18398 FreeList(watches, (void *)(FreeIdentifier));
18399 }
18400 else
18401 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18402 }
18403 break;
18404 }
18405 case 16:
18406 {
18407 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18408 struct Expression * object = stmt->__anon1._watch.object;
18409 struct Expression * watcher = stmt->__anon1._watch.watcher;
18410 struct __ecereNameSpace__ecere__com__Class * _class;
18411
18412 if(object)
18413 ProcessExpressionType(object);
18414 if(watcher)
18415 ProcessExpressionType(watcher);
18416 if(inCompiler)
18417 {
18418 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18419 if(watcher || thisClass)
18420 {
18421 if(_class)
18422 {
18423 struct Identifier * propID;
18424
18425 stmt->type = 3;
18426 stmt->__anon1.expressions = MkList();
18427 if(!watches)
18428 {
18429 struct __ecereNameSpace__ecere__sys__OldList * args;
18430
18431 args = MkList();
18432 ListAdd(args, CopyExpression(object));
18433 ListAdd(args, MkExpConstant("0"));
18434 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18435 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18436 }
18437 else
18438 {
18439 for(propID = (*watches).first; propID; propID = propID->next)
18440 {
18441 char propName[1024];
18442 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18443
18444 if(prop)
18445 {
18446 char getName[1024], setName[1024];
18447 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18448
18449 DeclareProperty(prop, setName, getName);
18450 strcpy(propName, "__ecereProp_");
18451 FullClassNameCat(propName, prop->_class->fullName, 0);
18452 strcat(propName, "_");
18453 FullClassNameCat(propName, prop->name, 1);
18454 ListAdd(args, CopyExpression(object));
18455 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18456 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18457 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18458 }
18459 else
18460 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18461 }
18462 }
18463 if(object)
18464 FreeExpression(object);
18465 if(watcher)
18466 FreeExpression(watcher);
18467 FreeList(watches, (void *)(FreeIdentifier));
18468 }
18469 else
18470 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18471 }
18472 else
18473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18474 }
18475 break;
18476 }
18477 }
18478 }
18479
18480 extern struct Expression * QBrackets(struct Expression * exp);
18481
18482 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18483
18484 extern struct Declarator * QMkPtrDecl(const char *  id);
18485
18486 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18487
18488 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18489
18490 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18491
18492 static void ProcessFunction(struct FunctionDefinition * function)
18493 {
18494 struct Identifier * id = GetDeclId(function->declarator);
18495 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18496 struct Type * type = symbol ? symbol->type : (((void *)0));
18497 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18498 struct Context * oldTopContext = topContext;
18499
18500 yylloc = function->loc;
18501 if(type && type->__anon1.__anon2.thisClass)
18502 {
18503 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18504 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18505 char className[1024];
18506 char structName[1024];
18507 struct Declarator * funcDecl;
18508 struct Symbol * thisSymbol;
18509 unsigned int typedObject = 0;
18510
18511 if(_class && !_class->base)
18512 {
18513 _class = currentClass;
18514 if(_class && !_class->symbol)
18515 _class->symbol = FindClass(_class->fullName);
18516 classSym = _class ? _class->symbol : (((void *)0));
18517 typedObject = 1;
18518 }
18519 thisClass = _class;
18520 if(inCompiler && _class)
18521 {
18522 if(type->kind == 11)
18523 {
18524 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18525 {
18526 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18527
18528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18529 FreeType(param);
18530 }
18531 if(type->classObjectType != 1)
18532 {
18533 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18534 symbol->type->__anon1.__anon2.staticMethod = 1;
18535 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18536 symbol->type->extraParam = 0;
18537 }
18538 }
18539 strcpy(className, "__ecereClass_");
18540 FullClassNameCat(className, _class->fullName, 1);
18541 structName[0] = (char)0;
18542 FullClassNameCat(structName, _class->fullName, 0);
18543 funcDecl = GetFuncDecl(function->declarator);
18544 if(funcDecl)
18545 {
18546 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18547 {
18548 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18549
18550 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18551 {
18552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18553 FreeTypeName(param);
18554 }
18555 }
18556 if(!function->propertyNoThis)
18557 {
18558 struct TypeName * thisParam = (((void *)0));
18559
18560 if(type->classObjectType != 1)
18561 {
18562 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18563 if(!funcDecl->__anon1.function.parameters)
18564 funcDecl->__anon1.function.parameters = MkList();
18565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18566 }
18567 if(typedObject)
18568 {
18569 if(type->classObjectType != 1)
18570 {
18571 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18572 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18573 }
18574 thisParam = __extension__ ({
18575 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18576
18577 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18578 });
18579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18580 }
18581 }
18582 }
18583 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18584 {
18585 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18586
18587 funcDecl = GetFuncDecl(initDecl->declarator);
18588 if(funcDecl)
18589 {
18590 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18591 {
18592 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18593
18594 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18595 {
18596 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18597 FreeTypeName(param);
18598 }
18599 }
18600 if(type->classObjectType != 1)
18601 {
18602 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18603 {
18604 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18605
18606 if(!funcDecl->__anon1.function.parameters)
18607 funcDecl->__anon1.function.parameters = MkList();
18608 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18609 }
18610 }
18611 }
18612 }
18613 }
18614 if(function->body)
18615 {
18616 if(type->classObjectType != 1)
18617 {
18618 thisSymbol = __extension__ ({
18619 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18620
18621 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18622 });
18623 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18624 if(typedObject && thisSymbol->type)
18625 {
18626 thisSymbol->type->classObjectType = 2;
18627 thisSymbol->type->byReference = type->byReference;
18628 thisSymbol->type->typedByReference = type->byReference;
18629 }
18630 }
18631 }
18632 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18633 {
18634 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18635
18636 {
18637 struct __ecereNameSpace__ecere__com__Class * base;
18638
18639 for(base = _class; base && base->type != 1000; base = base->next)
18640 {
18641 for(member = base->membersAndProperties.first; member; member = member->next)
18642 if(!member->isProperty)
18643 break;
18644 if(member)
18645 break;
18646 }
18647 }
18648 for(member = _class->membersAndProperties.first; member; member = member->next)
18649 if(!member->isProperty)
18650 break;
18651 if(member)
18652 {
18653 char pointerName[1024];
18654 struct Declaration * decl;
18655 struct Initializer * initializer;
18656 struct Expression * exp, * bytePtr;
18657
18658 strcpy(pointerName, "__ecerePointer_");
18659 FullClassNameCat(pointerName, _class->fullName, 0);
18660 {
18661 char className[1024];
18662
18663 strcpy(className, "__ecereClass_");
18664 FullClassNameCat(className, classSym->string, 1);
18665 DeclareClass(classSym, className);
18666 }
18667 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18668 if(_class->fixed)
18669 {
18670 char string[256];
18671
18672 sprintf(string, "%d", _class->offset);
18673 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18674 }
18675 else
18676 {
18677 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18678 }
18679 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18680 exp->expType = __extension__ ({
18681 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18682
18683 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18684 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18685
18686 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18687 }), __ecereInstance2;
18688 });
18689 if(function->body)
18690 {
18691 yylloc = function->body->loc;
18692 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18693 {
18694 struct Context * prevContext = curContext;
18695 struct __ecereNameSpace__ecere__sys__OldList * list;
18696
18697 curContext = function->body->__anon1.compound.context;
18698 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18699 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18700 curContext = prevContext;
18701 }
18702 decl->symbol = (((void *)0));
18703 if(!function->body->__anon1.compound.declarations)
18704 function->body->__anon1.compound.declarations = MkList();
18705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18706 }
18707 }
18708 }
18709 }
18710 else
18711 thisClass = (((void *)0));
18712 if(id)
18713 {
18714 FreeSpecifier(id->_class);
18715 id->_class = (((void *)0));
18716 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18717 {
18718 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18719
18720 id = GetDeclId(initDecl->declarator);
18721 FreeSpecifier(id->_class);
18722 id->_class = (((void *)0));
18723 }
18724 }
18725 if(function->body)
18726 topContext = function->body->__anon1.compound.context;
18727 {
18728 struct FunctionDefinition * oldFunction = curFunction;
18729
18730 curFunction = function;
18731 if(function->body)
18732 ProcessStatement(function->body);
18733 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18734 {
18735 struct Statement * prevCompound = curCompound;
18736 struct Context * prevContext = curContext;
18737 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18738
18739 if(!function->body->__anon1.compound.statements)
18740 function->body->__anon1.compound.statements = MkList();
18741 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18742 curCompound = function->body;
18743 curContext = function->body->__anon1.compound.context;
18744 ProcessStatement(fireWatchers);
18745 curContext = prevContext;
18746 curCompound = prevCompound;
18747 }
18748 curFunction = oldFunction;
18749 }
18750 if(function->declarator)
18751 {
18752 ProcessDeclarator(function->declarator);
18753 }
18754 topContext = oldTopContext;
18755 thisClass = oldThisClass;
18756 }
18757
18758 extern void FreeSymbol(struct Symbol * symbol);
18759
18760 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18761
18762 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18763 {
18764 struct ClassDef * def;
18765 struct External * external = curExternal;
18766 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18767
18768 for(def = definitions->first; def; def = def->next)
18769 {
18770 if(def->type == 0)
18771 {
18772 if(def->__anon1.function->declarator)
18773 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18774 else
18775 curExternal = external;
18776 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18777 }
18778 else if(def->type == 2)
18779 {
18780 if(def->__anon1.decl->type == 2)
18781 {
18782 thisClass = regClass;
18783 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18784 thisClass = (((void *)0));
18785 }
18786 else
18787 {
18788 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18789
18790 if(regClass)
18791 thisClass = regClass;
18792 ProcessDeclaration(def->__anon1.decl);
18793 thisClass = backThisClass;
18794 }
18795 }
18796 else if(def->type == 1 && def->__anon1.defProperties)
18797 {
18798 struct MemberInit * defProperty;
18799 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);
18800
18801 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18802 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18803 {
18804 thisClass = regClass;
18805 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18806 thisClass = (((void *)0));
18807 }
18808 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18809 FreeSymbol(thisSymbol);
18810 }
18811 else if(def->type == 3 && def->__anon1.propertyDef)
18812 {
18813 struct PropertyDef * prop = def->__anon1.propertyDef;
18814
18815 thisClass = regClass;
18816 if(prop->setStmt)
18817 {
18818 if(regClass)
18819 {
18820 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18821
18822 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18823 }
18824 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18825 ProcessStatement(prop->setStmt);
18826 }
18827 if(prop->getStmt)
18828 {
18829 if(regClass)
18830 {
18831 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18832
18833 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18834 }
18835 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18836 ProcessStatement(prop->getStmt);
18837 }
18838 if(prop->issetStmt)
18839 {
18840 if(regClass)
18841 {
18842 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18843
18844 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18845 }
18846 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18847 ProcessStatement(prop->issetStmt);
18848 }
18849 thisClass = (((void *)0));
18850 }
18851 else if(def->type == 4 && def->__anon1.propertyWatch)
18852 {
18853 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18854
18855 thisClass = regClass;
18856 if(propertyWatch->compound)
18857 {
18858 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);
18859
18860 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18861 curExternal = (((void *)0));
18862 ProcessStatement(propertyWatch->compound);
18863 }
18864 thisClass = (((void *)0));
18865 }
18866 }
18867 }
18868
18869 void DeclareFunctionUtil(const char * s)
18870 {
18871 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18872
18873 if(function)
18874 {
18875 char name[1024];
18876
18877 name[0] = (char)0;
18878 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18879 strcpy(name, "__ecereFunction_");
18880 FullClassNameCat(name, s, 0);
18881 DeclareFunction(function, name);
18882 }
18883 }
18884
18885 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18886
18887 void ComputeDataTypes()
18888 {
18889 struct External * external;
18890 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18891 struct External * after = (((void *)0));
18892
18893 currentClass = (((void *)0));
18894 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18895 for(external = (*ast).first; external; external = external->next)
18896 {
18897 if(external->type == 1)
18898 {
18899 struct Declaration * decl = external->__anon1.declaration;
18900
18901 if(decl)
18902 {
18903 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18904
18905 if(decls)
18906 {
18907 struct InitDeclarator * initDecl = (*decls).first;
18908
18909 if(initDecl)
18910 {
18911 struct Declarator * declarator = initDecl->declarator;
18912
18913 if(declarator && declarator->type == 1)
18914 {
18915 struct Identifier * id = declarator->__anon1.identifier;
18916
18917 if(id && id->string)
18918 {
18919 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18920 {
18921 external->symbol->id = -1001, external->symbol->idCode = -1001;
18922 after = external;
18923 }
18924 }
18925 }
18926 }
18927 }
18928 }
18929 }
18930 }
18931 {
18932 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18933
18934 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18935 after = e;
18936 }
18937 temp->symbol = __extension__ ({
18938 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18939
18940 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18941 });
18942 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18943 curExternal = temp;
18944 DeclareFunctionUtil("eSystem_New");
18945 DeclareFunctionUtil("eSystem_New0");
18946 DeclareFunctionUtil("eSystem_Renew");
18947 DeclareFunctionUtil("eSystem_Renew0");
18948 DeclareFunctionUtil("eSystem_Delete");
18949 DeclareFunctionUtil("eClass_GetProperty");
18950 DeclareFunctionUtil("eClass_SetProperty");
18951 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18952 DeclareFunctionUtil("eInstance_SetMethod");
18953 DeclareFunctionUtil("eInstance_IncRef");
18954 DeclareFunctionUtil("eInstance_StopWatching");
18955 DeclareFunctionUtil("eInstance_Watch");
18956 DeclareFunctionUtil("eInstance_FireWatchers");
18957 DeclareStruct("ecere::com::Class", 0);
18958 DeclareStruct("ecere::com::Instance", 0);
18959 DeclareStruct("ecere::com::Property", 0);
18960 DeclareStruct("ecere::com::DataMember", 0);
18961 DeclareStruct("ecere::com::Method", 0);
18962 DeclareStruct("ecere::com::SerialBuffer", 0);
18963 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18965 for(external = (*ast).first; external; external = external->next)
18966 {
18967 afterExternal = curExternal = external;
18968 if(external->type == 0)
18969 {
18970 currentClass = external->__anon1.function->_class;
18971 ProcessFunction(external->__anon1.function);
18972 }
18973 else if(external->type == 1)
18974 {
18975 currentClass = (((void *)0));
18976 if(external->__anon1.declaration)
18977 ProcessDeclaration(external->__anon1.declaration);
18978 }
18979 else if(external->type == 2)
18980 {
18981 struct ClassDefinition * _class = external->__anon1._class;
18982
18983 currentClass = external->symbol->__anon1.registered;
18984 if(_class->definitions)
18985 {
18986 ProcessClass(_class->definitions, _class->symbol);
18987 }
18988 if(inCompiler)
18989 {
18990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18991 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18992 }
18993 }
18994 else if(external->type == 4)
18995 {
18996 thisNameSpace = external->__anon1.id->string;
18997 }
18998 }
18999 currentClass = (((void *)0));
19000 thisNameSpace = (((void *)0));
19001 curExternal = (((void *)0));
19002 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
19003 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
19004 }
19005
19006 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);
19007
19008 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);
19009
19010 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
19011
19012 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19013 {
19014 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19015
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19065 __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);
19066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19069 __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);
19070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19082 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19083 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19084 __ecereClass_Conversion = class;
19085 __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);
19086 __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);
19087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19088 __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);
19089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19104 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19105 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19106 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19107 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19108 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19109 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19110 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19111 }
19112
19113 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19114 {
19115
19116 }
19117