compiler/libec: Fixed missing warnings within ( ) and conditional expressions
[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 if(dest->passAsTemplate)
5694 {
5695 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5696 CopyTypeInto(sourceExp->expType, dest);
5697 sourceExp->expType->passAsTemplate = 0;
5698 }
5699 else
5700 {
5701 sourceExp->expType = dest;
5702 dest->refCount++;
5703 }
5704 flag = 1;
5705 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5706 }
5707 }
5708 if(_class && _class->type == 2 && source->kind != 8)
5709 {
5710 if(!dest->__anon1._class->__anon1.registered->dataType)
5711 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5712 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5713 {
5714 FreeType(source);
5715 FreeType(sourceExp->expType);
5716 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5717 source->refCount++;
5718 }
5719 }
5720 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5721 {
5722 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5723 struct Declarator * decl;
5724 char string[1024];
5725
5726 ReadString(string, sourceExp->__anon1.__anon2.string);
5727 decl = SpecDeclFromString(string, specs, (((void *)0)));
5728 FreeExpContents(sourceExp);
5729 FreeType(sourceExp->expType);
5730 sourceExp->type = 24;
5731 sourceExp->__anon1._classExp.specifiers = specs;
5732 sourceExp->__anon1._classExp.decl = decl;
5733 sourceExp->expType = dest;
5734 dest->refCount++;
5735 FreeType(source);
5736 FreeType(dest);
5737 if(backupSourceExpType)
5738 FreeType(backupSourceExpType);
5739 return 1;
5740 }
5741 }
5742 else if(source->kind == 8)
5743 {
5744 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5745
5746 if(_class && (_class->type == 3 || _class->type == 2))
5747 {
5748 if(dest->kind != 8)
5749 {
5750 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5751 struct Type * tempDest, * tempSource;
5752
5753 if(!source->__anon1._class->__anon1.registered->dataType)
5754 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5755 for(; _class->base->type != 1000; _class = _class->base)
5756 ;
5757 tempDest = source;
5758 tempSource = tempType;
5759 tempType->kind = 8;
5760 tempType->__anon1._class = FindClass(_class->fullName);
5761 tempType->truth = source->truth;
5762 tempType->classObjectType = source->classObjectType;
5763 if(tempType->__anon1._class)
5764 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5765 if(conversions && conversions->last)
5766 {
5767 ((struct Conversion *)conversions->last)->resultType = dest;
5768 dest->refCount++;
5769 }
5770 FreeType(sourceExp->expType);
5771 sourceExp->expType = MkClassType(_class->fullName);
5772 sourceExp->expType->truth = source->truth;
5773 sourceExp->expType->classObjectType = source->classObjectType;
5774 if(!sourceExp->destType)
5775 {
5776 FreeType(sourceExp->destType);
5777 sourceExp->destType = sourceExp->expType;
5778 if(sourceExp->expType)
5779 sourceExp->expType->refCount++;
5780 }
5781 if(!_class->dataType)
5782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5783 FreeType(dest);
5784 dest = MkClassType(source->__anon1._class->string);
5785 dest->truth = source->truth;
5786 dest->classObjectType = source->classObjectType;
5787 FreeType(source);
5788 source = _class->dataType;
5789 source->refCount++;
5790 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5791 }
5792 }
5793 }
5794 if(!flag)
5795 {
5796 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5797 {
5798 FreeType(source);
5799 FreeType(dest);
5800 return 1;
5801 }
5802 }
5803 if(dest->kind == 8)
5804 {
5805 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5806 unsigned int fittingValue = 0;
5807
5808 if(_class && _class->type == 4)
5809 {
5810 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5811 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5812
5813 if(c && value >= 0 && value <= c->largest)
5814 fittingValue = 1;
5815 }
5816 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5817 {
5818 if(_class->type == 0 || _class->type == 5)
5819 {
5820 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5821
5822 *newExp = *sourceExp;
5823 if(sourceExp->destType)
5824 sourceExp->destType->refCount++;
5825 if(sourceExp->expType)
5826 sourceExp->expType->refCount++;
5827 sourceExp->type = 11;
5828 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5829 sourceExp->__anon1.cast.exp = newExp;
5830 FreeType(sourceExp->expType);
5831 sourceExp->expType = (((void *)0));
5832 ProcessExpressionType(sourceExp);
5833 if(!inCompiler)
5834 {
5835 FreeType(sourceExp->expType);
5836 sourceExp->expType = dest;
5837 }
5838 FreeType(source);
5839 if(inCompiler)
5840 FreeType(dest);
5841 if(backupSourceExpType)
5842 FreeType(backupSourceExpType);
5843 return 1;
5844 }
5845 if(!_class->dataType)
5846 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5847 FreeType(dest);
5848 dest = _class->dataType;
5849 dest->refCount++;
5850 }
5851 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))
5852 {
5853 specs = MkListOne(MkSpecifier(DOUBLE));
5854 }
5855 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))
5856 {
5857 specs = MkListOne(MkSpecifier(FLOAT));
5858 }
5859 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))
5860 {
5861 specs = MkList();
5862 if(!dest->isSigned)
5863 ListAdd(specs, MkSpecifier(UNSIGNED));
5864 ListAdd(specs, MkSpecifier(INT64));
5865 }
5866 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5867 {
5868 specs = MkList();
5869 if(!dest->isSigned)
5870 ListAdd(specs, MkSpecifier(UNSIGNED));
5871 ListAdd(specs, MkSpecifier(INT));
5872 }
5873 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5874 {
5875 specs = MkList();
5876 if(!dest->isSigned)
5877 ListAdd(specs, MkSpecifier(UNSIGNED));
5878 ListAdd(specs, MkSpecifier(SHORT));
5879 }
5880 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5881 {
5882 specs = MkList();
5883 if(!dest->isSigned)
5884 ListAdd(specs, MkSpecifier(UNSIGNED));
5885 ListAdd(specs, MkSpecifier(CHAR));
5886 }
5887 else
5888 {
5889 FreeType(source);
5890 FreeType(dest);
5891 if(backupSourceExpType)
5892 {
5893 if(sourceExp->expType)
5894 FreeType(sourceExp->expType);
5895 sourceExp->expType = backupSourceExpType;
5896 }
5897 return 0;
5898 }
5899 }
5900 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))
5901 {
5902 specs = MkListOne(MkSpecifier(DOUBLE));
5903 }
5904 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))
5905 {
5906 specs = MkListOne(MkSpecifier(FLOAT));
5907 }
5908 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5909 {
5910 specs = MkList();
5911 ListAdd(specs, MkSpecifier(BOOL));
5912 }
5913 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)))
5914 {
5915 specs = MkList();
5916 if(!dest->isSigned)
5917 ListAdd(specs, MkSpecifier(UNSIGNED));
5918 ListAdd(specs, MkSpecifier(CHAR));
5919 }
5920 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)))))
5921 {
5922 specs = MkList();
5923 if(!dest->isSigned)
5924 ListAdd(specs, MkSpecifier(UNSIGNED));
5925 ListAdd(specs, MkSpecifier(SHORT));
5926 }
5927 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5928 {
5929 specs = MkList();
5930 if(!dest->isSigned)
5931 ListAdd(specs, MkSpecifier(UNSIGNED));
5932 ListAdd(specs, MkSpecifier(INT));
5933 }
5934 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5935 {
5936 specs = MkList();
5937 if(!dest->isSigned)
5938 ListAdd(specs, MkSpecifier(UNSIGNED));
5939 ListAdd(specs, MkSpecifier(INT64));
5940 }
5941 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5942 {
5943 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5944 }
5945 else
5946 {
5947 FreeType(source);
5948 FreeType(dest);
5949 if(backupSourceExpType)
5950 {
5951 if(sourceExp->expType)
5952 FreeType(sourceExp->expType);
5953 sourceExp->expType = backupSourceExpType;
5954 }
5955 return 0;
5956 }
5957 if(!flag && !sourceExp->opDestType)
5958 {
5959 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5960
5961 *newExp = *sourceExp;
5962 newExp->prev = (((void *)0));
5963 newExp->next = (((void *)0));
5964 if(sourceExp->destType)
5965 sourceExp->destType->refCount++;
5966 if(sourceExp->expType)
5967 sourceExp->expType->refCount++;
5968 sourceExp->type = 11;
5969 if(realDest->kind == 8)
5970 {
5971 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5972 FreeList(specs, (void *)(FreeSpecifier));
5973 }
5974 else
5975 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5976 if(newExp->type == 4)
5977 {
5978 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5979 }
5980 else
5981 sourceExp->__anon1.cast.exp = newExp;
5982 FreeType(sourceExp->expType);
5983 sourceExp->expType = (((void *)0));
5984 ProcessExpressionType(sourceExp);
5985 }
5986 else
5987 FreeList(specs, (void *)(FreeSpecifier));
5988 FreeType(dest);
5989 FreeType(source);
5990 if(backupSourceExpType)
5991 FreeType(backupSourceExpType);
5992 return 1;
5993 }
5994 else
5995 {
5996 if(computedExp != sourceExp)
5997 {
5998 FreeExpression(computedExp);
5999 computedExp = sourceExp;
6000 }
6001 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
6002 sourceExp = (*sourceExp->__anon1.list).last;
6003 if(sourceExp->type == 0)
6004 {
6005 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
6006
6007 if(dest->kind == 8)
6008 {
6009 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
6010 {
6011 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
6012 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
6013
6014 if(enumClass)
6015 {
6016 for(; _class && _class->type == 4; _class = _class->base)
6017 {
6018 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
6019 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
6020
6021 for(value = e->values.first; value; value = value->next)
6022 {
6023 if(!strcmp(value->name, id->string))
6024 break;
6025 }
6026 if(value)
6027 {
6028 FreeType(sourceExp->expType);
6029 sourceExp->isConstant = 1;
6030 sourceExp->expType = MkClassType(_class->fullName);
6031 if(inCompiler || inPreCompiler || inDebugger)
6032 {
6033 FreeExpContents(sourceExp);
6034 sourceExp->type = 2;
6035 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
6036 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
6037 else
6038 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
6039 }
6040 FreeType(dest);
6041 return 1;
6042 }
6043 }
6044 }
6045 }
6046 }
6047 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
6048 {
6049 FreeType(dest);
6050 return 1;
6051 }
6052 }
6053 FreeType(dest);
6054 }
6055 return 0;
6056 }
6057
6058 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 {
6060 int value2 = op2->__anon1.i;
6061
6062 exp->type = 2;
6063 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6064 if(!exp->expType)
6065 {
6066 exp->expType = op1->type;
6067 if(op1->type)
6068 op1->type->refCount++;
6069 }
6070 return 1;
6071 }
6072
6073 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 {
6075 unsigned int value2 = op2->__anon1.ui;
6076
6077 exp->type = 2;
6078 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6079 if(!exp->expType)
6080 {
6081 exp->expType = op1->type;
6082 if(op1->type)
6083 op1->type->refCount++;
6084 }
6085 return 1;
6086 }
6087
6088 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 {
6090 long long value2 = op2->__anon1.i64;
6091
6092 exp->type = 2;
6093 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6094 if(!exp->expType)
6095 {
6096 exp->expType = op1->type;
6097 if(op1->type)
6098 op1->type->refCount++;
6099 }
6100 return 1;
6101 }
6102
6103 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 {
6105 uint64 value2 = op2->__anon1.ui64;
6106
6107 exp->type = 2;
6108 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6109 if(!exp->expType)
6110 {
6111 exp->expType = op1->type;
6112 if(op1->type)
6113 op1->type->refCount++;
6114 }
6115 return 1;
6116 }
6117
6118 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 {
6120 short value2 = op2->__anon1.s;
6121
6122 exp->type = 2;
6123 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6124 if(!exp->expType)
6125 {
6126 exp->expType = op1->type;
6127 if(op1->type)
6128 op1->type->refCount++;
6129 }
6130 return 1;
6131 }
6132
6133 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 {
6135 unsigned short value2 = op2->__anon1.us;
6136
6137 exp->type = 2;
6138 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6139 if(!exp->expType)
6140 {
6141 exp->expType = op1->type;
6142 if(op1->type)
6143 op1->type->refCount++;
6144 }
6145 return 1;
6146 }
6147
6148 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 {
6150 char value2 = op2->__anon1.c;
6151
6152 exp->type = 2;
6153 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6154 if(!exp->expType)
6155 {
6156 exp->expType = op1->type;
6157 if(op1->type)
6158 op1->type->refCount++;
6159 }
6160 return 1;
6161 }
6162
6163 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 {
6165 unsigned char value2 = op2->__anon1.uc;
6166
6167 exp->type = 2;
6168 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6169 if(!exp->expType)
6170 {
6171 exp->expType = op1->type;
6172 if(op1->type)
6173 op1->type->refCount++;
6174 }
6175 return 1;
6176 }
6177
6178 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 {
6180 float value2 = op2->__anon1.f;
6181
6182 exp->type = 2;
6183 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6184 if(!exp->expType)
6185 {
6186 exp->expType = op1->type;
6187 if(op1->type)
6188 op1->type->refCount++;
6189 }
6190 return 1;
6191 }
6192
6193 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 {
6195 double value2 = op2->__anon1.d;
6196
6197 exp->type = 2;
6198 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6199 if(!exp->expType)
6200 {
6201 exp->expType = op1->type;
6202 if(op1->type)
6203 op1->type->refCount++;
6204 }
6205 return 1;
6206 }
6207
6208 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 {
6210 int value2 = op2->__anon1.i;
6211
6212 exp->type = 2;
6213 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6214 if(!exp->expType)
6215 {
6216 exp->expType = op1->type;
6217 if(op1->type)
6218 op1->type->refCount++;
6219 }
6220 return 1;
6221 }
6222
6223 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 {
6225 unsigned int value2 = op2->__anon1.ui;
6226
6227 exp->type = 2;
6228 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6229 if(!exp->expType)
6230 {
6231 exp->expType = op1->type;
6232 if(op1->type)
6233 op1->type->refCount++;
6234 }
6235 return 1;
6236 }
6237
6238 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 {
6240 long long value2 = op2->__anon1.i64;
6241
6242 exp->type = 2;
6243 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6244 if(!exp->expType)
6245 {
6246 exp->expType = op1->type;
6247 if(op1->type)
6248 op1->type->refCount++;
6249 }
6250 return 1;
6251 }
6252
6253 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 {
6255 uint64 value2 = op2->__anon1.ui64;
6256
6257 exp->type = 2;
6258 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6259 if(!exp->expType)
6260 {
6261 exp->expType = op1->type;
6262 if(op1->type)
6263 op1->type->refCount++;
6264 }
6265 return 1;
6266 }
6267
6268 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 {
6270 short value2 = op2->__anon1.s;
6271
6272 exp->type = 2;
6273 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6274 if(!exp->expType)
6275 {
6276 exp->expType = op1->type;
6277 if(op1->type)
6278 op1->type->refCount++;
6279 }
6280 return 1;
6281 }
6282
6283 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 {
6285 unsigned short value2 = op2->__anon1.us;
6286
6287 exp->type = 2;
6288 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6289 if(!exp->expType)
6290 {
6291 exp->expType = op1->type;
6292 if(op1->type)
6293 op1->type->refCount++;
6294 }
6295 return 1;
6296 }
6297
6298 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 {
6300 char value2 = op2->__anon1.c;
6301
6302 exp->type = 2;
6303 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6304 if(!exp->expType)
6305 {
6306 exp->expType = op1->type;
6307 if(op1->type)
6308 op1->type->refCount++;
6309 }
6310 return 1;
6311 }
6312
6313 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 {
6315 unsigned char value2 = op2->__anon1.uc;
6316
6317 exp->type = 2;
6318 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6319 if(!exp->expType)
6320 {
6321 exp->expType = op1->type;
6322 if(op1->type)
6323 op1->type->refCount++;
6324 }
6325 return 1;
6326 }
6327
6328 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 {
6330 float value2 = op2->__anon1.f;
6331
6332 exp->type = 2;
6333 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6334 if(!exp->expType)
6335 {
6336 exp->expType = op1->type;
6337 if(op1->type)
6338 op1->type->refCount++;
6339 }
6340 return 1;
6341 }
6342
6343 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 {
6345 double value2 = op2->__anon1.d;
6346
6347 exp->type = 2;
6348 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6349 if(!exp->expType)
6350 {
6351 exp->expType = op1->type;
6352 if(op1->type)
6353 op1->type->refCount++;
6354 }
6355 return 1;
6356 }
6357
6358 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 {
6360 int value2 = op2->__anon1.i;
6361
6362 exp->type = 2;
6363 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6364 if(!exp->expType)
6365 {
6366 exp->expType = op1->type;
6367 if(op1->type)
6368 op1->type->refCount++;
6369 }
6370 return 1;
6371 }
6372
6373 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 {
6375 unsigned int value2 = op2->__anon1.ui;
6376
6377 exp->type = 2;
6378 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6379 if(!exp->expType)
6380 {
6381 exp->expType = op1->type;
6382 if(op1->type)
6383 op1->type->refCount++;
6384 }
6385 return 1;
6386 }
6387
6388 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 {
6390 long long value2 = op2->__anon1.i64;
6391
6392 exp->type = 2;
6393 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6394 if(!exp->expType)
6395 {
6396 exp->expType = op1->type;
6397 if(op1->type)
6398 op1->type->refCount++;
6399 }
6400 return 1;
6401 }
6402
6403 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 {
6405 uint64 value2 = op2->__anon1.ui64;
6406
6407 exp->type = 2;
6408 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6409 if(!exp->expType)
6410 {
6411 exp->expType = op1->type;
6412 if(op1->type)
6413 op1->type->refCount++;
6414 }
6415 return 1;
6416 }
6417
6418 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 {
6420 short value2 = op2->__anon1.s;
6421
6422 exp->type = 2;
6423 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6424 if(!exp->expType)
6425 {
6426 exp->expType = op1->type;
6427 if(op1->type)
6428 op1->type->refCount++;
6429 }
6430 return 1;
6431 }
6432
6433 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 {
6435 unsigned short value2 = op2->__anon1.us;
6436
6437 exp->type = 2;
6438 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6439 if(!exp->expType)
6440 {
6441 exp->expType = op1->type;
6442 if(op1->type)
6443 op1->type->refCount++;
6444 }
6445 return 1;
6446 }
6447
6448 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 {
6450 char value2 = op2->__anon1.c;
6451
6452 exp->type = 2;
6453 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6454 if(!exp->expType)
6455 {
6456 exp->expType = op1->type;
6457 if(op1->type)
6458 op1->type->refCount++;
6459 }
6460 return 1;
6461 }
6462
6463 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 {
6465 unsigned char value2 = op2->__anon1.uc;
6466
6467 exp->type = 2;
6468 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6469 if(!exp->expType)
6470 {
6471 exp->expType = op1->type;
6472 if(op1->type)
6473 op1->type->refCount++;
6474 }
6475 return 1;
6476 }
6477
6478 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 {
6480 float value2 = op2->__anon1.f;
6481
6482 exp->type = 2;
6483 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6484 if(!exp->expType)
6485 {
6486 exp->expType = op1->type;
6487 if(op1->type)
6488 op1->type->refCount++;
6489 }
6490 return 1;
6491 }
6492
6493 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 {
6495 double value2 = op2->__anon1.d;
6496
6497 exp->type = 2;
6498 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6499 if(!exp->expType)
6500 {
6501 exp->expType = op1->type;
6502 if(op1->type)
6503 op1->type->refCount++;
6504 }
6505 return 1;
6506 }
6507
6508 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 {
6510 int value2 = op2->__anon1.i;
6511
6512 exp->type = 2;
6513 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6514 if(!exp->expType)
6515 {
6516 exp->expType = op1->type;
6517 if(op1->type)
6518 op1->type->refCount++;
6519 }
6520 return 1;
6521 }
6522
6523 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 {
6525 unsigned int value2 = op2->__anon1.ui;
6526
6527 exp->type = 2;
6528 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6529 if(!exp->expType)
6530 {
6531 exp->expType = op1->type;
6532 if(op1->type)
6533 op1->type->refCount++;
6534 }
6535 return 1;
6536 }
6537
6538 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 {
6540 long long value2 = op2->__anon1.i64;
6541
6542 exp->type = 2;
6543 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 1;
6551 }
6552
6553 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 {
6555 uint64 value2 = op2->__anon1.ui64;
6556
6557 exp->type = 2;
6558 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6559 if(!exp->expType)
6560 {
6561 exp->expType = op1->type;
6562 if(op1->type)
6563 op1->type->refCount++;
6564 }
6565 return 1;
6566 }
6567
6568 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 {
6570 short value2 = op2->__anon1.s;
6571
6572 exp->type = 2;
6573 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6574 if(!exp->expType)
6575 {
6576 exp->expType = op1->type;
6577 if(op1->type)
6578 op1->type->refCount++;
6579 }
6580 return 1;
6581 }
6582
6583 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 {
6585 unsigned short value2 = op2->__anon1.us;
6586
6587 exp->type = 2;
6588 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6589 if(!exp->expType)
6590 {
6591 exp->expType = op1->type;
6592 if(op1->type)
6593 op1->type->refCount++;
6594 }
6595 return 1;
6596 }
6597
6598 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 {
6600 char value2 = op2->__anon1.c;
6601
6602 exp->type = 2;
6603 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6604 if(!exp->expType)
6605 {
6606 exp->expType = op1->type;
6607 if(op1->type)
6608 op1->type->refCount++;
6609 }
6610 return 1;
6611 }
6612
6613 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 {
6615 unsigned char value2 = op2->__anon1.uc;
6616
6617 exp->type = 2;
6618 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6619 if(!exp->expType)
6620 {
6621 exp->expType = op1->type;
6622 if(op1->type)
6623 op1->type->refCount++;
6624 }
6625 return 1;
6626 }
6627
6628 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 {
6630 float value2 = op2->__anon1.f;
6631
6632 exp->type = 2;
6633 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6634 if(!exp->expType)
6635 {
6636 exp->expType = op1->type;
6637 if(op1->type)
6638 op1->type->refCount++;
6639 }
6640 return 1;
6641 }
6642
6643 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 {
6645 double value2 = op2->__anon1.d;
6646
6647 exp->type = 2;
6648 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6649 if(!exp->expType)
6650 {
6651 exp->expType = op1->type;
6652 if(op1->type)
6653 op1->type->refCount++;
6654 }
6655 return 1;
6656 }
6657
6658 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 {
6660 int value2 = op2->__anon1.i;
6661
6662 exp->type = 2;
6663 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6664 if(!exp->expType)
6665 {
6666 exp->expType = op1->type;
6667 if(op1->type)
6668 op1->type->refCount++;
6669 }
6670 return 1;
6671 }
6672
6673 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 {
6675 unsigned int value2 = op2->__anon1.ui;
6676
6677 exp->type = 2;
6678 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6679 if(!exp->expType)
6680 {
6681 exp->expType = op1->type;
6682 if(op1->type)
6683 op1->type->refCount++;
6684 }
6685 return 1;
6686 }
6687
6688 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 {
6690 long long value2 = op2->__anon1.i64;
6691
6692 exp->type = 2;
6693 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6694 if(!exp->expType)
6695 {
6696 exp->expType = op1->type;
6697 if(op1->type)
6698 op1->type->refCount++;
6699 }
6700 return 1;
6701 }
6702
6703 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 {
6705 uint64 value2 = op2->__anon1.ui64;
6706
6707 exp->type = 2;
6708 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6709 if(!exp->expType)
6710 {
6711 exp->expType = op1->type;
6712 if(op1->type)
6713 op1->type->refCount++;
6714 }
6715 return 1;
6716 }
6717
6718 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6719 {
6720 short value2 = op2->__anon1.s;
6721
6722 exp->type = 2;
6723 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6724 if(!exp->expType)
6725 {
6726 exp->expType = op1->type;
6727 if(op1->type)
6728 op1->type->refCount++;
6729 }
6730 return 1;
6731 }
6732
6733 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6734 {
6735 unsigned short value2 = op2->__anon1.us;
6736
6737 exp->type = 2;
6738 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6739 if(!exp->expType)
6740 {
6741 exp->expType = op1->type;
6742 if(op1->type)
6743 op1->type->refCount++;
6744 }
6745 return 1;
6746 }
6747
6748 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 {
6750 char value2 = op2->__anon1.c;
6751
6752 exp->type = 2;
6753 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 1;
6761 }
6762
6763 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 {
6765 unsigned char value2 = op2->__anon1.uc;
6766
6767 exp->type = 2;
6768 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6769 if(!exp->expType)
6770 {
6771 exp->expType = op1->type;
6772 if(op1->type)
6773 op1->type->refCount++;
6774 }
6775 return 1;
6776 }
6777
6778 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6779 {
6780 exp->type = 2;
6781 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6782 if(!exp->expType)
6783 {
6784 exp->expType = op1->type;
6785 if(op1->type)
6786 op1->type->refCount++;
6787 }
6788 return 1;
6789 }
6790
6791 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6792 {
6793 exp->type = 2;
6794 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6795 if(!exp->expType)
6796 {
6797 exp->expType = op1->type;
6798 if(op1->type)
6799 op1->type->refCount++;
6800 }
6801 return 1;
6802 }
6803
6804 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6805 {
6806 exp->type = 2;
6807 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6808 if(!exp->expType)
6809 {
6810 exp->expType = op1->type;
6811 if(op1->type)
6812 op1->type->refCount++;
6813 }
6814 return 1;
6815 }
6816
6817 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6818 {
6819 exp->type = 2;
6820 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6821 if(!exp->expType)
6822 {
6823 exp->expType = op1->type;
6824 if(op1->type)
6825 op1->type->refCount++;
6826 }
6827 return 1;
6828 }
6829
6830 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6831 {
6832 exp->type = 2;
6833 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6834 if(!exp->expType)
6835 {
6836 exp->expType = op1->type;
6837 if(op1->type)
6838 op1->type->refCount++;
6839 }
6840 return 1;
6841 }
6842
6843 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6844 {
6845 exp->type = 2;
6846 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6847 if(!exp->expType)
6848 {
6849 exp->expType = op1->type;
6850 if(op1->type)
6851 op1->type->refCount++;
6852 }
6853 return 1;
6854 }
6855
6856 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6857 {
6858 exp->type = 2;
6859 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6860 if(!exp->expType)
6861 {
6862 exp->expType = op1->type;
6863 if(op1->type)
6864 op1->type->refCount++;
6865 }
6866 return 1;
6867 }
6868
6869 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6870 {
6871 exp->type = 2;
6872 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6873 if(!exp->expType)
6874 {
6875 exp->expType = op1->type;
6876 if(op1->type)
6877 op1->type->refCount++;
6878 }
6879 return 1;
6880 }
6881
6882 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6883 {
6884 exp->type = 2;
6885 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6886 if(!exp->expType)
6887 {
6888 exp->expType = op1->type;
6889 if(op1->type)
6890 op1->type->refCount++;
6891 }
6892 return 1;
6893 }
6894
6895 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6896 {
6897 exp->type = 2;
6898 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6899 if(!exp->expType)
6900 {
6901 exp->expType = op1->type;
6902 if(op1->type)
6903 op1->type->refCount++;
6904 }
6905 return 1;
6906 }
6907
6908 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6909 {
6910 exp->type = 2;
6911 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6912 if(!exp->expType)
6913 {
6914 exp->expType = op1->type;
6915 if(op1->type)
6916 op1->type->refCount++;
6917 }
6918 return 1;
6919 }
6920
6921 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6922 {
6923 exp->type = 2;
6924 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6925 if(!exp->expType)
6926 {
6927 exp->expType = op1->type;
6928 if(op1->type)
6929 op1->type->refCount++;
6930 }
6931 return 1;
6932 }
6933
6934 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6935 {
6936 exp->type = 2;
6937 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6938 if(!exp->expType)
6939 {
6940 exp->expType = op1->type;
6941 if(op1->type)
6942 op1->type->refCount++;
6943 }
6944 return 1;
6945 }
6946
6947 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6948 {
6949 exp->type = 2;
6950 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 1;
6958 }
6959
6960 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6961 {
6962 exp->type = 2;
6963 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 1;
6971 }
6972
6973 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6974 {
6975 exp->type = 2;
6976 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6977 if(!exp->expType)
6978 {
6979 exp->expType = op1->type;
6980 if(op1->type)
6981 op1->type->refCount++;
6982 }
6983 return 1;
6984 }
6985
6986 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6987 {
6988 exp->type = 2;
6989 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6990 if(!exp->expType)
6991 {
6992 exp->expType = op1->type;
6993 if(op1->type)
6994 op1->type->refCount++;
6995 }
6996 return 1;
6997 }
6998
6999 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
7000 {
7001 exp->type = 2;
7002 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
7003 if(!exp->expType)
7004 {
7005 exp->expType = op1->type;
7006 if(op1->type)
7007 op1->type->refCount++;
7008 }
7009 return 1;
7010 }
7011
7012 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
7013 {
7014 exp->type = 2;
7015 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
7016 if(!exp->expType)
7017 {
7018 exp->expType = op1->type;
7019 if(op1->type)
7020 op1->type->refCount++;
7021 }
7022 return 1;
7023 }
7024
7025 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
7026 {
7027 exp->type = 2;
7028 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
7029 if(!exp->expType)
7030 {
7031 exp->expType = op1->type;
7032 if(op1->type)
7033 op1->type->refCount++;
7034 }
7035 return 1;
7036 }
7037
7038 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
7039 {
7040 exp->type = 2;
7041 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
7042 if(!exp->expType)
7043 {
7044 exp->expType = op1->type;
7045 if(op1->type)
7046 op1->type->refCount++;
7047 }
7048 return 1;
7049 }
7050
7051 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7052 {
7053 exp->type = 2;
7054 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 1;
7062 }
7063
7064 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7065 {
7066 exp->type = 2;
7067 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 1;
7075 }
7076
7077 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7078 {
7079 exp->type = 2;
7080 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7081 if(!exp->expType)
7082 {
7083 exp->expType = op1->type;
7084 if(op1->type)
7085 op1->type->refCount++;
7086 }
7087 return 1;
7088 }
7089
7090 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7091 {
7092 exp->type = 2;
7093 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 1;
7101 }
7102
7103 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7104 {
7105 exp->type = 2;
7106 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 1;
7114 }
7115
7116 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7117 {
7118 exp->type = 2;
7119 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 1;
7127 }
7128
7129 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7130 {
7131 exp->type = 2;
7132 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7133 if(!exp->expType)
7134 {
7135 exp->expType = op1->type;
7136 if(op1->type)
7137 op1->type->refCount++;
7138 }
7139 return 1;
7140 }
7141
7142 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7143 {
7144 exp->type = 2;
7145 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 1;
7153 }
7154
7155 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7156 {
7157 exp->type = 2;
7158 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7159 if(!exp->expType)
7160 {
7161 exp->expType = op1->type;
7162 if(op1->type)
7163 op1->type->refCount++;
7164 }
7165 return 1;
7166 }
7167
7168 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 {
7170 int value2 = op2->__anon1.i;
7171
7172 exp->type = 2;
7173 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7174 if(!exp->expType)
7175 {
7176 exp->expType = op1->type;
7177 if(op1->type)
7178 op1->type->refCount++;
7179 }
7180 return 1;
7181 }
7182
7183 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 {
7185 unsigned int value2 = op2->__anon1.ui;
7186
7187 exp->type = 2;
7188 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7189 if(!exp->expType)
7190 {
7191 exp->expType = op1->type;
7192 if(op1->type)
7193 op1->type->refCount++;
7194 }
7195 return 1;
7196 }
7197
7198 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 {
7200 long long value2 = op2->__anon1.i64;
7201
7202 exp->type = 2;
7203 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7204 if(!exp->expType)
7205 {
7206 exp->expType = op1->type;
7207 if(op1->type)
7208 op1->type->refCount++;
7209 }
7210 return 1;
7211 }
7212
7213 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 {
7215 uint64 value2 = op2->__anon1.ui64;
7216
7217 exp->type = 2;
7218 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7219 if(!exp->expType)
7220 {
7221 exp->expType = op1->type;
7222 if(op1->type)
7223 op1->type->refCount++;
7224 }
7225 return 1;
7226 }
7227
7228 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 {
7230 short value2 = op2->__anon1.s;
7231
7232 exp->type = 2;
7233 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7234 if(!exp->expType)
7235 {
7236 exp->expType = op1->type;
7237 if(op1->type)
7238 op1->type->refCount++;
7239 }
7240 return 1;
7241 }
7242
7243 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 {
7245 unsigned short value2 = op2->__anon1.us;
7246
7247 exp->type = 2;
7248 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7249 if(!exp->expType)
7250 {
7251 exp->expType = op1->type;
7252 if(op1->type)
7253 op1->type->refCount++;
7254 }
7255 return 1;
7256 }
7257
7258 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 {
7260 char value2 = op2->__anon1.c;
7261
7262 exp->type = 2;
7263 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7264 if(!exp->expType)
7265 {
7266 exp->expType = op1->type;
7267 if(op1->type)
7268 op1->type->refCount++;
7269 }
7270 return 1;
7271 }
7272
7273 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 {
7275 unsigned char value2 = op2->__anon1.uc;
7276
7277 exp->type = 2;
7278 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7279 if(!exp->expType)
7280 {
7281 exp->expType = op1->type;
7282 if(op1->type)
7283 op1->type->refCount++;
7284 }
7285 return 1;
7286 }
7287
7288 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 {
7290 float value2 = op2->__anon1.f;
7291
7292 exp->type = 2;
7293 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7294 if(!exp->expType)
7295 {
7296 exp->expType = op1->type;
7297 if(op1->type)
7298 op1->type->refCount++;
7299 }
7300 return 1;
7301 }
7302
7303 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 {
7305 double value2 = op2->__anon1.d;
7306
7307 exp->type = 2;
7308 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7309 if(!exp->expType)
7310 {
7311 exp->expType = op1->type;
7312 if(op1->type)
7313 op1->type->refCount++;
7314 }
7315 return 1;
7316 }
7317
7318 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 {
7320 int value2 = op2->__anon1.i;
7321
7322 exp->type = 2;
7323 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7324 if(!exp->expType)
7325 {
7326 exp->expType = op1->type;
7327 if(op1->type)
7328 op1->type->refCount++;
7329 }
7330 return 1;
7331 }
7332
7333 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 {
7335 unsigned int value2 = op2->__anon1.ui;
7336
7337 exp->type = 2;
7338 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7339 if(!exp->expType)
7340 {
7341 exp->expType = op1->type;
7342 if(op1->type)
7343 op1->type->refCount++;
7344 }
7345 return 1;
7346 }
7347
7348 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 {
7350 long long value2 = op2->__anon1.i64;
7351
7352 exp->type = 2;
7353 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7354 if(!exp->expType)
7355 {
7356 exp->expType = op1->type;
7357 if(op1->type)
7358 op1->type->refCount++;
7359 }
7360 return 1;
7361 }
7362
7363 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 {
7365 uint64 value2 = op2->__anon1.ui64;
7366
7367 exp->type = 2;
7368 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7369 if(!exp->expType)
7370 {
7371 exp->expType = op1->type;
7372 if(op1->type)
7373 op1->type->refCount++;
7374 }
7375 return 1;
7376 }
7377
7378 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 {
7380 short value2 = op2->__anon1.s;
7381
7382 exp->type = 2;
7383 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7384 if(!exp->expType)
7385 {
7386 exp->expType = op1->type;
7387 if(op1->type)
7388 op1->type->refCount++;
7389 }
7390 return 1;
7391 }
7392
7393 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 {
7395 unsigned short value2 = op2->__anon1.us;
7396
7397 exp->type = 2;
7398 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7399 if(!exp->expType)
7400 {
7401 exp->expType = op1->type;
7402 if(op1->type)
7403 op1->type->refCount++;
7404 }
7405 return 1;
7406 }
7407
7408 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 {
7410 char value2 = op2->__anon1.c;
7411
7412 exp->type = 2;
7413 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7414 if(!exp->expType)
7415 {
7416 exp->expType = op1->type;
7417 if(op1->type)
7418 op1->type->refCount++;
7419 }
7420 return 1;
7421 }
7422
7423 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 {
7425 unsigned char value2 = op2->__anon1.uc;
7426
7427 exp->type = 2;
7428 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7429 if(!exp->expType)
7430 {
7431 exp->expType = op1->type;
7432 if(op1->type)
7433 op1->type->refCount++;
7434 }
7435 return 1;
7436 }
7437
7438 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 {
7440 float value2 = op2->__anon1.f;
7441
7442 exp->type = 2;
7443 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7444 if(!exp->expType)
7445 {
7446 exp->expType = op1->type;
7447 if(op1->type)
7448 op1->type->refCount++;
7449 }
7450 return 1;
7451 }
7452
7453 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 {
7455 double value2 = op2->__anon1.d;
7456
7457 exp->type = 2;
7458 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7459 if(!exp->expType)
7460 {
7461 exp->expType = op1->type;
7462 if(op1->type)
7463 op1->type->refCount++;
7464 }
7465 return 1;
7466 }
7467
7468 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 {
7470 int value2 = op2->__anon1.i;
7471
7472 exp->type = 2;
7473 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7474 if(!exp->expType)
7475 {
7476 exp->expType = op1->type;
7477 if(op1->type)
7478 op1->type->refCount++;
7479 }
7480 return 1;
7481 }
7482
7483 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 {
7485 unsigned int value2 = op2->__anon1.ui;
7486
7487 exp->type = 2;
7488 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7489 if(!exp->expType)
7490 {
7491 exp->expType = op1->type;
7492 if(op1->type)
7493 op1->type->refCount++;
7494 }
7495 return 1;
7496 }
7497
7498 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7499 {
7500 long long value2 = op2->__anon1.i64;
7501
7502 exp->type = 2;
7503 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7504 if(!exp->expType)
7505 {
7506 exp->expType = op1->type;
7507 if(op1->type)
7508 op1->type->refCount++;
7509 }
7510 return 1;
7511 }
7512
7513 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 {
7515 uint64 value2 = op2->__anon1.ui64;
7516
7517 exp->type = 2;
7518 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7519 if(!exp->expType)
7520 {
7521 exp->expType = op1->type;
7522 if(op1->type)
7523 op1->type->refCount++;
7524 }
7525 return 1;
7526 }
7527
7528 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 {
7530 short value2 = op2->__anon1.s;
7531
7532 exp->type = 2;
7533 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7534 if(!exp->expType)
7535 {
7536 exp->expType = op1->type;
7537 if(op1->type)
7538 op1->type->refCount++;
7539 }
7540 return 1;
7541 }
7542
7543 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 {
7545 unsigned short value2 = op2->__anon1.us;
7546
7547 exp->type = 2;
7548 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7549 if(!exp->expType)
7550 {
7551 exp->expType = op1->type;
7552 if(op1->type)
7553 op1->type->refCount++;
7554 }
7555 return 1;
7556 }
7557
7558 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 {
7560 char value2 = op2->__anon1.c;
7561
7562 exp->type = 2;
7563 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7564 if(!exp->expType)
7565 {
7566 exp->expType = op1->type;
7567 if(op1->type)
7568 op1->type->refCount++;
7569 }
7570 return 1;
7571 }
7572
7573 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 {
7575 unsigned char value2 = op2->__anon1.uc;
7576
7577 exp->type = 2;
7578 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7579 if(!exp->expType)
7580 {
7581 exp->expType = op1->type;
7582 if(op1->type)
7583 op1->type->refCount++;
7584 }
7585 return 1;
7586 }
7587
7588 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 {
7590 float value2 = op2->__anon1.f;
7591
7592 exp->type = 2;
7593 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7594 if(!exp->expType)
7595 {
7596 exp->expType = op1->type;
7597 if(op1->type)
7598 op1->type->refCount++;
7599 }
7600 return 1;
7601 }
7602
7603 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 {
7605 double value2 = op2->__anon1.d;
7606
7607 exp->type = 2;
7608 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7609 if(!exp->expType)
7610 {
7611 exp->expType = op1->type;
7612 if(op1->type)
7613 op1->type->refCount++;
7614 }
7615 return 1;
7616 }
7617
7618 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 {
7620 int value2 = op2->__anon1.i;
7621
7622 exp->type = 2;
7623 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7624 if(!exp->expType)
7625 {
7626 exp->expType = op1->type;
7627 if(op1->type)
7628 op1->type->refCount++;
7629 }
7630 return 1;
7631 }
7632
7633 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 {
7635 unsigned int value2 = op2->__anon1.ui;
7636
7637 exp->type = 2;
7638 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7639 if(!exp->expType)
7640 {
7641 exp->expType = op1->type;
7642 if(op1->type)
7643 op1->type->refCount++;
7644 }
7645 return 1;
7646 }
7647
7648 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 {
7650 long long value2 = op2->__anon1.i64;
7651
7652 exp->type = 2;
7653 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7654 if(!exp->expType)
7655 {
7656 exp->expType = op1->type;
7657 if(op1->type)
7658 op1->type->refCount++;
7659 }
7660 return 1;
7661 }
7662
7663 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 {
7665 uint64 value2 = op2->__anon1.ui64;
7666
7667 exp->type = 2;
7668 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7669 if(!exp->expType)
7670 {
7671 exp->expType = op1->type;
7672 if(op1->type)
7673 op1->type->refCount++;
7674 }
7675 return 1;
7676 }
7677
7678 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 {
7680 short value2 = op2->__anon1.s;
7681
7682 exp->type = 2;
7683 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7684 if(!exp->expType)
7685 {
7686 exp->expType = op1->type;
7687 if(op1->type)
7688 op1->type->refCount++;
7689 }
7690 return 1;
7691 }
7692
7693 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 {
7695 unsigned short value2 = op2->__anon1.us;
7696
7697 exp->type = 2;
7698 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7699 if(!exp->expType)
7700 {
7701 exp->expType = op1->type;
7702 if(op1->type)
7703 op1->type->refCount++;
7704 }
7705 return 1;
7706 }
7707
7708 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 {
7710 char value2 = op2->__anon1.c;
7711
7712 exp->type = 2;
7713 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7714 if(!exp->expType)
7715 {
7716 exp->expType = op1->type;
7717 if(op1->type)
7718 op1->type->refCount++;
7719 }
7720 return 1;
7721 }
7722
7723 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 {
7725 unsigned char value2 = op2->__anon1.uc;
7726
7727 exp->type = 2;
7728 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7729 if(!exp->expType)
7730 {
7731 exp->expType = op1->type;
7732 if(op1->type)
7733 op1->type->refCount++;
7734 }
7735 return 1;
7736 }
7737
7738 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 {
7740 float value2 = op2->__anon1.f;
7741
7742 exp->type = 2;
7743 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7744 if(!exp->expType)
7745 {
7746 exp->expType = op1->type;
7747 if(op1->type)
7748 op1->type->refCount++;
7749 }
7750 return 1;
7751 }
7752
7753 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 {
7755 double value2 = op2->__anon1.d;
7756
7757 exp->type = 2;
7758 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7759 if(!exp->expType)
7760 {
7761 exp->expType = op1->type;
7762 if(op1->type)
7763 op1->type->refCount++;
7764 }
7765 return 1;
7766 }
7767
7768 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 {
7770 int value2 = op2->__anon1.i;
7771
7772 exp->type = 2;
7773 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7774 if(!exp->expType)
7775 {
7776 exp->expType = op1->type;
7777 if(op1->type)
7778 op1->type->refCount++;
7779 }
7780 return 1;
7781 }
7782
7783 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 {
7785 unsigned int value2 = op2->__anon1.ui;
7786
7787 exp->type = 2;
7788 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7789 if(!exp->expType)
7790 {
7791 exp->expType = op1->type;
7792 if(op1->type)
7793 op1->type->refCount++;
7794 }
7795 return 1;
7796 }
7797
7798 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 {
7800 long long value2 = op2->__anon1.i64;
7801
7802 exp->type = 2;
7803 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7804 if(!exp->expType)
7805 {
7806 exp->expType = op1->type;
7807 if(op1->type)
7808 op1->type->refCount++;
7809 }
7810 return 1;
7811 }
7812
7813 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 {
7815 uint64 value2 = op2->__anon1.ui64;
7816
7817 exp->type = 2;
7818 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7819 if(!exp->expType)
7820 {
7821 exp->expType = op1->type;
7822 if(op1->type)
7823 op1->type->refCount++;
7824 }
7825 return 1;
7826 }
7827
7828 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 {
7830 short value2 = op2->__anon1.s;
7831
7832 exp->type = 2;
7833 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7834 if(!exp->expType)
7835 {
7836 exp->expType = op1->type;
7837 if(op1->type)
7838 op1->type->refCount++;
7839 }
7840 return 1;
7841 }
7842
7843 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 {
7845 unsigned short value2 = op2->__anon1.us;
7846
7847 exp->type = 2;
7848 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7849 if(!exp->expType)
7850 {
7851 exp->expType = op1->type;
7852 if(op1->type)
7853 op1->type->refCount++;
7854 }
7855 return 1;
7856 }
7857
7858 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 {
7860 char value2 = op2->__anon1.c;
7861
7862 exp->type = 2;
7863 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7864 if(!exp->expType)
7865 {
7866 exp->expType = op1->type;
7867 if(op1->type)
7868 op1->type->refCount++;
7869 }
7870 return 1;
7871 }
7872
7873 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 {
7875 unsigned char value2 = op2->__anon1.uc;
7876
7877 exp->type = 2;
7878 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7879 if(!exp->expType)
7880 {
7881 exp->expType = op1->type;
7882 if(op1->type)
7883 op1->type->refCount++;
7884 }
7885 return 1;
7886 }
7887
7888 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 {
7890 float value2 = op2->__anon1.f;
7891
7892 exp->type = 2;
7893 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7894 if(!exp->expType)
7895 {
7896 exp->expType = op1->type;
7897 if(op1->type)
7898 op1->type->refCount++;
7899 }
7900 return 1;
7901 }
7902
7903 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 {
7905 double value2 = op2->__anon1.d;
7906
7907 exp->type = 2;
7908 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7909 if(!exp->expType)
7910 {
7911 exp->expType = op1->type;
7912 if(op1->type)
7913 op1->type->refCount++;
7914 }
7915 return 1;
7916 }
7917
7918 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 {
7920 int value2 = op2->__anon1.i;
7921
7922 exp->type = 2;
7923 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7924 if(!exp->expType)
7925 {
7926 exp->expType = op1->type;
7927 if(op1->type)
7928 op1->type->refCount++;
7929 }
7930 return 1;
7931 }
7932
7933 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 {
7935 unsigned int value2 = op2->__anon1.ui;
7936
7937 exp->type = 2;
7938 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7939 if(!exp->expType)
7940 {
7941 exp->expType = op1->type;
7942 if(op1->type)
7943 op1->type->refCount++;
7944 }
7945 return 1;
7946 }
7947
7948 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 {
7950 long long value2 = op2->__anon1.i64;
7951
7952 exp->type = 2;
7953 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7954 if(!exp->expType)
7955 {
7956 exp->expType = op1->type;
7957 if(op1->type)
7958 op1->type->refCount++;
7959 }
7960 return 1;
7961 }
7962
7963 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7964 {
7965 uint64 value2 = op2->__anon1.ui64;
7966
7967 exp->type = 2;
7968 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7969 if(!exp->expType)
7970 {
7971 exp->expType = op1->type;
7972 if(op1->type)
7973 op1->type->refCount++;
7974 }
7975 return 1;
7976 }
7977
7978 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7979 {
7980 short value2 = op2->__anon1.s;
7981
7982 exp->type = 2;
7983 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7984 if(!exp->expType)
7985 {
7986 exp->expType = op1->type;
7987 if(op1->type)
7988 op1->type->refCount++;
7989 }
7990 return 1;
7991 }
7992
7993 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7994 {
7995 unsigned short value2 = op2->__anon1.us;
7996
7997 exp->type = 2;
7998 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7999 if(!exp->expType)
8000 {
8001 exp->expType = op1->type;
8002 if(op1->type)
8003 op1->type->refCount++;
8004 }
8005 return 1;
8006 }
8007
8008 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8009 {
8010 char value2 = op2->__anon1.c;
8011
8012 exp->type = 2;
8013 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
8014 if(!exp->expType)
8015 {
8016 exp->expType = op1->type;
8017 if(op1->type)
8018 op1->type->refCount++;
8019 }
8020 return 1;
8021 }
8022
8023 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8024 {
8025 unsigned char value2 = op2->__anon1.uc;
8026
8027 exp->type = 2;
8028 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
8029 if(!exp->expType)
8030 {
8031 exp->expType = op1->type;
8032 if(op1->type)
8033 op1->type->refCount++;
8034 }
8035 return 1;
8036 }
8037
8038 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8039 {
8040 int value2 = op2->__anon1.i;
8041
8042 exp->type = 2;
8043 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
8044 if(!exp->expType)
8045 {
8046 exp->expType = op1->type;
8047 if(op1->type)
8048 op1->type->refCount++;
8049 }
8050 return 1;
8051 }
8052
8053 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8054 {
8055 unsigned int value2 = op2->__anon1.ui;
8056
8057 exp->type = 2;
8058 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8059 if(!exp->expType)
8060 {
8061 exp->expType = op1->type;
8062 if(op1->type)
8063 op1->type->refCount++;
8064 }
8065 return 1;
8066 }
8067
8068 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8069 {
8070 long long value2 = op2->__anon1.i64;
8071
8072 exp->type = 2;
8073 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8074 if(!exp->expType)
8075 {
8076 exp->expType = op1->type;
8077 if(op1->type)
8078 op1->type->refCount++;
8079 }
8080 return 1;
8081 }
8082
8083 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8084 {
8085 uint64 value2 = op2->__anon1.ui64;
8086
8087 exp->type = 2;
8088 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8089 if(!exp->expType)
8090 {
8091 exp->expType = op1->type;
8092 if(op1->type)
8093 op1->type->refCount++;
8094 }
8095 return 1;
8096 }
8097
8098 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8099 {
8100 short value2 = op2->__anon1.s;
8101
8102 exp->type = 2;
8103 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8104 if(!exp->expType)
8105 {
8106 exp->expType = op1->type;
8107 if(op1->type)
8108 op1->type->refCount++;
8109 }
8110 return 1;
8111 }
8112
8113 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 {
8115 unsigned short value2 = op2->__anon1.us;
8116
8117 exp->type = 2;
8118 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8119 if(!exp->expType)
8120 {
8121 exp->expType = op1->type;
8122 if(op1->type)
8123 op1->type->refCount++;
8124 }
8125 return 1;
8126 }
8127
8128 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 {
8130 char value2 = op2->__anon1.c;
8131
8132 exp->type = 2;
8133 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8134 if(!exp->expType)
8135 {
8136 exp->expType = op1->type;
8137 if(op1->type)
8138 op1->type->refCount++;
8139 }
8140 return 1;
8141 }
8142
8143 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 {
8145 unsigned char value2 = op2->__anon1.uc;
8146
8147 exp->type = 2;
8148 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8149 if(!exp->expType)
8150 {
8151 exp->expType = op1->type;
8152 if(op1->type)
8153 op1->type->refCount++;
8154 }
8155 return 1;
8156 }
8157
8158 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 {
8160 int value2 = op2->__anon1.i;
8161
8162 exp->type = 2;
8163 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8164 if(!exp->expType)
8165 {
8166 exp->expType = op1->type;
8167 if(op1->type)
8168 op1->type->refCount++;
8169 }
8170 return 1;
8171 }
8172
8173 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 {
8175 unsigned int value2 = op2->__anon1.ui;
8176
8177 exp->type = 2;
8178 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8179 if(!exp->expType)
8180 {
8181 exp->expType = op1->type;
8182 if(op1->type)
8183 op1->type->refCount++;
8184 }
8185 return 1;
8186 }
8187
8188 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 {
8190 long long value2 = op2->__anon1.i64;
8191
8192 exp->type = 2;
8193 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8194 if(!exp->expType)
8195 {
8196 exp->expType = op1->type;
8197 if(op1->type)
8198 op1->type->refCount++;
8199 }
8200 return 1;
8201 }
8202
8203 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 {
8205 uint64 value2 = op2->__anon1.ui64;
8206
8207 exp->type = 2;
8208 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8209 if(!exp->expType)
8210 {
8211 exp->expType = op1->type;
8212 if(op1->type)
8213 op1->type->refCount++;
8214 }
8215 return 1;
8216 }
8217
8218 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8219 {
8220 short value2 = op2->__anon1.s;
8221
8222 exp->type = 2;
8223 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8224 if(!exp->expType)
8225 {
8226 exp->expType = op1->type;
8227 if(op1->type)
8228 op1->type->refCount++;
8229 }
8230 return 1;
8231 }
8232
8233 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 {
8235 unsigned short value2 = op2->__anon1.us;
8236
8237 exp->type = 2;
8238 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8239 if(!exp->expType)
8240 {
8241 exp->expType = op1->type;
8242 if(op1->type)
8243 op1->type->refCount++;
8244 }
8245 return 1;
8246 }
8247
8248 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 {
8250 char value2 = op2->__anon1.c;
8251
8252 exp->type = 2;
8253 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8254 if(!exp->expType)
8255 {
8256 exp->expType = op1->type;
8257 if(op1->type)
8258 op1->type->refCount++;
8259 }
8260 return 1;
8261 }
8262
8263 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 {
8265 unsigned char value2 = op2->__anon1.uc;
8266
8267 exp->type = 2;
8268 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8269 if(!exp->expType)
8270 {
8271 exp->expType = op1->type;
8272 if(op1->type)
8273 op1->type->refCount++;
8274 }
8275 return 1;
8276 }
8277
8278 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 {
8280 int value2 = op2->__anon1.i;
8281
8282 exp->type = 2;
8283 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8284 if(!exp->expType)
8285 {
8286 exp->expType = op1->type;
8287 if(op1->type)
8288 op1->type->refCount++;
8289 }
8290 return 1;
8291 }
8292
8293 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 {
8295 unsigned int value2 = op2->__anon1.ui;
8296
8297 exp->type = 2;
8298 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8299 if(!exp->expType)
8300 {
8301 exp->expType = op1->type;
8302 if(op1->type)
8303 op1->type->refCount++;
8304 }
8305 return 1;
8306 }
8307
8308 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 {
8310 long long value2 = op2->__anon1.i64;
8311
8312 exp->type = 2;
8313 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8314 if(!exp->expType)
8315 {
8316 exp->expType = op1->type;
8317 if(op1->type)
8318 op1->type->refCount++;
8319 }
8320 return 1;
8321 }
8322
8323 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 {
8325 uint64 value2 = op2->__anon1.ui64;
8326
8327 exp->type = 2;
8328 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8329 if(!exp->expType)
8330 {
8331 exp->expType = op1->type;
8332 if(op1->type)
8333 op1->type->refCount++;
8334 }
8335 return 1;
8336 }
8337
8338 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 {
8340 short value2 = op2->__anon1.s;
8341
8342 exp->type = 2;
8343 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8344 if(!exp->expType)
8345 {
8346 exp->expType = op1->type;
8347 if(op1->type)
8348 op1->type->refCount++;
8349 }
8350 return 1;
8351 }
8352
8353 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 {
8355 unsigned short value2 = op2->__anon1.us;
8356
8357 exp->type = 2;
8358 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8359 if(!exp->expType)
8360 {
8361 exp->expType = op1->type;
8362 if(op1->type)
8363 op1->type->refCount++;
8364 }
8365 return 1;
8366 }
8367
8368 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 {
8370 char value2 = op2->__anon1.c;
8371
8372 exp->type = 2;
8373 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8374 if(!exp->expType)
8375 {
8376 exp->expType = op1->type;
8377 if(op1->type)
8378 op1->type->refCount++;
8379 }
8380 return 1;
8381 }
8382
8383 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 {
8385 unsigned char value2 = op2->__anon1.uc;
8386
8387 exp->type = 2;
8388 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8389 if(!exp->expType)
8390 {
8391 exp->expType = op1->type;
8392 if(op1->type)
8393 op1->type->refCount++;
8394 }
8395 return 1;
8396 }
8397
8398 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 {
8400 int value2 = op2->__anon1.i;
8401
8402 exp->type = 2;
8403 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8404 if(!exp->expType)
8405 {
8406 exp->expType = op1->type;
8407 if(op1->type)
8408 op1->type->refCount++;
8409 }
8410 return 1;
8411 }
8412
8413 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 {
8415 unsigned int value2 = op2->__anon1.ui;
8416
8417 exp->type = 2;
8418 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8419 if(!exp->expType)
8420 {
8421 exp->expType = op1->type;
8422 if(op1->type)
8423 op1->type->refCount++;
8424 }
8425 return 1;
8426 }
8427
8428 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 {
8430 long long value2 = op2->__anon1.i64;
8431
8432 exp->type = 2;
8433 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8434 if(!exp->expType)
8435 {
8436 exp->expType = op1->type;
8437 if(op1->type)
8438 op1->type->refCount++;
8439 }
8440 return 1;
8441 }
8442
8443 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 {
8445 uint64 value2 = op2->__anon1.ui64;
8446
8447 exp->type = 2;
8448 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8449 if(!exp->expType)
8450 {
8451 exp->expType = op1->type;
8452 if(op1->type)
8453 op1->type->refCount++;
8454 }
8455 return 1;
8456 }
8457
8458 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 {
8460 short value2 = op2->__anon1.s;
8461
8462 exp->type = 2;
8463 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8464 if(!exp->expType)
8465 {
8466 exp->expType = op1->type;
8467 if(op1->type)
8468 op1->type->refCount++;
8469 }
8470 return 1;
8471 }
8472
8473 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 {
8475 unsigned short value2 = op2->__anon1.us;
8476
8477 exp->type = 2;
8478 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8479 if(!exp->expType)
8480 {
8481 exp->expType = op1->type;
8482 if(op1->type)
8483 op1->type->refCount++;
8484 }
8485 return 1;
8486 }
8487
8488 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 {
8490 char value2 = op2->__anon1.c;
8491
8492 exp->type = 2;
8493 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8494 if(!exp->expType)
8495 {
8496 exp->expType = op1->type;
8497 if(op1->type)
8498 op1->type->refCount++;
8499 }
8500 return 1;
8501 }
8502
8503 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 {
8505 unsigned char value2 = op2->__anon1.uc;
8506
8507 exp->type = 2;
8508 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8509 if(!exp->expType)
8510 {
8511 exp->expType = op1->type;
8512 if(op1->type)
8513 op1->type->refCount++;
8514 }
8515 return 1;
8516 }
8517
8518 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 {
8520 int value2 = op2->__anon1.i;
8521
8522 exp->type = 2;
8523 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8524 if(!exp->expType)
8525 {
8526 exp->expType = op1->type;
8527 if(op1->type)
8528 op1->type->refCount++;
8529 }
8530 return 1;
8531 }
8532
8533 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 {
8535 unsigned int value2 = op2->__anon1.ui;
8536
8537 exp->type = 2;
8538 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8539 if(!exp->expType)
8540 {
8541 exp->expType = op1->type;
8542 if(op1->type)
8543 op1->type->refCount++;
8544 }
8545 return 1;
8546 }
8547
8548 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 {
8550 long long value2 = op2->__anon1.i64;
8551
8552 exp->type = 2;
8553 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8554 if(!exp->expType)
8555 {
8556 exp->expType = op1->type;
8557 if(op1->type)
8558 op1->type->refCount++;
8559 }
8560 return 1;
8561 }
8562
8563 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 {
8565 uint64 value2 = op2->__anon1.ui64;
8566
8567 exp->type = 2;
8568 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8569 if(!exp->expType)
8570 {
8571 exp->expType = op1->type;
8572 if(op1->type)
8573 op1->type->refCount++;
8574 }
8575 return 1;
8576 }
8577
8578 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 {
8580 short value2 = op2->__anon1.s;
8581
8582 exp->type = 2;
8583 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8584 if(!exp->expType)
8585 {
8586 exp->expType = op1->type;
8587 if(op1->type)
8588 op1->type->refCount++;
8589 }
8590 return 1;
8591 }
8592
8593 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 {
8595 unsigned short value2 = op2->__anon1.us;
8596
8597 exp->type = 2;
8598 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8599 if(!exp->expType)
8600 {
8601 exp->expType = op1->type;
8602 if(op1->type)
8603 op1->type->refCount++;
8604 }
8605 return 1;
8606 }
8607
8608 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 {
8610 char value2 = op2->__anon1.c;
8611
8612 exp->type = 2;
8613 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8614 if(!exp->expType)
8615 {
8616 exp->expType = op1->type;
8617 if(op1->type)
8618 op1->type->refCount++;
8619 }
8620 return 1;
8621 }
8622
8623 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 {
8625 unsigned char value2 = op2->__anon1.uc;
8626
8627 exp->type = 2;
8628 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8629 if(!exp->expType)
8630 {
8631 exp->expType = op1->type;
8632 if(op1->type)
8633 op1->type->refCount++;
8634 }
8635 return 1;
8636 }
8637
8638 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8639 {
8640 exp->type = 2;
8641 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8642 if(!exp->expType)
8643 {
8644 exp->expType = op1->type;
8645 if(op1->type)
8646 op1->type->refCount++;
8647 }
8648 return 1;
8649 }
8650
8651 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8652 {
8653 exp->type = 2;
8654 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8655 if(!exp->expType)
8656 {
8657 exp->expType = op1->type;
8658 if(op1->type)
8659 op1->type->refCount++;
8660 }
8661 return 1;
8662 }
8663
8664 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8665 {
8666 exp->type = 2;
8667 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8668 if(!exp->expType)
8669 {
8670 exp->expType = op1->type;
8671 if(op1->type)
8672 op1->type->refCount++;
8673 }
8674 return 1;
8675 }
8676
8677 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8678 {
8679 exp->type = 2;
8680 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8681 if(!exp->expType)
8682 {
8683 exp->expType = op1->type;
8684 if(op1->type)
8685 op1->type->refCount++;
8686 }
8687 return 1;
8688 }
8689
8690 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8691 {
8692 exp->type = 2;
8693 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8694 if(!exp->expType)
8695 {
8696 exp->expType = op1->type;
8697 if(op1->type)
8698 op1->type->refCount++;
8699 }
8700 return 1;
8701 }
8702
8703 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8704 {
8705 exp->type = 2;
8706 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8707 if(!exp->expType)
8708 {
8709 exp->expType = op1->type;
8710 if(op1->type)
8711 op1->type->refCount++;
8712 }
8713 return 1;
8714 }
8715
8716 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8717 {
8718 exp->type = 2;
8719 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8720 if(!exp->expType)
8721 {
8722 exp->expType = op1->type;
8723 if(op1->type)
8724 op1->type->refCount++;
8725 }
8726 return 1;
8727 }
8728
8729 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8730 {
8731 exp->type = 2;
8732 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8733 if(!exp->expType)
8734 {
8735 exp->expType = op1->type;
8736 if(op1->type)
8737 op1->type->refCount++;
8738 }
8739 return 1;
8740 }
8741
8742 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 {
8744 int value2 = op2->__anon1.i;
8745
8746 exp->type = 2;
8747 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8748 if(!exp->expType)
8749 {
8750 exp->expType = op1->type;
8751 if(op1->type)
8752 op1->type->refCount++;
8753 }
8754 return 1;
8755 }
8756
8757 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 {
8759 unsigned int value2 = op2->__anon1.ui;
8760
8761 exp->type = 2;
8762 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8763 if(!exp->expType)
8764 {
8765 exp->expType = op1->type;
8766 if(op1->type)
8767 op1->type->refCount++;
8768 }
8769 return 1;
8770 }
8771
8772 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 {
8774 long long value2 = op2->__anon1.i64;
8775
8776 exp->type = 2;
8777 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8778 if(!exp->expType)
8779 {
8780 exp->expType = op1->type;
8781 if(op1->type)
8782 op1->type->refCount++;
8783 }
8784 return 1;
8785 }
8786
8787 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 {
8789 uint64 value2 = op2->__anon1.ui64;
8790
8791 exp->type = 2;
8792 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8793 if(!exp->expType)
8794 {
8795 exp->expType = op1->type;
8796 if(op1->type)
8797 op1->type->refCount++;
8798 }
8799 return 1;
8800 }
8801
8802 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 {
8804 short value2 = op2->__anon1.s;
8805
8806 exp->type = 2;
8807 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8808 if(!exp->expType)
8809 {
8810 exp->expType = op1->type;
8811 if(op1->type)
8812 op1->type->refCount++;
8813 }
8814 return 1;
8815 }
8816
8817 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 {
8819 unsigned short value2 = op2->__anon1.us;
8820
8821 exp->type = 2;
8822 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8823 if(!exp->expType)
8824 {
8825 exp->expType = op1->type;
8826 if(op1->type)
8827 op1->type->refCount++;
8828 }
8829 return 1;
8830 }
8831
8832 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 {
8834 char value2 = op2->__anon1.c;
8835
8836 exp->type = 2;
8837 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8838 if(!exp->expType)
8839 {
8840 exp->expType = op1->type;
8841 if(op1->type)
8842 op1->type->refCount++;
8843 }
8844 return 1;
8845 }
8846
8847 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 {
8849 unsigned char value2 = op2->__anon1.uc;
8850
8851 exp->type = 2;
8852 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8853 if(!exp->expType)
8854 {
8855 exp->expType = op1->type;
8856 if(op1->type)
8857 op1->type->refCount++;
8858 }
8859 return 1;
8860 }
8861
8862 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 {
8864 int value2 = op2->__anon1.i;
8865
8866 exp->type = 2;
8867 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8868 if(!exp->expType)
8869 {
8870 exp->expType = op1->type;
8871 if(op1->type)
8872 op1->type->refCount++;
8873 }
8874 return 1;
8875 }
8876
8877 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 {
8879 unsigned int value2 = op2->__anon1.ui;
8880
8881 exp->type = 2;
8882 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8883 if(!exp->expType)
8884 {
8885 exp->expType = op1->type;
8886 if(op1->type)
8887 op1->type->refCount++;
8888 }
8889 return 1;
8890 }
8891
8892 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 {
8894 long long value2 = op2->__anon1.i64;
8895
8896 exp->type = 2;
8897 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8898 if(!exp->expType)
8899 {
8900 exp->expType = op1->type;
8901 if(op1->type)
8902 op1->type->refCount++;
8903 }
8904 return 1;
8905 }
8906
8907 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 {
8909 uint64 value2 = op2->__anon1.ui64;
8910
8911 exp->type = 2;
8912 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8913 if(!exp->expType)
8914 {
8915 exp->expType = op1->type;
8916 if(op1->type)
8917 op1->type->refCount++;
8918 }
8919 return 1;
8920 }
8921
8922 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8923 {
8924 short value2 = op2->__anon1.s;
8925
8926 exp->type = 2;
8927 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8928 if(!exp->expType)
8929 {
8930 exp->expType = op1->type;
8931 if(op1->type)
8932 op1->type->refCount++;
8933 }
8934 return 1;
8935 }
8936
8937 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8938 {
8939 unsigned short value2 = op2->__anon1.us;
8940
8941 exp->type = 2;
8942 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8943 if(!exp->expType)
8944 {
8945 exp->expType = op1->type;
8946 if(op1->type)
8947 op1->type->refCount++;
8948 }
8949 return 1;
8950 }
8951
8952 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8953 {
8954 char value2 = op2->__anon1.c;
8955
8956 exp->type = 2;
8957 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8958 if(!exp->expType)
8959 {
8960 exp->expType = op1->type;
8961 if(op1->type)
8962 op1->type->refCount++;
8963 }
8964 return 1;
8965 }
8966
8967 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8968 {
8969 unsigned char value2 = op2->__anon1.uc;
8970
8971 exp->type = 2;
8972 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8973 if(!exp->expType)
8974 {
8975 exp->expType = op1->type;
8976 if(op1->type)
8977 op1->type->refCount++;
8978 }
8979 return 1;
8980 }
8981
8982 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8983 {
8984 int value2 = op2->__anon1.i;
8985
8986 exp->type = 2;
8987 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8988 if(!exp->expType)
8989 {
8990 exp->expType = op1->type;
8991 if(op1->type)
8992 op1->type->refCount++;
8993 }
8994 return 1;
8995 }
8996
8997 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8998 {
8999 unsigned int value2 = op2->__anon1.ui;
9000
9001 exp->type = 2;
9002 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
9003 if(!exp->expType)
9004 {
9005 exp->expType = op1->type;
9006 if(op1->type)
9007 op1->type->refCount++;
9008 }
9009 return 1;
9010 }
9011
9012 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9013 {
9014 long long value2 = op2->__anon1.i64;
9015
9016 exp->type = 2;
9017 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
9018 if(!exp->expType)
9019 {
9020 exp->expType = op1->type;
9021 if(op1->type)
9022 op1->type->refCount++;
9023 }
9024 return 1;
9025 }
9026
9027 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 {
9029 uint64 value2 = op2->__anon1.ui64;
9030
9031 exp->type = 2;
9032 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
9033 if(!exp->expType)
9034 {
9035 exp->expType = op1->type;
9036 if(op1->type)
9037 op1->type->refCount++;
9038 }
9039 return 1;
9040 }
9041
9042 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 {
9044 short value2 = op2->__anon1.s;
9045
9046 exp->type = 2;
9047 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
9048 if(!exp->expType)
9049 {
9050 exp->expType = op1->type;
9051 if(op1->type)
9052 op1->type->refCount++;
9053 }
9054 return 1;
9055 }
9056
9057 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 {
9059 unsigned short value2 = op2->__anon1.us;
9060
9061 exp->type = 2;
9062 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9063 if(!exp->expType)
9064 {
9065 exp->expType = op1->type;
9066 if(op1->type)
9067 op1->type->refCount++;
9068 }
9069 return 1;
9070 }
9071
9072 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 {
9074 char value2 = op2->__anon1.c;
9075
9076 exp->type = 2;
9077 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9078 if(!exp->expType)
9079 {
9080 exp->expType = op1->type;
9081 if(op1->type)
9082 op1->type->refCount++;
9083 }
9084 return 1;
9085 }
9086
9087 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 {
9089 unsigned char value2 = op2->__anon1.uc;
9090
9091 exp->type = 2;
9092 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9093 if(!exp->expType)
9094 {
9095 exp->expType = op1->type;
9096 if(op1->type)
9097 op1->type->refCount++;
9098 }
9099 return 1;
9100 }
9101
9102 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 {
9104 int value2 = op2->__anon1.i;
9105
9106 exp->type = 2;
9107 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9108 if(!exp->expType)
9109 {
9110 exp->expType = op1->type;
9111 if(op1->type)
9112 op1->type->refCount++;
9113 }
9114 return 1;
9115 }
9116
9117 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 {
9119 unsigned int value2 = op2->__anon1.ui;
9120
9121 exp->type = 2;
9122 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9123 if(!exp->expType)
9124 {
9125 exp->expType = op1->type;
9126 if(op1->type)
9127 op1->type->refCount++;
9128 }
9129 return 1;
9130 }
9131
9132 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9133 {
9134 long long value2 = op2->__anon1.i64;
9135
9136 exp->type = 2;
9137 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9138 if(!exp->expType)
9139 {
9140 exp->expType = op1->type;
9141 if(op1->type)
9142 op1->type->refCount++;
9143 }
9144 return 1;
9145 }
9146
9147 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9148 {
9149 uint64 value2 = op2->__anon1.ui64;
9150
9151 exp->type = 2;
9152 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9153 if(!exp->expType)
9154 {
9155 exp->expType = op1->type;
9156 if(op1->type)
9157 op1->type->refCount++;
9158 }
9159 return 1;
9160 }
9161
9162 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9163 {
9164 short value2 = op2->__anon1.s;
9165
9166 exp->type = 2;
9167 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9168 if(!exp->expType)
9169 {
9170 exp->expType = op1->type;
9171 if(op1->type)
9172 op1->type->refCount++;
9173 }
9174 return 1;
9175 }
9176
9177 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9178 {
9179 unsigned short value2 = op2->__anon1.us;
9180
9181 exp->type = 2;
9182 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9183 if(!exp->expType)
9184 {
9185 exp->expType = op1->type;
9186 if(op1->type)
9187 op1->type->refCount++;
9188 }
9189 return 1;
9190 }
9191
9192 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9193 {
9194 char value2 = op2->__anon1.c;
9195
9196 exp->type = 2;
9197 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9198 if(!exp->expType)
9199 {
9200 exp->expType = op1->type;
9201 if(op1->type)
9202 op1->type->refCount++;
9203 }
9204 return 1;
9205 }
9206
9207 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9208 {
9209 unsigned char value2 = op2->__anon1.uc;
9210
9211 exp->type = 2;
9212 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9213 if(!exp->expType)
9214 {
9215 exp->expType = op1->type;
9216 if(op1->type)
9217 op1->type->refCount++;
9218 }
9219 return 1;
9220 }
9221
9222 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9223 {
9224 int value2 = op2->__anon1.i;
9225
9226 exp->type = 2;
9227 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9228 if(!exp->expType)
9229 {
9230 exp->expType = op1->type;
9231 if(op1->type)
9232 op1->type->refCount++;
9233 }
9234 return 1;
9235 }
9236
9237 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9238 {
9239 unsigned int value2 = op2->__anon1.ui;
9240
9241 exp->type = 2;
9242 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9243 if(!exp->expType)
9244 {
9245 exp->expType = op1->type;
9246 if(op1->type)
9247 op1->type->refCount++;
9248 }
9249 return 1;
9250 }
9251
9252 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9253 {
9254 long long value2 = op2->__anon1.i64;
9255
9256 exp->type = 2;
9257 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9258 if(!exp->expType)
9259 {
9260 exp->expType = op1->type;
9261 if(op1->type)
9262 op1->type->refCount++;
9263 }
9264 return 1;
9265 }
9266
9267 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9268 {
9269 uint64 value2 = op2->__anon1.ui64;
9270
9271 exp->type = 2;
9272 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9273 if(!exp->expType)
9274 {
9275 exp->expType = op1->type;
9276 if(op1->type)
9277 op1->type->refCount++;
9278 }
9279 return 1;
9280 }
9281
9282 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9283 {
9284 short value2 = op2->__anon1.s;
9285
9286 exp->type = 2;
9287 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9288 if(!exp->expType)
9289 {
9290 exp->expType = op1->type;
9291 if(op1->type)
9292 op1->type->refCount++;
9293 }
9294 return 1;
9295 }
9296
9297 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9298 {
9299 unsigned short value2 = op2->__anon1.us;
9300
9301 exp->type = 2;
9302 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9303 if(!exp->expType)
9304 {
9305 exp->expType = op1->type;
9306 if(op1->type)
9307 op1->type->refCount++;
9308 }
9309 return 1;
9310 }
9311
9312 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9313 {
9314 char value2 = op2->__anon1.c;
9315
9316 exp->type = 2;
9317 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9318 if(!exp->expType)
9319 {
9320 exp->expType = op1->type;
9321 if(op1->type)
9322 op1->type->refCount++;
9323 }
9324 return 1;
9325 }
9326
9327 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9328 {
9329 unsigned char value2 = op2->__anon1.uc;
9330
9331 exp->type = 2;
9332 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9333 if(!exp->expType)
9334 {
9335 exp->expType = op1->type;
9336 if(op1->type)
9337 op1->type->refCount++;
9338 }
9339 return 1;
9340 }
9341
9342 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9343 {
9344 exp->type = 2;
9345 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9346 if(!exp->expType)
9347 {
9348 exp->expType = op1->type;
9349 if(op1->type)
9350 op1->type->refCount++;
9351 }
9352 return 1;
9353 }
9354
9355 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9356 {
9357 exp->type = 2;
9358 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9359 if(!exp->expType)
9360 {
9361 exp->expType = op1->type;
9362 if(op1->type)
9363 op1->type->refCount++;
9364 }
9365 return 1;
9366 }
9367
9368 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9369 {
9370 exp->type = 2;
9371 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9372 if(!exp->expType)
9373 {
9374 exp->expType = op1->type;
9375 if(op1->type)
9376 op1->type->refCount++;
9377 }
9378 return 1;
9379 }
9380
9381 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9382 {
9383 exp->type = 2;
9384 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9385 if(!exp->expType)
9386 {
9387 exp->expType = op1->type;
9388 if(op1->type)
9389 op1->type->refCount++;
9390 }
9391 return 1;
9392 }
9393
9394 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9395 {
9396 exp->type = 2;
9397 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9398 if(!exp->expType)
9399 {
9400 exp->expType = op1->type;
9401 if(op1->type)
9402 op1->type->refCount++;
9403 }
9404 return 1;
9405 }
9406
9407 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9408 {
9409 exp->type = 2;
9410 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9411 if(!exp->expType)
9412 {
9413 exp->expType = op1->type;
9414 if(op1->type)
9415 op1->type->refCount++;
9416 }
9417 return 1;
9418 }
9419
9420 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9421 {
9422 exp->type = 2;
9423 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9424 if(!exp->expType)
9425 {
9426 exp->expType = op1->type;
9427 if(op1->type)
9428 op1->type->refCount++;
9429 }
9430 return 1;
9431 }
9432
9433 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9434 {
9435 exp->type = 2;
9436 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9437 if(!exp->expType)
9438 {
9439 exp->expType = op1->type;
9440 if(op1->type)
9441 op1->type->refCount++;
9442 }
9443 return 1;
9444 }
9445
9446 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9447 {
9448 int value2 = op2->__anon1.i;
9449
9450 exp->type = 2;
9451 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9452 if(!exp->expType)
9453 {
9454 exp->expType = op1->type;
9455 if(op1->type)
9456 op1->type->refCount++;
9457 }
9458 return 1;
9459 }
9460
9461 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9462 {
9463 unsigned int value2 = op2->__anon1.ui;
9464
9465 exp->type = 2;
9466 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9467 if(!exp->expType)
9468 {
9469 exp->expType = op1->type;
9470 if(op1->type)
9471 op1->type->refCount++;
9472 }
9473 return 1;
9474 }
9475
9476 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9477 {
9478 long long value2 = op2->__anon1.i64;
9479
9480 exp->type = 2;
9481 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9482 if(!exp->expType)
9483 {
9484 exp->expType = op1->type;
9485 if(op1->type)
9486 op1->type->refCount++;
9487 }
9488 return 1;
9489 }
9490
9491 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9492 {
9493 uint64 value2 = op2->__anon1.ui64;
9494
9495 exp->type = 2;
9496 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9497 if(!exp->expType)
9498 {
9499 exp->expType = op1->type;
9500 if(op1->type)
9501 op1->type->refCount++;
9502 }
9503 return 1;
9504 }
9505
9506 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9507 {
9508 short value2 = op2->__anon1.s;
9509
9510 exp->type = 2;
9511 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9512 if(!exp->expType)
9513 {
9514 exp->expType = op1->type;
9515 if(op1->type)
9516 op1->type->refCount++;
9517 }
9518 return 1;
9519 }
9520
9521 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9522 {
9523 unsigned short value2 = op2->__anon1.us;
9524
9525 exp->type = 2;
9526 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9527 if(!exp->expType)
9528 {
9529 exp->expType = op1->type;
9530 if(op1->type)
9531 op1->type->refCount++;
9532 }
9533 return 1;
9534 }
9535
9536 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9537 {
9538 char value2 = op2->__anon1.c;
9539
9540 exp->type = 2;
9541 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9542 if(!exp->expType)
9543 {
9544 exp->expType = op1->type;
9545 if(op1->type)
9546 op1->type->refCount++;
9547 }
9548 return 1;
9549 }
9550
9551 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9552 {
9553 unsigned char value2 = op2->__anon1.uc;
9554
9555 exp->type = 2;
9556 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9557 if(!exp->expType)
9558 {
9559 exp->expType = op1->type;
9560 if(op1->type)
9561 op1->type->refCount++;
9562 }
9563 return 1;
9564 }
9565
9566 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9567 {
9568 float value2 = op2->__anon1.f;
9569
9570 exp->type = 2;
9571 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9572 if(!exp->expType)
9573 {
9574 exp->expType = op1->type;
9575 if(op1->type)
9576 op1->type->refCount++;
9577 }
9578 return 1;
9579 }
9580
9581 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9582 {
9583 double value2 = op2->__anon1.d;
9584
9585 exp->type = 2;
9586 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9587 if(!exp->expType)
9588 {
9589 exp->expType = op1->type;
9590 if(op1->type)
9591 op1->type->refCount++;
9592 }
9593 return 1;
9594 }
9595
9596 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9597 {
9598 int value2 = op2->__anon1.i;
9599
9600 exp->type = 2;
9601 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9602 if(!exp->expType)
9603 {
9604 exp->expType = op1->type;
9605 if(op1->type)
9606 op1->type->refCount++;
9607 }
9608 return 1;
9609 }
9610
9611 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9612 {
9613 unsigned int value2 = op2->__anon1.ui;
9614
9615 exp->type = 2;
9616 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9617 if(!exp->expType)
9618 {
9619 exp->expType = op1->type;
9620 if(op1->type)
9621 op1->type->refCount++;
9622 }
9623 return 1;
9624 }
9625
9626 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9627 {
9628 long long value2 = op2->__anon1.i64;
9629
9630 exp->type = 2;
9631 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9632 if(!exp->expType)
9633 {
9634 exp->expType = op1->type;
9635 if(op1->type)
9636 op1->type->refCount++;
9637 }
9638 return 1;
9639 }
9640
9641 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9642 {
9643 uint64 value2 = op2->__anon1.ui64;
9644
9645 exp->type = 2;
9646 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9647 if(!exp->expType)
9648 {
9649 exp->expType = op1->type;
9650 if(op1->type)
9651 op1->type->refCount++;
9652 }
9653 return 1;
9654 }
9655
9656 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9657 {
9658 short value2 = op2->__anon1.s;
9659
9660 exp->type = 2;
9661 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9662 if(!exp->expType)
9663 {
9664 exp->expType = op1->type;
9665 if(op1->type)
9666 op1->type->refCount++;
9667 }
9668 return 1;
9669 }
9670
9671 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9672 {
9673 unsigned short value2 = op2->__anon1.us;
9674
9675 exp->type = 2;
9676 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9677 if(!exp->expType)
9678 {
9679 exp->expType = op1->type;
9680 if(op1->type)
9681 op1->type->refCount++;
9682 }
9683 return 1;
9684 }
9685
9686 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9687 {
9688 char value2 = op2->__anon1.c;
9689
9690 exp->type = 2;
9691 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9692 if(!exp->expType)
9693 {
9694 exp->expType = op1->type;
9695 if(op1->type)
9696 op1->type->refCount++;
9697 }
9698 return 1;
9699 }
9700
9701 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9702 {
9703 unsigned char value2 = op2->__anon1.uc;
9704
9705 exp->type = 2;
9706 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9707 if(!exp->expType)
9708 {
9709 exp->expType = op1->type;
9710 if(op1->type)
9711 op1->type->refCount++;
9712 }
9713 return 1;
9714 }
9715
9716 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9717 {
9718 float value2 = op2->__anon1.f;
9719
9720 exp->type = 2;
9721 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9722 if(!exp->expType)
9723 {
9724 exp->expType = op1->type;
9725 if(op1->type)
9726 op1->type->refCount++;
9727 }
9728 return 1;
9729 }
9730
9731 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9732 {
9733 double value2 = op2->__anon1.d;
9734
9735 exp->type = 2;
9736 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9737 if(!exp->expType)
9738 {
9739 exp->expType = op1->type;
9740 if(op1->type)
9741 op1->type->refCount++;
9742 }
9743 return 1;
9744 }
9745
9746 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9747 {
9748 int value2 = op2->__anon1.i;
9749
9750 exp->type = 2;
9751 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9752 if(!exp->expType)
9753 {
9754 exp->expType = op1->type;
9755 if(op1->type)
9756 op1->type->refCount++;
9757 }
9758 return 1;
9759 }
9760
9761 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9762 {
9763 unsigned int value2 = op2->__anon1.ui;
9764
9765 exp->type = 2;
9766 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9767 if(!exp->expType)
9768 {
9769 exp->expType = op1->type;
9770 if(op1->type)
9771 op1->type->refCount++;
9772 }
9773 return 1;
9774 }
9775
9776 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9777 {
9778 long long value2 = op2->__anon1.i64;
9779
9780 exp->type = 2;
9781 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9782 if(!exp->expType)
9783 {
9784 exp->expType = op1->type;
9785 if(op1->type)
9786 op1->type->refCount++;
9787 }
9788 return 1;
9789 }
9790
9791 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9792 {
9793 uint64 value2 = op2->__anon1.ui64;
9794
9795 exp->type = 2;
9796 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9797 if(!exp->expType)
9798 {
9799 exp->expType = op1->type;
9800 if(op1->type)
9801 op1->type->refCount++;
9802 }
9803 return 1;
9804 }
9805
9806 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9807 {
9808 short value2 = op2->__anon1.s;
9809
9810 exp->type = 2;
9811 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9812 if(!exp->expType)
9813 {
9814 exp->expType = op1->type;
9815 if(op1->type)
9816 op1->type->refCount++;
9817 }
9818 return 1;
9819 }
9820
9821 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9822 {
9823 unsigned short value2 = op2->__anon1.us;
9824
9825 exp->type = 2;
9826 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9827 if(!exp->expType)
9828 {
9829 exp->expType = op1->type;
9830 if(op1->type)
9831 op1->type->refCount++;
9832 }
9833 return 1;
9834 }
9835
9836 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9837 {
9838 char value2 = op2->__anon1.c;
9839
9840 exp->type = 2;
9841 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9842 if(!exp->expType)
9843 {
9844 exp->expType = op1->type;
9845 if(op1->type)
9846 op1->type->refCount++;
9847 }
9848 return 1;
9849 }
9850
9851 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9852 {
9853 unsigned char value2 = op2->__anon1.uc;
9854
9855 exp->type = 2;
9856 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9857 if(!exp->expType)
9858 {
9859 exp->expType = op1->type;
9860 if(op1->type)
9861 op1->type->refCount++;
9862 }
9863 return 1;
9864 }
9865
9866 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9867 {
9868 float value2 = op2->__anon1.f;
9869
9870 exp->type = 2;
9871 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9872 if(!exp->expType)
9873 {
9874 exp->expType = op1->type;
9875 if(op1->type)
9876 op1->type->refCount++;
9877 }
9878 return 1;
9879 }
9880
9881 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9882 {
9883 double value2 = op2->__anon1.d;
9884
9885 exp->type = 2;
9886 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9887 if(!exp->expType)
9888 {
9889 exp->expType = op1->type;
9890 if(op1->type)
9891 op1->type->refCount++;
9892 }
9893 return 1;
9894 }
9895
9896 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9897 {
9898 int value2 = op2->__anon1.i;
9899
9900 exp->type = 2;
9901 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9902 if(!exp->expType)
9903 {
9904 exp->expType = op1->type;
9905 if(op1->type)
9906 op1->type->refCount++;
9907 }
9908 return 1;
9909 }
9910
9911 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9912 {
9913 unsigned int value2 = op2->__anon1.ui;
9914
9915 exp->type = 2;
9916 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9917 if(!exp->expType)
9918 {
9919 exp->expType = op1->type;
9920 if(op1->type)
9921 op1->type->refCount++;
9922 }
9923 return 1;
9924 }
9925
9926 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9927 {
9928 long long value2 = op2->__anon1.i64;
9929
9930 exp->type = 2;
9931 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9932 if(!exp->expType)
9933 {
9934 exp->expType = op1->type;
9935 if(op1->type)
9936 op1->type->refCount++;
9937 }
9938 return 1;
9939 }
9940
9941 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9942 {
9943 uint64 value2 = op2->__anon1.ui64;
9944
9945 exp->type = 2;
9946 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9947 if(!exp->expType)
9948 {
9949 exp->expType = op1->type;
9950 if(op1->type)
9951 op1->type->refCount++;
9952 }
9953 return 1;
9954 }
9955
9956 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9957 {
9958 short value2 = op2->__anon1.s;
9959
9960 exp->type = 2;
9961 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9962 if(!exp->expType)
9963 {
9964 exp->expType = op1->type;
9965 if(op1->type)
9966 op1->type->refCount++;
9967 }
9968 return 1;
9969 }
9970
9971 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9972 {
9973 unsigned short value2 = op2->__anon1.us;
9974
9975 exp->type = 2;
9976 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9977 if(!exp->expType)
9978 {
9979 exp->expType = op1->type;
9980 if(op1->type)
9981 op1->type->refCount++;
9982 }
9983 return 1;
9984 }
9985
9986 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9987 {
9988 char value2 = op2->__anon1.c;
9989
9990 exp->type = 2;
9991 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9992 if(!exp->expType)
9993 {
9994 exp->expType = op1->type;
9995 if(op1->type)
9996 op1->type->refCount++;
9997 }
9998 return 1;
9999 }
10000
10001 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10002 {
10003 unsigned char value2 = op2->__anon1.uc;
10004
10005 exp->type = 2;
10006 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
10007 if(!exp->expType)
10008 {
10009 exp->expType = op1->type;
10010 if(op1->type)
10011 op1->type->refCount++;
10012 }
10013 return 1;
10014 }
10015
10016 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10017 {
10018 float value2 = op2->__anon1.f;
10019
10020 exp->type = 2;
10021 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
10022 if(!exp->expType)
10023 {
10024 exp->expType = op1->type;
10025 if(op1->type)
10026 op1->type->refCount++;
10027 }
10028 return 1;
10029 }
10030
10031 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10032 {
10033 double value2 = op2->__anon1.d;
10034
10035 exp->type = 2;
10036 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
10037 if(!exp->expType)
10038 {
10039 exp->expType = op1->type;
10040 if(op1->type)
10041 op1->type->refCount++;
10042 }
10043 return 1;
10044 }
10045
10046 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10047 {
10048 int value2 = op2->__anon1.i;
10049
10050 exp->type = 2;
10051 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10052 if(!exp->expType)
10053 {
10054 exp->expType = op1->type;
10055 if(op1->type)
10056 op1->type->refCount++;
10057 }
10058 return 1;
10059 }
10060
10061 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10062 {
10063 unsigned int value2 = op2->__anon1.ui;
10064
10065 exp->type = 2;
10066 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10067 if(!exp->expType)
10068 {
10069 exp->expType = op1->type;
10070 if(op1->type)
10071 op1->type->refCount++;
10072 }
10073 return 1;
10074 }
10075
10076 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10077 {
10078 long long value2 = op2->__anon1.i64;
10079
10080 exp->type = 2;
10081 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10082 if(!exp->expType)
10083 {
10084 exp->expType = op1->type;
10085 if(op1->type)
10086 op1->type->refCount++;
10087 }
10088 return 1;
10089 }
10090
10091 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10092 {
10093 uint64 value2 = op2->__anon1.ui64;
10094
10095 exp->type = 2;
10096 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10097 if(!exp->expType)
10098 {
10099 exp->expType = op1->type;
10100 if(op1->type)
10101 op1->type->refCount++;
10102 }
10103 return 1;
10104 }
10105
10106 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10107 {
10108 short value2 = op2->__anon1.s;
10109
10110 exp->type = 2;
10111 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10112 if(!exp->expType)
10113 {
10114 exp->expType = op1->type;
10115 if(op1->type)
10116 op1->type->refCount++;
10117 }
10118 return 1;
10119 }
10120
10121 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10122 {
10123 unsigned short value2 = op2->__anon1.us;
10124
10125 exp->type = 2;
10126 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10127 if(!exp->expType)
10128 {
10129 exp->expType = op1->type;
10130 if(op1->type)
10131 op1->type->refCount++;
10132 }
10133 return 1;
10134 }
10135
10136 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10137 {
10138 char value2 = op2->__anon1.c;
10139
10140 exp->type = 2;
10141 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10142 if(!exp->expType)
10143 {
10144 exp->expType = op1->type;
10145 if(op1->type)
10146 op1->type->refCount++;
10147 }
10148 return 1;
10149 }
10150
10151 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10152 {
10153 unsigned char value2 = op2->__anon1.uc;
10154
10155 exp->type = 2;
10156 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10157 if(!exp->expType)
10158 {
10159 exp->expType = op1->type;
10160 if(op1->type)
10161 op1->type->refCount++;
10162 }
10163 return 1;
10164 }
10165
10166 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10167 {
10168 float value2 = op2->__anon1.f;
10169
10170 exp->type = 2;
10171 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10172 if(!exp->expType)
10173 {
10174 exp->expType = op1->type;
10175 if(op1->type)
10176 op1->type->refCount++;
10177 }
10178 return 1;
10179 }
10180
10181 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10182 {
10183 double value2 = op2->__anon1.d;
10184
10185 exp->type = 2;
10186 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10187 if(!exp->expType)
10188 {
10189 exp->expType = op1->type;
10190 if(op1->type)
10191 op1->type->refCount++;
10192 }
10193 return 1;
10194 }
10195
10196 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10197 {
10198 int value2 = op2->__anon1.i;
10199
10200 exp->type = 2;
10201 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10202 if(!exp->expType)
10203 {
10204 exp->expType = op1->type;
10205 if(op1->type)
10206 op1->type->refCount++;
10207 }
10208 return 1;
10209 }
10210
10211 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10212 {
10213 unsigned int value2 = op2->__anon1.ui;
10214
10215 exp->type = 2;
10216 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10217 if(!exp->expType)
10218 {
10219 exp->expType = op1->type;
10220 if(op1->type)
10221 op1->type->refCount++;
10222 }
10223 return 1;
10224 }
10225
10226 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10227 {
10228 long long value2 = op2->__anon1.i64;
10229
10230 exp->type = 2;
10231 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10232 if(!exp->expType)
10233 {
10234 exp->expType = op1->type;
10235 if(op1->type)
10236 op1->type->refCount++;
10237 }
10238 return 1;
10239 }
10240
10241 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10242 {
10243 uint64 value2 = op2->__anon1.ui64;
10244
10245 exp->type = 2;
10246 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10247 if(!exp->expType)
10248 {
10249 exp->expType = op1->type;
10250 if(op1->type)
10251 op1->type->refCount++;
10252 }
10253 return 1;
10254 }
10255
10256 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10257 {
10258 short value2 = op2->__anon1.s;
10259
10260 exp->type = 2;
10261 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10262 if(!exp->expType)
10263 {
10264 exp->expType = op1->type;
10265 if(op1->type)
10266 op1->type->refCount++;
10267 }
10268 return 1;
10269 }
10270
10271 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10272 {
10273 unsigned short value2 = op2->__anon1.us;
10274
10275 exp->type = 2;
10276 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10277 if(!exp->expType)
10278 {
10279 exp->expType = op1->type;
10280 if(op1->type)
10281 op1->type->refCount++;
10282 }
10283 return 1;
10284 }
10285
10286 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10287 {
10288 char value2 = op2->__anon1.c;
10289
10290 exp->type = 2;
10291 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10292 if(!exp->expType)
10293 {
10294 exp->expType = op1->type;
10295 if(op1->type)
10296 op1->type->refCount++;
10297 }
10298 return 1;
10299 }
10300
10301 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10302 {
10303 unsigned char value2 = op2->__anon1.uc;
10304
10305 exp->type = 2;
10306 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10307 if(!exp->expType)
10308 {
10309 exp->expType = op1->type;
10310 if(op1->type)
10311 op1->type->refCount++;
10312 }
10313 return 1;
10314 }
10315
10316 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10317 {
10318 float value2 = op2->__anon1.f;
10319
10320 exp->type = 2;
10321 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10322 if(!exp->expType)
10323 {
10324 exp->expType = op1->type;
10325 if(op1->type)
10326 op1->type->refCount++;
10327 }
10328 return 1;
10329 }
10330
10331 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10332 {
10333 double value2 = op2->__anon1.d;
10334
10335 exp->type = 2;
10336 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10337 if(!exp->expType)
10338 {
10339 exp->expType = op1->type;
10340 if(op1->type)
10341 op1->type->refCount++;
10342 }
10343 return 1;
10344 }
10345
10346 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10347 {
10348 int value2 = op2->__anon1.i;
10349
10350 exp->type = 2;
10351 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10352 if(!exp->expType)
10353 {
10354 exp->expType = op1->type;
10355 if(op1->type)
10356 op1->type->refCount++;
10357 }
10358 return 1;
10359 }
10360
10361 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10362 {
10363 unsigned int value2 = op2->__anon1.ui;
10364
10365 exp->type = 2;
10366 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10367 if(!exp->expType)
10368 {
10369 exp->expType = op1->type;
10370 if(op1->type)
10371 op1->type->refCount++;
10372 }
10373 return 1;
10374 }
10375
10376 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10377 {
10378 long long value2 = op2->__anon1.i64;
10379
10380 exp->type = 2;
10381 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10382 if(!exp->expType)
10383 {
10384 exp->expType = op1->type;
10385 if(op1->type)
10386 op1->type->refCount++;
10387 }
10388 return 1;
10389 }
10390
10391 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10392 {
10393 uint64 value2 = op2->__anon1.ui64;
10394
10395 exp->type = 2;
10396 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10397 if(!exp->expType)
10398 {
10399 exp->expType = op1->type;
10400 if(op1->type)
10401 op1->type->refCount++;
10402 }
10403 return 1;
10404 }
10405
10406 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10407 {
10408 short value2 = op2->__anon1.s;
10409
10410 exp->type = 2;
10411 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10412 if(!exp->expType)
10413 {
10414 exp->expType = op1->type;
10415 if(op1->type)
10416 op1->type->refCount++;
10417 }
10418 return 1;
10419 }
10420
10421 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10422 {
10423 unsigned short value2 = op2->__anon1.us;
10424
10425 exp->type = 2;
10426 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10427 if(!exp->expType)
10428 {
10429 exp->expType = op1->type;
10430 if(op1->type)
10431 op1->type->refCount++;
10432 }
10433 return 1;
10434 }
10435
10436 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10437 {
10438 char value2 = op2->__anon1.c;
10439
10440 exp->type = 2;
10441 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10442 if(!exp->expType)
10443 {
10444 exp->expType = op1->type;
10445 if(op1->type)
10446 op1->type->refCount++;
10447 }
10448 return 1;
10449 }
10450
10451 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10452 {
10453 unsigned char value2 = op2->__anon1.uc;
10454
10455 exp->type = 2;
10456 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10457 if(!exp->expType)
10458 {
10459 exp->expType = op1->type;
10460 if(op1->type)
10461 op1->type->refCount++;
10462 }
10463 return 1;
10464 }
10465
10466 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10467 {
10468 float value2 = op2->__anon1.f;
10469
10470 exp->type = 2;
10471 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10472 if(!exp->expType)
10473 {
10474 exp->expType = op1->type;
10475 if(op1->type)
10476 op1->type->refCount++;
10477 }
10478 return 1;
10479 }
10480
10481 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10482 {
10483 double value2 = op2->__anon1.d;
10484
10485 exp->type = 2;
10486 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10487 if(!exp->expType)
10488 {
10489 exp->expType = op1->type;
10490 if(op1->type)
10491 op1->type->refCount++;
10492 }
10493 return 1;
10494 }
10495
10496 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10497 {
10498 int value2 = op2->__anon1.i;
10499
10500 exp->type = 2;
10501 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10502 if(!exp->expType)
10503 {
10504 exp->expType = op1->type;
10505 if(op1->type)
10506 op1->type->refCount++;
10507 }
10508 return 1;
10509 }
10510
10511 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10512 {
10513 unsigned int value2 = op2->__anon1.ui;
10514
10515 exp->type = 2;
10516 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10517 if(!exp->expType)
10518 {
10519 exp->expType = op1->type;
10520 if(op1->type)
10521 op1->type->refCount++;
10522 }
10523 return 1;
10524 }
10525
10526 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10527 {
10528 long long value2 = op2->__anon1.i64;
10529
10530 exp->type = 2;
10531 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10532 if(!exp->expType)
10533 {
10534 exp->expType = op1->type;
10535 if(op1->type)
10536 op1->type->refCount++;
10537 }
10538 return 1;
10539 }
10540
10541 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10542 {
10543 uint64 value2 = op2->__anon1.ui64;
10544
10545 exp->type = 2;
10546 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10547 if(!exp->expType)
10548 {
10549 exp->expType = op1->type;
10550 if(op1->type)
10551 op1->type->refCount++;
10552 }
10553 return 1;
10554 }
10555
10556 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10557 {
10558 short value2 = op2->__anon1.s;
10559
10560 exp->type = 2;
10561 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10562 if(!exp->expType)
10563 {
10564 exp->expType = op1->type;
10565 if(op1->type)
10566 op1->type->refCount++;
10567 }
10568 return 1;
10569 }
10570
10571 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10572 {
10573 unsigned short value2 = op2->__anon1.us;
10574
10575 exp->type = 2;
10576 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10577 if(!exp->expType)
10578 {
10579 exp->expType = op1->type;
10580 if(op1->type)
10581 op1->type->refCount++;
10582 }
10583 return 1;
10584 }
10585
10586 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10587 {
10588 char value2 = op2->__anon1.c;
10589
10590 exp->type = 2;
10591 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10592 if(!exp->expType)
10593 {
10594 exp->expType = op1->type;
10595 if(op1->type)
10596 op1->type->refCount++;
10597 }
10598 return 1;
10599 }
10600
10601 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10602 {
10603 unsigned char value2 = op2->__anon1.uc;
10604
10605 exp->type = 2;
10606 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10607 if(!exp->expType)
10608 {
10609 exp->expType = op1->type;
10610 if(op1->type)
10611 op1->type->refCount++;
10612 }
10613 return 1;
10614 }
10615
10616 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10617 {
10618 float value2 = op2->__anon1.f;
10619
10620 exp->type = 2;
10621 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10622 if(!exp->expType)
10623 {
10624 exp->expType = op1->type;
10625 if(op1->type)
10626 op1->type->refCount++;
10627 }
10628 return 1;
10629 }
10630
10631 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10632 {
10633 double value2 = op2->__anon1.d;
10634
10635 exp->type = 2;
10636 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10637 if(!exp->expType)
10638 {
10639 exp->expType = op1->type;
10640 if(op1->type)
10641 op1->type->refCount++;
10642 }
10643 return 1;
10644 }
10645
10646 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10647 {
10648 exp->type = 2;
10649 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10650 if(!exp->expType)
10651 {
10652 exp->expType = op1->type;
10653 if(op1->type)
10654 op1->type->refCount++;
10655 }
10656 return 1;
10657 }
10658
10659 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10660 {
10661 exp->type = 2;
10662 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10663 if(!exp->expType)
10664 {
10665 exp->expType = op1->type;
10666 if(op1->type)
10667 op1->type->refCount++;
10668 }
10669 return 1;
10670 }
10671
10672 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10673 {
10674 exp->type = 2;
10675 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10676 if(!exp->expType)
10677 {
10678 exp->expType = op1->type;
10679 if(op1->type)
10680 op1->type->refCount++;
10681 }
10682 return 1;
10683 }
10684
10685 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10686 {
10687 exp->type = 2;
10688 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10689 if(!exp->expType)
10690 {
10691 exp->expType = op1->type;
10692 if(op1->type)
10693 op1->type->refCount++;
10694 }
10695 return 1;
10696 }
10697
10698 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10699 {
10700 exp->type = 2;
10701 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10702 if(!exp->expType)
10703 {
10704 exp->expType = op1->type;
10705 if(op1->type)
10706 op1->type->refCount++;
10707 }
10708 return 1;
10709 }
10710
10711 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10712 {
10713 exp->type = 2;
10714 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10715 if(!exp->expType)
10716 {
10717 exp->expType = op1->type;
10718 if(op1->type)
10719 op1->type->refCount++;
10720 }
10721 return 1;
10722 }
10723
10724 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10725 {
10726 exp->type = 2;
10727 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10728 if(!exp->expType)
10729 {
10730 exp->expType = op1->type;
10731 if(op1->type)
10732 op1->type->refCount++;
10733 }
10734 return 1;
10735 }
10736
10737 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10738 {
10739 exp->type = 2;
10740 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10741 if(!exp->expType)
10742 {
10743 exp->expType = op1->type;
10744 if(op1->type)
10745 op1->type->refCount++;
10746 }
10747 return 1;
10748 }
10749
10750 struct OpTable intOps =
10751 {
10752 (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)
10753 };
10754
10755 struct OpTable uintOps =
10756 {
10757 (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)
10758 };
10759
10760 struct OpTable int64Ops =
10761 {
10762 (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)
10763 };
10764
10765 struct OpTable uint64Ops =
10766 {
10767 (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)
10768 };
10769
10770 struct OpTable shortOps =
10771 {
10772 (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)
10773 };
10774
10775 struct OpTable ushortOps =
10776 {
10777 (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)
10778 };
10779
10780 struct OpTable floatOps =
10781 {
10782 (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)
10783 };
10784
10785 struct OpTable doubleOps =
10786 {
10787 (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)
10788 };
10789
10790 struct OpTable charOps =
10791 {
10792 (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)
10793 };
10794
10795 struct OpTable ucharOps =
10796 {
10797 (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)
10798 };
10799
10800 void ReadString(char * output, char * string)
10801 {
10802 int len = strlen(string);
10803 int c, d = 0;
10804 unsigned int quoted = 0, escaped = 0;
10805
10806 for(c = 0; c < len; c++)
10807 {
10808 char ch = string[c];
10809
10810 if(escaped)
10811 {
10812 switch(ch)
10813 {
10814 case 'n':
10815 output[d] = '\n';
10816 break;
10817 case 't':
10818 output[d] = '\t';
10819 break;
10820 case 'a':
10821 output[d] = '\a';
10822 break;
10823 case 'b':
10824 output[d] = '\b';
10825 break;
10826 case 'f':
10827 output[d] = '\f';
10828 break;
10829 case 'r':
10830 output[d] = '\r';
10831 break;
10832 case 'v':
10833 output[d] = '\v';
10834 break;
10835 case '\\':
10836 output[d] = '\\';
10837 break;
10838 case '\"':
10839 output[d] = '\"';
10840 break;
10841 case '\'':
10842 output[d] = '\'';
10843 break;
10844 default:
10845 output[d] = ch;
10846 }
10847 d++;
10848 escaped = 0;
10849 }
10850 else
10851 {
10852 if(ch == '\"')
10853 quoted ^= 1;
10854 else if(quoted)
10855 {
10856 if(ch == '\\')
10857 escaped = 1;
10858 else
10859 output[d++] = ch;
10860 }
10861 }
10862 }
10863 output[d] = '\0';
10864 }
10865
10866 int UnescapeString(char * d, char * s, int len)
10867 {
10868 int j = 0, k = 0;
10869 char ch;
10870
10871 while(j < len && (ch = s[j]))
10872 {
10873 switch(ch)
10874 {
10875 case '\\':
10876 switch((ch = s[++j]))
10877 {
10878 case 'n':
10879 d[k] = '\n';
10880 break;
10881 case 't':
10882 d[k] = '\t';
10883 break;
10884 case 'a':
10885 d[k] = '\a';
10886 break;
10887 case 'b':
10888 d[k] = '\b';
10889 break;
10890 case 'f':
10891 d[k] = '\f';
10892 break;
10893 case 'r':
10894 d[k] = '\r';
10895 break;
10896 case 'v':
10897 d[k] = '\v';
10898 break;
10899 case '\\':
10900 d[k] = '\\';
10901 break;
10902 case '\"':
10903 d[k] = '\"';
10904 break;
10905 case '\'':
10906 d[k] = '\'';
10907 break;
10908 default:
10909 d[k] = '\\';
10910 d[k] = ch;
10911 }
10912 break;
10913 default:
10914 d[k] = ch;
10915 }
10916 j++, k++;
10917 }
10918 d[k] = '\0';
10919 return k;
10920 }
10921
10922 char * OffsetEscapedString(char * s, int len, int offset)
10923 {
10924 char ch;
10925 int j = 0, k = 0;
10926
10927 while(j < len && k < offset && (ch = s[j]))
10928 {
10929 if(ch == '\\')
10930 ++j;
10931 j++, k++;
10932 }
10933 return (k == offset) ? s + j : (((void *)0));
10934 }
10935
10936 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10937
10938 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10939
10940 extern double strtod(const char * , char * * );
10941
10942 extern float (* __ecereMethod_float_inf)(void);
10943
10944 extern float (* __ecereMethod_float_nan)(void);
10945
10946 extern double (* __ecereMethod_double_inf)(void);
10947
10948 extern double (* __ecereMethod_double_nan)(void);
10949
10950 struct Operand GetOperand(struct Expression * exp)
10951 {
10952 struct Operand op =
10953 {
10954 0, 0, 0,
10955 .__anon1 = {
10956 .c = 0
10957 },
10958 {
10959 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10960 }
10961 };
10962 struct Type * type = exp->expType;
10963
10964 if(type)
10965 {
10966 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))
10967 {
10968 if(!type->__anon1._class->__anon1.registered->dataType)
10969 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10970 type = type->__anon1._class->__anon1.registered->dataType;
10971 }
10972 if(exp->type == 3 && op.kind == 13)
10973 {
10974 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
10975 op.kind = 13;
10976 op.ops = uint64Ops;
10977 }
10978 else if(exp->isConstant && exp->type == 2)
10979 {
10980 op.kind = type->kind;
10981 op.type = type;
10982 switch(op.kind)
10983 {
10984 case 24:
10985 case 1:
10986 {
10987 if(exp->__anon1.__anon1.constant[0] == '\'')
10988 {
10989 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10990 op.ops = charOps;
10991 }
10992 else if(type->isSigned)
10993 {
10994 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10995 op.ops = charOps;
10996 }
10997 else
10998 {
10999 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11000 op.ops = ucharOps;
11001 }
11002 break;
11003 }
11004 case 2:
11005 if(type->isSigned)
11006 {
11007 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11008 op.ops = shortOps;
11009 }
11010 else
11011 {
11012 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11013 op.ops = ushortOps;
11014 }
11015 break;
11016 case 3:
11017 case 5:
11018 if(type->isSigned)
11019 {
11020 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11021 op.ops = intOps;
11022 }
11023 else
11024 {
11025 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11026 op.ops = uintOps;
11027 }
11028 op.kind = 3;
11029 break;
11030 case 4:
11031 if(type->isSigned)
11032 {
11033 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11034 op.ops = int64Ops;
11035 }
11036 else
11037 {
11038 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11039 op.ops = uint64Ops;
11040 }
11041 op.kind = 4;
11042 break;
11043 case 22:
11044 if(type->isSigned)
11045 {
11046 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11047 op.ops = int64Ops;
11048 }
11049 else
11050 {
11051 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11052 op.ops = uint64Ops;
11053 }
11054 op.kind = 4;
11055 break;
11056 case 23:
11057 if(type->isSigned)
11058 {
11059 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11060 op.ops = int64Ops;
11061 }
11062 else
11063 {
11064 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11065 op.ops = uint64Ops;
11066 }
11067 op.kind = 4;
11068 break;
11069 case 6:
11070 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11071 op.__anon1.f = __ecereMethod_float_inf();
11072 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11073 op.__anon1.f = -__ecereMethod_float_inf();
11074 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11075 op.__anon1.f = __ecereMethod_float_nan();
11076 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11077 op.__anon1.f = -__ecereMethod_float_nan();
11078 else
11079 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11080 op.ops = floatOps;
11081 break;
11082 case 7:
11083 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11084 op.__anon1.d = __ecereMethod_double_inf();
11085 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11086 op.__anon1.d = -__ecereMethod_double_inf();
11087 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11088 op.__anon1.d = __ecereMethod_double_nan();
11089 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11090 op.__anon1.d = -__ecereMethod_double_nan();
11091 else
11092 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11093 op.ops = doubleOps;
11094 break;
11095 case 12:
11096 case 13:
11097 case 8:
11098 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11099 op.kind = 13;
11100 op.ops = uint64Ops;
11101 break;
11102 }
11103 }
11104 }
11105 return op;
11106 }
11107
11108 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11109 {
11110 long long v = 0;
11111
11112 switch(_class->typeSize)
11113 {
11114 case 8:
11115 if(!strcmp(_class->dataTypeString, "uint64"))
11116 v = (long long)*(uint64 *)ptr;
11117 else
11118 v = *(long long *)ptr;
11119 break;
11120 case 4:
11121 if(!strcmp(_class->dataTypeString, "uint"))
11122 v = (long long)*(unsigned int *)ptr;
11123 else
11124 v = (long long)*(int *)ptr;
11125 break;
11126 case 2:
11127 if(!strcmp(_class->dataTypeString, "uint16"))
11128 v = (long long)*(unsigned short *)ptr;
11129 else
11130 v = (long long)*(short *)ptr;
11131 break;
11132 case 1:
11133 if(!strcmp(_class->dataTypeString, "byte"))
11134 v = (long long)*(unsigned char *)ptr;
11135 else
11136 v = (long long)*(char *)ptr;
11137 break;
11138 }
11139 return v;
11140 }
11141
11142 int __ecereVMethodID_class_OnGetString;
11143
11144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11145
11146 static __attribute__((unused)) void UnusedFunction()
11147 {
11148 int a;
11149
11150 ((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);
11151 }
11152
11153 extern int __ecereVMethodID_class_OnGetString;
11154
11155 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11156 {
11157 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11158
11159 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11160 {
11161 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11162 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11163 else
11164 {
11165 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11166 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11167 struct Type * type;
11168 void * ptr = inst->data + dataMember->offset + offset;
11169 char * result = (((void *)0));
11170
11171 exp->loc = member->loc = inst->loc;
11172 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11173 if(!dataMember->dataType)
11174 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11175 type = dataMember->dataType;
11176 if(type->kind == 8)
11177 {
11178 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11179
11180 if(_class->type == 4)
11181 {
11182 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11183
11184 if(enumClass)
11185 {
11186 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11187 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11188
11189 for(item = e->values.first; item; item = item->next)
11190 {
11191 if(item->data == GetEnumValue(_class, ptr))
11192 {
11193 result = item->name;
11194 break;
11195 }
11196 }
11197 if(result)
11198 {
11199 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11200 exp->type = 0;
11201 exp->destType = MkClassType(_class->fullName);
11202 ProcessExpressionType(exp);
11203 }
11204 }
11205 }
11206 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11207 {
11208 if(!_class->dataType)
11209 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11210 type = _class->dataType;
11211 }
11212 }
11213 if(!result)
11214 {
11215 switch(type->kind)
11216 {
11217 case 6:
11218 {
11219 FreeExpContents(exp);
11220 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11221 exp->type = 2;
11222 break;
11223 }
11224 case 7:
11225 {
11226 FreeExpContents(exp);
11227 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11228 exp->type = 2;
11229 break;
11230 }
11231 case 3:
11232 {
11233 FreeExpContents(exp);
11234 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11235 exp->type = 2;
11236 break;
11237 }
11238 case 4:
11239 {
11240 FreeExpContents(exp);
11241 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11242 exp->type = 2;
11243 break;
11244 }
11245 case 22:
11246 {
11247 FreeExpContents(exp);
11248 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11249 exp->type = 2;
11250 break;
11251 }
11252 case 23:
11253 {
11254 FreeExpContents(exp);
11255 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11256 exp->type = 2;
11257 break;
11258 }
11259 default:
11260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11261 }
11262 }
11263 ListAdd(memberList, member);
11264 }
11265 if(parentDataMember->type == 1)
11266 break;
11267 }
11268 }
11269
11270 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11271
11272 void PopulateInstance(struct Instantiation * inst)
11273 {
11274 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11275 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11276 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11277 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11278
11279 if(!inst->members)
11280 inst->members = MkListOne(MkMembersInitList(memberList));
11281 else
11282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11283 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11284 {
11285 if(!dataMember->isProperty)
11286 {
11287 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11288 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11289 else
11290 {
11291 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11292 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11293 struct Type * type;
11294 void * ptr = inst->data + dataMember->offset;
11295 char * result = (((void *)0));
11296
11297 exp->loc = member->loc = inst->loc;
11298 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11299 if(!dataMember->dataType)
11300 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11301 type = dataMember->dataType;
11302 if(type->kind == 8)
11303 {
11304 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11305
11306 if(_class->type == 4)
11307 {
11308 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11309
11310 if(enumClass)
11311 {
11312 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11313 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11314
11315 for(item = e->values.first; item; item = item->next)
11316 {
11317 if(item->data == GetEnumValue(_class, ptr))
11318 {
11319 result = item->name;
11320 break;
11321 }
11322 }
11323 }
11324 if(result)
11325 {
11326 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11327 exp->type = 0;
11328 exp->destType = MkClassType(_class->fullName);
11329 ProcessExpressionType(exp);
11330 }
11331 }
11332 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11333 {
11334 if(!_class->dataType)
11335 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11336 type = _class->dataType;
11337 }
11338 }
11339 if(!result)
11340 {
11341 switch(type->kind)
11342 {
11343 case 6:
11344 {
11345 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11346 exp->type = 2;
11347 break;
11348 }
11349 case 7:
11350 {
11351 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11352 exp->type = 2;
11353 break;
11354 }
11355 case 3:
11356 {
11357 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11358 exp->type = 2;
11359 break;
11360 }
11361 case 4:
11362 {
11363 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11364 exp->type = 2;
11365 break;
11366 }
11367 case 22:
11368 {
11369 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11370 exp->type = 2;
11371 break;
11372 }
11373 default:
11374 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11375 }
11376 }
11377 ListAdd(memberList, member);
11378 }
11379 }
11380 }
11381 }
11382
11383 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);
11384
11385 extern void FreeInstance(struct Instantiation * inst);
11386
11387 void ComputeInstantiation(struct Expression * exp)
11388 {
11389 struct Instantiation * inst = exp->__anon1.instance;
11390 struct MembersInit * members;
11391 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11392 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11393 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11394 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11395 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11396 int subMemberStackPos = 0;
11397 uint64 bits = 0;
11398
11399 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11400 {
11401 if(inst->data)
11402 return ;
11403 if(_class->type == 0 || _class->type == 5)
11404 {
11405 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11406 if(_class->type == 0)
11407 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11408 }
11409 else
11410 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11411 }
11412 if(inst->members)
11413 {
11414 for(members = (*inst->members).first; members; members = members->next)
11415 {
11416 switch(members->type)
11417 {
11418 case 0:
11419 {
11420 if(members->__anon1.dataMembers)
11421 {
11422 struct MemberInit * member;
11423
11424 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11425 {
11426 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11427 unsigned int found = 0;
11428 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11429 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11430 unsigned int dataMemberOffset;
11431
11432 if(!ident)
11433 {
11434 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11435 if(curMember)
11436 {
11437 if(curMember->isProperty)
11438 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11439 else
11440 {
11441 dataMember = curMember;
11442 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11443 if(_class->type == 0)
11444 dataMemberOffset += _class->base->structSize;
11445 }
11446 found = 1;
11447 }
11448 }
11449 else
11450 {
11451 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11452 if(prop)
11453 {
11454 found = 1;
11455 if(prop->memberAccess == 1)
11456 {
11457 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11458 curClass = prop->_class;
11459 }
11460 }
11461 else
11462 {
11463 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11464 int _subMemberStackPos = 0;
11465
11466 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11467 if(dataMember)
11468 {
11469 found = 1;
11470 if(dataMember->memberAccess == 1)
11471 {
11472 curMember = dataMember;
11473 curClass = dataMember->_class;
11474 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11475 subMemberStackPos = _subMemberStackPos;
11476 }
11477 }
11478 }
11479 }
11480 if(found && member->initializer && member->initializer->type == 0)
11481 {
11482 struct Expression * value = member->initializer->__anon1.exp;
11483 struct Type * type = (((void *)0));
11484 unsigned int deepMember = 0;
11485
11486 if(prop)
11487 {
11488 type = prop->dataType;
11489 }
11490 else if(dataMember)
11491 {
11492 if(!dataMember->dataType)
11493 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11494 type = dataMember->dataType;
11495 }
11496 if(ident && ident->next)
11497 {
11498 deepMember = 1;
11499 for(ident = ident->next; ident && type; ident = ident->next)
11500 {
11501 if(type->kind == 8)
11502 {
11503 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11504 if(prop)
11505 type = prop->dataType;
11506 else
11507 {
11508 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11509 if(dataMember)
11510 type = dataMember->dataType;
11511 }
11512 }
11513 else if(type->kind == 9 || type->kind == 10)
11514 {
11515 struct Type * memberType;
11516
11517 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11518 {
11519 if(!strcmp(memberType->name, ident->string))
11520 {
11521 type = memberType;
11522 break;
11523 }
11524 }
11525 }
11526 }
11527 }
11528 if(value)
11529 {
11530 FreeType(value->destType);
11531 value->destType = type;
11532 if(type)
11533 type->refCount++;
11534 ComputeExpression(value);
11535 }
11536 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11537 {
11538 if(type->kind == 8)
11539 {
11540 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11541
11542 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11543 {
11544 if(!_class->dataType)
11545 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11546 type = _class->dataType;
11547 }
11548 }
11549 if(dataMember)
11550 {
11551 void * ptr = inst->data + dataMemberOffset;
11552
11553 if(value->type == 2)
11554 {
11555 switch(type->kind)
11556 {
11557 case 3:
11558 {
11559 GetInt(value, (int *)ptr);
11560 break;
11561 }
11562 case 4:
11563 {
11564 GetInt64(value, (long long *)ptr);
11565 break;
11566 }
11567 case 22:
11568 {
11569 GetIntPtr(value, (intptr_t *)ptr);
11570 break;
11571 }
11572 case 23:
11573 {
11574 GetIntSize(value, (ssize_t *)ptr);
11575 break;
11576 }
11577 case 6:
11578 {
11579 GetFloat(value, (float *)ptr);
11580 break;
11581 }
11582 case 7:
11583 {
11584 GetDouble(value, (double *)ptr);
11585 break;
11586 }
11587 }
11588 }
11589 else if(value->type == 1)
11590 {
11591 if(type->kind == 8)
11592 {
11593 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11594
11595 if(_class->type == 1)
11596 {
11597 ComputeTypeSize(type);
11598 if(value->__anon1.instance->data)
11599 memcpy(ptr, value->__anon1.instance->data, type->size);
11600 }
11601 }
11602 }
11603 }
11604 else if(prop && prop->Set != (void *)(intptr_t)1)
11605 {
11606 if(value->type == 1 && value->__anon1.instance->data)
11607 {
11608 if(type->kind == 8)
11609 {
11610 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11611
11612 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)))
11613 {
11614 void (* Set)(void *, void *) = (void *)prop->Set;
11615
11616 Set(inst->data, value->__anon1.instance->data);
11617 PopulateInstance(inst);
11618 }
11619 }
11620 }
11621 else if(value->type == 2)
11622 {
11623 switch(type->kind)
11624 {
11625 case 7:
11626 {
11627 void (* Set)(void *, double) = (void *)prop->Set;
11628
11629 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11630 break;
11631 }
11632 case 6:
11633 {
11634 void (* Set)(void *, float) = (void *)prop->Set;
11635
11636 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11637 break;
11638 }
11639 case 3:
11640 {
11641 void (* Set)(void *, int) = (void *)prop->Set;
11642
11643 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11644 break;
11645 }
11646 case 4:
11647 {
11648 void (* Set)(void *, long long) = (void *)prop->Set;
11649
11650 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11651 break;
11652 }
11653 case 22:
11654 {
11655 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11656
11657 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11658 break;
11659 }
11660 case 23:
11661 {
11662 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11663
11664 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11665 break;
11666 }
11667 }
11668 }
11669 else if(value->type == 3)
11670 {
11671 char temp[1024];
11672
11673 ReadString(temp, value->__anon1.__anon2.string);
11674 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11675 }
11676 }
11677 }
11678 else if(!deepMember && type && _class->type == 3)
11679 {
11680 if(prop)
11681 {
11682 if(value->type == 2)
11683 {
11684 if(type->kind == 8)
11685 {
11686 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11687
11688 if(_class->type == 3)
11689 {
11690 if(!_class->dataType)
11691 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11692 type = _class->dataType;
11693 }
11694 }
11695 switch(type->kind)
11696 {
11697 case 6:
11698 {
11699 float fValue;
11700 float (* Set)(float) = (void *)prop->Set;
11701
11702 GetFloat(member->initializer->__anon1.exp, &fValue);
11703 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11704 exp->type = 2;
11705 break;
11706 }
11707 case 7:
11708 {
11709 double dValue;
11710 double (* Set)(double) = (void *)prop->Set;
11711
11712 GetDouble(member->initializer->__anon1.exp, &dValue);
11713 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11714 exp->type = 2;
11715 break;
11716 }
11717 }
11718 }
11719 }
11720 }
11721 else if(!deepMember && type && _class->type == 2)
11722 {
11723 if(prop)
11724 {
11725 if(value->type == 1 && value->__anon1.instance->data)
11726 {
11727 unsigned int (* Set)(void *) = (void *)prop->Set;
11728
11729 bits = Set(value->__anon1.instance->data);
11730 }
11731 else if(value->type == 2)
11732 {
11733 }
11734 }
11735 else if(dataMember)
11736 {
11737 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11738 struct Type * type;
11739 uint64 part = 0;
11740
11741 bits = (bits & ~bitMember->mask);
11742 if(!bitMember->dataType)
11743 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11744 type = bitMember->dataType;
11745 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11746 {
11747 if(!type->__anon1._class->__anon1.registered->dataType)
11748 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11749 type = type->__anon1._class->__anon1.registered->dataType;
11750 }
11751 switch(type->kind)
11752 {
11753 case 24:
11754 case 1:
11755 {
11756 unsigned char v;
11757
11758 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11759 part = (uint64)v;
11760 break;
11761 }
11762 case 2:
11763 {
11764 unsigned short v;
11765
11766 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11767 part = (uint64)v;
11768 break;
11769 }
11770 case 3:
11771 case 5:
11772 {
11773 unsigned int v;
11774
11775 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11776 part = (uint64)v;
11777 break;
11778 }
11779 case 4:
11780 {
11781 uint64 v;
11782
11783 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11784 part = v;
11785 break;
11786 }
11787 case 22:
11788 {
11789 uintptr_t v;
11790
11791 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11792 part = (uint64)v;
11793 break;
11794 }
11795 case 23:
11796 {
11797 size_t v;
11798
11799 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11800 part = (uint64)v;
11801 break;
11802 }
11803 }
11804 bits |= part << bitMember->pos;
11805 }
11806 }
11807 }
11808 else
11809 {
11810 if(_class && _class->type == 3)
11811 {
11812 ComputeExpression(member->initializer->__anon1.exp);
11813 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11814 exp->type = 2;
11815 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11816 }
11817 }
11818 }
11819 }
11820 break;
11821 }
11822 }
11823 }
11824 }
11825 if(_class && _class->type == 2)
11826 {
11827 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11828 exp->type = 2;
11829 }
11830 if(exp->type != 1)
11831 {
11832 FreeInstance(inst);
11833 }
11834 }
11835
11836 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11837 {
11838 unsigned int result = 0;
11839
11840 switch(kind)
11841 {
11842 case 2:
11843 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11844 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11845 break;
11846 case 3:
11847 case 5:
11848 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11849 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11850 break;
11851 case 4:
11852 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)
11853 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11854 break;
11855 case 6:
11856 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)
11857 result = GetOpFloat(op, &op->__anon1.f);
11858 break;
11859 case 7:
11860 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)
11861 result = GetOpDouble(op, &op->__anon1.d);
11862 break;
11863 case 13:
11864 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)
11865 result = GetOpUInt64(op, &op->__anon1.ui64);
11866 break;
11867 case 15:
11868 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)
11869 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11870 break;
11871 case 22:
11872 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11873 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11874 break;
11875 case 23:
11876 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11877 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11878 break;
11879 }
11880 return result;
11881 }
11882
11883 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11884 {
11885 if(exp->__anon1.op.op == SIZEOF)
11886 {
11887 FreeExpContents(exp);
11888 exp->type = 2;
11889 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11890 }
11891 else
11892 {
11893 if(!exp->__anon1.op.exp1)
11894 {
11895 switch(exp->__anon1.op.op)
11896 {
11897 case '+':
11898 {
11899 struct Expression * exp2 = exp->__anon1.op.exp2;
11900
11901 exp->__anon1.op.exp2 = (((void *)0));
11902 FreeExpContents(exp);
11903 FreeType(exp->expType);
11904 FreeType(exp->destType);
11905 *exp = *exp2;
11906 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11907 break;
11908 }
11909 case '-':
11910 if(op1->ops.Neg)
11911 {
11912 FreeExpContents(exp);
11913 op1->ops.Neg(exp, op1);
11914 }
11915 break;
11916 case '~':
11917 if(op1->ops.BitNot)
11918 {
11919 FreeExpContents(exp);
11920 op1->ops.BitNot(exp, op1);
11921 }
11922 break;
11923 case '!':
11924 if(op1->ops.Not)
11925 {
11926 FreeExpContents(exp);
11927 op1->ops.Not(exp, op1);
11928 }
11929 break;
11930 }
11931 }
11932 else
11933 {
11934 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11935 {
11936 if(Promote(op2, op1->kind, op1->type->isSigned))
11937 op2->kind = op1->kind, op2->ops = op1->ops;
11938 else if(Promote(op1, op2->kind, op2->type->isSigned))
11939 op1->kind = op2->kind, op1->ops = op2->ops;
11940 }
11941 switch(exp->__anon1.op.op)
11942 {
11943 case '+':
11944 if(op1->ops.Add)
11945 {
11946 FreeExpContents(exp);
11947 op1->ops.Add(exp, op1, op2);
11948 }
11949 break;
11950 case '-':
11951 if(op1->ops.Sub)
11952 {
11953 FreeExpContents(exp);
11954 op1->ops.Sub(exp, op1, op2);
11955 }
11956 break;
11957 case '*':
11958 if(op1->ops.Mul)
11959 {
11960 FreeExpContents(exp);
11961 op1->ops.Mul(exp, op1, op2);
11962 }
11963 break;
11964 case '/':
11965 if(op1->ops.Div)
11966 {
11967 FreeExpContents(exp);
11968 op1->ops.Div(exp, op1, op2);
11969 }
11970 break;
11971 case '%':
11972 if(op1->ops.Mod)
11973 {
11974 FreeExpContents(exp);
11975 op1->ops.Mod(exp, op1, op2);
11976 }
11977 break;
11978 case '&':
11979 if(exp->__anon1.op.exp2)
11980 {
11981 if(op1->ops.BitAnd)
11982 {
11983 FreeExpContents(exp);
11984 op1->ops.BitAnd(exp, op1, op2);
11985 }
11986 }
11987 break;
11988 case '|':
11989 if(op1->ops.BitOr)
11990 {
11991 FreeExpContents(exp);
11992 op1->ops.BitOr(exp, op1, op2);
11993 }
11994 break;
11995 case '^':
11996 if(op1->ops.BitXor)
11997 {
11998 FreeExpContents(exp);
11999 op1->ops.BitXor(exp, op1, op2);
12000 }
12001 break;
12002 case LEFT_OP:
12003 if(op1->ops.LShift)
12004 {
12005 FreeExpContents(exp);
12006 op1->ops.LShift(exp, op1, op2);
12007 }
12008 break;
12009 case RIGHT_OP:
12010 if(op1->ops.RShift)
12011 {
12012 FreeExpContents(exp);
12013 op1->ops.RShift(exp, op1, op2);
12014 }
12015 break;
12016 case EQ_OP:
12017 if(op1->ops.Equ)
12018 {
12019 FreeExpContents(exp);
12020 op1->ops.Equ(exp, op1, op2);
12021 }
12022 break;
12023 case NE_OP:
12024 if(op1->ops.Nqu)
12025 {
12026 FreeExpContents(exp);
12027 op1->ops.Nqu(exp, op1, op2);
12028 }
12029 break;
12030 case AND_OP:
12031 if(op1->ops.And)
12032 {
12033 FreeExpContents(exp);
12034 op1->ops.And(exp, op1, op2);
12035 }
12036 break;
12037 case OR_OP:
12038 if(op1->ops.Or)
12039 {
12040 FreeExpContents(exp);
12041 op1->ops.Or(exp, op1, op2);
12042 }
12043 break;
12044 case '>':
12045 if(op1->ops.Grt)
12046 {
12047 FreeExpContents(exp);
12048 op1->ops.Grt(exp, op1, op2);
12049 }
12050 break;
12051 case '<':
12052 if(op1->ops.Sma)
12053 {
12054 FreeExpContents(exp);
12055 op1->ops.Sma(exp, op1, op2);
12056 }
12057 break;
12058 case GE_OP:
12059 if(op1->ops.GrtEqu)
12060 {
12061 FreeExpContents(exp);
12062 op1->ops.GrtEqu(exp, op1, op2);
12063 }
12064 break;
12065 case LE_OP:
12066 if(op1->ops.SmaEqu)
12067 {
12068 FreeExpContents(exp);
12069 op1->ops.SmaEqu(exp, op1, op2);
12070 }
12071 break;
12072 }
12073 }
12074 }
12075 }
12076
12077 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12078
12079 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12080
12081 void ComputeExpression(struct Expression * exp)
12082 {
12083 switch(exp->type)
12084 {
12085 case 1:
12086 {
12087 ComputeInstantiation(exp);
12088 break;
12089 }
12090 case 4:
12091 {
12092 struct Expression * exp1, * exp2 = (((void *)0));
12093 struct Operand op1 =
12094 {
12095 0, 0, 0,
12096 .__anon1 = {
12097 .c = 0
12098 },
12099 {
12100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12101 }
12102 };
12103 struct Operand op2 =
12104 {
12105 0, 0, 0,
12106 .__anon1 = {
12107 .c = 0
12108 },
12109 {
12110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12111 }
12112 };
12113
12114 if(exp->__anon1.op.exp2)
12115 {
12116 struct Expression * e = exp->__anon1.op.exp2;
12117
12118 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12119 {
12120 if(e->type == 5 || e->type == 32 || e->type == 23)
12121 {
12122 if(e->type == 23)
12123 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12124 else
12125 e = (*e->__anon1.list).last;
12126 }
12127 }
12128 if(exp->__anon1.op.op == 261 && e && e->expType)
12129 {
12130 if(e->type == 3 && e->__anon1.__anon2.string)
12131 {
12132 char * string = e->__anon1.__anon2.string;
12133 int len = strlen(string);
12134 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12135
12136 len = UnescapeString(tmp, string + 1, len - 2);
12137 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12138 FreeExpContents(exp);
12139 exp->type = 2;
12140 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12141 }
12142 else
12143 {
12144 struct Type * type = e->expType;
12145
12146 type->refCount++;
12147 FreeExpContents(exp);
12148 exp->type = 2;
12149 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12150 FreeType(type);
12151 }
12152 break;
12153 }
12154 else
12155 ComputeExpression(exp->__anon1.op.exp2);
12156 }
12157 if(exp->__anon1.op.exp1)
12158 {
12159 ComputeExpression(exp->__anon1.op.exp1);
12160 exp1 = exp->__anon1.op.exp1;
12161 exp2 = exp->__anon1.op.exp2;
12162 op1 = GetOperand(exp1);
12163 if(op1.type)
12164 op1.type->refCount++;
12165 if(exp2)
12166 {
12167 op2 = GetOperand(exp2);
12168 if(op2.type)
12169 op2.type->refCount++;
12170 }
12171 }
12172 else
12173 {
12174 exp1 = exp->__anon1.op.exp2;
12175 op1 = GetOperand(exp1);
12176 if(op1.type)
12177 op1.type->refCount++;
12178 }
12179 CallOperator(exp, exp1, exp2, &op1, &op2);
12180 if(op1.type)
12181 FreeType(op1.type);
12182 if(op2.type)
12183 FreeType(op2.type);
12184 break;
12185 }
12186 case 5:
12187 case 32:
12188 {
12189 struct Expression * e, * n;
12190
12191 for(e = (*exp->__anon1.list).first; e; e = n)
12192 {
12193 n = e->next;
12194 if(!n)
12195 {
12196 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12197 struct Expression * prev = exp->prev;
12198 struct Expression * next = exp->next;
12199
12200 ComputeExpression(e);
12201 FreeType(exp->expType);
12202 FreeType(exp->destType);
12203 *exp = *e;
12204 exp->prev = prev;
12205 exp->next = next;
12206 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12207 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12208 }
12209 else
12210 {
12211 FreeExpression(e);
12212 }
12213 }
12214 break;
12215 }
12216 case 8:
12217 {
12218 struct Expression * memberExp = exp->__anon1.member.exp;
12219 struct Identifier * memberID = exp->__anon1.member.member;
12220 struct Type * type;
12221
12222 ComputeExpression(exp->__anon1.member.exp);
12223 type = exp->__anon1.member.exp->expType;
12224 if(type)
12225 {
12226 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)));
12227 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12228 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12229 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12230
12231 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12232 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12233 if(!_class)
12234 {
12235 char string[256];
12236 struct Symbol * classSym;
12237
12238 string[0] = '\0';
12239 PrintTypeNoConst(type, string, 0, 1);
12240 classSym = FindClass(string);
12241 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12242 }
12243 if(exp->__anon1.member.member)
12244 {
12245 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12246 if(!prop)
12247 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12248 }
12249 if(!prop && !member && _class && exp->__anon1.member.member)
12250 {
12251 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12252
12253 convertTo = _class;
12254 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12255 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12256 }
12257 if(prop)
12258 {
12259 if(prop->compiled)
12260 {
12261 struct Type * type = prop->dataType;
12262
12263 if(_class->type == 3)
12264 {
12265 if(type->kind == 8)
12266 {
12267 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12268
12269 if(_class->type == 3)
12270 {
12271 if(!_class->dataType)
12272 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12273 type = _class->dataType;
12274 }
12275 }
12276 switch(type->kind)
12277 {
12278 case 6:
12279 {
12280 float value;
12281 float (* Get)(float) = (void *)prop->Get;
12282
12283 GetFloat(exp->__anon1.member.exp, &value);
12284 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12285 exp->type = 2;
12286 break;
12287 }
12288 case 7:
12289 {
12290 double value;
12291 double (* Get)(double);
12292
12293 GetDouble(exp->__anon1.member.exp, &value);
12294 if(convertTo)
12295 Get = (void *)prop->Set;
12296 else
12297 Get = (void *)prop->Get;
12298 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12299 exp->type = 2;
12300 break;
12301 }
12302 }
12303 }
12304 else
12305 {
12306 if(convertTo)
12307 {
12308 struct Expression * value = exp->__anon1.member.exp;
12309 struct Type * type;
12310
12311 if(!prop->dataType)
12312 ProcessPropertyType(prop);
12313 type = prop->dataType;
12314 if(!type)
12315 {
12316 }
12317 else if(_class->type == 1)
12318 {
12319 switch(type->kind)
12320 {
12321 case 8:
12322 {
12323 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12324
12325 if(propertyClass->type == 1 && value->type == 1)
12326 {
12327 void (* Set)(void *, void *) = (void *)prop->Set;
12328
12329 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12330 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12331 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12332 exp->__anon1.instance->loc = exp->loc;
12333 exp->type = 1;
12334 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12335 PopulateInstance(exp->__anon1.instance);
12336 }
12337 break;
12338 }
12339 case 3:
12340 {
12341 int intValue;
12342 void (* Set)(void *, int) = (void *)prop->Set;
12343
12344 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12345 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12346 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12347 exp->__anon1.instance->loc = exp->loc;
12348 exp->type = 1;
12349 GetInt(value, &intValue);
12350 Set(exp->__anon1.instance->data, intValue);
12351 PopulateInstance(exp->__anon1.instance);
12352 break;
12353 }
12354 case 4:
12355 {
12356 long long intValue;
12357 void (* Set)(void *, long long) = (void *)prop->Set;
12358
12359 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12360 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12361 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12362 exp->__anon1.instance->loc = exp->loc;
12363 exp->type = 1;
12364 GetInt64(value, &intValue);
12365 Set(exp->__anon1.instance->data, intValue);
12366 PopulateInstance(exp->__anon1.instance);
12367 break;
12368 }
12369 case 22:
12370 {
12371 intptr_t intValue;
12372 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12373
12374 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12375 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12376 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12377 exp->__anon1.instance->loc = exp->loc;
12378 exp->type = 1;
12379 GetIntPtr(value, &intValue);
12380 Set(exp->__anon1.instance->data, intValue);
12381 PopulateInstance(exp->__anon1.instance);
12382 break;
12383 }
12384 case 23:
12385 {
12386 ssize_t intValue;
12387 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12388
12389 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12390 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12391 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12392 exp->__anon1.instance->loc = exp->loc;
12393 exp->type = 1;
12394 GetIntSize(value, &intValue);
12395 Set(exp->__anon1.instance->data, intValue);
12396 PopulateInstance(exp->__anon1.instance);
12397 break;
12398 }
12399 case 6:
12400 {
12401 float floatValue;
12402 void (* Set)(void *, float) = (void *)prop->Set;
12403
12404 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12405 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12406 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12407 exp->__anon1.instance->loc = exp->loc;
12408 exp->type = 1;
12409 GetFloat(value, &floatValue);
12410 Set(exp->__anon1.instance->data, floatValue);
12411 PopulateInstance(exp->__anon1.instance);
12412 break;
12413 }
12414 case 7:
12415 {
12416 double doubleValue;
12417 void (* Set)(void *, double) = (void *)prop->Set;
12418
12419 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12420 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12421 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12422 exp->__anon1.instance->loc = exp->loc;
12423 exp->type = 1;
12424 GetDouble(value, &doubleValue);
12425 Set(exp->__anon1.instance->data, doubleValue);
12426 PopulateInstance(exp->__anon1.instance);
12427 break;
12428 }
12429 }
12430 }
12431 else if(_class->type == 2)
12432 {
12433 switch(type->kind)
12434 {
12435 case 8:
12436 {
12437 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12438
12439 if(propertyClass->type == 1 && value->__anon1.instance->data)
12440 {
12441 unsigned int (* Set)(void *) = (void *)prop->Set;
12442 unsigned int bits = Set(value->__anon1.instance->data);
12443
12444 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12445 exp->type = 2;
12446 break;
12447 }
12448 else if(_class->type == 2)
12449 {
12450 unsigned int value;
12451 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12452 unsigned int bits;
12453
12454 GetUInt(exp->__anon1.member.exp, &value);
12455 bits = Set(value);
12456 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12457 exp->type = 2;
12458 }
12459 }
12460 }
12461 }
12462 }
12463 else
12464 {
12465 if(_class->type == 2)
12466 {
12467 unsigned int value;
12468
12469 GetUInt(exp->__anon1.member.exp, &value);
12470 switch(type->kind)
12471 {
12472 case 8:
12473 {
12474 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12475
12476 if(_class->type == 1)
12477 {
12478 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12479
12480 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12481 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12482 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12483 exp->__anon1.instance->loc = exp->loc;
12484 exp->type = 1;
12485 Get(value, exp->__anon1.instance->data);
12486 PopulateInstance(exp->__anon1.instance);
12487 }
12488 else if(_class->type == 2)
12489 {
12490 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12491 uint64 bits = Get(value);
12492
12493 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12494 exp->type = 2;
12495 }
12496 break;
12497 }
12498 }
12499 }
12500 else if(_class->type == 1)
12501 {
12502 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12503
12504 switch(type->kind)
12505 {
12506 case 8:
12507 {
12508 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12509
12510 if(_class->type == 1 && value)
12511 {
12512 void (* Get)(void *, void *) = (void *)prop->Get;
12513
12514 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12515 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12516 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12517 exp->__anon1.instance->loc = exp->loc;
12518 exp->type = 1;
12519 Get(value, exp->__anon1.instance->data);
12520 PopulateInstance(exp->__anon1.instance);
12521 }
12522 break;
12523 }
12524 }
12525 }
12526 }
12527 }
12528 }
12529 else
12530 {
12531 exp->isConstant = 0;
12532 }
12533 }
12534 else if(member)
12535 {
12536 }
12537 }
12538 if(exp->type != 8)
12539 {
12540 FreeExpression(memberExp);
12541 FreeIdentifier(memberID);
12542 }
12543 break;
12544 }
12545 case 10:
12546 {
12547 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12548
12549 FreeExpContents(exp);
12550 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12551 exp->type = 2;
12552 FreeType(type);
12553 break;
12554 }
12555 case 15:
12556 {
12557 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12558
12559 if(classSym && classSym->__anon1.registered)
12560 {
12561 if(classSym->__anon1.registered->fixed)
12562 {
12563 FreeSpecifier(exp->__anon1._class);
12564 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12565 exp->type = 2;
12566 }
12567 else
12568 {
12569 char className[1024];
12570
12571 strcpy(className, "__ecereClass_");
12572 FullClassNameCat(className, classSym->string, 1);
12573 DeclareClass(classSym, className);
12574 FreeExpContents(exp);
12575 exp->type = 9;
12576 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12577 exp->__anon1.member.member = MkIdentifier("structSize");
12578 }
12579 }
12580 break;
12581 }
12582 case 11:
12583 {
12584 struct Type * type;
12585 struct Expression * e = exp;
12586
12587 if(exp->type == 11)
12588 {
12589 if(exp->__anon1.cast.exp)
12590 ComputeExpression(exp->__anon1.cast.exp);
12591 e = exp->__anon1.cast.exp;
12592 }
12593 if(e && exp->expType)
12594 {
12595 type = exp->expType;
12596 if(type->kind == 8)
12597 {
12598 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12599
12600 if(_class && (_class->type == 3 || _class->type == 2))
12601 {
12602 if(!_class->dataType)
12603 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12604 type = _class->dataType;
12605 }
12606 }
12607 switch(type->kind)
12608 {
12609 case 24:
12610 case 1:
12611 if(type->isSigned)
12612 {
12613 char value = (char)0;
12614
12615 if(GetChar(e, &value))
12616 {
12617 FreeExpContents(exp);
12618 exp->__anon1.__anon1.constant = PrintChar(value);
12619 exp->type = 2;
12620 }
12621 }
12622 else
12623 {
12624 unsigned char value = (unsigned char)0;
12625
12626 if(GetUChar(e, &value))
12627 {
12628 FreeExpContents(exp);
12629 exp->__anon1.__anon1.constant = PrintUChar(value);
12630 exp->type = 2;
12631 }
12632 }
12633 break;
12634 case 2:
12635 if(type->isSigned)
12636 {
12637 short value = (short)0;
12638
12639 if(GetShort(e, &value))
12640 {
12641 FreeExpContents(exp);
12642 exp->__anon1.__anon1.constant = PrintShort(value);
12643 exp->type = 2;
12644 }
12645 }
12646 else
12647 {
12648 unsigned short value = (unsigned short)0;
12649
12650 if(GetUShort(e, &value))
12651 {
12652 FreeExpContents(exp);
12653 exp->__anon1.__anon1.constant = PrintUShort(value);
12654 exp->type = 2;
12655 }
12656 }
12657 break;
12658 case 3:
12659 if(type->isSigned)
12660 {
12661 int value = 0;
12662
12663 if(GetInt(e, &value))
12664 {
12665 FreeExpContents(exp);
12666 exp->__anon1.__anon1.constant = PrintInt(value);
12667 exp->type = 2;
12668 }
12669 }
12670 else
12671 {
12672 unsigned int value = 0;
12673
12674 if(GetUInt(e, &value))
12675 {
12676 FreeExpContents(exp);
12677 exp->__anon1.__anon1.constant = PrintUInt(value);
12678 exp->type = 2;
12679 }
12680 }
12681 break;
12682 case 4:
12683 if(type->isSigned)
12684 {
12685 long long value = 0;
12686
12687 if(GetInt64(e, &value))
12688 {
12689 FreeExpContents(exp);
12690 exp->__anon1.__anon1.constant = PrintInt64(value);
12691 exp->type = 2;
12692 }
12693 }
12694 else
12695 {
12696 uint64 value = 0;
12697
12698 if(GetUInt64(e, &value))
12699 {
12700 FreeExpContents(exp);
12701 exp->__anon1.__anon1.constant = PrintUInt64(value);
12702 exp->type = 2;
12703 }
12704 }
12705 break;
12706 case 22:
12707 if(type->isSigned)
12708 {
12709 intptr_t value = 0;
12710
12711 if(GetIntPtr(e, &value))
12712 {
12713 FreeExpContents(exp);
12714 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12715 exp->type = 2;
12716 }
12717 }
12718 else
12719 {
12720 uintptr_t value = 0;
12721
12722 if(GetUIntPtr(e, &value))
12723 {
12724 FreeExpContents(exp);
12725 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12726 exp->type = 2;
12727 }
12728 }
12729 break;
12730 case 23:
12731 if(type->isSigned)
12732 {
12733 ssize_t value = 0;
12734
12735 if(GetIntSize(e, &value))
12736 {
12737 FreeExpContents(exp);
12738 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12739 exp->type = 2;
12740 }
12741 }
12742 else
12743 {
12744 size_t value = 0;
12745
12746 if(GetUIntSize(e, &value))
12747 {
12748 FreeExpContents(exp);
12749 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12750 exp->type = 2;
12751 }
12752 }
12753 break;
12754 case 6:
12755 {
12756 float value = 0;
12757
12758 if(GetFloat(e, &value))
12759 {
12760 FreeExpContents(exp);
12761 exp->__anon1.__anon1.constant = PrintFloat(value);
12762 exp->type = 2;
12763 }
12764 break;
12765 }
12766 case 7:
12767 {
12768 double value = 0;
12769
12770 if(GetDouble(e, &value))
12771 {
12772 FreeExpContents(exp);
12773 exp->__anon1.__anon1.constant = PrintDouble(value);
12774 exp->type = 2;
12775 }
12776 break;
12777 }
12778 }
12779 }
12780 break;
12781 }
12782 case 12:
12783 {
12784 struct Operand op1 =
12785 {
12786 0, 0, 0,
12787 .__anon1 = {
12788 .c = 0
12789 },
12790 {
12791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12792 }
12793 };
12794 struct Operand op2 =
12795 {
12796 0, 0, 0,
12797 .__anon1 = {
12798 .c = 0
12799 },
12800 {
12801 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12802 }
12803 };
12804 struct Operand op3 =
12805 {
12806 0, 0, 0,
12807 .__anon1 = {
12808 .c = 0
12809 },
12810 {
12811 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12812 }
12813 };
12814
12815 if(exp->__anon1.cond.exp)
12816 ComputeExpression((*exp->__anon1.cond.exp).last);
12817 if(exp->__anon1.cond.elseExp)
12818 ComputeExpression(exp->__anon1.cond.elseExp);
12819 if(exp->__anon1.cond.cond)
12820 ComputeExpression(exp->__anon1.cond.cond);
12821 op1 = GetOperand(exp->__anon1.cond.cond);
12822 if(op1.type)
12823 op1.type->refCount++;
12824 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12825 if(op2.type)
12826 op2.type->refCount++;
12827 op3 = GetOperand(exp->__anon1.cond.elseExp);
12828 if(op3.type)
12829 op3.type->refCount++;
12830 if(op1.ops.Cond)
12831 {
12832 FreeExpContents(exp);
12833 op1.ops.Cond(exp, &op1, &op2, &op3);
12834 }
12835 if(op1.type)
12836 FreeType(op1.type);
12837 if(op2.type)
12838 FreeType(op2.type);
12839 if(op3.type)
12840 FreeType(op3.type);
12841 break;
12842 }
12843 }
12844 }
12845
12846 void ApplyAnyObjectLogic(struct Expression * e);
12847
12848 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12849 {
12850 unsigned int result = 1;
12851
12852 if(destType)
12853 {
12854 struct __ecereNameSpace__ecere__sys__OldList converts =
12855 {
12856 0, 0, 0, 0, 0
12857 };
12858 struct Conversion * convert;
12859
12860 if(destType->kind == 0)
12861 return 0;
12862 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12863 result = 0;
12864 if(converts.count)
12865 {
12866 for(convert = converts.first; convert; convert = convert->next)
12867 {
12868 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12869
12870 if(!empty)
12871 {
12872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12873 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12874
12875 *newExp = *exp;
12876 newExp->prev = (((void *)0));
12877 newExp->next = (((void *)0));
12878 newExp->destType = (((void *)0));
12879 if(convert->isGet)
12880 {
12881 exp->type = 8;
12882 exp->addedThis = 1;
12883 exp->__anon1.member.exp = newExp;
12884 FreeType(exp->__anon1.member.exp->expType);
12885 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12886 exp->__anon1.member.exp->expType->classObjectType = objectType;
12887 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12888 exp->__anon1.member.memberType = 1;
12889 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12890 exp->needCast = 1;
12891 if(exp->expType)
12892 exp->expType->refCount++;
12893 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12894 }
12895 else
12896 {
12897 {
12898 exp->type = 8;
12899 exp->addedThis = 1;
12900 exp->__anon1.member.exp = newExp;
12901 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)
12902 {
12903 newExp->byReference = 1;
12904 }
12905 FreeType(exp->__anon1.member.exp->expType);
12906 exp->__anon1.member.exp->expType = (((void *)0));
12907 if(convert->convert->dataType)
12908 {
12909 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12910 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12911 exp->__anon1.member.exp->expType->refCount = 1;
12912 exp->__anon1.member.exp->expType->classObjectType = objectType;
12913 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12914 }
12915 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12916 exp->__anon1.member.memberType = 4;
12917 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12918 exp->needCast = 1;
12919 if(convert->resultType)
12920 convert->resultType->refCount++;
12921 }
12922 }
12923 }
12924 else
12925 {
12926 FreeType(exp->expType);
12927 if(convert->isGet)
12928 {
12929 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12930 if(exp->destType->casted)
12931 exp->needCast = 1;
12932 if(exp->expType)
12933 exp->expType->refCount++;
12934 }
12935 else
12936 {
12937 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12938 if(exp->destType->casted)
12939 exp->needCast = 1;
12940 if(convert->resultType)
12941 convert->resultType->refCount++;
12942 }
12943 }
12944 }
12945 if(exp->isConstant && inCompiler)
12946 ComputeExpression(exp);
12947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12948 }
12949 if(!result && exp->expType && converts.count)
12950 {
12951 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12952 }
12953 if(!result && exp->expType && exp->destType)
12954 {
12955 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))
12956 result = 1;
12957 }
12958 }
12959 return result;
12960 }
12961
12962 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12963
12964 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12965
12966 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12967
12968 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12969
12970 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
12971
12972 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
12973
12974 void CheckTemplateTypes(struct Expression * exp)
12975 {
12976 struct Expression * nbExp = GetNonBracketsExp(exp);
12977
12978 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12979 {
12980 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12981 struct Context * context;
12982 int kind = exp->expType->kind;
12983
12984 *newExp = *exp;
12985 if(exp->destType)
12986 exp->destType->refCount++;
12987 if(exp->expType)
12988 exp->expType->refCount++;
12989 newExp->prev = (((void *)0));
12990 newExp->next = (((void *)0));
12991 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
12992 {
12993 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
12994
12995 if(c->type == 2 || c->type == 4 || c->type == 3)
12996 {
12997 if(!c->dataType)
12998 c->dataType = ProcessTypeString(c->dataTypeString, 0);
12999 kind = c->dataType->kind;
13000 }
13001 }
13002 switch(kind)
13003 {
13004 case 7:
13005 if(exp->destType->classObjectType)
13006 {
13007 if(exp->destType)
13008 exp->destType->refCount--;
13009 if(exp->expType)
13010 exp->expType->refCount--;
13011 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13012 }
13013 else
13014 {
13015 struct __ecereNameSpace__ecere__sys__OldList * specs;
13016 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13017 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13018
13019 context = PushContext();
13020 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13021 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13022 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13023 exp->type = 23;
13024 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13025 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
13026 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
13027 exp->__anon1.compound->__anon1.compound.context = context;
13028 PopContext(context);
13029 }
13030 break;
13031 default:
13032 exp->type = 11;
13033 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
13034 if((exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1) || __ecereProp_Type_Get_isPointerType(exp->expType))
13035 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
13036 else
13037 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13038 exp->needCast = 1;
13039 break;
13040 }
13041 }
13042 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
13043 {
13044 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13045 struct Context * context;
13046 int kind = exp->expType->kind;
13047
13048 *newExp = *exp;
13049 if(exp->destType)
13050 exp->destType->refCount++;
13051 if(exp->expType)
13052 exp->expType->refCount++;
13053 newExp->prev = (((void *)0));
13054 newExp->next = (((void *)0));
13055 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
13056 {
13057 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
13058
13059 if(c->type == 2 || c->type == 4 || c->type == 3)
13060 {
13061 if(!c->dataType)
13062 c->dataType = ProcessTypeString(c->dataTypeString, 0);
13063 kind = c->dataType->kind;
13064 }
13065 }
13066 switch(kind)
13067 {
13068 case 7:
13069 if(exp->destType->classObjectType)
13070 {
13071 if(exp->destType)
13072 exp->destType->refCount--;
13073 if(exp->expType)
13074 exp->expType->refCount--;
13075 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13076 }
13077 else
13078 {
13079 struct __ecereNameSpace__ecere__sys__OldList * specs;
13080 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13081 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13082
13083 context = PushContext();
13084 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13085 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13086 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13087 exp->type = 23;
13088 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13089 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13090 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13091 exp->__anon1.compound->__anon1.compound.context = context;
13092 PopContext(context);
13093 }
13094 break;
13095 case 8:
13096 {
13097 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13098 {
13099 exp->type = 5;
13100 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
13101 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)));
13102 ProcessExpressionType((*exp->__anon1.list).first);
13103 break;
13104 }
13105 else
13106 {
13107 exp->type = 5;
13108 if(__ecereProp_Type_Get_isPointerType(exp->expType))
13109 {
13110 exp->needTemplateCast = 2;
13111 newExp->needCast = 1;
13112 newExp->needTemplateCast = 2;
13113 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
13114 }
13115 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13116 exp->needTemplateCast = 2;
13117 newExp->needCast = 1;
13118 newExp->needTemplateCast = 2;
13119 ProcessExpressionType((*exp->__anon1.list).first);
13120 break;
13121 }
13122 }
13123 default:
13124 {
13125 if(exp->expType->kind == 20)
13126 {
13127 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13128
13129 if(type)
13130 {
13131 FreeType(exp->destType);
13132 FreeType(exp->expType);
13133 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13134 break;
13135 }
13136 }
13137 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13138 {
13139 exp->type = 4;
13140 exp->__anon1.op.op = '*';
13141 exp->__anon1.op.exp1 = (((void *)0));
13142 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13143 }
13144 else
13145 {
13146 char typeString[1024];
13147 struct Declarator * decl;
13148 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13149
13150 typeString[0] = '\0';
13151 PrintType(exp->expType, typeString, 0, 0);
13152 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13153 exp->type = 11;
13154 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13155 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13156 exp->__anon1.cast.exp->needCast = 1;
13157 }
13158 break;
13159 }
13160 }
13161 }
13162 }
13163
13164 extern int strncmp(const char * , const char * , size_t n);
13165
13166 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13167
13168 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13169 {
13170 int nsLen = strlen(nameSpace);
13171 struct Symbol * symbol;
13172
13173 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)))
13174 {
13175 char * s = symbol->string;
13176
13177 if(!strncmp(s, nameSpace, nsLen))
13178 {
13179 int c;
13180 char * namePart;
13181
13182 for(c = strlen(s) - 1; c >= 0; c--)
13183 if(s[c] == ':')
13184 break;
13185 namePart = s + c + 1;
13186 if(!strcmp(namePart, name))
13187 {
13188 return symbol;
13189 }
13190 }
13191 else
13192 break;
13193 }
13194 return (((void *)0));
13195 }
13196
13197 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13198 {
13199 int c;
13200 char nameSpace[1024];
13201 const char * namePart;
13202 unsigned int gotColon = 0;
13203
13204 nameSpace[0] = '\0';
13205 for(c = strlen(name) - 1; c >= 0; c--)
13206 if(name[c] == ':')
13207 {
13208 gotColon = 1;
13209 break;
13210 }
13211 namePart = name + c + 1;
13212 while(c >= 0 && name[c] == ':')
13213 c--;
13214 if(c >= 0)
13215 {
13216 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13217
13218 if(symbol)
13219 return symbol;
13220 memcpy(nameSpace, name, c + 1);
13221 nameSpace[c + 1] = (char)0;
13222 return ScanWithNameSpace(tree, nameSpace, namePart);
13223 }
13224 else if(gotColon)
13225 {
13226 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13227
13228 return symbol;
13229 }
13230 else
13231 {
13232 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13233
13234 if(symbol)
13235 return symbol;
13236 return ScanWithNameSpace(tree, "", namePart);
13237 }
13238 return (((void *)0));
13239 }
13240
13241 static void ProcessDeclaration(struct Declaration * decl);
13242
13243 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13244 {
13245 struct Context * ctx;
13246 struct Symbol * symbol = (((void *)0));
13247
13248 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13249 {
13250 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13251 {
13252 symbol = (((void *)0));
13253 if(thisNameSpace)
13254 {
13255 char curName[1024];
13256
13257 strcpy(curName, thisNameSpace);
13258 strcat(curName, "::");
13259 strcat(curName, name);
13260 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13261 }
13262 if(!symbol)
13263 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13264 }
13265 else
13266 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13267 if(symbol || ctx == endContext)
13268 break;
13269 }
13270 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13271 {
13272 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13273 {
13274 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13275 struct Context * tmpContext = curContext;
13276
13277 curContext = (((void *)0));
13278 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13279 curContext = tmpContext;
13280 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13281 DeclareType(symbol->type, 1, 1);
13282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13283 symbol->id = curExternal->symbol->idCode;
13284 }
13285 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13286 {
13287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13288 symbol->id = curExternal->symbol->idCode;
13289 }
13290 }
13291 return symbol;
13292 }
13293
13294 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13295 {
13296 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13297 ListAdd(specs, MkSpecifier(UNSIGNED));
13298 switch(type->kind)
13299 {
13300 case 8:
13301 {
13302 if(type->__anon1._class->__anon1.registered)
13303 {
13304 if(!type->__anon1._class->__anon1.registered->dataType)
13305 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13306 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13307 }
13308 break;
13309 }
13310 case 7:
13311 ListAdd(specs, MkSpecifier(DOUBLE));
13312 break;
13313 case 6:
13314 ListAdd(specs, MkSpecifier(FLOAT));
13315 break;
13316 case 1:
13317 ListAdd(specs, MkSpecifier(CHAR));
13318 break;
13319 case 24:
13320 ListAdd(specs, MkSpecifier(_BOOL));
13321 break;
13322 case 2:
13323 ListAdd(specs, MkSpecifier(SHORT));
13324 break;
13325 case 4:
13326 ListAdd(specs, MkSpecifier(INT64));
13327 break;
13328 case 22:
13329 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13330 break;
13331 case 23:
13332 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13333 break;
13334 case 3:
13335 default:
13336 ListAdd(specs, MkSpecifier(INT));
13337 break;
13338 }
13339 }
13340
13341 static void PrintArraySize(struct Type * arrayType, char * string)
13342 {
13343 char size[256];
13344
13345 size[0] = '\0';
13346 strcat(size, "[");
13347 if(arrayType->__anon1.__anon4.enumClass)
13348 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13349 else if(arrayType->__anon1.__anon4.arraySizeExp)
13350 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13351 strcat(size, "]");
13352 strcat(string, size);
13353 }
13354
13355 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13356 {
13357 if(type)
13358 {
13359 if(printConst && type->constant)
13360 strcat(string, "const ");
13361 switch(type->kind)
13362 {
13363 case 8:
13364 {
13365 struct Symbol * c = type->__anon1._class;
13366 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
13367
13368 if(type->classObjectType == 2 && isObjectBaseClass)
13369 strcat(string, "typed_object");
13370 else if(type->classObjectType == 3 && isObjectBaseClass)
13371 strcat(string, "any_object");
13372 else
13373 {
13374 if(c && c->string)
13375 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13376 }
13377 if(type->byReference)
13378 strcat(string, " &");
13379 break;
13380 }
13381 case 0:
13382 strcat(string, "void");
13383 break;
13384 case 3:
13385 strcat(string, type->isSigned ? "int" : "uint");
13386 break;
13387 case 4:
13388 strcat(string, type->isSigned ? "int64" : "uint64");
13389 break;
13390 case 22:
13391 strcat(string, type->isSigned ? "intptr" : "uintptr");
13392 break;
13393 case 23:
13394 strcat(string, type->isSigned ? "intsize" : "uintsize");
13395 break;
13396 case 1:
13397 strcat(string, type->isSigned ? "char" : "byte");
13398 break;
13399 case 24:
13400 strcat(string, "_Bool");
13401 break;
13402 case 2:
13403 strcat(string, type->isSigned ? "short" : "uint16");
13404 break;
13405 case 6:
13406 strcat(string, "float");
13407 break;
13408 case 7:
13409 strcat(string, "double");
13410 break;
13411 case 9:
13412 if(type->__anon1.__anon1.enumName)
13413 {
13414 strcat(string, "struct ");
13415 strcat(string, type->__anon1.__anon1.enumName);
13416 }
13417 else if(type->typeName)
13418 strcat(string, type->typeName);
13419 else
13420 {
13421 struct Type * member;
13422
13423 strcat(string, "struct { ");
13424 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13425 {
13426 PrintType(member, string, 1, fullName);
13427 strcat(string, "; ");
13428 }
13429 strcat(string, "}");
13430 }
13431 break;
13432 case 10:
13433 if(type->__anon1.__anon1.enumName)
13434 {
13435 strcat(string, "union ");
13436 strcat(string, type->__anon1.__anon1.enumName);
13437 }
13438 else if(type->typeName)
13439 strcat(string, type->typeName);
13440 else
13441 {
13442 strcat(string, "union ");
13443 strcat(string, "(unnamed)");
13444 }
13445 break;
13446 case 15:
13447 if(type->__anon1.__anon1.enumName)
13448 {
13449 strcat(string, "enum ");
13450 strcat(string, type->__anon1.__anon1.enumName);
13451 }
13452 else if(type->typeName)
13453 strcat(string, type->typeName);
13454 else
13455 strcat(string, "int");
13456 break;
13457 case 14:
13458 strcat(string, "...");
13459 break;
13460 case 19:
13461 strcat(string, "subclass(");
13462 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13463 strcat(string, ")");
13464 break;
13465 case 20:
13466 strcat(string, type->__anon1.templateParameter->identifier->string);
13467 break;
13468 case 21:
13469 strcat(string, "thisclass");
13470 break;
13471 case 17:
13472 strcat(string, "__builtin_va_list");
13473 break;
13474 }
13475 }
13476 }
13477
13478 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13479
13480 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13481 {
13482 if(type->name && type->name[0])
13483 {
13484 if(fullName)
13485 strcat(string, type->name);
13486 else
13487 {
13488 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13489
13490 if(name)
13491 name += 2;
13492 else
13493 name = type->name;
13494 strcat(string, name);
13495 }
13496 }
13497 }
13498
13499 static void PrintAttribs(struct Type * type, char * string)
13500 {
13501 if(type)
13502 {
13503 if(type->dllExport)
13504 strcat(string, "dllexport ");
13505 if(type->attrStdcall)
13506 strcat(string, "stdcall ");
13507 }
13508 }
13509
13510 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13511 {
13512 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13513 {
13514 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13515 PrintAttribs(type, string);
13516 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13517 strcat(string, " const");
13518 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13519 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13520 strcat(string, " (");
13521 if(type->kind == 13)
13522 {
13523 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13524 PrintAttribs(type->__anon1.type, string);
13525 }
13526 if(type->kind == 13)
13527 {
13528 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13529 strcat(string, "*");
13530 else
13531 strcat(string, " *");
13532 }
13533 if(printConst && type->constant && type->kind == 13)
13534 strcat(string, " const");
13535 }
13536 else
13537 PrintTypeSpecs(type, string, fullName, printConst);
13538 }
13539
13540 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13541 {
13542 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13543 strcat(string, ")");
13544 if(type->kind == 12)
13545 PrintArraySize(type, string);
13546 else if(type->kind == 11)
13547 {
13548 struct Type * param;
13549
13550 strcat(string, "(");
13551 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13552 {
13553 PrintType(param, string, 1, fullName);
13554 if(param->next)
13555 strcat(string, ", ");
13556 }
13557 strcat(string, ")");
13558 }
13559 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13560 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13561 }
13562
13563 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13564 {
13565 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13566 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13567 strcat(string, " ");
13568 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13569 {
13570 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13571
13572 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13573 {
13574 if(type->classObjectType == 1)
13575 strcat(string, "class");
13576 else
13577 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13578 }
13579 else if(_class && _class->string)
13580 {
13581 char * s = _class->string;
13582
13583 if(fullName)
13584 strcat(string, s);
13585 else
13586 {
13587 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13588
13589 if(name)
13590 name += 2;
13591 else
13592 name = s;
13593 strcat(string, name);
13594 }
13595 }
13596 strcat(string, "::");
13597 }
13598 if(printName && type->name)
13599 PrintName(type, string, fullName);
13600 PostPrintType(type, string, fullName);
13601 if(type->bitFieldCount)
13602 {
13603 char count[100];
13604
13605 sprintf(count, ":%d", type->bitFieldCount);
13606 strcat(string, count);
13607 }
13608 }
13609
13610 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13611 {
13612 _PrintType(type, string, printName, fullName, 1);
13613 }
13614
13615 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13616 {
13617 _PrintType(type, string, printName, fullName, 0);
13618 }
13619
13620 static struct Type * FindMember(struct Type * type, char * string)
13621 {
13622 struct Type * memberType;
13623
13624 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13625 {
13626 if(!memberType->name)
13627 {
13628 struct Type * subType = FindMember(memberType, string);
13629
13630 if(subType)
13631 return subType;
13632 }
13633 else if(!strcmp(memberType->name, string))
13634 return memberType;
13635 }
13636 return (((void *)0));
13637 }
13638
13639 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13640 {
13641 struct Type * memberType;
13642
13643 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13644 {
13645 if(!memberType->name)
13646 {
13647 struct Type * subType = FindMember(memberType, string);
13648
13649 if(subType)
13650 {
13651 *offset += memberType->offset;
13652 return subType;
13653 }
13654 }
13655 else if(!strcmp(memberType->name, string))
13656 {
13657 *offset += memberType->offset;
13658 return memberType;
13659 }
13660 }
13661 return (((void *)0));
13662 }
13663
13664 extern unsigned int parseError;
13665
13666 unsigned int GetParseError()
13667 {
13668 return parseError;
13669 }
13670
13671 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13672
13673 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13674
13675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13676
13677 struct Expression * ParseExpressionString(char * expression)
13678 {
13679 parseError = 0;
13680 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13681 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13682 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13683
13684 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13685 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13686 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13687 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13688
13689 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13690 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13691 echoOn = 0;
13692 parsedExpression = (((void *)0));
13693 resetScanner();
13694 expression_yyparse();
13695 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13696 return parsedExpression;
13697 }
13698
13699 extern char *  QMkString(const char *  source);
13700
13701 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13702 {
13703 struct Identifier * id = exp->__anon1.__anon1.identifier;
13704 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13705 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13706 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13707 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13708
13709 if(_class && _class->type == 4)
13710 {
13711 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13712 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13713
13714 if(enumClass)
13715 {
13716 struct __ecereNameSpace__ecere__com__Class * baseClass;
13717
13718 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13719 {
13720 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13721
13722 for(value = e->values.first; value; value = value->next)
13723 {
13724 if(!strcmp(value->name, id->string))
13725 break;
13726 }
13727 if(value)
13728 {
13729 exp->isConstant = 1;
13730 if(inCompiler || inPreCompiler || inDebugger)
13731 {
13732 char constant[256];
13733
13734 FreeExpContents(exp);
13735 exp->type = 2;
13736 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13737 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13738 else
13739 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13740 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13741 }
13742 exp->expType = MkClassType(baseClass->fullName);
13743 break;
13744 }
13745 }
13746 }
13747 if(value)
13748 return 1;
13749 }
13750 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13751 {
13752 ProcessMethodType(method);
13753 exp->expType = __extension__ ({
13754 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13755
13756 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13757 });
13758 return 1;
13759 }
13760 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13761 {
13762 if(!prop->dataType)
13763 ProcessPropertyType(prop);
13764 exp->expType = prop->dataType;
13765 if(prop->dataType)
13766 prop->dataType->refCount++;
13767 return 1;
13768 }
13769 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13770 {
13771 if(!member->dataType)
13772 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13773 exp->expType = member->dataType;
13774 if(member->dataType)
13775 member->dataType->refCount++;
13776 return 1;
13777 }
13778 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13779 {
13780 if(!classProp->dataType)
13781 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13782 if(classProp->constant)
13783 {
13784 FreeExpContents(exp);
13785 exp->isConstant = 1;
13786 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13787 {
13788 exp->type = 3;
13789 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
13790 }
13791 else
13792 {
13793 char constant[256];
13794
13795 exp->type = 2;
13796 sprintf(constant, "%d", (int)classProp->Get(_class));
13797 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13798 }
13799 }
13800 else
13801 {
13802 }
13803 exp->expType = classProp->dataType;
13804 if(classProp->dataType)
13805 classProp->dataType->refCount++;
13806 return 1;
13807 }
13808 return 0;
13809 }
13810
13811 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13812 {
13813 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13814 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13815 struct __ecereNameSpace__ecere__com__NameSpace * child;
13816
13817 if(!data)
13818 {
13819 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)))
13820 {
13821 data = ScanGlobalData(child, name);
13822 if(data)
13823 break;
13824 }
13825 }
13826 return data;
13827 }
13828
13829 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13830
13831 extern char *  strncpy(char * , const char * , size_t n);
13832
13833 static struct GlobalData * FindGlobalData(char * name)
13834 {
13835 int start = 0, c;
13836 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13837
13838 nameSpace = globalData;
13839 for(c = 0; name[c]; c++)
13840 {
13841 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13842 {
13843 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13844 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13845
13846 strncpy(spaceName, name + start, c - start);
13847 spaceName[c - start] = '\0';
13848 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13849 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13850 if(!newSpace)
13851 return (((void *)0));
13852 nameSpace = newSpace;
13853 if(name[c] == ':')
13854 c++;
13855 start = c + 1;
13856 }
13857 }
13858 if(c - start)
13859 {
13860 return ScanGlobalData(nameSpace, name + start);
13861 }
13862 return (((void *)0));
13863 }
13864
13865 static int definedExpStackPos;
13866
13867 static void * definedExpStack[512];
13868
13869 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13870 {
13871 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13872
13873 FreeExpContents(checkedExp);
13874 FreeType(checkedExp->expType);
13875 FreeType(checkedExp->destType);
13876 *checkedExp = *newExp;
13877 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13878 checkedExp->prev = prev;
13879 checkedExp->next = next;
13880 }
13881
13882 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13883
13884 extern int printf(const char * , ...);
13885
13886 void __ecereMethod_Expression_Clear();
13887
13888 void ApplyAnyObjectLogic(struct Expression * e)
13889 {
13890 struct Type * destType = e->destType;
13891
13892 if(destType && (destType->classObjectType == 3))
13893 {
13894 if(e && e->expType)
13895 {
13896 struct Type * type = e->expType;
13897 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13898
13899 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13900 {
13901 _class = type->__anon1._class->__anon1.registered;
13902 }
13903 else if(type->kind == 19)
13904 {
13905 _class = FindClass("ecere::com::Class")->__anon1.registered;
13906 }
13907 else
13908 {
13909 char string[1024] = "";
13910 struct Symbol * classSym;
13911
13912 PrintTypeNoConst(type, string, 0, 1);
13913 classSym = FindClass(string);
13914 if(classSym)
13915 _class = classSym->__anon1.registered;
13916 }
13917 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)))
13918 {
13919 if(!_class || strcmp(_class->fullName, "char *"))
13920 {
13921 struct Expression * checkedExp = e, * newExp;
13922
13923 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13924 {
13925 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13926 {
13927 if(checkedExp->type == 23)
13928 {
13929 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13930 }
13931 else
13932 checkedExp = (*checkedExp->__anon1.list).last;
13933 }
13934 else if(checkedExp->type == 11)
13935 checkedExp = checkedExp->__anon1.cast.exp;
13936 }
13937 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13938 {
13939 newExp = checkedExp->__anon1.op.exp2;
13940 checkedExp->__anon1.op.exp2 = (((void *)0));
13941 FreeExpContents(checkedExp);
13942 if(e->expType && e->expType->passAsTemplate)
13943 {
13944 char size[100];
13945
13946 ComputeTypeSize(e->expType);
13947 sprintf(size, "%d", e->expType->size);
13948 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))))));
13949 }
13950 ReplaceExpContents(checkedExp, newExp);
13951 e->byReference = 1;
13952 }
13953 else if(!e->byReference || (_class && _class->type == 5))
13954 {
13955 struct Expression * checkedExp;
13956
13957 {
13958 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;
13959
13960 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13961 {
13962 struct Context * context = PushContext();
13963 struct Declarator * decl;
13964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13965 char typeString[1024];
13966 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13967
13968 typeString[0] = '\0';
13969 *newExp = *e;
13970 newExp->prev = (((void *)0));
13971 newExp->next = (((void *)0));
13972 newExp->expType = (((void *)0));
13973 PrintTypeNoConst(e->expType, typeString, 0, 1);
13974 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13975 newExp->destType = ProcessType(specs, decl);
13976 curContext = context;
13977 if(curCompound)
13978 {
13979 char name[100];
13980 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13981
13982 e->type = 23;
13983 sprintf(name, "__internalValue%03X", internalValueCounter++);
13984 if(!curCompound->__anon1.compound.declarations)
13985 curCompound->__anon1.compound.declarations = MkList();
13986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13987 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13988 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13989 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13990 }
13991 else
13992 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13993 {
13994 struct Type * type = e->destType;
13995
13996 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13997 CopyTypeInto(e->destType, type);
13998 e->destType->refCount = 1;
13999 e->destType->classObjectType = 0;
14000 FreeType(type);
14001 }
14002 e->__anon1.compound->__anon1.compound.context = context;
14003 PopContext(context);
14004 curContext = context->parent;
14005 }
14006 }
14007 checkedExp = e;
14008 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
14009 {
14010 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
14011 {
14012 if(checkedExp->type == 23)
14013 {
14014 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14015 }
14016 else
14017 checkedExp = (*checkedExp->__anon1.list).last;
14018 }
14019 else if(checkedExp->type == 11)
14020 checkedExp = checkedExp->__anon1.cast.exp;
14021 }
14022 {
14023 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14024
14025 *operand = *checkedExp;
14026 __ecereMethod_Expression_Clear(checkedExp);
14027 checkedExp->destType = ProcessTypeString("void *", 0);
14028 checkedExp->expType = checkedExp->destType;
14029 checkedExp->destType->refCount++;
14030 checkedExp->type = 4;
14031 checkedExp->__anon1.op.op = '&';
14032 checkedExp->__anon1.op.exp1 = (((void *)0));
14033 checkedExp->__anon1.op.exp2 = operand;
14034 }
14035 }
14036 }
14037 }
14038 }
14039 }
14040 {
14041 }
14042 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))))
14043 {
14044 if(e->expType->classObjectType && destType && destType->classObjectType)
14045 {
14046 return ;
14047 }
14048 else
14049 {
14050 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14051
14052 *thisExp = *e;
14053 thisExp->prev = (((void *)0));
14054 thisExp->next = (((void *)0));
14055 __ecereMethod_Expression_Clear(e);
14056 e->type = 5;
14057 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
14058 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
14059 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
14060 {
14061 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14062 CopyTypeInto(e->expType, thisExp->expType);
14063 e->expType->byReference = 0;
14064 e->expType->refCount = 1;
14065 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))
14066 {
14067 e->expType->classObjectType = 0;
14068 }
14069 }
14070 }
14071 }
14072 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
14073 {
14074 if(destType->kind == 14)
14075 {
14076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
14077 }
14078 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))
14079 {
14080 unsigned int byReference = e->expType->byReference;
14081 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14082 struct Declarator * decl;
14083 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14084 char typeString[1024];
14085 struct Type * type;
14086 int backupClassObjectType;
14087 unsigned int backupByReference;
14088
14089 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
14090 type = e->expType;
14091 else
14092 type = destType;
14093 backupClassObjectType = type->classObjectType;
14094 backupByReference = type->byReference;
14095 type->classObjectType = 0;
14096 type->byReference = 0;
14097 typeString[0] = '\0';
14098 PrintType(type, typeString, 0, 1);
14099 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14100 type->classObjectType = backupClassObjectType;
14101 type->byReference = backupByReference;
14102 *thisExp = *e;
14103 thisExp->prev = (((void *)0));
14104 thisExp->next = (((void *)0));
14105 __ecereMethod_Expression_Clear(e);
14106 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)))
14107 {
14108 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
14109 struct Type * t;
14110
14111 destType->refCount++;
14112 e->type = 4;
14113 e->__anon1.op.op = '*';
14114 e->__anon1.op.exp1 = (((void *)0));
14115 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14116 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14117 CopyTypeInto(t, thisExp->destType);
14118 t->passAsTemplate = 0;
14119 FreeType(thisExp->destType);
14120 thisExp->destType = t;
14121 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14122 CopyTypeInto(t, destType);
14123 t->passAsTemplate = passAsTemplate;
14124 FreeType(destType);
14125 destType = t;
14126 destType->refCount = 0;
14127 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14128 CopyTypeInto(e->expType, type);
14129 if(type->passAsTemplate)
14130 {
14131 e->expType->classObjectType = 0;
14132 e->expType->passAsTemplate = 0;
14133 }
14134 e->expType->byReference = 0;
14135 e->expType->refCount = 1;
14136 }
14137 else
14138 {
14139 e->type = 11;
14140 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14141 e->__anon1.cast.exp = thisExp;
14142 e->byReference = 1;
14143 e->expType = type;
14144 type->refCount++;
14145 }
14146 if(e->destType)
14147 FreeType(e->destType);
14148 e->destType = destType;
14149 destType->refCount++;
14150 }
14151 }
14152 }
14153
14154 void ApplyLocation(struct Expression * exp, struct Location * loc)
14155 {
14156 exp->loc = *loc;
14157 switch(exp->type)
14158 {
14159 case 4:
14160 if(exp->__anon1.op.exp1)
14161 ApplyLocation(exp->__anon1.op.exp1, loc);
14162 if(exp->__anon1.op.exp2)
14163 ApplyLocation(exp->__anon1.op.exp2, loc);
14164 break;
14165 case 5:
14166 if(exp->__anon1.list)
14167 {
14168 struct Expression * e;
14169
14170 for(e = (*exp->__anon1.list).first; e; e = e->next)
14171 ApplyLocation(e, loc);
14172 }
14173 break;
14174 case 6:
14175 if(exp->__anon1.index.index)
14176 {
14177 struct Expression * e;
14178
14179 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14180 ApplyLocation(e, loc);
14181 }
14182 if(exp->__anon1.index.exp)
14183 ApplyLocation(exp->__anon1.index.exp, loc);
14184 break;
14185 case 7:
14186 if(exp->__anon1.call.arguments)
14187 {
14188 struct Expression * arg;
14189
14190 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14191 ApplyLocation(arg, loc);
14192 }
14193 if(exp->__anon1.call.exp)
14194 ApplyLocation(exp->__anon1.call.exp, loc);
14195 break;
14196 case 8:
14197 case 9:
14198 if(exp->__anon1.member.exp)
14199 ApplyLocation(exp->__anon1.member.exp, loc);
14200 break;
14201 case 11:
14202 if(exp->__anon1.cast.exp)
14203 ApplyLocation(exp->__anon1.cast.exp, loc);
14204 break;
14205 case 12:
14206 if(exp->__anon1.cond.exp)
14207 {
14208 struct Expression * e;
14209
14210 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14211 ApplyLocation(e, loc);
14212 }
14213 if(exp->__anon1.cond.cond)
14214 ApplyLocation(exp->__anon1.cond.cond, loc);
14215 if(exp->__anon1.cond.elseExp)
14216 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14217 break;
14218 case 34:
14219 if(exp->__anon1.vaArg.exp)
14220 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14221 break;
14222 default:
14223 break;
14224 }
14225 }
14226
14227 extern char *  strstr(const char * , const char * );
14228
14229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14230
14231 struct __ecereNameSpace__ecere__com__DefinedExpression
14232 {
14233 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14234 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14235 const char *  name;
14236 const char *  value;
14237 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14238 } __attribute__ ((gcc_struct));
14239
14240 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14241
14242 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14243
14244 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14245
14246 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14247
14248 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14249
14250 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14251
14252 static void ProcessStatement(struct Statement * stmt);
14253
14254 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14255
14256 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14257
14258 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14259
14260 extern const char *  sourceFile;
14261
14262 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
14263
14264 extern struct Expression * MoveExpContents(struct Expression * exp);
14265
14266 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14267
14268 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
14269
14270 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14271
14272 void ProcessExpressionType(struct Expression * exp)
14273 {
14274 unsigned int unresolved = 0;
14275 struct Location oldyylloc = yylloc;
14276 unsigned int notByReference = 0;
14277
14278 if(!exp || exp->expType)
14279 return ;
14280 yylloc = exp->loc;
14281 switch(exp->type)
14282 {
14283 case 0:
14284 {
14285 struct Identifier * id = exp->__anon1.__anon1.identifier;
14286
14287 if(!id || !topContext)
14288 return ;
14289 if(id->_class && id->_class->__anon1.__anon1.name)
14290 {
14291 id->classSym = id->_class->__anon1.__anon1.symbol;
14292 }
14293 if(!strcmp(id->string, "__runtimePlatform"))
14294 {
14295 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14296 break;
14297 }
14298 else if(strstr(id->string, "__ecereClass") == id->string)
14299 {
14300 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14301 break;
14302 }
14303 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14304 {
14305 ReplaceClassMembers(exp, thisClass);
14306 if(exp->type != 0)
14307 {
14308 ProcessExpressionType(exp);
14309 break;
14310 }
14311 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14312 break;
14313 }
14314 else
14315 {
14316 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14317
14318 if(!symbol)
14319 {
14320 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14321 break;
14322 else
14323 {
14324 if(thisClass)
14325 {
14326 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14327 if(exp->type != 0)
14328 {
14329 ProcessExpressionType(exp);
14330 break;
14331 }
14332 }
14333 else if(currentClass && !id->_class)
14334 {
14335 if(ResolveIdWithClass(exp, currentClass, 1))
14336 break;
14337 }
14338 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14339 }
14340 }
14341 if(symbol)
14342 {
14343 struct Type * type = symbol->type;
14344 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14345
14346 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14347 {
14348 struct Context * context = SetupTemplatesContext(_class);
14349
14350 type = ReplaceThisClassType(_class);
14351 FinishTemplatesContext(context);
14352 if(type)
14353 type->refCount = 0;
14354 }
14355 FreeSpecifier(id->_class);
14356 id->_class = (((void *)0));
14357 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14358 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14359 id->classSym = (((void *)0));
14360 exp->expType = type;
14361 if(type)
14362 type->refCount++;
14363 if(type && (type->kind == 15))
14364 exp->isConstant = 1;
14365 if(symbol->isParam || !strcmp(id->string, "this"))
14366 {
14367 if(_class && _class->type == 1 && !type->declaredWithStruct)
14368 exp->byReference = 1;
14369 }
14370 if(symbol->isIterator)
14371 {
14372 if(symbol->isIterator == 3)
14373 {
14374 exp->type = 5;
14375 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14376 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14377 exp->expType = (((void *)0));
14378 ProcessExpressionType(exp);
14379 }
14380 else if(symbol->isIterator != 4)
14381 {
14382 exp->type = 8;
14383 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14384 exp->__anon1.member.exp->expType = exp->expType;
14385 exp->__anon1.member.member = MkIdentifier("data");
14386 exp->expType = (((void *)0));
14387 ProcessExpressionType(exp);
14388 }
14389 }
14390 break;
14391 }
14392 else
14393 {
14394 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14395
14396 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14397 {
14398 char name[1024];
14399
14400 strcpy(name, thisNameSpace);
14401 strcat(name, "::");
14402 strcat(name, id->string);
14403 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14404 }
14405 if(!definedExp)
14406 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14407 if(definedExp)
14408 {
14409 int c;
14410
14411 for(c = 0; c < definedExpStackPos; c++)
14412 if(definedExpStack[c] == definedExp)
14413 break;
14414 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14415 {
14416 struct Location backupYylloc = yylloc;
14417 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14418
14419 definedExpStack[definedExpStackPos++] = definedExp;
14420 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14421 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14422 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14423
14424 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14425 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14426 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14427 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14428
14429 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14430 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14431 echoOn = 0;
14432 parsedExpression = (((void *)0));
14433 resetScanner();
14434 expression_yyparse();
14435 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14436 if(backInput)
14437 fileInput = backInput;
14438 yylloc = backupYylloc;
14439 if(parsedExpression)
14440 {
14441 FreeIdentifier(id);
14442 exp->type = 5;
14443 exp->__anon1.list = MkListOne(parsedExpression);
14444 ApplyLocation(parsedExpression, &yylloc);
14445 ProcessExpressionType(exp);
14446 definedExpStackPos--;
14447 return ;
14448 }
14449 definedExpStackPos--;
14450 }
14451 else
14452 {
14453 if(inCompiler)
14454 {
14455 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14456 }
14457 }
14458 }
14459 else
14460 {
14461 struct GlobalData * data = (((void *)0));
14462
14463 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14464 {
14465 char name[1024];
14466
14467 strcpy(name, thisNameSpace);
14468 strcat(name, "::");
14469 strcat(name, id->string);
14470 data = FindGlobalData(name);
14471 }
14472 if(!data)
14473 data = FindGlobalData(id->string);
14474 if(data)
14475 {
14476 DeclareGlobalData(data);
14477 exp->expType = data->dataType;
14478 if(data->dataType)
14479 data->dataType->refCount++;
14480 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14481 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14482 FreeSpecifier(id->_class);
14483 id->_class = (((void *)0));
14484 break;
14485 }
14486 else
14487 {
14488 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14489
14490 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14491 {
14492 char name[1024];
14493
14494 strcpy(name, thisNameSpace);
14495 strcat(name, "::");
14496 strcat(name, id->string);
14497 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14498 }
14499 if(!function)
14500 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14501 if(function)
14502 {
14503 char name[1024];
14504
14505 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14506 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14507 name[0] = (char)0;
14508 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14509 strcpy(name, "__ecereFunction_");
14510 FullClassNameCat(name, id->string, 0);
14511 if(DeclareFunction(function, name))
14512 {
14513 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14514 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14515 }
14516 exp->expType = function->dataType;
14517 if(function->dataType)
14518 function->dataType->refCount++;
14519 FreeSpecifier(id->_class);
14520 id->_class = (((void *)0));
14521 break;
14522 }
14523 }
14524 }
14525 }
14526 }
14527 unresolved = 1;
14528 break;
14529 }
14530 case 1:
14531 {
14532 if(!exp->__anon1.instance->_class)
14533 {
14534 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14535 {
14536 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14537 }
14538 }
14539 ProcessInstantiationType(exp->__anon1.instance);
14540 exp->isConstant = exp->__anon1.instance->isConstant;
14541 if(exp->__anon1.instance->_class)
14542 {
14543 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14544 }
14545 break;
14546 }
14547 case 2:
14548 {
14549 if(!exp->expType)
14550 {
14551 char * constant = exp->__anon1.__anon1.constant;
14552 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14553
14554 exp->expType = type;
14555 if(constant[0] == '\'')
14556 {
14557 if((int)((unsigned char *)constant)[1] > 127)
14558 {
14559 int nb;
14560 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14561
14562 if(nb < 2)
14563 ch = constant[1];
14564 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14565 exp->__anon1.__anon1.constant = PrintUInt(ch);
14566 type->kind = 8;
14567 type->__anon1._class = FindClass("unichar");
14568 type->isSigned = 0;
14569 }
14570 else
14571 {
14572 type->kind = 1;
14573 type->isSigned = 1;
14574 }
14575 }
14576 else
14577 {
14578 char * dot = strchr(constant, '.');
14579 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14580 char * exponent;
14581
14582 if(isHex)
14583 {
14584 exponent = strchr(constant, 'p');
14585 if(!exponent)
14586 exponent = strchr(constant, 'P');
14587 }
14588 else
14589 {
14590 exponent = strchr(constant, 'e');
14591 if(!exponent)
14592 exponent = strchr(constant, 'E');
14593 }
14594 if(dot || exponent)
14595 {
14596 if(strchr(constant, 'f') || strchr(constant, 'F'))
14597 type->kind = 6;
14598 else
14599 type->kind = 7;
14600 type->isSigned = 1;
14601 }
14602 else
14603 {
14604 unsigned int isSigned = constant[0] == '-';
14605 char * endP = (((void *)0));
14606 long long i64 = strtoll(constant, &endP, 0);
14607 uint64 ui64 = strtoull(constant, &endP, 0);
14608 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14609
14610 if(isSigned)
14611 {
14612 if(i64 < (((int)0x80000000)))
14613 is64Bit = 1;
14614 }
14615 else
14616 {
14617 if(ui64 > (((int)0x7fffffff)))
14618 {
14619 if(ui64 > (0xffffffff))
14620 {
14621 is64Bit = 1;
14622 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14623 isSigned = 1;
14624 }
14625 }
14626 else if(constant[0] != '0' || !constant[1])
14627 isSigned = 1;
14628 }
14629 type->kind = is64Bit ? 4 : 3;
14630 type->isSigned = isSigned;
14631 }
14632 }
14633 exp->isConstant = 1;
14634 if(exp->destType && exp->destType->kind == 7)
14635 type->kind = 7;
14636 else if(exp->destType && exp->destType->kind == 6)
14637 type->kind = 6;
14638 else if(exp->destType && exp->destType->kind == 4)
14639 type->kind = 4;
14640 }
14641 break;
14642 }
14643 case 3:
14644 {
14645 exp->isConstant = 1;
14646 exp->expType = __extension__ ({
14647 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14648
14649 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14650 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14651
14652 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
14653 }), __ecereInstance2;
14654 });
14655 break;
14656 }
14657 case 13:
14658 case 26:
14659 ProcessExpressionType(exp->__anon1._new.size);
14660 exp->expType = __extension__ ({
14661 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14662
14663 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14664 });
14665 DeclareType(exp->expType->__anon1.type, 0, 0);
14666 break;
14667 case 14:
14668 case 27:
14669 ProcessExpressionType(exp->__anon1._renew.size);
14670 ProcessExpressionType(exp->__anon1._renew.exp);
14671 exp->expType = __extension__ ({
14672 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14673
14674 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14675 });
14676 DeclareType(exp->expType->__anon1.type, 0, 0);
14677 break;
14678 case 4:
14679 {
14680 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14681 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14682 unsigned int useDestType = 0, useSideType = 0;
14683 struct Location oldyylloc = yylloc;
14684 unsigned int useSideUnit = 0;
14685 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14686 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14687
14688 switch(exp->__anon1.op.op)
14689 {
14690 case '=':
14691 case MUL_ASSIGN:
14692 case DIV_ASSIGN:
14693 case MOD_ASSIGN:
14694 case ADD_ASSIGN:
14695 case SUB_ASSIGN:
14696 case LEFT_ASSIGN:
14697 case RIGHT_ASSIGN:
14698 case AND_ASSIGN:
14699 case XOR_ASSIGN:
14700 case OR_ASSIGN:
14701 assign = 1;
14702 break;
14703 case '!':
14704 break;
14705 case AND_OP:
14706 case OR_OP:
14707 boolOps = 1;
14708 boolResult = 1;
14709 break;
14710 case EQ_OP:
14711 case '<':
14712 case '>':
14713 case LE_OP:
14714 case GE_OP:
14715 case NE_OP:
14716 boolResult = 1;
14717 useSideType = 1;
14718 break;
14719 case '+':
14720 case '-':
14721 useSideUnit = 1;
14722 useSideType = 1;
14723 useDestType = 1;
14724 break;
14725 case LEFT_OP:
14726 case RIGHT_OP:
14727 useSideType = 1;
14728 useDestType = 1;
14729 break;
14730 case '|':
14731 case '^':
14732 useSideType = 1;
14733 useDestType = 1;
14734 break;
14735 case '/':
14736 case '%':
14737 useSideType = 1;
14738 useDestType = 1;
14739 break;
14740 case '&':
14741 case '*':
14742 if(exp->__anon1.op.exp1)
14743 {
14744 useSideType = 1;
14745 useDestType = 1;
14746 }
14747 break;
14748 }
14749 if(exp->__anon1.op.op == '&')
14750 {
14751 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14752 {
14753 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14754 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14755
14756 if(symbol && symbol->isIterator == 2)
14757 {
14758 exp->type = 8;
14759 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14760 exp->__anon1.member.member = MkIdentifier("key");
14761 exp->expType = (((void *)0));
14762 exp->__anon1.op.exp2->expType = symbol->type;
14763 symbol->type->refCount++;
14764 ProcessExpressionType(exp);
14765 FreeType(dummy);
14766 break;
14767 }
14768 }
14769 }
14770 if(exp->__anon1.op.exp1)
14771 {
14772 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14773 useDestType = 0;
14774 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14775 {
14776 if(exp->__anon1.op.exp1->destType)
14777 FreeType(exp->__anon1.op.exp1->destType);
14778 exp->__anon1.op.exp1->destType = exp->destType;
14779 exp->__anon1.op.exp1->opDestType = 1;
14780 if(exp->destType)
14781 exp->destType->refCount++;
14782 }
14783 else if(!assign)
14784 {
14785 if(exp->__anon1.op.exp1->destType)
14786 FreeType(exp->__anon1.op.exp1->destType);
14787 exp->__anon1.op.exp1->destType = dummy;
14788 dummy->refCount++;
14789 }
14790 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14791 exp->__anon1.op.exp1->destType->count++;
14792 ProcessExpressionType(exp->__anon1.op.exp1);
14793 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14794 exp->__anon1.op.exp1->destType->count--;
14795 exp->__anon1.op.exp1->opDestType = 0;
14796 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)
14797 {
14798 exp->__anon1.op.exp2 = MkExpConstant("1");
14799 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14800 assign = 1;
14801 }
14802 if(exp->__anon1.op.exp1->destType == dummy)
14803 {
14804 FreeType(dummy);
14805 exp->__anon1.op.exp1->destType = (((void *)0));
14806 }
14807 type1 = exp->__anon1.op.exp1->expType;
14808 }
14809 if(exp->__anon1.op.exp2)
14810 {
14811 char expString[10240];
14812
14813 expString[0] = '\0';
14814 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14815 {
14816 if(exp->__anon1.op.exp1)
14817 {
14818 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14819 if(exp->__anon1.op.exp1->expType)
14820 exp->__anon1.op.exp1->expType->refCount++;
14821 }
14822 else
14823 {
14824 exp->__anon1.op.exp2->destType = exp->destType;
14825 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14826 exp->__anon1.op.exp2->opDestType = 1;
14827 if(exp->destType)
14828 exp->destType->refCount++;
14829 }
14830 if(type1)
14831 type1->refCount++;
14832 exp->expType = type1;
14833 }
14834 else if(assign)
14835 {
14836 if(inCompiler)
14837 PrintExpression(exp->__anon1.op.exp2, expString);
14838 if(type1 && type1->kind == 13)
14839 {
14840 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)
14841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14842 else if(exp->__anon1.op.op == '=')
14843 {
14844 if(exp->__anon1.op.exp2->destType)
14845 FreeType(exp->__anon1.op.exp2->destType);
14846 exp->__anon1.op.exp2->destType = type1;
14847 if(type1)
14848 type1->refCount++;
14849 }
14850 }
14851 else
14852 {
14853 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)
14854 ;
14855 else
14856 {
14857 if(exp->__anon1.op.exp2->destType)
14858 FreeType(exp->__anon1.op.exp2->destType);
14859 exp->__anon1.op.exp2->destType = type1;
14860 if(type1)
14861 type1->refCount++;
14862 }
14863 }
14864 if(type1)
14865 type1->refCount++;
14866 exp->expType = type1;
14867 }
14868 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14869 {
14870 if(exp->__anon1.op.exp2->destType)
14871 FreeType(exp->__anon1.op.exp2->destType);
14872 exp->__anon1.op.exp2->destType = exp->destType;
14873 if(exp->__anon1.op.op != '&')
14874 exp->__anon1.op.exp2->opDestType = 1;
14875 if(exp->destType)
14876 exp->destType->refCount++;
14877 }
14878 else
14879 {
14880 if(exp->__anon1.op.exp2->destType)
14881 FreeType(exp->__anon1.op.exp2->destType);
14882 exp->__anon1.op.exp2->destType = dummy;
14883 dummy->refCount++;
14884 }
14885 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))
14886 {
14887 FreeType(exp->__anon1.op.exp2->destType);
14888 exp->__anon1.op.exp2->destType = type1;
14889 type1->refCount++;
14890 }
14891 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14892 exp->__anon1.op.exp2->destType->count++;
14893 if(exp->__anon1.op.op == SIZEOF)
14894 {
14895 struct Expression * e = exp->__anon1.op.exp2;
14896
14897 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14898 {
14899 if(e->type == 5 || e->type == 32 || e->type == 23)
14900 {
14901 if(e->type == 23)
14902 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14903 else
14904 e = (*e->__anon1.list).last;
14905 }
14906 }
14907 if(e->type == 11 && e->__anon1.cast.exp)
14908 e->__anon1.cast.exp->needCast = 1;
14909 }
14910 ProcessExpressionType(exp->__anon1.op.exp2);
14911 exp->__anon1.op.exp2->opDestType = 0;
14912 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14913 exp->__anon1.op.exp2->destType->count--;
14914 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14915 {
14916 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)
14917 {
14918 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14919 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14920 }
14921 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)))
14922 {
14923 if(exp->__anon1.op.op == ADD_ASSIGN)
14924 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14925 }
14926 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))
14927 {
14928 if(exp->__anon1.op.op == ADD_ASSIGN)
14929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14930 }
14931 else if(inCompiler)
14932 {
14933 char type1String[1024];
14934 char type2String[1024];
14935
14936 type1String[0] = '\0';
14937 type2String[0] = '\0';
14938 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14939 PrintType(type1, type2String, 0, 1);
14940 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14941 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14942 }
14943 }
14944 if(exp->__anon1.op.exp2->destType == dummy)
14945 {
14946 FreeType(dummy);
14947 exp->__anon1.op.exp2->destType = (((void *)0));
14948 }
14949 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14950 {
14951 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14952 type2->refCount = 1;
14953 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14954 type2->isSigned = 1;
14955 }
14956 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))
14957 {
14958 type2 = __extension__ ({
14959 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14960
14961 __ecereInstance1->kind = 3, __ecereInstance1;
14962 });
14963 type2->refCount = 1;
14964 type2->isSigned = 1;
14965 }
14966 else
14967 {
14968 type2 = exp->__anon1.op.exp2->expType;
14969 if(type2)
14970 type2->refCount++;
14971 }
14972 }
14973 dummy->kind = 0;
14974 if(exp->__anon1.op.op == SIZEOF)
14975 {
14976 exp->expType = __extension__ ({
14977 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14978
14979 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14980 });
14981 exp->isConstant = 1;
14982 }
14983 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14984 {
14985 exp->expType = Dereference(type2);
14986 if(type2 && type2->kind == 8)
14987 notByReference = 1;
14988 }
14989 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14990 exp->expType = Reference(type2);
14991 else if(!assign)
14992 {
14993 if(boolOps)
14994 {
14995 if(exp->__anon1.op.exp1)
14996 {
14997 if(exp->__anon1.op.exp1->destType)
14998 FreeType(exp->__anon1.op.exp1->destType);
14999 exp->__anon1.op.exp1->destType = MkClassType("bool");
15000 exp->__anon1.op.exp1->destType->truth = 1;
15001 if(!exp->__anon1.op.exp1->expType)
15002 ProcessExpressionType(exp->__anon1.op.exp1);
15003 else
15004 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15005 FreeType(exp->__anon1.op.exp1->expType);
15006 exp->__anon1.op.exp1->expType = MkClassType("bool");
15007 exp->__anon1.op.exp1->expType->truth = 1;
15008 }
15009 if(exp->__anon1.op.exp2)
15010 {
15011 if(exp->__anon1.op.exp2->destType)
15012 FreeType(exp->__anon1.op.exp2->destType);
15013 exp->__anon1.op.exp2->destType = MkClassType("bool");
15014 exp->__anon1.op.exp2->destType->truth = 1;
15015 if(!exp->__anon1.op.exp2->expType)
15016 ProcessExpressionType(exp->__anon1.op.exp2);
15017 else
15018 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15019 FreeType(exp->__anon1.op.exp2->expType);
15020 exp->__anon1.op.exp2->expType = MkClassType("bool");
15021 exp->__anon1.op.exp2->expType->truth = 1;
15022 }
15023 }
15024 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")))))
15025 {
15026 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"))))
15027 {
15028 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)))
15029 {
15030 struct Type * intType;
15031
15032 if(!type1->__anon1._class->__anon1.registered->dataType)
15033 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15034 if(!type2->__anon1._class->__anon1.registered->dataType)
15035 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15036 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
15037 if(exp->__anon1.op.exp1->destType)
15038 FreeType(exp->__anon1.op.exp1->destType);
15039 if(exp->__anon1.op.exp2->destType)
15040 FreeType(exp->__anon1.op.exp2->destType);
15041 exp->__anon1.op.exp1->destType = intType;
15042 exp->__anon1.op.exp2->destType = intType;
15043 intType->refCount++;
15044 }
15045 else
15046 {
15047 if(exp->__anon1.op.exp2->destType)
15048 FreeType(exp->__anon1.op.exp2->destType);
15049 exp->__anon1.op.exp2->destType = type1;
15050 type1->refCount++;
15051 if(exp->__anon1.op.exp1->destType)
15052 FreeType(exp->__anon1.op.exp1->destType);
15053 exp->__anon1.op.exp1->destType = type2;
15054 type2->refCount++;
15055 }
15056 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)
15057 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);
15058 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
15059 {
15060 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15061
15062 if(argExp)
15063 {
15064 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15065
15066 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
15067 ProcessExpressionType(exp->__anon1.op.exp1);
15068 if(type2->kind != 13)
15069 {
15070 ProcessExpressionType(classExp);
15071 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
15072 if(!exp->__anon1.op.exp2->expType)
15073 {
15074 if(type2)
15075 FreeType(type2);
15076 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
15077 type2->refCount++;
15078 }
15079 ProcessExpressionType(exp->__anon1.op.exp2);
15080 }
15081 }
15082 }
15083 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)))
15084 {
15085 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
15086 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15087 exp->expType = type1;
15088 if(type1)
15089 type1->refCount++;
15090 }
15091 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)))
15092 {
15093 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
15094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
15095 exp->expType = type2;
15096 if(type2)
15097 type2->refCount++;
15098 }
15099 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))
15100 {
15101 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
15102 }
15103 else
15104 {
15105 unsigned int success = 0;
15106
15107 if(type1->kind == 13 && type2->kind == 13)
15108 {
15109 if(exp->__anon1.op.op == '+')
15110 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
15111 else if(exp->__anon1.op.op == '-')
15112 {
15113 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
15114 {
15115 exp->expType = __extension__ ({
15116 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15117
15118 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15119 });
15120 success = 1;
15121 if(type1->__anon1.type->kind == 20)
15122 {
15123 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15124
15125 if(argExp)
15126 {
15127 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15128
15129 ProcessExpressionType(classExp);
15130 exp->type = 5;
15131 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"))));
15132 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15133 FreeType(dummy);
15134 return ;
15135 }
15136 }
15137 }
15138 }
15139 }
15140 if(!success && exp->__anon1.op.exp1->type == 2)
15141 {
15142 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15143 {
15144 if(exp->expType)
15145 FreeType(exp->expType);
15146 exp->expType = exp->__anon1.op.exp1->destType;
15147 if(exp->__anon1.op.exp1->destType)
15148 exp->__anon1.op.exp1->destType->refCount++;
15149 success = 1;
15150 }
15151 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15152 {
15153 if(exp->expType)
15154 FreeType(exp->expType);
15155 exp->expType = exp->__anon1.op.exp2->destType;
15156 if(exp->__anon1.op.exp2->destType)
15157 exp->__anon1.op.exp2->destType->refCount++;
15158 success = 1;
15159 }
15160 }
15161 else if(!success)
15162 {
15163 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15164 {
15165 if(exp->expType)
15166 FreeType(exp->expType);
15167 exp->expType = exp->__anon1.op.exp2->destType;
15168 if(exp->__anon1.op.exp2->destType)
15169 exp->__anon1.op.exp2->destType->refCount++;
15170 success = 1;
15171 }
15172 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15173 {
15174 if(exp->expType)
15175 FreeType(exp->expType);
15176 exp->expType = exp->__anon1.op.exp1->destType;
15177 if(exp->__anon1.op.exp1->destType)
15178 exp->__anon1.op.exp1->destType->refCount++;
15179 success = 1;
15180 }
15181 }
15182 if(!success)
15183 {
15184 char expString1[10240];
15185 char expString2[10240];
15186 char type1[1024];
15187 char type2[1024];
15188
15189 expString1[0] = '\0';
15190 expString2[0] = '\0';
15191 type1[0] = '\0';
15192 type2[0] = '\0';
15193 if(inCompiler)
15194 {
15195 PrintExpression(exp->__anon1.op.exp1, expString1);
15196 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15197 PrintExpression(exp->__anon1.op.exp2, expString2);
15198 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15199 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15200 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15201 }
15202 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15203 }
15204 }
15205 }
15206 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)
15207 {
15208 if(exp->__anon1.op.exp1->destType)
15209 FreeType(exp->__anon1.op.exp1->destType);
15210 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15211 if(type2->__anon1._class->__anon1.registered->dataType)
15212 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15213 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15214 exp->expType = type2;
15215 if(type2)
15216 type2->refCount++;
15217 }
15218 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)
15219 {
15220 if(exp->__anon1.op.exp2->destType)
15221 FreeType(exp->__anon1.op.exp2->destType);
15222 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15223 if(type1->__anon1._class->__anon1.registered->dataType)
15224 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15225 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15226 exp->expType = type1;
15227 if(type1)
15228 type1->refCount++;
15229 }
15230 else if(type1)
15231 {
15232 unsigned int valid = 0;
15233
15234 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15235 {
15236 if(exp->__anon1.op.exp2->destType)
15237 FreeType(exp->__anon1.op.exp2->destType);
15238 if(!type1->__anon1._class->__anon1.registered->dataType)
15239 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15240 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15241 exp->__anon1.op.exp2->destType->refCount++;
15242 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15243 if(type2)
15244 FreeType(type2);
15245 type2 = exp->__anon1.op.exp2->destType;
15246 if(type2)
15247 type2->refCount++;
15248 exp->expType = type2;
15249 type2->refCount++;
15250 }
15251 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15252 {
15253 if(exp->__anon1.op.exp1->destType)
15254 FreeType(exp->__anon1.op.exp1->destType);
15255 if(!type2->__anon1._class->__anon1.registered->dataType)
15256 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15257 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15258 exp->__anon1.op.exp1->destType->refCount++;
15259 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15260 type1 = exp->__anon1.op.exp1->destType;
15261 exp->expType = type1;
15262 type1->refCount++;
15263 }
15264 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15265 {
15266 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15267 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15268
15269 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15270 {
15271 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15272 {
15273 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15274 {
15275 if(exp->expType)
15276 FreeType(exp->expType);
15277 exp->expType = exp->__anon1.op.exp2->expType;
15278 if(exp->__anon1.op.exp2->expType)
15279 exp->__anon1.op.exp2->expType->refCount++;
15280 valid = 1;
15281 }
15282 }
15283 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15284 {
15285 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15286 {
15287 if(exp->expType)
15288 FreeType(exp->expType);
15289 exp->expType = exp->__anon1.op.exp1->expType;
15290 if(exp->__anon1.op.exp1->expType)
15291 exp->__anon1.op.exp1->expType->refCount++;
15292 valid = 1;
15293 }
15294 }
15295 }
15296 else
15297 {
15298 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15299 {
15300 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15301 {
15302 if(exp->expType)
15303 FreeType(exp->expType);
15304 exp->expType = exp->__anon1.op.exp1->expType;
15305 if(exp->__anon1.op.exp1->expType)
15306 exp->__anon1.op.exp1->expType->refCount++;
15307 valid = 1;
15308 }
15309 }
15310 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15311 {
15312 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15313 {
15314 if(exp->expType)
15315 FreeType(exp->expType);
15316 exp->expType = exp->__anon1.op.exp2->expType;
15317 if(exp->__anon1.op.exp2->expType)
15318 exp->__anon1.op.exp2->expType->refCount++;
15319 valid = 1;
15320 }
15321 }
15322 }
15323 }
15324 if(!valid)
15325 {
15326 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))
15327 {
15328 if(exp->__anon1.op.exp1->destType)
15329 FreeType(exp->__anon1.op.exp1->destType);
15330 exp->__anon1.op.exp1->destType = type2;
15331 type2->refCount++;
15332 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15333 {
15334 if(exp->expType)
15335 FreeType(exp->expType);
15336 exp->expType = exp->__anon1.op.exp1->destType;
15337 if(exp->__anon1.op.exp1->destType)
15338 exp->__anon1.op.exp1->destType->refCount++;
15339 }
15340 }
15341 else
15342 {
15343 if(exp->__anon1.op.exp2->destType)
15344 FreeType(exp->__anon1.op.exp2->destType);
15345 exp->__anon1.op.exp2->destType = type1;
15346 type1->refCount++;
15347 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15348 {
15349 if(exp->expType)
15350 FreeType(exp->expType);
15351 exp->expType = exp->__anon1.op.exp2->destType;
15352 if(exp->__anon1.op.exp2->destType)
15353 exp->__anon1.op.exp2->destType->refCount++;
15354 }
15355 else if(type1 && type2)
15356 {
15357 char expString1[10240];
15358 char expString2[10240];
15359 char type1String[1024];
15360 char type2String[1024];
15361
15362 expString1[0] = '\0';
15363 expString2[0] = '\0';
15364 type1String[0] = '\0';
15365 type2String[0] = '\0';
15366 if(inCompiler)
15367 {
15368 PrintExpression(exp->__anon1.op.exp1, expString1);
15369 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15370 PrintExpression(exp->__anon1.op.exp2, expString2);
15371 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15372 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15373 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15374 }
15375 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15376 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15377 {
15378 exp->expType = exp->__anon1.op.exp1->expType;
15379 if(exp->__anon1.op.exp1->expType)
15380 exp->__anon1.op.exp1->expType->refCount++;
15381 }
15382 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15383 {
15384 exp->expType = exp->__anon1.op.exp2->expType;
15385 if(exp->__anon1.op.exp2->expType)
15386 exp->__anon1.op.exp2->expType->refCount++;
15387 }
15388 }
15389 }
15390 }
15391 }
15392 else if(type2)
15393 {
15394 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15395 {
15396 struct Type * oldType = exp->__anon1.op.exp1->expType;
15397
15398 exp->__anon1.op.exp1->expType = (((void *)0));
15399 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15400 FreeType(oldType);
15401 else
15402 exp->__anon1.op.exp1->expType = oldType;
15403 }
15404 if(exp->__anon1.op.exp1->destType)
15405 FreeType(exp->__anon1.op.exp1->destType);
15406 exp->__anon1.op.exp1->destType = type2;
15407 type2->refCount++;
15408 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15409 {
15410 if(exp->expType)
15411 FreeType(exp->expType);
15412 exp->expType = exp->__anon1.op.exp1->destType;
15413 if(exp->__anon1.op.exp1->destType)
15414 exp->__anon1.op.exp1->destType->refCount++;
15415 }
15416 }
15417 }
15418 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15419 {
15420 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15421 {
15422 if(exp->__anon1.op.exp1->destType)
15423 FreeType(exp->__anon1.op.exp1->destType);
15424 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15425 if(type2->__anon1._class->__anon1.registered->dataType)
15426 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15427 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15428 }
15429 if(exp->__anon1.op.op == '!')
15430 {
15431 exp->expType = MkClassType("bool");
15432 exp->expType->truth = 1;
15433 }
15434 else
15435 {
15436 exp->expType = type2;
15437 if(type2)
15438 type2->refCount++;
15439 }
15440 }
15441 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15442 {
15443 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15444 {
15445 if(exp->__anon1.op.exp2->destType)
15446 FreeType(exp->__anon1.op.exp2->destType);
15447 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15448 if(type1->__anon1._class->__anon1.registered->dataType)
15449 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15450 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15451 }
15452 exp->expType = type1;
15453 if(type1)
15454 type1->refCount++;
15455 }
15456 }
15457 yylloc = exp->loc;
15458 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15459 {
15460 char expString[10000];
15461
15462 expString[0] = '\0';
15463 if(inCompiler)
15464 {
15465 PrintExpression(exp->__anon1.op.exp1, expString);
15466 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15467 }
15468 if(expString[0])
15469 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15470 }
15471 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15472 {
15473 char expString[10240];
15474
15475 expString[0] = '\0';
15476 if(inCompiler)
15477 {
15478 PrintExpression(exp->__anon1.op.exp2, expString);
15479 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15480 }
15481 if(expString[0])
15482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15483 }
15484 if(boolResult)
15485 {
15486 FreeType(exp->expType);
15487 exp->expType = MkClassType("bool");
15488 exp->expType->truth = 1;
15489 }
15490 if(exp->__anon1.op.op != SIZEOF)
15491 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15492 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15493 {
15494 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15495 }
15496 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15497 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15498 yylloc = oldyylloc;
15499 FreeType(dummy);
15500 if(type2)
15501 FreeType(type2);
15502 break;
15503 }
15504 case 5:
15505 case 32:
15506 {
15507 struct Expression * e;
15508
15509 exp->isConstant = 1;
15510 for(e = (*exp->__anon1.list).first; e; e = e->next)
15511 {
15512 if(!e->next)
15513 {
15514 FreeType(e->destType);
15515 e->opDestType = exp->opDestType;
15516 e->destType = exp->destType;
15517 if(e->destType)
15518 {
15519 exp->destType->refCount++;
15520 }
15521 }
15522 ProcessExpressionType(e);
15523 if(!exp->expType && !e->next)
15524 {
15525 exp->expType = e->expType;
15526 if(e->expType)
15527 e->expType->refCount++;
15528 }
15529 if(!e->isConstant)
15530 exp->isConstant = 0;
15531 }
15532 e = (*exp->__anon1.list).first;
15533 if(!e->next && e->type == 8)
15534 {
15535 struct Expression * next = exp->next, * prev = exp->prev;
15536
15537 FreeType(exp->expType);
15538 FreeType(exp->destType);
15539 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15540 *exp = *e;
15541 exp->prev = prev;
15542 exp->next = next;
15543 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15544 ProcessExpressionType(exp);
15545 }
15546 break;
15547 }
15548 case 6:
15549 {
15550 struct Expression * e;
15551
15552 exp->isConstant = 1;
15553 ProcessExpressionType(exp->__anon1.index.exp);
15554 if(!exp->__anon1.index.exp->isConstant)
15555 exp->isConstant = 0;
15556 if(exp->__anon1.index.exp->expType)
15557 {
15558 struct Type * source = exp->__anon1.index.exp->expType;
15559
15560 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15561 {
15562 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15563 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15564
15565 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15566 {
15567 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15568 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15569 {
15570 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15571
15572 if(type->kind == 8)
15573 type->constant = 1;
15574 else if(type->kind == 13)
15575 {
15576 struct Type * t = type;
15577
15578 while(t->kind == 13)
15579 t = t->__anon1.type;
15580 t->constant = 1;
15581 }
15582 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15583 }
15584 }
15585 }
15586 }
15587 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15588 {
15589 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15590 {
15591 if(e->destType)
15592 FreeType(e->destType);
15593 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15594 }
15595 ProcessExpressionType(e);
15596 if(!e->next)
15597 {
15598 }
15599 if(!e->isConstant)
15600 exp->isConstant = 0;
15601 }
15602 if(!exp->expType)
15603 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15604 if(exp->expType)
15605 DeclareType(exp->expType, 0, 0);
15606 break;
15607 }
15608 case 7:
15609 {
15610 struct Expression * e;
15611 struct Type * functionType;
15612 struct Type * methodType = (((void *)0));
15613 char name[1024];
15614
15615 name[0] = '\0';
15616 if(inCompiler)
15617 {
15618 PrintExpression(exp->__anon1.call.exp, name);
15619 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15620 {
15621 PrintExpression(exp->__anon1.call.exp, name);
15622 }
15623 }
15624 if(exp->__anon1.call.exp->type == 0)
15625 {
15626 struct Expression * idExp = exp->__anon1.call.exp;
15627 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15628
15629 if(!strcmp(id->string, "__builtin_frame_address"))
15630 {
15631 exp->expType = ProcessTypeString("void *", 1);
15632 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15633 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15634 break;
15635 }
15636 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15637 {
15638 exp->expType = ProcessTypeString("int", 1);
15639 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15640 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15641 break;
15642 }
15643 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15644 {
15645 struct Expression * a = (((void *)0));
15646 struct Expression * b = (((void *)0));
15647 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15648
15649 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15650 {
15651 a = (*exp->__anon1.call.arguments).first;
15652 b = (*exp->__anon1.call.arguments).last;
15653 tempExp1 = a;
15654 tempExp2 = b;
15655 }
15656 else if((*exp->__anon1.call.arguments).count == 1)
15657 {
15658 a = (*exp->__anon1.call.arguments).first;
15659 tempExp1 = a;
15660 }
15661 if(a)
15662 {
15663 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15664 idExp->__anon1.__anon1.identifier = (((void *)0));
15665 FreeExpContents(exp);
15666 ProcessExpressionType(a);
15667 if(b)
15668 ProcessExpressionType(b);
15669 exp->type = 5;
15670 exp->__anon1.list = MkList();
15671 if(a->expType && (!b || b->expType))
15672 {
15673 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15674 {
15675 if(inCompiler)
15676 {
15677 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15678 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15679 struct Declaration * decl;
15680 char temp1[1024], temp2[1024];
15681
15682 GetTypeSpecs(a->expType, specs);
15683 if(a && !a->isConstant && a->type != 0)
15684 {
15685 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15686 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15687 tempExp1 = QMkExpId(temp1);
15688 tempExp1->expType = a->expType;
15689 if(a->expType)
15690 a->expType->refCount++;
15691 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15692 }
15693 if(b && !b->isConstant && b->type != 0)
15694 {
15695 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15696 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15697 tempExp2 = QMkExpId(temp2);
15698 tempExp2->expType = b->expType;
15699 if(b->expType)
15700 b->expType->refCount++;
15701 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15702 }
15703 decl = MkDeclaration(specs, decls);
15704 if(!curCompound->__anon1.compound.declarations)
15705 curCompound->__anon1.compound.declarations = MkList();
15706 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15707 }
15708 }
15709 }
15710 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15711 {
15712 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15713
15714 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15715 exp->expType = a->expType;
15716 if(a->expType)
15717 a->expType->refCount++;
15718 }
15719 else if(!strcmp(id->string, "Abs"))
15720 {
15721 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15722 exp->expType = a->expType;
15723 if(a->expType)
15724 a->expType->refCount++;
15725 }
15726 else if(!strcmp(id->string, "Sgn"))
15727 {
15728 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"))))));
15729 exp->expType = ProcessTypeString("int", 0);
15730 }
15731 FreeExpression(tempExp1);
15732 if(tempExp2)
15733 FreeExpression(tempExp2);
15734 FreeIdentifier(id);
15735 break;
15736 }
15737 }
15738 }
15739 {
15740 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15741
15742 if(!exp->__anon1.call.exp->destType)
15743 {
15744 exp->__anon1.call.exp->destType = dummy;
15745 dummy->refCount++;
15746 }
15747 ProcessExpressionType(exp->__anon1.call.exp);
15748 if(exp->__anon1.call.exp->destType == dummy)
15749 {
15750 FreeType(dummy);
15751 exp->__anon1.call.exp->destType = (((void *)0));
15752 }
15753 FreeType(dummy);
15754 }
15755 functionType = exp->__anon1.call.exp->expType;
15756 if(functionType && functionType->kind == 16)
15757 {
15758 methodType = functionType;
15759 functionType = methodType->__anon1.__anon3.method->dataType;
15760 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15761 {
15762 char typeString[1024];
15763
15764 typeString[0] = '\0';
15765 {
15766 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15767
15768 functionType->__anon1.__anon2.thisClass = (((void *)0));
15769 PrintType(functionType, typeString, 1, 1);
15770 functionType->__anon1.__anon2.thisClass = back;
15771 }
15772 if(strstr(typeString, "thisclass"))
15773 {
15774 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15775 struct Declarator * decl;
15776
15777 {
15778 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15779
15780 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15781 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))
15782 thisClassParams = 0;
15783 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15784 {
15785 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15786
15787 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15788 ProcessDeclarator(decl);
15789 thisClass = backupThisClass;
15790 }
15791 thisClassParams = 1;
15792 functionType = ProcessType(specs, decl);
15793 functionType->refCount = 0;
15794 FinishTemplatesContext(context);
15795 }
15796 FreeList(specs, (void *)(FreeSpecifier));
15797 FreeDeclarator(decl);
15798 }
15799 }
15800 }
15801 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15802 {
15803 struct Type * type = functionType->__anon1.type;
15804
15805 if(!functionType->refCount)
15806 {
15807 functionType->__anon1.type = (((void *)0));
15808 FreeType(functionType);
15809 }
15810 functionType = type;
15811 }
15812 if(functionType && functionType->kind != 11)
15813 {
15814 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15815 }
15816 else if(functionType)
15817 {
15818 unsigned int emptyParams = 0, noParams = 0;
15819 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15820 struct Type * type = functionType->__anon1.__anon2.params.first;
15821 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15822 int extra = 0;
15823 struct Location oldyylloc = yylloc;
15824
15825 if(!type)
15826 emptyParams = 1;
15827 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15828 {
15829 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15830 e = e->next;
15831 }
15832 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15833 {
15834 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)
15835 {
15836 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15837 if(e)
15838 {
15839 e->destType = type;
15840 e = e->next;
15841 type = functionType->__anon1.__anon2.params.first;
15842 }
15843 else
15844 type->refCount = 0;
15845 }
15846 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15847 {
15848 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15849 type->byReference = functionType->byReference;
15850 type->typedByReference = functionType->typedByReference;
15851 if(e)
15852 {
15853 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15854 e = e->next;
15855 e->destType = type;
15856 e = e->next;
15857 type = functionType->__anon1.__anon2.params.first;
15858 }
15859 else
15860 type->refCount = 0;
15861 }
15862 }
15863 if(type && type->kind == 0)
15864 {
15865 noParams = 1;
15866 if(!type->refCount)
15867 FreeType(type);
15868 type = (((void *)0));
15869 }
15870 for(; e; e = e->next)
15871 {
15872 if(!type && !emptyParams)
15873 {
15874 yylloc = e->loc;
15875 if(methodType && methodType->__anon1.__anon3.methodClass)
15876 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);
15877 else
15878 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);
15879 break;
15880 }
15881 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15882 {
15883 struct Type * templatedType = (((void *)0));
15884 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15885 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15886 int id = 0;
15887
15888 if(_class && _class->templateArgs)
15889 {
15890 struct __ecereNameSpace__ecere__com__Class * sClass;
15891
15892 for(sClass = _class; sClass; sClass = sClass->base)
15893 {
15894 if(sClass->templateClass)
15895 sClass = sClass->templateClass;
15896 id = 0;
15897 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15898 {
15899 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15900 {
15901 struct __ecereNameSpace__ecere__com__Class * nextClass;
15902
15903 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15904 {
15905 if(nextClass->templateClass)
15906 nextClass = nextClass->templateClass;
15907 id += nextClass->templateParams.count;
15908 }
15909 break;
15910 }
15911 id++;
15912 }
15913 if(curParam)
15914 break;
15915 }
15916 }
15917 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15918 {
15919 unsigned int constant = type->constant;
15920 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15921
15922 {
15923 struct Context * context = SetupTemplatesContext(_class);
15924
15925 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15926 FinishTemplatesContext(context);
15927 }
15928 if(templatedType->kind == 8 && constant)
15929 templatedType->constant = 1;
15930 else if(templatedType->kind == 13)
15931 {
15932 struct Type * t = templatedType->__anon1.type;
15933
15934 while(t->kind == 13)
15935 t = t->__anon1.type;
15936 if(constant)
15937 t->constant = constant;
15938 }
15939 e->destType = templatedType;
15940 if(templatedType)
15941 {
15942 templatedType->passAsTemplate = 1;
15943 }
15944 }
15945 else
15946 {
15947 e->destType = type;
15948 if(type)
15949 type->refCount++;
15950 }
15951 }
15952 else
15953 {
15954 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15955 {
15956 e->destType = type->prev;
15957 e->destType->refCount++;
15958 }
15959 else
15960 {
15961 e->destType = type;
15962 if(type)
15963 type->refCount++;
15964 }
15965 }
15966 if(type && type->kind != 14)
15967 {
15968 struct Type * next = type->next;
15969
15970 if(!type->refCount)
15971 FreeType(type);
15972 type = next;
15973 }
15974 }
15975 if(type && type->kind != 14)
15976 {
15977 if(methodType && methodType->__anon1.__anon3.methodClass)
15978 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);
15979 else
15980 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);
15981 }
15982 yylloc = oldyylloc;
15983 if(type && !type->refCount)
15984 FreeType(type);
15985 }
15986 else
15987 {
15988 functionType = __extension__ ({
15989 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15990
15991 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15992 });
15993 if(exp->__anon1.call.exp->type == 0)
15994 {
15995 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15996
15997 if(inCompiler)
15998 {
15999 struct Symbol * symbol;
16000 struct Location oldyylloc = yylloc;
16001
16002 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
16003 if(strstr(string, "__builtin_") == string)
16004 {
16005 if(exp->destType)
16006 {
16007 functionType->__anon1.__anon2.returnType = exp->destType;
16008 exp->destType->refCount++;
16009 }
16010 }
16011 else
16012 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
16013 symbol = __extension__ ({
16014 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16015
16016 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
16017 });
16018 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
16019 if(strstr(symbol->string, "::"))
16020 globalContext->hasNameSpace = 1;
16021 yylloc = oldyylloc;
16022 }
16023 }
16024 else if(exp->__anon1.call.exp->type == 8)
16025 {
16026 }
16027 else
16028 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
16029 if(!functionType->__anon1.__anon2.returnType)
16030 {
16031 functionType->__anon1.__anon2.returnType = __extension__ ({
16032 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16033
16034 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16035 });
16036 }
16037 }
16038 if(functionType && functionType->kind == 11)
16039 {
16040 exp->expType = functionType->__anon1.__anon2.returnType;
16041 if(functionType->__anon1.__anon2.returnType)
16042 functionType->__anon1.__anon2.returnType->refCount++;
16043 if(!functionType->refCount)
16044 FreeType(functionType);
16045 }
16046 if(exp->__anon1.call.arguments)
16047 {
16048 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
16049 ProcessExpressionType(e);
16050 }
16051 break;
16052 }
16053 case 8:
16054 {
16055 struct Type * type;
16056 struct Location oldyylloc = yylloc;
16057 unsigned int thisPtr;
16058 struct Expression * checkExp = exp->__anon1.member.exp;
16059
16060 while(checkExp)
16061 {
16062 if(checkExp->type == 11)
16063 checkExp = checkExp->__anon1.cast.exp;
16064 else if(checkExp->type == 5)
16065 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
16066 else
16067 break;
16068 }
16069 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
16070 exp->thisPtr = thisPtr;
16071 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16072 {
16073 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16074 }
16075 ProcessExpressionType(exp->__anon1.member.exp);
16076 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)
16077 {
16078 exp->isConstant = 0;
16079 }
16080 else
16081 exp->isConstant = exp->__anon1.member.exp->isConstant;
16082 type = exp->__anon1.member.exp->expType;
16083 yylloc = exp->loc;
16084 if(type && (type->kind == 20))
16085 {
16086 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16087 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
16088
16089 if(_class)
16090 {
16091 for(param = _class->templateParams.first; param; param = param->next)
16092 {
16093 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
16094 break;
16095 }
16096 }
16097 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
16098 {
16099 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
16100
16101 if(argExp)
16102 {
16103 struct Expression * expMember = exp->__anon1.member.exp;
16104 struct Declarator * decl;
16105 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16106 char thisClassTypeString[1024];
16107
16108 FreeIdentifier(exp->__anon1.member.member);
16109 ProcessExpressionType(argExp);
16110 {
16111 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16112
16113 if(colon)
16114 {
16115 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16116 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16117 }
16118 else
16119 strcpy(thisClassTypeString, _class->fullName);
16120 }
16121 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16122 exp->expType = ProcessType(specs, decl);
16123 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16124 {
16125 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16126 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16127 int paramCount = 0;
16128 int lastParam = -1;
16129 char templateString[1024];
16130 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16131
16132 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16133 for(cClass = expClass; cClass; cClass = cClass->base)
16134 {
16135 int p = 0;
16136
16137 for(param = cClass->templateParams.first; param; param = param->next)
16138 {
16139 int id = p;
16140 struct __ecereNameSpace__ecere__com__Class * sClass;
16141 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16142
16143 for(sClass = cClass->base; sClass; sClass = sClass->base)
16144 id += sClass->templateParams.count;
16145 arg = expClass->templateArgs[id];
16146 for(sClass = _class; sClass; sClass = sClass->base)
16147 {
16148 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16149 int p = 0;
16150 struct __ecereNameSpace__ecere__com__Class * nextClass;
16151
16152 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16153 p += nextClass->templateParams.count;
16154 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16155 {
16156 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16157 {
16158 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16159 {
16160 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16161 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16162 break;
16163 }
16164 }
16165 }
16166 }
16167 {
16168 char argument[256];
16169
16170 argument[0] = '\0';
16171 switch(param->type)
16172 {
16173 case 2:
16174 {
16175 char expString[1024];
16176 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16177 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16178 struct Expression * exp;
16179 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16180
16181 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16182 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16183 ProcessExpressionType(exp);
16184 ComputeExpression(exp);
16185 expString[0] = '\0';
16186 PrintExpression(exp, expString);
16187 strcat(argument, expString);
16188 FreeExpression(exp);
16189 break;
16190 }
16191 case 1:
16192 {
16193 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16194 break;
16195 }
16196 case 0:
16197 {
16198 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16199 {
16200 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16201 strcat(argument, thisClassTypeString);
16202 else
16203 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16204 }
16205 break;
16206 }
16207 }
16208 if(argument[0])
16209 {
16210 if(paramCount)
16211 strcat(templateString, ", ");
16212 if(lastParam != p - 1)
16213 {
16214 strcat(templateString, param->name);
16215 strcat(templateString, " = ");
16216 }
16217 strcat(templateString, argument);
16218 paramCount++;
16219 lastParam = p;
16220 }
16221 p++;
16222 }
16223 }
16224 }
16225 {
16226 int len = strlen(templateString);
16227
16228 if(templateString[len - 1] == '>')
16229 templateString[len++] = ' ';
16230 templateString[len++] = '>';
16231 templateString[len++] = '\0';
16232 }
16233 {
16234 struct Context * context = SetupTemplatesContext(_class);
16235
16236 FreeType(exp->expType);
16237 exp->expType = ProcessTypeString(templateString, 0);
16238 FinishTemplatesContext(context);
16239 }
16240 }
16241 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
16242 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
16243 exp->type = 5;
16244 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")))))))));
16245 }
16246 }
16247 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16248 {
16249 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16250 }
16251 }
16252 if(type && (type->kind == 20))
16253 ;
16254 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)))
16255 {
16256 struct Identifier * id = exp->__anon1.member.member;
16257 int typeKind = type->kind;
16258 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));
16259
16260 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16261 {
16262 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16263 typeKind = 8;
16264 }
16265 if(id)
16266 {
16267 if(typeKind == 3 || typeKind == 15)
16268 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16269 else if(!_class)
16270 {
16271 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16272 {
16273 _class = type->__anon1._class->__anon1.registered;
16274 }
16275 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16276 {
16277 _class = FindClass("char *")->__anon1.registered;
16278 }
16279 else if(type->kind == 13)
16280 {
16281 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16282 FreeType(exp->expType);
16283 exp->expType = ProcessTypeString("uintptr", 0);
16284 exp->byReference = 1;
16285 }
16286 else
16287 {
16288 char string[1024] = "";
16289 struct Symbol * classSym;
16290
16291 PrintTypeNoConst(type, string, 0, 1);
16292 classSym = FindClass(string);
16293 if(classSym)
16294 _class = classSym->__anon1.registered;
16295 }
16296 }
16297 }
16298 if(_class && id)
16299 {
16300 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16301 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16302 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16303 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16304 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16305
16306 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16307 exp->__anon1.member.memberType = 1;
16308 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16310 if(typeKind != 19)
16311 {
16312 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16313 {
16314 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16315 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16316 {
16317 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16318 if(prop)
16319 member = (((void *)0));
16320 }
16321 if(!member && !prop)
16322 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16323 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16324 exp->__anon1.member.thisPtr = 1;
16325 }
16326 else
16327 {
16328 unsigned int useMemberForNonConst = 0;
16329
16330 if(!id->classSym)
16331 {
16332 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16333 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);
16334 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16335 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16336 }
16337 if((!prop || useMemberForNonConst) && !member)
16338 {
16339 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16340 if(!method)
16341 {
16342 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16343 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);
16344 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16345 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16346 }
16347 }
16348 if(member && prop)
16349 {
16350 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16351 prop = (((void *)0));
16352 else
16353 member = (((void *)0));
16354 }
16355 }
16356 }
16357 if(!prop && !member && !method)
16358 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16359 if(!prop && !member && !method)
16360 {
16361 if(typeKind == 19)
16362 {
16363 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16364 if(classProp)
16365 {
16366 exp->__anon1.member.memberType = 5;
16367 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16368 }
16369 else
16370 {
16371 char structName[1024];
16372 struct Identifier * id = exp->__anon1.member.member;
16373 struct Expression * classExp = exp->__anon1.member.exp;
16374
16375 type->refCount++;
16376 FreeType(classExp->expType);
16377 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16378 strcpy(structName, "__ecereClassData_");
16379 FullClassNameCat(structName, type->__anon1._class->string, 0);
16380 exp->type = 9;
16381 exp->__anon1.member.member = id;
16382 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"))))))));
16383 FreeType(type);
16384 ProcessExpressionType(exp);
16385 return ;
16386 }
16387 }
16388 else
16389 {
16390 struct Symbol * classSym = FindClass(id->string);
16391
16392 if(classSym)
16393 {
16394 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16395
16396 if(convertClass)
16397 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16398 }
16399 }
16400 }
16401 if(exp->__anon1.member.exp->destType)
16402 FreeType(exp->__anon1.member.exp->destType);
16403 {
16404 if(method && !method->_class->symbol)
16405 method->_class->symbol = FindClass(method->_class->fullName);
16406 if(prop && !prop->_class->symbol)
16407 prop->_class->symbol = FindClass(prop->_class->fullName);
16408 exp->__anon1.member.exp->destType = __extension__ ({
16409 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16410
16411 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16412 });
16413 }
16414 if(prop)
16415 {
16416 exp->__anon1.member.memberType = 1;
16417 if(!prop->dataType)
16418 ProcessPropertyType(prop);
16419 exp->expType = prop->dataType;
16420 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16421 {
16422 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16423
16424 CopyTypeInto(type, exp->expType);
16425 type->refCount = 1;
16426 type->constant = 1;
16427 exp->expType = type;
16428 }
16429 else if(prop->dataType)
16430 prop->dataType->refCount++;
16431 }
16432 else if(member)
16433 {
16434 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16435 {
16436 FreeExpContents(exp);
16437 exp->type = 0;
16438 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16439 ProcessExpressionType(exp);
16440 return ;
16441 }
16442 exp->__anon1.member.memberType = 3;
16443 DeclareStruct(_class->fullName, 0);
16444 if(!member->dataType)
16445 {
16446 struct Context * context = SetupTemplatesContext(_class);
16447
16448 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16449 FinishTemplatesContext(context);
16450 }
16451 exp->expType = member->dataType;
16452 if(member->dataType)
16453 member->dataType->refCount++;
16454 }
16455 else if(revConvert)
16456 {
16457 exp->__anon1.member.memberType = 4;
16458 exp->expType = MkClassType(revConvert->_class->fullName);
16459 }
16460 else if(method)
16461 {
16462 {
16463 exp->__anon1.member.memberType = 2;
16464 }
16465 if(!method->dataType)
16466 ProcessMethodType(method);
16467 exp->expType = __extension__ ({
16468 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16469
16470 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16471 });
16472 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16473 exp->expType->__anon1.__anon3.usedClass = _class;
16474 }
16475 else if(!classProp)
16476 {
16477 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16478 {
16479 FreeExpContents(exp);
16480 exp->type = 0;
16481 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16482 FreeType(exp->expType);
16483 exp->expType = MkClassType("ecere::com::Class");
16484 return ;
16485 }
16486 yylloc = exp->__anon1.member.member->loc;
16487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16488 if(inCompiler)
16489 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16490 }
16491 if(_class && exp->expType)
16492 {
16493 struct __ecereNameSpace__ecere__com__Class * tClass;
16494
16495 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16496 while(tClass && !tClass->templateClass)
16497 tClass = tClass->base;
16498 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16499 {
16500 int id = 0;
16501 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16502 struct __ecereNameSpace__ecere__com__Class * sClass;
16503
16504 for(sClass = tClass; sClass; sClass = sClass->base)
16505 {
16506 id = 0;
16507 if(sClass->templateClass)
16508 sClass = sClass->templateClass;
16509 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16510 {
16511 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16512 {
16513 for(sClass = sClass->base; sClass; sClass = sClass->base)
16514 id += sClass->templateParams.count;
16515 break;
16516 }
16517 id++;
16518 }
16519 if(curParam)
16520 break;
16521 }
16522 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16523 {
16524 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16525 struct Context * context = SetupTemplatesContext(tClass);
16526 unsigned int constant = exp->expType->constant;
16527
16528 FreeType(exp->expType);
16529 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16530 if(exp->expType->kind == 8 && constant)
16531 exp->expType->constant = 1;
16532 else if(exp->expType->kind == 13)
16533 {
16534 struct Type * t = exp->expType->__anon1.type;
16535
16536 while(t->kind == 13)
16537 t = t->__anon1.type;
16538 if(constant)
16539 t->constant = constant;
16540 }
16541 if(exp->expType)
16542 {
16543 if(exp->expType->kind == 21)
16544 {
16545 FreeType(exp->expType);
16546 exp->expType = ReplaceThisClassType(_class);
16547 }
16548 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16549 exp->expType->passAsTemplate = 1;
16550 if(!exp->destType)
16551 {
16552 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16553 if(exp->destType->kind == 8 && constant)
16554 exp->destType->constant = 1;
16555 else if(exp->destType->kind == 13)
16556 {
16557 struct Type * t = exp->destType->__anon1.type;
16558
16559 while(t->kind == 13)
16560 t = t->__anon1.type;
16561 if(constant)
16562 t->constant = constant;
16563 }
16564 if(exp->destType->kind == 21)
16565 {
16566 FreeType(exp->destType);
16567 exp->destType = ReplaceThisClassType(_class);
16568 }
16569 }
16570 }
16571 FinishTemplatesContext(context);
16572 }
16573 }
16574 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)
16575 {
16576 int id = 0;
16577 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16578 struct __ecereNameSpace__ecere__com__Class * sClass;
16579
16580 for(sClass = tClass; sClass; sClass = sClass->base)
16581 {
16582 id = 0;
16583 if(sClass->templateClass)
16584 sClass = sClass->templateClass;
16585 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16586 {
16587 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16588 {
16589 for(sClass = sClass->base; sClass; sClass = sClass->base)
16590 id += sClass->templateParams.count;
16591 break;
16592 }
16593 id++;
16594 }
16595 if(curParam)
16596 break;
16597 }
16598 if(curParam)
16599 {
16600 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16601 struct Context * context = SetupTemplatesContext(tClass);
16602 struct Type * basicType;
16603
16604 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16605 if(basicType)
16606 {
16607 if(basicType->kind == 21)
16608 {
16609 FreeType(basicType);
16610 basicType = ReplaceThisClassType(_class);
16611 }
16612 FreeType(exp->expType);
16613 exp->expType = __extension__ ({
16614 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16615
16616 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16617 });
16618 if(!exp->destType)
16619 {
16620 exp->destType = exp->expType;
16621 exp->destType->refCount++;
16622 }
16623 {
16624 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16625 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16626 struct Declarator * decl;
16627
16628 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16629 *newExp = *exp;
16630 if(exp->destType)
16631 exp->destType->refCount++;
16632 if(exp->expType)
16633 exp->expType->refCount++;
16634 exp->type = 11;
16635 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16636 exp->__anon1.cast.exp = newExp;
16637 }
16638 }
16639 FinishTemplatesContext(context);
16640 }
16641 }
16642 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16643 {
16644 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16645
16646 if(expClass)
16647 {
16648 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16649 int p = 0;
16650 int paramCount = 0;
16651 int lastParam = -1;
16652 char templateString[1024];
16653 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16654
16655 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16656 while(cClass != expClass)
16657 {
16658 struct __ecereNameSpace__ecere__com__Class * sClass;
16659
16660 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16661 ;
16662 cClass = sClass;
16663 for(param = cClass->templateParams.first; param; param = param->next)
16664 {
16665 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16666 int cp = 0;
16667 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16668 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16669
16670 while(cClassCur != tClass && !paramCur)
16671 {
16672 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16673
16674 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16675 ;
16676 cClassCur = sClassCur;
16677 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16678 {
16679 if(!strcmp(paramCur->name, param->name))
16680 {
16681 break;
16682 }
16683 cp++;
16684 }
16685 }
16686 if(paramCur && paramCur->type == 0)
16687 arg = tClass->templateArgs[cp];
16688 else
16689 arg = expClass->templateArgs[p];
16690 {
16691 char argument[256];
16692
16693 argument[0] = '\0';
16694 switch(param->type)
16695 {
16696 case 2:
16697 {
16698 char expString[1024];
16699 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16700 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16701 struct Expression * exp;
16702 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16703
16704 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16705 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16706 ProcessExpressionType(exp);
16707 ComputeExpression(exp);
16708 expString[0] = '\0';
16709 PrintExpression(exp, expString);
16710 strcat(argument, expString);
16711 FreeExpression(exp);
16712 break;
16713 }
16714 case 1:
16715 {
16716 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16717 break;
16718 }
16719 case 0:
16720 {
16721 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16722 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16723 break;
16724 }
16725 }
16726 if(argument[0])
16727 {
16728 if(paramCount)
16729 strcat(templateString, ", ");
16730 if(lastParam != p - 1)
16731 {
16732 strcat(templateString, param->name);
16733 strcat(templateString, " = ");
16734 }
16735 strcat(templateString, argument);
16736 paramCount++;
16737 lastParam = p;
16738 }
16739 }
16740 p++;
16741 }
16742 }
16743 {
16744 int len = strlen(templateString);
16745
16746 if(templateString[len - 1] == '>')
16747 templateString[len++] = ' ';
16748 templateString[len++] = '>';
16749 templateString[len++] = '\0';
16750 }
16751 FreeType(exp->expType);
16752 {
16753 struct Context * context = SetupTemplatesContext(tClass);
16754
16755 exp->expType = ProcessTypeString(templateString, 0);
16756 FinishTemplatesContext(context);
16757 }
16758 }
16759 }
16760 }
16761 }
16762 else
16763 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)");
16764 }
16765 else if(type && (type->kind == 9 || type->kind == 10))
16766 {
16767 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16768
16769 if(memberType)
16770 {
16771 exp->expType = memberType;
16772 if(memberType)
16773 memberType->refCount++;
16774 }
16775 }
16776 else
16777 {
16778 char expString[10240];
16779
16780 expString[0] = '\0';
16781 if(inCompiler)
16782 {
16783 PrintExpression(exp, expString);
16784 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16785 }
16786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16787 }
16788 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16789 {
16790 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16791 {
16792 struct Identifier * id = exp->__anon1.member.member;
16793 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));
16794
16795 if(_class)
16796 {
16797 FreeType(exp->expType);
16798 exp->expType = ReplaceThisClassType(_class);
16799 }
16800 }
16801 }
16802 yylloc = oldyylloc;
16803 break;
16804 }
16805 case 9:
16806 {
16807 struct Type * destType = exp->destType;
16808
16809 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16810 {
16811 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16812 }
16813 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16814 exp->type = 8;
16815 if(destType)
16816 destType->count++;
16817 ProcessExpressionType(exp);
16818 if(destType)
16819 destType->count--;
16820 break;
16821 }
16822 case 15:
16823 {
16824 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16825
16826 if(classSym && classSym->__anon1.registered)
16827 {
16828 if(classSym->__anon1.registered->type == 5)
16829 {
16830 char name[1024];
16831
16832 name[0] = '\0';
16833 DeclareStruct(classSym->string, 0);
16834 FreeSpecifier(exp->__anon1._class);
16835 exp->type = 10;
16836 FullClassNameCat(name, classSym->string, 0);
16837 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16838 }
16839 else
16840 {
16841 if(classSym->__anon1.registered->fixed)
16842 {
16843 FreeSpecifier(exp->__anon1._class);
16844 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16845 exp->type = 2;
16846 }
16847 else
16848 {
16849 char className[1024];
16850
16851 strcpy(className, "__ecereClass_");
16852 FullClassNameCat(className, classSym->string, 1);
16853 DeclareClass(classSym, className);
16854 FreeExpContents(exp);
16855 exp->type = 9;
16856 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16857 exp->__anon1.member.member = MkIdentifier("structSize");
16858 }
16859 }
16860 }
16861 exp->expType = __extension__ ({
16862 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16863
16864 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16865 });
16866 break;
16867 }
16868 case 10:
16869 {
16870 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16871
16872 exp->expType = __extension__ ({
16873 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16874
16875 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16876 });
16877 exp->isConstant = 1;
16878 DeclareType(type, 0, 0);
16879 FreeType(type);
16880 break;
16881 }
16882 case 11:
16883 {
16884 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16885
16886 type->count = 1;
16887 FreeType(exp->__anon1.cast.exp->destType);
16888 exp->__anon1.cast.exp->destType = type;
16889 type->refCount++;
16890 type->casted = 1;
16891 ProcessExpressionType(exp->__anon1.cast.exp);
16892 type->casted = 0;
16893 type->count = 0;
16894 exp->expType = type;
16895 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16896 {
16897 void * prev = exp->prev, * next = exp->next;
16898 struct Type * expType = exp->__anon1.cast.exp->destType;
16899 struct Expression * castExp = exp->__anon1.cast.exp;
16900 struct Type * destType = exp->destType;
16901
16902 if(expType)
16903 expType->refCount++;
16904 FreeType(exp->expType);
16905 FreeTypeName(exp->__anon1.cast.typeName);
16906 *exp = *castExp;
16907 FreeType(exp->expType);
16908 FreeType(exp->destType);
16909 exp->expType = expType;
16910 exp->destType = destType;
16911 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16912 exp->prev = prev;
16913 exp->next = next;
16914 }
16915 else
16916 {
16917 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16918 }
16919 break;
16920 }
16921 case 33:
16922 {
16923 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16924
16925 exp->expType = type;
16926 break;
16927 }
16928 case 34:
16929 {
16930 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16931
16932 ProcessExpressionType(exp->__anon1.vaArg.exp);
16933 exp->expType = type;
16934 break;
16935 }
16936 case 12:
16937 {
16938 struct Expression * e;
16939 struct Type * t = exp->destType;
16940
16941 if(t && !exp->destType->casted)
16942 {
16943 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16944 CopyTypeInto(t, exp->destType);
16945 t->count = 0;
16946 }
16947 else if(t)
16948 t->refCount++;
16949 exp->isConstant = 1;
16950 FreeType(exp->__anon1.cond.cond->destType);
16951 exp->__anon1.cond.cond->destType = MkClassType("bool");
16952 exp->__anon1.cond.cond->destType->truth = 1;
16953 ProcessExpressionType(exp->__anon1.cond.cond);
16954 if(!exp->__anon1.cond.cond->isConstant)
16955 exp->isConstant = 0;
16956 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16957 {
16958 if(!e->next)
16959 {
16960 FreeType(e->destType);
16961 e->destType = t;
16962 if(e->destType)
16963 e->destType->refCount++;
16964 }
16965 ProcessExpressionType(e);
16966 if(!e->next)
16967 {
16968 exp->expType = e->expType;
16969 if(e->expType)
16970 e->expType->refCount++;
16971 }
16972 if(!e->isConstant)
16973 exp->isConstant = 0;
16974 }
16975 FreeType(exp->__anon1.cond.elseExp->destType);
16976 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
16977 if(exp->__anon1.cond.elseExp->destType)
16978 exp->__anon1.cond.elseExp->destType->refCount++;
16979 ProcessExpressionType(exp->__anon1.cond.elseExp);
16980 if(!exp->__anon1.cond.elseExp->isConstant)
16981 exp->isConstant = 0;
16982 FreeType(t);
16983 break;
16984 }
16985 case 23:
16986 {
16987 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16988 {
16989 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16990
16991 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16992 {
16993 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16994 if(exp->destType)
16995 exp->destType->refCount++;
16996 }
16997 ProcessStatement(exp->__anon1.compound);
16998 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16999 if(exp->expType)
17000 exp->expType->refCount++;
17001 }
17002 break;
17003 }
17004 case 24:
17005 {
17006 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
17007
17008 if(spec && spec->type == 1)
17009 {
17010 exp->expType = MkClassType(spec->__anon1.__anon1.name);
17011 exp->expType->kind = 19;
17012 exp->byReference = 1;
17013 }
17014 else
17015 {
17016 exp->expType = MkClassType("ecere::com::Class");
17017 exp->byReference = 1;
17018 }
17019 break;
17020 }
17021 case 25:
17022 {
17023 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17024
17025 if(_class)
17026 {
17027 struct Identifier * id = exp->__anon1.classData.id;
17028 char structName[1024];
17029 struct Expression * classExp;
17030
17031 strcpy(structName, "__ecereClassData_");
17032 FullClassNameCat(structName, _class->fullName, 0);
17033 exp->type = 9;
17034 exp->__anon1.member.member = id;
17035 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
17036 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
17037 else
17038 classExp = MkExpIdentifier(MkIdentifier("class"));
17039 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"))))))));
17040 ProcessExpressionType(exp);
17041 return ;
17042 }
17043 break;
17044 }
17045 case 35:
17046 {
17047 struct Type * type = (((void *)0));
17048 const char * typeString = (((void *)0));
17049 char typeStringBuf[1024];
17050
17051 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))
17052 {
17053 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
17054
17055 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17056 }
17057 else if(exp->__anon1.list)
17058 {
17059 struct Expression * e;
17060
17061 for(e = (*exp->__anon1.list).first; e; e = e->next)
17062 {
17063 ProcessExpressionType(e);
17064 if(e->expType)
17065 {
17066 if(!type)
17067 {
17068 type = e->expType;
17069 type->refCount++;
17070 }
17071 else
17072 {
17073 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17074 {
17075 FreeType(type);
17076 type = e->expType;
17077 e->expType = (((void *)0));
17078 e = (*exp->__anon1.list).first;
17079 ProcessExpressionType(e);
17080 if(e->expType)
17081 {
17082 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17083 {
17084 FreeType(e->expType);
17085 e->expType = (((void *)0));
17086 FreeType(type);
17087 type = (((void *)0));
17088 break;
17089 }
17090 }
17091 }
17092 }
17093 if(e->expType)
17094 {
17095 FreeType(e->expType);
17096 e->expType = (((void *)0));
17097 }
17098 }
17099 }
17100 if(type)
17101 {
17102 typeStringBuf[0] = '\0';
17103 PrintTypeNoConst(type, typeStringBuf, 0, 1);
17104 typeString = typeStringBuf;
17105 FreeType(type);
17106 type = (((void *)0));
17107 }
17108 }
17109 if(typeString)
17110 {
17111 char templateString[1024];
17112 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17113 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
17114 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17115 struct Expression * expExt;
17116 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17117
17118 sprintf(templateString, "Container<%s>", typeString);
17119 if(exp->__anon1.list)
17120 {
17121 struct Expression * e;
17122
17123 type = ProcessTypeString(typeString, 0);
17124 while((e = (*exp->__anon1.list).first))
17125 {
17126 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17127 e->destType = type;
17128 type->refCount++;
17129 ProcessExpressionType(e);
17130 ListAdd(initializers, MkInitializerAssignment(e));
17131 }
17132 FreeType(type);
17133 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17134 }
17135 DeclareStruct("ecere::com::BuiltInContainer", 0);
17136 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17137 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17138 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17139 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17140 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17141 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17142 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17143 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17144 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17145 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17146
17147 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
17148 })));
17149 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17150 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
17151 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17152 exp->expType = ProcessTypeString(templateString, 0);
17153 exp->type = 5;
17154 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17155 ProcessExpressionType(expExt);
17156 }
17157 else
17158 {
17159 exp->expType = ProcessTypeString("Container", 0);
17160 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17161 }
17162 break;
17163 }
17164 }
17165 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17166 {
17167 FreeType(exp->expType);
17168 exp->expType = ReplaceThisClassType(thisClass);
17169 }
17170 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)
17171 {
17172 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17173
17174 if(symbol)
17175 {
17176 if(exp->expType->kind != 15)
17177 {
17178 struct Type * member;
17179 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17180
17181 FreeType(exp->expType);
17182 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17183 exp->expType->kind = symbol->type->kind;
17184 exp->expType->refCount++;
17185 exp->expType->__anon1.__anon1.enumName = enumName;
17186 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17187 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17188 member->refCount++;
17189 }
17190 else
17191 {
17192 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17193
17194 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17195 {
17196 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17197
17198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17199 }
17200 }
17201 }
17202 }
17203 yylloc = exp->loc;
17204 if(exp->destType && (exp->destType->kind == 18))
17205 ;
17206 else if(exp->destType && !exp->destType->keepCast)
17207 {
17208 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17209 exp->needTemplateCast = 1;
17210 if(exp->destType->kind == 0)
17211 ;
17212 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17213 {
17214 unsigned int invalidCast = 0;
17215
17216 if(inCompiler && exp->destType->count && exp->expType)
17217 {
17218 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
17219 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
17220
17221 if(c1 && c1->type != 1)
17222 c1 = (((void *)0));
17223 if(c2 && c2->type != 1)
17224 c2 = (((void *)0));
17225 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
17226 invalidCast = 1;
17227 }
17228 if(!exp->destType->count || unresolved || invalidCast)
17229 {
17230 if(!exp->expType)
17231 {
17232 yylloc = exp->loc;
17233 if(exp->destType->kind != 14)
17234 {
17235 char type2[1024];
17236
17237 type2[0] = '\0';
17238 if(inCompiler)
17239 {
17240 char expString[10240];
17241
17242 expString[0] = '\0';
17243 PrintType(exp->destType, type2, 0, 1);
17244 if(inCompiler)
17245 {
17246 PrintExpression(exp, expString);
17247 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17248 }
17249 if(unresolved)
17250 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17251 else if(exp->type != 16)
17252 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17253 }
17254 }
17255 else
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 if(unresolved)
17266 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17267 else if(exp->type != 16)
17268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17269 }
17270 }
17271 else
17272 {
17273 char type1[1024];
17274 char type2[1024];
17275
17276 type1[0] = '\0';
17277 type2[0] = '\0';
17278 if(inCompiler)
17279 {
17280 PrintType(exp->expType, type1, 0, 1);
17281 PrintType(exp->destType, type2, 0, 1);
17282 }
17283 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)))
17284 ;
17285 else
17286 {
17287 char expString[10240];
17288
17289 expString[0] = '\0';
17290 if(inCompiler)
17291 {
17292 PrintExpression(exp, expString);
17293 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17294 }
17295 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")))
17296 {
17297 if(invalidCast)
17298 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17299 else
17300 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17301 }
17302 if(!inCompiler)
17303 {
17304 FreeType(exp->expType);
17305 exp->destType->refCount++;
17306 exp->expType = exp->destType;
17307 }
17308 }
17309 }
17310 }
17311 }
17312 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))
17313 {
17314 struct Expression * nbExp = GetNonBracketsExp(exp);
17315
17316 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
17317 {
17318 struct Expression * e = MoveExpContents(exp);
17319
17320 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
17321 exp->type = 11;
17322 exp->__anon1.cast.exp->destType = exp->destType;
17323 if(exp->destType)
17324 exp->destType->refCount++;
17325 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
17326 }
17327 }
17328 }
17329 else if(unresolved)
17330 {
17331 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17332 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);
17333 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17334 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17335 }
17336 else if(!exp->expType && exp->type != 16)
17337 {
17338 char expString[10240];
17339
17340 expString[0] = '\0';
17341 if(inCompiler)
17342 {
17343 PrintExpression(exp, expString);
17344 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17345 }
17346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17347 }
17348 if(inCompiler)
17349 ApplyAnyObjectLogic(exp);
17350 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)))
17351 {
17352 exp->byReference = 1;
17353 }
17354 yylloc = oldyylloc;
17355 }
17356
17357 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)
17358 {
17359 if(*curMember)
17360 {
17361 *curMember = (*curMember)->next;
17362 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17363 {
17364 *curMember = subMemberStack[--(*subMemberStackPos)];
17365 *curMember = (*curMember)->next;
17366 }
17367 while((*curMember) && (*curMember)->isProperty)
17368 *curMember = (*curMember)->next;
17369 if(subMemberStackPos)
17370 {
17371 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17372 {
17373 subMemberStack[(*subMemberStackPos)++] = *curMember;
17374 *curMember = (*curMember)->members.first;
17375 while(*curMember && (*curMember)->isProperty)
17376 *curMember = (*curMember)->next;
17377 }
17378 }
17379 }
17380 while(!*curMember)
17381 {
17382 if(!*curMember)
17383 {
17384 if(subMemberStackPos && *subMemberStackPos)
17385 {
17386 *curMember = subMemberStack[--(*subMemberStackPos)];
17387 *curMember = (*curMember)->next;
17388 }
17389 else
17390 {
17391 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17392
17393 if(*curClass == _class)
17394 break;
17395 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17396 ;
17397 *curMember = (*curClass)->membersAndProperties.first;
17398 }
17399 while((*curMember) && (*curMember)->isProperty)
17400 *curMember = (*curMember)->next;
17401 if(subMemberStackPos)
17402 {
17403 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17404 {
17405 subMemberStack[(*subMemberStackPos)++] = *curMember;
17406 *curMember = (*curMember)->members.first;
17407 while(*curMember && (*curMember)->isProperty)
17408 *curMember = (*curMember)->next;
17409 }
17410 }
17411 }
17412 }
17413 }
17414
17415 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17416 {
17417 switch(init->type)
17418 {
17419 case 0:
17420 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17421 {
17422 if(init->__anon1.exp && !init->__anon1.exp->destType)
17423 {
17424 FreeType(init->__anon1.exp->destType);
17425 init->__anon1.exp->destType = type;
17426 if(type)
17427 type->refCount++;
17428 }
17429 if(init->__anon1.exp)
17430 {
17431 ProcessExpressionType(init->__anon1.exp);
17432 init->isConstant = init->__anon1.exp->isConstant;
17433 }
17434 break;
17435 }
17436 else
17437 {
17438 struct Expression * exp = init->__anon1.exp;
17439 struct Instantiation * inst = exp->__anon1.instance;
17440 struct MembersInit * members;
17441
17442 init->type = 1;
17443 init->__anon1.list = MkList();
17444 if(inst->members)
17445 {
17446 for(members = (*inst->members).first; members; members = members->next)
17447 {
17448 if(members->type == 0)
17449 {
17450 struct MemberInit * member;
17451
17452 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17453 {
17454 ListAdd(init->__anon1.list, member->initializer);
17455 member->initializer = (((void *)0));
17456 }
17457 }
17458 }
17459 }
17460 FreeExpression(exp);
17461 }
17462 case 1:
17463 {
17464 struct Initializer * i;
17465 struct Type * initializerType = (((void *)0));
17466 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17467 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17468 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17469 int subMemberStackPos = 0;
17470
17471 if(type && type->kind == 12)
17472 initializerType = Dereference(type);
17473 else if(type && (type->kind == 9 || type->kind == 10))
17474 initializerType = type->__anon1.__anon1.members.first;
17475 for(i = (*init->__anon1.list).first; i; i = i->next)
17476 {
17477 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17478 {
17479 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17480 if(curMember)
17481 {
17482 if(!curMember->dataType)
17483 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17484 initializerType = curMember->dataType;
17485 }
17486 }
17487 ProcessInitializer(i, initializerType);
17488 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17489 initializerType = initializerType->next;
17490 if(!i->isConstant)
17491 init->isConstant = 0;
17492 }
17493 if(type && type->kind == 12)
17494 FreeType(initializerType);
17495 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))
17496 {
17497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17498 }
17499 break;
17500 }
17501 }
17502 }
17503
17504 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17505
17506 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17507
17508 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17509 {
17510 switch(spec->type)
17511 {
17512 case 0:
17513 {
17514 if(spec->__anon1.specifier == THISCLASS)
17515 {
17516 if(thisClass)
17517 {
17518 spec->type = 1;
17519 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17520 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17521 ProcessSpecifier(spec, declareStruct);
17522 }
17523 }
17524 break;
17525 }
17526 case 1:
17527 {
17528 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17529
17530 if(symbol)
17531 DeclareType(symbol->type, 1, 1);
17532 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17533 DeclareStruct(spec->__anon1.__anon1.name, 0);
17534 break;
17535 }
17536 case 2:
17537 {
17538 struct Enumerator * e;
17539
17540 if(spec->__anon1.__anon2.list)
17541 {
17542 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17543 {
17544 if(e->exp)
17545 ProcessExpressionType(e->exp);
17546 }
17547 }
17548 if(inCompiler)
17549 break;
17550 }
17551 case 3:
17552 case 4:
17553 {
17554 if(spec->__anon1.__anon2.definitions)
17555 {
17556 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17557
17558 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17559 }
17560 break;
17561 }
17562 }
17563 }
17564
17565 static void ProcessDeclarator(struct Declarator * decl)
17566 {
17567 switch(decl->type)
17568 {
17569 case 1:
17570 if(decl->__anon1.identifier->classSym)
17571 {
17572 FreeSpecifier(decl->__anon1.identifier->_class);
17573 decl->__anon1.identifier->_class = (((void *)0));
17574 }
17575 break;
17576 case 3:
17577 if(decl->__anon1.array.exp)
17578 ProcessExpressionType(decl->__anon1.array.exp);
17579 case 0:
17580 case 2:
17581 case 4:
17582 case 5:
17583 case 6:
17584 case 7:
17585 if(decl->declarator)
17586 ProcessDeclarator(decl->declarator);
17587 if(decl->type == 4)
17588 {
17589 struct Identifier * id = GetDeclId(decl);
17590
17591 if(id && id->_class)
17592 {
17593 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17594
17595 if(!decl->__anon1.function.parameters)
17596 decl->__anon1.function.parameters = MkList();
17597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17598 id->_class = (((void *)0));
17599 }
17600 if(decl->__anon1.function.parameters)
17601 {
17602 struct TypeName * param;
17603
17604 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17605 {
17606 if(param->qualifiers && (*param->qualifiers).first)
17607 {
17608 struct Specifier * spec = (*param->qualifiers).first;
17609
17610 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17611 {
17612 struct Declarator * d = param->declarator;
17613 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);
17614
17615 if(d->type != 5)
17616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17617 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17618 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17619 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17620 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17621 param = newParam;
17622 }
17623 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17624 {
17625 struct Declarator * d = param->declarator;
17626
17627 FreeList(param->qualifiers, (void *)(FreeSpecifier));
17628 param->qualifiers = MkListOne(MkSpecifier(VOID));
17629 if(d->type != 5)
17630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17631 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17632 }
17633 else if(spec->__anon1.specifier == THISCLASS)
17634 {
17635 if(thisClass)
17636 {
17637 spec->type = 1;
17638 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17639 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17640 ProcessSpecifier(spec, 0);
17641 }
17642 }
17643 }
17644 if(param->declarator)
17645 ProcessDeclarator(param->declarator);
17646 }
17647 }
17648 }
17649 break;
17650 }
17651 }
17652
17653 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17654
17655 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17656
17657 static void ProcessDeclaration(struct Declaration * decl)
17658 {
17659 yylloc = decl->loc;
17660 switch(decl->type)
17661 {
17662 case 1:
17663 {
17664 unsigned int declareStruct = 0;
17665
17666 if(decl->__anon1.__anon1.declarators)
17667 {
17668 struct InitDeclarator * d;
17669
17670 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17671 {
17672 struct Type * type, * subType;
17673
17674 ProcessDeclarator(d->declarator);
17675 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17676 if(d->initializer)
17677 {
17678 ProcessInitializer(d->initializer, type);
17679 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17680 {
17681 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17682 {
17683 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17684
17685 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17686 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17687 if(decl->__anon1.__anon1.specifiers)
17688 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
17689 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
17690 d = (((void *)0));
17691 decl->type = 2;
17692 decl->__anon1.inst = inst;
17693 }
17694 }
17695 }
17696 for(subType = type; subType; )
17697 {
17698 if(subType->kind == 8)
17699 {
17700 declareStruct = 1;
17701 break;
17702 }
17703 else if(subType->kind == 13)
17704 break;
17705 else if(subType->kind == 12)
17706 subType = subType->__anon1.__anon4.arrayType;
17707 else
17708 break;
17709 }
17710 FreeType(type);
17711 if(!d)
17712 break;
17713 }
17714 }
17715 if(decl->__anon1.__anon1.specifiers)
17716 {
17717 struct Specifier * s;
17718
17719 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17720 {
17721 ProcessSpecifier(s, declareStruct);
17722 }
17723 }
17724 break;
17725 }
17726 case 2:
17727 {
17728 ProcessInstantiationType(decl->__anon1.inst);
17729 break;
17730 }
17731 case 0:
17732 {
17733 struct Specifier * spec;
17734 struct Declarator * d;
17735 unsigned int declareStruct = 0;
17736
17737 if(decl->__anon1.__anon1.declarators)
17738 {
17739 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17740 {
17741 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17742 struct Type * subType;
17743
17744 ProcessDeclarator(d);
17745 for(subType = type; subType; )
17746 {
17747 if(subType->kind == 8)
17748 {
17749 declareStruct = 1;
17750 break;
17751 }
17752 else if(subType->kind == 13)
17753 break;
17754 else if(subType->kind == 12)
17755 subType = subType->__anon1.__anon4.arrayType;
17756 else
17757 break;
17758 }
17759 FreeType(type);
17760 }
17761 }
17762 if(decl->__anon1.__anon1.specifiers)
17763 {
17764 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17765 ProcessSpecifier(spec, declareStruct);
17766 }
17767 break;
17768 }
17769 }
17770 }
17771
17772 static struct FunctionDefinition * curFunction;
17773
17774 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17775 {
17776 char propName[1024], propNameM[1024];
17777 char getName[1024], setName[1024];
17778 struct __ecereNameSpace__ecere__sys__OldList * args;
17779
17780 DeclareProperty(prop, setName, getName);
17781 strcpy(propName, "__ecereProp_");
17782 FullClassNameCat(propName, prop->_class->fullName, 0);
17783 strcat(propName, "_");
17784 FullClassNameCat(propName, prop->name, 1);
17785 strcpy(propNameM, "__ecerePropM_");
17786 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17787 strcat(propNameM, "_");
17788 FullClassNameCat(propNameM, prop->name, 1);
17789 if(prop->isWatchable)
17790 {
17791 args = MkList();
17792 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17793 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17794 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17795 args = MkList();
17796 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17797 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17798 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17799 }
17800 {
17801 args = MkList();
17802 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17803 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17804 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17805 args = MkList();
17806 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17807 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17808 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17809 }
17810 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17811 curFunction->propSet->fireWatchersDone = 1;
17812 }
17813
17814 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17815
17816 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17817
17818 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17819
17820 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17821
17822 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17823
17824 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17825
17826 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17827
17828 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17829
17830 static void ProcessStatement(struct Statement * stmt)
17831 {
17832 yylloc = stmt->loc;
17833 switch(stmt->type)
17834 {
17835 case 0:
17836 ProcessStatement(stmt->__anon1.labeled.stmt);
17837 break;
17838 case 1:
17839 if(stmt->__anon1.caseStmt.exp)
17840 {
17841 FreeType(stmt->__anon1.caseStmt.exp->destType);
17842 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17843 if(curSwitchType)
17844 curSwitchType->refCount++;
17845 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17846 ComputeExpression(stmt->__anon1.caseStmt.exp);
17847 }
17848 if(stmt->__anon1.caseStmt.stmt)
17849 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17850 break;
17851 case 2:
17852 {
17853 if(stmt->__anon1.compound.context)
17854 {
17855 struct Declaration * decl;
17856 struct Statement * s;
17857 struct Statement * prevCompound = curCompound;
17858 struct Context * prevContext = curContext;
17859
17860 if(!stmt->__anon1.compound.isSwitch)
17861 curCompound = stmt;
17862 curContext = stmt->__anon1.compound.context;
17863 if(stmt->__anon1.compound.declarations)
17864 {
17865 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17866 ProcessDeclaration(decl);
17867 }
17868 if(stmt->__anon1.compound.statements)
17869 {
17870 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17871 ProcessStatement(s);
17872 }
17873 curContext = prevContext;
17874 curCompound = prevCompound;
17875 }
17876 break;
17877 }
17878 case 3:
17879 {
17880 struct Expression * exp;
17881
17882 if(stmt->__anon1.expressions)
17883 {
17884 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17885 ProcessExpressionType(exp);
17886 }
17887 break;
17888 }
17889 case 4:
17890 {
17891 struct Expression * exp;
17892
17893 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17894 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17895 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17896 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17897 {
17898 ProcessExpressionType(exp);
17899 }
17900 if(stmt->__anon1.ifStmt.stmt)
17901 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17902 if(stmt->__anon1.ifStmt.elseStmt)
17903 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17904 break;
17905 }
17906 case 5:
17907 {
17908 struct Type * oldSwitchType = curSwitchType;
17909
17910 if(stmt->__anon1.switchStmt.exp)
17911 {
17912 struct Expression * exp;
17913
17914 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17915 {
17916 if(!exp->next)
17917 {
17918 ProcessExpressionType(exp);
17919 }
17920 if(!exp->next)
17921 curSwitchType = exp->expType;
17922 }
17923 }
17924 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17925 curSwitchType = oldSwitchType;
17926 break;
17927 }
17928 case 6:
17929 {
17930 if(stmt->__anon1.whileStmt.exp)
17931 {
17932 struct Expression * exp;
17933
17934 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17935 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17936 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17937 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17938 {
17939 ProcessExpressionType(exp);
17940 }
17941 }
17942 if(stmt->__anon1.whileStmt.stmt)
17943 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17944 break;
17945 }
17946 case 7:
17947 {
17948 if(stmt->__anon1.doWhile.exp)
17949 {
17950 struct Expression * exp;
17951
17952 if((*stmt->__anon1.doWhile.exp).last)
17953 {
17954 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17955 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17956 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17957 }
17958 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17959 {
17960 ProcessExpressionType(exp);
17961 }
17962 }
17963 if(stmt->__anon1.doWhile.stmt)
17964 ProcessStatement(stmt->__anon1.doWhile.stmt);
17965 break;
17966 }
17967 case 8:
17968 {
17969 struct Expression * exp;
17970
17971 if(stmt->__anon1.forStmt.init)
17972 ProcessStatement(stmt->__anon1.forStmt.init);
17973 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17974 {
17975 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17976 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17977 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17978 }
17979 if(stmt->__anon1.forStmt.check)
17980 ProcessStatement(stmt->__anon1.forStmt.check);
17981 if(stmt->__anon1.forStmt.increment)
17982 {
17983 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17984 ProcessExpressionType(exp);
17985 }
17986 if(stmt->__anon1.forStmt.stmt)
17987 ProcessStatement(stmt->__anon1.forStmt.stmt);
17988 break;
17989 }
17990 case 18:
17991 {
17992 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17993 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17994 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17995 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17996 char iteratorType[1024];
17997 struct Type * source;
17998 struct Expression * e;
17999 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));
18000 struct Expression * arrayExp;
18001 const char * typeString = (((void *)0));
18002 int builtinCount = 0;
18003
18004 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
18005 {
18006 if(!e->next)
18007 {
18008 FreeType(e->destType);
18009 e->destType = ProcessTypeString("Container", 0);
18010 }
18011 if(!isBuiltin || e->next)
18012 ProcessExpressionType(e);
18013 }
18014 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
18015 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)))
18016 {
18017 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
18018 struct Symbol * symbol;
18019 struct Expression * expIt = (((void *)0));
18020 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
18021 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
18022 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
18023 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
18024
18025 if(inCompiler)
18026 {
18027 stmt->type = 2;
18028 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
18029 stmt->__anon1.compound.context->parent = curContext;
18030 curContext = stmt->__anon1.compound.context;
18031 }
18032 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
18033 {
18034 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
18035
18036 isCustomAVLTree = 1;
18037 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
18038 isMap = 1;
18039 }
18040 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
18041 isArray = 1;
18042 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
18043 {
18044 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
18045
18046 isLinkList = 1;
18047 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
18048 }
18049 if(inCompiler && isArray)
18050 {
18051 struct Declarator * decl;
18052 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18053
18054 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
18055 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18056 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
18057 }
18058 else if(isBuiltin)
18059 {
18060 struct Type * type = (((void *)0));
18061 char typeStringBuf[1024];
18062
18063 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
18064 if(((struct Expression *)(*exp).last)->type == 11)
18065 {
18066 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
18067
18068 if(typeName)
18069 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
18070 }
18071 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)
18072 {
18073 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
18074
18075 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18076 }
18077 else if(arrayExp->__anon1.list)
18078 {
18079 struct Expression * e;
18080
18081 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
18082 {
18083 ProcessExpressionType(e);
18084 if(e->expType)
18085 {
18086 if(!type)
18087 {
18088 type = e->expType;
18089 type->refCount++;
18090 }
18091 else
18092 {
18093 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18094 {
18095 FreeType(type);
18096 type = e->expType;
18097 e->expType = (((void *)0));
18098 e = (*arrayExp->__anon1.list).first;
18099 ProcessExpressionType(e);
18100 if(e->expType)
18101 {
18102 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18103 {
18104 FreeType(e->expType);
18105 e->expType = (((void *)0));
18106 FreeType(type);
18107 type = (((void *)0));
18108 break;
18109 }
18110 }
18111 }
18112 }
18113 if(e->expType)
18114 {
18115 FreeType(e->expType);
18116 e->expType = (((void *)0));
18117 }
18118 }
18119 }
18120 if(type)
18121 {
18122 typeStringBuf[0] = '\0';
18123 PrintType(type, typeStringBuf, 0, 1);
18124 typeString = typeStringBuf;
18125 FreeType(type);
18126 }
18127 }
18128 if(typeString)
18129 {
18130 if(inCompiler)
18131 {
18132 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18133 struct Declarator * decl;
18134 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18135
18136 if(arrayExp->__anon1.list)
18137 {
18138 struct Expression * e;
18139
18140 builtinCount = (*arrayExp->__anon1.list).count;
18141 type = ProcessTypeString(typeString, 0);
18142 while((e = (*arrayExp->__anon1.list).first))
18143 {
18144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
18145 e->destType = type;
18146 type->refCount++;
18147 ProcessExpressionType(e);
18148 if(inCompiler)
18149 ListAdd(initializers, MkInitializerAssignment(e));
18150 }
18151 FreeType(type);
18152 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
18153 }
18154 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
18155 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
18156 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
18157 FreeList(exp, (void *)(FreeExpression));
18158 }
18159 else if(arrayExp->__anon1.list)
18160 {
18161 struct Expression * e;
18162
18163 type = ProcessTypeString(typeString, 0);
18164 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
18165 {
18166 e->destType = type;
18167 type->refCount++;
18168 ProcessExpressionType(e);
18169 }
18170 FreeType(type);
18171 }
18172 }
18173 else
18174 {
18175 arrayExp->expType = ProcessTypeString("Container", 0);
18176 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18177 }
18178 }
18179 else if(inCompiler && isLinkList && !isList)
18180 {
18181 struct Declarator * decl;
18182 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18183
18184 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18185 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18186 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18187 }
18188 else if(inCompiler && _class->templateArgs)
18189 {
18190 if(isMap)
18191 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18192 else
18193 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18194 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)))))))));
18195 }
18196 if(inCompiler)
18197 {
18198 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18199 if(block)
18200 {
18201 switch(block->type)
18202 {
18203 case 2:
18204 if(block->__anon1.compound.context)
18205 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18206 break;
18207 case 4:
18208 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18209 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18210 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18211 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18212 break;
18213 case 5:
18214 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18215 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18216 break;
18217 case 6:
18218 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18219 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18220 break;
18221 case 7:
18222 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18223 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18224 break;
18225 case 8:
18226 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18227 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18228 break;
18229 case 18:
18230 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18231 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18232 break;
18233 }
18234 }
18235 if(filter)
18236 {
18237 block = MkIfStmt(filter, block, (((void *)0)));
18238 }
18239 if(isArray)
18240 {
18241 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));
18242 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18243 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18244 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18245 }
18246 else if(isBuiltin)
18247 {
18248 char count[128];
18249
18250 sprintf(count, "%d", builtinCount);
18251 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));
18252 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18253 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18254 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18255 }
18256 else if(isLinkList && !isList)
18257 {
18258 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18259 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18260
18261 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18262 {
18263 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));
18264 }
18265 else
18266 {
18267 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18268 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18269
18270 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));
18271 }
18272 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18273 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18274 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18275 }
18276 else
18277 {
18278 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18279 }
18280 ProcessExpressionType(expIt);
18281 if((*stmt->__anon1.compound.declarations).first)
18282 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18283 if(symbol)
18284 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18285 ProcessStatement(stmt);
18286 }
18287 else
18288 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
18289 if(inCompiler)
18290 curContext = stmt->__anon1.compound.context->parent;
18291 break;
18292 }
18293 else
18294 {
18295 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18296 }
18297 break;
18298 }
18299 case 9:
18300 break;
18301 case 10:
18302 break;
18303 case 11:
18304 break;
18305 case 12:
18306 {
18307 struct Expression * exp;
18308
18309 if(stmt->__anon1.expressions)
18310 {
18311 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18312 {
18313 if(!exp->next)
18314 {
18315 if(curFunction && !curFunction->type)
18316 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18317 FreeType(exp->destType);
18318 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18319 if(exp->destType)
18320 exp->destType->refCount++;
18321 }
18322 ProcessExpressionType(exp);
18323 }
18324 }
18325 break;
18326 }
18327 case 14:
18328 {
18329 ProcessDeclaration(stmt->__anon1.decl);
18330 break;
18331 }
18332 case 13:
18333 {
18334 struct AsmField * field;
18335
18336 if(stmt->__anon1.asmStmt.inputFields)
18337 {
18338 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18339 if(field->expression)
18340 ProcessExpressionType(field->expression);
18341 }
18342 if(stmt->__anon1.asmStmt.outputFields)
18343 {
18344 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18345 if(field->expression)
18346 ProcessExpressionType(field->expression);
18347 }
18348 if(stmt->__anon1.asmStmt.clobberedFields)
18349 {
18350 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18351 {
18352 if(field->expression)
18353 ProcessExpressionType(field->expression);
18354 }
18355 }
18356 break;
18357 }
18358 case 17:
18359 {
18360 struct PropertyWatch * propWatch;
18361 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18362 struct Expression * object = stmt->__anon1._watch.object;
18363 struct Expression * watcher = stmt->__anon1._watch.watcher;
18364
18365 if(watcher)
18366 ProcessExpressionType(watcher);
18367 if(object)
18368 ProcessExpressionType(object);
18369 if(inCompiler)
18370 {
18371 if(watcher || thisClass)
18372 {
18373 struct External * external = curExternal;
18374 struct Context * context = curContext;
18375
18376 stmt->type = 3;
18377 stmt->__anon1.expressions = MkList();
18378 curExternal = external->prev;
18379 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18380 {
18381 struct ClassFunction * func;
18382 char watcherName[1024];
18383 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;
18384 struct External * createdExternal;
18385 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18386
18387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18388 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18389 if(propWatch->deleteWatch)
18390 strcat(watcherName, "_delete");
18391 else
18392 {
18393 struct Identifier * propID;
18394
18395 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18396 {
18397 strcat(watcherName, "_");
18398 strcat(watcherName, propID->string);
18399 }
18400 }
18401 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18402 {
18403 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)));
18404 ProcessClassFunctionBody(func, propWatch->compound);
18405 propWatch->compound = (((void *)0));
18406 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18407 createdExternal->symbol->idCode = external->symbol->idCode;
18408 curExternal = createdExternal;
18409 ProcessFunction(createdExternal->__anon1.function);
18410 {
18411 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18412
18413 externalDecl->__anon1.declaration = decl;
18414 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18415 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18416 }
18417 if(propWatch->deleteWatch)
18418 {
18419 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18420
18421 ListAdd(args, CopyExpression(object));
18422 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18423 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18424 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18425 }
18426 else
18427 {
18428 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18429 struct Identifier * propID;
18430
18431 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18432 {
18433 char propName[1024];
18434 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18435
18436 if(prop)
18437 {
18438 char getName[1024], setName[1024];
18439 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18440
18441 DeclareProperty(prop, setName, getName);
18442 strcpy(propName, "__ecereProp_");
18443 FullClassNameCat(propName, prop->_class->fullName, 0);
18444 strcat(propName, "_");
18445 FullClassNameCat(propName, prop->name, 1);
18446 ListAdd(args, CopyExpression(object));
18447 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18448 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18449 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
18450 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18451 }
18452 else
18453 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18454 }
18455 }
18456 }
18457 else
18458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18459 }
18460 curExternal = external;
18461 curContext = context;
18462 if(watcher)
18463 FreeExpression(watcher);
18464 if(object)
18465 FreeExpression(object);
18466 FreeList(watches, (void *)(FreePropertyWatch));
18467 }
18468 else
18469 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18470 }
18471 else
18472 {
18473 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18474 {
18475 ProcessStatement(propWatch->compound);
18476 }
18477 }
18478 break;
18479 }
18480 case 15:
18481 {
18482 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18483 struct Expression * object = stmt->__anon1._watch.object;
18484 struct __ecereNameSpace__ecere__com__Class * _class;
18485
18486 if(object)
18487 ProcessExpressionType(object);
18488 if(inCompiler)
18489 {
18490 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18491 if(_class)
18492 {
18493 struct Identifier * propID;
18494
18495 stmt->type = 3;
18496 stmt->__anon1.expressions = MkList();
18497 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18498 {
18499 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18500 }
18501 else if(!watches)
18502 {
18503 }
18504 if(watches)
18505 {
18506 for(propID = (*watches).first; propID; propID = propID->next)
18507 {
18508 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18509
18510 if(prop)
18511 {
18512 CreateFireWatcher(prop, object, stmt);
18513 }
18514 else
18515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18516 }
18517 }
18518 else
18519 {
18520 struct __ecereNameSpace__ecere__com__Property * prop;
18521 struct __ecereNameSpace__ecere__com__Class * base;
18522
18523 for(base = _class; base; base = base->base)
18524 {
18525 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18526 {
18527 if(prop->isProperty && prop->isWatchable)
18528 {
18529 CreateFireWatcher(prop, object, stmt);
18530 }
18531 }
18532 }
18533 }
18534 if(object)
18535 FreeExpression(object);
18536 FreeList(watches, (void *)(FreeIdentifier));
18537 }
18538 else
18539 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18540 }
18541 break;
18542 }
18543 case 16:
18544 {
18545 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18546 struct Expression * object = stmt->__anon1._watch.object;
18547 struct Expression * watcher = stmt->__anon1._watch.watcher;
18548 struct __ecereNameSpace__ecere__com__Class * _class;
18549
18550 if(object)
18551 ProcessExpressionType(object);
18552 if(watcher)
18553 ProcessExpressionType(watcher);
18554 if(inCompiler)
18555 {
18556 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18557 if(watcher || thisClass)
18558 {
18559 if(_class)
18560 {
18561 struct Identifier * propID;
18562
18563 stmt->type = 3;
18564 stmt->__anon1.expressions = MkList();
18565 if(!watches)
18566 {
18567 struct __ecereNameSpace__ecere__sys__OldList * args;
18568
18569 args = MkList();
18570 ListAdd(args, CopyExpression(object));
18571 ListAdd(args, MkExpConstant("0"));
18572 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18573 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18574 }
18575 else
18576 {
18577 for(propID = (*watches).first; propID; propID = propID->next)
18578 {
18579 char propName[1024];
18580 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18581
18582 if(prop)
18583 {
18584 char getName[1024], setName[1024];
18585 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18586
18587 DeclareProperty(prop, setName, getName);
18588 strcpy(propName, "__ecereProp_");
18589 FullClassNameCat(propName, prop->_class->fullName, 0);
18590 strcat(propName, "_");
18591 FullClassNameCat(propName, prop->name, 1);
18592 ListAdd(args, CopyExpression(object));
18593 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18594 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18595 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18596 }
18597 else
18598 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18599 }
18600 }
18601 if(object)
18602 FreeExpression(object);
18603 if(watcher)
18604 FreeExpression(watcher);
18605 FreeList(watches, (void *)(FreeIdentifier));
18606 }
18607 else
18608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18609 }
18610 else
18611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18612 }
18613 break;
18614 }
18615 }
18616 }
18617
18618 extern struct Expression * QBrackets(struct Expression * exp);
18619
18620 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18621
18622 extern struct Declarator * QMkPtrDecl(const char *  id);
18623
18624 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18625
18626 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18627
18628 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18629
18630 static void ProcessFunction(struct FunctionDefinition * function)
18631 {
18632 struct Identifier * id = GetDeclId(function->declarator);
18633 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18634 struct Type * type = symbol ? symbol->type : (((void *)0));
18635 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18636 struct Context * oldTopContext = topContext;
18637
18638 yylloc = function->loc;
18639 if(type && type->__anon1.__anon2.thisClass)
18640 {
18641 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18642 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18643 char className[1024];
18644 char structName[1024];
18645 struct Declarator * funcDecl;
18646 struct Symbol * thisSymbol;
18647 unsigned int typedObject = 0;
18648
18649 if(_class && !_class->base)
18650 {
18651 _class = currentClass;
18652 if(_class && !_class->symbol)
18653 _class->symbol = FindClass(_class->fullName);
18654 classSym = _class ? _class->symbol : (((void *)0));
18655 typedObject = 1;
18656 }
18657 thisClass = _class;
18658 if(inCompiler && _class)
18659 {
18660 if(type->kind == 11)
18661 {
18662 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18663 {
18664 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18665
18666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18667 FreeType(param);
18668 }
18669 if(type->classObjectType != 1)
18670 {
18671 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18672 symbol->type->__anon1.__anon2.staticMethod = 1;
18673 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18674 symbol->type->extraParam = 0;
18675 }
18676 }
18677 strcpy(className, "__ecereClass_");
18678 FullClassNameCat(className, _class->fullName, 1);
18679 structName[0] = (char)0;
18680 FullClassNameCat(structName, _class->fullName, 0);
18681 funcDecl = GetFuncDecl(function->declarator);
18682 if(funcDecl)
18683 {
18684 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18685 {
18686 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18687
18688 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18689 {
18690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18691 FreeTypeName(param);
18692 }
18693 }
18694 if(!function->propertyNoThis)
18695 {
18696 struct TypeName * thisParam = (((void *)0));
18697
18698 if(type->classObjectType != 1)
18699 {
18700 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18701 if(!funcDecl->__anon1.function.parameters)
18702 funcDecl->__anon1.function.parameters = MkList();
18703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18704 }
18705 if(typedObject)
18706 {
18707 if(type->classObjectType != 1)
18708 {
18709 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18710 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18711 }
18712 thisParam = __extension__ ({
18713 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18714
18715 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18716 });
18717 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18718 }
18719 }
18720 }
18721 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18722 {
18723 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18724
18725 funcDecl = GetFuncDecl(initDecl->declarator);
18726 if(funcDecl)
18727 {
18728 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18729 {
18730 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18731
18732 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18733 {
18734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18735 FreeTypeName(param);
18736 }
18737 }
18738 if(type->classObjectType != 1)
18739 {
18740 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18741 {
18742 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18743
18744 if(!funcDecl->__anon1.function.parameters)
18745 funcDecl->__anon1.function.parameters = MkList();
18746 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18747 }
18748 }
18749 }
18750 }
18751 }
18752 if(function->body)
18753 {
18754 if(type->classObjectType != 1)
18755 {
18756 thisSymbol = __extension__ ({
18757 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18758
18759 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18760 });
18761 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18762 if(typedObject && thisSymbol->type)
18763 {
18764 thisSymbol->type->classObjectType = 2;
18765 thisSymbol->type->byReference = type->byReference;
18766 thisSymbol->type->typedByReference = type->byReference;
18767 }
18768 }
18769 }
18770 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18771 {
18772 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18773
18774 {
18775 struct __ecereNameSpace__ecere__com__Class * base;
18776
18777 for(base = _class; base && base->type != 1000; base = base->next)
18778 {
18779 for(member = base->membersAndProperties.first; member; member = member->next)
18780 if(!member->isProperty)
18781 break;
18782 if(member)
18783 break;
18784 }
18785 }
18786 for(member = _class->membersAndProperties.first; member; member = member->next)
18787 if(!member->isProperty)
18788 break;
18789 if(member)
18790 {
18791 char pointerName[1024];
18792 struct Declaration * decl;
18793 struct Initializer * initializer;
18794 struct Expression * exp, * bytePtr;
18795
18796 strcpy(pointerName, "__ecerePointer_");
18797 FullClassNameCat(pointerName, _class->fullName, 0);
18798 {
18799 char className[1024];
18800
18801 strcpy(className, "__ecereClass_");
18802 FullClassNameCat(className, classSym->string, 1);
18803 DeclareClass(classSym, className);
18804 }
18805 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18806 if(_class->fixed)
18807 {
18808 char string[256];
18809
18810 sprintf(string, "%d", _class->offset);
18811 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18812 }
18813 else
18814 {
18815 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18816 }
18817 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18818 exp->expType = __extension__ ({
18819 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18820
18821 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18822 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18823
18824 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18825 }), __ecereInstance2;
18826 });
18827 if(function->body)
18828 {
18829 yylloc = function->body->loc;
18830 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18831 {
18832 struct Context * prevContext = curContext;
18833 struct __ecereNameSpace__ecere__sys__OldList * list;
18834
18835 curContext = function->body->__anon1.compound.context;
18836 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18837 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18838 curContext = prevContext;
18839 }
18840 decl->symbol = (((void *)0));
18841 if(!function->body->__anon1.compound.declarations)
18842 function->body->__anon1.compound.declarations = MkList();
18843 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18844 }
18845 }
18846 }
18847 }
18848 else
18849 thisClass = (((void *)0));
18850 if(id)
18851 {
18852 FreeSpecifier(id->_class);
18853 id->_class = (((void *)0));
18854 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18855 {
18856 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18857
18858 id = GetDeclId(initDecl->declarator);
18859 FreeSpecifier(id->_class);
18860 id->_class = (((void *)0));
18861 }
18862 }
18863 if(function->body)
18864 topContext = function->body->__anon1.compound.context;
18865 {
18866 struct FunctionDefinition * oldFunction = curFunction;
18867
18868 curFunction = function;
18869 if(function->body)
18870 ProcessStatement(function->body);
18871 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18872 {
18873 struct Statement * prevCompound = curCompound;
18874 struct Context * prevContext = curContext;
18875 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18876
18877 if(!function->body->__anon1.compound.statements)
18878 function->body->__anon1.compound.statements = MkList();
18879 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18880 curCompound = function->body;
18881 curContext = function->body->__anon1.compound.context;
18882 ProcessStatement(fireWatchers);
18883 curContext = prevContext;
18884 curCompound = prevCompound;
18885 }
18886 curFunction = oldFunction;
18887 }
18888 if(function->declarator)
18889 {
18890 ProcessDeclarator(function->declarator);
18891 }
18892 topContext = oldTopContext;
18893 thisClass = oldThisClass;
18894 }
18895
18896 extern void FreeSymbol(struct Symbol * symbol);
18897
18898 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18899
18900 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18901 {
18902 struct ClassDef * def;
18903 struct External * external = curExternal;
18904 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18905
18906 for(def = definitions->first; def; def = def->next)
18907 {
18908 if(def->type == 0)
18909 {
18910 if(def->__anon1.function->declarator)
18911 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18912 else
18913 curExternal = external;
18914 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18915 }
18916 else if(def->type == 2)
18917 {
18918 if(def->__anon1.decl->type == 2)
18919 {
18920 thisClass = regClass;
18921 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18922 thisClass = (((void *)0));
18923 }
18924 else
18925 {
18926 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18927
18928 if(regClass)
18929 thisClass = regClass;
18930 ProcessDeclaration(def->__anon1.decl);
18931 thisClass = backThisClass;
18932 }
18933 }
18934 else if(def->type == 1 && def->__anon1.defProperties)
18935 {
18936 struct MemberInit * defProperty;
18937 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);
18938
18939 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18940 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18941 {
18942 thisClass = regClass;
18943 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18944 thisClass = (((void *)0));
18945 }
18946 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18947 FreeSymbol(thisSymbol);
18948 }
18949 else if(def->type == 3 && def->__anon1.propertyDef)
18950 {
18951 struct PropertyDef * prop = def->__anon1.propertyDef;
18952
18953 thisClass = regClass;
18954 if(prop->setStmt)
18955 {
18956 if(regClass)
18957 {
18958 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18959
18960 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18961 }
18962 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18963 ProcessStatement(prop->setStmt);
18964 }
18965 if(prop->getStmt)
18966 {
18967 if(regClass)
18968 {
18969 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18970
18971 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18972 }
18973 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18974 ProcessStatement(prop->getStmt);
18975 }
18976 if(prop->issetStmt)
18977 {
18978 if(regClass)
18979 {
18980 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18981
18982 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18983 }
18984 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18985 ProcessStatement(prop->issetStmt);
18986 }
18987 thisClass = (((void *)0));
18988 }
18989 else if(def->type == 4 && def->__anon1.propertyWatch)
18990 {
18991 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18992
18993 thisClass = regClass;
18994 if(propertyWatch->compound)
18995 {
18996 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);
18997
18998 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18999 curExternal = (((void *)0));
19000 ProcessStatement(propertyWatch->compound);
19001 }
19002 thisClass = (((void *)0));
19003 }
19004 }
19005 }
19006
19007 void DeclareFunctionUtil(const char * s)
19008 {
19009 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
19010
19011 if(function)
19012 {
19013 char name[1024];
19014
19015 name[0] = (char)0;
19016 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
19017 strcpy(name, "__ecereFunction_");
19018 FullClassNameCat(name, s, 0);
19019 DeclareFunction(function, name);
19020 }
19021 }
19022
19023 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
19024
19025 extern unsigned int memoryGuard;
19026
19027 void ComputeDataTypes()
19028 {
19029 struct External * external;
19030 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
19031 struct External * after = (((void *)0));
19032
19033 currentClass = (((void *)0));
19034 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
19035 for(external = (*ast).first; external; external = external->next)
19036 {
19037 if(external->type == 1)
19038 {
19039 struct Declaration * decl = external->__anon1.declaration;
19040
19041 if(decl)
19042 {
19043 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
19044
19045 if(decls)
19046 {
19047 struct InitDeclarator * initDecl = (*decls).first;
19048
19049 if(initDecl)
19050 {
19051 struct Declarator * declarator = initDecl->declarator;
19052
19053 if(declarator && declarator->type == 1)
19054 {
19055 struct Identifier * id = declarator->__anon1.identifier;
19056
19057 if(id && id->string)
19058 {
19059 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
19060 {
19061 external->symbol->id = -1001, external->symbol->idCode = -1001;
19062 after = external;
19063 }
19064 }
19065 }
19066 }
19067 }
19068 }
19069 }
19070 }
19071 {
19072 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
19073
19074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
19075 after = e;
19076 }
19077 temp->symbol = __extension__ ({
19078 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19079
19080 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
19081 });
19082 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
19083 curExternal = temp;
19084 DeclareFunctionUtil("eSystem_New");
19085 DeclareFunctionUtil("eSystem_New0");
19086 DeclareFunctionUtil("eSystem_Renew");
19087 DeclareFunctionUtil("eSystem_Renew0");
19088 DeclareFunctionUtil("eSystem_Delete");
19089 DeclareFunctionUtil("eClass_GetProperty");
19090 DeclareFunctionUtil("eClass_SetProperty");
19091 DeclareFunctionUtil("eInstance_FireSelfWatchers");
19092 DeclareFunctionUtil("eInstance_SetMethod");
19093 DeclareFunctionUtil("eInstance_IncRef");
19094 DeclareFunctionUtil("eInstance_StopWatching");
19095 DeclareFunctionUtil("eInstance_Watch");
19096 DeclareFunctionUtil("eInstance_FireWatchers");
19097 if(memoryGuard)
19098 {
19099 DeclareFunctionUtil("MemoryGuard_PushLoc");
19100 DeclareFunctionUtil("MemoryGuard_PopLoc");
19101 }
19102 DeclareStruct("ecere::com::Class", 0);
19103 DeclareStruct("ecere::com::Instance", 0);
19104 DeclareStruct("ecere::com::Property", 0);
19105 DeclareStruct("ecere::com::DataMember", 0);
19106 DeclareStruct("ecere::com::Method", 0);
19107 DeclareStruct("ecere::com::SerialBuffer", 0);
19108 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
19109 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
19110 for(external = (*ast).first; external; external = external->next)
19111 {
19112 afterExternal = curExternal = external;
19113 if(external->type == 0)
19114 {
19115 currentClass = external->__anon1.function->_class;
19116 ProcessFunction(external->__anon1.function);
19117 }
19118 else if(external->type == 1)
19119 {
19120 currentClass = (((void *)0));
19121 if(external->__anon1.declaration)
19122 ProcessDeclaration(external->__anon1.declaration);
19123 }
19124 else if(external->type == 2)
19125 {
19126 struct ClassDefinition * _class = external->__anon1._class;
19127
19128 currentClass = external->symbol->__anon1.registered;
19129 if(_class->definitions)
19130 {
19131 ProcessClass(_class->definitions, _class->symbol);
19132 }
19133 if(inCompiler)
19134 {
19135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
19136 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
19137 }
19138 }
19139 else if(external->type == 4)
19140 {
19141 thisNameSpace = external->__anon1.id->string;
19142 }
19143 }
19144 currentClass = (((void *)0));
19145 thisNameSpace = (((void *)0));
19146 curExternal = (((void *)0));
19147 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
19148 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
19149 }
19150
19151 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);
19152
19153 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);
19154
19155 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
19156
19157 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19158 {
19159 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19160
19161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19162 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19163 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19164 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19165 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19166 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19167 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19168 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19169 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19171 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19175 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19176 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19177 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19178 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19179 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19180 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19181 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19185 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19188 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19189 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19190 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19191 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19192 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19194 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19210 __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);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19214 __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);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19227 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19228 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19229 __ecereClass_Conversion = class;
19230 __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);
19231 __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);
19232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19233 __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);
19234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19244 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19247 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19249 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19252 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19255 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19256 }
19257
19258 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19259 {
19260
19261 }
19262