compiler/libec (ide): Fixed crash on sentinel property Set
[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 if(!(dest->__anon1.type && dest->__anon1.type->kind == 13 && source->__anon1.type->kind == 8 && source->__anon1.type->__anon1._class && source->__anon1.type->__anon1._class->__anon1.registered && (source->__anon1.type->__anon1._class->__anon1.registered->type != 0 && source->__anon1.type->__anon1._class->__anon1.registered->type != 5) && !source->__anon1.type->byReference))
5377 {
5378 ComputeTypeSize(source->__anon1.type);
5379 ComputeTypeSize(dest->__anon1.type);
5380 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))
5381 return 1;
5382 }
5383 }
5384 }
5385 return 0;
5386 }
5387
5388 static void FreeConvert(struct Conversion * convert)
5389 {
5390 if(convert->resultType)
5391 FreeType(convert->resultType);
5392 }
5393
5394 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5395
5396 struct __ecereNameSpace__ecere__com__BTNamedLink
5397 {
5398 const char *  name;
5399 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5400 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5401 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5402 int depth;
5403 void *  data;
5404 } __attribute__ ((gcc_struct));
5405
5406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5407
5408 struct __ecereNameSpace__ecere__com__EnumClassData
5409 {
5410 struct __ecereNameSpace__ecere__sys__OldList values;
5411 long long largest;
5412 } __attribute__ ((gcc_struct));
5413
5414 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5415
5416 struct __ecereNameSpace__ecere__sys__NamedLink64
5417 {
5418 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5419 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5420 char *  name;
5421 long long data;
5422 } __attribute__ ((gcc_struct));
5423
5424 extern unsigned int inPreCompiler;
5425
5426 extern unsigned int inDebugger;
5427
5428 extern void FreeExpContents(struct Expression * exp);
5429
5430 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5431
5432 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5433
5434 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5435
5436 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5437
5438 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5439
5440 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5441 {
5442 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5443
5444 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)))
5445 {
5446 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5447
5448 if(_class->type == 4)
5449 {
5450 struct __ecereNameSpace__ecere__sys__OldList converts =
5451 {
5452 0, 0, 0, 0, 0
5453 };
5454 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5455
5456 type->kind = 8;
5457 if(!_class->symbol)
5458 _class->symbol = FindClass(_class->fullName);
5459 type->__anon1._class = _class->symbol;
5460 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), dest->kind != 8 || !dest->__anon1._class || strcmp(dest->__anon1._class->string, "bool"), 0, 0, 0, 0))
5461 {
5462 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5463 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5464
5465 if(enumClass)
5466 {
5467 struct __ecereNameSpace__ecere__com__Class * baseClass;
5468
5469 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5470 {
5471 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5472
5473 for(value = e->values.first; value; value = value->next)
5474 {
5475 if(!strcmp(value->name, string))
5476 break;
5477 }
5478 if(value)
5479 {
5480 FreeType(sourceExp->expType);
5481 sourceExp->isConstant = 1;
5482 sourceExp->expType = MkClassType(baseClass->fullName);
5483 if(inCompiler || inPreCompiler || inDebugger)
5484 {
5485 char constant[256];
5486
5487 FreeExpContents(sourceExp);
5488 sourceExp->type = 2;
5489 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5490 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5491 else
5492 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5493 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5494 }
5495 while(converts.first)
5496 {
5497 struct Conversion * convert = converts.first;
5498
5499 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5501 }
5502 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5503 return 1;
5504 }
5505 }
5506 }
5507 }
5508 if(converts.first)
5509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
5510 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5511 }
5512 }
5513 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)))
5514 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5515 return 1;
5516 return 0;
5517 }
5518
5519 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5520
5521 struct __ecereNameSpace__ecere__com__SubModule
5522 {
5523 struct __ecereNameSpace__ecere__com__SubModule * prev;
5524 struct __ecereNameSpace__ecere__com__SubModule * next;
5525 struct __ecereNameSpace__ecere__com__Instance * module;
5526 int importMode;
5527 } __attribute__ ((gcc_struct));
5528
5529 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5530 {
5531 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5532
5533 if(searchFor == searchIn)
5534 return 1;
5535 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5536 {
5537 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5538 {
5539 if(ModuleVisibility(subModule->module, searchFor))
5540 return 1;
5541 }
5542 }
5543 return 0;
5544 }
5545
5546 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5547
5548 struct __ecereNameSpace__ecere__com__Application
5549 {
5550 int argc;
5551 const char * *  argv;
5552 int exitCode;
5553 unsigned int isGUIApp;
5554 struct __ecereNameSpace__ecere__sys__OldList allModules;
5555 char *  parsedCommand;
5556 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5557 } __attribute__ ((gcc_struct));
5558
5559 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5560 {
5561 struct __ecereNameSpace__ecere__com__Instance * module;
5562
5563 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))
5564 return 1;
5565 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))
5566 return 1;
5567 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))
5568 return 1;
5569 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)
5570 {
5571 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5572 return 1;
5573 }
5574 return 0;
5575 }
5576
5577 extern struct Expression * CopyExpression(struct Expression * exp);
5578
5579 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5580
5581 void ReadString(char *  output, char *  string);
5582
5583 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5584
5585 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5586
5587 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5588
5589 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5590 {
5591 struct Type * source;
5592 struct Type * realDest = dest;
5593 struct Type * backupSourceExpType = (((void *)0));
5594 struct Expression * computedExp = sourceExp;
5595
5596 dest->refCount++;
5597 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)
5598 {
5599 computedExp = CopyExpression(sourceExp);
5600 ComputeExpression(computedExp);
5601 }
5602 source = sourceExp->expType;
5603 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5604 {
5605 if(computedExp != sourceExp)
5606 {
5607 FreeExpression(computedExp);
5608 computedExp = sourceExp;
5609 }
5610 FreeType(dest);
5611 return 1;
5612 }
5613 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5614 {
5615 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5616 {
5617 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5618
5619 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5620 ;
5621 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5622 ;
5623 if(sourceBase == destBase)
5624 {
5625 if(computedExp != sourceExp)
5626 {
5627 FreeExpression(computedExp);
5628 computedExp = sourceExp;
5629 }
5630 FreeType(dest);
5631 return 1;
5632 }
5633 }
5634 }
5635 if(source)
5636 {
5637 struct __ecereNameSpace__ecere__sys__OldList * specs;
5638 unsigned int flag = 0;
5639 long long value = (((int)0x7fffffff));
5640
5641 source->refCount++;
5642 if(computedExp->type == 2)
5643 {
5644 if(source->isSigned)
5645 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5646 else
5647 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5648 }
5649 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5650 {
5651 if(source->isSigned)
5652 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5653 else
5654 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5655 }
5656 if(computedExp != sourceExp)
5657 {
5658 FreeExpression(computedExp);
5659 computedExp = sourceExp;
5660 }
5661 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"))
5662 {
5663 FreeType(source);
5664 source = __extension__ ({
5665 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5666
5667 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5668 });
5669 }
5670 if(dest->kind == 8)
5671 {
5672 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5673
5674 if(_class && _class->type == 3)
5675 {
5676 if(source->kind != 8)
5677 {
5678 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5679 struct Type * tempDest, * tempSource;
5680
5681 for(; _class->base->type != 1000; _class = _class->base)
5682 ;
5683 tempSource = dest;
5684 tempDest = tempType;
5685 tempType->kind = 8;
5686 if(!_class->symbol)
5687 _class->symbol = FindClass(_class->fullName);
5688 tempType->__anon1._class = _class->symbol;
5689 tempType->truth = dest->truth;
5690 if(tempType->__anon1._class)
5691 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5692 backupSourceExpType = sourceExp->expType;
5693 sourceExp->expType = dest;
5694 dest->refCount++;
5695 flag = 1;
5696 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5697 }
5698 }
5699 if(_class && _class->type == 2 && source->kind != 8)
5700 {
5701 if(!dest->__anon1._class->__anon1.registered->dataType)
5702 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5703 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5704 {
5705 FreeType(source);
5706 FreeType(sourceExp->expType);
5707 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5708 source->refCount++;
5709 }
5710 }
5711 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5712 {
5713 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5714 struct Declarator * decl;
5715 char string[1024];
5716
5717 ReadString(string, sourceExp->__anon1.__anon2.string);
5718 decl = SpecDeclFromString(string, specs, (((void *)0)));
5719 FreeExpContents(sourceExp);
5720 FreeType(sourceExp->expType);
5721 sourceExp->type = 24;
5722 sourceExp->__anon1._classExp.specifiers = specs;
5723 sourceExp->__anon1._classExp.decl = decl;
5724 sourceExp->expType = dest;
5725 dest->refCount++;
5726 FreeType(source);
5727 FreeType(dest);
5728 if(backupSourceExpType)
5729 FreeType(backupSourceExpType);
5730 return 1;
5731 }
5732 }
5733 else if(source->kind == 8)
5734 {
5735 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5736
5737 if(_class && (_class->type == 3 || _class->type == 2))
5738 {
5739 if(dest->kind != 8)
5740 {
5741 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5742 struct Type * tempDest, * tempSource;
5743
5744 if(!source->__anon1._class->__anon1.registered->dataType)
5745 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5746 for(; _class->base->type != 1000; _class = _class->base)
5747 ;
5748 tempDest = source;
5749 tempSource = tempType;
5750 tempType->kind = 8;
5751 tempType->__anon1._class = FindClass(_class->fullName);
5752 tempType->truth = source->truth;
5753 tempType->classObjectType = source->classObjectType;
5754 if(tempType->__anon1._class)
5755 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5756 if(conversions && conversions->last)
5757 {
5758 ((struct Conversion *)conversions->last)->resultType = dest;
5759 dest->refCount++;
5760 }
5761 FreeType(sourceExp->expType);
5762 sourceExp->expType = MkClassType(_class->fullName);
5763 sourceExp->expType->truth = source->truth;
5764 sourceExp->expType->classObjectType = source->classObjectType;
5765 if(!sourceExp->destType)
5766 {
5767 FreeType(sourceExp->destType);
5768 sourceExp->destType = sourceExp->expType;
5769 if(sourceExp->expType)
5770 sourceExp->expType->refCount++;
5771 }
5772 if(!_class->dataType)
5773 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5774 FreeType(dest);
5775 dest = MkClassType(source->__anon1._class->string);
5776 dest->truth = source->truth;
5777 dest->classObjectType = source->classObjectType;
5778 FreeType(source);
5779 source = _class->dataType;
5780 source->refCount++;
5781 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5782 }
5783 }
5784 }
5785 if(!flag)
5786 {
5787 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5788 {
5789 FreeType(source);
5790 FreeType(dest);
5791 return 1;
5792 }
5793 }
5794 if(dest->kind == 8)
5795 {
5796 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5797 unsigned int fittingValue = 0;
5798
5799 if(_class && _class->type == 4)
5800 {
5801 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5802 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5803
5804 if(c && value >= 0 && value <= c->largest)
5805 fittingValue = 1;
5806 }
5807 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5808 {
5809 if(_class->type == 0 || _class->type == 5)
5810 {
5811 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5812
5813 *newExp = *sourceExp;
5814 if(sourceExp->destType)
5815 sourceExp->destType->refCount++;
5816 if(sourceExp->expType)
5817 sourceExp->expType->refCount++;
5818 sourceExp->type = 11;
5819 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5820 sourceExp->__anon1.cast.exp = newExp;
5821 FreeType(sourceExp->expType);
5822 sourceExp->expType = (((void *)0));
5823 ProcessExpressionType(sourceExp);
5824 if(!inCompiler)
5825 {
5826 FreeType(sourceExp->expType);
5827 sourceExp->expType = dest;
5828 }
5829 FreeType(source);
5830 if(inCompiler)
5831 FreeType(dest);
5832 if(backupSourceExpType)
5833 FreeType(backupSourceExpType);
5834 return 1;
5835 }
5836 if(!_class->dataType)
5837 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5838 FreeType(dest);
5839 dest = _class->dataType;
5840 dest->refCount++;
5841 }
5842 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))
5843 {
5844 specs = MkListOne(MkSpecifier(DOUBLE));
5845 }
5846 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))
5847 {
5848 specs = MkListOne(MkSpecifier(FLOAT));
5849 }
5850 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))
5851 {
5852 specs = MkList();
5853 if(!dest->isSigned)
5854 ListAdd(specs, MkSpecifier(UNSIGNED));
5855 ListAdd(specs, MkSpecifier(INT64));
5856 }
5857 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5858 {
5859 specs = MkList();
5860 if(!dest->isSigned)
5861 ListAdd(specs, MkSpecifier(UNSIGNED));
5862 ListAdd(specs, MkSpecifier(INT));
5863 }
5864 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5865 {
5866 specs = MkList();
5867 if(!dest->isSigned)
5868 ListAdd(specs, MkSpecifier(UNSIGNED));
5869 ListAdd(specs, MkSpecifier(SHORT));
5870 }
5871 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5872 {
5873 specs = MkList();
5874 if(!dest->isSigned)
5875 ListAdd(specs, MkSpecifier(UNSIGNED));
5876 ListAdd(specs, MkSpecifier(CHAR));
5877 }
5878 else
5879 {
5880 FreeType(source);
5881 FreeType(dest);
5882 if(backupSourceExpType)
5883 {
5884 if(sourceExp->expType)
5885 FreeType(sourceExp->expType);
5886 sourceExp->expType = backupSourceExpType;
5887 }
5888 return 0;
5889 }
5890 }
5891 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))
5892 {
5893 specs = MkListOne(MkSpecifier(DOUBLE));
5894 }
5895 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))
5896 {
5897 specs = MkListOne(MkSpecifier(FLOAT));
5898 }
5899 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5900 {
5901 specs = MkList();
5902 ListAdd(specs, MkSpecifier(BOOL));
5903 }
5904 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)))
5905 {
5906 specs = MkList();
5907 if(!dest->isSigned)
5908 ListAdd(specs, MkSpecifier(UNSIGNED));
5909 ListAdd(specs, MkSpecifier(CHAR));
5910 }
5911 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)))))
5912 {
5913 specs = MkList();
5914 if(!dest->isSigned)
5915 ListAdd(specs, MkSpecifier(UNSIGNED));
5916 ListAdd(specs, MkSpecifier(SHORT));
5917 }
5918 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5919 {
5920 specs = MkList();
5921 if(!dest->isSigned)
5922 ListAdd(specs, MkSpecifier(UNSIGNED));
5923 ListAdd(specs, MkSpecifier(INT));
5924 }
5925 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5926 {
5927 specs = MkList();
5928 if(!dest->isSigned)
5929 ListAdd(specs, MkSpecifier(UNSIGNED));
5930 ListAdd(specs, MkSpecifier(INT64));
5931 }
5932 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5933 {
5934 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5935 }
5936 else
5937 {
5938 FreeType(source);
5939 FreeType(dest);
5940 if(backupSourceExpType)
5941 {
5942 if(sourceExp->expType)
5943 FreeType(sourceExp->expType);
5944 sourceExp->expType = backupSourceExpType;
5945 }
5946 return 0;
5947 }
5948 if(!flag && !sourceExp->opDestType)
5949 {
5950 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5951
5952 *newExp = *sourceExp;
5953 newExp->prev = (((void *)0));
5954 newExp->next = (((void *)0));
5955 if(sourceExp->destType)
5956 sourceExp->destType->refCount++;
5957 if(sourceExp->expType)
5958 sourceExp->expType->refCount++;
5959 sourceExp->type = 11;
5960 if(realDest->kind == 8)
5961 {
5962 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5963 FreeList(specs, (void *)(FreeSpecifier));
5964 }
5965 else
5966 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5967 if(newExp->type == 4)
5968 {
5969 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5970 }
5971 else
5972 sourceExp->__anon1.cast.exp = newExp;
5973 FreeType(sourceExp->expType);
5974 sourceExp->expType = (((void *)0));
5975 ProcessExpressionType(sourceExp);
5976 }
5977 else
5978 FreeList(specs, (void *)(FreeSpecifier));
5979 FreeType(dest);
5980 FreeType(source);
5981 if(backupSourceExpType)
5982 FreeType(backupSourceExpType);
5983 return 1;
5984 }
5985 else
5986 {
5987 if(computedExp != sourceExp)
5988 {
5989 FreeExpression(computedExp);
5990 computedExp = sourceExp;
5991 }
5992 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5993 sourceExp = (*sourceExp->__anon1.list).last;
5994 if(sourceExp->type == 0)
5995 {
5996 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5997
5998 if(dest->kind == 8)
5999 {
6000 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
6001 {
6002 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
6003 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
6004
6005 if(enumClass)
6006 {
6007 for(; _class && _class->type == 4; _class = _class->base)
6008 {
6009 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
6010 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
6011
6012 for(value = e->values.first; value; value = value->next)
6013 {
6014 if(!strcmp(value->name, id->string))
6015 break;
6016 }
6017 if(value)
6018 {
6019 FreeType(sourceExp->expType);
6020 sourceExp->isConstant = 1;
6021 sourceExp->expType = MkClassType(_class->fullName);
6022 if(inCompiler || inPreCompiler || inDebugger)
6023 {
6024 FreeExpContents(sourceExp);
6025 sourceExp->type = 2;
6026 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
6027 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
6028 else
6029 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
6030 }
6031 FreeType(dest);
6032 return 1;
6033 }
6034 }
6035 }
6036 }
6037 }
6038 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
6039 {
6040 FreeType(dest);
6041 return 1;
6042 }
6043 }
6044 FreeType(dest);
6045 }
6046 return 0;
6047 }
6048
6049 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6050 {
6051 int value2 = op2->__anon1.i;
6052
6053 exp->type = 2;
6054 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6055 if(!exp->expType)
6056 {
6057 exp->expType = op1->type;
6058 if(op1->type)
6059 op1->type->refCount++;
6060 }
6061 return 1;
6062 }
6063
6064 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6065 {
6066 unsigned int value2 = op2->__anon1.ui;
6067
6068 exp->type = 2;
6069 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6070 if(!exp->expType)
6071 {
6072 exp->expType = op1->type;
6073 if(op1->type)
6074 op1->type->refCount++;
6075 }
6076 return 1;
6077 }
6078
6079 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6080 {
6081 long long value2 = op2->__anon1.i64;
6082
6083 exp->type = 2;
6084 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6085 if(!exp->expType)
6086 {
6087 exp->expType = op1->type;
6088 if(op1->type)
6089 op1->type->refCount++;
6090 }
6091 return 1;
6092 }
6093
6094 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6095 {
6096 uint64 value2 = op2->__anon1.ui64;
6097
6098 exp->type = 2;
6099 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6100 if(!exp->expType)
6101 {
6102 exp->expType = op1->type;
6103 if(op1->type)
6104 op1->type->refCount++;
6105 }
6106 return 1;
6107 }
6108
6109 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6110 {
6111 short value2 = op2->__anon1.s;
6112
6113 exp->type = 2;
6114 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6115 if(!exp->expType)
6116 {
6117 exp->expType = op1->type;
6118 if(op1->type)
6119 op1->type->refCount++;
6120 }
6121 return 1;
6122 }
6123
6124 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6125 {
6126 unsigned short value2 = op2->__anon1.us;
6127
6128 exp->type = 2;
6129 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6130 if(!exp->expType)
6131 {
6132 exp->expType = op1->type;
6133 if(op1->type)
6134 op1->type->refCount++;
6135 }
6136 return 1;
6137 }
6138
6139 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6140 {
6141 char value2 = op2->__anon1.c;
6142
6143 exp->type = 2;
6144 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6145 if(!exp->expType)
6146 {
6147 exp->expType = op1->type;
6148 if(op1->type)
6149 op1->type->refCount++;
6150 }
6151 return 1;
6152 }
6153
6154 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6155 {
6156 unsigned char value2 = op2->__anon1.uc;
6157
6158 exp->type = 2;
6159 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6160 if(!exp->expType)
6161 {
6162 exp->expType = op1->type;
6163 if(op1->type)
6164 op1->type->refCount++;
6165 }
6166 return 1;
6167 }
6168
6169 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6170 {
6171 float value2 = op2->__anon1.f;
6172
6173 exp->type = 2;
6174 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 1;
6182 }
6183
6184 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6185 {
6186 double value2 = op2->__anon1.d;
6187
6188 exp->type = 2;
6189 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6190 if(!exp->expType)
6191 {
6192 exp->expType = op1->type;
6193 if(op1->type)
6194 op1->type->refCount++;
6195 }
6196 return 1;
6197 }
6198
6199 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6200 {
6201 int value2 = op2->__anon1.i;
6202
6203 exp->type = 2;
6204 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6205 if(!exp->expType)
6206 {
6207 exp->expType = op1->type;
6208 if(op1->type)
6209 op1->type->refCount++;
6210 }
6211 return 1;
6212 }
6213
6214 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6215 {
6216 unsigned int value2 = op2->__anon1.ui;
6217
6218 exp->type = 2;
6219 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6220 if(!exp->expType)
6221 {
6222 exp->expType = op1->type;
6223 if(op1->type)
6224 op1->type->refCount++;
6225 }
6226 return 1;
6227 }
6228
6229 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6230 {
6231 long long value2 = op2->__anon1.i64;
6232
6233 exp->type = 2;
6234 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6235 if(!exp->expType)
6236 {
6237 exp->expType = op1->type;
6238 if(op1->type)
6239 op1->type->refCount++;
6240 }
6241 return 1;
6242 }
6243
6244 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6245 {
6246 uint64 value2 = op2->__anon1.ui64;
6247
6248 exp->type = 2;
6249 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6250 if(!exp->expType)
6251 {
6252 exp->expType = op1->type;
6253 if(op1->type)
6254 op1->type->refCount++;
6255 }
6256 return 1;
6257 }
6258
6259 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6260 {
6261 short value2 = op2->__anon1.s;
6262
6263 exp->type = 2;
6264 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6265 if(!exp->expType)
6266 {
6267 exp->expType = op1->type;
6268 if(op1->type)
6269 op1->type->refCount++;
6270 }
6271 return 1;
6272 }
6273
6274 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6275 {
6276 unsigned short value2 = op2->__anon1.us;
6277
6278 exp->type = 2;
6279 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6280 if(!exp->expType)
6281 {
6282 exp->expType = op1->type;
6283 if(op1->type)
6284 op1->type->refCount++;
6285 }
6286 return 1;
6287 }
6288
6289 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6290 {
6291 char value2 = op2->__anon1.c;
6292
6293 exp->type = 2;
6294 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6295 if(!exp->expType)
6296 {
6297 exp->expType = op1->type;
6298 if(op1->type)
6299 op1->type->refCount++;
6300 }
6301 return 1;
6302 }
6303
6304 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6305 {
6306 unsigned char value2 = op2->__anon1.uc;
6307
6308 exp->type = 2;
6309 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6310 if(!exp->expType)
6311 {
6312 exp->expType = op1->type;
6313 if(op1->type)
6314 op1->type->refCount++;
6315 }
6316 return 1;
6317 }
6318
6319 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6320 {
6321 float value2 = op2->__anon1.f;
6322
6323 exp->type = 2;
6324 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6325 if(!exp->expType)
6326 {
6327 exp->expType = op1->type;
6328 if(op1->type)
6329 op1->type->refCount++;
6330 }
6331 return 1;
6332 }
6333
6334 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6335 {
6336 double value2 = op2->__anon1.d;
6337
6338 exp->type = 2;
6339 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6340 if(!exp->expType)
6341 {
6342 exp->expType = op1->type;
6343 if(op1->type)
6344 op1->type->refCount++;
6345 }
6346 return 1;
6347 }
6348
6349 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6350 {
6351 int value2 = op2->__anon1.i;
6352
6353 exp->type = 2;
6354 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6355 if(!exp->expType)
6356 {
6357 exp->expType = op1->type;
6358 if(op1->type)
6359 op1->type->refCount++;
6360 }
6361 return 1;
6362 }
6363
6364 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6365 {
6366 unsigned int value2 = op2->__anon1.ui;
6367
6368 exp->type = 2;
6369 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6370 if(!exp->expType)
6371 {
6372 exp->expType = op1->type;
6373 if(op1->type)
6374 op1->type->refCount++;
6375 }
6376 return 1;
6377 }
6378
6379 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6380 {
6381 long long value2 = op2->__anon1.i64;
6382
6383 exp->type = 2;
6384 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6385 if(!exp->expType)
6386 {
6387 exp->expType = op1->type;
6388 if(op1->type)
6389 op1->type->refCount++;
6390 }
6391 return 1;
6392 }
6393
6394 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6395 {
6396 uint64 value2 = op2->__anon1.ui64;
6397
6398 exp->type = 2;
6399 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6400 if(!exp->expType)
6401 {
6402 exp->expType = op1->type;
6403 if(op1->type)
6404 op1->type->refCount++;
6405 }
6406 return 1;
6407 }
6408
6409 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6410 {
6411 short value2 = op2->__anon1.s;
6412
6413 exp->type = 2;
6414 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6415 if(!exp->expType)
6416 {
6417 exp->expType = op1->type;
6418 if(op1->type)
6419 op1->type->refCount++;
6420 }
6421 return 1;
6422 }
6423
6424 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6425 {
6426 unsigned short value2 = op2->__anon1.us;
6427
6428 exp->type = 2;
6429 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6430 if(!exp->expType)
6431 {
6432 exp->expType = op1->type;
6433 if(op1->type)
6434 op1->type->refCount++;
6435 }
6436 return 1;
6437 }
6438
6439 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6440 {
6441 char value2 = op2->__anon1.c;
6442
6443 exp->type = 2;
6444 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6445 if(!exp->expType)
6446 {
6447 exp->expType = op1->type;
6448 if(op1->type)
6449 op1->type->refCount++;
6450 }
6451 return 1;
6452 }
6453
6454 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 {
6456 unsigned char value2 = op2->__anon1.uc;
6457
6458 exp->type = 2;
6459 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6460 if(!exp->expType)
6461 {
6462 exp->expType = op1->type;
6463 if(op1->type)
6464 op1->type->refCount++;
6465 }
6466 return 1;
6467 }
6468
6469 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 {
6471 float value2 = op2->__anon1.f;
6472
6473 exp->type = 2;
6474 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6475 if(!exp->expType)
6476 {
6477 exp->expType = op1->type;
6478 if(op1->type)
6479 op1->type->refCount++;
6480 }
6481 return 1;
6482 }
6483
6484 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 {
6486 double value2 = op2->__anon1.d;
6487
6488 exp->type = 2;
6489 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6490 if(!exp->expType)
6491 {
6492 exp->expType = op1->type;
6493 if(op1->type)
6494 op1->type->refCount++;
6495 }
6496 return 1;
6497 }
6498
6499 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6500 {
6501 int value2 = op2->__anon1.i;
6502
6503 exp->type = 2;
6504 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6505 if(!exp->expType)
6506 {
6507 exp->expType = op1->type;
6508 if(op1->type)
6509 op1->type->refCount++;
6510 }
6511 return 1;
6512 }
6513
6514 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6515 {
6516 unsigned int value2 = op2->__anon1.ui;
6517
6518 exp->type = 2;
6519 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6520 if(!exp->expType)
6521 {
6522 exp->expType = op1->type;
6523 if(op1->type)
6524 op1->type->refCount++;
6525 }
6526 return 1;
6527 }
6528
6529 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6530 {
6531 long long value2 = op2->__anon1.i64;
6532
6533 exp->type = 2;
6534 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6535 if(!exp->expType)
6536 {
6537 exp->expType = op1->type;
6538 if(op1->type)
6539 op1->type->refCount++;
6540 }
6541 return 1;
6542 }
6543
6544 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6545 {
6546 uint64 value2 = op2->__anon1.ui64;
6547
6548 exp->type = 2;
6549 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6550 if(!exp->expType)
6551 {
6552 exp->expType = op1->type;
6553 if(op1->type)
6554 op1->type->refCount++;
6555 }
6556 return 1;
6557 }
6558
6559 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6560 {
6561 short value2 = op2->__anon1.s;
6562
6563 exp->type = 2;
6564 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6565 if(!exp->expType)
6566 {
6567 exp->expType = op1->type;
6568 if(op1->type)
6569 op1->type->refCount++;
6570 }
6571 return 1;
6572 }
6573
6574 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6575 {
6576 unsigned short value2 = op2->__anon1.us;
6577
6578 exp->type = 2;
6579 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6580 if(!exp->expType)
6581 {
6582 exp->expType = op1->type;
6583 if(op1->type)
6584 op1->type->refCount++;
6585 }
6586 return 1;
6587 }
6588
6589 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6590 {
6591 char value2 = op2->__anon1.c;
6592
6593 exp->type = 2;
6594 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6595 if(!exp->expType)
6596 {
6597 exp->expType = op1->type;
6598 if(op1->type)
6599 op1->type->refCount++;
6600 }
6601 return 1;
6602 }
6603
6604 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6605 {
6606 unsigned char value2 = op2->__anon1.uc;
6607
6608 exp->type = 2;
6609 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6610 if(!exp->expType)
6611 {
6612 exp->expType = op1->type;
6613 if(op1->type)
6614 op1->type->refCount++;
6615 }
6616 return 1;
6617 }
6618
6619 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6620 {
6621 float value2 = op2->__anon1.f;
6622
6623 exp->type = 2;
6624 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6625 if(!exp->expType)
6626 {
6627 exp->expType = op1->type;
6628 if(op1->type)
6629 op1->type->refCount++;
6630 }
6631 return 1;
6632 }
6633
6634 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6635 {
6636 double value2 = op2->__anon1.d;
6637
6638 exp->type = 2;
6639 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6640 if(!exp->expType)
6641 {
6642 exp->expType = op1->type;
6643 if(op1->type)
6644 op1->type->refCount++;
6645 }
6646 return 1;
6647 }
6648
6649 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6650 {
6651 int value2 = op2->__anon1.i;
6652
6653 exp->type = 2;
6654 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6655 if(!exp->expType)
6656 {
6657 exp->expType = op1->type;
6658 if(op1->type)
6659 op1->type->refCount++;
6660 }
6661 return 1;
6662 }
6663
6664 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6665 {
6666 unsigned int value2 = op2->__anon1.ui;
6667
6668 exp->type = 2;
6669 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6670 if(!exp->expType)
6671 {
6672 exp->expType = op1->type;
6673 if(op1->type)
6674 op1->type->refCount++;
6675 }
6676 return 1;
6677 }
6678
6679 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6680 {
6681 long long value2 = op2->__anon1.i64;
6682
6683 exp->type = 2;
6684 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6685 if(!exp->expType)
6686 {
6687 exp->expType = op1->type;
6688 if(op1->type)
6689 op1->type->refCount++;
6690 }
6691 return 1;
6692 }
6693
6694 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6695 {
6696 uint64 value2 = op2->__anon1.ui64;
6697
6698 exp->type = 2;
6699 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6700 if(!exp->expType)
6701 {
6702 exp->expType = op1->type;
6703 if(op1->type)
6704 op1->type->refCount++;
6705 }
6706 return 1;
6707 }
6708
6709 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6710 {
6711 short value2 = op2->__anon1.s;
6712
6713 exp->type = 2;
6714 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6715 if(!exp->expType)
6716 {
6717 exp->expType = op1->type;
6718 if(op1->type)
6719 op1->type->refCount++;
6720 }
6721 return 1;
6722 }
6723
6724 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6725 {
6726 unsigned short value2 = op2->__anon1.us;
6727
6728 exp->type = 2;
6729 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6730 if(!exp->expType)
6731 {
6732 exp->expType = op1->type;
6733 if(op1->type)
6734 op1->type->refCount++;
6735 }
6736 return 1;
6737 }
6738
6739 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6740 {
6741 char value2 = op2->__anon1.c;
6742
6743 exp->type = 2;
6744 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6745 if(!exp->expType)
6746 {
6747 exp->expType = op1->type;
6748 if(op1->type)
6749 op1->type->refCount++;
6750 }
6751 return 1;
6752 }
6753
6754 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6755 {
6756 unsigned char value2 = op2->__anon1.uc;
6757
6758 exp->type = 2;
6759 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6760 if(!exp->expType)
6761 {
6762 exp->expType = op1->type;
6763 if(op1->type)
6764 op1->type->refCount++;
6765 }
6766 return 1;
6767 }
6768
6769 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6770 {
6771 exp->type = 2;
6772 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6773 if(!exp->expType)
6774 {
6775 exp->expType = op1->type;
6776 if(op1->type)
6777 op1->type->refCount++;
6778 }
6779 return 1;
6780 }
6781
6782 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6783 {
6784 exp->type = 2;
6785 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6786 if(!exp->expType)
6787 {
6788 exp->expType = op1->type;
6789 if(op1->type)
6790 op1->type->refCount++;
6791 }
6792 return 1;
6793 }
6794
6795 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6796 {
6797 exp->type = 2;
6798 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6799 if(!exp->expType)
6800 {
6801 exp->expType = op1->type;
6802 if(op1->type)
6803 op1->type->refCount++;
6804 }
6805 return 1;
6806 }
6807
6808 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6809 {
6810 exp->type = 2;
6811 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6812 if(!exp->expType)
6813 {
6814 exp->expType = op1->type;
6815 if(op1->type)
6816 op1->type->refCount++;
6817 }
6818 return 1;
6819 }
6820
6821 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6822 {
6823 exp->type = 2;
6824 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6825 if(!exp->expType)
6826 {
6827 exp->expType = op1->type;
6828 if(op1->type)
6829 op1->type->refCount++;
6830 }
6831 return 1;
6832 }
6833
6834 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6835 {
6836 exp->type = 2;
6837 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6838 if(!exp->expType)
6839 {
6840 exp->expType = op1->type;
6841 if(op1->type)
6842 op1->type->refCount++;
6843 }
6844 return 1;
6845 }
6846
6847 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6848 {
6849 exp->type = 2;
6850 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6851 if(!exp->expType)
6852 {
6853 exp->expType = op1->type;
6854 if(op1->type)
6855 op1->type->refCount++;
6856 }
6857 return 1;
6858 }
6859
6860 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6861 {
6862 exp->type = 2;
6863 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6864 if(!exp->expType)
6865 {
6866 exp->expType = op1->type;
6867 if(op1->type)
6868 op1->type->refCount++;
6869 }
6870 return 1;
6871 }
6872
6873 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6874 {
6875 exp->type = 2;
6876 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6877 if(!exp->expType)
6878 {
6879 exp->expType = op1->type;
6880 if(op1->type)
6881 op1->type->refCount++;
6882 }
6883 return 1;
6884 }
6885
6886 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6887 {
6888 exp->type = 2;
6889 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6890 if(!exp->expType)
6891 {
6892 exp->expType = op1->type;
6893 if(op1->type)
6894 op1->type->refCount++;
6895 }
6896 return 1;
6897 }
6898
6899 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6900 {
6901 exp->type = 2;
6902 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6903 if(!exp->expType)
6904 {
6905 exp->expType = op1->type;
6906 if(op1->type)
6907 op1->type->refCount++;
6908 }
6909 return 1;
6910 }
6911
6912 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6913 {
6914 exp->type = 2;
6915 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6916 if(!exp->expType)
6917 {
6918 exp->expType = op1->type;
6919 if(op1->type)
6920 op1->type->refCount++;
6921 }
6922 return 1;
6923 }
6924
6925 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6926 {
6927 exp->type = 2;
6928 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6929 if(!exp->expType)
6930 {
6931 exp->expType = op1->type;
6932 if(op1->type)
6933 op1->type->refCount++;
6934 }
6935 return 1;
6936 }
6937
6938 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6939 {
6940 exp->type = 2;
6941 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6942 if(!exp->expType)
6943 {
6944 exp->expType = op1->type;
6945 if(op1->type)
6946 op1->type->refCount++;
6947 }
6948 return 1;
6949 }
6950
6951 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6952 {
6953 exp->type = 2;
6954 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6955 if(!exp->expType)
6956 {
6957 exp->expType = op1->type;
6958 if(op1->type)
6959 op1->type->refCount++;
6960 }
6961 return 1;
6962 }
6963
6964 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6965 {
6966 exp->type = 2;
6967 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6968 if(!exp->expType)
6969 {
6970 exp->expType = op1->type;
6971 if(op1->type)
6972 op1->type->refCount++;
6973 }
6974 return 1;
6975 }
6976
6977 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6978 {
6979 exp->type = 2;
6980 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 1;
6988 }
6989
6990 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6991 {
6992 exp->type = 2;
6993 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 1;
7001 }
7002
7003 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
7004 {
7005 exp->type = 2;
7006 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
7007 if(!exp->expType)
7008 {
7009 exp->expType = op1->type;
7010 if(op1->type)
7011 op1->type->refCount++;
7012 }
7013 return 1;
7014 }
7015
7016 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
7017 {
7018 exp->type = 2;
7019 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
7020 if(!exp->expType)
7021 {
7022 exp->expType = op1->type;
7023 if(op1->type)
7024 op1->type->refCount++;
7025 }
7026 return 1;
7027 }
7028
7029 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
7030 {
7031 exp->type = 2;
7032 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
7033 if(!exp->expType)
7034 {
7035 exp->expType = op1->type;
7036 if(op1->type)
7037 op1->type->refCount++;
7038 }
7039 return 1;
7040 }
7041
7042 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7043 {
7044 exp->type = 2;
7045 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7046 if(!exp->expType)
7047 {
7048 exp->expType = op1->type;
7049 if(op1->type)
7050 op1->type->refCount++;
7051 }
7052 return 1;
7053 }
7054
7055 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7056 {
7057 exp->type = 2;
7058 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7059 if(!exp->expType)
7060 {
7061 exp->expType = op1->type;
7062 if(op1->type)
7063 op1->type->refCount++;
7064 }
7065 return 1;
7066 }
7067
7068 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7069 {
7070 exp->type = 2;
7071 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7072 if(!exp->expType)
7073 {
7074 exp->expType = op1->type;
7075 if(op1->type)
7076 op1->type->refCount++;
7077 }
7078 return 1;
7079 }
7080
7081 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7082 {
7083 exp->type = 2;
7084 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7085 if(!exp->expType)
7086 {
7087 exp->expType = op1->type;
7088 if(op1->type)
7089 op1->type->refCount++;
7090 }
7091 return 1;
7092 }
7093
7094 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7095 {
7096 exp->type = 2;
7097 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7098 if(!exp->expType)
7099 {
7100 exp->expType = op1->type;
7101 if(op1->type)
7102 op1->type->refCount++;
7103 }
7104 return 1;
7105 }
7106
7107 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7108 {
7109 exp->type = 2;
7110 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7111 if(!exp->expType)
7112 {
7113 exp->expType = op1->type;
7114 if(op1->type)
7115 op1->type->refCount++;
7116 }
7117 return 1;
7118 }
7119
7120 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7121 {
7122 exp->type = 2;
7123 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7124 if(!exp->expType)
7125 {
7126 exp->expType = op1->type;
7127 if(op1->type)
7128 op1->type->refCount++;
7129 }
7130 return 1;
7131 }
7132
7133 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7134 {
7135 exp->type = 2;
7136 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7137 if(!exp->expType)
7138 {
7139 exp->expType = op1->type;
7140 if(op1->type)
7141 op1->type->refCount++;
7142 }
7143 return 1;
7144 }
7145
7146 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7147 {
7148 exp->type = 2;
7149 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7150 if(!exp->expType)
7151 {
7152 exp->expType = op1->type;
7153 if(op1->type)
7154 op1->type->refCount++;
7155 }
7156 return 1;
7157 }
7158
7159 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7160 {
7161 int value2 = op2->__anon1.i;
7162
7163 exp->type = 2;
7164 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7165 if(!exp->expType)
7166 {
7167 exp->expType = op1->type;
7168 if(op1->type)
7169 op1->type->refCount++;
7170 }
7171 return 1;
7172 }
7173
7174 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7175 {
7176 unsigned int value2 = op2->__anon1.ui;
7177
7178 exp->type = 2;
7179 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7180 if(!exp->expType)
7181 {
7182 exp->expType = op1->type;
7183 if(op1->type)
7184 op1->type->refCount++;
7185 }
7186 return 1;
7187 }
7188
7189 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7190 {
7191 long long value2 = op2->__anon1.i64;
7192
7193 exp->type = 2;
7194 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7195 if(!exp->expType)
7196 {
7197 exp->expType = op1->type;
7198 if(op1->type)
7199 op1->type->refCount++;
7200 }
7201 return 1;
7202 }
7203
7204 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7205 {
7206 uint64 value2 = op2->__anon1.ui64;
7207
7208 exp->type = 2;
7209 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7210 if(!exp->expType)
7211 {
7212 exp->expType = op1->type;
7213 if(op1->type)
7214 op1->type->refCount++;
7215 }
7216 return 1;
7217 }
7218
7219 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7220 {
7221 short value2 = op2->__anon1.s;
7222
7223 exp->type = 2;
7224 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7225 if(!exp->expType)
7226 {
7227 exp->expType = op1->type;
7228 if(op1->type)
7229 op1->type->refCount++;
7230 }
7231 return 1;
7232 }
7233
7234 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7235 {
7236 unsigned short value2 = op2->__anon1.us;
7237
7238 exp->type = 2;
7239 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7240 if(!exp->expType)
7241 {
7242 exp->expType = op1->type;
7243 if(op1->type)
7244 op1->type->refCount++;
7245 }
7246 return 1;
7247 }
7248
7249 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7250 {
7251 char value2 = op2->__anon1.c;
7252
7253 exp->type = 2;
7254 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7255 if(!exp->expType)
7256 {
7257 exp->expType = op1->type;
7258 if(op1->type)
7259 op1->type->refCount++;
7260 }
7261 return 1;
7262 }
7263
7264 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7265 {
7266 unsigned char value2 = op2->__anon1.uc;
7267
7268 exp->type = 2;
7269 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7270 if(!exp->expType)
7271 {
7272 exp->expType = op1->type;
7273 if(op1->type)
7274 op1->type->refCount++;
7275 }
7276 return 1;
7277 }
7278
7279 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7280 {
7281 float value2 = op2->__anon1.f;
7282
7283 exp->type = 2;
7284 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7285 if(!exp->expType)
7286 {
7287 exp->expType = op1->type;
7288 if(op1->type)
7289 op1->type->refCount++;
7290 }
7291 return 1;
7292 }
7293
7294 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7295 {
7296 double value2 = op2->__anon1.d;
7297
7298 exp->type = 2;
7299 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7300 if(!exp->expType)
7301 {
7302 exp->expType = op1->type;
7303 if(op1->type)
7304 op1->type->refCount++;
7305 }
7306 return 1;
7307 }
7308
7309 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7310 {
7311 int value2 = op2->__anon1.i;
7312
7313 exp->type = 2;
7314 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7315 if(!exp->expType)
7316 {
7317 exp->expType = op1->type;
7318 if(op1->type)
7319 op1->type->refCount++;
7320 }
7321 return 1;
7322 }
7323
7324 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7325 {
7326 unsigned int value2 = op2->__anon1.ui;
7327
7328 exp->type = 2;
7329 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7330 if(!exp->expType)
7331 {
7332 exp->expType = op1->type;
7333 if(op1->type)
7334 op1->type->refCount++;
7335 }
7336 return 1;
7337 }
7338
7339 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7340 {
7341 long long value2 = op2->__anon1.i64;
7342
7343 exp->type = 2;
7344 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7345 if(!exp->expType)
7346 {
7347 exp->expType = op1->type;
7348 if(op1->type)
7349 op1->type->refCount++;
7350 }
7351 return 1;
7352 }
7353
7354 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7355 {
7356 uint64 value2 = op2->__anon1.ui64;
7357
7358 exp->type = 2;
7359 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7360 if(!exp->expType)
7361 {
7362 exp->expType = op1->type;
7363 if(op1->type)
7364 op1->type->refCount++;
7365 }
7366 return 1;
7367 }
7368
7369 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7370 {
7371 short value2 = op2->__anon1.s;
7372
7373 exp->type = 2;
7374 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7375 if(!exp->expType)
7376 {
7377 exp->expType = op1->type;
7378 if(op1->type)
7379 op1->type->refCount++;
7380 }
7381 return 1;
7382 }
7383
7384 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7385 {
7386 unsigned short value2 = op2->__anon1.us;
7387
7388 exp->type = 2;
7389 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7390 if(!exp->expType)
7391 {
7392 exp->expType = op1->type;
7393 if(op1->type)
7394 op1->type->refCount++;
7395 }
7396 return 1;
7397 }
7398
7399 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7400 {
7401 char value2 = op2->__anon1.c;
7402
7403 exp->type = 2;
7404 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7405 if(!exp->expType)
7406 {
7407 exp->expType = op1->type;
7408 if(op1->type)
7409 op1->type->refCount++;
7410 }
7411 return 1;
7412 }
7413
7414 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7415 {
7416 unsigned char value2 = op2->__anon1.uc;
7417
7418 exp->type = 2;
7419 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7420 if(!exp->expType)
7421 {
7422 exp->expType = op1->type;
7423 if(op1->type)
7424 op1->type->refCount++;
7425 }
7426 return 1;
7427 }
7428
7429 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7430 {
7431 float value2 = op2->__anon1.f;
7432
7433 exp->type = 2;
7434 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7435 if(!exp->expType)
7436 {
7437 exp->expType = op1->type;
7438 if(op1->type)
7439 op1->type->refCount++;
7440 }
7441 return 1;
7442 }
7443
7444 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7445 {
7446 double value2 = op2->__anon1.d;
7447
7448 exp->type = 2;
7449 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7450 if(!exp->expType)
7451 {
7452 exp->expType = op1->type;
7453 if(op1->type)
7454 op1->type->refCount++;
7455 }
7456 return 1;
7457 }
7458
7459 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7460 {
7461 int value2 = op2->__anon1.i;
7462
7463 exp->type = 2;
7464 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7465 if(!exp->expType)
7466 {
7467 exp->expType = op1->type;
7468 if(op1->type)
7469 op1->type->refCount++;
7470 }
7471 return 1;
7472 }
7473
7474 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7475 {
7476 unsigned int value2 = op2->__anon1.ui;
7477
7478 exp->type = 2;
7479 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7480 if(!exp->expType)
7481 {
7482 exp->expType = op1->type;
7483 if(op1->type)
7484 op1->type->refCount++;
7485 }
7486 return 1;
7487 }
7488
7489 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7490 {
7491 long long value2 = op2->__anon1.i64;
7492
7493 exp->type = 2;
7494 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7495 if(!exp->expType)
7496 {
7497 exp->expType = op1->type;
7498 if(op1->type)
7499 op1->type->refCount++;
7500 }
7501 return 1;
7502 }
7503
7504 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7505 {
7506 uint64 value2 = op2->__anon1.ui64;
7507
7508 exp->type = 2;
7509 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7510 if(!exp->expType)
7511 {
7512 exp->expType = op1->type;
7513 if(op1->type)
7514 op1->type->refCount++;
7515 }
7516 return 1;
7517 }
7518
7519 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7520 {
7521 short value2 = op2->__anon1.s;
7522
7523 exp->type = 2;
7524 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7525 if(!exp->expType)
7526 {
7527 exp->expType = op1->type;
7528 if(op1->type)
7529 op1->type->refCount++;
7530 }
7531 return 1;
7532 }
7533
7534 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7535 {
7536 unsigned short value2 = op2->__anon1.us;
7537
7538 exp->type = 2;
7539 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7540 if(!exp->expType)
7541 {
7542 exp->expType = op1->type;
7543 if(op1->type)
7544 op1->type->refCount++;
7545 }
7546 return 1;
7547 }
7548
7549 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7550 {
7551 char value2 = op2->__anon1.c;
7552
7553 exp->type = 2;
7554 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7555 if(!exp->expType)
7556 {
7557 exp->expType = op1->type;
7558 if(op1->type)
7559 op1->type->refCount++;
7560 }
7561 return 1;
7562 }
7563
7564 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7565 {
7566 unsigned char value2 = op2->__anon1.uc;
7567
7568 exp->type = 2;
7569 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7570 if(!exp->expType)
7571 {
7572 exp->expType = op1->type;
7573 if(op1->type)
7574 op1->type->refCount++;
7575 }
7576 return 1;
7577 }
7578
7579 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7580 {
7581 float value2 = op2->__anon1.f;
7582
7583 exp->type = 2;
7584 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7585 if(!exp->expType)
7586 {
7587 exp->expType = op1->type;
7588 if(op1->type)
7589 op1->type->refCount++;
7590 }
7591 return 1;
7592 }
7593
7594 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7595 {
7596 double value2 = op2->__anon1.d;
7597
7598 exp->type = 2;
7599 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7600 if(!exp->expType)
7601 {
7602 exp->expType = op1->type;
7603 if(op1->type)
7604 op1->type->refCount++;
7605 }
7606 return 1;
7607 }
7608
7609 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7610 {
7611 int value2 = op2->__anon1.i;
7612
7613 exp->type = 2;
7614 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7615 if(!exp->expType)
7616 {
7617 exp->expType = op1->type;
7618 if(op1->type)
7619 op1->type->refCount++;
7620 }
7621 return 1;
7622 }
7623
7624 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7625 {
7626 unsigned int value2 = op2->__anon1.ui;
7627
7628 exp->type = 2;
7629 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7630 if(!exp->expType)
7631 {
7632 exp->expType = op1->type;
7633 if(op1->type)
7634 op1->type->refCount++;
7635 }
7636 return 1;
7637 }
7638
7639 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7640 {
7641 long long value2 = op2->__anon1.i64;
7642
7643 exp->type = 2;
7644 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7645 if(!exp->expType)
7646 {
7647 exp->expType = op1->type;
7648 if(op1->type)
7649 op1->type->refCount++;
7650 }
7651 return 1;
7652 }
7653
7654 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7655 {
7656 uint64 value2 = op2->__anon1.ui64;
7657
7658 exp->type = 2;
7659 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7660 if(!exp->expType)
7661 {
7662 exp->expType = op1->type;
7663 if(op1->type)
7664 op1->type->refCount++;
7665 }
7666 return 1;
7667 }
7668
7669 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7670 {
7671 short value2 = op2->__anon1.s;
7672
7673 exp->type = 2;
7674 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7675 if(!exp->expType)
7676 {
7677 exp->expType = op1->type;
7678 if(op1->type)
7679 op1->type->refCount++;
7680 }
7681 return 1;
7682 }
7683
7684 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7685 {
7686 unsigned short value2 = op2->__anon1.us;
7687
7688 exp->type = 2;
7689 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7690 if(!exp->expType)
7691 {
7692 exp->expType = op1->type;
7693 if(op1->type)
7694 op1->type->refCount++;
7695 }
7696 return 1;
7697 }
7698
7699 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7700 {
7701 char value2 = op2->__anon1.c;
7702
7703 exp->type = 2;
7704 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7705 if(!exp->expType)
7706 {
7707 exp->expType = op1->type;
7708 if(op1->type)
7709 op1->type->refCount++;
7710 }
7711 return 1;
7712 }
7713
7714 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7715 {
7716 unsigned char value2 = op2->__anon1.uc;
7717
7718 exp->type = 2;
7719 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7720 if(!exp->expType)
7721 {
7722 exp->expType = op1->type;
7723 if(op1->type)
7724 op1->type->refCount++;
7725 }
7726 return 1;
7727 }
7728
7729 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7730 {
7731 float value2 = op2->__anon1.f;
7732
7733 exp->type = 2;
7734 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7735 if(!exp->expType)
7736 {
7737 exp->expType = op1->type;
7738 if(op1->type)
7739 op1->type->refCount++;
7740 }
7741 return 1;
7742 }
7743
7744 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7745 {
7746 double value2 = op2->__anon1.d;
7747
7748 exp->type = 2;
7749 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7750 if(!exp->expType)
7751 {
7752 exp->expType = op1->type;
7753 if(op1->type)
7754 op1->type->refCount++;
7755 }
7756 return 1;
7757 }
7758
7759 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7760 {
7761 int value2 = op2->__anon1.i;
7762
7763 exp->type = 2;
7764 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7765 if(!exp->expType)
7766 {
7767 exp->expType = op1->type;
7768 if(op1->type)
7769 op1->type->refCount++;
7770 }
7771 return 1;
7772 }
7773
7774 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7775 {
7776 unsigned int value2 = op2->__anon1.ui;
7777
7778 exp->type = 2;
7779 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7780 if(!exp->expType)
7781 {
7782 exp->expType = op1->type;
7783 if(op1->type)
7784 op1->type->refCount++;
7785 }
7786 return 1;
7787 }
7788
7789 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7790 {
7791 long long value2 = op2->__anon1.i64;
7792
7793 exp->type = 2;
7794 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7795 if(!exp->expType)
7796 {
7797 exp->expType = op1->type;
7798 if(op1->type)
7799 op1->type->refCount++;
7800 }
7801 return 1;
7802 }
7803
7804 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7805 {
7806 uint64 value2 = op2->__anon1.ui64;
7807
7808 exp->type = 2;
7809 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7810 if(!exp->expType)
7811 {
7812 exp->expType = op1->type;
7813 if(op1->type)
7814 op1->type->refCount++;
7815 }
7816 return 1;
7817 }
7818
7819 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7820 {
7821 short value2 = op2->__anon1.s;
7822
7823 exp->type = 2;
7824 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7825 if(!exp->expType)
7826 {
7827 exp->expType = op1->type;
7828 if(op1->type)
7829 op1->type->refCount++;
7830 }
7831 return 1;
7832 }
7833
7834 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7835 {
7836 unsigned short value2 = op2->__anon1.us;
7837
7838 exp->type = 2;
7839 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7840 if(!exp->expType)
7841 {
7842 exp->expType = op1->type;
7843 if(op1->type)
7844 op1->type->refCount++;
7845 }
7846 return 1;
7847 }
7848
7849 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7850 {
7851 char value2 = op2->__anon1.c;
7852
7853 exp->type = 2;
7854 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7855 if(!exp->expType)
7856 {
7857 exp->expType = op1->type;
7858 if(op1->type)
7859 op1->type->refCount++;
7860 }
7861 return 1;
7862 }
7863
7864 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7865 {
7866 unsigned char value2 = op2->__anon1.uc;
7867
7868 exp->type = 2;
7869 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7870 if(!exp->expType)
7871 {
7872 exp->expType = op1->type;
7873 if(op1->type)
7874 op1->type->refCount++;
7875 }
7876 return 1;
7877 }
7878
7879 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7880 {
7881 float value2 = op2->__anon1.f;
7882
7883 exp->type = 2;
7884 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7885 if(!exp->expType)
7886 {
7887 exp->expType = op1->type;
7888 if(op1->type)
7889 op1->type->refCount++;
7890 }
7891 return 1;
7892 }
7893
7894 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7895 {
7896 double value2 = op2->__anon1.d;
7897
7898 exp->type = 2;
7899 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7900 if(!exp->expType)
7901 {
7902 exp->expType = op1->type;
7903 if(op1->type)
7904 op1->type->refCount++;
7905 }
7906 return 1;
7907 }
7908
7909 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7910 {
7911 int value2 = op2->__anon1.i;
7912
7913 exp->type = 2;
7914 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7915 if(!exp->expType)
7916 {
7917 exp->expType = op1->type;
7918 if(op1->type)
7919 op1->type->refCount++;
7920 }
7921 return 1;
7922 }
7923
7924 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7925 {
7926 unsigned int value2 = op2->__anon1.ui;
7927
7928 exp->type = 2;
7929 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7930 if(!exp->expType)
7931 {
7932 exp->expType = op1->type;
7933 if(op1->type)
7934 op1->type->refCount++;
7935 }
7936 return 1;
7937 }
7938
7939 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7940 {
7941 long long value2 = op2->__anon1.i64;
7942
7943 exp->type = 2;
7944 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7945 if(!exp->expType)
7946 {
7947 exp->expType = op1->type;
7948 if(op1->type)
7949 op1->type->refCount++;
7950 }
7951 return 1;
7952 }
7953
7954 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7955 {
7956 uint64 value2 = op2->__anon1.ui64;
7957
7958 exp->type = 2;
7959 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7960 if(!exp->expType)
7961 {
7962 exp->expType = op1->type;
7963 if(op1->type)
7964 op1->type->refCount++;
7965 }
7966 return 1;
7967 }
7968
7969 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7970 {
7971 short value2 = op2->__anon1.s;
7972
7973 exp->type = 2;
7974 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7975 if(!exp->expType)
7976 {
7977 exp->expType = op1->type;
7978 if(op1->type)
7979 op1->type->refCount++;
7980 }
7981 return 1;
7982 }
7983
7984 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7985 {
7986 unsigned short value2 = op2->__anon1.us;
7987
7988 exp->type = 2;
7989 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7990 if(!exp->expType)
7991 {
7992 exp->expType = op1->type;
7993 if(op1->type)
7994 op1->type->refCount++;
7995 }
7996 return 1;
7997 }
7998
7999 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8000 {
8001 char value2 = op2->__anon1.c;
8002
8003 exp->type = 2;
8004 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
8005 if(!exp->expType)
8006 {
8007 exp->expType = op1->type;
8008 if(op1->type)
8009 op1->type->refCount++;
8010 }
8011 return 1;
8012 }
8013
8014 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8015 {
8016 unsigned char value2 = op2->__anon1.uc;
8017
8018 exp->type = 2;
8019 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
8020 if(!exp->expType)
8021 {
8022 exp->expType = op1->type;
8023 if(op1->type)
8024 op1->type->refCount++;
8025 }
8026 return 1;
8027 }
8028
8029 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8030 {
8031 int value2 = op2->__anon1.i;
8032
8033 exp->type = 2;
8034 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
8035 if(!exp->expType)
8036 {
8037 exp->expType = op1->type;
8038 if(op1->type)
8039 op1->type->refCount++;
8040 }
8041 return 1;
8042 }
8043
8044 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8045 {
8046 unsigned int value2 = op2->__anon1.ui;
8047
8048 exp->type = 2;
8049 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8050 if(!exp->expType)
8051 {
8052 exp->expType = op1->type;
8053 if(op1->type)
8054 op1->type->refCount++;
8055 }
8056 return 1;
8057 }
8058
8059 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8060 {
8061 long long value2 = op2->__anon1.i64;
8062
8063 exp->type = 2;
8064 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8065 if(!exp->expType)
8066 {
8067 exp->expType = op1->type;
8068 if(op1->type)
8069 op1->type->refCount++;
8070 }
8071 return 1;
8072 }
8073
8074 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8075 {
8076 uint64 value2 = op2->__anon1.ui64;
8077
8078 exp->type = 2;
8079 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8080 if(!exp->expType)
8081 {
8082 exp->expType = op1->type;
8083 if(op1->type)
8084 op1->type->refCount++;
8085 }
8086 return 1;
8087 }
8088
8089 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8090 {
8091 short value2 = op2->__anon1.s;
8092
8093 exp->type = 2;
8094 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8095 if(!exp->expType)
8096 {
8097 exp->expType = op1->type;
8098 if(op1->type)
8099 op1->type->refCount++;
8100 }
8101 return 1;
8102 }
8103
8104 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 {
8106 unsigned short value2 = op2->__anon1.us;
8107
8108 exp->type = 2;
8109 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8110 if(!exp->expType)
8111 {
8112 exp->expType = op1->type;
8113 if(op1->type)
8114 op1->type->refCount++;
8115 }
8116 return 1;
8117 }
8118
8119 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 {
8121 char value2 = op2->__anon1.c;
8122
8123 exp->type = 2;
8124 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8125 if(!exp->expType)
8126 {
8127 exp->expType = op1->type;
8128 if(op1->type)
8129 op1->type->refCount++;
8130 }
8131 return 1;
8132 }
8133
8134 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 {
8136 unsigned char value2 = op2->__anon1.uc;
8137
8138 exp->type = 2;
8139 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8140 if(!exp->expType)
8141 {
8142 exp->expType = op1->type;
8143 if(op1->type)
8144 op1->type->refCount++;
8145 }
8146 return 1;
8147 }
8148
8149 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 {
8151 int value2 = op2->__anon1.i;
8152
8153 exp->type = 2;
8154 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8155 if(!exp->expType)
8156 {
8157 exp->expType = op1->type;
8158 if(op1->type)
8159 op1->type->refCount++;
8160 }
8161 return 1;
8162 }
8163
8164 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 {
8166 unsigned int value2 = op2->__anon1.ui;
8167
8168 exp->type = 2;
8169 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8170 if(!exp->expType)
8171 {
8172 exp->expType = op1->type;
8173 if(op1->type)
8174 op1->type->refCount++;
8175 }
8176 return 1;
8177 }
8178
8179 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 {
8181 long long value2 = op2->__anon1.i64;
8182
8183 exp->type = 2;
8184 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8185 if(!exp->expType)
8186 {
8187 exp->expType = op1->type;
8188 if(op1->type)
8189 op1->type->refCount++;
8190 }
8191 return 1;
8192 }
8193
8194 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 {
8196 uint64 value2 = op2->__anon1.ui64;
8197
8198 exp->type = 2;
8199 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8200 if(!exp->expType)
8201 {
8202 exp->expType = op1->type;
8203 if(op1->type)
8204 op1->type->refCount++;
8205 }
8206 return 1;
8207 }
8208
8209 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 {
8211 short value2 = op2->__anon1.s;
8212
8213 exp->type = 2;
8214 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8215 if(!exp->expType)
8216 {
8217 exp->expType = op1->type;
8218 if(op1->type)
8219 op1->type->refCount++;
8220 }
8221 return 1;
8222 }
8223
8224 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 {
8226 unsigned short value2 = op2->__anon1.us;
8227
8228 exp->type = 2;
8229 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8230 if(!exp->expType)
8231 {
8232 exp->expType = op1->type;
8233 if(op1->type)
8234 op1->type->refCount++;
8235 }
8236 return 1;
8237 }
8238
8239 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 {
8241 char value2 = op2->__anon1.c;
8242
8243 exp->type = 2;
8244 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8245 if(!exp->expType)
8246 {
8247 exp->expType = op1->type;
8248 if(op1->type)
8249 op1->type->refCount++;
8250 }
8251 return 1;
8252 }
8253
8254 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 {
8256 unsigned char value2 = op2->__anon1.uc;
8257
8258 exp->type = 2;
8259 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8260 if(!exp->expType)
8261 {
8262 exp->expType = op1->type;
8263 if(op1->type)
8264 op1->type->refCount++;
8265 }
8266 return 1;
8267 }
8268
8269 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 {
8271 int value2 = op2->__anon1.i;
8272
8273 exp->type = 2;
8274 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8275 if(!exp->expType)
8276 {
8277 exp->expType = op1->type;
8278 if(op1->type)
8279 op1->type->refCount++;
8280 }
8281 return 1;
8282 }
8283
8284 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 {
8286 unsigned int value2 = op2->__anon1.ui;
8287
8288 exp->type = 2;
8289 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8290 if(!exp->expType)
8291 {
8292 exp->expType = op1->type;
8293 if(op1->type)
8294 op1->type->refCount++;
8295 }
8296 return 1;
8297 }
8298
8299 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 {
8301 long long value2 = op2->__anon1.i64;
8302
8303 exp->type = 2;
8304 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8305 if(!exp->expType)
8306 {
8307 exp->expType = op1->type;
8308 if(op1->type)
8309 op1->type->refCount++;
8310 }
8311 return 1;
8312 }
8313
8314 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 {
8316 uint64 value2 = op2->__anon1.ui64;
8317
8318 exp->type = 2;
8319 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8320 if(!exp->expType)
8321 {
8322 exp->expType = op1->type;
8323 if(op1->type)
8324 op1->type->refCount++;
8325 }
8326 return 1;
8327 }
8328
8329 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 {
8331 short value2 = op2->__anon1.s;
8332
8333 exp->type = 2;
8334 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8335 if(!exp->expType)
8336 {
8337 exp->expType = op1->type;
8338 if(op1->type)
8339 op1->type->refCount++;
8340 }
8341 return 1;
8342 }
8343
8344 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 {
8346 unsigned short value2 = op2->__anon1.us;
8347
8348 exp->type = 2;
8349 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8350 if(!exp->expType)
8351 {
8352 exp->expType = op1->type;
8353 if(op1->type)
8354 op1->type->refCount++;
8355 }
8356 return 1;
8357 }
8358
8359 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8360 {
8361 char value2 = op2->__anon1.c;
8362
8363 exp->type = 2;
8364 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8365 if(!exp->expType)
8366 {
8367 exp->expType = op1->type;
8368 if(op1->type)
8369 op1->type->refCount++;
8370 }
8371 return 1;
8372 }
8373
8374 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8375 {
8376 unsigned char value2 = op2->__anon1.uc;
8377
8378 exp->type = 2;
8379 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8380 if(!exp->expType)
8381 {
8382 exp->expType = op1->type;
8383 if(op1->type)
8384 op1->type->refCount++;
8385 }
8386 return 1;
8387 }
8388
8389 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8390 {
8391 int value2 = op2->__anon1.i;
8392
8393 exp->type = 2;
8394 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8395 if(!exp->expType)
8396 {
8397 exp->expType = op1->type;
8398 if(op1->type)
8399 op1->type->refCount++;
8400 }
8401 return 1;
8402 }
8403
8404 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8405 {
8406 unsigned int value2 = op2->__anon1.ui;
8407
8408 exp->type = 2;
8409 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8410 if(!exp->expType)
8411 {
8412 exp->expType = op1->type;
8413 if(op1->type)
8414 op1->type->refCount++;
8415 }
8416 return 1;
8417 }
8418
8419 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8420 {
8421 long long value2 = op2->__anon1.i64;
8422
8423 exp->type = 2;
8424 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8425 if(!exp->expType)
8426 {
8427 exp->expType = op1->type;
8428 if(op1->type)
8429 op1->type->refCount++;
8430 }
8431 return 1;
8432 }
8433
8434 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8435 {
8436 uint64 value2 = op2->__anon1.ui64;
8437
8438 exp->type = 2;
8439 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8440 if(!exp->expType)
8441 {
8442 exp->expType = op1->type;
8443 if(op1->type)
8444 op1->type->refCount++;
8445 }
8446 return 1;
8447 }
8448
8449 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8450 {
8451 short value2 = op2->__anon1.s;
8452
8453 exp->type = 2;
8454 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8455 if(!exp->expType)
8456 {
8457 exp->expType = op1->type;
8458 if(op1->type)
8459 op1->type->refCount++;
8460 }
8461 return 1;
8462 }
8463
8464 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8465 {
8466 unsigned short value2 = op2->__anon1.us;
8467
8468 exp->type = 2;
8469 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8470 if(!exp->expType)
8471 {
8472 exp->expType = op1->type;
8473 if(op1->type)
8474 op1->type->refCount++;
8475 }
8476 return 1;
8477 }
8478
8479 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8480 {
8481 char value2 = op2->__anon1.c;
8482
8483 exp->type = 2;
8484 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8485 if(!exp->expType)
8486 {
8487 exp->expType = op1->type;
8488 if(op1->type)
8489 op1->type->refCount++;
8490 }
8491 return 1;
8492 }
8493
8494 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8495 {
8496 unsigned char value2 = op2->__anon1.uc;
8497
8498 exp->type = 2;
8499 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8500 if(!exp->expType)
8501 {
8502 exp->expType = op1->type;
8503 if(op1->type)
8504 op1->type->refCount++;
8505 }
8506 return 1;
8507 }
8508
8509 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8510 {
8511 int value2 = op2->__anon1.i;
8512
8513 exp->type = 2;
8514 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8515 if(!exp->expType)
8516 {
8517 exp->expType = op1->type;
8518 if(op1->type)
8519 op1->type->refCount++;
8520 }
8521 return 1;
8522 }
8523
8524 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8525 {
8526 unsigned int value2 = op2->__anon1.ui;
8527
8528 exp->type = 2;
8529 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8530 if(!exp->expType)
8531 {
8532 exp->expType = op1->type;
8533 if(op1->type)
8534 op1->type->refCount++;
8535 }
8536 return 1;
8537 }
8538
8539 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8540 {
8541 long long value2 = op2->__anon1.i64;
8542
8543 exp->type = 2;
8544 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8545 if(!exp->expType)
8546 {
8547 exp->expType = op1->type;
8548 if(op1->type)
8549 op1->type->refCount++;
8550 }
8551 return 1;
8552 }
8553
8554 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8555 {
8556 uint64 value2 = op2->__anon1.ui64;
8557
8558 exp->type = 2;
8559 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8560 if(!exp->expType)
8561 {
8562 exp->expType = op1->type;
8563 if(op1->type)
8564 op1->type->refCount++;
8565 }
8566 return 1;
8567 }
8568
8569 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8570 {
8571 short value2 = op2->__anon1.s;
8572
8573 exp->type = 2;
8574 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8575 if(!exp->expType)
8576 {
8577 exp->expType = op1->type;
8578 if(op1->type)
8579 op1->type->refCount++;
8580 }
8581 return 1;
8582 }
8583
8584 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8585 {
8586 unsigned short value2 = op2->__anon1.us;
8587
8588 exp->type = 2;
8589 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8590 if(!exp->expType)
8591 {
8592 exp->expType = op1->type;
8593 if(op1->type)
8594 op1->type->refCount++;
8595 }
8596 return 1;
8597 }
8598
8599 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8600 {
8601 char value2 = op2->__anon1.c;
8602
8603 exp->type = 2;
8604 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8605 if(!exp->expType)
8606 {
8607 exp->expType = op1->type;
8608 if(op1->type)
8609 op1->type->refCount++;
8610 }
8611 return 1;
8612 }
8613
8614 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8615 {
8616 unsigned char value2 = op2->__anon1.uc;
8617
8618 exp->type = 2;
8619 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8620 if(!exp->expType)
8621 {
8622 exp->expType = op1->type;
8623 if(op1->type)
8624 op1->type->refCount++;
8625 }
8626 return 1;
8627 }
8628
8629 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8630 {
8631 exp->type = 2;
8632 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8633 if(!exp->expType)
8634 {
8635 exp->expType = op1->type;
8636 if(op1->type)
8637 op1->type->refCount++;
8638 }
8639 return 1;
8640 }
8641
8642 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8643 {
8644 exp->type = 2;
8645 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8646 if(!exp->expType)
8647 {
8648 exp->expType = op1->type;
8649 if(op1->type)
8650 op1->type->refCount++;
8651 }
8652 return 1;
8653 }
8654
8655 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8656 {
8657 exp->type = 2;
8658 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8659 if(!exp->expType)
8660 {
8661 exp->expType = op1->type;
8662 if(op1->type)
8663 op1->type->refCount++;
8664 }
8665 return 1;
8666 }
8667
8668 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8669 {
8670 exp->type = 2;
8671 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8672 if(!exp->expType)
8673 {
8674 exp->expType = op1->type;
8675 if(op1->type)
8676 op1->type->refCount++;
8677 }
8678 return 1;
8679 }
8680
8681 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8682 {
8683 exp->type = 2;
8684 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8685 if(!exp->expType)
8686 {
8687 exp->expType = op1->type;
8688 if(op1->type)
8689 op1->type->refCount++;
8690 }
8691 return 1;
8692 }
8693
8694 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8695 {
8696 exp->type = 2;
8697 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8698 if(!exp->expType)
8699 {
8700 exp->expType = op1->type;
8701 if(op1->type)
8702 op1->type->refCount++;
8703 }
8704 return 1;
8705 }
8706
8707 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8708 {
8709 exp->type = 2;
8710 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8711 if(!exp->expType)
8712 {
8713 exp->expType = op1->type;
8714 if(op1->type)
8715 op1->type->refCount++;
8716 }
8717 return 1;
8718 }
8719
8720 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8721 {
8722 exp->type = 2;
8723 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8724 if(!exp->expType)
8725 {
8726 exp->expType = op1->type;
8727 if(op1->type)
8728 op1->type->refCount++;
8729 }
8730 return 1;
8731 }
8732
8733 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 {
8735 int value2 = op2->__anon1.i;
8736
8737 exp->type = 2;
8738 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8739 if(!exp->expType)
8740 {
8741 exp->expType = op1->type;
8742 if(op1->type)
8743 op1->type->refCount++;
8744 }
8745 return 1;
8746 }
8747
8748 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 {
8750 unsigned int value2 = op2->__anon1.ui;
8751
8752 exp->type = 2;
8753 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8754 if(!exp->expType)
8755 {
8756 exp->expType = op1->type;
8757 if(op1->type)
8758 op1->type->refCount++;
8759 }
8760 return 1;
8761 }
8762
8763 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 {
8765 long long value2 = op2->__anon1.i64;
8766
8767 exp->type = 2;
8768 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8769 if(!exp->expType)
8770 {
8771 exp->expType = op1->type;
8772 if(op1->type)
8773 op1->type->refCount++;
8774 }
8775 return 1;
8776 }
8777
8778 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 {
8780 uint64 value2 = op2->__anon1.ui64;
8781
8782 exp->type = 2;
8783 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8784 if(!exp->expType)
8785 {
8786 exp->expType = op1->type;
8787 if(op1->type)
8788 op1->type->refCount++;
8789 }
8790 return 1;
8791 }
8792
8793 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 {
8795 short value2 = op2->__anon1.s;
8796
8797 exp->type = 2;
8798 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8799 if(!exp->expType)
8800 {
8801 exp->expType = op1->type;
8802 if(op1->type)
8803 op1->type->refCount++;
8804 }
8805 return 1;
8806 }
8807
8808 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 {
8810 unsigned short value2 = op2->__anon1.us;
8811
8812 exp->type = 2;
8813 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8814 if(!exp->expType)
8815 {
8816 exp->expType = op1->type;
8817 if(op1->type)
8818 op1->type->refCount++;
8819 }
8820 return 1;
8821 }
8822
8823 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 {
8825 char value2 = op2->__anon1.c;
8826
8827 exp->type = 2;
8828 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8829 if(!exp->expType)
8830 {
8831 exp->expType = op1->type;
8832 if(op1->type)
8833 op1->type->refCount++;
8834 }
8835 return 1;
8836 }
8837
8838 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 {
8840 unsigned char value2 = op2->__anon1.uc;
8841
8842 exp->type = 2;
8843 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8844 if(!exp->expType)
8845 {
8846 exp->expType = op1->type;
8847 if(op1->type)
8848 op1->type->refCount++;
8849 }
8850 return 1;
8851 }
8852
8853 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 {
8855 int value2 = op2->__anon1.i;
8856
8857 exp->type = 2;
8858 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8859 if(!exp->expType)
8860 {
8861 exp->expType = op1->type;
8862 if(op1->type)
8863 op1->type->refCount++;
8864 }
8865 return 1;
8866 }
8867
8868 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 {
8870 unsigned int value2 = op2->__anon1.ui;
8871
8872 exp->type = 2;
8873 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8874 if(!exp->expType)
8875 {
8876 exp->expType = op1->type;
8877 if(op1->type)
8878 op1->type->refCount++;
8879 }
8880 return 1;
8881 }
8882
8883 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 {
8885 long long value2 = op2->__anon1.i64;
8886
8887 exp->type = 2;
8888 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8889 if(!exp->expType)
8890 {
8891 exp->expType = op1->type;
8892 if(op1->type)
8893 op1->type->refCount++;
8894 }
8895 return 1;
8896 }
8897
8898 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 {
8900 uint64 value2 = op2->__anon1.ui64;
8901
8902 exp->type = 2;
8903 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8904 if(!exp->expType)
8905 {
8906 exp->expType = op1->type;
8907 if(op1->type)
8908 op1->type->refCount++;
8909 }
8910 return 1;
8911 }
8912
8913 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 {
8915 short value2 = op2->__anon1.s;
8916
8917 exp->type = 2;
8918 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8919 if(!exp->expType)
8920 {
8921 exp->expType = op1->type;
8922 if(op1->type)
8923 op1->type->refCount++;
8924 }
8925 return 1;
8926 }
8927
8928 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 {
8930 unsigned short value2 = op2->__anon1.us;
8931
8932 exp->type = 2;
8933 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8934 if(!exp->expType)
8935 {
8936 exp->expType = op1->type;
8937 if(op1->type)
8938 op1->type->refCount++;
8939 }
8940 return 1;
8941 }
8942
8943 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 {
8945 char value2 = op2->__anon1.c;
8946
8947 exp->type = 2;
8948 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8949 if(!exp->expType)
8950 {
8951 exp->expType = op1->type;
8952 if(op1->type)
8953 op1->type->refCount++;
8954 }
8955 return 1;
8956 }
8957
8958 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 {
8960 unsigned char value2 = op2->__anon1.uc;
8961
8962 exp->type = 2;
8963 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8964 if(!exp->expType)
8965 {
8966 exp->expType = op1->type;
8967 if(op1->type)
8968 op1->type->refCount++;
8969 }
8970 return 1;
8971 }
8972
8973 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 {
8975 int value2 = op2->__anon1.i;
8976
8977 exp->type = 2;
8978 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8979 if(!exp->expType)
8980 {
8981 exp->expType = op1->type;
8982 if(op1->type)
8983 op1->type->refCount++;
8984 }
8985 return 1;
8986 }
8987
8988 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 {
8990 unsigned int value2 = op2->__anon1.ui;
8991
8992 exp->type = 2;
8993 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8994 if(!exp->expType)
8995 {
8996 exp->expType = op1->type;
8997 if(op1->type)
8998 op1->type->refCount++;
8999 }
9000 return 1;
9001 }
9002
9003 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 {
9005 long long value2 = op2->__anon1.i64;
9006
9007 exp->type = 2;
9008 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
9009 if(!exp->expType)
9010 {
9011 exp->expType = op1->type;
9012 if(op1->type)
9013 op1->type->refCount++;
9014 }
9015 return 1;
9016 }
9017
9018 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 {
9020 uint64 value2 = op2->__anon1.ui64;
9021
9022 exp->type = 2;
9023 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
9024 if(!exp->expType)
9025 {
9026 exp->expType = op1->type;
9027 if(op1->type)
9028 op1->type->refCount++;
9029 }
9030 return 1;
9031 }
9032
9033 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 {
9035 short value2 = op2->__anon1.s;
9036
9037 exp->type = 2;
9038 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
9039 if(!exp->expType)
9040 {
9041 exp->expType = op1->type;
9042 if(op1->type)
9043 op1->type->refCount++;
9044 }
9045 return 1;
9046 }
9047
9048 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 {
9050 unsigned short value2 = op2->__anon1.us;
9051
9052 exp->type = 2;
9053 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9054 if(!exp->expType)
9055 {
9056 exp->expType = op1->type;
9057 if(op1->type)
9058 op1->type->refCount++;
9059 }
9060 return 1;
9061 }
9062
9063 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9064 {
9065 char value2 = op2->__anon1.c;
9066
9067 exp->type = 2;
9068 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9069 if(!exp->expType)
9070 {
9071 exp->expType = op1->type;
9072 if(op1->type)
9073 op1->type->refCount++;
9074 }
9075 return 1;
9076 }
9077
9078 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9079 {
9080 unsigned char value2 = op2->__anon1.uc;
9081
9082 exp->type = 2;
9083 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9084 if(!exp->expType)
9085 {
9086 exp->expType = op1->type;
9087 if(op1->type)
9088 op1->type->refCount++;
9089 }
9090 return 1;
9091 }
9092
9093 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9094 {
9095 int value2 = op2->__anon1.i;
9096
9097 exp->type = 2;
9098 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9099 if(!exp->expType)
9100 {
9101 exp->expType = op1->type;
9102 if(op1->type)
9103 op1->type->refCount++;
9104 }
9105 return 1;
9106 }
9107
9108 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9109 {
9110 unsigned int value2 = op2->__anon1.ui;
9111
9112 exp->type = 2;
9113 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9114 if(!exp->expType)
9115 {
9116 exp->expType = op1->type;
9117 if(op1->type)
9118 op1->type->refCount++;
9119 }
9120 return 1;
9121 }
9122
9123 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9124 {
9125 long long value2 = op2->__anon1.i64;
9126
9127 exp->type = 2;
9128 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9129 if(!exp->expType)
9130 {
9131 exp->expType = op1->type;
9132 if(op1->type)
9133 op1->type->refCount++;
9134 }
9135 return 1;
9136 }
9137
9138 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9139 {
9140 uint64 value2 = op2->__anon1.ui64;
9141
9142 exp->type = 2;
9143 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9144 if(!exp->expType)
9145 {
9146 exp->expType = op1->type;
9147 if(op1->type)
9148 op1->type->refCount++;
9149 }
9150 return 1;
9151 }
9152
9153 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9154 {
9155 short value2 = op2->__anon1.s;
9156
9157 exp->type = 2;
9158 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9159 if(!exp->expType)
9160 {
9161 exp->expType = op1->type;
9162 if(op1->type)
9163 op1->type->refCount++;
9164 }
9165 return 1;
9166 }
9167
9168 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9169 {
9170 unsigned short value2 = op2->__anon1.us;
9171
9172 exp->type = 2;
9173 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9174 if(!exp->expType)
9175 {
9176 exp->expType = op1->type;
9177 if(op1->type)
9178 op1->type->refCount++;
9179 }
9180 return 1;
9181 }
9182
9183 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9184 {
9185 char value2 = op2->__anon1.c;
9186
9187 exp->type = 2;
9188 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9189 if(!exp->expType)
9190 {
9191 exp->expType = op1->type;
9192 if(op1->type)
9193 op1->type->refCount++;
9194 }
9195 return 1;
9196 }
9197
9198 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9199 {
9200 unsigned char value2 = op2->__anon1.uc;
9201
9202 exp->type = 2;
9203 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9204 if(!exp->expType)
9205 {
9206 exp->expType = op1->type;
9207 if(op1->type)
9208 op1->type->refCount++;
9209 }
9210 return 1;
9211 }
9212
9213 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9214 {
9215 int value2 = op2->__anon1.i;
9216
9217 exp->type = 2;
9218 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9219 if(!exp->expType)
9220 {
9221 exp->expType = op1->type;
9222 if(op1->type)
9223 op1->type->refCount++;
9224 }
9225 return 1;
9226 }
9227
9228 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9229 {
9230 unsigned int value2 = op2->__anon1.ui;
9231
9232 exp->type = 2;
9233 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9234 if(!exp->expType)
9235 {
9236 exp->expType = op1->type;
9237 if(op1->type)
9238 op1->type->refCount++;
9239 }
9240 return 1;
9241 }
9242
9243 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9244 {
9245 long long value2 = op2->__anon1.i64;
9246
9247 exp->type = 2;
9248 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9249 if(!exp->expType)
9250 {
9251 exp->expType = op1->type;
9252 if(op1->type)
9253 op1->type->refCount++;
9254 }
9255 return 1;
9256 }
9257
9258 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9259 {
9260 uint64 value2 = op2->__anon1.ui64;
9261
9262 exp->type = 2;
9263 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9264 if(!exp->expType)
9265 {
9266 exp->expType = op1->type;
9267 if(op1->type)
9268 op1->type->refCount++;
9269 }
9270 return 1;
9271 }
9272
9273 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9274 {
9275 short value2 = op2->__anon1.s;
9276
9277 exp->type = 2;
9278 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9279 if(!exp->expType)
9280 {
9281 exp->expType = op1->type;
9282 if(op1->type)
9283 op1->type->refCount++;
9284 }
9285 return 1;
9286 }
9287
9288 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9289 {
9290 unsigned short value2 = op2->__anon1.us;
9291
9292 exp->type = 2;
9293 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9294 if(!exp->expType)
9295 {
9296 exp->expType = op1->type;
9297 if(op1->type)
9298 op1->type->refCount++;
9299 }
9300 return 1;
9301 }
9302
9303 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9304 {
9305 char value2 = op2->__anon1.c;
9306
9307 exp->type = 2;
9308 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9309 if(!exp->expType)
9310 {
9311 exp->expType = op1->type;
9312 if(op1->type)
9313 op1->type->refCount++;
9314 }
9315 return 1;
9316 }
9317
9318 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9319 {
9320 unsigned char value2 = op2->__anon1.uc;
9321
9322 exp->type = 2;
9323 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9324 if(!exp->expType)
9325 {
9326 exp->expType = op1->type;
9327 if(op1->type)
9328 op1->type->refCount++;
9329 }
9330 return 1;
9331 }
9332
9333 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9334 {
9335 exp->type = 2;
9336 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9337 if(!exp->expType)
9338 {
9339 exp->expType = op1->type;
9340 if(op1->type)
9341 op1->type->refCount++;
9342 }
9343 return 1;
9344 }
9345
9346 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9347 {
9348 exp->type = 2;
9349 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9350 if(!exp->expType)
9351 {
9352 exp->expType = op1->type;
9353 if(op1->type)
9354 op1->type->refCount++;
9355 }
9356 return 1;
9357 }
9358
9359 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9360 {
9361 exp->type = 2;
9362 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9363 if(!exp->expType)
9364 {
9365 exp->expType = op1->type;
9366 if(op1->type)
9367 op1->type->refCount++;
9368 }
9369 return 1;
9370 }
9371
9372 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9373 {
9374 exp->type = 2;
9375 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9376 if(!exp->expType)
9377 {
9378 exp->expType = op1->type;
9379 if(op1->type)
9380 op1->type->refCount++;
9381 }
9382 return 1;
9383 }
9384
9385 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9386 {
9387 exp->type = 2;
9388 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9389 if(!exp->expType)
9390 {
9391 exp->expType = op1->type;
9392 if(op1->type)
9393 op1->type->refCount++;
9394 }
9395 return 1;
9396 }
9397
9398 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9399 {
9400 exp->type = 2;
9401 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9402 if(!exp->expType)
9403 {
9404 exp->expType = op1->type;
9405 if(op1->type)
9406 op1->type->refCount++;
9407 }
9408 return 1;
9409 }
9410
9411 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9412 {
9413 exp->type = 2;
9414 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9415 if(!exp->expType)
9416 {
9417 exp->expType = op1->type;
9418 if(op1->type)
9419 op1->type->refCount++;
9420 }
9421 return 1;
9422 }
9423
9424 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9425 {
9426 exp->type = 2;
9427 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9428 if(!exp->expType)
9429 {
9430 exp->expType = op1->type;
9431 if(op1->type)
9432 op1->type->refCount++;
9433 }
9434 return 1;
9435 }
9436
9437 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9438 {
9439 int value2 = op2->__anon1.i;
9440
9441 exp->type = 2;
9442 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9443 if(!exp->expType)
9444 {
9445 exp->expType = op1->type;
9446 if(op1->type)
9447 op1->type->refCount++;
9448 }
9449 return 1;
9450 }
9451
9452 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9453 {
9454 unsigned int value2 = op2->__anon1.ui;
9455
9456 exp->type = 2;
9457 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9458 if(!exp->expType)
9459 {
9460 exp->expType = op1->type;
9461 if(op1->type)
9462 op1->type->refCount++;
9463 }
9464 return 1;
9465 }
9466
9467 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9468 {
9469 long long value2 = op2->__anon1.i64;
9470
9471 exp->type = 2;
9472 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9473 if(!exp->expType)
9474 {
9475 exp->expType = op1->type;
9476 if(op1->type)
9477 op1->type->refCount++;
9478 }
9479 return 1;
9480 }
9481
9482 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9483 {
9484 uint64 value2 = op2->__anon1.ui64;
9485
9486 exp->type = 2;
9487 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9488 if(!exp->expType)
9489 {
9490 exp->expType = op1->type;
9491 if(op1->type)
9492 op1->type->refCount++;
9493 }
9494 return 1;
9495 }
9496
9497 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9498 {
9499 short value2 = op2->__anon1.s;
9500
9501 exp->type = 2;
9502 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9503 if(!exp->expType)
9504 {
9505 exp->expType = op1->type;
9506 if(op1->type)
9507 op1->type->refCount++;
9508 }
9509 return 1;
9510 }
9511
9512 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9513 {
9514 unsigned short value2 = op2->__anon1.us;
9515
9516 exp->type = 2;
9517 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9518 if(!exp->expType)
9519 {
9520 exp->expType = op1->type;
9521 if(op1->type)
9522 op1->type->refCount++;
9523 }
9524 return 1;
9525 }
9526
9527 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9528 {
9529 char value2 = op2->__anon1.c;
9530
9531 exp->type = 2;
9532 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9533 if(!exp->expType)
9534 {
9535 exp->expType = op1->type;
9536 if(op1->type)
9537 op1->type->refCount++;
9538 }
9539 return 1;
9540 }
9541
9542 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9543 {
9544 unsigned char value2 = op2->__anon1.uc;
9545
9546 exp->type = 2;
9547 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9548 if(!exp->expType)
9549 {
9550 exp->expType = op1->type;
9551 if(op1->type)
9552 op1->type->refCount++;
9553 }
9554 return 1;
9555 }
9556
9557 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9558 {
9559 float value2 = op2->__anon1.f;
9560
9561 exp->type = 2;
9562 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9563 if(!exp->expType)
9564 {
9565 exp->expType = op1->type;
9566 if(op1->type)
9567 op1->type->refCount++;
9568 }
9569 return 1;
9570 }
9571
9572 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9573 {
9574 double value2 = op2->__anon1.d;
9575
9576 exp->type = 2;
9577 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9578 if(!exp->expType)
9579 {
9580 exp->expType = op1->type;
9581 if(op1->type)
9582 op1->type->refCount++;
9583 }
9584 return 1;
9585 }
9586
9587 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9588 {
9589 int value2 = op2->__anon1.i;
9590
9591 exp->type = 2;
9592 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9593 if(!exp->expType)
9594 {
9595 exp->expType = op1->type;
9596 if(op1->type)
9597 op1->type->refCount++;
9598 }
9599 return 1;
9600 }
9601
9602 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9603 {
9604 unsigned int value2 = op2->__anon1.ui;
9605
9606 exp->type = 2;
9607 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9608 if(!exp->expType)
9609 {
9610 exp->expType = op1->type;
9611 if(op1->type)
9612 op1->type->refCount++;
9613 }
9614 return 1;
9615 }
9616
9617 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9618 {
9619 long long value2 = op2->__anon1.i64;
9620
9621 exp->type = 2;
9622 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9623 if(!exp->expType)
9624 {
9625 exp->expType = op1->type;
9626 if(op1->type)
9627 op1->type->refCount++;
9628 }
9629 return 1;
9630 }
9631
9632 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9633 {
9634 uint64 value2 = op2->__anon1.ui64;
9635
9636 exp->type = 2;
9637 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9638 if(!exp->expType)
9639 {
9640 exp->expType = op1->type;
9641 if(op1->type)
9642 op1->type->refCount++;
9643 }
9644 return 1;
9645 }
9646
9647 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9648 {
9649 short value2 = op2->__anon1.s;
9650
9651 exp->type = 2;
9652 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9653 if(!exp->expType)
9654 {
9655 exp->expType = op1->type;
9656 if(op1->type)
9657 op1->type->refCount++;
9658 }
9659 return 1;
9660 }
9661
9662 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9663 {
9664 unsigned short value2 = op2->__anon1.us;
9665
9666 exp->type = 2;
9667 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9668 if(!exp->expType)
9669 {
9670 exp->expType = op1->type;
9671 if(op1->type)
9672 op1->type->refCount++;
9673 }
9674 return 1;
9675 }
9676
9677 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9678 {
9679 char value2 = op2->__anon1.c;
9680
9681 exp->type = 2;
9682 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9683 if(!exp->expType)
9684 {
9685 exp->expType = op1->type;
9686 if(op1->type)
9687 op1->type->refCount++;
9688 }
9689 return 1;
9690 }
9691
9692 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9693 {
9694 unsigned char value2 = op2->__anon1.uc;
9695
9696 exp->type = 2;
9697 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9698 if(!exp->expType)
9699 {
9700 exp->expType = op1->type;
9701 if(op1->type)
9702 op1->type->refCount++;
9703 }
9704 return 1;
9705 }
9706
9707 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9708 {
9709 float value2 = op2->__anon1.f;
9710
9711 exp->type = 2;
9712 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9713 if(!exp->expType)
9714 {
9715 exp->expType = op1->type;
9716 if(op1->type)
9717 op1->type->refCount++;
9718 }
9719 return 1;
9720 }
9721
9722 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9723 {
9724 double value2 = op2->__anon1.d;
9725
9726 exp->type = 2;
9727 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9728 if(!exp->expType)
9729 {
9730 exp->expType = op1->type;
9731 if(op1->type)
9732 op1->type->refCount++;
9733 }
9734 return 1;
9735 }
9736
9737 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9738 {
9739 int value2 = op2->__anon1.i;
9740
9741 exp->type = 2;
9742 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9743 if(!exp->expType)
9744 {
9745 exp->expType = op1->type;
9746 if(op1->type)
9747 op1->type->refCount++;
9748 }
9749 return 1;
9750 }
9751
9752 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9753 {
9754 unsigned int value2 = op2->__anon1.ui;
9755
9756 exp->type = 2;
9757 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9758 if(!exp->expType)
9759 {
9760 exp->expType = op1->type;
9761 if(op1->type)
9762 op1->type->refCount++;
9763 }
9764 return 1;
9765 }
9766
9767 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9768 {
9769 long long value2 = op2->__anon1.i64;
9770
9771 exp->type = 2;
9772 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9773 if(!exp->expType)
9774 {
9775 exp->expType = op1->type;
9776 if(op1->type)
9777 op1->type->refCount++;
9778 }
9779 return 1;
9780 }
9781
9782 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9783 {
9784 uint64 value2 = op2->__anon1.ui64;
9785
9786 exp->type = 2;
9787 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9788 if(!exp->expType)
9789 {
9790 exp->expType = op1->type;
9791 if(op1->type)
9792 op1->type->refCount++;
9793 }
9794 return 1;
9795 }
9796
9797 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9798 {
9799 short value2 = op2->__anon1.s;
9800
9801 exp->type = 2;
9802 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9803 if(!exp->expType)
9804 {
9805 exp->expType = op1->type;
9806 if(op1->type)
9807 op1->type->refCount++;
9808 }
9809 return 1;
9810 }
9811
9812 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9813 {
9814 unsigned short value2 = op2->__anon1.us;
9815
9816 exp->type = 2;
9817 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9818 if(!exp->expType)
9819 {
9820 exp->expType = op1->type;
9821 if(op1->type)
9822 op1->type->refCount++;
9823 }
9824 return 1;
9825 }
9826
9827 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9828 {
9829 char value2 = op2->__anon1.c;
9830
9831 exp->type = 2;
9832 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9833 if(!exp->expType)
9834 {
9835 exp->expType = op1->type;
9836 if(op1->type)
9837 op1->type->refCount++;
9838 }
9839 return 1;
9840 }
9841
9842 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9843 {
9844 unsigned char value2 = op2->__anon1.uc;
9845
9846 exp->type = 2;
9847 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9848 if(!exp->expType)
9849 {
9850 exp->expType = op1->type;
9851 if(op1->type)
9852 op1->type->refCount++;
9853 }
9854 return 1;
9855 }
9856
9857 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9858 {
9859 float value2 = op2->__anon1.f;
9860
9861 exp->type = 2;
9862 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9863 if(!exp->expType)
9864 {
9865 exp->expType = op1->type;
9866 if(op1->type)
9867 op1->type->refCount++;
9868 }
9869 return 1;
9870 }
9871
9872 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9873 {
9874 double value2 = op2->__anon1.d;
9875
9876 exp->type = 2;
9877 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9878 if(!exp->expType)
9879 {
9880 exp->expType = op1->type;
9881 if(op1->type)
9882 op1->type->refCount++;
9883 }
9884 return 1;
9885 }
9886
9887 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9888 {
9889 int value2 = op2->__anon1.i;
9890
9891 exp->type = 2;
9892 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9893 if(!exp->expType)
9894 {
9895 exp->expType = op1->type;
9896 if(op1->type)
9897 op1->type->refCount++;
9898 }
9899 return 1;
9900 }
9901
9902 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9903 {
9904 unsigned int value2 = op2->__anon1.ui;
9905
9906 exp->type = 2;
9907 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9908 if(!exp->expType)
9909 {
9910 exp->expType = op1->type;
9911 if(op1->type)
9912 op1->type->refCount++;
9913 }
9914 return 1;
9915 }
9916
9917 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9918 {
9919 long long value2 = op2->__anon1.i64;
9920
9921 exp->type = 2;
9922 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9923 if(!exp->expType)
9924 {
9925 exp->expType = op1->type;
9926 if(op1->type)
9927 op1->type->refCount++;
9928 }
9929 return 1;
9930 }
9931
9932 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9933 {
9934 uint64 value2 = op2->__anon1.ui64;
9935
9936 exp->type = 2;
9937 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9938 if(!exp->expType)
9939 {
9940 exp->expType = op1->type;
9941 if(op1->type)
9942 op1->type->refCount++;
9943 }
9944 return 1;
9945 }
9946
9947 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9948 {
9949 short value2 = op2->__anon1.s;
9950
9951 exp->type = 2;
9952 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9953 if(!exp->expType)
9954 {
9955 exp->expType = op1->type;
9956 if(op1->type)
9957 op1->type->refCount++;
9958 }
9959 return 1;
9960 }
9961
9962 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9963 {
9964 unsigned short value2 = op2->__anon1.us;
9965
9966 exp->type = 2;
9967 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9968 if(!exp->expType)
9969 {
9970 exp->expType = op1->type;
9971 if(op1->type)
9972 op1->type->refCount++;
9973 }
9974 return 1;
9975 }
9976
9977 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9978 {
9979 char value2 = op2->__anon1.c;
9980
9981 exp->type = 2;
9982 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9983 if(!exp->expType)
9984 {
9985 exp->expType = op1->type;
9986 if(op1->type)
9987 op1->type->refCount++;
9988 }
9989 return 1;
9990 }
9991
9992 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9993 {
9994 unsigned char value2 = op2->__anon1.uc;
9995
9996 exp->type = 2;
9997 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9998 if(!exp->expType)
9999 {
10000 exp->expType = op1->type;
10001 if(op1->type)
10002 op1->type->refCount++;
10003 }
10004 return 1;
10005 }
10006
10007 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10008 {
10009 float value2 = op2->__anon1.f;
10010
10011 exp->type = 2;
10012 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
10013 if(!exp->expType)
10014 {
10015 exp->expType = op1->type;
10016 if(op1->type)
10017 op1->type->refCount++;
10018 }
10019 return 1;
10020 }
10021
10022 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10023 {
10024 double value2 = op2->__anon1.d;
10025
10026 exp->type = 2;
10027 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
10028 if(!exp->expType)
10029 {
10030 exp->expType = op1->type;
10031 if(op1->type)
10032 op1->type->refCount++;
10033 }
10034 return 1;
10035 }
10036
10037 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10038 {
10039 int value2 = op2->__anon1.i;
10040
10041 exp->type = 2;
10042 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10043 if(!exp->expType)
10044 {
10045 exp->expType = op1->type;
10046 if(op1->type)
10047 op1->type->refCount++;
10048 }
10049 return 1;
10050 }
10051
10052 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10053 {
10054 unsigned int value2 = op2->__anon1.ui;
10055
10056 exp->type = 2;
10057 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10058 if(!exp->expType)
10059 {
10060 exp->expType = op1->type;
10061 if(op1->type)
10062 op1->type->refCount++;
10063 }
10064 return 1;
10065 }
10066
10067 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10068 {
10069 long long value2 = op2->__anon1.i64;
10070
10071 exp->type = 2;
10072 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10073 if(!exp->expType)
10074 {
10075 exp->expType = op1->type;
10076 if(op1->type)
10077 op1->type->refCount++;
10078 }
10079 return 1;
10080 }
10081
10082 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10083 {
10084 uint64 value2 = op2->__anon1.ui64;
10085
10086 exp->type = 2;
10087 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10088 if(!exp->expType)
10089 {
10090 exp->expType = op1->type;
10091 if(op1->type)
10092 op1->type->refCount++;
10093 }
10094 return 1;
10095 }
10096
10097 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10098 {
10099 short value2 = op2->__anon1.s;
10100
10101 exp->type = 2;
10102 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10103 if(!exp->expType)
10104 {
10105 exp->expType = op1->type;
10106 if(op1->type)
10107 op1->type->refCount++;
10108 }
10109 return 1;
10110 }
10111
10112 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10113 {
10114 unsigned short value2 = op2->__anon1.us;
10115
10116 exp->type = 2;
10117 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10118 if(!exp->expType)
10119 {
10120 exp->expType = op1->type;
10121 if(op1->type)
10122 op1->type->refCount++;
10123 }
10124 return 1;
10125 }
10126
10127 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10128 {
10129 char value2 = op2->__anon1.c;
10130
10131 exp->type = 2;
10132 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10133 if(!exp->expType)
10134 {
10135 exp->expType = op1->type;
10136 if(op1->type)
10137 op1->type->refCount++;
10138 }
10139 return 1;
10140 }
10141
10142 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10143 {
10144 unsigned char value2 = op2->__anon1.uc;
10145
10146 exp->type = 2;
10147 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10148 if(!exp->expType)
10149 {
10150 exp->expType = op1->type;
10151 if(op1->type)
10152 op1->type->refCount++;
10153 }
10154 return 1;
10155 }
10156
10157 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10158 {
10159 float value2 = op2->__anon1.f;
10160
10161 exp->type = 2;
10162 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10163 if(!exp->expType)
10164 {
10165 exp->expType = op1->type;
10166 if(op1->type)
10167 op1->type->refCount++;
10168 }
10169 return 1;
10170 }
10171
10172 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10173 {
10174 double value2 = op2->__anon1.d;
10175
10176 exp->type = 2;
10177 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10178 if(!exp->expType)
10179 {
10180 exp->expType = op1->type;
10181 if(op1->type)
10182 op1->type->refCount++;
10183 }
10184 return 1;
10185 }
10186
10187 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10188 {
10189 int value2 = op2->__anon1.i;
10190
10191 exp->type = 2;
10192 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10193 if(!exp->expType)
10194 {
10195 exp->expType = op1->type;
10196 if(op1->type)
10197 op1->type->refCount++;
10198 }
10199 return 1;
10200 }
10201
10202 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10203 {
10204 unsigned int value2 = op2->__anon1.ui;
10205
10206 exp->type = 2;
10207 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10208 if(!exp->expType)
10209 {
10210 exp->expType = op1->type;
10211 if(op1->type)
10212 op1->type->refCount++;
10213 }
10214 return 1;
10215 }
10216
10217 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10218 {
10219 long long value2 = op2->__anon1.i64;
10220
10221 exp->type = 2;
10222 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10223 if(!exp->expType)
10224 {
10225 exp->expType = op1->type;
10226 if(op1->type)
10227 op1->type->refCount++;
10228 }
10229 return 1;
10230 }
10231
10232 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10233 {
10234 uint64 value2 = op2->__anon1.ui64;
10235
10236 exp->type = 2;
10237 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10238 if(!exp->expType)
10239 {
10240 exp->expType = op1->type;
10241 if(op1->type)
10242 op1->type->refCount++;
10243 }
10244 return 1;
10245 }
10246
10247 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10248 {
10249 short value2 = op2->__anon1.s;
10250
10251 exp->type = 2;
10252 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10253 if(!exp->expType)
10254 {
10255 exp->expType = op1->type;
10256 if(op1->type)
10257 op1->type->refCount++;
10258 }
10259 return 1;
10260 }
10261
10262 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10263 {
10264 unsigned short value2 = op2->__anon1.us;
10265
10266 exp->type = 2;
10267 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10268 if(!exp->expType)
10269 {
10270 exp->expType = op1->type;
10271 if(op1->type)
10272 op1->type->refCount++;
10273 }
10274 return 1;
10275 }
10276
10277 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10278 {
10279 char value2 = op2->__anon1.c;
10280
10281 exp->type = 2;
10282 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10283 if(!exp->expType)
10284 {
10285 exp->expType = op1->type;
10286 if(op1->type)
10287 op1->type->refCount++;
10288 }
10289 return 1;
10290 }
10291
10292 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10293 {
10294 unsigned char value2 = op2->__anon1.uc;
10295
10296 exp->type = 2;
10297 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10298 if(!exp->expType)
10299 {
10300 exp->expType = op1->type;
10301 if(op1->type)
10302 op1->type->refCount++;
10303 }
10304 return 1;
10305 }
10306
10307 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10308 {
10309 float value2 = op2->__anon1.f;
10310
10311 exp->type = 2;
10312 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10313 if(!exp->expType)
10314 {
10315 exp->expType = op1->type;
10316 if(op1->type)
10317 op1->type->refCount++;
10318 }
10319 return 1;
10320 }
10321
10322 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10323 {
10324 double value2 = op2->__anon1.d;
10325
10326 exp->type = 2;
10327 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10328 if(!exp->expType)
10329 {
10330 exp->expType = op1->type;
10331 if(op1->type)
10332 op1->type->refCount++;
10333 }
10334 return 1;
10335 }
10336
10337 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10338 {
10339 int value2 = op2->__anon1.i;
10340
10341 exp->type = 2;
10342 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10343 if(!exp->expType)
10344 {
10345 exp->expType = op1->type;
10346 if(op1->type)
10347 op1->type->refCount++;
10348 }
10349 return 1;
10350 }
10351
10352 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10353 {
10354 unsigned int value2 = op2->__anon1.ui;
10355
10356 exp->type = 2;
10357 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10358 if(!exp->expType)
10359 {
10360 exp->expType = op1->type;
10361 if(op1->type)
10362 op1->type->refCount++;
10363 }
10364 return 1;
10365 }
10366
10367 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10368 {
10369 long long value2 = op2->__anon1.i64;
10370
10371 exp->type = 2;
10372 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10373 if(!exp->expType)
10374 {
10375 exp->expType = op1->type;
10376 if(op1->type)
10377 op1->type->refCount++;
10378 }
10379 return 1;
10380 }
10381
10382 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10383 {
10384 uint64 value2 = op2->__anon1.ui64;
10385
10386 exp->type = 2;
10387 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10388 if(!exp->expType)
10389 {
10390 exp->expType = op1->type;
10391 if(op1->type)
10392 op1->type->refCount++;
10393 }
10394 return 1;
10395 }
10396
10397 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10398 {
10399 short value2 = op2->__anon1.s;
10400
10401 exp->type = 2;
10402 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10403 if(!exp->expType)
10404 {
10405 exp->expType = op1->type;
10406 if(op1->type)
10407 op1->type->refCount++;
10408 }
10409 return 1;
10410 }
10411
10412 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10413 {
10414 unsigned short value2 = op2->__anon1.us;
10415
10416 exp->type = 2;
10417 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10418 if(!exp->expType)
10419 {
10420 exp->expType = op1->type;
10421 if(op1->type)
10422 op1->type->refCount++;
10423 }
10424 return 1;
10425 }
10426
10427 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10428 {
10429 char value2 = op2->__anon1.c;
10430
10431 exp->type = 2;
10432 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10433 if(!exp->expType)
10434 {
10435 exp->expType = op1->type;
10436 if(op1->type)
10437 op1->type->refCount++;
10438 }
10439 return 1;
10440 }
10441
10442 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10443 {
10444 unsigned char value2 = op2->__anon1.uc;
10445
10446 exp->type = 2;
10447 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10448 if(!exp->expType)
10449 {
10450 exp->expType = op1->type;
10451 if(op1->type)
10452 op1->type->refCount++;
10453 }
10454 return 1;
10455 }
10456
10457 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10458 {
10459 float value2 = op2->__anon1.f;
10460
10461 exp->type = 2;
10462 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10463 if(!exp->expType)
10464 {
10465 exp->expType = op1->type;
10466 if(op1->type)
10467 op1->type->refCount++;
10468 }
10469 return 1;
10470 }
10471
10472 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10473 {
10474 double value2 = op2->__anon1.d;
10475
10476 exp->type = 2;
10477 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10478 if(!exp->expType)
10479 {
10480 exp->expType = op1->type;
10481 if(op1->type)
10482 op1->type->refCount++;
10483 }
10484 return 1;
10485 }
10486
10487 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10488 {
10489 int value2 = op2->__anon1.i;
10490
10491 exp->type = 2;
10492 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10493 if(!exp->expType)
10494 {
10495 exp->expType = op1->type;
10496 if(op1->type)
10497 op1->type->refCount++;
10498 }
10499 return 1;
10500 }
10501
10502 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10503 {
10504 unsigned int value2 = op2->__anon1.ui;
10505
10506 exp->type = 2;
10507 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10508 if(!exp->expType)
10509 {
10510 exp->expType = op1->type;
10511 if(op1->type)
10512 op1->type->refCount++;
10513 }
10514 return 1;
10515 }
10516
10517 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10518 {
10519 long long value2 = op2->__anon1.i64;
10520
10521 exp->type = 2;
10522 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10523 if(!exp->expType)
10524 {
10525 exp->expType = op1->type;
10526 if(op1->type)
10527 op1->type->refCount++;
10528 }
10529 return 1;
10530 }
10531
10532 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10533 {
10534 uint64 value2 = op2->__anon1.ui64;
10535
10536 exp->type = 2;
10537 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10538 if(!exp->expType)
10539 {
10540 exp->expType = op1->type;
10541 if(op1->type)
10542 op1->type->refCount++;
10543 }
10544 return 1;
10545 }
10546
10547 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10548 {
10549 short value2 = op2->__anon1.s;
10550
10551 exp->type = 2;
10552 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10553 if(!exp->expType)
10554 {
10555 exp->expType = op1->type;
10556 if(op1->type)
10557 op1->type->refCount++;
10558 }
10559 return 1;
10560 }
10561
10562 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10563 {
10564 unsigned short value2 = op2->__anon1.us;
10565
10566 exp->type = 2;
10567 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10568 if(!exp->expType)
10569 {
10570 exp->expType = op1->type;
10571 if(op1->type)
10572 op1->type->refCount++;
10573 }
10574 return 1;
10575 }
10576
10577 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10578 {
10579 char value2 = op2->__anon1.c;
10580
10581 exp->type = 2;
10582 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10583 if(!exp->expType)
10584 {
10585 exp->expType = op1->type;
10586 if(op1->type)
10587 op1->type->refCount++;
10588 }
10589 return 1;
10590 }
10591
10592 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10593 {
10594 unsigned char value2 = op2->__anon1.uc;
10595
10596 exp->type = 2;
10597 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10598 if(!exp->expType)
10599 {
10600 exp->expType = op1->type;
10601 if(op1->type)
10602 op1->type->refCount++;
10603 }
10604 return 1;
10605 }
10606
10607 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10608 {
10609 float value2 = op2->__anon1.f;
10610
10611 exp->type = 2;
10612 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10613 if(!exp->expType)
10614 {
10615 exp->expType = op1->type;
10616 if(op1->type)
10617 op1->type->refCount++;
10618 }
10619 return 1;
10620 }
10621
10622 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10623 {
10624 double value2 = op2->__anon1.d;
10625
10626 exp->type = 2;
10627 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10628 if(!exp->expType)
10629 {
10630 exp->expType = op1->type;
10631 if(op1->type)
10632 op1->type->refCount++;
10633 }
10634 return 1;
10635 }
10636
10637 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10638 {
10639 exp->type = 2;
10640 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10641 if(!exp->expType)
10642 {
10643 exp->expType = op1->type;
10644 if(op1->type)
10645 op1->type->refCount++;
10646 }
10647 return 1;
10648 }
10649
10650 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10651 {
10652 exp->type = 2;
10653 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10654 if(!exp->expType)
10655 {
10656 exp->expType = op1->type;
10657 if(op1->type)
10658 op1->type->refCount++;
10659 }
10660 return 1;
10661 }
10662
10663 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10664 {
10665 exp->type = 2;
10666 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10667 if(!exp->expType)
10668 {
10669 exp->expType = op1->type;
10670 if(op1->type)
10671 op1->type->refCount++;
10672 }
10673 return 1;
10674 }
10675
10676 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10677 {
10678 exp->type = 2;
10679 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10680 if(!exp->expType)
10681 {
10682 exp->expType = op1->type;
10683 if(op1->type)
10684 op1->type->refCount++;
10685 }
10686 return 1;
10687 }
10688
10689 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10690 {
10691 exp->type = 2;
10692 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10693 if(!exp->expType)
10694 {
10695 exp->expType = op1->type;
10696 if(op1->type)
10697 op1->type->refCount++;
10698 }
10699 return 1;
10700 }
10701
10702 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10703 {
10704 exp->type = 2;
10705 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10706 if(!exp->expType)
10707 {
10708 exp->expType = op1->type;
10709 if(op1->type)
10710 op1->type->refCount++;
10711 }
10712 return 1;
10713 }
10714
10715 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10716 {
10717 exp->type = 2;
10718 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10719 if(!exp->expType)
10720 {
10721 exp->expType = op1->type;
10722 if(op1->type)
10723 op1->type->refCount++;
10724 }
10725 return 1;
10726 }
10727
10728 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10729 {
10730 exp->type = 2;
10731 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10732 if(!exp->expType)
10733 {
10734 exp->expType = op1->type;
10735 if(op1->type)
10736 op1->type->refCount++;
10737 }
10738 return 1;
10739 }
10740
10741 struct OpTable intOps =
10742 {
10743 (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)
10744 };
10745
10746 struct OpTable uintOps =
10747 {
10748 (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)
10749 };
10750
10751 struct OpTable int64Ops =
10752 {
10753 (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)
10754 };
10755
10756 struct OpTable uint64Ops =
10757 {
10758 (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)
10759 };
10760
10761 struct OpTable shortOps =
10762 {
10763 (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)
10764 };
10765
10766 struct OpTable ushortOps =
10767 {
10768 (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)
10769 };
10770
10771 struct OpTable floatOps =
10772 {
10773 (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)
10774 };
10775
10776 struct OpTable doubleOps =
10777 {
10778 (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)
10779 };
10780
10781 struct OpTable charOps =
10782 {
10783 (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)
10784 };
10785
10786 struct OpTable ucharOps =
10787 {
10788 (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)
10789 };
10790
10791 void ReadString(char * output, char * string)
10792 {
10793 int len = strlen(string);
10794 int c, d = 0;
10795 unsigned int quoted = 0, escaped = 0;
10796
10797 for(c = 0; c < len; c++)
10798 {
10799 char ch = string[c];
10800
10801 if(escaped)
10802 {
10803 switch(ch)
10804 {
10805 case 'n':
10806 output[d] = '\n';
10807 break;
10808 case 't':
10809 output[d] = '\t';
10810 break;
10811 case 'a':
10812 output[d] = '\a';
10813 break;
10814 case 'b':
10815 output[d] = '\b';
10816 break;
10817 case 'f':
10818 output[d] = '\f';
10819 break;
10820 case 'r':
10821 output[d] = '\r';
10822 break;
10823 case 'v':
10824 output[d] = '\v';
10825 break;
10826 case '\\':
10827 output[d] = '\\';
10828 break;
10829 case '\"':
10830 output[d] = '\"';
10831 break;
10832 case '\'':
10833 output[d] = '\'';
10834 break;
10835 default:
10836 output[d] = ch;
10837 }
10838 d++;
10839 escaped = 0;
10840 }
10841 else
10842 {
10843 if(ch == '\"')
10844 quoted ^= 1;
10845 else if(quoted)
10846 {
10847 if(ch == '\\')
10848 escaped = 1;
10849 else
10850 output[d++] = ch;
10851 }
10852 }
10853 }
10854 output[d] = '\0';
10855 }
10856
10857 int UnescapeString(char * d, char * s, int len)
10858 {
10859 int j = 0, k = 0;
10860 char ch;
10861
10862 while(j < len && (ch = s[j]))
10863 {
10864 switch(ch)
10865 {
10866 case '\\':
10867 switch((ch = s[++j]))
10868 {
10869 case 'n':
10870 d[k] = '\n';
10871 break;
10872 case 't':
10873 d[k] = '\t';
10874 break;
10875 case 'a':
10876 d[k] = '\a';
10877 break;
10878 case 'b':
10879 d[k] = '\b';
10880 break;
10881 case 'f':
10882 d[k] = '\f';
10883 break;
10884 case 'r':
10885 d[k] = '\r';
10886 break;
10887 case 'v':
10888 d[k] = '\v';
10889 break;
10890 case '\\':
10891 d[k] = '\\';
10892 break;
10893 case '\"':
10894 d[k] = '\"';
10895 break;
10896 case '\'':
10897 d[k] = '\'';
10898 break;
10899 default:
10900 d[k] = '\\';
10901 d[k] = ch;
10902 }
10903 break;
10904 default:
10905 d[k] = ch;
10906 }
10907 j++, k++;
10908 }
10909 d[k] = '\0';
10910 return k;
10911 }
10912
10913 char * OffsetEscapedString(char * s, int len, int offset)
10914 {
10915 char ch;
10916 int j = 0, k = 0;
10917
10918 while(j < len && k < offset && (ch = s[j]))
10919 {
10920 if(ch == '\\')
10921 ++j;
10922 j++, k++;
10923 }
10924 return (k == offset) ? s + j : (((void *)0));
10925 }
10926
10927 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10928
10929 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10930
10931 extern double strtod(const char * , char * * );
10932
10933 extern float (* __ecereMethod_float_inf)(void);
10934
10935 extern float (* __ecereMethod_float_nan)(void);
10936
10937 extern double (* __ecereMethod_double_inf)(void);
10938
10939 extern double (* __ecereMethod_double_nan)(void);
10940
10941 struct Operand GetOperand(struct Expression * exp)
10942 {
10943 struct Operand op =
10944 {
10945 0, 0, 0,
10946 .__anon1 = {
10947 .c = 0
10948 },
10949 {
10950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10951 }
10952 };
10953 struct Type * type = exp->expType;
10954
10955 if(type)
10956 {
10957 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))
10958 {
10959 if(!type->__anon1._class->__anon1.registered->dataType)
10960 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10961 type = type->__anon1._class->__anon1.registered->dataType;
10962 }
10963 if(exp->type == 3 && op.kind == 13)
10964 {
10965 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
10966 op.kind = 13;
10967 op.ops = uint64Ops;
10968 }
10969 else if(exp->isConstant && exp->type == 2)
10970 {
10971 op.kind = type->kind;
10972 op.type = type;
10973 switch(op.kind)
10974 {
10975 case 24:
10976 case 1:
10977 {
10978 if(exp->__anon1.__anon1.constant[0] == '\'')
10979 {
10980 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10981 op.ops = charOps;
10982 }
10983 else if(type->isSigned)
10984 {
10985 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10986 op.ops = charOps;
10987 }
10988 else
10989 {
10990 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10991 op.ops = ucharOps;
10992 }
10993 break;
10994 }
10995 case 2:
10996 if(type->isSigned)
10997 {
10998 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10999 op.ops = shortOps;
11000 }
11001 else
11002 {
11003 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11004 op.ops = ushortOps;
11005 }
11006 break;
11007 case 3:
11008 case 5:
11009 if(type->isSigned)
11010 {
11011 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11012 op.ops = intOps;
11013 }
11014 else
11015 {
11016 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11017 op.ops = uintOps;
11018 }
11019 op.kind = 3;
11020 break;
11021 case 4:
11022 if(type->isSigned)
11023 {
11024 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11025 op.ops = int64Ops;
11026 }
11027 else
11028 {
11029 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11030 op.ops = uint64Ops;
11031 }
11032 op.kind = 4;
11033 break;
11034 case 22:
11035 if(type->isSigned)
11036 {
11037 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11038 op.ops = int64Ops;
11039 }
11040 else
11041 {
11042 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11043 op.ops = uint64Ops;
11044 }
11045 op.kind = 4;
11046 break;
11047 case 23:
11048 if(type->isSigned)
11049 {
11050 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11051 op.ops = int64Ops;
11052 }
11053 else
11054 {
11055 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11056 op.ops = uint64Ops;
11057 }
11058 op.kind = 4;
11059 break;
11060 case 6:
11061 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11062 op.__anon1.f = __ecereMethod_float_inf();
11063 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11064 op.__anon1.f = -__ecereMethod_float_inf();
11065 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11066 op.__anon1.f = __ecereMethod_float_nan();
11067 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11068 op.__anon1.f = -__ecereMethod_float_nan();
11069 else
11070 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11071 op.ops = floatOps;
11072 break;
11073 case 7:
11074 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11075 op.__anon1.d = __ecereMethod_double_inf();
11076 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11077 op.__anon1.d = -__ecereMethod_double_inf();
11078 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11079 op.__anon1.d = __ecereMethod_double_nan();
11080 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11081 op.__anon1.d = -__ecereMethod_double_nan();
11082 else
11083 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11084 op.ops = doubleOps;
11085 break;
11086 case 12:
11087 case 13:
11088 case 8:
11089 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11090 op.kind = 13;
11091 op.ops = uint64Ops;
11092 break;
11093 }
11094 }
11095 }
11096 return op;
11097 }
11098
11099 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11100 {
11101 long long v = 0;
11102
11103 switch(_class->typeSize)
11104 {
11105 case 8:
11106 if(!strcmp(_class->dataTypeString, "uint64"))
11107 v = (long long)*(uint64 *)ptr;
11108 else
11109 v = *(long long *)ptr;
11110 break;
11111 case 4:
11112 if(!strcmp(_class->dataTypeString, "uint"))
11113 v = (long long)*(unsigned int *)ptr;
11114 else
11115 v = (long long)*(int *)ptr;
11116 break;
11117 case 2:
11118 if(!strcmp(_class->dataTypeString, "uint16"))
11119 v = (long long)*(unsigned short *)ptr;
11120 else
11121 v = (long long)*(short *)ptr;
11122 break;
11123 case 1:
11124 if(!strcmp(_class->dataTypeString, "byte"))
11125 v = (long long)*(unsigned char *)ptr;
11126 else
11127 v = (long long)*(char *)ptr;
11128 break;
11129 }
11130 return v;
11131 }
11132
11133 int __ecereVMethodID_class_OnGetString;
11134
11135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11136
11137 static __attribute__((unused)) void UnusedFunction()
11138 {
11139 int a;
11140
11141 ((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);
11142 }
11143
11144 extern int __ecereVMethodID_class_OnGetString;
11145
11146 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11147 {
11148 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11149
11150 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11151 {
11152 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11153 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11154 else
11155 {
11156 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11157 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11158 struct Type * type;
11159 void * ptr = inst->data + dataMember->offset + offset;
11160 char * result = (((void *)0));
11161
11162 exp->loc = member->loc = inst->loc;
11163 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11164 if(!dataMember->dataType)
11165 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11166 type = dataMember->dataType;
11167 if(type->kind == 8)
11168 {
11169 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11170
11171 if(_class->type == 4)
11172 {
11173 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11174
11175 if(enumClass)
11176 {
11177 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11178 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11179
11180 for(item = e->values.first; item; item = item->next)
11181 {
11182 if(item->data == GetEnumValue(_class, ptr))
11183 {
11184 result = item->name;
11185 break;
11186 }
11187 }
11188 if(result)
11189 {
11190 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11191 exp->type = 0;
11192 exp->destType = MkClassType(_class->fullName);
11193 ProcessExpressionType(exp);
11194 }
11195 }
11196 }
11197 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11198 {
11199 if(!_class->dataType)
11200 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11201 type = _class->dataType;
11202 }
11203 }
11204 if(!result)
11205 {
11206 switch(type->kind)
11207 {
11208 case 6:
11209 {
11210 FreeExpContents(exp);
11211 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11212 exp->type = 2;
11213 break;
11214 }
11215 case 7:
11216 {
11217 FreeExpContents(exp);
11218 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11219 exp->type = 2;
11220 break;
11221 }
11222 case 3:
11223 {
11224 FreeExpContents(exp);
11225 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11226 exp->type = 2;
11227 break;
11228 }
11229 case 4:
11230 {
11231 FreeExpContents(exp);
11232 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11233 exp->type = 2;
11234 break;
11235 }
11236 case 22:
11237 {
11238 FreeExpContents(exp);
11239 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11240 exp->type = 2;
11241 break;
11242 }
11243 case 23:
11244 {
11245 FreeExpContents(exp);
11246 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11247 exp->type = 2;
11248 break;
11249 }
11250 default:
11251 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11252 }
11253 }
11254 ListAdd(memberList, member);
11255 }
11256 if(parentDataMember->type == 1)
11257 break;
11258 }
11259 }
11260
11261 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11262
11263 void PopulateInstance(struct Instantiation * inst)
11264 {
11265 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11266 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11267 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11268 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11269
11270 if(!inst->members)
11271 inst->members = MkListOne(MkMembersInitList(memberList));
11272 else
11273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11274 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11275 {
11276 if(!dataMember->isProperty)
11277 {
11278 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11279 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11280 else
11281 {
11282 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11283 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11284 struct Type * type;
11285 void * ptr = inst->data + dataMember->offset;
11286 char * result = (((void *)0));
11287
11288 exp->loc = member->loc = inst->loc;
11289 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11290 if(!dataMember->dataType)
11291 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11292 type = dataMember->dataType;
11293 if(type->kind == 8)
11294 {
11295 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11296
11297 if(_class->type == 4)
11298 {
11299 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11300
11301 if(enumClass)
11302 {
11303 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11304 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11305
11306 for(item = e->values.first; item; item = item->next)
11307 {
11308 if(item->data == GetEnumValue(_class, ptr))
11309 {
11310 result = item->name;
11311 break;
11312 }
11313 }
11314 }
11315 if(result)
11316 {
11317 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11318 exp->type = 0;
11319 exp->destType = MkClassType(_class->fullName);
11320 ProcessExpressionType(exp);
11321 }
11322 }
11323 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11324 {
11325 if(!_class->dataType)
11326 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11327 type = _class->dataType;
11328 }
11329 }
11330 if(!result)
11331 {
11332 switch(type->kind)
11333 {
11334 case 6:
11335 {
11336 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11337 exp->type = 2;
11338 break;
11339 }
11340 case 7:
11341 {
11342 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11343 exp->type = 2;
11344 break;
11345 }
11346 case 3:
11347 {
11348 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11349 exp->type = 2;
11350 break;
11351 }
11352 case 4:
11353 {
11354 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11355 exp->type = 2;
11356 break;
11357 }
11358 case 22:
11359 {
11360 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11361 exp->type = 2;
11362 break;
11363 }
11364 default:
11365 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11366 }
11367 }
11368 ListAdd(memberList, member);
11369 }
11370 }
11371 }
11372 }
11373
11374 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);
11375
11376 extern void FreeInstance(struct Instantiation * inst);
11377
11378 void ComputeInstantiation(struct Expression * exp)
11379 {
11380 struct Instantiation * inst = exp->__anon1.instance;
11381 struct MembersInit * members;
11382 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11383 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11384 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11385 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11386 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11387 int subMemberStackPos = 0;
11388 uint64 bits = 0;
11389
11390 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11391 {
11392 if(inst->data)
11393 return ;
11394 if(_class->type == 0 || _class->type == 5)
11395 {
11396 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11397 if(_class->type == 0)
11398 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11399 }
11400 else
11401 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11402 }
11403 if(inst->members)
11404 {
11405 for(members = (*inst->members).first; members; members = members->next)
11406 {
11407 switch(members->type)
11408 {
11409 case 0:
11410 {
11411 if(members->__anon1.dataMembers)
11412 {
11413 struct MemberInit * member;
11414
11415 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11416 {
11417 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11418 unsigned int found = 0;
11419 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11420 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11421 unsigned int dataMemberOffset;
11422
11423 if(!ident)
11424 {
11425 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11426 if(curMember)
11427 {
11428 if(curMember->isProperty)
11429 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11430 else
11431 {
11432 dataMember = curMember;
11433 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11434 if(_class->type == 0)
11435 dataMemberOffset += _class->base->structSize;
11436 }
11437 found = 1;
11438 }
11439 }
11440 else
11441 {
11442 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11443 if(prop)
11444 {
11445 found = 1;
11446 if(prop->memberAccess == 1)
11447 {
11448 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11449 curClass = prop->_class;
11450 }
11451 }
11452 else
11453 {
11454 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11455 int _subMemberStackPos = 0;
11456
11457 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11458 if(dataMember)
11459 {
11460 found = 1;
11461 if(dataMember->memberAccess == 1)
11462 {
11463 curMember = dataMember;
11464 curClass = dataMember->_class;
11465 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11466 subMemberStackPos = _subMemberStackPos;
11467 }
11468 }
11469 }
11470 }
11471 if(found && member->initializer && member->initializer->type == 0)
11472 {
11473 struct Expression * value = member->initializer->__anon1.exp;
11474 struct Type * type = (((void *)0));
11475 unsigned int deepMember = 0;
11476
11477 if(prop)
11478 {
11479 type = prop->dataType;
11480 }
11481 else if(dataMember)
11482 {
11483 if(!dataMember->dataType)
11484 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11485 type = dataMember->dataType;
11486 }
11487 if(ident && ident->next)
11488 {
11489 deepMember = 1;
11490 for(ident = ident->next; ident && type; ident = ident->next)
11491 {
11492 if(type->kind == 8)
11493 {
11494 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11495 if(prop)
11496 type = prop->dataType;
11497 else
11498 {
11499 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11500 if(dataMember)
11501 type = dataMember->dataType;
11502 }
11503 }
11504 else if(type->kind == 9 || type->kind == 10)
11505 {
11506 struct Type * memberType;
11507
11508 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11509 {
11510 if(!strcmp(memberType->name, ident->string))
11511 {
11512 type = memberType;
11513 break;
11514 }
11515 }
11516 }
11517 }
11518 }
11519 if(value)
11520 {
11521 FreeType(value->destType);
11522 value->destType = type;
11523 if(type)
11524 type->refCount++;
11525 ComputeExpression(value);
11526 }
11527 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11528 {
11529 if(type->kind == 8)
11530 {
11531 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11532
11533 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11534 {
11535 if(!_class->dataType)
11536 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11537 type = _class->dataType;
11538 }
11539 }
11540 if(dataMember)
11541 {
11542 void * ptr = inst->data + dataMemberOffset;
11543
11544 if(value->type == 2)
11545 {
11546 switch(type->kind)
11547 {
11548 case 3:
11549 {
11550 GetInt(value, (int *)ptr);
11551 break;
11552 }
11553 case 4:
11554 {
11555 GetInt64(value, (long long *)ptr);
11556 break;
11557 }
11558 case 22:
11559 {
11560 GetIntPtr(value, (intptr_t *)ptr);
11561 break;
11562 }
11563 case 23:
11564 {
11565 GetIntSize(value, (ssize_t *)ptr);
11566 break;
11567 }
11568 case 6:
11569 {
11570 GetFloat(value, (float *)ptr);
11571 break;
11572 }
11573 case 7:
11574 {
11575 GetDouble(value, (double *)ptr);
11576 break;
11577 }
11578 }
11579 }
11580 else if(value->type == 1)
11581 {
11582 if(type->kind == 8)
11583 {
11584 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11585
11586 if(_class->type == 1)
11587 {
11588 ComputeTypeSize(type);
11589 if(value->__anon1.instance->data)
11590 memcpy(ptr, value->__anon1.instance->data, type->size);
11591 }
11592 }
11593 }
11594 }
11595 else if(prop && prop->Set != (void *)(intptr_t)1)
11596 {
11597 if(value->type == 1 && value->__anon1.instance->data)
11598 {
11599 if(type->kind == 8)
11600 {
11601 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11602
11603 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)))
11604 {
11605 void (* Set)(void *, void *) = (void *)prop->Set;
11606
11607 Set(inst->data, value->__anon1.instance->data);
11608 PopulateInstance(inst);
11609 }
11610 }
11611 }
11612 else if(value->type == 2)
11613 {
11614 switch(type->kind)
11615 {
11616 case 7:
11617 {
11618 void (* Set)(void *, double) = (void *)prop->Set;
11619
11620 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11621 break;
11622 }
11623 case 6:
11624 {
11625 void (* Set)(void *, float) = (void *)prop->Set;
11626
11627 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11628 break;
11629 }
11630 case 3:
11631 {
11632 void (* Set)(void *, int) = (void *)prop->Set;
11633
11634 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11635 break;
11636 }
11637 case 4:
11638 {
11639 void (* Set)(void *, long long) = (void *)prop->Set;
11640
11641 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11642 break;
11643 }
11644 case 22:
11645 {
11646 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11647
11648 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11649 break;
11650 }
11651 case 23:
11652 {
11653 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11654
11655 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11656 break;
11657 }
11658 }
11659 }
11660 else if(value->type == 3)
11661 {
11662 char temp[1024];
11663
11664 ReadString(temp, value->__anon1.__anon2.string);
11665 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11666 }
11667 }
11668 }
11669 else if(!deepMember && type && _class->type == 3)
11670 {
11671 if(prop)
11672 {
11673 if(value->type == 2)
11674 {
11675 if(type->kind == 8)
11676 {
11677 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11678
11679 if(_class->type == 3)
11680 {
11681 if(!_class->dataType)
11682 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11683 type = _class->dataType;
11684 }
11685 }
11686 switch(type->kind)
11687 {
11688 case 6:
11689 {
11690 float fValue;
11691 float (* Set)(float) = (void *)prop->Set;
11692
11693 GetFloat(member->initializer->__anon1.exp, &fValue);
11694 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11695 exp->type = 2;
11696 break;
11697 }
11698 case 7:
11699 {
11700 double dValue;
11701 double (* Set)(double) = (void *)prop->Set;
11702
11703 GetDouble(member->initializer->__anon1.exp, &dValue);
11704 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11705 exp->type = 2;
11706 break;
11707 }
11708 }
11709 }
11710 }
11711 }
11712 else if(!deepMember && type && _class->type == 2)
11713 {
11714 if(prop)
11715 {
11716 if(value->type == 1 && value->__anon1.instance->data)
11717 {
11718 unsigned int (* Set)(void *) = (void *)prop->Set;
11719
11720 bits = Set(value->__anon1.instance->data);
11721 }
11722 else if(value->type == 2)
11723 {
11724 }
11725 }
11726 else if(dataMember)
11727 {
11728 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11729 struct Type * type;
11730 uint64 part = 0;
11731
11732 bits = (bits & ~bitMember->mask);
11733 if(!bitMember->dataType)
11734 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11735 type = bitMember->dataType;
11736 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11737 {
11738 if(!type->__anon1._class->__anon1.registered->dataType)
11739 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11740 type = type->__anon1._class->__anon1.registered->dataType;
11741 }
11742 switch(type->kind)
11743 {
11744 case 24:
11745 case 1:
11746 {
11747 unsigned char v;
11748
11749 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11750 part = (uint64)v;
11751 break;
11752 }
11753 case 2:
11754 {
11755 unsigned short v;
11756
11757 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11758 part = (uint64)v;
11759 break;
11760 }
11761 case 3:
11762 case 5:
11763 {
11764 unsigned int v;
11765
11766 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11767 part = (uint64)v;
11768 break;
11769 }
11770 case 4:
11771 {
11772 uint64 v;
11773
11774 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11775 part = v;
11776 break;
11777 }
11778 case 22:
11779 {
11780 uintptr_t v;
11781
11782 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11783 part = (uint64)v;
11784 break;
11785 }
11786 case 23:
11787 {
11788 size_t v;
11789
11790 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11791 part = (uint64)v;
11792 break;
11793 }
11794 }
11795 bits |= part << bitMember->pos;
11796 }
11797 }
11798 }
11799 else
11800 {
11801 if(_class && _class->type == 3)
11802 {
11803 ComputeExpression(member->initializer->__anon1.exp);
11804 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11805 exp->type = 2;
11806 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11807 }
11808 }
11809 }
11810 }
11811 break;
11812 }
11813 }
11814 }
11815 }
11816 if(_class && _class->type == 2)
11817 {
11818 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11819 exp->type = 2;
11820 }
11821 if(exp->type != 1)
11822 {
11823 FreeInstance(inst);
11824 }
11825 }
11826
11827 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11828 {
11829 unsigned int result = 0;
11830
11831 switch(kind)
11832 {
11833 case 2:
11834 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11835 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11836 break;
11837 case 3:
11838 case 5:
11839 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11840 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11841 break;
11842 case 4:
11843 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)
11844 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11845 break;
11846 case 6:
11847 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)
11848 result = GetOpFloat(op, &op->__anon1.f);
11849 break;
11850 case 7:
11851 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)
11852 result = GetOpDouble(op, &op->__anon1.d);
11853 break;
11854 case 13:
11855 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)
11856 result = GetOpUInt64(op, &op->__anon1.ui64);
11857 break;
11858 case 15:
11859 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)
11860 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11861 break;
11862 case 22:
11863 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11864 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11865 break;
11866 case 23:
11867 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11868 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11869 break;
11870 }
11871 return result;
11872 }
11873
11874 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11875 {
11876 if(exp->__anon1.op.op == SIZEOF)
11877 {
11878 FreeExpContents(exp);
11879 exp->type = 2;
11880 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11881 }
11882 else
11883 {
11884 if(!exp->__anon1.op.exp1)
11885 {
11886 switch(exp->__anon1.op.op)
11887 {
11888 case '+':
11889 {
11890 struct Expression * exp2 = exp->__anon1.op.exp2;
11891
11892 exp->__anon1.op.exp2 = (((void *)0));
11893 FreeExpContents(exp);
11894 FreeType(exp->expType);
11895 FreeType(exp->destType);
11896 *exp = *exp2;
11897 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11898 break;
11899 }
11900 case '-':
11901 if(op1->ops.Neg)
11902 {
11903 FreeExpContents(exp);
11904 op1->ops.Neg(exp, op1);
11905 }
11906 break;
11907 case '~':
11908 if(op1->ops.BitNot)
11909 {
11910 FreeExpContents(exp);
11911 op1->ops.BitNot(exp, op1);
11912 }
11913 break;
11914 case '!':
11915 if(op1->ops.Not)
11916 {
11917 FreeExpContents(exp);
11918 op1->ops.Not(exp, op1);
11919 }
11920 break;
11921 }
11922 }
11923 else
11924 {
11925 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11926 {
11927 if(Promote(op2, op1->kind, op1->type->isSigned))
11928 op2->kind = op1->kind, op2->ops = op1->ops;
11929 else if(Promote(op1, op2->kind, op2->type->isSigned))
11930 op1->kind = op2->kind, op1->ops = op2->ops;
11931 }
11932 switch(exp->__anon1.op.op)
11933 {
11934 case '+':
11935 if(op1->ops.Add)
11936 {
11937 FreeExpContents(exp);
11938 op1->ops.Add(exp, op1, op2);
11939 }
11940 break;
11941 case '-':
11942 if(op1->ops.Sub)
11943 {
11944 FreeExpContents(exp);
11945 op1->ops.Sub(exp, op1, op2);
11946 }
11947 break;
11948 case '*':
11949 if(op1->ops.Mul)
11950 {
11951 FreeExpContents(exp);
11952 op1->ops.Mul(exp, op1, op2);
11953 }
11954 break;
11955 case '/':
11956 if(op1->ops.Div)
11957 {
11958 FreeExpContents(exp);
11959 op1->ops.Div(exp, op1, op2);
11960 }
11961 break;
11962 case '%':
11963 if(op1->ops.Mod)
11964 {
11965 FreeExpContents(exp);
11966 op1->ops.Mod(exp, op1, op2);
11967 }
11968 break;
11969 case '&':
11970 if(exp->__anon1.op.exp2)
11971 {
11972 if(op1->ops.BitAnd)
11973 {
11974 FreeExpContents(exp);
11975 op1->ops.BitAnd(exp, op1, op2);
11976 }
11977 }
11978 break;
11979 case '|':
11980 if(op1->ops.BitOr)
11981 {
11982 FreeExpContents(exp);
11983 op1->ops.BitOr(exp, op1, op2);
11984 }
11985 break;
11986 case '^':
11987 if(op1->ops.BitXor)
11988 {
11989 FreeExpContents(exp);
11990 op1->ops.BitXor(exp, op1, op2);
11991 }
11992 break;
11993 case LEFT_OP:
11994 if(op1->ops.LShift)
11995 {
11996 FreeExpContents(exp);
11997 op1->ops.LShift(exp, op1, op2);
11998 }
11999 break;
12000 case RIGHT_OP:
12001 if(op1->ops.RShift)
12002 {
12003 FreeExpContents(exp);
12004 op1->ops.RShift(exp, op1, op2);
12005 }
12006 break;
12007 case EQ_OP:
12008 if(op1->ops.Equ)
12009 {
12010 FreeExpContents(exp);
12011 op1->ops.Equ(exp, op1, op2);
12012 }
12013 break;
12014 case NE_OP:
12015 if(op1->ops.Nqu)
12016 {
12017 FreeExpContents(exp);
12018 op1->ops.Nqu(exp, op1, op2);
12019 }
12020 break;
12021 case AND_OP:
12022 if(op1->ops.And)
12023 {
12024 FreeExpContents(exp);
12025 op1->ops.And(exp, op1, op2);
12026 }
12027 break;
12028 case OR_OP:
12029 if(op1->ops.Or)
12030 {
12031 FreeExpContents(exp);
12032 op1->ops.Or(exp, op1, op2);
12033 }
12034 break;
12035 case '>':
12036 if(op1->ops.Grt)
12037 {
12038 FreeExpContents(exp);
12039 op1->ops.Grt(exp, op1, op2);
12040 }
12041 break;
12042 case '<':
12043 if(op1->ops.Sma)
12044 {
12045 FreeExpContents(exp);
12046 op1->ops.Sma(exp, op1, op2);
12047 }
12048 break;
12049 case GE_OP:
12050 if(op1->ops.GrtEqu)
12051 {
12052 FreeExpContents(exp);
12053 op1->ops.GrtEqu(exp, op1, op2);
12054 }
12055 break;
12056 case LE_OP:
12057 if(op1->ops.SmaEqu)
12058 {
12059 FreeExpContents(exp);
12060 op1->ops.SmaEqu(exp, op1, op2);
12061 }
12062 break;
12063 }
12064 }
12065 }
12066 }
12067
12068 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12069
12070 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12071
12072 void ComputeExpression(struct Expression * exp)
12073 {
12074 switch(exp->type)
12075 {
12076 case 1:
12077 {
12078 ComputeInstantiation(exp);
12079 break;
12080 }
12081 case 4:
12082 {
12083 struct Expression * exp1, * exp2 = (((void *)0));
12084 struct Operand op1 =
12085 {
12086 0, 0, 0,
12087 .__anon1 = {
12088 .c = 0
12089 },
12090 {
12091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12092 }
12093 };
12094 struct Operand op2 =
12095 {
12096 0, 0, 0,
12097 .__anon1 = {
12098 .c = 0
12099 },
12100 {
12101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12102 }
12103 };
12104
12105 if(exp->__anon1.op.exp2)
12106 {
12107 struct Expression * e = exp->__anon1.op.exp2;
12108
12109 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12110 {
12111 if(e->type == 5 || e->type == 32 || e->type == 23)
12112 {
12113 if(e->type == 23)
12114 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12115 else
12116 e = (*e->__anon1.list).last;
12117 }
12118 }
12119 if(exp->__anon1.op.op == 261 && e && e->expType)
12120 {
12121 if(e->type == 3 && e->__anon1.__anon2.string)
12122 {
12123 char * string = e->__anon1.__anon2.string;
12124 int len = strlen(string);
12125 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12126
12127 len = UnescapeString(tmp, string + 1, len - 2);
12128 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12129 FreeExpContents(exp);
12130 exp->type = 2;
12131 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12132 }
12133 else
12134 {
12135 struct Type * type = e->expType;
12136
12137 type->refCount++;
12138 FreeExpContents(exp);
12139 exp->type = 2;
12140 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12141 FreeType(type);
12142 }
12143 break;
12144 }
12145 else
12146 ComputeExpression(exp->__anon1.op.exp2);
12147 }
12148 if(exp->__anon1.op.exp1)
12149 {
12150 ComputeExpression(exp->__anon1.op.exp1);
12151 exp1 = exp->__anon1.op.exp1;
12152 exp2 = exp->__anon1.op.exp2;
12153 op1 = GetOperand(exp1);
12154 if(op1.type)
12155 op1.type->refCount++;
12156 if(exp2)
12157 {
12158 op2 = GetOperand(exp2);
12159 if(op2.type)
12160 op2.type->refCount++;
12161 }
12162 }
12163 else
12164 {
12165 exp1 = exp->__anon1.op.exp2;
12166 op1 = GetOperand(exp1);
12167 if(op1.type)
12168 op1.type->refCount++;
12169 }
12170 CallOperator(exp, exp1, exp2, &op1, &op2);
12171 if(op1.type)
12172 FreeType(op1.type);
12173 if(op2.type)
12174 FreeType(op2.type);
12175 break;
12176 }
12177 case 5:
12178 case 32:
12179 {
12180 struct Expression * e, * n;
12181
12182 for(e = (*exp->__anon1.list).first; e; e = n)
12183 {
12184 n = e->next;
12185 if(!n)
12186 {
12187 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12188 struct Expression * prev = exp->prev;
12189 struct Expression * next = exp->next;
12190
12191 ComputeExpression(e);
12192 FreeType(exp->expType);
12193 FreeType(exp->destType);
12194 *exp = *e;
12195 exp->prev = prev;
12196 exp->next = next;
12197 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12198 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12199 }
12200 else
12201 {
12202 FreeExpression(e);
12203 }
12204 }
12205 break;
12206 }
12207 case 8:
12208 {
12209 struct Expression * memberExp = exp->__anon1.member.exp;
12210 struct Identifier * memberID = exp->__anon1.member.member;
12211 struct Type * type;
12212
12213 ComputeExpression(exp->__anon1.member.exp);
12214 type = exp->__anon1.member.exp->expType;
12215 if(type)
12216 {
12217 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)));
12218 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12219 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12220 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12221
12222 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12223 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12224 if(!_class)
12225 {
12226 char string[256];
12227 struct Symbol * classSym;
12228
12229 string[0] = '\0';
12230 PrintTypeNoConst(type, string, 0, 1);
12231 classSym = FindClass(string);
12232 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12233 }
12234 if(exp->__anon1.member.member)
12235 {
12236 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12237 if(!prop)
12238 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12239 }
12240 if(!prop && !member && _class && exp->__anon1.member.member)
12241 {
12242 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12243
12244 convertTo = _class;
12245 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12246 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12247 }
12248 if(prop)
12249 {
12250 if(prop->compiled)
12251 {
12252 struct Type * type = prop->dataType;
12253
12254 if(_class->type == 3)
12255 {
12256 if(type->kind == 8)
12257 {
12258 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12259
12260 if(_class->type == 3)
12261 {
12262 if(!_class->dataType)
12263 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12264 type = _class->dataType;
12265 }
12266 }
12267 switch(type->kind)
12268 {
12269 case 6:
12270 {
12271 float value;
12272 float (* Get)(float) = (void *)prop->Get;
12273
12274 GetFloat(exp->__anon1.member.exp, &value);
12275 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12276 exp->type = 2;
12277 break;
12278 }
12279 case 7:
12280 {
12281 double value;
12282 double (* Get)(double);
12283
12284 GetDouble(exp->__anon1.member.exp, &value);
12285 if(convertTo)
12286 Get = (void *)prop->Set;
12287 else
12288 Get = (void *)prop->Get;
12289 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12290 exp->type = 2;
12291 break;
12292 }
12293 }
12294 }
12295 else
12296 {
12297 if(convertTo)
12298 {
12299 struct Expression * value = exp->__anon1.member.exp;
12300 struct Type * type;
12301
12302 if(!prop->dataType)
12303 ProcessPropertyType(prop);
12304 type = prop->dataType;
12305 if(!type)
12306 {
12307 }
12308 else if(_class->type == 1)
12309 {
12310 switch(type->kind)
12311 {
12312 case 8:
12313 {
12314 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12315
12316 if(propertyClass->type == 1 && value->type == 1)
12317 {
12318 void (* Set)(void *, void *) = (void *)prop->Set;
12319
12320 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12321 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12322 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12323 exp->__anon1.instance->loc = exp->loc;
12324 exp->type = 1;
12325 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12326 PopulateInstance(exp->__anon1.instance);
12327 }
12328 break;
12329 }
12330 case 3:
12331 {
12332 int intValue;
12333 void (* Set)(void *, int) = (void *)prop->Set;
12334
12335 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12336 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12337 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12338 exp->__anon1.instance->loc = exp->loc;
12339 exp->type = 1;
12340 GetInt(value, &intValue);
12341 Set(exp->__anon1.instance->data, intValue);
12342 PopulateInstance(exp->__anon1.instance);
12343 break;
12344 }
12345 case 4:
12346 {
12347 long long intValue;
12348 void (* Set)(void *, long long) = (void *)prop->Set;
12349
12350 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12351 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12352 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12353 exp->__anon1.instance->loc = exp->loc;
12354 exp->type = 1;
12355 GetInt64(value, &intValue);
12356 Set(exp->__anon1.instance->data, intValue);
12357 PopulateInstance(exp->__anon1.instance);
12358 break;
12359 }
12360 case 22:
12361 {
12362 intptr_t intValue;
12363 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12364
12365 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12366 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12367 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12368 exp->__anon1.instance->loc = exp->loc;
12369 exp->type = 1;
12370 GetIntPtr(value, &intValue);
12371 Set(exp->__anon1.instance->data, intValue);
12372 PopulateInstance(exp->__anon1.instance);
12373 break;
12374 }
12375 case 23:
12376 {
12377 ssize_t intValue;
12378 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12379
12380 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12381 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12382 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12383 exp->__anon1.instance->loc = exp->loc;
12384 exp->type = 1;
12385 GetIntSize(value, &intValue);
12386 Set(exp->__anon1.instance->data, intValue);
12387 PopulateInstance(exp->__anon1.instance);
12388 break;
12389 }
12390 case 6:
12391 {
12392 float floatValue;
12393 void (* Set)(void *, float) = (void *)prop->Set;
12394
12395 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12396 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12397 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12398 exp->__anon1.instance->loc = exp->loc;
12399 exp->type = 1;
12400 GetFloat(value, &floatValue);
12401 Set(exp->__anon1.instance->data, floatValue);
12402 PopulateInstance(exp->__anon1.instance);
12403 break;
12404 }
12405 case 7:
12406 {
12407 double doubleValue;
12408 void (* Set)(void *, double) = (void *)prop->Set;
12409
12410 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12411 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12412 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12413 exp->__anon1.instance->loc = exp->loc;
12414 exp->type = 1;
12415 GetDouble(value, &doubleValue);
12416 Set(exp->__anon1.instance->data, doubleValue);
12417 PopulateInstance(exp->__anon1.instance);
12418 break;
12419 }
12420 }
12421 }
12422 else if(_class->type == 2)
12423 {
12424 switch(type->kind)
12425 {
12426 case 8:
12427 {
12428 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12429
12430 if(propertyClass->type == 1 && value->__anon1.instance->data)
12431 {
12432 unsigned int (* Set)(void *) = (void *)prop->Set;
12433 unsigned int bits = Set(value->__anon1.instance->data);
12434
12435 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12436 exp->type = 2;
12437 break;
12438 }
12439 else if(_class->type == 2)
12440 {
12441 unsigned int value;
12442 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12443 unsigned int bits;
12444
12445 GetUInt(exp->__anon1.member.exp, &value);
12446 bits = Set(value);
12447 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12448 exp->type = 2;
12449 }
12450 }
12451 }
12452 }
12453 }
12454 else
12455 {
12456 if(_class->type == 2)
12457 {
12458 unsigned int value;
12459
12460 GetUInt(exp->__anon1.member.exp, &value);
12461 switch(type->kind)
12462 {
12463 case 8:
12464 {
12465 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12466
12467 if(_class->type == 1)
12468 {
12469 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12470
12471 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12472 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12473 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12474 exp->__anon1.instance->loc = exp->loc;
12475 exp->type = 1;
12476 Get(value, exp->__anon1.instance->data);
12477 PopulateInstance(exp->__anon1.instance);
12478 }
12479 else if(_class->type == 2)
12480 {
12481 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12482 uint64 bits = Get(value);
12483
12484 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12485 exp->type = 2;
12486 }
12487 break;
12488 }
12489 }
12490 }
12491 else if(_class->type == 1)
12492 {
12493 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12494
12495 switch(type->kind)
12496 {
12497 case 8:
12498 {
12499 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12500
12501 if(_class->type == 1 && value)
12502 {
12503 void (* Get)(void *, void *) = (void *)prop->Get;
12504
12505 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12506 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12507 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12508 exp->__anon1.instance->loc = exp->loc;
12509 exp->type = 1;
12510 Get(value, exp->__anon1.instance->data);
12511 PopulateInstance(exp->__anon1.instance);
12512 }
12513 break;
12514 }
12515 }
12516 }
12517 }
12518 }
12519 }
12520 else
12521 {
12522 exp->isConstant = 0;
12523 }
12524 }
12525 else if(member)
12526 {
12527 }
12528 }
12529 if(exp->type != 8)
12530 {
12531 FreeExpression(memberExp);
12532 FreeIdentifier(memberID);
12533 }
12534 break;
12535 }
12536 case 10:
12537 {
12538 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12539
12540 FreeExpContents(exp);
12541 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12542 exp->type = 2;
12543 FreeType(type);
12544 break;
12545 }
12546 case 15:
12547 {
12548 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12549
12550 if(classSym && classSym->__anon1.registered)
12551 {
12552 if(classSym->__anon1.registered->fixed)
12553 {
12554 FreeSpecifier(exp->__anon1._class);
12555 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12556 exp->type = 2;
12557 }
12558 else
12559 {
12560 char className[1024];
12561
12562 strcpy(className, "__ecereClass_");
12563 FullClassNameCat(className, classSym->string, 1);
12564 DeclareClass(classSym, className);
12565 FreeExpContents(exp);
12566 exp->type = 9;
12567 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12568 exp->__anon1.member.member = MkIdentifier("structSize");
12569 }
12570 }
12571 break;
12572 }
12573 case 11:
12574 {
12575 struct Type * type;
12576 struct Expression * e = exp;
12577
12578 if(exp->type == 11)
12579 {
12580 if(exp->__anon1.cast.exp)
12581 ComputeExpression(exp->__anon1.cast.exp);
12582 e = exp->__anon1.cast.exp;
12583 }
12584 if(e && exp->expType)
12585 {
12586 type = exp->expType;
12587 if(type->kind == 8)
12588 {
12589 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12590
12591 if(_class && (_class->type == 3 || _class->type == 2))
12592 {
12593 if(!_class->dataType)
12594 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12595 type = _class->dataType;
12596 }
12597 }
12598 switch(type->kind)
12599 {
12600 case 24:
12601 case 1:
12602 if(type->isSigned)
12603 {
12604 char value = (char)0;
12605
12606 if(GetChar(e, &value))
12607 {
12608 FreeExpContents(exp);
12609 exp->__anon1.__anon1.constant = PrintChar(value);
12610 exp->type = 2;
12611 }
12612 }
12613 else
12614 {
12615 unsigned char value = (unsigned char)0;
12616
12617 if(GetUChar(e, &value))
12618 {
12619 FreeExpContents(exp);
12620 exp->__anon1.__anon1.constant = PrintUChar(value);
12621 exp->type = 2;
12622 }
12623 }
12624 break;
12625 case 2:
12626 if(type->isSigned)
12627 {
12628 short value = (short)0;
12629
12630 if(GetShort(e, &value))
12631 {
12632 FreeExpContents(exp);
12633 exp->__anon1.__anon1.constant = PrintShort(value);
12634 exp->type = 2;
12635 }
12636 }
12637 else
12638 {
12639 unsigned short value = (unsigned short)0;
12640
12641 if(GetUShort(e, &value))
12642 {
12643 FreeExpContents(exp);
12644 exp->__anon1.__anon1.constant = PrintUShort(value);
12645 exp->type = 2;
12646 }
12647 }
12648 break;
12649 case 3:
12650 if(type->isSigned)
12651 {
12652 int value = 0;
12653
12654 if(GetInt(e, &value))
12655 {
12656 FreeExpContents(exp);
12657 exp->__anon1.__anon1.constant = PrintInt(value);
12658 exp->type = 2;
12659 }
12660 }
12661 else
12662 {
12663 unsigned int value = 0;
12664
12665 if(GetUInt(e, &value))
12666 {
12667 FreeExpContents(exp);
12668 exp->__anon1.__anon1.constant = PrintUInt(value);
12669 exp->type = 2;
12670 }
12671 }
12672 break;
12673 case 4:
12674 if(type->isSigned)
12675 {
12676 long long value = 0;
12677
12678 if(GetInt64(e, &value))
12679 {
12680 FreeExpContents(exp);
12681 exp->__anon1.__anon1.constant = PrintInt64(value);
12682 exp->type = 2;
12683 }
12684 }
12685 else
12686 {
12687 uint64 value = 0;
12688
12689 if(GetUInt64(e, &value))
12690 {
12691 FreeExpContents(exp);
12692 exp->__anon1.__anon1.constant = PrintUInt64(value);
12693 exp->type = 2;
12694 }
12695 }
12696 break;
12697 case 22:
12698 if(type->isSigned)
12699 {
12700 intptr_t value = 0;
12701
12702 if(GetIntPtr(e, &value))
12703 {
12704 FreeExpContents(exp);
12705 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12706 exp->type = 2;
12707 }
12708 }
12709 else
12710 {
12711 uintptr_t value = 0;
12712
12713 if(GetUIntPtr(e, &value))
12714 {
12715 FreeExpContents(exp);
12716 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12717 exp->type = 2;
12718 }
12719 }
12720 break;
12721 case 23:
12722 if(type->isSigned)
12723 {
12724 ssize_t value = 0;
12725
12726 if(GetIntSize(e, &value))
12727 {
12728 FreeExpContents(exp);
12729 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12730 exp->type = 2;
12731 }
12732 }
12733 else
12734 {
12735 size_t value = 0;
12736
12737 if(GetUIntSize(e, &value))
12738 {
12739 FreeExpContents(exp);
12740 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12741 exp->type = 2;
12742 }
12743 }
12744 break;
12745 case 6:
12746 {
12747 float value = 0;
12748
12749 if(GetFloat(e, &value))
12750 {
12751 FreeExpContents(exp);
12752 exp->__anon1.__anon1.constant = PrintFloat(value);
12753 exp->type = 2;
12754 }
12755 break;
12756 }
12757 case 7:
12758 {
12759 double value = 0;
12760
12761 if(GetDouble(e, &value))
12762 {
12763 FreeExpContents(exp);
12764 exp->__anon1.__anon1.constant = PrintDouble(value);
12765 exp->type = 2;
12766 }
12767 break;
12768 }
12769 }
12770 }
12771 break;
12772 }
12773 case 12:
12774 {
12775 struct Operand op1 =
12776 {
12777 0, 0, 0,
12778 .__anon1 = {
12779 .c = 0
12780 },
12781 {
12782 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12783 }
12784 };
12785 struct Operand op2 =
12786 {
12787 0, 0, 0,
12788 .__anon1 = {
12789 .c = 0
12790 },
12791 {
12792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12793 }
12794 };
12795 struct Operand op3 =
12796 {
12797 0, 0, 0,
12798 .__anon1 = {
12799 .c = 0
12800 },
12801 {
12802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12803 }
12804 };
12805
12806 if(exp->__anon1.cond.exp)
12807 ComputeExpression((*exp->__anon1.cond.exp).last);
12808 if(exp->__anon1.cond.elseExp)
12809 ComputeExpression(exp->__anon1.cond.elseExp);
12810 if(exp->__anon1.cond.cond)
12811 ComputeExpression(exp->__anon1.cond.cond);
12812 op1 = GetOperand(exp->__anon1.cond.cond);
12813 if(op1.type)
12814 op1.type->refCount++;
12815 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12816 if(op2.type)
12817 op2.type->refCount++;
12818 op3 = GetOperand(exp->__anon1.cond.elseExp);
12819 if(op3.type)
12820 op3.type->refCount++;
12821 if(op1.ops.Cond)
12822 {
12823 FreeExpContents(exp);
12824 op1.ops.Cond(exp, &op1, &op2, &op3);
12825 }
12826 if(op1.type)
12827 FreeType(op1.type);
12828 if(op2.type)
12829 FreeType(op2.type);
12830 if(op3.type)
12831 FreeType(op3.type);
12832 break;
12833 }
12834 }
12835 }
12836
12837 void ApplyAnyObjectLogic(struct Expression * e);
12838
12839 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12840 {
12841 unsigned int result = 1;
12842
12843 if(destType)
12844 {
12845 struct __ecereNameSpace__ecere__sys__OldList converts =
12846 {
12847 0, 0, 0, 0, 0
12848 };
12849 struct Conversion * convert;
12850
12851 if(destType->kind == 0)
12852 return 0;
12853 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12854 result = 0;
12855 if(converts.count)
12856 {
12857 for(convert = converts.first; convert; convert = convert->next)
12858 {
12859 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12860
12861 if(!empty)
12862 {
12863 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12864 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12865
12866 *newExp = *exp;
12867 newExp->prev = (((void *)0));
12868 newExp->next = (((void *)0));
12869 newExp->destType = (((void *)0));
12870 if(convert->isGet)
12871 {
12872 exp->type = 8;
12873 exp->addedThis = 1;
12874 exp->__anon1.member.exp = newExp;
12875 FreeType(exp->__anon1.member.exp->expType);
12876 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12877 exp->__anon1.member.exp->expType->classObjectType = objectType;
12878 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12879 exp->__anon1.member.memberType = 1;
12880 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12881 exp->needCast = 1;
12882 if(exp->expType)
12883 exp->expType->refCount++;
12884 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12885 }
12886 else
12887 {
12888 {
12889 exp->type = 8;
12890 exp->addedThis = 1;
12891 exp->__anon1.member.exp = newExp;
12892 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)
12893 {
12894 newExp->byReference = 1;
12895 }
12896 FreeType(exp->__anon1.member.exp->expType);
12897 exp->__anon1.member.exp->expType = (((void *)0));
12898 if(convert->convert->dataType)
12899 {
12900 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12901 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12902 exp->__anon1.member.exp->expType->refCount = 1;
12903 exp->__anon1.member.exp->expType->classObjectType = objectType;
12904 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12905 }
12906 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12907 exp->__anon1.member.memberType = 4;
12908 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12909 exp->needCast = 1;
12910 if(convert->resultType)
12911 convert->resultType->refCount++;
12912 }
12913 }
12914 }
12915 else
12916 {
12917 FreeType(exp->expType);
12918 if(convert->isGet)
12919 {
12920 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12921 if(exp->destType->casted)
12922 exp->needCast = 1;
12923 if(exp->expType)
12924 exp->expType->refCount++;
12925 }
12926 else
12927 {
12928 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12929 if(exp->destType->casted)
12930 exp->needCast = 1;
12931 if(convert->resultType)
12932 convert->resultType->refCount++;
12933 }
12934 }
12935 }
12936 if(exp->isConstant && inCompiler)
12937 ComputeExpression(exp);
12938 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12939 }
12940 if(!result && exp->expType && converts.count)
12941 {
12942 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12943 }
12944 if(!result && exp->expType && exp->destType)
12945 {
12946 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))
12947 result = 1;
12948 }
12949 }
12950 return result;
12951 }
12952
12953 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12954
12955 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12956
12957 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12958
12959 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12960
12961 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
12962
12963 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
12964
12965 void CheckTemplateTypes(struct Expression * exp)
12966 {
12967 struct Expression * nbExp = GetNonBracketsExp(exp);
12968
12969 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12970 {
12971 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12972 struct Context * context;
12973
12974 *newExp = *exp;
12975 if(exp->destType)
12976 exp->destType->refCount++;
12977 if(exp->expType)
12978 exp->expType->refCount++;
12979 newExp->prev = (((void *)0));
12980 newExp->next = (((void *)0));
12981 switch(exp->expType->kind)
12982 {
12983 case 7:
12984 if(exp->destType->classObjectType)
12985 {
12986 if(exp->destType)
12987 exp->destType->refCount--;
12988 if(exp->expType)
12989 exp->expType->refCount--;
12990 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12991 }
12992 else
12993 {
12994 struct __ecereNameSpace__ecere__sys__OldList * specs;
12995 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12996 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12997
12998 context = PushContext();
12999 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13000 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13001 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13002 exp->type = 23;
13003 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13004 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
13005 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
13006 exp->__anon1.compound->__anon1.compound.context = context;
13007 PopContext(context);
13008 }
13009 break;
13010 default:
13011 exp->type = 11;
13012 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
13013 if(__ecereProp_Type_Get_isPointerType(exp->expType))
13014 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
13015 else
13016 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13017 exp->needCast = 1;
13018 break;
13019 }
13020 }
13021 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
13022 {
13023 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13024 struct Context * context;
13025
13026 *newExp = *exp;
13027 if(exp->destType)
13028 exp->destType->refCount++;
13029 if(exp->expType)
13030 exp->expType->refCount++;
13031 newExp->prev = (((void *)0));
13032 newExp->next = (((void *)0));
13033 switch(exp->expType->kind)
13034 {
13035 case 7:
13036 if(exp->destType->classObjectType)
13037 {
13038 if(exp->destType)
13039 exp->destType->refCount--;
13040 if(exp->expType)
13041 exp->expType->refCount--;
13042 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13043 }
13044 else
13045 {
13046 struct __ecereNameSpace__ecere__sys__OldList * specs;
13047 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13048 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13049
13050 context = PushContext();
13051 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13052 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13053 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13054 exp->type = 23;
13055 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13056 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13057 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13058 exp->__anon1.compound->__anon1.compound.context = context;
13059 PopContext(context);
13060 }
13061 break;
13062 case 8:
13063 {
13064 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13065 {
13066 exp->type = 5;
13067 if(__ecereProp_Type_Get_isPointerType(exp->expType))
13068 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
13069 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)));
13070 ProcessExpressionType((*exp->__anon1.list).first);
13071 break;
13072 }
13073 else
13074 {
13075 exp->type = 5;
13076 if(__ecereProp_Type_Get_isPointerType(exp->expType))
13077 {
13078 exp->needTemplateCast = 2;
13079 newExp->needCast = 1;
13080 newExp->needTemplateCast = 2;
13081 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
13082 }
13083 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13084 exp->needTemplateCast = 2;
13085 newExp->needCast = 1;
13086 newExp->needTemplateCast = 2;
13087 ProcessExpressionType((*exp->__anon1.list).first);
13088 break;
13089 }
13090 }
13091 default:
13092 {
13093 if(exp->expType->kind == 20)
13094 {
13095 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13096
13097 if(type)
13098 {
13099 FreeType(exp->destType);
13100 FreeType(exp->expType);
13101 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13102 break;
13103 }
13104 }
13105 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13106 {
13107 exp->type = 4;
13108 exp->__anon1.op.op = '*';
13109 exp->__anon1.op.exp1 = (((void *)0));
13110 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13111 }
13112 else
13113 {
13114 char typeString[1024];
13115 struct Declarator * decl;
13116 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13117
13118 typeString[0] = '\0';
13119 PrintType(exp->expType, typeString, 0, 0);
13120 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13121 exp->type = 11;
13122 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13123 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13124 exp->__anon1.cast.exp->needCast = 1;
13125 }
13126 break;
13127 }
13128 }
13129 }
13130 }
13131
13132 extern int strncmp(const char * , const char * , size_t n);
13133
13134 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13135
13136 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13137 {
13138 int nsLen = strlen(nameSpace);
13139 struct Symbol * symbol;
13140
13141 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)))
13142 {
13143 char * s = symbol->string;
13144
13145 if(!strncmp(s, nameSpace, nsLen))
13146 {
13147 int c;
13148 char * namePart;
13149
13150 for(c = strlen(s) - 1; c >= 0; c--)
13151 if(s[c] == ':')
13152 break;
13153 namePart = s + c + 1;
13154 if(!strcmp(namePart, name))
13155 {
13156 return symbol;
13157 }
13158 }
13159 else
13160 break;
13161 }
13162 return (((void *)0));
13163 }
13164
13165 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13166 {
13167 int c;
13168 char nameSpace[1024];
13169 const char * namePart;
13170 unsigned int gotColon = 0;
13171
13172 nameSpace[0] = '\0';
13173 for(c = strlen(name) - 1; c >= 0; c--)
13174 if(name[c] == ':')
13175 {
13176 gotColon = 1;
13177 break;
13178 }
13179 namePart = name + c + 1;
13180 while(c >= 0 && name[c] == ':')
13181 c--;
13182 if(c >= 0)
13183 {
13184 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13185
13186 if(symbol)
13187 return symbol;
13188 memcpy(nameSpace, name, c + 1);
13189 nameSpace[c + 1] = (char)0;
13190 return ScanWithNameSpace(tree, nameSpace, namePart);
13191 }
13192 else if(gotColon)
13193 {
13194 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13195
13196 return symbol;
13197 }
13198 else
13199 {
13200 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13201
13202 if(symbol)
13203 return symbol;
13204 return ScanWithNameSpace(tree, "", namePart);
13205 }
13206 return (((void *)0));
13207 }
13208
13209 static void ProcessDeclaration(struct Declaration * decl);
13210
13211 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13212 {
13213 struct Context * ctx;
13214 struct Symbol * symbol = (((void *)0));
13215
13216 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13217 {
13218 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13219 {
13220 symbol = (((void *)0));
13221 if(thisNameSpace)
13222 {
13223 char curName[1024];
13224
13225 strcpy(curName, thisNameSpace);
13226 strcat(curName, "::");
13227 strcat(curName, name);
13228 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13229 }
13230 if(!symbol)
13231 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13232 }
13233 else
13234 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13235 if(symbol || ctx == endContext)
13236 break;
13237 }
13238 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13239 {
13240 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13241 {
13242 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13243 struct Context * tmpContext = curContext;
13244
13245 curContext = (((void *)0));
13246 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13247 curContext = tmpContext;
13248 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13249 DeclareType(symbol->type, 1, 1);
13250 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13251 symbol->id = curExternal->symbol->idCode;
13252 }
13253 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13254 {
13255 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13256 symbol->id = curExternal->symbol->idCode;
13257 }
13258 }
13259 return symbol;
13260 }
13261
13262 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13263 {
13264 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13265 ListAdd(specs, MkSpecifier(UNSIGNED));
13266 switch(type->kind)
13267 {
13268 case 8:
13269 {
13270 if(type->__anon1._class->__anon1.registered)
13271 {
13272 if(!type->__anon1._class->__anon1.registered->dataType)
13273 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13274 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13275 }
13276 break;
13277 }
13278 case 7:
13279 ListAdd(specs, MkSpecifier(DOUBLE));
13280 break;
13281 case 6:
13282 ListAdd(specs, MkSpecifier(FLOAT));
13283 break;
13284 case 1:
13285 ListAdd(specs, MkSpecifier(CHAR));
13286 break;
13287 case 24:
13288 ListAdd(specs, MkSpecifier(_BOOL));
13289 break;
13290 case 2:
13291 ListAdd(specs, MkSpecifier(SHORT));
13292 break;
13293 case 4:
13294 ListAdd(specs, MkSpecifier(INT64));
13295 break;
13296 case 22:
13297 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13298 break;
13299 case 23:
13300 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13301 break;
13302 case 3:
13303 default:
13304 ListAdd(specs, MkSpecifier(INT));
13305 break;
13306 }
13307 }
13308
13309 static void PrintArraySize(struct Type * arrayType, char * string)
13310 {
13311 char size[256];
13312
13313 size[0] = '\0';
13314 strcat(size, "[");
13315 if(arrayType->__anon1.__anon4.enumClass)
13316 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13317 else if(arrayType->__anon1.__anon4.arraySizeExp)
13318 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13319 strcat(size, "]");
13320 strcat(string, size);
13321 }
13322
13323 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13324 {
13325 if(type)
13326 {
13327 if(printConst && type->constant)
13328 strcat(string, "const ");
13329 switch(type->kind)
13330 {
13331 case 8:
13332 {
13333 struct Symbol * c = type->__anon1._class;
13334
13335 if(type->classObjectType == 2)
13336 strcat(string, "typed_object");
13337 else if(type->classObjectType == 3)
13338 strcat(string, "any_object");
13339 else
13340 {
13341 if(c && c->string)
13342 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13343 }
13344 if(type->byReference)
13345 strcat(string, " &");
13346 break;
13347 }
13348 case 0:
13349 strcat(string, "void");
13350 break;
13351 case 3:
13352 strcat(string, type->isSigned ? "int" : "uint");
13353 break;
13354 case 4:
13355 strcat(string, type->isSigned ? "int64" : "uint64");
13356 break;
13357 case 22:
13358 strcat(string, type->isSigned ? "intptr" : "uintptr");
13359 break;
13360 case 23:
13361 strcat(string, type->isSigned ? "intsize" : "uintsize");
13362 break;
13363 case 1:
13364 strcat(string, type->isSigned ? "char" : "byte");
13365 break;
13366 case 24:
13367 strcat(string, "_Bool");
13368 break;
13369 case 2:
13370 strcat(string, type->isSigned ? "short" : "uint16");
13371 break;
13372 case 6:
13373 strcat(string, "float");
13374 break;
13375 case 7:
13376 strcat(string, "double");
13377 break;
13378 case 9:
13379 if(type->__anon1.__anon1.enumName)
13380 {
13381 strcat(string, "struct ");
13382 strcat(string, type->__anon1.__anon1.enumName);
13383 }
13384 else if(type->typeName)
13385 strcat(string, type->typeName);
13386 else
13387 {
13388 struct Type * member;
13389
13390 strcat(string, "struct { ");
13391 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13392 {
13393 PrintType(member, string, 1, fullName);
13394 strcat(string, "; ");
13395 }
13396 strcat(string, "}");
13397 }
13398 break;
13399 case 10:
13400 if(type->__anon1.__anon1.enumName)
13401 {
13402 strcat(string, "union ");
13403 strcat(string, type->__anon1.__anon1.enumName);
13404 }
13405 else if(type->typeName)
13406 strcat(string, type->typeName);
13407 else
13408 {
13409 strcat(string, "union ");
13410 strcat(string, "(unnamed)");
13411 }
13412 break;
13413 case 15:
13414 if(type->__anon1.__anon1.enumName)
13415 {
13416 strcat(string, "enum ");
13417 strcat(string, type->__anon1.__anon1.enumName);
13418 }
13419 else if(type->typeName)
13420 strcat(string, type->typeName);
13421 else
13422 strcat(string, "int");
13423 break;
13424 case 14:
13425 strcat(string, "...");
13426 break;
13427 case 19:
13428 strcat(string, "subclass(");
13429 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13430 strcat(string, ")");
13431 break;
13432 case 20:
13433 strcat(string, type->__anon1.templateParameter->identifier->string);
13434 break;
13435 case 21:
13436 strcat(string, "thisclass");
13437 break;
13438 case 17:
13439 strcat(string, "__builtin_va_list");
13440 break;
13441 }
13442 }
13443 }
13444
13445 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13446
13447 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13448 {
13449 if(type->name && type->name[0])
13450 {
13451 if(fullName)
13452 strcat(string, type->name);
13453 else
13454 {
13455 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13456
13457 if(name)
13458 name += 2;
13459 else
13460 name = type->name;
13461 strcat(string, name);
13462 }
13463 }
13464 }
13465
13466 static void PrintAttribs(struct Type * type, char * string)
13467 {
13468 if(type)
13469 {
13470 if(type->dllExport)
13471 strcat(string, "dllexport ");
13472 if(type->attrStdcall)
13473 strcat(string, "stdcall ");
13474 }
13475 }
13476
13477 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13478 {
13479 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13480 {
13481 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13482 PrintAttribs(type, string);
13483 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13484 strcat(string, " const");
13485 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13486 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13487 strcat(string, " (");
13488 if(type->kind == 13)
13489 {
13490 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13491 PrintAttribs(type->__anon1.type, string);
13492 }
13493 if(type->kind == 13)
13494 {
13495 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13496 strcat(string, "*");
13497 else
13498 strcat(string, " *");
13499 }
13500 if(printConst && type->constant && type->kind == 13)
13501 strcat(string, " const");
13502 }
13503 else
13504 PrintTypeSpecs(type, string, fullName, printConst);
13505 }
13506
13507 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13508 {
13509 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13510 strcat(string, ")");
13511 if(type->kind == 12)
13512 PrintArraySize(type, string);
13513 else if(type->kind == 11)
13514 {
13515 struct Type * param;
13516
13517 strcat(string, "(");
13518 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13519 {
13520 PrintType(param, string, 1, fullName);
13521 if(param->next)
13522 strcat(string, ", ");
13523 }
13524 strcat(string, ")");
13525 }
13526 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13527 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13528 }
13529
13530 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13531 {
13532 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13533 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13534 strcat(string, " ");
13535 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13536 {
13537 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13538
13539 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13540 {
13541 if(type->classObjectType == 1)
13542 strcat(string, "class");
13543 else
13544 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13545 }
13546 else if(_class && _class->string)
13547 {
13548 char * s = _class->string;
13549
13550 if(fullName)
13551 strcat(string, s);
13552 else
13553 {
13554 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13555
13556 if(name)
13557 name += 2;
13558 else
13559 name = s;
13560 strcat(string, name);
13561 }
13562 }
13563 strcat(string, "::");
13564 }
13565 if(printName && type->name)
13566 PrintName(type, string, fullName);
13567 PostPrintType(type, string, fullName);
13568 if(type->bitFieldCount)
13569 {
13570 char count[100];
13571
13572 sprintf(count, ":%d", type->bitFieldCount);
13573 strcat(string, count);
13574 }
13575 }
13576
13577 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13578 {
13579 _PrintType(type, string, printName, fullName, 1);
13580 }
13581
13582 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13583 {
13584 _PrintType(type, string, printName, fullName, 0);
13585 }
13586
13587 static struct Type * FindMember(struct Type * type, char * string)
13588 {
13589 struct Type * memberType;
13590
13591 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13592 {
13593 if(!memberType->name)
13594 {
13595 struct Type * subType = FindMember(memberType, string);
13596
13597 if(subType)
13598 return subType;
13599 }
13600 else if(!strcmp(memberType->name, string))
13601 return memberType;
13602 }
13603 return (((void *)0));
13604 }
13605
13606 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13607 {
13608 struct Type * memberType;
13609
13610 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13611 {
13612 if(!memberType->name)
13613 {
13614 struct Type * subType = FindMember(memberType, string);
13615
13616 if(subType)
13617 {
13618 *offset += memberType->offset;
13619 return subType;
13620 }
13621 }
13622 else if(!strcmp(memberType->name, string))
13623 {
13624 *offset += memberType->offset;
13625 return memberType;
13626 }
13627 }
13628 return (((void *)0));
13629 }
13630
13631 extern unsigned int parseError;
13632
13633 unsigned int GetParseError()
13634 {
13635 return parseError;
13636 }
13637
13638 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13639
13640 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13641
13642 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13643
13644 struct Expression * ParseExpressionString(char * expression)
13645 {
13646 parseError = 0;
13647 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13648 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13649 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13650
13651 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13652 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13653 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13654 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13655
13656 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13657 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13658 echoOn = 0;
13659 parsedExpression = (((void *)0));
13660 resetScanner();
13661 expression_yyparse();
13662 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13663 return parsedExpression;
13664 }
13665
13666 extern char *  QMkString(const char *  source);
13667
13668 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13669 {
13670 struct Identifier * id = exp->__anon1.__anon1.identifier;
13671 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13672 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13673 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13674 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13675
13676 if(_class && _class->type == 4)
13677 {
13678 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13679 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13680
13681 if(enumClass)
13682 {
13683 struct __ecereNameSpace__ecere__com__Class * baseClass;
13684
13685 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13686 {
13687 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13688
13689 for(value = e->values.first; value; value = value->next)
13690 {
13691 if(!strcmp(value->name, id->string))
13692 break;
13693 }
13694 if(value)
13695 {
13696 exp->isConstant = 1;
13697 if(inCompiler || inPreCompiler || inDebugger)
13698 {
13699 char constant[256];
13700
13701 FreeExpContents(exp);
13702 exp->type = 2;
13703 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13704 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13705 else
13706 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13707 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13708 }
13709 exp->expType = MkClassType(baseClass->fullName);
13710 break;
13711 }
13712 }
13713 }
13714 if(value)
13715 return 1;
13716 }
13717 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13718 {
13719 ProcessMethodType(method);
13720 exp->expType = __extension__ ({
13721 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13722
13723 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13724 });
13725 return 1;
13726 }
13727 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13728 {
13729 if(!prop->dataType)
13730 ProcessPropertyType(prop);
13731 exp->expType = prop->dataType;
13732 if(prop->dataType)
13733 prop->dataType->refCount++;
13734 return 1;
13735 }
13736 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13737 {
13738 if(!member->dataType)
13739 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13740 exp->expType = member->dataType;
13741 if(member->dataType)
13742 member->dataType->refCount++;
13743 return 1;
13744 }
13745 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13746 {
13747 if(!classProp->dataType)
13748 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13749 if(classProp->constant)
13750 {
13751 FreeExpContents(exp);
13752 exp->isConstant = 1;
13753 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13754 {
13755 exp->type = 3;
13756 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
13757 }
13758 else
13759 {
13760 char constant[256];
13761
13762 exp->type = 2;
13763 sprintf(constant, "%d", (int)classProp->Get(_class));
13764 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13765 }
13766 }
13767 else
13768 {
13769 }
13770 exp->expType = classProp->dataType;
13771 if(classProp->dataType)
13772 classProp->dataType->refCount++;
13773 return 1;
13774 }
13775 return 0;
13776 }
13777
13778 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13779 {
13780 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13781 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13782 struct __ecereNameSpace__ecere__com__NameSpace * child;
13783
13784 if(!data)
13785 {
13786 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)))
13787 {
13788 data = ScanGlobalData(child, name);
13789 if(data)
13790 break;
13791 }
13792 }
13793 return data;
13794 }
13795
13796 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13797
13798 extern char *  strncpy(char * , const char * , size_t n);
13799
13800 static struct GlobalData * FindGlobalData(char * name)
13801 {
13802 int start = 0, c;
13803 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13804
13805 nameSpace = globalData;
13806 for(c = 0; name[c]; c++)
13807 {
13808 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13809 {
13810 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13811 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13812
13813 strncpy(spaceName, name + start, c - start);
13814 spaceName[c - start] = '\0';
13815 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13816 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13817 if(!newSpace)
13818 return (((void *)0));
13819 nameSpace = newSpace;
13820 if(name[c] == ':')
13821 c++;
13822 start = c + 1;
13823 }
13824 }
13825 if(c - start)
13826 {
13827 return ScanGlobalData(nameSpace, name + start);
13828 }
13829 return (((void *)0));
13830 }
13831
13832 static int definedExpStackPos;
13833
13834 static void * definedExpStack[512];
13835
13836 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13837 {
13838 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13839
13840 FreeExpContents(checkedExp);
13841 FreeType(checkedExp->expType);
13842 FreeType(checkedExp->destType);
13843 *checkedExp = *newExp;
13844 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13845 checkedExp->prev = prev;
13846 checkedExp->next = next;
13847 }
13848
13849 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13850
13851 extern int printf(const char * , ...);
13852
13853 void __ecereMethod_Expression_Clear();
13854
13855 void ApplyAnyObjectLogic(struct Expression * e)
13856 {
13857 struct Type * destType = e->destType;
13858
13859 if(destType && (destType->classObjectType == 3))
13860 {
13861 if(e && e->expType)
13862 {
13863 struct Type * type = e->expType;
13864 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13865
13866 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13867 {
13868 _class = type->__anon1._class->__anon1.registered;
13869 }
13870 else if(type->kind == 19)
13871 {
13872 _class = FindClass("ecere::com::Class")->__anon1.registered;
13873 }
13874 else
13875 {
13876 char string[1024] = "";
13877 struct Symbol * classSym;
13878
13879 PrintTypeNoConst(type, string, 0, 1);
13880 classSym = FindClass(string);
13881 if(classSym)
13882 _class = classSym->__anon1.registered;
13883 }
13884 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)))
13885 {
13886 if(!_class || strcmp(_class->fullName, "char *"))
13887 {
13888 struct Expression * checkedExp = e, * newExp;
13889
13890 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13891 {
13892 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13893 {
13894 if(checkedExp->type == 23)
13895 {
13896 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13897 }
13898 else
13899 checkedExp = (*checkedExp->__anon1.list).last;
13900 }
13901 else if(checkedExp->type == 11)
13902 checkedExp = checkedExp->__anon1.cast.exp;
13903 }
13904 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13905 {
13906 newExp = checkedExp->__anon1.op.exp2;
13907 checkedExp->__anon1.op.exp2 = (((void *)0));
13908 FreeExpContents(checkedExp);
13909 if(e->expType && e->expType->passAsTemplate)
13910 {
13911 char size[100];
13912
13913 ComputeTypeSize(e->expType);
13914 sprintf(size, "%d", e->expType->size);
13915 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))))));
13916 }
13917 ReplaceExpContents(checkedExp, newExp);
13918 e->byReference = 1;
13919 }
13920 else if(!e->byReference || (_class && _class->type == 5))
13921 {
13922 struct Expression * checkedExp;
13923
13924 {
13925 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;
13926
13927 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13928 {
13929 struct Context * context = PushContext();
13930 struct Declarator * decl;
13931 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13932 char typeString[1024];
13933 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13934
13935 typeString[0] = '\0';
13936 *newExp = *e;
13937 newExp->prev = (((void *)0));
13938 newExp->next = (((void *)0));
13939 newExp->expType = (((void *)0));
13940 PrintTypeNoConst(e->expType, typeString, 0, 1);
13941 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13942 newExp->destType = ProcessType(specs, decl);
13943 curContext = context;
13944 if(curCompound)
13945 {
13946 char name[100];
13947 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13948
13949 e->type = 23;
13950 sprintf(name, "__internalValue%03X", internalValueCounter++);
13951 if(!curCompound->__anon1.compound.declarations)
13952 curCompound->__anon1.compound.declarations = MkList();
13953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13954 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13955 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13956 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13957 }
13958 else
13959 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13960 {
13961 struct Type * type = e->destType;
13962
13963 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13964 CopyTypeInto(e->destType, type);
13965 e->destType->refCount = 1;
13966 e->destType->classObjectType = 0;
13967 FreeType(type);
13968 }
13969 e->__anon1.compound->__anon1.compound.context = context;
13970 PopContext(context);
13971 curContext = context->parent;
13972 }
13973 }
13974 checkedExp = e;
13975 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13976 {
13977 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13978 {
13979 if(checkedExp->type == 23)
13980 {
13981 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13982 }
13983 else
13984 checkedExp = (*checkedExp->__anon1.list).last;
13985 }
13986 else if(checkedExp->type == 11)
13987 checkedExp = checkedExp->__anon1.cast.exp;
13988 }
13989 {
13990 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13991
13992 *operand = *checkedExp;
13993 __ecereMethod_Expression_Clear(checkedExp);
13994 checkedExp->destType = ProcessTypeString("void *", 0);
13995 checkedExp->expType = checkedExp->destType;
13996 checkedExp->destType->refCount++;
13997 checkedExp->type = 4;
13998 checkedExp->__anon1.op.op = '&';
13999 checkedExp->__anon1.op.exp1 = (((void *)0));
14000 checkedExp->__anon1.op.exp2 = operand;
14001 }
14002 }
14003 }
14004 }
14005 }
14006 }
14007 {
14008 }
14009 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))))
14010 {
14011 if(e->expType->classObjectType && destType && destType->classObjectType)
14012 {
14013 return ;
14014 }
14015 else
14016 {
14017 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14018
14019 *thisExp = *e;
14020 thisExp->prev = (((void *)0));
14021 thisExp->next = (((void *)0));
14022 __ecereMethod_Expression_Clear(e);
14023 e->type = 5;
14024 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
14025 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
14026 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
14027 {
14028 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14029 CopyTypeInto(e->expType, thisExp->expType);
14030 e->expType->byReference = 0;
14031 e->expType->refCount = 1;
14032 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))
14033 {
14034 e->expType->classObjectType = 0;
14035 }
14036 }
14037 }
14038 }
14039 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
14040 {
14041 if(destType->kind == 14)
14042 {
14043 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
14044 }
14045 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))
14046 {
14047 unsigned int byReference = e->expType->byReference;
14048 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14049 struct Declarator * decl;
14050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14051 char typeString[1024];
14052 struct Type * type;
14053 int backupClassObjectType;
14054 unsigned int backupByReference;
14055
14056 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
14057 type = e->expType;
14058 else
14059 type = destType;
14060 backupClassObjectType = type->classObjectType;
14061 backupByReference = type->byReference;
14062 type->classObjectType = 0;
14063 type->byReference = 0;
14064 typeString[0] = '\0';
14065 PrintType(type, typeString, 0, 1);
14066 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14067 type->classObjectType = backupClassObjectType;
14068 type->byReference = backupByReference;
14069 *thisExp = *e;
14070 thisExp->prev = (((void *)0));
14071 thisExp->next = (((void *)0));
14072 __ecereMethod_Expression_Clear(e);
14073 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)))
14074 {
14075 e->type = 4;
14076 e->__anon1.op.op = '*';
14077 e->__anon1.op.exp1 = (((void *)0));
14078 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14079 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14080 CopyTypeInto(e->expType, type);
14081 e->expType->byReference = 0;
14082 e->expType->refCount = 1;
14083 }
14084 else
14085 {
14086 e->type = 11;
14087 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14088 e->__anon1.cast.exp = thisExp;
14089 e->byReference = 1;
14090 e->expType = type;
14091 type->refCount++;
14092 }
14093 e->destType = destType;
14094 destType->refCount++;
14095 }
14096 }
14097 }
14098
14099 void ApplyLocation(struct Expression * exp, struct Location * loc)
14100 {
14101 exp->loc = *loc;
14102 switch(exp->type)
14103 {
14104 case 4:
14105 if(exp->__anon1.op.exp1)
14106 ApplyLocation(exp->__anon1.op.exp1, loc);
14107 if(exp->__anon1.op.exp2)
14108 ApplyLocation(exp->__anon1.op.exp2, loc);
14109 break;
14110 case 5:
14111 if(exp->__anon1.list)
14112 {
14113 struct Expression * e;
14114
14115 for(e = (*exp->__anon1.list).first; e; e = e->next)
14116 ApplyLocation(e, loc);
14117 }
14118 break;
14119 case 6:
14120 if(exp->__anon1.index.index)
14121 {
14122 struct Expression * e;
14123
14124 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14125 ApplyLocation(e, loc);
14126 }
14127 if(exp->__anon1.index.exp)
14128 ApplyLocation(exp->__anon1.index.exp, loc);
14129 break;
14130 case 7:
14131 if(exp->__anon1.call.arguments)
14132 {
14133 struct Expression * arg;
14134
14135 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14136 ApplyLocation(arg, loc);
14137 }
14138 if(exp->__anon1.call.exp)
14139 ApplyLocation(exp->__anon1.call.exp, loc);
14140 break;
14141 case 8:
14142 case 9:
14143 if(exp->__anon1.member.exp)
14144 ApplyLocation(exp->__anon1.member.exp, loc);
14145 break;
14146 case 11:
14147 if(exp->__anon1.cast.exp)
14148 ApplyLocation(exp->__anon1.cast.exp, loc);
14149 break;
14150 case 12:
14151 if(exp->__anon1.cond.exp)
14152 {
14153 struct Expression * e;
14154
14155 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14156 ApplyLocation(e, loc);
14157 }
14158 if(exp->__anon1.cond.cond)
14159 ApplyLocation(exp->__anon1.cond.cond, loc);
14160 if(exp->__anon1.cond.elseExp)
14161 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14162 break;
14163 case 34:
14164 if(exp->__anon1.vaArg.exp)
14165 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14166 break;
14167 default:
14168 break;
14169 }
14170 }
14171
14172 extern char *  strstr(const char * , const char * );
14173
14174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14175
14176 struct __ecereNameSpace__ecere__com__DefinedExpression
14177 {
14178 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14179 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14180 const char *  name;
14181 const char *  value;
14182 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14183 } __attribute__ ((gcc_struct));
14184
14185 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14186
14187 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14188
14189 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14190
14191 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14192
14193 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14194
14195 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14196
14197 static void ProcessStatement(struct Statement * stmt);
14198
14199 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14200
14201 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14202
14203 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14204
14205 extern const char *  sourceFile;
14206
14207 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
14208
14209 extern struct Expression * MoveExpContents(struct Expression * exp);
14210
14211 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14212
14213 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
14214
14215 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14216
14217 void ProcessExpressionType(struct Expression * exp)
14218 {
14219 unsigned int unresolved = 0;
14220 struct Location oldyylloc = yylloc;
14221 unsigned int notByReference = 0;
14222
14223 if(!exp || exp->expType)
14224 return ;
14225 yylloc = exp->loc;
14226 switch(exp->type)
14227 {
14228 case 0:
14229 {
14230 struct Identifier * id = exp->__anon1.__anon1.identifier;
14231
14232 if(!id || !topContext)
14233 return ;
14234 if(id->_class && id->_class->__anon1.__anon1.name)
14235 {
14236 id->classSym = id->_class->__anon1.__anon1.symbol;
14237 }
14238 if(!strcmp(id->string, "__runtimePlatform"))
14239 {
14240 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14241 break;
14242 }
14243 else if(strstr(id->string, "__ecereClass") == id->string)
14244 {
14245 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14246 break;
14247 }
14248 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14249 {
14250 ReplaceClassMembers(exp, thisClass);
14251 if(exp->type != 0)
14252 {
14253 ProcessExpressionType(exp);
14254 break;
14255 }
14256 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14257 break;
14258 }
14259 else
14260 {
14261 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14262
14263 if(!symbol)
14264 {
14265 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14266 break;
14267 else
14268 {
14269 if(thisClass)
14270 {
14271 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14272 if(exp->type != 0)
14273 {
14274 ProcessExpressionType(exp);
14275 break;
14276 }
14277 }
14278 else if(currentClass && !id->_class)
14279 {
14280 if(ResolveIdWithClass(exp, currentClass, 1))
14281 break;
14282 }
14283 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14284 }
14285 }
14286 if(symbol)
14287 {
14288 struct Type * type = symbol->type;
14289 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14290
14291 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14292 {
14293 struct Context * context = SetupTemplatesContext(_class);
14294
14295 type = ReplaceThisClassType(_class);
14296 FinishTemplatesContext(context);
14297 if(type)
14298 type->refCount = 0;
14299 }
14300 FreeSpecifier(id->_class);
14301 id->_class = (((void *)0));
14302 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14303 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14304 id->classSym = (((void *)0));
14305 exp->expType = type;
14306 if(type)
14307 type->refCount++;
14308 if(type && (type->kind == 15))
14309 exp->isConstant = 1;
14310 if(symbol->isParam || !strcmp(id->string, "this"))
14311 {
14312 if(_class && _class->type == 1 && !type->declaredWithStruct)
14313 exp->byReference = 1;
14314 }
14315 if(symbol->isIterator)
14316 {
14317 if(symbol->isIterator == 3)
14318 {
14319 exp->type = 5;
14320 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14321 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14322 exp->expType = (((void *)0));
14323 ProcessExpressionType(exp);
14324 }
14325 else if(symbol->isIterator != 4)
14326 {
14327 exp->type = 8;
14328 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14329 exp->__anon1.member.exp->expType = exp->expType;
14330 exp->__anon1.member.member = MkIdentifier("data");
14331 exp->expType = (((void *)0));
14332 ProcessExpressionType(exp);
14333 }
14334 }
14335 break;
14336 }
14337 else
14338 {
14339 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14340
14341 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14342 {
14343 char name[1024];
14344
14345 strcpy(name, thisNameSpace);
14346 strcat(name, "::");
14347 strcat(name, id->string);
14348 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14349 }
14350 if(!definedExp)
14351 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14352 if(definedExp)
14353 {
14354 int c;
14355
14356 for(c = 0; c < definedExpStackPos; c++)
14357 if(definedExpStack[c] == definedExp)
14358 break;
14359 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14360 {
14361 struct Location backupYylloc = yylloc;
14362 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14363
14364 definedExpStack[definedExpStackPos++] = definedExp;
14365 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14366 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14367 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14368
14369 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14370 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14371 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14372 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14373
14374 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14375 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14376 echoOn = 0;
14377 parsedExpression = (((void *)0));
14378 resetScanner();
14379 expression_yyparse();
14380 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14381 if(backInput)
14382 fileInput = backInput;
14383 yylloc = backupYylloc;
14384 if(parsedExpression)
14385 {
14386 FreeIdentifier(id);
14387 exp->type = 5;
14388 exp->__anon1.list = MkListOne(parsedExpression);
14389 ApplyLocation(parsedExpression, &yylloc);
14390 ProcessExpressionType(exp);
14391 definedExpStackPos--;
14392 return ;
14393 }
14394 definedExpStackPos--;
14395 }
14396 else
14397 {
14398 if(inCompiler)
14399 {
14400 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14401 }
14402 }
14403 }
14404 else
14405 {
14406 struct GlobalData * data = (((void *)0));
14407
14408 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14409 {
14410 char name[1024];
14411
14412 strcpy(name, thisNameSpace);
14413 strcat(name, "::");
14414 strcat(name, id->string);
14415 data = FindGlobalData(name);
14416 }
14417 if(!data)
14418 data = FindGlobalData(id->string);
14419 if(data)
14420 {
14421 DeclareGlobalData(data);
14422 exp->expType = data->dataType;
14423 if(data->dataType)
14424 data->dataType->refCount++;
14425 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14426 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14427 FreeSpecifier(id->_class);
14428 id->_class = (((void *)0));
14429 break;
14430 }
14431 else
14432 {
14433 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14434
14435 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14436 {
14437 char name[1024];
14438
14439 strcpy(name, thisNameSpace);
14440 strcat(name, "::");
14441 strcat(name, id->string);
14442 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14443 }
14444 if(!function)
14445 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14446 if(function)
14447 {
14448 char name[1024];
14449
14450 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14451 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14452 name[0] = (char)0;
14453 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14454 strcpy(name, "__ecereFunction_");
14455 FullClassNameCat(name, id->string, 0);
14456 if(DeclareFunction(function, name))
14457 {
14458 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14459 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14460 }
14461 exp->expType = function->dataType;
14462 if(function->dataType)
14463 function->dataType->refCount++;
14464 FreeSpecifier(id->_class);
14465 id->_class = (((void *)0));
14466 break;
14467 }
14468 }
14469 }
14470 }
14471 }
14472 unresolved = 1;
14473 break;
14474 }
14475 case 1:
14476 {
14477 if(!exp->__anon1.instance->_class)
14478 {
14479 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14480 {
14481 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14482 }
14483 }
14484 ProcessInstantiationType(exp->__anon1.instance);
14485 exp->isConstant = exp->__anon1.instance->isConstant;
14486 if(exp->__anon1.instance->_class)
14487 {
14488 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14489 }
14490 break;
14491 }
14492 case 2:
14493 {
14494 if(!exp->expType)
14495 {
14496 char * constant = exp->__anon1.__anon1.constant;
14497 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14498
14499 exp->expType = type;
14500 if(constant[0] == '\'')
14501 {
14502 if((int)((unsigned char *)constant)[1] > 127)
14503 {
14504 int nb;
14505 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14506
14507 if(nb < 2)
14508 ch = constant[1];
14509 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14510 exp->__anon1.__anon1.constant = PrintUInt(ch);
14511 type->kind = 8;
14512 type->__anon1._class = FindClass("unichar");
14513 type->isSigned = 0;
14514 }
14515 else
14516 {
14517 type->kind = 1;
14518 type->isSigned = 1;
14519 }
14520 }
14521 else
14522 {
14523 char * dot = strchr(constant, '.');
14524 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14525 char * exponent;
14526
14527 if(isHex)
14528 {
14529 exponent = strchr(constant, 'p');
14530 if(!exponent)
14531 exponent = strchr(constant, 'P');
14532 }
14533 else
14534 {
14535 exponent = strchr(constant, 'e');
14536 if(!exponent)
14537 exponent = strchr(constant, 'E');
14538 }
14539 if(dot || exponent)
14540 {
14541 if(strchr(constant, 'f') || strchr(constant, 'F'))
14542 type->kind = 6;
14543 else
14544 type->kind = 7;
14545 type->isSigned = 1;
14546 }
14547 else
14548 {
14549 unsigned int isSigned = constant[0] == '-';
14550 char * endP = (((void *)0));
14551 long long i64 = strtoll(constant, &endP, 0);
14552 uint64 ui64 = strtoull(constant, &endP, 0);
14553 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14554
14555 if(isSigned)
14556 {
14557 if(i64 < (((int)0x80000000)))
14558 is64Bit = 1;
14559 }
14560 else
14561 {
14562 if(ui64 > (((int)0x7fffffff)))
14563 {
14564 if(ui64 > (0xffffffff))
14565 {
14566 is64Bit = 1;
14567 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14568 isSigned = 1;
14569 }
14570 }
14571 else if(constant[0] != '0' || !constant[1])
14572 isSigned = 1;
14573 }
14574 type->kind = is64Bit ? 4 : 3;
14575 type->isSigned = isSigned;
14576 }
14577 }
14578 exp->isConstant = 1;
14579 if(exp->destType && exp->destType->kind == 7)
14580 type->kind = 7;
14581 else if(exp->destType && exp->destType->kind == 6)
14582 type->kind = 6;
14583 else if(exp->destType && exp->destType->kind == 4)
14584 type->kind = 4;
14585 }
14586 break;
14587 }
14588 case 3:
14589 {
14590 exp->isConstant = 1;
14591 exp->expType = __extension__ ({
14592 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14593
14594 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14595 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14596
14597 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
14598 }), __ecereInstance2;
14599 });
14600 break;
14601 }
14602 case 13:
14603 case 26:
14604 ProcessExpressionType(exp->__anon1._new.size);
14605 exp->expType = __extension__ ({
14606 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14607
14608 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14609 });
14610 DeclareType(exp->expType->__anon1.type, 0, 0);
14611 break;
14612 case 14:
14613 case 27:
14614 ProcessExpressionType(exp->__anon1._renew.size);
14615 ProcessExpressionType(exp->__anon1._renew.exp);
14616 exp->expType = __extension__ ({
14617 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14618
14619 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14620 });
14621 DeclareType(exp->expType->__anon1.type, 0, 0);
14622 break;
14623 case 4:
14624 {
14625 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14626 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14627 unsigned int useDestType = 0, useSideType = 0;
14628 struct Location oldyylloc = yylloc;
14629 unsigned int useSideUnit = 0;
14630 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14631 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14632
14633 switch(exp->__anon1.op.op)
14634 {
14635 case '=':
14636 case MUL_ASSIGN:
14637 case DIV_ASSIGN:
14638 case MOD_ASSIGN:
14639 case ADD_ASSIGN:
14640 case SUB_ASSIGN:
14641 case LEFT_ASSIGN:
14642 case RIGHT_ASSIGN:
14643 case AND_ASSIGN:
14644 case XOR_ASSIGN:
14645 case OR_ASSIGN:
14646 assign = 1;
14647 break;
14648 case '!':
14649 break;
14650 case AND_OP:
14651 case OR_OP:
14652 boolOps = 1;
14653 boolResult = 1;
14654 break;
14655 case EQ_OP:
14656 case '<':
14657 case '>':
14658 case LE_OP:
14659 case GE_OP:
14660 case NE_OP:
14661 boolResult = 1;
14662 useSideType = 1;
14663 break;
14664 case '+':
14665 case '-':
14666 useSideUnit = 1;
14667 useSideType = 1;
14668 useDestType = 1;
14669 break;
14670 case LEFT_OP:
14671 case RIGHT_OP:
14672 useSideType = 1;
14673 useDestType = 1;
14674 break;
14675 case '|':
14676 case '^':
14677 useSideType = 1;
14678 useDestType = 1;
14679 break;
14680 case '/':
14681 case '%':
14682 useSideType = 1;
14683 useDestType = 1;
14684 break;
14685 case '&':
14686 case '*':
14687 if(exp->__anon1.op.exp1)
14688 {
14689 useSideType = 1;
14690 useDestType = 1;
14691 }
14692 break;
14693 }
14694 if(exp->__anon1.op.op == '&')
14695 {
14696 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14697 {
14698 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14699 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14700
14701 if(symbol && symbol->isIterator == 2)
14702 {
14703 exp->type = 8;
14704 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14705 exp->__anon1.member.member = MkIdentifier("key");
14706 exp->expType = (((void *)0));
14707 exp->__anon1.op.exp2->expType = symbol->type;
14708 symbol->type->refCount++;
14709 ProcessExpressionType(exp);
14710 FreeType(dummy);
14711 break;
14712 }
14713 }
14714 }
14715 if(exp->__anon1.op.exp1)
14716 {
14717 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14718 useDestType = 0;
14719 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14720 {
14721 if(exp->__anon1.op.exp1->destType)
14722 FreeType(exp->__anon1.op.exp1->destType);
14723 exp->__anon1.op.exp1->destType = exp->destType;
14724 exp->__anon1.op.exp1->opDestType = 1;
14725 if(exp->destType)
14726 exp->destType->refCount++;
14727 }
14728 else if(!assign)
14729 {
14730 if(exp->__anon1.op.exp1->destType)
14731 FreeType(exp->__anon1.op.exp1->destType);
14732 exp->__anon1.op.exp1->destType = dummy;
14733 dummy->refCount++;
14734 }
14735 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14736 exp->__anon1.op.exp1->destType->count++;
14737 ProcessExpressionType(exp->__anon1.op.exp1);
14738 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14739 exp->__anon1.op.exp1->destType->count--;
14740 exp->__anon1.op.exp1->opDestType = 0;
14741 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)
14742 {
14743 exp->__anon1.op.exp2 = MkExpConstant("1");
14744 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14745 assign = 1;
14746 }
14747 if(exp->__anon1.op.exp1->destType == dummy)
14748 {
14749 FreeType(dummy);
14750 exp->__anon1.op.exp1->destType = (((void *)0));
14751 }
14752 type1 = exp->__anon1.op.exp1->expType;
14753 }
14754 if(exp->__anon1.op.exp2)
14755 {
14756 char expString[10240];
14757
14758 expString[0] = '\0';
14759 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14760 {
14761 if(exp->__anon1.op.exp1)
14762 {
14763 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14764 if(exp->__anon1.op.exp1->expType)
14765 exp->__anon1.op.exp1->expType->refCount++;
14766 }
14767 else
14768 {
14769 exp->__anon1.op.exp2->destType = exp->destType;
14770 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14771 exp->__anon1.op.exp2->opDestType = 1;
14772 if(exp->destType)
14773 exp->destType->refCount++;
14774 }
14775 if(type1)
14776 type1->refCount++;
14777 exp->expType = type1;
14778 }
14779 else if(assign)
14780 {
14781 if(inCompiler)
14782 PrintExpression(exp->__anon1.op.exp2, expString);
14783 if(type1 && type1->kind == 13)
14784 {
14785 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)
14786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14787 else if(exp->__anon1.op.op == '=')
14788 {
14789 if(exp->__anon1.op.exp2->destType)
14790 FreeType(exp->__anon1.op.exp2->destType);
14791 exp->__anon1.op.exp2->destType = type1;
14792 if(type1)
14793 type1->refCount++;
14794 }
14795 }
14796 else
14797 {
14798 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)
14799 ;
14800 else
14801 {
14802 if(exp->__anon1.op.exp2->destType)
14803 FreeType(exp->__anon1.op.exp2->destType);
14804 exp->__anon1.op.exp2->destType = type1;
14805 if(type1)
14806 type1->refCount++;
14807 }
14808 }
14809 if(type1)
14810 type1->refCount++;
14811 exp->expType = type1;
14812 }
14813 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14814 {
14815 if(exp->__anon1.op.exp2->destType)
14816 FreeType(exp->__anon1.op.exp2->destType);
14817 exp->__anon1.op.exp2->destType = exp->destType;
14818 if(exp->__anon1.op.op != '&')
14819 exp->__anon1.op.exp2->opDestType = 1;
14820 if(exp->destType)
14821 exp->destType->refCount++;
14822 }
14823 else
14824 {
14825 if(exp->__anon1.op.exp2->destType)
14826 FreeType(exp->__anon1.op.exp2->destType);
14827 exp->__anon1.op.exp2->destType = dummy;
14828 dummy->refCount++;
14829 }
14830 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))
14831 {
14832 FreeType(exp->__anon1.op.exp2->destType);
14833 exp->__anon1.op.exp2->destType = type1;
14834 type1->refCount++;
14835 }
14836 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14837 exp->__anon1.op.exp2->destType->count++;
14838 if(exp->__anon1.op.op == SIZEOF)
14839 {
14840 struct Expression * e = exp->__anon1.op.exp2;
14841
14842 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14843 {
14844 if(e->type == 5 || e->type == 32 || e->type == 23)
14845 {
14846 if(e->type == 23)
14847 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14848 else
14849 e = (*e->__anon1.list).last;
14850 }
14851 }
14852 if(e->type == 11 && e->__anon1.cast.exp)
14853 e->__anon1.cast.exp->needCast = 1;
14854 }
14855 ProcessExpressionType(exp->__anon1.op.exp2);
14856 exp->__anon1.op.exp2->opDestType = 0;
14857 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14858 exp->__anon1.op.exp2->destType->count--;
14859 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14860 {
14861 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)
14862 {
14863 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14865 }
14866 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)))
14867 {
14868 if(exp->__anon1.op.op == ADD_ASSIGN)
14869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14870 }
14871 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))
14872 {
14873 if(exp->__anon1.op.op == ADD_ASSIGN)
14874 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14875 }
14876 else if(inCompiler)
14877 {
14878 char type1String[1024];
14879 char type2String[1024];
14880
14881 type1String[0] = '\0';
14882 type2String[0] = '\0';
14883 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14884 PrintType(type1, type2String, 0, 1);
14885 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14886 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14887 }
14888 }
14889 if(exp->__anon1.op.exp2->destType == dummy)
14890 {
14891 FreeType(dummy);
14892 exp->__anon1.op.exp2->destType = (((void *)0));
14893 }
14894 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14895 {
14896 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14897 type2->refCount = 1;
14898 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14899 type2->isSigned = 1;
14900 }
14901 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))
14902 {
14903 type2 = __extension__ ({
14904 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14905
14906 __ecereInstance1->kind = 3, __ecereInstance1;
14907 });
14908 type2->refCount = 1;
14909 type2->isSigned = 1;
14910 }
14911 else
14912 {
14913 type2 = exp->__anon1.op.exp2->expType;
14914 if(type2)
14915 type2->refCount++;
14916 }
14917 }
14918 dummy->kind = 0;
14919 if(exp->__anon1.op.op == SIZEOF)
14920 {
14921 exp->expType = __extension__ ({
14922 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14923
14924 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14925 });
14926 exp->isConstant = 1;
14927 }
14928 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14929 {
14930 exp->expType = Dereference(type2);
14931 if(type2 && type2->kind == 8)
14932 notByReference = 1;
14933 }
14934 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14935 exp->expType = Reference(type2);
14936 else if(!assign)
14937 {
14938 if(boolOps)
14939 {
14940 if(exp->__anon1.op.exp1)
14941 {
14942 if(exp->__anon1.op.exp1->destType)
14943 FreeType(exp->__anon1.op.exp1->destType);
14944 exp->__anon1.op.exp1->destType = MkClassType("bool");
14945 exp->__anon1.op.exp1->destType->truth = 1;
14946 if(!exp->__anon1.op.exp1->expType)
14947 ProcessExpressionType(exp->__anon1.op.exp1);
14948 else
14949 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14950 FreeType(exp->__anon1.op.exp1->expType);
14951 exp->__anon1.op.exp1->expType = MkClassType("bool");
14952 exp->__anon1.op.exp1->expType->truth = 1;
14953 }
14954 if(exp->__anon1.op.exp2)
14955 {
14956 if(exp->__anon1.op.exp2->destType)
14957 FreeType(exp->__anon1.op.exp2->destType);
14958 exp->__anon1.op.exp2->destType = MkClassType("bool");
14959 exp->__anon1.op.exp2->destType->truth = 1;
14960 if(!exp->__anon1.op.exp2->expType)
14961 ProcessExpressionType(exp->__anon1.op.exp2);
14962 else
14963 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14964 FreeType(exp->__anon1.op.exp2->expType);
14965 exp->__anon1.op.exp2->expType = MkClassType("bool");
14966 exp->__anon1.op.exp2->expType->truth = 1;
14967 }
14968 }
14969 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")))))
14970 {
14971 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"))))
14972 {
14973 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)))
14974 {
14975 struct Type * intType;
14976
14977 if(!type1->__anon1._class->__anon1.registered->dataType)
14978 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14979 if(!type2->__anon1._class->__anon1.registered->dataType)
14980 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14981 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14982 if(exp->__anon1.op.exp1->destType)
14983 FreeType(exp->__anon1.op.exp1->destType);
14984 if(exp->__anon1.op.exp2->destType)
14985 FreeType(exp->__anon1.op.exp2->destType);
14986 exp->__anon1.op.exp1->destType = intType;
14987 exp->__anon1.op.exp2->destType = intType;
14988 intType->refCount++;
14989 }
14990 else
14991 {
14992 if(exp->__anon1.op.exp2->destType)
14993 FreeType(exp->__anon1.op.exp2->destType);
14994 exp->__anon1.op.exp2->destType = type1;
14995 type1->refCount++;
14996 if(exp->__anon1.op.exp1->destType)
14997 FreeType(exp->__anon1.op.exp1->destType);
14998 exp->__anon1.op.exp1->destType = type2;
14999 type2->refCount++;
15000 }
15001 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)
15002 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);
15003 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
15004 {
15005 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15006
15007 if(argExp)
15008 {
15009 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15010
15011 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
15012 ProcessExpressionType(exp->__anon1.op.exp1);
15013 if(type2->kind != 13)
15014 {
15015 ProcessExpressionType(classExp);
15016 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
15017 if(!exp->__anon1.op.exp2->expType)
15018 {
15019 if(type2)
15020 FreeType(type2);
15021 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
15022 type2->refCount++;
15023 }
15024 ProcessExpressionType(exp->__anon1.op.exp2);
15025 }
15026 }
15027 }
15028 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)))
15029 {
15030 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
15031 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15032 exp->expType = type1;
15033 if(type1)
15034 type1->refCount++;
15035 }
15036 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)))
15037 {
15038 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
15039 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15040 exp->expType = type2;
15041 if(type2)
15042 type2->refCount++;
15043 }
15044 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))
15045 {
15046 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
15047 }
15048 else
15049 {
15050 unsigned int success = 0;
15051
15052 if(type1->kind == 13 && type2->kind == 13)
15053 {
15054 if(exp->__anon1.op.op == '+')
15055 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
15056 else if(exp->__anon1.op.op == '-')
15057 {
15058 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
15059 {
15060 exp->expType = __extension__ ({
15061 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15062
15063 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15064 });
15065 success = 1;
15066 if(type1->__anon1.type->kind == 20)
15067 {
15068 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15069
15070 if(argExp)
15071 {
15072 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15073
15074 ProcessExpressionType(classExp);
15075 exp->type = 5;
15076 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"))));
15077 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15078 FreeType(dummy);
15079 return ;
15080 }
15081 }
15082 }
15083 }
15084 }
15085 if(!success && exp->__anon1.op.exp1->type == 2)
15086 {
15087 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15088 {
15089 if(exp->expType)
15090 FreeType(exp->expType);
15091 exp->expType = exp->__anon1.op.exp1->destType;
15092 if(exp->__anon1.op.exp1->destType)
15093 exp->__anon1.op.exp1->destType->refCount++;
15094 success = 1;
15095 }
15096 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15097 {
15098 if(exp->expType)
15099 FreeType(exp->expType);
15100 exp->expType = exp->__anon1.op.exp2->destType;
15101 if(exp->__anon1.op.exp2->destType)
15102 exp->__anon1.op.exp2->destType->refCount++;
15103 success = 1;
15104 }
15105 }
15106 else if(!success)
15107 {
15108 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15109 {
15110 if(exp->expType)
15111 FreeType(exp->expType);
15112 exp->expType = exp->__anon1.op.exp2->destType;
15113 if(exp->__anon1.op.exp2->destType)
15114 exp->__anon1.op.exp2->destType->refCount++;
15115 success = 1;
15116 }
15117 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15118 {
15119 if(exp->expType)
15120 FreeType(exp->expType);
15121 exp->expType = exp->__anon1.op.exp1->destType;
15122 if(exp->__anon1.op.exp1->destType)
15123 exp->__anon1.op.exp1->destType->refCount++;
15124 success = 1;
15125 }
15126 }
15127 if(!success)
15128 {
15129 char expString1[10240];
15130 char expString2[10240];
15131 char type1[1024];
15132 char type2[1024];
15133
15134 expString1[0] = '\0';
15135 expString2[0] = '\0';
15136 type1[0] = '\0';
15137 type2[0] = '\0';
15138 if(inCompiler)
15139 {
15140 PrintExpression(exp->__anon1.op.exp1, expString1);
15141 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15142 PrintExpression(exp->__anon1.op.exp2, expString2);
15143 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15144 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15145 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15146 }
15147 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15148 }
15149 }
15150 }
15151 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)
15152 {
15153 if(exp->__anon1.op.exp1->destType)
15154 FreeType(exp->__anon1.op.exp1->destType);
15155 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15156 if(type2->__anon1._class->__anon1.registered->dataType)
15157 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15158 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15159 exp->expType = type2;
15160 if(type2)
15161 type2->refCount++;
15162 }
15163 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)
15164 {
15165 if(exp->__anon1.op.exp2->destType)
15166 FreeType(exp->__anon1.op.exp2->destType);
15167 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15168 if(type1->__anon1._class->__anon1.registered->dataType)
15169 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15170 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15171 exp->expType = type1;
15172 if(type1)
15173 type1->refCount++;
15174 }
15175 else if(type1)
15176 {
15177 unsigned int valid = 0;
15178
15179 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15180 {
15181 if(exp->__anon1.op.exp2->destType)
15182 FreeType(exp->__anon1.op.exp2->destType);
15183 if(!type1->__anon1._class->__anon1.registered->dataType)
15184 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15185 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15186 exp->__anon1.op.exp2->destType->refCount++;
15187 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15188 if(type2)
15189 FreeType(type2);
15190 type2 = exp->__anon1.op.exp2->destType;
15191 if(type2)
15192 type2->refCount++;
15193 exp->expType = type2;
15194 type2->refCount++;
15195 }
15196 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15197 {
15198 if(exp->__anon1.op.exp1->destType)
15199 FreeType(exp->__anon1.op.exp1->destType);
15200 if(!type2->__anon1._class->__anon1.registered->dataType)
15201 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15202 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15203 exp->__anon1.op.exp1->destType->refCount++;
15204 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15205 type1 = exp->__anon1.op.exp1->destType;
15206 exp->expType = type1;
15207 type1->refCount++;
15208 }
15209 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15210 {
15211 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15212 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15213
15214 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15215 {
15216 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15217 {
15218 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15219 {
15220 if(exp->expType)
15221 FreeType(exp->expType);
15222 exp->expType = exp->__anon1.op.exp2->expType;
15223 if(exp->__anon1.op.exp2->expType)
15224 exp->__anon1.op.exp2->expType->refCount++;
15225 valid = 1;
15226 }
15227 }
15228 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15229 {
15230 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15231 {
15232 if(exp->expType)
15233 FreeType(exp->expType);
15234 exp->expType = exp->__anon1.op.exp1->expType;
15235 if(exp->__anon1.op.exp1->expType)
15236 exp->__anon1.op.exp1->expType->refCount++;
15237 valid = 1;
15238 }
15239 }
15240 }
15241 else
15242 {
15243 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15244 {
15245 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15246 {
15247 if(exp->expType)
15248 FreeType(exp->expType);
15249 exp->expType = exp->__anon1.op.exp1->expType;
15250 if(exp->__anon1.op.exp1->expType)
15251 exp->__anon1.op.exp1->expType->refCount++;
15252 valid = 1;
15253 }
15254 }
15255 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15256 {
15257 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15258 {
15259 if(exp->expType)
15260 FreeType(exp->expType);
15261 exp->expType = exp->__anon1.op.exp2->expType;
15262 if(exp->__anon1.op.exp2->expType)
15263 exp->__anon1.op.exp2->expType->refCount++;
15264 valid = 1;
15265 }
15266 }
15267 }
15268 }
15269 if(!valid)
15270 {
15271 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))
15272 {
15273 if(exp->__anon1.op.exp1->destType)
15274 FreeType(exp->__anon1.op.exp1->destType);
15275 exp->__anon1.op.exp1->destType = type2;
15276 type2->refCount++;
15277 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15278 {
15279 if(exp->expType)
15280 FreeType(exp->expType);
15281 exp->expType = exp->__anon1.op.exp1->destType;
15282 if(exp->__anon1.op.exp1->destType)
15283 exp->__anon1.op.exp1->destType->refCount++;
15284 }
15285 }
15286 else
15287 {
15288 if(exp->__anon1.op.exp2->destType)
15289 FreeType(exp->__anon1.op.exp2->destType);
15290 exp->__anon1.op.exp2->destType = type1;
15291 type1->refCount++;
15292 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15293 {
15294 if(exp->expType)
15295 FreeType(exp->expType);
15296 exp->expType = exp->__anon1.op.exp2->destType;
15297 if(exp->__anon1.op.exp2->destType)
15298 exp->__anon1.op.exp2->destType->refCount++;
15299 }
15300 else if(type1 && type2)
15301 {
15302 char expString1[10240];
15303 char expString2[10240];
15304 char type1String[1024];
15305 char type2String[1024];
15306
15307 expString1[0] = '\0';
15308 expString2[0] = '\0';
15309 type1String[0] = '\0';
15310 type2String[0] = '\0';
15311 if(inCompiler)
15312 {
15313 PrintExpression(exp->__anon1.op.exp1, expString1);
15314 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15315 PrintExpression(exp->__anon1.op.exp2, expString2);
15316 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15317 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15318 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15319 }
15320 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15321 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15322 {
15323 exp->expType = exp->__anon1.op.exp1->expType;
15324 if(exp->__anon1.op.exp1->expType)
15325 exp->__anon1.op.exp1->expType->refCount++;
15326 }
15327 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15328 {
15329 exp->expType = exp->__anon1.op.exp2->expType;
15330 if(exp->__anon1.op.exp2->expType)
15331 exp->__anon1.op.exp2->expType->refCount++;
15332 }
15333 }
15334 }
15335 }
15336 }
15337 else if(type2)
15338 {
15339 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15340 {
15341 struct Type * oldType = exp->__anon1.op.exp1->expType;
15342
15343 exp->__anon1.op.exp1->expType = (((void *)0));
15344 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15345 FreeType(oldType);
15346 else
15347 exp->__anon1.op.exp1->expType = oldType;
15348 }
15349 if(exp->__anon1.op.exp1->destType)
15350 FreeType(exp->__anon1.op.exp1->destType);
15351 exp->__anon1.op.exp1->destType = type2;
15352 type2->refCount++;
15353 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15354 {
15355 if(exp->expType)
15356 FreeType(exp->expType);
15357 exp->expType = exp->__anon1.op.exp1->destType;
15358 if(exp->__anon1.op.exp1->destType)
15359 exp->__anon1.op.exp1->destType->refCount++;
15360 }
15361 }
15362 }
15363 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15364 {
15365 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15366 {
15367 if(exp->__anon1.op.exp1->destType)
15368 FreeType(exp->__anon1.op.exp1->destType);
15369 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15370 if(type2->__anon1._class->__anon1.registered->dataType)
15371 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15372 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15373 }
15374 if(exp->__anon1.op.op == '!')
15375 {
15376 exp->expType = MkClassType("bool");
15377 exp->expType->truth = 1;
15378 }
15379 else
15380 {
15381 exp->expType = type2;
15382 if(type2)
15383 type2->refCount++;
15384 }
15385 }
15386 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15387 {
15388 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15389 {
15390 if(exp->__anon1.op.exp2->destType)
15391 FreeType(exp->__anon1.op.exp2->destType);
15392 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15393 if(type1->__anon1._class->__anon1.registered->dataType)
15394 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15395 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15396 }
15397 exp->expType = type1;
15398 if(type1)
15399 type1->refCount++;
15400 }
15401 }
15402 yylloc = exp->loc;
15403 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15404 {
15405 char expString[10000];
15406
15407 expString[0] = '\0';
15408 if(inCompiler)
15409 {
15410 PrintExpression(exp->__anon1.op.exp1, expString);
15411 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15412 }
15413 if(expString[0])
15414 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15415 }
15416 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15417 {
15418 char expString[10240];
15419
15420 expString[0] = '\0';
15421 if(inCompiler)
15422 {
15423 PrintExpression(exp->__anon1.op.exp2, expString);
15424 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15425 }
15426 if(expString[0])
15427 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15428 }
15429 if(boolResult)
15430 {
15431 FreeType(exp->expType);
15432 exp->expType = MkClassType("bool");
15433 exp->expType->truth = 1;
15434 }
15435 if(exp->__anon1.op.op != SIZEOF)
15436 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15437 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15438 {
15439 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15440 }
15441 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15442 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15443 yylloc = oldyylloc;
15444 FreeType(dummy);
15445 if(type2)
15446 FreeType(type2);
15447 break;
15448 }
15449 case 5:
15450 case 32:
15451 {
15452 struct Expression * e;
15453
15454 exp->isConstant = 1;
15455 for(e = (*exp->__anon1.list).first; e; e = e->next)
15456 {
15457 unsigned int inced = 0;
15458
15459 if(!e->next)
15460 {
15461 FreeType(e->destType);
15462 e->opDestType = exp->opDestType;
15463 e->destType = exp->destType;
15464 if(e->destType)
15465 {
15466 exp->destType->refCount++;
15467 e->destType->count++;
15468 inced = 1;
15469 }
15470 }
15471 ProcessExpressionType(e);
15472 if(inced)
15473 exp->destType->count--;
15474 if(!exp->expType && !e->next)
15475 {
15476 exp->expType = e->expType;
15477 if(e->expType)
15478 e->expType->refCount++;
15479 }
15480 if(!e->isConstant)
15481 exp->isConstant = 0;
15482 }
15483 e = (*exp->__anon1.list).first;
15484 if(!e->next && e->type == 8)
15485 {
15486 struct Expression * next = exp->next, * prev = exp->prev;
15487
15488 FreeType(exp->expType);
15489 FreeType(exp->destType);
15490 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15491 *exp = *e;
15492 exp->prev = prev;
15493 exp->next = next;
15494 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15495 ProcessExpressionType(exp);
15496 }
15497 break;
15498 }
15499 case 6:
15500 {
15501 struct Expression * e;
15502
15503 exp->isConstant = 1;
15504 ProcessExpressionType(exp->__anon1.index.exp);
15505 if(!exp->__anon1.index.exp->isConstant)
15506 exp->isConstant = 0;
15507 if(exp->__anon1.index.exp->expType)
15508 {
15509 struct Type * source = exp->__anon1.index.exp->expType;
15510
15511 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15512 {
15513 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15514 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15515
15516 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15517 {
15518 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15519 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15520 {
15521 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15522
15523 if(type->kind == 8)
15524 type->constant = 1;
15525 else if(type->kind == 13)
15526 {
15527 struct Type * t = type;
15528
15529 while(t->kind == 13)
15530 t = t->__anon1.type;
15531 t->constant = 1;
15532 }
15533 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15534 }
15535 }
15536 }
15537 }
15538 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15539 {
15540 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15541 {
15542 if(e->destType)
15543 FreeType(e->destType);
15544 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15545 }
15546 ProcessExpressionType(e);
15547 if(!e->next)
15548 {
15549 }
15550 if(!e->isConstant)
15551 exp->isConstant = 0;
15552 }
15553 if(!exp->expType)
15554 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15555 if(exp->expType)
15556 DeclareType(exp->expType, 0, 0);
15557 break;
15558 }
15559 case 7:
15560 {
15561 struct Expression * e;
15562 struct Type * functionType;
15563 struct Type * methodType = (((void *)0));
15564 char name[1024];
15565
15566 name[0] = '\0';
15567 if(inCompiler)
15568 {
15569 PrintExpression(exp->__anon1.call.exp, name);
15570 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15571 {
15572 PrintExpression(exp->__anon1.call.exp, name);
15573 }
15574 }
15575 if(exp->__anon1.call.exp->type == 0)
15576 {
15577 struct Expression * idExp = exp->__anon1.call.exp;
15578 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15579
15580 if(!strcmp(id->string, "__builtin_frame_address"))
15581 {
15582 exp->expType = ProcessTypeString("void *", 1);
15583 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15584 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15585 break;
15586 }
15587 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15588 {
15589 exp->expType = ProcessTypeString("int", 1);
15590 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15591 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15592 break;
15593 }
15594 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15595 {
15596 struct Expression * a = (((void *)0));
15597 struct Expression * b = (((void *)0));
15598 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15599
15600 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15601 {
15602 a = (*exp->__anon1.call.arguments).first;
15603 b = (*exp->__anon1.call.arguments).last;
15604 tempExp1 = a;
15605 tempExp2 = b;
15606 }
15607 else if((*exp->__anon1.call.arguments).count == 1)
15608 {
15609 a = (*exp->__anon1.call.arguments).first;
15610 tempExp1 = a;
15611 }
15612 if(a)
15613 {
15614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15615 idExp->__anon1.__anon1.identifier = (((void *)0));
15616 FreeExpContents(exp);
15617 ProcessExpressionType(a);
15618 if(b)
15619 ProcessExpressionType(b);
15620 exp->type = 5;
15621 exp->__anon1.list = MkList();
15622 if(a->expType && (!b || b->expType))
15623 {
15624 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15625 {
15626 if(inCompiler)
15627 {
15628 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15629 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15630 struct Declaration * decl;
15631 char temp1[1024], temp2[1024];
15632
15633 GetTypeSpecs(a->expType, specs);
15634 if(a && !a->isConstant && a->type != 0)
15635 {
15636 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15637 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15638 tempExp1 = QMkExpId(temp1);
15639 tempExp1->expType = a->expType;
15640 if(a->expType)
15641 a->expType->refCount++;
15642 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15643 }
15644 if(b && !b->isConstant && b->type != 0)
15645 {
15646 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15647 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15648 tempExp2 = QMkExpId(temp2);
15649 tempExp2->expType = b->expType;
15650 if(b->expType)
15651 b->expType->refCount++;
15652 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15653 }
15654 decl = MkDeclaration(specs, decls);
15655 if(!curCompound->__anon1.compound.declarations)
15656 curCompound->__anon1.compound.declarations = MkList();
15657 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15658 }
15659 }
15660 }
15661 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15662 {
15663 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15664
15665 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15666 exp->expType = a->expType;
15667 if(a->expType)
15668 a->expType->refCount++;
15669 }
15670 else if(!strcmp(id->string, "Abs"))
15671 {
15672 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15673 exp->expType = a->expType;
15674 if(a->expType)
15675 a->expType->refCount++;
15676 }
15677 else if(!strcmp(id->string, "Sgn"))
15678 {
15679 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"))))));
15680 exp->expType = ProcessTypeString("int", 0);
15681 }
15682 FreeExpression(tempExp1);
15683 if(tempExp2)
15684 FreeExpression(tempExp2);
15685 FreeIdentifier(id);
15686 break;
15687 }
15688 }
15689 }
15690 {
15691 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15692
15693 if(!exp->__anon1.call.exp->destType)
15694 {
15695 exp->__anon1.call.exp->destType = dummy;
15696 dummy->refCount++;
15697 }
15698 ProcessExpressionType(exp->__anon1.call.exp);
15699 if(exp->__anon1.call.exp->destType == dummy)
15700 {
15701 FreeType(dummy);
15702 exp->__anon1.call.exp->destType = (((void *)0));
15703 }
15704 FreeType(dummy);
15705 }
15706 functionType = exp->__anon1.call.exp->expType;
15707 if(functionType && functionType->kind == 16)
15708 {
15709 methodType = functionType;
15710 functionType = methodType->__anon1.__anon3.method->dataType;
15711 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15712 {
15713 char typeString[1024];
15714
15715 typeString[0] = '\0';
15716 {
15717 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15718
15719 functionType->__anon1.__anon2.thisClass = (((void *)0));
15720 PrintType(functionType, typeString, 1, 1);
15721 functionType->__anon1.__anon2.thisClass = back;
15722 }
15723 if(strstr(typeString, "thisclass"))
15724 {
15725 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15726 struct Declarator * decl;
15727
15728 {
15729 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15730
15731 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15732 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))
15733 thisClassParams = 0;
15734 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15735 {
15736 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15737
15738 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15739 ProcessDeclarator(decl);
15740 thisClass = backupThisClass;
15741 }
15742 thisClassParams = 1;
15743 functionType = ProcessType(specs, decl);
15744 functionType->refCount = 0;
15745 FinishTemplatesContext(context);
15746 }
15747 FreeList(specs, (void *)(FreeSpecifier));
15748 FreeDeclarator(decl);
15749 }
15750 }
15751 }
15752 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15753 {
15754 struct Type * type = functionType->__anon1.type;
15755
15756 if(!functionType->refCount)
15757 {
15758 functionType->__anon1.type = (((void *)0));
15759 FreeType(functionType);
15760 }
15761 functionType = type;
15762 }
15763 if(functionType && functionType->kind != 11)
15764 {
15765 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15766 }
15767 else if(functionType)
15768 {
15769 unsigned int emptyParams = 0, noParams = 0;
15770 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15771 struct Type * type = functionType->__anon1.__anon2.params.first;
15772 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15773 int extra = 0;
15774 struct Location oldyylloc = yylloc;
15775
15776 if(!type)
15777 emptyParams = 1;
15778 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15779 {
15780 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15781 e = e->next;
15782 }
15783 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15784 {
15785 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)
15786 {
15787 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15788 if(e)
15789 {
15790 e->destType = type;
15791 e = e->next;
15792 type = functionType->__anon1.__anon2.params.first;
15793 }
15794 else
15795 type->refCount = 0;
15796 }
15797 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15798 {
15799 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15800 type->byReference = functionType->byReference;
15801 type->typedByReference = functionType->typedByReference;
15802 if(e)
15803 {
15804 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15805 e = e->next;
15806 e->destType = type;
15807 e = e->next;
15808 type = functionType->__anon1.__anon2.params.first;
15809 }
15810 else
15811 type->refCount = 0;
15812 }
15813 }
15814 if(type && type->kind == 0)
15815 {
15816 noParams = 1;
15817 if(!type->refCount)
15818 FreeType(type);
15819 type = (((void *)0));
15820 }
15821 for(; e; e = e->next)
15822 {
15823 if(!type && !emptyParams)
15824 {
15825 yylloc = e->loc;
15826 if(methodType && methodType->__anon1.__anon3.methodClass)
15827 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);
15828 else
15829 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);
15830 break;
15831 }
15832 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15833 {
15834 struct Type * templatedType = (((void *)0));
15835 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15836 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15837 int id = 0;
15838
15839 if(_class && _class->templateArgs)
15840 {
15841 struct __ecereNameSpace__ecere__com__Class * sClass;
15842
15843 for(sClass = _class; sClass; sClass = sClass->base)
15844 {
15845 if(sClass->templateClass)
15846 sClass = sClass->templateClass;
15847 id = 0;
15848 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15849 {
15850 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15851 {
15852 struct __ecereNameSpace__ecere__com__Class * nextClass;
15853
15854 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15855 {
15856 if(nextClass->templateClass)
15857 nextClass = nextClass->templateClass;
15858 id += nextClass->templateParams.count;
15859 }
15860 break;
15861 }
15862 id++;
15863 }
15864 if(curParam)
15865 break;
15866 }
15867 }
15868 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15869 {
15870 unsigned int constant = type->constant;
15871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15872
15873 {
15874 struct Context * context = SetupTemplatesContext(_class);
15875
15876 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15877 FinishTemplatesContext(context);
15878 }
15879 if(templatedType->kind == 8 && constant)
15880 templatedType->constant = 1;
15881 else if(templatedType->kind == 13)
15882 {
15883 struct Type * t = templatedType->__anon1.type;
15884
15885 while(t->kind == 13)
15886 t = t->__anon1.type;
15887 if(constant)
15888 t->constant = constant;
15889 }
15890 e->destType = templatedType;
15891 if(templatedType)
15892 {
15893 templatedType->passAsTemplate = 1;
15894 }
15895 }
15896 else
15897 {
15898 e->destType = type;
15899 if(type)
15900 type->refCount++;
15901 }
15902 }
15903 else
15904 {
15905 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15906 {
15907 e->destType = type->prev;
15908 e->destType->refCount++;
15909 }
15910 else
15911 {
15912 e->destType = type;
15913 if(type)
15914 type->refCount++;
15915 }
15916 }
15917 if(type && type->kind != 14)
15918 {
15919 struct Type * next = type->next;
15920
15921 if(!type->refCount)
15922 FreeType(type);
15923 type = next;
15924 }
15925 }
15926 if(type && type->kind != 14)
15927 {
15928 if(methodType && methodType->__anon1.__anon3.methodClass)
15929 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);
15930 else
15931 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);
15932 }
15933 yylloc = oldyylloc;
15934 if(type && !type->refCount)
15935 FreeType(type);
15936 }
15937 else
15938 {
15939 functionType = __extension__ ({
15940 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15941
15942 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15943 });
15944 if(exp->__anon1.call.exp->type == 0)
15945 {
15946 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15947
15948 if(inCompiler)
15949 {
15950 struct Symbol * symbol;
15951 struct Location oldyylloc = yylloc;
15952
15953 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15954 if(strstr(string, "__builtin_") == string)
15955 {
15956 if(exp->destType)
15957 {
15958 functionType->__anon1.__anon2.returnType = exp->destType;
15959 exp->destType->refCount++;
15960 }
15961 }
15962 else
15963 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15964 symbol = __extension__ ({
15965 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15966
15967 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15968 });
15969 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15970 if(strstr(symbol->string, "::"))
15971 globalContext->hasNameSpace = 1;
15972 yylloc = oldyylloc;
15973 }
15974 }
15975 else if(exp->__anon1.call.exp->type == 8)
15976 {
15977 }
15978 else
15979 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15980 if(!functionType->__anon1.__anon2.returnType)
15981 {
15982 functionType->__anon1.__anon2.returnType = __extension__ ({
15983 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15984
15985 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15986 });
15987 }
15988 }
15989 if(functionType && functionType->kind == 11)
15990 {
15991 exp->expType = functionType->__anon1.__anon2.returnType;
15992 if(functionType->__anon1.__anon2.returnType)
15993 functionType->__anon1.__anon2.returnType->refCount++;
15994 if(!functionType->refCount)
15995 FreeType(functionType);
15996 }
15997 if(exp->__anon1.call.arguments)
15998 {
15999 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
16000 ProcessExpressionType(e);
16001 }
16002 break;
16003 }
16004 case 8:
16005 {
16006 struct Type * type;
16007 struct Location oldyylloc = yylloc;
16008 unsigned int thisPtr;
16009 struct Expression * checkExp = exp->__anon1.member.exp;
16010
16011 while(checkExp)
16012 {
16013 if(checkExp->type == 11)
16014 checkExp = checkExp->__anon1.cast.exp;
16015 else if(checkExp->type == 5)
16016 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
16017 else
16018 break;
16019 }
16020 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
16021 exp->thisPtr = thisPtr;
16022 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16023 {
16024 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16025 }
16026 ProcessExpressionType(exp->__anon1.member.exp);
16027 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)
16028 {
16029 exp->isConstant = 0;
16030 }
16031 else
16032 exp->isConstant = exp->__anon1.member.exp->isConstant;
16033 type = exp->__anon1.member.exp->expType;
16034 yylloc = exp->loc;
16035 if(type && (type->kind == 20))
16036 {
16037 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16038 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
16039
16040 if(_class)
16041 {
16042 for(param = _class->templateParams.first; param; param = param->next)
16043 {
16044 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
16045 break;
16046 }
16047 }
16048 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
16049 {
16050 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
16051
16052 if(argExp)
16053 {
16054 struct Expression * expMember = exp->__anon1.member.exp;
16055 struct Declarator * decl;
16056 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16057 char thisClassTypeString[1024];
16058
16059 FreeIdentifier(exp->__anon1.member.member);
16060 ProcessExpressionType(argExp);
16061 {
16062 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16063
16064 if(colon)
16065 {
16066 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16067 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16068 }
16069 else
16070 strcpy(thisClassTypeString, _class->fullName);
16071 }
16072 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16073 exp->expType = ProcessType(specs, decl);
16074 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16075 {
16076 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16077 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16078 int paramCount = 0;
16079 int lastParam = -1;
16080 char templateString[1024];
16081 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16082
16083 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16084 for(cClass = expClass; cClass; cClass = cClass->base)
16085 {
16086 int p = 0;
16087
16088 for(param = cClass->templateParams.first; param; param = param->next)
16089 {
16090 int id = p;
16091 struct __ecereNameSpace__ecere__com__Class * sClass;
16092 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16093
16094 for(sClass = cClass->base; sClass; sClass = sClass->base)
16095 id += sClass->templateParams.count;
16096 arg = expClass->templateArgs[id];
16097 for(sClass = _class; sClass; sClass = sClass->base)
16098 {
16099 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16100 int p = 0;
16101 struct __ecereNameSpace__ecere__com__Class * nextClass;
16102
16103 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16104 p += nextClass->templateParams.count;
16105 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16106 {
16107 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16108 {
16109 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16110 {
16111 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16112 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16113 break;
16114 }
16115 }
16116 }
16117 }
16118 {
16119 char argument[256];
16120
16121 argument[0] = '\0';
16122 switch(param->type)
16123 {
16124 case 2:
16125 {
16126 char expString[1024];
16127 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16128 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16129 struct Expression * exp;
16130 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16131
16132 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16133 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16134 ProcessExpressionType(exp);
16135 ComputeExpression(exp);
16136 expString[0] = '\0';
16137 PrintExpression(exp, expString);
16138 strcat(argument, expString);
16139 FreeExpression(exp);
16140 break;
16141 }
16142 case 1:
16143 {
16144 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16145 break;
16146 }
16147 case 0:
16148 {
16149 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16150 {
16151 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16152 strcat(argument, thisClassTypeString);
16153 else
16154 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16155 }
16156 break;
16157 }
16158 }
16159 if(argument[0])
16160 {
16161 if(paramCount)
16162 strcat(templateString, ", ");
16163 if(lastParam != p - 1)
16164 {
16165 strcat(templateString, param->name);
16166 strcat(templateString, " = ");
16167 }
16168 strcat(templateString, argument);
16169 paramCount++;
16170 lastParam = p;
16171 }
16172 p++;
16173 }
16174 }
16175 }
16176 {
16177 int len = strlen(templateString);
16178
16179 if(templateString[len - 1] == '>')
16180 templateString[len++] = ' ';
16181 templateString[len++] = '>';
16182 templateString[len++] = '\0';
16183 }
16184 {
16185 struct Context * context = SetupTemplatesContext(_class);
16186
16187 FreeType(exp->expType);
16188 exp->expType = ProcessTypeString(templateString, 0);
16189 FinishTemplatesContext(context);
16190 }
16191 }
16192 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
16193 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
16194 exp->type = 5;
16195 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")))))))));
16196 }
16197 }
16198 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16199 {
16200 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16201 }
16202 }
16203 if(type && (type->kind == 20))
16204 ;
16205 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)))
16206 {
16207 struct Identifier * id = exp->__anon1.member.member;
16208 int typeKind = type->kind;
16209 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));
16210
16211 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16212 {
16213 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16214 typeKind = 8;
16215 }
16216 if(id)
16217 {
16218 if(typeKind == 3 || typeKind == 15)
16219 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16220 else if(!_class)
16221 {
16222 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16223 {
16224 _class = type->__anon1._class->__anon1.registered;
16225 }
16226 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16227 {
16228 _class = FindClass("char *")->__anon1.registered;
16229 }
16230 else if(type->kind == 13)
16231 {
16232 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16233 FreeType(exp->expType);
16234 exp->expType = ProcessTypeString("uintptr", 0);
16235 exp->byReference = 1;
16236 }
16237 else
16238 {
16239 char string[1024] = "";
16240 struct Symbol * classSym;
16241
16242 PrintTypeNoConst(type, string, 0, 1);
16243 classSym = FindClass(string);
16244 if(classSym)
16245 _class = classSym->__anon1.registered;
16246 }
16247 }
16248 }
16249 if(_class && id)
16250 {
16251 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16252 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16253 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16254 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16255 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16256
16257 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16258 exp->__anon1.member.memberType = 1;
16259 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16261 if(typeKind != 19)
16262 {
16263 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16264 {
16265 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16266 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16267 {
16268 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16269 if(prop)
16270 member = (((void *)0));
16271 }
16272 if(!member && !prop)
16273 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16274 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16275 exp->__anon1.member.thisPtr = 1;
16276 }
16277 else
16278 {
16279 unsigned int useMemberForNonConst = 0;
16280
16281 if(!id->classSym)
16282 {
16283 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16284 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);
16285 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16286 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16287 }
16288 if((!prop || useMemberForNonConst) && !member)
16289 {
16290 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16291 if(!method)
16292 {
16293 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16294 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);
16295 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16296 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16297 }
16298 }
16299 if(member && prop)
16300 {
16301 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16302 prop = (((void *)0));
16303 else
16304 member = (((void *)0));
16305 }
16306 }
16307 }
16308 if(!prop && !member && !method)
16309 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16310 if(!prop && !member && !method)
16311 {
16312 if(typeKind == 19)
16313 {
16314 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16315 if(classProp)
16316 {
16317 exp->__anon1.member.memberType = 5;
16318 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16319 }
16320 else
16321 {
16322 char structName[1024];
16323 struct Identifier * id = exp->__anon1.member.member;
16324 struct Expression * classExp = exp->__anon1.member.exp;
16325
16326 type->refCount++;
16327 FreeType(classExp->expType);
16328 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16329 strcpy(structName, "__ecereClassData_");
16330 FullClassNameCat(structName, type->__anon1._class->string, 0);
16331 exp->type = 9;
16332 exp->__anon1.member.member = id;
16333 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"))))))));
16334 FreeType(type);
16335 ProcessExpressionType(exp);
16336 return ;
16337 }
16338 }
16339 else
16340 {
16341 struct Symbol * classSym = FindClass(id->string);
16342
16343 if(classSym)
16344 {
16345 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16346
16347 if(convertClass)
16348 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16349 }
16350 }
16351 }
16352 if(exp->__anon1.member.exp->destType)
16353 FreeType(exp->__anon1.member.exp->destType);
16354 {
16355 if(method && !method->_class->symbol)
16356 method->_class->symbol = FindClass(method->_class->fullName);
16357 if(prop && !prop->_class->symbol)
16358 prop->_class->symbol = FindClass(prop->_class->fullName);
16359 exp->__anon1.member.exp->destType = __extension__ ({
16360 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16361
16362 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16363 });
16364 }
16365 if(prop)
16366 {
16367 exp->__anon1.member.memberType = 1;
16368 if(!prop->dataType)
16369 ProcessPropertyType(prop);
16370 exp->expType = prop->dataType;
16371 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16372 {
16373 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16374
16375 CopyTypeInto(type, exp->expType);
16376 type->refCount = 1;
16377 type->constant = 1;
16378 exp->expType = type;
16379 }
16380 else if(prop->dataType)
16381 prop->dataType->refCount++;
16382 }
16383 else if(member)
16384 {
16385 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16386 {
16387 FreeExpContents(exp);
16388 exp->type = 0;
16389 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16390 ProcessExpressionType(exp);
16391 return ;
16392 }
16393 exp->__anon1.member.memberType = 3;
16394 DeclareStruct(_class->fullName, 0);
16395 if(!member->dataType)
16396 {
16397 struct Context * context = SetupTemplatesContext(_class);
16398
16399 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16400 FinishTemplatesContext(context);
16401 }
16402 exp->expType = member->dataType;
16403 if(member->dataType)
16404 member->dataType->refCount++;
16405 }
16406 else if(revConvert)
16407 {
16408 exp->__anon1.member.memberType = 4;
16409 exp->expType = MkClassType(revConvert->_class->fullName);
16410 }
16411 else if(method)
16412 {
16413 {
16414 exp->__anon1.member.memberType = 2;
16415 }
16416 if(!method->dataType)
16417 ProcessMethodType(method);
16418 exp->expType = __extension__ ({
16419 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16420
16421 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16422 });
16423 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16424 exp->expType->__anon1.__anon3.usedClass = _class;
16425 }
16426 else if(!classProp)
16427 {
16428 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16429 {
16430 FreeExpContents(exp);
16431 exp->type = 0;
16432 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16433 FreeType(exp->expType);
16434 exp->expType = MkClassType("ecere::com::Class");
16435 return ;
16436 }
16437 yylloc = exp->__anon1.member.member->loc;
16438 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16439 if(inCompiler)
16440 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16441 }
16442 if(_class && exp->expType)
16443 {
16444 struct __ecereNameSpace__ecere__com__Class * tClass;
16445
16446 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16447 while(tClass && !tClass->templateClass)
16448 tClass = tClass->base;
16449 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16450 {
16451 int id = 0;
16452 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16453 struct __ecereNameSpace__ecere__com__Class * sClass;
16454
16455 for(sClass = tClass; sClass; sClass = sClass->base)
16456 {
16457 id = 0;
16458 if(sClass->templateClass)
16459 sClass = sClass->templateClass;
16460 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16461 {
16462 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16463 {
16464 for(sClass = sClass->base; sClass; sClass = sClass->base)
16465 id += sClass->templateParams.count;
16466 break;
16467 }
16468 id++;
16469 }
16470 if(curParam)
16471 break;
16472 }
16473 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16474 {
16475 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16476 struct Context * context = SetupTemplatesContext(tClass);
16477 unsigned int constant = exp->expType->constant;
16478
16479 FreeType(exp->expType);
16480 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16481 if(exp->expType->kind == 8 && constant)
16482 exp->expType->constant = 1;
16483 else if(exp->expType->kind == 13)
16484 {
16485 struct Type * t = exp->expType->__anon1.type;
16486
16487 while(t->kind == 13)
16488 t = t->__anon1.type;
16489 if(constant)
16490 t->constant = constant;
16491 }
16492 if(exp->expType)
16493 {
16494 if(exp->expType->kind == 21)
16495 {
16496 FreeType(exp->expType);
16497 exp->expType = ReplaceThisClassType(_class);
16498 }
16499 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16500 exp->expType->passAsTemplate = 1;
16501 if(!exp->destType)
16502 {
16503 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16504 if(exp->destType->kind == 8 && constant)
16505 exp->destType->constant = 1;
16506 else if(exp->destType->kind == 13)
16507 {
16508 struct Type * t = exp->destType->__anon1.type;
16509
16510 while(t->kind == 13)
16511 t = t->__anon1.type;
16512 if(constant)
16513 t->constant = constant;
16514 }
16515 if(exp->destType->kind == 21)
16516 {
16517 FreeType(exp->destType);
16518 exp->destType = ReplaceThisClassType(_class);
16519 }
16520 }
16521 }
16522 FinishTemplatesContext(context);
16523 }
16524 }
16525 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)
16526 {
16527 int id = 0;
16528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16529 struct __ecereNameSpace__ecere__com__Class * sClass;
16530
16531 for(sClass = tClass; sClass; sClass = sClass->base)
16532 {
16533 id = 0;
16534 if(sClass->templateClass)
16535 sClass = sClass->templateClass;
16536 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16537 {
16538 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16539 {
16540 for(sClass = sClass->base; sClass; sClass = sClass->base)
16541 id += sClass->templateParams.count;
16542 break;
16543 }
16544 id++;
16545 }
16546 if(curParam)
16547 break;
16548 }
16549 if(curParam)
16550 {
16551 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16552 struct Context * context = SetupTemplatesContext(tClass);
16553 struct Type * basicType;
16554
16555 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16556 if(basicType)
16557 {
16558 if(basicType->kind == 21)
16559 {
16560 FreeType(basicType);
16561 basicType = ReplaceThisClassType(_class);
16562 }
16563 FreeType(exp->expType);
16564 exp->expType = __extension__ ({
16565 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16566
16567 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16568 });
16569 if(!exp->destType)
16570 {
16571 exp->destType = exp->expType;
16572 exp->destType->refCount++;
16573 }
16574 {
16575 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16576 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16577 struct Declarator * decl;
16578
16579 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16580 *newExp = *exp;
16581 if(exp->destType)
16582 exp->destType->refCount++;
16583 if(exp->expType)
16584 exp->expType->refCount++;
16585 exp->type = 11;
16586 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16587 exp->__anon1.cast.exp = newExp;
16588 }
16589 }
16590 FinishTemplatesContext(context);
16591 }
16592 }
16593 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16594 {
16595 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16596
16597 if(expClass)
16598 {
16599 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16600 int p = 0;
16601 int paramCount = 0;
16602 int lastParam = -1;
16603 char templateString[1024];
16604 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16605
16606 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16607 while(cClass != expClass)
16608 {
16609 struct __ecereNameSpace__ecere__com__Class * sClass;
16610
16611 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16612 ;
16613 cClass = sClass;
16614 for(param = cClass->templateParams.first; param; param = param->next)
16615 {
16616 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16617 int cp = 0;
16618 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16619 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16620
16621 while(cClassCur != tClass && !paramCur)
16622 {
16623 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16624
16625 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16626 ;
16627 cClassCur = sClassCur;
16628 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16629 {
16630 if(!strcmp(paramCur->name, param->name))
16631 {
16632 break;
16633 }
16634 cp++;
16635 }
16636 }
16637 if(paramCur && paramCur->type == 0)
16638 arg = tClass->templateArgs[cp];
16639 else
16640 arg = expClass->templateArgs[p];
16641 {
16642 char argument[256];
16643
16644 argument[0] = '\0';
16645 switch(param->type)
16646 {
16647 case 2:
16648 {
16649 char expString[1024];
16650 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16651 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16652 struct Expression * exp;
16653 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16654
16655 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16656 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16657 ProcessExpressionType(exp);
16658 ComputeExpression(exp);
16659 expString[0] = '\0';
16660 PrintExpression(exp, expString);
16661 strcat(argument, expString);
16662 FreeExpression(exp);
16663 break;
16664 }
16665 case 1:
16666 {
16667 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16668 break;
16669 }
16670 case 0:
16671 {
16672 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16673 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16674 break;
16675 }
16676 }
16677 if(argument[0])
16678 {
16679 if(paramCount)
16680 strcat(templateString, ", ");
16681 if(lastParam != p - 1)
16682 {
16683 strcat(templateString, param->name);
16684 strcat(templateString, " = ");
16685 }
16686 strcat(templateString, argument);
16687 paramCount++;
16688 lastParam = p;
16689 }
16690 }
16691 p++;
16692 }
16693 }
16694 {
16695 int len = strlen(templateString);
16696
16697 if(templateString[len - 1] == '>')
16698 templateString[len++] = ' ';
16699 templateString[len++] = '>';
16700 templateString[len++] = '\0';
16701 }
16702 FreeType(exp->expType);
16703 {
16704 struct Context * context = SetupTemplatesContext(tClass);
16705
16706 exp->expType = ProcessTypeString(templateString, 0);
16707 FinishTemplatesContext(context);
16708 }
16709 }
16710 }
16711 }
16712 }
16713 else
16714 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)");
16715 }
16716 else if(type && (type->kind == 9 || type->kind == 10))
16717 {
16718 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16719
16720 if(memberType)
16721 {
16722 exp->expType = memberType;
16723 if(memberType)
16724 memberType->refCount++;
16725 }
16726 }
16727 else
16728 {
16729 char expString[10240];
16730
16731 expString[0] = '\0';
16732 if(inCompiler)
16733 {
16734 PrintExpression(exp, expString);
16735 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16736 }
16737 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16738 }
16739 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16740 {
16741 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16742 {
16743 struct Identifier * id = exp->__anon1.member.member;
16744 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));
16745
16746 if(_class)
16747 {
16748 FreeType(exp->expType);
16749 exp->expType = ReplaceThisClassType(_class);
16750 }
16751 }
16752 }
16753 yylloc = oldyylloc;
16754 break;
16755 }
16756 case 9:
16757 {
16758 struct Type * destType = exp->destType;
16759
16760 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16761 {
16762 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16763 }
16764 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16765 exp->type = 8;
16766 if(destType)
16767 destType->count++;
16768 ProcessExpressionType(exp);
16769 if(destType)
16770 destType->count--;
16771 break;
16772 }
16773 case 15:
16774 {
16775 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16776
16777 if(classSym && classSym->__anon1.registered)
16778 {
16779 if(classSym->__anon1.registered->type == 5)
16780 {
16781 char name[1024];
16782
16783 name[0] = '\0';
16784 DeclareStruct(classSym->string, 0);
16785 FreeSpecifier(exp->__anon1._class);
16786 exp->type = 10;
16787 FullClassNameCat(name, classSym->string, 0);
16788 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16789 }
16790 else
16791 {
16792 if(classSym->__anon1.registered->fixed)
16793 {
16794 FreeSpecifier(exp->__anon1._class);
16795 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16796 exp->type = 2;
16797 }
16798 else
16799 {
16800 char className[1024];
16801
16802 strcpy(className, "__ecereClass_");
16803 FullClassNameCat(className, classSym->string, 1);
16804 DeclareClass(classSym, className);
16805 FreeExpContents(exp);
16806 exp->type = 9;
16807 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16808 exp->__anon1.member.member = MkIdentifier("structSize");
16809 }
16810 }
16811 }
16812 exp->expType = __extension__ ({
16813 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16814
16815 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16816 });
16817 break;
16818 }
16819 case 10:
16820 {
16821 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16822
16823 exp->expType = __extension__ ({
16824 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16825
16826 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16827 });
16828 exp->isConstant = 1;
16829 DeclareType(type, 0, 0);
16830 FreeType(type);
16831 break;
16832 }
16833 case 11:
16834 {
16835 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16836
16837 type->count = 1;
16838 FreeType(exp->__anon1.cast.exp->destType);
16839 exp->__anon1.cast.exp->destType = type;
16840 type->refCount++;
16841 type->casted = 1;
16842 ProcessExpressionType(exp->__anon1.cast.exp);
16843 type->casted = 0;
16844 type->count = 0;
16845 exp->expType = type;
16846 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16847 {
16848 void * prev = exp->prev, * next = exp->next;
16849 struct Type * expType = exp->__anon1.cast.exp->destType;
16850 struct Expression * castExp = exp->__anon1.cast.exp;
16851 struct Type * destType = exp->destType;
16852
16853 if(expType)
16854 expType->refCount++;
16855 FreeType(exp->expType);
16856 FreeTypeName(exp->__anon1.cast.typeName);
16857 *exp = *castExp;
16858 FreeType(exp->expType);
16859 FreeType(exp->destType);
16860 exp->expType = expType;
16861 exp->destType = destType;
16862 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16863 exp->prev = prev;
16864 exp->next = next;
16865 }
16866 else
16867 {
16868 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16869 }
16870 break;
16871 }
16872 case 33:
16873 {
16874 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16875
16876 exp->expType = type;
16877 break;
16878 }
16879 case 34:
16880 {
16881 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16882
16883 ProcessExpressionType(exp->__anon1.vaArg.exp);
16884 exp->expType = type;
16885 break;
16886 }
16887 case 12:
16888 {
16889 struct Expression * e;
16890
16891 exp->isConstant = 1;
16892 FreeType(exp->__anon1.cond.cond->destType);
16893 exp->__anon1.cond.cond->destType = MkClassType("bool");
16894 exp->__anon1.cond.cond->destType->truth = 1;
16895 ProcessExpressionType(exp->__anon1.cond.cond);
16896 if(!exp->__anon1.cond.cond->isConstant)
16897 exp->isConstant = 0;
16898 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16899 {
16900 if(!e->next)
16901 {
16902 FreeType(e->destType);
16903 e->destType = exp->destType;
16904 if(e->destType)
16905 e->destType->refCount++;
16906 }
16907 ProcessExpressionType(e);
16908 if(!e->next)
16909 {
16910 exp->expType = e->expType;
16911 if(e->expType)
16912 e->expType->refCount++;
16913 }
16914 if(!e->isConstant)
16915 exp->isConstant = 0;
16916 }
16917 FreeType(exp->__anon1.cond.elseExp->destType);
16918 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16919 if(exp->__anon1.cond.elseExp->destType)
16920 exp->__anon1.cond.elseExp->destType->refCount++;
16921 ProcessExpressionType(exp->__anon1.cond.elseExp);
16922 if(!exp->__anon1.cond.elseExp->isConstant)
16923 exp->isConstant = 0;
16924 break;
16925 }
16926 case 23:
16927 {
16928 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16929 {
16930 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16931
16932 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16933 {
16934 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16935 if(exp->destType)
16936 exp->destType->refCount++;
16937 }
16938 ProcessStatement(exp->__anon1.compound);
16939 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16940 if(exp->expType)
16941 exp->expType->refCount++;
16942 }
16943 break;
16944 }
16945 case 24:
16946 {
16947 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16948
16949 if(spec && spec->type == 1)
16950 {
16951 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16952 exp->expType->kind = 19;
16953 exp->byReference = 1;
16954 }
16955 else
16956 {
16957 exp->expType = MkClassType("ecere::com::Class");
16958 exp->byReference = 1;
16959 }
16960 break;
16961 }
16962 case 25:
16963 {
16964 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16965
16966 if(_class)
16967 {
16968 struct Identifier * id = exp->__anon1.classData.id;
16969 char structName[1024];
16970 struct Expression * classExp;
16971
16972 strcpy(structName, "__ecereClassData_");
16973 FullClassNameCat(structName, _class->fullName, 0);
16974 exp->type = 9;
16975 exp->__anon1.member.member = id;
16976 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16977 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16978 else
16979 classExp = MkExpIdentifier(MkIdentifier("class"));
16980 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"))))))));
16981 ProcessExpressionType(exp);
16982 return ;
16983 }
16984 break;
16985 }
16986 case 35:
16987 {
16988 struct Type * type = (((void *)0));
16989 const char * typeString = (((void *)0));
16990 char typeStringBuf[1024];
16991
16992 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))
16993 {
16994 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16995
16996 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16997 }
16998 else if(exp->__anon1.list)
16999 {
17000 struct Expression * e;
17001
17002 for(e = (*exp->__anon1.list).first; e; e = e->next)
17003 {
17004 ProcessExpressionType(e);
17005 if(e->expType)
17006 {
17007 if(!type)
17008 {
17009 type = e->expType;
17010 type->refCount++;
17011 }
17012 else
17013 {
17014 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17015 {
17016 FreeType(type);
17017 type = e->expType;
17018 e->expType = (((void *)0));
17019 e = (*exp->__anon1.list).first;
17020 ProcessExpressionType(e);
17021 if(e->expType)
17022 {
17023 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17024 {
17025 FreeType(e->expType);
17026 e->expType = (((void *)0));
17027 FreeType(type);
17028 type = (((void *)0));
17029 break;
17030 }
17031 }
17032 }
17033 }
17034 if(e->expType)
17035 {
17036 FreeType(e->expType);
17037 e->expType = (((void *)0));
17038 }
17039 }
17040 }
17041 if(type)
17042 {
17043 typeStringBuf[0] = '\0';
17044 PrintTypeNoConst(type, typeStringBuf, 0, 1);
17045 typeString = typeStringBuf;
17046 FreeType(type);
17047 type = (((void *)0));
17048 }
17049 }
17050 if(typeString)
17051 {
17052 char templateString[1024];
17053 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17054 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
17055 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17056 struct Expression * expExt;
17057 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17058
17059 sprintf(templateString, "Container<%s>", typeString);
17060 if(exp->__anon1.list)
17061 {
17062 struct Expression * e;
17063
17064 type = ProcessTypeString(typeString, 0);
17065 while((e = (*exp->__anon1.list).first))
17066 {
17067 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17068 e->destType = type;
17069 type->refCount++;
17070 ProcessExpressionType(e);
17071 ListAdd(initializers, MkInitializerAssignment(e));
17072 }
17073 FreeType(type);
17074 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17075 }
17076 DeclareStruct("ecere::com::BuiltInContainer", 0);
17077 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17078 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17079 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17080 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17081 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17082 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17083 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17084 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17085 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17086 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17087
17088 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
17089 })));
17090 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17091 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
17092 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17093 exp->expType = ProcessTypeString(templateString, 0);
17094 exp->type = 5;
17095 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17096 ProcessExpressionType(expExt);
17097 }
17098 else
17099 {
17100 exp->expType = ProcessTypeString("Container", 0);
17101 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17102 }
17103 break;
17104 }
17105 }
17106 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17107 {
17108 FreeType(exp->expType);
17109 exp->expType = ReplaceThisClassType(thisClass);
17110 }
17111 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)
17112 {
17113 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17114
17115 if(symbol)
17116 {
17117 if(exp->expType->kind != 15)
17118 {
17119 struct Type * member;
17120 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17121
17122 FreeType(exp->expType);
17123 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17124 exp->expType->kind = symbol->type->kind;
17125 exp->expType->refCount++;
17126 exp->expType->__anon1.__anon1.enumName = enumName;
17127 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17128 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17129 member->refCount++;
17130 }
17131 else
17132 {
17133 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17134
17135 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17136 {
17137 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17138
17139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17140 }
17141 }
17142 }
17143 }
17144 yylloc = exp->loc;
17145 if(exp->destType && (exp->destType->kind == 18))
17146 ;
17147 else if(exp->destType && !exp->destType->keepCast)
17148 {
17149 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17150 exp->needTemplateCast = 1;
17151 if(exp->destType->kind == 0)
17152 ;
17153 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17154 {
17155 if(!exp->destType->count || unresolved)
17156 {
17157 if(!exp->expType)
17158 {
17159 yylloc = exp->loc;
17160 if(exp->destType->kind != 14)
17161 {
17162 char type2[1024];
17163
17164 type2[0] = '\0';
17165 if(inCompiler)
17166 {
17167 char expString[10240];
17168
17169 expString[0] = '\0';
17170 PrintType(exp->destType, type2, 0, 1);
17171 if(inCompiler)
17172 {
17173 PrintExpression(exp, expString);
17174 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17175 }
17176 if(unresolved)
17177 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17178 else if(exp->type != 16)
17179 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17180 }
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(unresolved)
17193 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17194 else if(exp->type != 16)
17195 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17196 }
17197 }
17198 else
17199 {
17200 char type1[1024];
17201 char type2[1024];
17202
17203 type1[0] = '\0';
17204 type2[0] = '\0';
17205 if(inCompiler)
17206 {
17207 PrintType(exp->expType, type1, 0, 1);
17208 PrintType(exp->destType, type2, 0, 1);
17209 }
17210 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)))
17211 ;
17212 else
17213 {
17214 char expString[10240];
17215
17216 expString[0] = '\0';
17217 if(inCompiler)
17218 {
17219 PrintExpression(exp, expString);
17220 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17221 }
17222 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")))
17223 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17224 FreeType(exp->expType);
17225 exp->destType->refCount++;
17226 exp->expType = exp->destType;
17227 }
17228 }
17229 }
17230 }
17231 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))
17232 {
17233 struct Expression * nbExp = GetNonBracketsExp(exp);
17234
17235 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
17236 {
17237 struct Expression * e = MoveExpContents(exp);
17238
17239 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
17240 exp->type = 11;
17241 exp->__anon1.cast.exp->destType = exp->destType;
17242 if(exp->destType)
17243 exp->destType->refCount++;
17244 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
17245 }
17246 }
17247 }
17248 else if(unresolved)
17249 {
17250 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17251 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);
17252 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17253 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17254 }
17255 else if(!exp->expType && exp->type != 16)
17256 {
17257 char expString[10240];
17258
17259 expString[0] = '\0';
17260 if(inCompiler)
17261 {
17262 PrintExpression(exp, expString);
17263 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17264 }
17265 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17266 }
17267 if(inCompiler)
17268 ApplyAnyObjectLogic(exp);
17269 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)))
17270 {
17271 exp->byReference = 1;
17272 }
17273 yylloc = oldyylloc;
17274 }
17275
17276 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)
17277 {
17278 if(*curMember)
17279 {
17280 *curMember = (*curMember)->next;
17281 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17282 {
17283 *curMember = subMemberStack[--(*subMemberStackPos)];
17284 *curMember = (*curMember)->next;
17285 }
17286 while((*curMember) && (*curMember)->isProperty)
17287 *curMember = (*curMember)->next;
17288 if(subMemberStackPos)
17289 {
17290 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17291 {
17292 subMemberStack[(*subMemberStackPos)++] = *curMember;
17293 *curMember = (*curMember)->members.first;
17294 while(*curMember && (*curMember)->isProperty)
17295 *curMember = (*curMember)->next;
17296 }
17297 }
17298 }
17299 while(!*curMember)
17300 {
17301 if(!*curMember)
17302 {
17303 if(subMemberStackPos && *subMemberStackPos)
17304 {
17305 *curMember = subMemberStack[--(*subMemberStackPos)];
17306 *curMember = (*curMember)->next;
17307 }
17308 else
17309 {
17310 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17311
17312 if(*curClass == _class)
17313 break;
17314 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17315 ;
17316 *curMember = (*curClass)->membersAndProperties.first;
17317 }
17318 while((*curMember) && (*curMember)->isProperty)
17319 *curMember = (*curMember)->next;
17320 if(subMemberStackPos)
17321 {
17322 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17323 {
17324 subMemberStack[(*subMemberStackPos)++] = *curMember;
17325 *curMember = (*curMember)->members.first;
17326 while(*curMember && (*curMember)->isProperty)
17327 *curMember = (*curMember)->next;
17328 }
17329 }
17330 }
17331 }
17332 }
17333
17334 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17335 {
17336 switch(init->type)
17337 {
17338 case 0:
17339 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17340 {
17341 if(init->__anon1.exp && !init->__anon1.exp->destType)
17342 {
17343 FreeType(init->__anon1.exp->destType);
17344 init->__anon1.exp->destType = type;
17345 if(type)
17346 type->refCount++;
17347 }
17348 if(init->__anon1.exp)
17349 {
17350 ProcessExpressionType(init->__anon1.exp);
17351 init->isConstant = init->__anon1.exp->isConstant;
17352 }
17353 break;
17354 }
17355 else
17356 {
17357 struct Expression * exp = init->__anon1.exp;
17358 struct Instantiation * inst = exp->__anon1.instance;
17359 struct MembersInit * members;
17360
17361 init->type = 1;
17362 init->__anon1.list = MkList();
17363 if(inst->members)
17364 {
17365 for(members = (*inst->members).first; members; members = members->next)
17366 {
17367 if(members->type == 0)
17368 {
17369 struct MemberInit * member;
17370
17371 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17372 {
17373 ListAdd(init->__anon1.list, member->initializer);
17374 member->initializer = (((void *)0));
17375 }
17376 }
17377 }
17378 }
17379 FreeExpression(exp);
17380 }
17381 case 1:
17382 {
17383 struct Initializer * i;
17384 struct Type * initializerType = (((void *)0));
17385 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17386 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17387 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17388 int subMemberStackPos = 0;
17389
17390 if(type && type->kind == 12)
17391 initializerType = Dereference(type);
17392 else if(type && (type->kind == 9 || type->kind == 10))
17393 initializerType = type->__anon1.__anon1.members.first;
17394 for(i = (*init->__anon1.list).first; i; i = i->next)
17395 {
17396 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17397 {
17398 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17399 if(curMember)
17400 {
17401 if(!curMember->dataType)
17402 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17403 initializerType = curMember->dataType;
17404 }
17405 }
17406 ProcessInitializer(i, initializerType);
17407 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17408 initializerType = initializerType->next;
17409 if(!i->isConstant)
17410 init->isConstant = 0;
17411 }
17412 if(type && type->kind == 12)
17413 FreeType(initializerType);
17414 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))
17415 {
17416 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17417 }
17418 break;
17419 }
17420 }
17421 }
17422
17423 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17424
17425 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17426
17427 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17428 {
17429 switch(spec->type)
17430 {
17431 case 0:
17432 {
17433 if(spec->__anon1.specifier == THISCLASS)
17434 {
17435 if(thisClass)
17436 {
17437 spec->type = 1;
17438 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17439 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17440 ProcessSpecifier(spec, declareStruct);
17441 }
17442 }
17443 break;
17444 }
17445 case 1:
17446 {
17447 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17448
17449 if(symbol)
17450 DeclareType(symbol->type, 1, 1);
17451 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17452 DeclareStruct(spec->__anon1.__anon1.name, 0);
17453 break;
17454 }
17455 case 2:
17456 {
17457 struct Enumerator * e;
17458
17459 if(spec->__anon1.__anon2.list)
17460 {
17461 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17462 {
17463 if(e->exp)
17464 ProcessExpressionType(e->exp);
17465 }
17466 }
17467 if(inCompiler)
17468 break;
17469 }
17470 case 3:
17471 case 4:
17472 {
17473 if(spec->__anon1.__anon2.definitions)
17474 {
17475 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17476
17477 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17478 }
17479 break;
17480 }
17481 }
17482 }
17483
17484 static void ProcessDeclarator(struct Declarator * decl)
17485 {
17486 switch(decl->type)
17487 {
17488 case 1:
17489 if(decl->__anon1.identifier->classSym)
17490 {
17491 FreeSpecifier(decl->__anon1.identifier->_class);
17492 decl->__anon1.identifier->_class = (((void *)0));
17493 }
17494 break;
17495 case 3:
17496 if(decl->__anon1.array.exp)
17497 ProcessExpressionType(decl->__anon1.array.exp);
17498 case 0:
17499 case 2:
17500 case 4:
17501 case 5:
17502 case 6:
17503 case 7:
17504 if(decl->declarator)
17505 ProcessDeclarator(decl->declarator);
17506 if(decl->type == 4)
17507 {
17508 struct Identifier * id = GetDeclId(decl);
17509
17510 if(id && id->_class)
17511 {
17512 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17513
17514 if(!decl->__anon1.function.parameters)
17515 decl->__anon1.function.parameters = MkList();
17516 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17517 id->_class = (((void *)0));
17518 }
17519 if(decl->__anon1.function.parameters)
17520 {
17521 struct TypeName * param;
17522
17523 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17524 {
17525 if(param->qualifiers && (*param->qualifiers).first)
17526 {
17527 struct Specifier * spec = (*param->qualifiers).first;
17528
17529 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17530 {
17531 struct Declarator * d = param->declarator;
17532 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);
17533
17534 if(d->type != 5)
17535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17536 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17537 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17538 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17540 param = newParam;
17541 }
17542 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17543 {
17544 struct Declarator * d = param->declarator;
17545
17546 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17547 param->qualifiers = MkListOne(MkSpecifier(VOID));
17548 if(d->type != 5)
17549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17550 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17551 }
17552 else if(spec->__anon1.specifier == THISCLASS)
17553 {
17554 if(thisClass)
17555 {
17556 spec->type = 1;
17557 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17558 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17559 ProcessSpecifier(spec, 0);
17560 }
17561 }
17562 }
17563 if(param->declarator)
17564 ProcessDeclarator(param->declarator);
17565 }
17566 }
17567 }
17568 break;
17569 }
17570 }
17571
17572 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17573
17574 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17575
17576 static void ProcessDeclaration(struct Declaration * decl)
17577 {
17578 yylloc = decl->loc;
17579 switch(decl->type)
17580 {
17581 case 1:
17582 {
17583 unsigned int declareStruct = 0;
17584
17585 if(decl->__anon1.__anon1.declarators)
17586 {
17587 struct InitDeclarator * d;
17588
17589 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17590 {
17591 struct Type * type, * subType;
17592
17593 ProcessDeclarator(d->declarator);
17594 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17595 if(d->initializer)
17596 {
17597 ProcessInitializer(d->initializer, type);
17598 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17599 {
17600 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17601 {
17602 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17603
17604 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17605 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17606 if(decl->__anon1.__anon1.specifiers)
17607 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
17608 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
17609 d = (((void *)0));
17610 decl->type = 2;
17611 decl->__anon1.inst = inst;
17612 }
17613 }
17614 }
17615 for(subType = type; subType; )
17616 {
17617 if(subType->kind == 8)
17618 {
17619 declareStruct = 1;
17620 break;
17621 }
17622 else if(subType->kind == 13)
17623 break;
17624 else if(subType->kind == 12)
17625 subType = subType->__anon1.__anon4.arrayType;
17626 else
17627 break;
17628 }
17629 FreeType(type);
17630 if(!d)
17631 break;
17632 }
17633 }
17634 if(decl->__anon1.__anon1.specifiers)
17635 {
17636 struct Specifier * s;
17637
17638 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17639 {
17640 ProcessSpecifier(s, declareStruct);
17641 }
17642 }
17643 break;
17644 }
17645 case 2:
17646 {
17647 ProcessInstantiationType(decl->__anon1.inst);
17648 break;
17649 }
17650 case 0:
17651 {
17652 struct Specifier * spec;
17653 struct Declarator * d;
17654 unsigned int declareStruct = 0;
17655
17656 if(decl->__anon1.__anon1.declarators)
17657 {
17658 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17659 {
17660 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17661 struct Type * subType;
17662
17663 ProcessDeclarator(d);
17664 for(subType = type; subType; )
17665 {
17666 if(subType->kind == 8)
17667 {
17668 declareStruct = 1;
17669 break;
17670 }
17671 else if(subType->kind == 13)
17672 break;
17673 else if(subType->kind == 12)
17674 subType = subType->__anon1.__anon4.arrayType;
17675 else
17676 break;
17677 }
17678 FreeType(type);
17679 }
17680 }
17681 if(decl->__anon1.__anon1.specifiers)
17682 {
17683 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17684 ProcessSpecifier(spec, declareStruct);
17685 }
17686 break;
17687 }
17688 }
17689 }
17690
17691 static struct FunctionDefinition * curFunction;
17692
17693 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17694 {
17695 char propName[1024], propNameM[1024];
17696 char getName[1024], setName[1024];
17697 struct __ecereNameSpace__ecere__sys__OldList * args;
17698
17699 DeclareProperty(prop, setName, getName);
17700 strcpy(propName, "__ecereProp_");
17701 FullClassNameCat(propName, prop->_class->fullName, 0);
17702 strcat(propName, "_");
17703 FullClassNameCat(propName, prop->name, 1);
17704 strcpy(propNameM, "__ecerePropM_");
17705 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17706 strcat(propNameM, "_");
17707 FullClassNameCat(propNameM, prop->name, 1);
17708 if(prop->isWatchable)
17709 {
17710 args = MkList();
17711 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17712 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17713 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17714 args = MkList();
17715 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17716 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17717 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17718 }
17719 {
17720 args = MkList();
17721 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17722 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17723 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17724 args = MkList();
17725 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17726 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17727 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17728 }
17729 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17730 curFunction->propSet->fireWatchersDone = 1;
17731 }
17732
17733 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17734
17735 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17736
17737 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17738
17739 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17740
17741 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17742
17743 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17744
17745 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17746
17747 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17748
17749 static void ProcessStatement(struct Statement * stmt)
17750 {
17751 yylloc = stmt->loc;
17752 switch(stmt->type)
17753 {
17754 case 0:
17755 ProcessStatement(stmt->__anon1.labeled.stmt);
17756 break;
17757 case 1:
17758 if(stmt->__anon1.caseStmt.exp)
17759 {
17760 FreeType(stmt->__anon1.caseStmt.exp->destType);
17761 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17762 if(curSwitchType)
17763 curSwitchType->refCount++;
17764 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17765 ComputeExpression(stmt->__anon1.caseStmt.exp);
17766 }
17767 if(stmt->__anon1.caseStmt.stmt)
17768 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17769 break;
17770 case 2:
17771 {
17772 if(stmt->__anon1.compound.context)
17773 {
17774 struct Declaration * decl;
17775 struct Statement * s;
17776 struct Statement * prevCompound = curCompound;
17777 struct Context * prevContext = curContext;
17778
17779 if(!stmt->__anon1.compound.isSwitch)
17780 curCompound = stmt;
17781 curContext = stmt->__anon1.compound.context;
17782 if(stmt->__anon1.compound.declarations)
17783 {
17784 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17785 ProcessDeclaration(decl);
17786 }
17787 if(stmt->__anon1.compound.statements)
17788 {
17789 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17790 ProcessStatement(s);
17791 }
17792 curContext = prevContext;
17793 curCompound = prevCompound;
17794 }
17795 break;
17796 }
17797 case 3:
17798 {
17799 struct Expression * exp;
17800
17801 if(stmt->__anon1.expressions)
17802 {
17803 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17804 ProcessExpressionType(exp);
17805 }
17806 break;
17807 }
17808 case 4:
17809 {
17810 struct Expression * exp;
17811
17812 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17813 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17814 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17815 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17816 {
17817 ProcessExpressionType(exp);
17818 }
17819 if(stmt->__anon1.ifStmt.stmt)
17820 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17821 if(stmt->__anon1.ifStmt.elseStmt)
17822 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17823 break;
17824 }
17825 case 5:
17826 {
17827 struct Type * oldSwitchType = curSwitchType;
17828
17829 if(stmt->__anon1.switchStmt.exp)
17830 {
17831 struct Expression * exp;
17832
17833 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17834 {
17835 if(!exp->next)
17836 {
17837 ProcessExpressionType(exp);
17838 }
17839 if(!exp->next)
17840 curSwitchType = exp->expType;
17841 }
17842 }
17843 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17844 curSwitchType = oldSwitchType;
17845 break;
17846 }
17847 case 6:
17848 {
17849 if(stmt->__anon1.whileStmt.exp)
17850 {
17851 struct Expression * exp;
17852
17853 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17854 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17855 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17856 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17857 {
17858 ProcessExpressionType(exp);
17859 }
17860 }
17861 if(stmt->__anon1.whileStmt.stmt)
17862 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17863 break;
17864 }
17865 case 7:
17866 {
17867 if(stmt->__anon1.doWhile.exp)
17868 {
17869 struct Expression * exp;
17870
17871 if((*stmt->__anon1.doWhile.exp).last)
17872 {
17873 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17874 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17875 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17876 }
17877 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17878 {
17879 ProcessExpressionType(exp);
17880 }
17881 }
17882 if(stmt->__anon1.doWhile.stmt)
17883 ProcessStatement(stmt->__anon1.doWhile.stmt);
17884 break;
17885 }
17886 case 8:
17887 {
17888 struct Expression * exp;
17889
17890 if(stmt->__anon1.forStmt.init)
17891 ProcessStatement(stmt->__anon1.forStmt.init);
17892 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17893 {
17894 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17895 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17896 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17897 }
17898 if(stmt->__anon1.forStmt.check)
17899 ProcessStatement(stmt->__anon1.forStmt.check);
17900 if(stmt->__anon1.forStmt.increment)
17901 {
17902 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17903 ProcessExpressionType(exp);
17904 }
17905 if(stmt->__anon1.forStmt.stmt)
17906 ProcessStatement(stmt->__anon1.forStmt.stmt);
17907 break;
17908 }
17909 case 18:
17910 {
17911 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17912 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17913 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17914 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17915 char iteratorType[1024];
17916 struct Type * source;
17917 struct Expression * e;
17918 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));
17919 struct Expression * arrayExp;
17920 const char * typeString = (((void *)0));
17921 int builtinCount = 0;
17922
17923 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17924 {
17925 if(!e->next)
17926 {
17927 FreeType(e->destType);
17928 e->destType = ProcessTypeString("Container", 0);
17929 }
17930 if(!isBuiltin || e->next)
17931 ProcessExpressionType(e);
17932 }
17933 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17934 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)))
17935 {
17936 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17937 struct Symbol * symbol;
17938 struct Expression * expIt = (((void *)0));
17939 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17940 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17941 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17942 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17943
17944 if(inCompiler)
17945 {
17946 stmt->type = 2;
17947 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17948 stmt->__anon1.compound.context->parent = curContext;
17949 curContext = stmt->__anon1.compound.context;
17950 }
17951 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17952 {
17953 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17954
17955 isCustomAVLTree = 1;
17956 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17957 isMap = 1;
17958 }
17959 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17960 isArray = 1;
17961 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17962 {
17963 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17964
17965 isLinkList = 1;
17966 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17967 }
17968 if(inCompiler && isArray)
17969 {
17970 struct Declarator * decl;
17971 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17972
17973 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17974 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17975 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17976 }
17977 else if(isBuiltin)
17978 {
17979 struct Type * type = (((void *)0));
17980 char typeStringBuf[1024];
17981
17982 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17983 if(((struct Expression *)(*exp).last)->type == 11)
17984 {
17985 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17986
17987 if(typeName)
17988 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17989 }
17990 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)
17991 {
17992 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17993
17994 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17995 }
17996 else if(arrayExp->__anon1.list)
17997 {
17998 struct Expression * e;
17999
18000 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
18001 {
18002 ProcessExpressionType(e);
18003 if(e->expType)
18004 {
18005 if(!type)
18006 {
18007 type = e->expType;
18008 type->refCount++;
18009 }
18010 else
18011 {
18012 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18013 {
18014 FreeType(type);
18015 type = e->expType;
18016 e->expType = (((void *)0));
18017 e = (*arrayExp->__anon1.list).first;
18018 ProcessExpressionType(e);
18019 if(e->expType)
18020 {
18021 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18022 {
18023 FreeType(e->expType);
18024 e->expType = (((void *)0));
18025 FreeType(type);
18026 type = (((void *)0));
18027 break;
18028 }
18029 }
18030 }
18031 }
18032 if(e->expType)
18033 {
18034 FreeType(e->expType);
18035 e->expType = (((void *)0));
18036 }
18037 }
18038 }
18039 if(type)
18040 {
18041 typeStringBuf[0] = '\0';
18042 PrintType(type, typeStringBuf, 0, 1);
18043 typeString = typeStringBuf;
18044 FreeType(type);
18045 }
18046 }
18047 if(typeString)
18048 {
18049 if(inCompiler)
18050 {
18051 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18052 struct Declarator * decl;
18053 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18054
18055 if(arrayExp->__anon1.list)
18056 {
18057 struct Expression * e;
18058
18059 builtinCount = (*arrayExp->__anon1.list).count;
18060 type = ProcessTypeString(typeString, 0);
18061 while((e = (*arrayExp->__anon1.list).first))
18062 {
18063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
18064 e->destType = type;
18065 type->refCount++;
18066 ProcessExpressionType(e);
18067 if(inCompiler)
18068 ListAdd(initializers, MkInitializerAssignment(e));
18069 }
18070 FreeType(type);
18071 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
18072 }
18073 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
18074 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
18075 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
18076 FreeList(exp, (void *)(FreeExpression));
18077 }
18078 else if(arrayExp->__anon1.list)
18079 {
18080 struct Expression * e;
18081
18082 type = ProcessTypeString(typeString, 0);
18083 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
18084 {
18085 e->destType = type;
18086 type->refCount++;
18087 ProcessExpressionType(e);
18088 }
18089 FreeType(type);
18090 }
18091 }
18092 else
18093 {
18094 arrayExp->expType = ProcessTypeString("Container", 0);
18095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18096 }
18097 }
18098 else if(inCompiler && isLinkList && !isList)
18099 {
18100 struct Declarator * decl;
18101 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18102
18103 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18104 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18105 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18106 }
18107 else if(inCompiler && _class->templateArgs)
18108 {
18109 if(isMap)
18110 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18111 else
18112 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18113 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)))))))));
18114 }
18115 if(inCompiler)
18116 {
18117 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18118 if(block)
18119 {
18120 switch(block->type)
18121 {
18122 case 2:
18123 if(block->__anon1.compound.context)
18124 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18125 break;
18126 case 4:
18127 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18128 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18129 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18130 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18131 break;
18132 case 5:
18133 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18134 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18135 break;
18136 case 6:
18137 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18138 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18139 break;
18140 case 7:
18141 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18142 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18143 break;
18144 case 8:
18145 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18146 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18147 break;
18148 case 18:
18149 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18150 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18151 break;
18152 }
18153 }
18154 if(filter)
18155 {
18156 block = MkIfStmt(filter, block, (((void *)0)));
18157 }
18158 if(isArray)
18159 {
18160 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));
18161 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18162 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18163 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18164 }
18165 else if(isBuiltin)
18166 {
18167 char count[128];
18168
18169 sprintf(count, "%d", builtinCount);
18170 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));
18171 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18172 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18173 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18174 }
18175 else if(isLinkList && !isList)
18176 {
18177 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18178 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18179
18180 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18181 {
18182 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));
18183 }
18184 else
18185 {
18186 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18187 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18188
18189 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));
18190 }
18191 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18192 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18193 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18194 }
18195 else
18196 {
18197 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18198 }
18199 ProcessExpressionType(expIt);
18200 if((*stmt->__anon1.compound.declarations).first)
18201 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18202 if(symbol)
18203 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18204 ProcessStatement(stmt);
18205 }
18206 else
18207 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
18208 if(inCompiler)
18209 curContext = stmt->__anon1.compound.context->parent;
18210 break;
18211 }
18212 else
18213 {
18214 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18215 }
18216 break;
18217 }
18218 case 9:
18219 break;
18220 case 10:
18221 break;
18222 case 11:
18223 break;
18224 case 12:
18225 {
18226 struct Expression * exp;
18227
18228 if(stmt->__anon1.expressions)
18229 {
18230 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18231 {
18232 if(!exp->next)
18233 {
18234 if(curFunction && !curFunction->type)
18235 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18236 FreeType(exp->destType);
18237 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18238 if(exp->destType)
18239 exp->destType->refCount++;
18240 }
18241 ProcessExpressionType(exp);
18242 }
18243 }
18244 break;
18245 }
18246 case 14:
18247 {
18248 ProcessDeclaration(stmt->__anon1.decl);
18249 break;
18250 }
18251 case 13:
18252 {
18253 struct AsmField * field;
18254
18255 if(stmt->__anon1.asmStmt.inputFields)
18256 {
18257 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18258 if(field->expression)
18259 ProcessExpressionType(field->expression);
18260 }
18261 if(stmt->__anon1.asmStmt.outputFields)
18262 {
18263 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18264 if(field->expression)
18265 ProcessExpressionType(field->expression);
18266 }
18267 if(stmt->__anon1.asmStmt.clobberedFields)
18268 {
18269 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18270 {
18271 if(field->expression)
18272 ProcessExpressionType(field->expression);
18273 }
18274 }
18275 break;
18276 }
18277 case 17:
18278 {
18279 struct PropertyWatch * propWatch;
18280 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18281 struct Expression * object = stmt->__anon1._watch.object;
18282 struct Expression * watcher = stmt->__anon1._watch.watcher;
18283
18284 if(watcher)
18285 ProcessExpressionType(watcher);
18286 if(object)
18287 ProcessExpressionType(object);
18288 if(inCompiler)
18289 {
18290 if(watcher || thisClass)
18291 {
18292 struct External * external = curExternal;
18293 struct Context * context = curContext;
18294
18295 stmt->type = 3;
18296 stmt->__anon1.expressions = MkList();
18297 curExternal = external->prev;
18298 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18299 {
18300 struct ClassFunction * func;
18301 char watcherName[1024];
18302 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;
18303 struct External * createdExternal;
18304 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18305
18306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18307 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18308 if(propWatch->deleteWatch)
18309 strcat(watcherName, "_delete");
18310 else
18311 {
18312 struct Identifier * propID;
18313
18314 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18315 {
18316 strcat(watcherName, "_");
18317 strcat(watcherName, propID->string);
18318 }
18319 }
18320 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18321 {
18322 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)));
18323 ProcessClassFunctionBody(func, propWatch->compound);
18324 propWatch->compound = (((void *)0));
18325 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18326 createdExternal->symbol->idCode = external->symbol->idCode;
18327 curExternal = createdExternal;
18328 ProcessFunction(createdExternal->__anon1.function);
18329 {
18330 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18331
18332 externalDecl->__anon1.declaration = decl;
18333 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18334 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18335 }
18336 if(propWatch->deleteWatch)
18337 {
18338 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18339
18340 ListAdd(args, CopyExpression(object));
18341 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18342 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18343 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18344 }
18345 else
18346 {
18347 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18348 struct Identifier * propID;
18349
18350 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18351 {
18352 char propName[1024];
18353 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18354
18355 if(prop)
18356 {
18357 char getName[1024], setName[1024];
18358 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18359
18360 DeclareProperty(prop, setName, getName);
18361 strcpy(propName, "__ecereProp_");
18362 FullClassNameCat(propName, prop->_class->fullName, 0);
18363 strcat(propName, "_");
18364 FullClassNameCat(propName, prop->name, 1);
18365 ListAdd(args, CopyExpression(object));
18366 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18367 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18368 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
18369 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18370 }
18371 else
18372 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18373 }
18374 }
18375 }
18376 else
18377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18378 }
18379 curExternal = external;
18380 curContext = context;
18381 if(watcher)
18382 FreeExpression(watcher);
18383 if(object)
18384 FreeExpression(object);
18385 FreeList(watches, (void *)(FreePropertyWatch));
18386 }
18387 else
18388 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18389 }
18390 else
18391 {
18392 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18393 {
18394 ProcessStatement(propWatch->compound);
18395 }
18396 }
18397 break;
18398 }
18399 case 15:
18400 {
18401 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18402 struct Expression * object = stmt->__anon1._watch.object;
18403 struct __ecereNameSpace__ecere__com__Class * _class;
18404
18405 if(object)
18406 ProcessExpressionType(object);
18407 if(inCompiler)
18408 {
18409 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18410 if(_class)
18411 {
18412 struct Identifier * propID;
18413
18414 stmt->type = 3;
18415 stmt->__anon1.expressions = MkList();
18416 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18417 {
18418 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18419 }
18420 else if(!watches)
18421 {
18422 }
18423 if(watches)
18424 {
18425 for(propID = (*watches).first; propID; propID = propID->next)
18426 {
18427 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18428
18429 if(prop)
18430 {
18431 CreateFireWatcher(prop, object, stmt);
18432 }
18433 else
18434 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18435 }
18436 }
18437 else
18438 {
18439 struct __ecereNameSpace__ecere__com__Property * prop;
18440 struct __ecereNameSpace__ecere__com__Class * base;
18441
18442 for(base = _class; base; base = base->base)
18443 {
18444 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18445 {
18446 if(prop->isProperty && prop->isWatchable)
18447 {
18448 CreateFireWatcher(prop, object, stmt);
18449 }
18450 }
18451 }
18452 }
18453 if(object)
18454 FreeExpression(object);
18455 FreeList(watches, (void *)(FreeIdentifier));
18456 }
18457 else
18458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18459 }
18460 break;
18461 }
18462 case 16:
18463 {
18464 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18465 struct Expression * object = stmt->__anon1._watch.object;
18466 struct Expression * watcher = stmt->__anon1._watch.watcher;
18467 struct __ecereNameSpace__ecere__com__Class * _class;
18468
18469 if(object)
18470 ProcessExpressionType(object);
18471 if(watcher)
18472 ProcessExpressionType(watcher);
18473 if(inCompiler)
18474 {
18475 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18476 if(watcher || thisClass)
18477 {
18478 if(_class)
18479 {
18480 struct Identifier * propID;
18481
18482 stmt->type = 3;
18483 stmt->__anon1.expressions = MkList();
18484 if(!watches)
18485 {
18486 struct __ecereNameSpace__ecere__sys__OldList * args;
18487
18488 args = MkList();
18489 ListAdd(args, CopyExpression(object));
18490 ListAdd(args, MkExpConstant("0"));
18491 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18492 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18493 }
18494 else
18495 {
18496 for(propID = (*watches).first; propID; propID = propID->next)
18497 {
18498 char propName[1024];
18499 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18500
18501 if(prop)
18502 {
18503 char getName[1024], setName[1024];
18504 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18505
18506 DeclareProperty(prop, setName, getName);
18507 strcpy(propName, "__ecereProp_");
18508 FullClassNameCat(propName, prop->_class->fullName, 0);
18509 strcat(propName, "_");
18510 FullClassNameCat(propName, prop->name, 1);
18511 ListAdd(args, CopyExpression(object));
18512 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18513 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18514 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18515 }
18516 else
18517 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18518 }
18519 }
18520 if(object)
18521 FreeExpression(object);
18522 if(watcher)
18523 FreeExpression(watcher);
18524 FreeList(watches, (void *)(FreeIdentifier));
18525 }
18526 else
18527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18528 }
18529 else
18530 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18531 }
18532 break;
18533 }
18534 }
18535 }
18536
18537 extern struct Expression * QBrackets(struct Expression * exp);
18538
18539 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18540
18541 extern struct Declarator * QMkPtrDecl(const char *  id);
18542
18543 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18544
18545 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18546
18547 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18548
18549 static void ProcessFunction(struct FunctionDefinition * function)
18550 {
18551 struct Identifier * id = GetDeclId(function->declarator);
18552 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18553 struct Type * type = symbol ? symbol->type : (((void *)0));
18554 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18555 struct Context * oldTopContext = topContext;
18556
18557 yylloc = function->loc;
18558 if(type && type->__anon1.__anon2.thisClass)
18559 {
18560 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18561 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18562 char className[1024];
18563 char structName[1024];
18564 struct Declarator * funcDecl;
18565 struct Symbol * thisSymbol;
18566 unsigned int typedObject = 0;
18567
18568 if(_class && !_class->base)
18569 {
18570 _class = currentClass;
18571 if(_class && !_class->symbol)
18572 _class->symbol = FindClass(_class->fullName);
18573 classSym = _class ? _class->symbol : (((void *)0));
18574 typedObject = 1;
18575 }
18576 thisClass = _class;
18577 if(inCompiler && _class)
18578 {
18579 if(type->kind == 11)
18580 {
18581 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18582 {
18583 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18584
18585 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18586 FreeType(param);
18587 }
18588 if(type->classObjectType != 1)
18589 {
18590 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18591 symbol->type->__anon1.__anon2.staticMethod = 1;
18592 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18593 symbol->type->extraParam = 0;
18594 }
18595 }
18596 strcpy(className, "__ecereClass_");
18597 FullClassNameCat(className, _class->fullName, 1);
18598 structName[0] = (char)0;
18599 FullClassNameCat(structName, _class->fullName, 0);
18600 funcDecl = GetFuncDecl(function->declarator);
18601 if(funcDecl)
18602 {
18603 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18604 {
18605 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18606
18607 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18608 {
18609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18610 FreeTypeName(param);
18611 }
18612 }
18613 if(!function->propertyNoThis)
18614 {
18615 struct TypeName * thisParam = (((void *)0));
18616
18617 if(type->classObjectType != 1)
18618 {
18619 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18620 if(!funcDecl->__anon1.function.parameters)
18621 funcDecl->__anon1.function.parameters = MkList();
18622 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18623 }
18624 if(typedObject)
18625 {
18626 if(type->classObjectType != 1)
18627 {
18628 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18629 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18630 }
18631 thisParam = __extension__ ({
18632 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18633
18634 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18635 });
18636 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18637 }
18638 }
18639 }
18640 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18641 {
18642 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18643
18644 funcDecl = GetFuncDecl(initDecl->declarator);
18645 if(funcDecl)
18646 {
18647 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18648 {
18649 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18650
18651 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18652 {
18653 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18654 FreeTypeName(param);
18655 }
18656 }
18657 if(type->classObjectType != 1)
18658 {
18659 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18660 {
18661 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18662
18663 if(!funcDecl->__anon1.function.parameters)
18664 funcDecl->__anon1.function.parameters = MkList();
18665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18666 }
18667 }
18668 }
18669 }
18670 }
18671 if(function->body)
18672 {
18673 if(type->classObjectType != 1)
18674 {
18675 thisSymbol = __extension__ ({
18676 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18677
18678 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18679 });
18680 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18681 if(typedObject && thisSymbol->type)
18682 {
18683 thisSymbol->type->classObjectType = 2;
18684 thisSymbol->type->byReference = type->byReference;
18685 thisSymbol->type->typedByReference = type->byReference;
18686 }
18687 }
18688 }
18689 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18690 {
18691 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18692
18693 {
18694 struct __ecereNameSpace__ecere__com__Class * base;
18695
18696 for(base = _class; base && base->type != 1000; base = base->next)
18697 {
18698 for(member = base->membersAndProperties.first; member; member = member->next)
18699 if(!member->isProperty)
18700 break;
18701 if(member)
18702 break;
18703 }
18704 }
18705 for(member = _class->membersAndProperties.first; member; member = member->next)
18706 if(!member->isProperty)
18707 break;
18708 if(member)
18709 {
18710 char pointerName[1024];
18711 struct Declaration * decl;
18712 struct Initializer * initializer;
18713 struct Expression * exp, * bytePtr;
18714
18715 strcpy(pointerName, "__ecerePointer_");
18716 FullClassNameCat(pointerName, _class->fullName, 0);
18717 {
18718 char className[1024];
18719
18720 strcpy(className, "__ecereClass_");
18721 FullClassNameCat(className, classSym->string, 1);
18722 DeclareClass(classSym, className);
18723 }
18724 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18725 if(_class->fixed)
18726 {
18727 char string[256];
18728
18729 sprintf(string, "%d", _class->offset);
18730 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18731 }
18732 else
18733 {
18734 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18735 }
18736 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18737 exp->expType = __extension__ ({
18738 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18739
18740 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18741 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18742
18743 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18744 }), __ecereInstance2;
18745 });
18746 if(function->body)
18747 {
18748 yylloc = function->body->loc;
18749 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18750 {
18751 struct Context * prevContext = curContext;
18752 struct __ecereNameSpace__ecere__sys__OldList * list;
18753
18754 curContext = function->body->__anon1.compound.context;
18755 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18756 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18757 curContext = prevContext;
18758 }
18759 decl->symbol = (((void *)0));
18760 if(!function->body->__anon1.compound.declarations)
18761 function->body->__anon1.compound.declarations = MkList();
18762 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18763 }
18764 }
18765 }
18766 }
18767 else
18768 thisClass = (((void *)0));
18769 if(id)
18770 {
18771 FreeSpecifier(id->_class);
18772 id->_class = (((void *)0));
18773 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18774 {
18775 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18776
18777 id = GetDeclId(initDecl->declarator);
18778 FreeSpecifier(id->_class);
18779 id->_class = (((void *)0));
18780 }
18781 }
18782 if(function->body)
18783 topContext = function->body->__anon1.compound.context;
18784 {
18785 struct FunctionDefinition * oldFunction = curFunction;
18786
18787 curFunction = function;
18788 if(function->body)
18789 ProcessStatement(function->body);
18790 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18791 {
18792 struct Statement * prevCompound = curCompound;
18793 struct Context * prevContext = curContext;
18794 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18795
18796 if(!function->body->__anon1.compound.statements)
18797 function->body->__anon1.compound.statements = MkList();
18798 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18799 curCompound = function->body;
18800 curContext = function->body->__anon1.compound.context;
18801 ProcessStatement(fireWatchers);
18802 curContext = prevContext;
18803 curCompound = prevCompound;
18804 }
18805 curFunction = oldFunction;
18806 }
18807 if(function->declarator)
18808 {
18809 ProcessDeclarator(function->declarator);
18810 }
18811 topContext = oldTopContext;
18812 thisClass = oldThisClass;
18813 }
18814
18815 extern void FreeSymbol(struct Symbol * symbol);
18816
18817 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18818
18819 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18820 {
18821 struct ClassDef * def;
18822 struct External * external = curExternal;
18823 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18824
18825 for(def = definitions->first; def; def = def->next)
18826 {
18827 if(def->type == 0)
18828 {
18829 if(def->__anon1.function->declarator)
18830 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18831 else
18832 curExternal = external;
18833 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18834 }
18835 else if(def->type == 2)
18836 {
18837 if(def->__anon1.decl->type == 2)
18838 {
18839 thisClass = regClass;
18840 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18841 thisClass = (((void *)0));
18842 }
18843 else
18844 {
18845 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18846
18847 if(regClass)
18848 thisClass = regClass;
18849 ProcessDeclaration(def->__anon1.decl);
18850 thisClass = backThisClass;
18851 }
18852 }
18853 else if(def->type == 1 && def->__anon1.defProperties)
18854 {
18855 struct MemberInit * defProperty;
18856 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);
18857
18858 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18859 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18860 {
18861 thisClass = regClass;
18862 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18863 thisClass = (((void *)0));
18864 }
18865 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18866 FreeSymbol(thisSymbol);
18867 }
18868 else if(def->type == 3 && def->__anon1.propertyDef)
18869 {
18870 struct PropertyDef * prop = def->__anon1.propertyDef;
18871
18872 thisClass = regClass;
18873 if(prop->setStmt)
18874 {
18875 if(regClass)
18876 {
18877 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18878
18879 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18880 }
18881 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18882 ProcessStatement(prop->setStmt);
18883 }
18884 if(prop->getStmt)
18885 {
18886 if(regClass)
18887 {
18888 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18889
18890 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18891 }
18892 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18893 ProcessStatement(prop->getStmt);
18894 }
18895 if(prop->issetStmt)
18896 {
18897 if(regClass)
18898 {
18899 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18900
18901 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18902 }
18903 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18904 ProcessStatement(prop->issetStmt);
18905 }
18906 thisClass = (((void *)0));
18907 }
18908 else if(def->type == 4 && def->__anon1.propertyWatch)
18909 {
18910 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18911
18912 thisClass = regClass;
18913 if(propertyWatch->compound)
18914 {
18915 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);
18916
18917 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18918 curExternal = (((void *)0));
18919 ProcessStatement(propertyWatch->compound);
18920 }
18921 thisClass = (((void *)0));
18922 }
18923 }
18924 }
18925
18926 void DeclareFunctionUtil(const char * s)
18927 {
18928 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18929
18930 if(function)
18931 {
18932 char name[1024];
18933
18934 name[0] = (char)0;
18935 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18936 strcpy(name, "__ecereFunction_");
18937 FullClassNameCat(name, s, 0);
18938 DeclareFunction(function, name);
18939 }
18940 }
18941
18942 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18943
18944 extern unsigned int memoryGuard;
18945
18946 void ComputeDataTypes()
18947 {
18948 struct External * external;
18949 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18950 struct External * after = (((void *)0));
18951
18952 currentClass = (((void *)0));
18953 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18954 for(external = (*ast).first; external; external = external->next)
18955 {
18956 if(external->type == 1)
18957 {
18958 struct Declaration * decl = external->__anon1.declaration;
18959
18960 if(decl)
18961 {
18962 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18963
18964 if(decls)
18965 {
18966 struct InitDeclarator * initDecl = (*decls).first;
18967
18968 if(initDecl)
18969 {
18970 struct Declarator * declarator = initDecl->declarator;
18971
18972 if(declarator && declarator->type == 1)
18973 {
18974 struct Identifier * id = declarator->__anon1.identifier;
18975
18976 if(id && id->string)
18977 {
18978 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18979 {
18980 external->symbol->id = -1001, external->symbol->idCode = -1001;
18981 after = external;
18982 }
18983 }
18984 }
18985 }
18986 }
18987 }
18988 }
18989 }
18990 {
18991 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18992
18993 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18994 after = e;
18995 }
18996 temp->symbol = __extension__ ({
18997 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18998
18999 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
19000 });
19001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
19002 curExternal = temp;
19003 DeclareFunctionUtil("eSystem_New");
19004 DeclareFunctionUtil("eSystem_New0");
19005 DeclareFunctionUtil("eSystem_Renew");
19006 DeclareFunctionUtil("eSystem_Renew0");
19007 DeclareFunctionUtil("eSystem_Delete");
19008 DeclareFunctionUtil("eClass_GetProperty");
19009 DeclareFunctionUtil("eClass_SetProperty");
19010 DeclareFunctionUtil("eInstance_FireSelfWatchers");
19011 DeclareFunctionUtil("eInstance_SetMethod");
19012 DeclareFunctionUtil("eInstance_IncRef");
19013 DeclareFunctionUtil("eInstance_StopWatching");
19014 DeclareFunctionUtil("eInstance_Watch");
19015 DeclareFunctionUtil("eInstance_FireWatchers");
19016 if(memoryGuard)
19017 {
19018 DeclareFunctionUtil("MemoryGuard_PushLoc");
19019 DeclareFunctionUtil("MemoryGuard_PopLoc");
19020 }
19021 DeclareStruct("ecere::com::Class", 0);
19022 DeclareStruct("ecere::com::Instance", 0);
19023 DeclareStruct("ecere::com::Property", 0);
19024 DeclareStruct("ecere::com::DataMember", 0);
19025 DeclareStruct("ecere::com::Method", 0);
19026 DeclareStruct("ecere::com::SerialBuffer", 0);
19027 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
19028 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
19029 for(external = (*ast).first; external; external = external->next)
19030 {
19031 afterExternal = curExternal = external;
19032 if(external->type == 0)
19033 {
19034 currentClass = external->__anon1.function->_class;
19035 ProcessFunction(external->__anon1.function);
19036 }
19037 else if(external->type == 1)
19038 {
19039 currentClass = (((void *)0));
19040 if(external->__anon1.declaration)
19041 ProcessDeclaration(external->__anon1.declaration);
19042 }
19043 else if(external->type == 2)
19044 {
19045 struct ClassDefinition * _class = external->__anon1._class;
19046
19047 currentClass = external->symbol->__anon1.registered;
19048 if(_class->definitions)
19049 {
19050 ProcessClass(_class->definitions, _class->symbol);
19051 }
19052 if(inCompiler)
19053 {
19054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
19055 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
19056 }
19057 }
19058 else if(external->type == 4)
19059 {
19060 thisNameSpace = external->__anon1.id->string;
19061 }
19062 }
19063 currentClass = (((void *)0));
19064 thisNameSpace = (((void *)0));
19065 curExternal = (((void *)0));
19066 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
19067 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
19068 }
19069
19070 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);
19071
19072 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);
19073
19074 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
19075
19076 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19077 {
19078 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19079
19080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19104 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19105 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19106 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19107 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19108 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19109 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19110 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19112 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19129 __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);
19130 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19131 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19132 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19133 __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);
19134 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19135 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19136 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19137 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19138 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19139 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19140 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19141 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19142 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19143 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19144 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19145 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19146 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19147 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19148 __ecereClass_Conversion = class;
19149 __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);
19150 __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);
19151 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19152 __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);
19153 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19154 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19155 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19156 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19157 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19158 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19159 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19160 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19162 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19163 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19164 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19165 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19166 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19167 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19168 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19169 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19171 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19175 }
19176
19177 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19178 {
19179
19180 }
19181